1/*! For license information please see client.min.js.LICENSE.txt */ 2(function(){var __webpack_modules__={4254:function(t,n,e){var i=e(3766)(),r=e(2994);t.exports=function(t,n){function e(n){if(!(this instanceof e))return new e(n);try{throw new Error(n)}catch(n){n.name=t,this.stack=n.stack}i&&this.stack&&(this.stack=r(this.stack,t,n)),this.message=n||"",this.name=t}return e.prototype=new(n||Error),e.prototype.constructor=e,e.prototype.inspect=function(){return this.message?"["+t+": "+this.message+"]":"["+t+"]"},e.prototype.name=t,e}},2994:function(t){"use strict";t.exports=function(t,n,e){var i=n;return e&&(i+=": "+e),t=i+t.slice(t.indexOf("\n"))}},3766:function(t){"use strict";t.exports=function(){var t=new Error("yep");return!!t.stack&&"Error: yep\n"===t.stack.substr(0,11)}},8535:function(t,n,e){t.exports=function(){"use strict";function t(t){return"function"==typeof t||"object"==typeof t&&null!==t}function n(t){return"function"==typeof t}var i=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,o=void 0,a=void 0,u=function(t,n){y[r]=t,y[r+1]=n,2===(r+=2)&&(a?a(w):I())};function c(t){a=t}function s(t){u=t}var f="undefined"!=typeof window?window:void 0,l=f||{},d=l.MutationObserver||l.WebKitMutationObserver,v="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function p(){return function(){return process.nextTick(w)}}function g(){return void 0!==o?function(){o(w)}:_()}function m(){var t=0,n=new d(w),e=document.createTextNode("");return n.observe(e,{characterData:!0}),function(){e.data=t=++t%2}}function b(){var t=new MessageChannel;return t.port1.onmessage=w,function(){return t.port2.postMessage(0)}}function _(){var t=setTimeout;return function(){return t(w,1)}}var y=new Array(1e3);function w(){for(var t=0;t<r;t+=2)(0,y[t])(y[t+1]),y[t]=void 0,y[t+1]=void 0;r=0}function E(){try{var t=e(6694);return o=t.runOnLoop||t.runOnContext,g()}catch(t){return _()}}var I=void 0;function A(t,n){var e=arguments,i=this,r=new this.constructor(O);void 0===r[S]&&Q(r);var o,a=i._state;return a?(o=e[a-1],u((function(){return $(a,r,o,i._result)}))):G(i,r,t,n),r}function T(t){var n=this;if(t&&"object"==typeof t&&t.constructor===n)return t;var e=new n(O);return V(e,t),e}I=v?p():d?m():h?b():void 0===f?E():_();var S=Math.random().toString(36).substring(16);function O(){}var k=void 0,R=1,N=2,C=new H;function D(){return new TypeError("You cannot resolve a promise with itself")}function x(){return new TypeError("A promises callback cannot return that same promise.")}function j(t){try{return t.then}catch(t){return C.error=t,C}}function M(t,n,e,i){try{t.call(n,e,i)}catch(t){return t}}function P(t,n,e){u((function(t){var i=!1,r=M(e,n,(function(e){i||(i=!0,n!==e?V(t,e):z(t,e))}),(function(n){i||(i=!0,F(t,n))}),"Settle: "+(t._label||" unknown promise"));!i&&r&&(i=!0,F(t,r))}),t)}function L(t,n){n._state===R?z(t,n._result):n._state===N?F(t,n._result):G(n,void 0,(function(n){return V(t,n)}),(function(n){return F(t,n)}))}function U(t,e,i){e.constructor===t.constructor&&i===A&&e.constructor.resolve===T?L(t,e):i===C?(F(t,C.error),C.error=null):void 0===i?z(t,e):n(i)?P(t,e,i):z(t,e)}function V(n,e){n===e?F(n,D()):t(e)?U(n,e,j(e)):z(n,e)}function B(t){t._onerror&&t._onerror(t._result),q(t)}function z(t,n){t._state===k&&(t._result=n,t._state=R,0!==t._subscribers.length&&u(q,t))}function F(t,n){t._state===k&&(t._state=N,t._result=n,u(B,t))}function G(t,n,e,i){var r=t._subscribers,o=r.length;t._onerror=null,r[o]=n,r[o+R]=e,r[o+N]=i,0===o&&t._state&&u(q,t)}function q(t){var n=t._subscribers,e=t._state;if(0!==n.length){for(var i=void 0,r=void 0,o=t._result,a=0;a<n.length;a+=3)i=n[a],r=n[a+e],i?$(e,i,r,o):r(o);t._subscribers.length=0}}function H(){this.error=null}var Y=new H;function K(t,n){try{return t(n)}catch(t){return Y.error=t,Y}}function $(t,e,i,r){var o=n(i),a=void 0,u=void 0,c=void 0,s=void 0;if(o){if((a=K(i,r))===Y?(s=!0,u=a.error,a.error=null):c=!0,e===a)return void F(e,x())}else a=r,c=!0;e._state!==k||(o&&c?V(e,a):s?F(e,u):t===R?z(e,a):t===N&&F(e,a))}
vendor: 1,154 bytes, line 2
2function W(t,n){try{n((function(n){V(t,n)}),(function(n){F(t,n)}))}catch(n){F(t,n)}}var X=0;function J(){return X++}function Q(t){t[S]=X++,t._state=void 0,t._result=void 0,t._subscribers=[]}function Z(t,n){this._instanceConstructor=t,this.promise=new t(O),this.promise[S]||Q(this.promise),i(n)?(this._input=n,this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?z(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&z(this.promise,this._result))):F(this.promise,tt())}function tt(){return new Error("Array Methods must be provided an Array")}function nt(t){return new Z(this,t).promise}function et(t){var n=this;return i(t)?new n((function(e,i){for(var r=t.length,o=0;o<r;o++)n.resolve(t[o]).then(e,i)})):new n((function(t,n){return n(new TypeError("You must pass an array to race."))}))}function it(t){var n=new this(O);return F(n,t),n}function rt(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function ot(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object c
2onstructor cannot be called as a function.")}function at(t){this[S]=J(),this._result=this._state=void 0,this._subscribers=[],O!==t&&("function"!=typeof t&&rt(),this instanceof at?W(this,t):ot())}function ut(){var t=void 0;if(void 0!==e.g)t=e.g;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;if(n){var i=null;try{i=Object.prototype.toString.call(n.resolve())}catch(t){}if("[object Promise]"===i&&!n.cast)return}t.Promise=at}return Z.prototype._enumerate=function(){for(var t=this.length,n=this._input,e=0;this._state===k&&e<t;e++)this._eachEntry(n[e],e)},Z.prototype._eachEntry=function(t,n){var e=this._instanceConstructor,i=e.resolve;if(i===T){var r=j(t);if(r===A&&t._state!==k)this._settledAt(t._state,n,t._result);else if("function"!=typeof r)this._remaining--,this._result[n]=t;else if(e===at){var o=new e(O);U(o,t,r),this._willSettleAt(o,n)}else this._willSettleAt(new e((function(n){return n(t)})),n)}else this._willSettleAt(i(t),n)},Z.prototype._settledAt=function(t,n,e){var i=this.promise;i._state===k&&(this._remaining--,t===N?F(i,e):this._result[n]=e),0===this._remaining&&z(i,this._result)},Z.prototype._willSettleAt=function(t,n){var e=this;G(t,void 0,(function(t){return e._settledAt(R,n,t)}),(function(t){return e._settledAt(N,n,t)}))},at.all=nt,at.race=et,at.resolve=T,at.reject=it,at._setScheduler=c,at._setAsap=s,at._asap=u,at.prototype={constructor:at,then:A,catch:function(t){return this.then(null,t)}},at.polyfill=ut,at.Promise=at,at}()},762:function(t){"use strict";t.exports=function(t){var n,e={};if(!(t instanceof Object)||Array.isArray(t))throw new Error("keyMirror(...): Argument must be an object.");for(n in t)t.hasOwnProperty(n)&&(e[n]=n);return e}},2891:function(t){"use strict";t.exports=function(t,n,e,i){Object.defineProperty(t,n,{get:function(){var t=e.call(this);return Object.defineProperty(this,n,{value:t,enumerable:!!i,writable:!0}),t},set:function(t){return Object.defineProperty(this,n,{value:t,enumerable:!!i,writable:!0}),t},enumerable:!!i,configurable:!0})}},4188:function(t){!function(){function n(t,n){var e,i,r,o,a,u,c,s;for(e=3&t.length,i=t.length-e,r=n,a=3432918353,u=461845907,s=0;s<i;)c=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24,++s,r=27492+(65535&(o=5*(65535&(r=(r^=c=(65535&(c=(c=(65535&c)*a+(((c>>>16)*a&65535)<<16)&4294967295)<<15|c>>>17))*u+(((c>>>16)*u&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(c=0,e){case 3:c^=(255&t.charCodeAt(s+2))<<16;case 2:c^=(255&t.charCodeAt(s+1))<<8;case 1:r^=c=(65535&(c=(c=(65535&(c^=255&t.charCodeAt(s)))*a+(((c>>>16)*a&65535)<<16)&4294967295)<<15|c>>>17))*u+(((c>>>16)*u&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}var e=n;e.v2=function(t,n){for(var e,i=t.length,r=n^i,o=0;i>=4;)e=1540483477*(65535&(e=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(e>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(e=1540483477*(65535&(e^=e>>>24))+((1540483477*(e>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:r^=(255&t.charCodeAt(o+2))<<16;case 2:r^=(255&t.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0},e.v3=n,t.exports=e}()},243:function(t,n,e){var i=e(4188).v3,r=Math.pow(2,32),o=function(t,n){return(i(t,n)>>>0)/r};t.exports={Seed:{IGNORING:0,BUCKETING:1,FALLBACK:2,HOLDBACK:3,BEHAVIOR_EVENT:2716770798},hashToHex:function(t,n){var e=i(t,n);return(e>>>16).toString(16)+(65535&e).toString(16)},hashToInt:function(t,n,e){return Math.floor(o(t,n)*e)},hashToReal:o,toByteString:function(t){var n=String.fromCharCode;return t.replace(/[\S\s]/gi,(function(t){t=t.charCodeAt(0);var e=n(255&t);return t>255&&(e=n(t>>>8&255)+e),t>65535&&(e=n(t>>>16)+e),e}))}}},2030:function(t,n,e){var i=e(279).pick,r=e(3221).get("stores/audience_data"),o=e(6210),a=e(3659),u=e(5355),c=e(7702);function s(t){var n=["type","selector","attributes","value"],e=Object.assign({},t);return e.changeSet=t.changeSet.map((function(t){return i(c.dereferenceChangeId(t),n)})),e}n.emitLayerDecided=function(t){var n=(t.decisionTicket?t.decisionTicket.audienceIds:[]).map((function(t){return{id:t,name:r.get(t).name}})),e={type:a.TYPES.LIFECYCLE,name:"layerDecided",data:Object.assign(t,{audiences:n})},i=c.translateLayerEventToCampaignEvent(e);
2o.emit(e),o.emit(i)},n.emitViewActivated=function(t){var n={type:a.TYPES.LIFECYCLE,name:"viewActivated",data:t},e=c.translateViewActivatedToPageActivated(n);o.emit(n),o.emit(e)},n.emitViewsActivated=function(t){var n={type:a.TYPES.LIFECYCLE,name:"viewsActivated",data:t};o.emit(n)},n.emitPageDeactivated=function(t){var n={type:a.TYPES.LIFECYCLE,name:"pageDeactivated",data:t};o.emit(n)},n.emitActivateEvent=function(){o.emit({type:a.TYPES.LIFECYCLE,name:"activate"},!0)},n.emitActivatedEvent=function(){o.emit({type:a.TYPES.LIFECYCLE,name:"activated"})},n.emitInitializedEvent=function(){var t={type:a.TYPES.LIFECYCLE,name:"initialized"};window.optimizely&&(window.optimizely.initialized=!0),o.emit(t)},n.emitOriginsSyncedEvent=function(){var t={type:a.TYPES.LIFECYCLE,name:"originsSynced"};o.emit(t)},n.emitActionAppliedEvent=function(t){var n={type:t.type,campaignId:t.layerId,pageId:t.pageId,experimentId:t.experimentId,variationId:t.variationId};u.defineProperty(n,"changes",(function(){return s(t).changeSet}),"actionAppliedEvent");var e={type:a.TYPES.ACTION,name:"applied",data:n};o.emit(e)},n.emitActionsForDecisionAppliedEvent=function(t,n){var e={decision:t};u.defineProperty(e,"actions",(function(){return n.map(s)}),"appliedAllForDecisionEvent");var i={type:a.TYPES.ACTION,name:"appliedAllForDecision",data:e};o.emit(i)},n.emitSendEvents=function(){var t={type:a.TYPES.ANALYTICS,name:"sendEvents"};o.emit(t)},n.emitMaybeSendEvents=function(){var t={type:a.TYPES.ANALYTICS,name:"maybeSendEvents"};o.emit(t)},n.emitHoldEvents=function(){var t={type:a.TYPES.ANALYTICS,name:"holdEvents"};o.emit(t)}},6320:function(t,n,e){Object.defineProperty(n,"u",{value:!0});var i=e(279),r=i.cloneDeep,o=i.isEqual,a=i.mapValues,u=i.pick,c=i.pickBy,s=e(6555),f=e(5355),l=e(7702),d=e(1386),v=e(2060);function h(t,n,e,i){var r=t.getLayerState(i),o=n.get(i),a=e.get();if(!r||!o)return a?{layer:{name:a.layerName,id:a.layerId,policy:a.layerPolicy,integrationStringVersion:a.integrationStringVersion},experiment:{name:a.experimentName,id:a.experimentId},variation:{name:a.variationName,id:a.variationId},isLayerHoldback:!1}:null;if(d.isSingleExperimentPolicy(o.policy)&&r.decision.isLayerHoldback)return null;var u,c,s=r.decision.experimentId,f=r.decision.variationId;return s&&f&&(u=o.experiments.find((function(t){return t.id===s})))&&(c=u.variations.find((function(t){return t.id===f})))?{layer:{name:o.name,id:o.id,policy:o.policy,integrationStringVersion:o.integrationStringVersion},experiment:{name:u.name,id:u.id},variation:{name:c.name,id:c.id},isLayerHoldback:r.decision.isLayerHoldback}:null}function p(t,n,e,i,r,a,c){var s=[],f=t.getLayerStates();c.onlySingleExperiments&&(f=f.filter((function(t){var e=n.get(t.layerId);return e&&d.isSingleExperimentPolicy(e.policy)})));var l=e.getActiveViewIds(),h=f.map((function(t){var e,i=!!t.decision.variationId,o=t.decisionActivationId&&t.decisionActivationId===r.getActivationId(),a=v.getExperimentAndVariation(),u=a?a.variationId:null,c=i&&t.decision.variationId===u,s=((null==(e=n.get(null==t?void 0:t.layerId))?void 0:e.viewIds)||[]).every((function(t){return!l.includes(t)}));return Object.assign(t,{isActive:i&&o&&!s||c,visitorRedirected:c})}));return(a?"function"==typeof a?h.filter(a):h.filter((function(t){return Object.keys(a).every((function(n){return o(t[n],a[n])}))})):h).forEach((function(t){var e=function(t,n,e,i){var r,o,a=t.layerId,c=n.get(a)||{},s=(c.experiments||[]).map((function(t){return u(t,["id","name"])}));if(!i&&c.decisionMetadata&&c.decisionMetadata.offerConsistency)return;var f={id:a,campaignName:c.name||null,experiment:null,audiences:[],allExperiments:s,variation:null,reason:t.decision.reason,isActive:!!t.isActive,visitorRedirected:t.visitorRedirected,isInCampaignHoldback:t.decision.isLayerHoldback};t.decision&&t.decision.experimentId&&(r=(c.experiments||[]).find((function(n){return n.id===t.decision.experimentId}))),r&&(f.experiment=u(r,["id","name","campaignName"])),r&&t.decision.variationId&&(o=r.variations.find((function(n){return n.id===t.decision.variationId}))),o&&(f.variation=u(o,["id","name"]));var l=(t.decisionTicket.audienceIds||[]).map((function(t){return u(e.get(t),["id","name"])}));return f.audiences=l,c.decisionMetadata&&c.decisionMetadata.offerConsistency&&(f.pageId=t.pageId),f}(t,n,i,c.includeOfferConsistency);e&&s.push(e)})),s}
2n.data=["stores/audience_data","stores/client_metadata","stores/event_data","stores/layer_data","stores/view_data","stores/group_data","stores/interest_group","stores/tag_group","stores/global",function(t,n,e,i,r,o,a,u,c){var s={},d={},v={},h={audiences:t.getAudiencesMap(),events:e.getEventsMap(),campaigns:s,pages:r.getPagesMap(),experiments:d,variations:v,projectId:c.getProjectId(),snippetId:c.getSnippetId(),accountId:c.getAccountId(),dcpServiceId:c.getDCPServiceId(),revision:c.getRevision(),clientName:n.getClientName(),clientVersion:n.getClientVersion()},p=l.dereferenceChangeId;return i.getAll().forEach((function(t){f.defineProperty(s,t.id,(function(){var n=Object.assign({},t);return f.defineProperty(n,"changes",(function(){return(t.changes||[]).map(p)}),"campaign"),f.defineProperty(n,"experiments",(function(){return(t.experiments||[]).map((function(t){return d[t.id]}))}),"campaign"),n}),"campaignMap","byId"),(t.experiments||[]).forEach((function(t){f.defineProperty(d,t.id,(function(){var n=Object.assign({},t);return f.defineProperty(n,"changes",(function(){return(t.changes||[]).map(p)}),"experiment"),f.defineProperty(n,"variations",(function(){return(t.variations||[]).map((function(t){return v[t.id]}))}),"experiment"),n}),"experimentMap","byId"),(t.variations||[]).forEach((function(t){f.defineProperty(v,t.id,(function(){var n=Object.assign({},t);return f.defineProperty(n,"actions",(function(){return(t.actions||[]).map((function(t){return Object.assign({},t,{changes:(t.changes||[]).map(p)})}))}),"variation"),n}),"variationMap","byId")}))}))})),h.groups=o.getGroupsMap(),h}],n.visitor=["stores/visitor",function(t){return r(t.getVisitorProfile())}],n.visitor_id=["stores/visitor_id",function(t){return{randomId:t.getRandomId()}}],n.state=["stores/audience_data","stores/layer_data","stores/layer","stores/view_data","stores/view","stores/global","stores/observed_redirect",function(t,n,i,r,o,f,l){return{getTrafficExclusionStats:function(){return e(5296).getStats()},getCampaignStates:function(e){var r={};return p(i,n,o,t,f,e,{includeOfferConsistency:!1}).forEach((function(t){r[t.id]=t})),r},getExperimentStates:function(e){var r=p(i,n,o,t,f,e,{includeOfferConsistency:!1,onlySingleExperiments:!0}),a=["audiences","variation","reason","visitorRedirected","isActive"];return r.reduce((function(t,n){var e=n.allExperiments[0];return t[e.id]=Object.assign({},u(n,a),{id:e.id,experimentName:e.name,isInExperimentHoldback:n.isInCampaignHoldback}),t}),{})},getCampaignStateLists:function(e){var r={};return p(i,n,o,t,f,e,{includeOfferConsistency:!0}).forEach((function(t){var n=t.id;r[n]||(r[n]=[]),r[n].push(t)})),r},getPageStates:function(t){var n=o.getAll(),e=Object.keys(n).reduce((function(t,e){var i=n[e],o=r.get(i.id);return t[i.id]=Object.assign({},u(o,["id","name","apiName","category","staticConditions","tags"]),u(i,["isActive","metadata"])),t[i.id].isActive=!!t[i.id].isActive,t}),{});return t?c(e,t):e},isGlobalHoldback:function(){return f.isGlobalHoldback()},getActivationId:function(){return f.getActivationId()},getVariationMap:function(){var t=i.getLayerStates(),e={};return t.forEach((function(t){var i=n.get(t.layerId);if(t.decision&&t.decision.experimentId&&(e[t.decision.experimentId]={id:t.decision.variationId,name:null,index:null},i)){var r=(i.experiments||[]).find((function(n){return n.id===t.decision.experimentId}));if(r&&t.decision.variationId)var o=r.variations.find((function(n){return n.id===t.decision.variationId})),a=r.variations.findIndex((function(n){return n.id===t.decision.variationId}));o&&(e[t.decision.experimentId]={id:t.decision.variationId,name:o.name,index:a})}})),e},getActiveExperimentIds:function(){var t={},n=this.getCampaignStateLists({isActive:!0});return Object.keys(n).forEach((function(e){n[e].forEach((function(n){t[n.experiment.id]=!0}))})),Object.keys(t)},getRedirectInfo:function(){var t=v.getExperimentAndVariation();return t&&(t.referrer=v.getReferrer()),t}
2,getDecisionString:function(t){if(!t)throw new Error("Must pass a config to getDecisionString");t=Object.assign({maxLength:255,shouldCleanString:!1},t);var e=h(i,n,l,t.campaignId);return e?s.generateAnalyticsString(e.layer,e.experiment,e.variation,e.isLayerHoldback,t.maxLength,t.shouldCleanString):null},getDecisionObject:function(t){if(!t)throw new Error("Must pass a config to getDecisionObject");t=Object.assign({maxLength:255,shouldCleanString:!1},t);var e=h(i,n,l,t.campaignId);if(!e)return null;var r=s.formatNamesAndIdsForAnalytics(e.layer,e.experiment,e.variation,t.shouldCleanString),o=a(r.names,(function(n,e){return s.combineAndTruncateIdAndName(n,r.idStrings[e],t.maxLength)})),u={experiment:o.experiment,variation:o.variation};return d.isSingleExperimentPolicy(e.layer.policy)||Object.assign(u,{campaign:o.layer,holdback:e.isLayerHoldback}),u}}}],n.utils=e(6139).create(),n.jquery=["env/jquery",function(t){return t}],n.event_emitter=e(879)},2945:function(t,n,e){var i=e(3496),r=e(3898),o="optimizelyDataApi";n.registerFunction=function(t,n){var e=r.getGlobal(o);e||(e={},r.setGlobal(o,e)),e[t]||(e[t]=n)},n.unregisterFunction=function(t){var n=r.getGlobal(o);n&&n[t]&&(n[t]=function(){i.log('Ignoring attempt to call "'+o+"."+t+'" which has been unregistered.')})},n.getFunction=function(t){return r.getGlobal(o)[t]}},5205:function(t,n,e){var i=e(279).isObject,r=e(3496),o=e(6320),a=e(3221),u=a.get("stores/plugins"),c=e(1756),s=e(2044),f=e(3941),l=[e(5502),e(8008),e(8457)],d=["clientMetadata","cookieDomain","disable","load","optOut","rum"];n.push=function(t,n){var e,o,a,u;if(!Array.isArray(t)&&i(t))u=void 0!==t.version?t.version:1,e=t.type,a=[t];else if(Array.isArray(t))u=0,e=t[0],a=t.slice(1);else{if("string"!=typeof t)return r.warn("API / Ignoring non-array/object/string argument:",t),!1;u=0,e=t,a=[]}if(l[u]&&(o=l[u][e]),n&&-1===d.indexOf(e))return r.debug("API / Ignoring non high priority function:",e,a),!1;if(!o)return r.warn('API / No function found for "'+e+'" (v'+u+") with arguments:",a),!1;r.log('API / Executing: "'+e,'" with arguments:',a);try{o.apply(null,a),f.dispatch(c.RECORD_API_USAGE,{methodName:u?"v"+u+"."+e:e})}catch(t){r.error(t)}return!0},n.get=function(t){r.log('API / Getting module: "'+t+'"');var n=o[t];if(n?Array.isArray(n)&&(n=a.evaluate(n)):n=u.getPlugin(s.PluginTypes.apiModules,t),n)return f.dispatch(c.RECORD_API_USAGE,{methodName:"get."+t}),n;r.warn('Module "'+t+'" not found.')}},5355:function(t,n,e){var i=e(2891),r=e(1756),o=e(3941),a=e(3496);n.defineProperty=function(t,n,e,u,c){i(t,n,(function(){var t=["prop",u,c||n].join(".");return a.debug('Evaluating getter: "'+t+'"'),o.dispatch(r.RECORD_API_USAGE,{methodName:t}),e()}),!0)}},5502:function(t,n,e){var i=e(8008);function r(t){var n,e={};if(t)if(o(t))n=Number(t);else{if("object"!=typeof t)throw new Error("tracker: Revenue argument "+t+"not a number.");if("revenue"in(e=Object.assign({},t))){if(!o(e.revenue))throw new Error("tracker: Revenue value "+e.revenue+"not a number.");n=Number(e.revenue),delete e.revenue}}return void 0!==n&&(e.revenue=n),e}function o(t){return"number"==typeof t||"string"==typeof t&&!isNaN(Number(t))&&Number(t).toString()==t}n.activateGeoDelayedExperiments=function(t,n){n||(n=t.lists?"odds":"cdn3"),i.dataFromSource({data:t,source:n})},n.activateSiteCatalyst=function(t){t&&t.sVariable&&i.integrationSettings({id:"adobe_analytics",settings:{sVariableReference:t.sVariable}})},n.bucketVisitor=function(t,n){if(t&&n){var e={experimentId:String(t)};n>256?e.variationId=String(n):e.variationIndex=String(n),i.bucketVisitor(e)}},n.bucketUser=n.bucketVisitor,n.disable=function(t){i.disable({scope:t})},n.log=function(t){void 0===t&&(t=!0),i.log({level:t?"INFO":"OFF"})},n.optOut=function(t){void 0===t&&(t=!0),i.optOut({isOptOut:t})},n.setCookieDomain=function(t){i.cookieDomain({cookieDomain:t})},n.setCookieExpiration=function(t){i.cookieExpiration({cookieExpirationDays:t})},n.setDimensionValue=function(t,n){var e={};e[t]=n,i.user({attributes:e})},n.setUserId=function(t){i.user({userId:t})},n.setGA4UserId=function(t){i.ga4User({ga4UserId:t})},n.storeThirdPartyData=function(t,n){i.dataFromSource({source:t,data:n})},n.trackEvent=function(t,n){i.event({eventName:t,tags:r(n)})}}
2,7702:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.omit,a=e(3221),u=e(1423),c=e(5355),s=a.get("stores/change_data");n.translateDecisionToCampaignDecision=function(t){return f(r(t),{layerId:"campaignId",isLayerHoldback:"isCampaignHoldback"})},n.translateLayerEventToCampaignEvent=function(t){var e={};return c.defineProperty(e,"campaign",(function(){return function(t){var e=r(t);return e.changes&&(e.changes=e.changes.map(n.dereferenceChangeId)),e.experiments&&e.experiments.forEach((function(t){t.changes&&(t.changes=t.changes.map(n.dereferenceChangeId)),t.variations&&t.variations.forEach((function(t){t.actions&&t.actions.forEach((function(t){t.changes&&(t.changes=t.changes.map(n.dereferenceChangeId))}))}))})),e}(t.data.layer)}),"campaignEvent"),e.decisionTicket=t.data.decisionTicket,e.decision=this.translateDecisionToCampaignDecision(t.data.decision),e.audiences=t.data.audiences,{type:"lifecycle",name:"campaignDecided",data:e}},n.translateViewActivatedToPageActivated=function(t){return{type:"lifecycle",name:"pageActivated",data:{page:t.data.view}}},n.dereferenceChangeId=function(t){var n=s.getChange(t);return n?u.safeReference(n):t};var f=function(t,n){var e=o(t,Object.keys(n));return Object.keys(n).forEach((function(i){var r=n[i];e[r]=t[i]})),e}},6139:function(t,n,e){var i=e(3341).Promise,r=e(2760).o,o=e(1906).F,a=e(2884).M,u=e(4541).poll,c=e(2322).x,s=e(4258).a;n.create=function(){return{observeSelector:r,onUrlChange:o,persistHtml:a,poll:u,Promise:i,waitForElement:c,waitUntil:s}}},1415:function(t){t.exports={DEFAULT_INTERVAL:20}},2760:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.isObject,a=(e(1756),e(3221)),u=a.get("stores/directive"),c=e(9751),s=e(4462),f=(e(2044),e(3941),e(167).generate),l=e(4541),d=e(3898),v=(a.get("stores/rum"),{once:!1,onTimeout:null,timeout:null}),h={},p=function(t){p=function(){if(!u.shouldObserveChangesIndefinitely())return function(t){var n=l.poll(m.bind(null,t));h[t].cancelObservation=function(){n(),delete h[t]}};var t,n=function(){t.disconnect(),Object.keys(h).forEach(m),t.observe(i,e)},e={attributes:!0,childList:!0,subtree:!0},i=c.getDocumentElement();return t=s.create(n),function(n){var o=h[n];t.observe(i,e),o.cancelObservation=function(){delete h[n],r(h)&&t.disconnect()}}}(),p(t)};function g(t){var n=h[t];n&&n.cancelObservation&&n.cancelObservation()}function m(t){if(h[t]){if(function(t){var n=t.options.timeout;if(null!==n)if("function"==typeof n)try{return n()}catch(t){}else if(Date.now()-t.startTime>n)return!0;return!1}(h[t]))return 0===h[t].matchedCount&&"function"==typeof h[t].options.onT
2imeout&&h[t].options.onTimeout(),void g(t);var n=c.querySelectorAll(h[t].selector);n.length&&(n.forEach((function(n){n.l&&n.l[t]||h[t].callbackQueue.push(n)})),function(t){for(;h[t]&&h[t].callbackQueue.length;){var n=h[t].callbackQueue.shift();if(b(n,t),h[t].matchedCount=h[t].matchedCount+1,h[t].callback(n),h[t]&&h[t].options.once)return void g(t)}}(t))}}function b(t,n){t.l||(t.l={}),t.l[n]=!0}n.o=function(t,n,e){if(!function(t){try{c.querySelector(t)}catch(t){return!1}return!0}(t))throw new Error("observeSelector expects a valid css selector as its first argument");if("function"!=typeof n)throw new Error("observeSelector expects a function as its second argument");if(e&&(!o(e)||"function"==typeof e))throw new Error("observeSelector expects an object as its third argument");var i=f();return e=Object.assign({},v,e||{}),h[i]={callback:n,callbackQueue:[],matchedCount:0,options:e,selector:t,startTime:Date.now()},p(i),d.setTimeout(m.bind(null,i),0),g.bind(null,i)}},1906:function(t,n,e){var i=e(167).generate,r=e(3898),o={},a=!1,u=null,c=null,s=null,f=null;function l(){a&&(window.history.pushState===s&&(window.history.pushState=u),window.history.replaceState===f&&(window.history.replaceState=c),u=null,c=null,s=null,f=null,a=!1)}function d(){var t=r.getHref();Object.keys(o).forEach((function(n){var e=o[n];e&&e(t)}))}n.F=function(t){var n=i(),e=0===Object.keys(o).length;return o[n]=t,e&&(r.addEventListener("popstate",d),r.addEventListener("hashchange",d),a||(u=window.history.pushState,c=window.history.replaceState,window.history.pushState=function(t,n,e){u.apply(window.history,arguments),d()},s=window.history.pushState,window.history.replaceState=function(t,n,e){c.apply(window.history,arguments),d()},f=window.history.replaceState,a=!0)),function(){!function(t){delete o[t],0===Object.keys(o).length&&(r.removeEventListener("popstate",d),r.removeEventListener("hashchange",d),l())}(n)}}},2884:function(t,n,e){var i=e(9751),r=e(167).generate,o=e(4462),a={before:"beforebegin",after:"afterend",first_child:"afterbegin",last_child:"beforeend"},u=Object.keys(a),c=[];function s(t,n,e){var i,r,o=[];if("beforebegin"===n)for(i=t.previousSibling,r=0;r<e&&i;r++)o.unshift(i),i=i.previousSibling;else if("afterend"===n)for(i=t.nextSibling,r=0;r<e&&i;r++)o.push(i),i=i.nextSibling;else if("afterbegin"===n)for(i=t.firstChild,r=0;r<e&&i;r++)o.push(i),i=i.nextSibling;else if("beforeend"===n)for(i=t.lastChild,r=0;r<e&&i;r++)o.unshift(i),i=i.previousSibling;return o}function f(t){return document.documentElement.contains(t)}n.M=function(t,n,e){if("string"!=typeof t||!t)throw new Error("persistHtml: html must be a non-empty string");if(!function(t){try{i.querySelector(t)}catch(t){return!1}return!0}(n))throw new Error("persistHtml: invalid CSS selector: "+n);if(e=null!=e?e:"before",-1===u.indexOf(e))throw new Error("persistHtml: placement must be one of: "+u.join(", "));var l=a[e],d=i.querySelector(n);if(!d)throw new Error('persistHtml: no element found for selector "'+n+'"');if(("beforebegin"===l||"afterend"===l)&&!d.parentElement)throw new Error('persistHtml: placement "'+e+'" requires the anchor element to have a parent');var v=function(t){var n=document.createElement("div");return n.innerHTML=t,n.childNodes.length}(t);if(0===v)throw new Error("persistHtml: html produces no DOM nodes");var h=function(t){var n=document.createElement("div");n.innerHTML=t;var e=[];return Array.prototype.forEach.call(n.childNodes,(function(t){if(t.nodeType===Node.ELEMENT_NODE){var n=r();e.push(n),t.setAttribute("data-optly-persist-id",n)}})),{taggedHtml:n.innerHTML,ids:e}}(t);d.insertAdjacentHTML(l,h.taggedHtml);var p,g=s(d,l,v),m=!1,b={childList:!0,subtree:!0},_=i.getDocumentElement();function y(){if(!m){m=!0,p.disconnect();var t=c.indexOf(y);-1!==t&&c.splice(t,1),g.forEach((function(t){f(t)&&t.parentNode&&t.parentNode.removeChild(t)}))}}return(p=o.create((function(){if(!m&&g.some((function(t){return!f(t)}))){var t=i.querySelector(n);!t||("beforebegin"===l||"afterend"===l)&&!t.parentElement||(p.disconnect(),g.forEach((function(t){f(t)&&t.parentNode&&t.parentNode.removeChild(t)})),m||(t.insertAdjacentHTML(l,h.taggedHtml),g=s(t,l,v)),m||p.observe(_,b))}}))).observe(_,b),c.push(y),y}},4541:function(t,n,e){e(1756);var i=e(3221),r=(e(2044),e(3941),e(167).generate),o=e(3898),a=e(1415).DEFAULT_INTERVAL,u=(i.get("stores/rum"),{});
2function c(t){u[t]&&Object.keys(u[t].callbacks).forEach((function(n){u[t].callbacks[n].call(null)}))}function s(t,n){u[n]&&u[n].callbacks[t]&&(delete u[n].callbacks[t],0===Object.keys(u[n].callbacks).length&&(clearInterval(u[n].id),delete u[n]))}n.poll=function(t,n){"number"!=typeof n&&(n=a),u[n]||(u[n]={callbacks:{},id:o.setInterval(c.bind(null,n),n)});var e=r();return u[n].callbacks[e]=t,s.bind(null,e,n)},n.cancelAll=function(){Object.keys(u).forEach((function(t){var n=u[t];clearInterval(n.id),delete u[t]}))}},2322:function(t,n,e){var i=e(3341).Promise,r=e(2760).o;n.x=function(t){return new i((function(n,e){r(t,n,{once:!0})}))}},4258:function(t,n,e){var i=e(3341).Promise,r=e(4541).poll;n.a=function(t){return new i((function(n,e){if(t())n();else var i=r((function(){t()&&(i(),n())}))}))}},8008:function(t,n,e){var i=e(279).omit,r=e(1756),o=e(5205),a=e(6320),u=e(9663),c=e(2044),s=e(6967),f=e(2030),l=e(8548),d=e(9726).v,v=e(6310),h=e(7946),p=(e(8813),e(295)),g=e(6210),m=e(3941),b=e(6388),_=e(2902),y=e(4143),w=e(3496),E=e(5213),I=(e(5442),e(3432)),A=e(7649),T=e(3221),S=T.get("stores/dimension_data"),O=T.get("stores/view"),k=T.get("stores/view_data"),R=T.get("stores/visitor_id"),N=T.get("stores/layer_data"),C=T.get("stores/directive"),D=n.ApiListenerError=d("ApiListenerError");n.event=function(t){var n;switch(t.eventType){case"click":n=function(t){var n;return t.eventData&&(n=p.create(t.eventData.id,t.eventData.apiName,"click",t.eventData)),function(){var t=s.trackClickEvent(n);t?w.log("API / Tracking click event:",t):w.log("API / Not tracking click event:",t)}}(t);break;case"decision":n=function(t){var n=t.eventData,e=_.createLayerState(n.layerId,n.experimentId,n.variationId,n.isLayerHoldback,n.isLayerConcluded),i=_.createSingle(n.layerId,n.experimentId,n.variationId);return function(){_.recordLayerDecision(e.layerId,e.decisionTicket,e.decision),w.log("API / Tracking decision event:",e),s.trackDecisionEvent(e.decision,e.decisionTicket,i)}}(t);break;case"pageview":n=function(t){var n=I.create(t.eventData.id,t.eventData.apiName),e=I.createState(n.id);return function(){var t=s.trackViewActivation(n,e);t?w.log("API / Tracking pageview event:",t):w.log("API / Not tracking pageview event:",t)}}(t);break;default:n=function(t){var n;return t.eventId&&(n=p.create(t.eventId,t.eventName,"custom")),I.updateAllViewTags(),function(){s.trackCustomEvent(t.eventName,t.tags,n,t.properties)?w.log("API / Tracking custom event:",t.eventName,t.tags):w.log("API / Not tracking custom event:",t.eventName)}}(t)}R.getBucketingId()?n():m.dispatch(r.ADD_CLEANUP_FN,{lifecycle:c.Lifecycle.postActivate,cleanupFn:n})},n.clientMetadata=function(t){0},n.priorRedirectString=function(t){},n.microsnippetError=function(t){},n.rum=function(t){m.dispatch(r.SET_RUM_DATA,t.eventData)},n.initialViewStates=function(t){var n=Object.keys(t.states||{}).map((function(n){return{id:n,isActive:t.states[n]}}));I.registerViews(n)},n.page=function(t){var n=k.getByApiName(t.pageName);if(!n)throw new Error('Unknown page "'+t.pageName+'"');var e=!t.hasOwnProperty("isActive")||t.isActive,i=function(){e?I.activateViaAPI(n,t.tags):(I.deactivate(n),w.log("API / Deactivated Page",I.description(n)))};R.getBucketingId()?i():m.dispatch(r.ADD_CLEANUP_FN,{lifecycle:c.Lifecycle.postViewsActivated,cleanupFn:i})},n.tags=function(t){I.setGlobalTags(t.tags)},n.user=function(t){w.log("API / Setting visitor custom attributes:",t.attributes),Object.keys(t.attributes||{}).forEach((function(n){var e,i,r=t.attributes[n],o=n,a=S.getById(n)||S.getByApiName(n);a&&(o=a.id,e=a.apiName,i=a.segmentId||a.id);var u={id:i,value:r};e&&(u.name=e),x(o,u,!0)}))},n.ga4User=function(t){t.ga4UserId?(w.log("API / Setting ga4 user id in the global store:",t.ga4UserId),m.dispatch(r.SET_GA4_USER_ID,t)):w.error('API / Argument "ga4UserId" is missing')};var x=function(t,n,e){var i=[{key:e?["custom",t]:[t],value:n,metadata:{lastModified:v.now()}}],o=function(){m.dispatch(r.SET_VISITOR_ATTRIBUTES,{attributes:i})};R.getBucketingId()?o():m.dispatch(r.ADD_CLEANUP_FN,{lifecycle:c.Lifecycle.postVisitorProfileLoad,cleanupFn:o})};n.optOut=function(t){var n=!t.hasOwnProperty("isOptOut")||t.isOptOut;h.setOptOut(n)},n.cookieExpiration=function(t){var n=t.cookieExpirationDays;n<90&&(w.error('Argument "cookieExpirationDays"=',n,"less than minimum days:",90,", setting to minimum."),n=90),w.log("API / Setting cookie age to",n,"days."),m.dispatch(r.SET_COOKIE_AGE,86400*n)},n.extendCookieLifetime=function(t){t=Object.assign({isEnabled:!0},t),w.log("API / Setting cookie automatic lifetime extension to",t.isEnabled),m.dispatch(r.SET_COOKIE_AUTO_REFRESH,t.isEnabled)},n.cookieDomain=function(t){w.log("API / Setting cookie domain to",t.cookieDomain),m.dispatch(r.SET_COOKIE_DOMAIN,t.cookieDomain)},n.disable=function(t){if(t.scope){if("tracking"!==t.scope)throw new Error('Unknown "scope" for disable: '+t.scope);w.log("API / Disabling tracking"),m.dispatch(r.LOAD_DIRECTIVE,{trackingDisabled:!0})}else w.log("API / Disabling everything"),m.dispatch(r.LOAD_DIRECTIVE,{disabled:!0})},n.log=function(t){var n=t.level,e=t.match;void 0===n&&(n="INFO"),void 0===e&&(e=""),w.setLogMatcher(e),w.setLogLevel(n)},n.registerModule=function(t){var n="custom/"+t.moduleName;if(a[n]||o.get(n))throw new Error('Module name "'+n+'" is reserved. Will not be registered as plugin.');E.registerApiModule(n,t.module)},n.dataFromSource=function(t){var n=t.source;l.makeAsyncRequest(n),l.resolveRequest(n,t.data)},n.addListener=function(t){if("function"!=typeof t.handler)throw new Error("A handler function must be supplied");(t=i(t,["type"])).publicOnly=!0,t.emitErrors=!0;var n=t.handler;t.handler=function(t){try{return n(t)}catch(t){throw new D(t)}},g.on(t)}
2,n.removeListener=function(t){if(!t.token)throw new Error("Must supply a token to removeListener");g.off(t.token)},n.load=function(t){t.data=Object.assign({},t.data),u.normalizeClientData(t.data),m.dispatch(r.DATA_LOADED,{data:t.data})},n.integrationSettings=function(t){if(!t.id)throw new Error("id is required");if(!t.settings)throw new Error("settings is required");m.dispatch(r.SET_INTEGRATION_SETTINGS,Object.assign({},t.settings,{id:t.id}))},n.loadEmbeddedEditor=function(){document.getElementById("optimizely-visual-editor-root")?w.warn("API / Visual editor is already loaded."):y.loadEmbeddedEditor("https://app.optimizely.com/dist/visual-editor/main.js")},n.bucketVisitor=function(t){if(!t.variationId&&void 0===t.variationIndex||t.variationId&&t.variationIndex)throw new Error("One of a variationId or a variationIndex is required.");if(!t.experimentId)throw new Error("An experimentId is required.");var n,e,i=t.campaignId;if(i){if(!(n=N.get(i)))throw new Error("Could not find layer "+i)}else if(!(i=(n=N.getLayerByExperimentId(t.experimentId)).id))throw new Error("Could not find layer for experiment "+t.experimentId);if(!(e=n.experiments.find((function(n){return n.id===t.experimentId}))))throw new Error("Could not find experiment "+t.experimentId+" in layer "+i);var r=t.variationId;if(void 0!==t.variationIndex){if(!(r=e.variations[t.variationIndex].id))throw new Error("Could not find variation at index "+t.variationIndex+" in experiment "+t.experimentId)}else if(!e.variations.find((function(t){return t.id===r})))throw new Error("Cound not find variation "+r+" in experiment "+t.experimentId);A.updateVariationIdMap(i,t.experimentId,r),R.getBucketingId()&&A.persistVariationIdMap(),A.updateContextualMabMap(i,t.experimentId,{variationId:r}),R.getBucketingId()&&A.persistContextualMabMap()},n.waitForOriginSync=function(t){if(!Array.isArray(t.canonicalOrigins))throw new Error("canonicalOrigins must be an array. Got: "+b.stringify(t.canonicalOrigins));t.canonicalOrigins.forEach((function(t){if("string"!=typeof t)throw new Error("Each item in canonicalOrigins must be a string. Found type "+(void 0===t?"undefined":(n=t)&&"undefined"!=typeof Symbol&&n.constructor===Symbol?"symbol":typeof n));var n})),m.dispatch(r.XDOMAIN_SET_CANONICAL_ORIGINS,{canonicalOrigins:t.canonicalOrigins})},n.disableCrossOrigin=function(){w.log("API / cross origin tracking is DISABLED"),m.dispatch(r.XDOMAIN_SET_DISABLED,{disabled:!0})},n.activate=function(){C.shouldActivate()?(O.getActiveViewStates().forEac
2h((function(t){I.deactivate(k.get(t.id))})),m.dispatch(r.RESET_VIEW_STATES),f.emitActivateEvent()):w.debug("Not activating.")},n.sendEvents=function(){f.emitSendEvents()},n.holdEvents=function(){f.emitHoldEvents()}},8457:function(){},376:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.flattenDeep,a=i.isEmpty,u=i.isObject,c=e(9726).v,s=n.ActivationCodeError=c("ActivationCodeError"),f=n.ProjectJSError=c("ProjectJSError"),l=e(6183),d=e(1756),v=e(6967),h=e(2030),p=e(391),g=e(525),m=e(9663),b=e(6310),_=e(8079),y=e(3221),w=e(7946),E=e(9751),I=e(2044),A=e(6210),T=e(3659),S=e(3816),O=e(3941),k=e(5564),R=e(2902),N=e(7429).DT,C=e(3496),D=e(7108),x=e(6494),j=e(5213),M=e(8805),P=e(3341).Promise,L=e(8767),U=e(5442),V=e(8597),B=e(6903),z=e(3432),F=e(7649),G=e(3898),q=(y=e(3221)).get("stores/session"),H=y.get("stores/audience_data"),Y=y.get("stores/action_data"),K=y.get("stores/cleanup"),$=y.get("stores/directive"),W=y.get("stores/global"),X=y.get("stores/group_data"),J=y.get("stores/layer_data"),Q=y.get("stores/layer"),Z=y.get("stores/pending_events"),tt=y.get("stores/plugins"),nt=y.get("stores/rum"),et=y.get("stores/visitor"),it=y.get("stores/view_data"),rt=y.get("stores/view"),ot=y.get("stores/visitor_id"),at=y.get("stores/visitor_bucketing"),ut=y.get("stores/xdomain"),ct=e(5205),st=e(8813),ft=e(8942),lt=!1,dt=n;function vt(){h.emitActivateEvent()}function ht(t){st.handleError(t.data.error,t.data.metadata)}function pt(t,n){O.dispatch(d.SET_RUM_DATA,{data:{extras:{xdAttempt:t,xdError:n?n.toString():void 0}}})}function gt(t,n,e){t=t||[];var i=W.getGlobalHoldbackThreshold(),r=ot.getBucketingId();if(!r)throw new Error("bucketingId not set");var o,a=et.getVisitorProfile();n&&(o=at.getVariationIdMap()[n.id]);var u={bucketingId:r,visitorProfile:a,audiences:t,globalHoldback:i,preferredVariationMap:o,layer:n};return n&&e&&_.isPageIdRelevant(n)?e.map((function(t){return _.createTicket(Object.assign({},u,{pageId:t}))})):[_.createTicket(u)]}function mt(t,n){var e={};return t.forEach((function(t){Array.isArray(t)?Object.assign(e,mt(t,n)):u(t)&&n[t.type]&&(e[t.type]=!0)})),e}function bt(t){var n=[];return t.forEach((function(t){n.push(t.name,t)})),n}function _t(t){var n=K.getCleanupFns(t);if(n.length>0){for(;n.length>0;)n.shift()();O.dispatch(d.CLEAR_CLEANUP_FN,{lifecycle:t})}}n.initialize=function(t){return this.initGlobalStore(t.clientData),this.initializePlugins(t.plugins)},n.initGlobalStore=function(t){m.normalizeClientData(t),A.on({filter:{type:"error"},handler:ht}),O.dispatch(d.DATA_LOADED,{data:t}),C.log("Initialized with DATA:",t)},n.initializePlugins=function(t){if(Array.isArray(window.optimizely)&&(window.optimizely=window.optimizely.filter((function(t){var n=!0;return!ct.push(t,n)}))),w.setOptOut($.shouldOptOut()),!$.isDisabled()&&!$.shouldOptOut()){ft.queueBeacons(),E.isReady()?O.dispatch(d.SET_DOMCONTENTLOADED):E.addReadyHandler((function(){O.dispatch(d.SET_DOMCONTENTLOADED)})),x.time("projectJS");var e=W.getProjectJS();if("function"==typeof e)try{S.apply(e)}catch(t){C.error("Error while executing projectJS: ",t),g.emitError(new f(t))}x.timeEnd("projectJS"),(t||[]).forEach((function(t){try{t(j)}catch(t){g.emitInternalError(t)}})),(W.getPlugins()||[]).forEach((function(t){try{S.apply(t,[j])}catch(t){g.emitError(t)}})),U.load();var i=A.on({filter:{type:"lifecycle",name:"activated"},handler:function(){et.observe(F.persistVisitorProfile),Q.observe(F.persistLayerStates),q.observe(F.persistSessionState),Z.observe(D.schedulePersistPendingEvents),at.observe(F.persistVisitorBucketingStore),A.off(i)}});A.on({filter:{type:"lifecycle",name:"viewsActivated"},handler:n.onViewsActivated}),A.on({filter:{type:"lifecycle",name:"pageDeactivated"},handler:n.onPageDeactivated}),n.initializeApi();var r=D.getPendingEvents();if(r&&(O.dispatch(d.LOAD_PENDING_EVENTS,{events:r}),D.retryPendingEvents(r)),A.on({filter:{type:"lifecycle",name:"activate"},handler:n.activate}),h.emitInitializedEvent(),!$.shouldActivate())return P.resolve();var o=[];if(ut.isDisabled())vt();else{var a=n.initializeXDomainStorage();if(o.push(a),Boolean(ut.getCanonicalOrigins())){var u=V.makeTimeoutPromise(1e3);P.race([a,u]).catch((function(t){C.error("Failed to initialize xDomain storage: ",t)})).then(vt).catch(st.handleError)}else vt()}return P.all(o)}C.log("Controller / Is disabled")},n.activate=function(){try{var t=[];C.log("Activated client"),_t(I.Lifecycle.preActivate);var n=!1;lt;var e=b.now();
2O.dispatch(d.ACTIVATE,{activationId:String(e),activationTimestamp:e});var i=it.getAll();z.registerViews(i,n),F.setId(F.getOrGenerateId()),t.push(v.trackPostRedirectDecisionEvent()),O.dispatch(d.MERGE_VARIATION_ID_MAP,{variationIdMap:F.getVariationIdMap()}),O.dispatch(d.MERGE_CONTEXTUAL_MAB_MAP,{contextualMabMap:F.getContextualMabMap()}),O.dispatch(d.SET_ODP_SEGMENTS,F.getOdpSegments()),O.dispatch(d.MERGE_PREFERRED_LAYER_MAP,{preferredLayerMap:F.getPreferredLayerMap()}),_t(I.Lifecycle.postVisitorProfileLoad),t.push((s=tt.getAllPlugins(I.PluginTypes.visitorProfileProviders),f=et.getVisitorProfile(),F.populateEagerVisitorData(s,f)).then((function(){C.log("Populated visitor profile")})));var r=gt(),o=_.decideGlobal(r);C.log("Made global decision",r,"->",o),O.dispatch(d.RECORD_GLOBAL_DECISION,o);var a=v.trackClientActivation();a?C.log("Tracked activation event",a):C.log("Not tracking activation event");var u=dt.setUpViewActivation(i),c=[];return u.forEach((function(t){c=c.concat(z.activateMultiple([t]))})),_t(I.Lifecycle.postViewsActivated),_t(I.Lifecycle.postActivate),h.emitActivatedEvent(),P.all(t).then((function(){A.emit({type:T.TYPES.LIFECYCLE,name:"activateDeferredDone"}),C.log("All immediate effects of activation resolved")}),g.emitError)}catch(t){return g.emitError(t),P.reject(t)}var s,f},dt.setUpViewActivation=function(t){var n=[];return t.forEach((function(t){"boolean"==typeof rt.getViewState(t.id).isActive&&z.isActivationTypeImmediate(t.activationType)?C.debug("Skipping page: already evaluated, presumably at the edge",z.description(t)):z.shouldTriggerImmediately(t.activationType)?n.push(t):t.activationType===I.ViewActivationTypes.callback?(C.debug("Setting up conditional activation for Page",z.description(t)),dt.activateViewOnCallback(t)):t.activationType===I.ViewActivationTypes.polling?(C.debug("Setting up polling activation for Page",z.description(t)),M.pollFor(S.apply.bind(null,t.activationCode),null,B.isTimedOut.bind(null,b.now())).then((function(){z.activateMultiple([t])})).catch((function(n){C.warn("Failed to activate view ",t,n)}))):t.activationType!==I.ViewActivationTypes.manual&&g.emitError(new Error("Unknown view activationType: "+t.activationType))})),n},dt.activateViewOnCallback=function(t){var n={pageId:t.id};Object.defineProperty(n,"isActive",{get:function(){return rt.isViewActive(t.id)}});try{S.apply(t.activationCode,[function(n){var e=Object.assign({},n,{pageName:t.apiName,type:"page"});ct.push(e)},n])}catch(n){var e=new s("("+n.toString()+") in activationCode for "+z.description(t));g.emitError(e,{originalError:n,userError:!0})}},n.onViewsActivated=function(t){var e,i=t.data.views,r=i.map((function(t){return t.id}));try{if(!ot.getBucketingId())throw new Error("View activated with no visitorId set");var o=function(t){var e=J.getAllByPageIds(t),i=$.getForceVariationIds(),r=$.getForceAudienceIds(),o=!a(i);o&&C.log("Force variations are in use. Disabling mutual exclusivity.");var u=o?{individual:e}:e.reduce((function(t,n){return n.groupId?t.groups[n.groupId]||(t.groups[n.groupId]=X.get(n.groupId)):t.individual.push(n),t}),{groups:{},individual:[]});if(C.log("Deciding Campaigns/Experiments for Page(s)",t),u.groups){var c=Object.keys(u.groups).map((function(t){return k.description(u.groups[t])})).join(", ");C.log("Groups:",c)}var s=u.individual.map(R.description).join(", ");C.log("Campaigns/Experiments not in Groups (by Campaign id):",s);var f=Object.keys(u.groups||{}).map((function(e){return function(t,e,i,r){try{var o=function(t){return{bucketingId:ot.getBucketingId(),preferredLayerId:at.getPreferredLayerMap()[t.id]}}(r),u=_.decideGroup(r,o);if(u.reason)return C.debug("Not activating Group",k.description(r),"; reason:",u.reason),nt.getSampleRum()&&O.dispatch(d.RECORD_LAYER_FEATURE_USAGE,{feature:"mutex",entityId:r.id}),P.resolve();var c=J.get(u.layerId);if(!c)return C.debug("Visitor was bucketed into a Campaign ("+u.layerId+") which is not in this snippet"),P.resolve();var s=(c.pageIds||[]).filter((function(t){return Array.isArray(i)&&i.includes(t)}));return a(s)?(C.debug("Not activating Group",k.description(r),"; reason: visitor was bucketed into a Campaign/Experiment not related to the currently-activating Page(s)"),P.resolve()):(nt.getSampleRum()&&O.dispatch(d.RECORD_LAYER_FEATURE_USAGE,{feature:"mutex",entityId:r.id}),n.decideAndExecuteLayerASAP(t,e,s,c))}catch(t){return C.error("Error getting decision for Group",k.description(r),"; ",t),P.reject(t)}}(i,r,t,u.groups[e])}))||[],l=u.individual.map((function(e){var o=(e.pageIds||[]).filter((function(n){return Array.isArray(t)&&t.includes(n)}));return n.decideAndExecuteLayerASAP(i,r,o,e)})),v=f.concat(l);return P.all(v).then((function(n){var e=n.filter((function(t){return!!t}));return C.log("All Campaigns/Experiments for Page(s) (by Campaign id)",t,"resolved:",e.map(R.description).join(", ")),e}))}(r).catch(g.emitError);return e=P.all(i.map((function(t){var n=function(){z.parseViewTags(t);var n=v.trackViewActivation(t);n?C.log("Tracked activation for Page",z.description(t),n):C.log("Not Tracking activation for Page",z.description(t))};return E.isReady()?P.resolve(n()):M.pollFor(E.isReady,1e3).then(n)}))),P.all([o,e])}catch(t){g.emitError(t)}},n.onPageDeactivated=function(t){var n=t.data.page;
2(Y.getAllActionIdsByPageId(n.id)||[]).forEach((function(t){var e=Y.getActionState(t);e&&(Object.keys(e).forEach((function(t){var i=e[t];if(i.cancel)try{i.cancel(),C.debug("Controller / Canceled change",t,"observation due to deactivation of page:",n)}catch(n){C.error("Controller / Error canceling change",t,"observation upon deactivation of page.",n)}if(n.undoOnDeactivation&&i.undo)try{i.undo(),C.debug("Controller / Undid change",t,"due to deactivation of page:",n)}catch(t){C.error("Controller / Error undoing change upon deactivation of page.",t)}})),O.dispatch(d.REMOVE_ACTION_STATE,{actionId:t}),C.debug("Controller / Undid changes and/or canceled change observation due to deactivation of page:",n,t))}))},n.initializeApi=function(){var t={push:ct.push};t.get=ct.get;var n=window.optimizely;Array.isArray(n)&&n.forEach((function(n){t.push(n)})),t.data={note:"Obsolete, use optimizely.get('data') instead"},t.state={},window.optimizely=t},n.persistItemsWithId=function(t){return Object.keys(t).forEach((function(n){var e=t[n];F.checkKeyForVisitorId(n)&&N.setItem(n,e)})),t},n.initializeXDomainStorage=function(){var t=e(9232),i=!!F.getCurrentId(),r=!!i&&F.hasSomeData();i?r?C.log("xd / Existing visitor; has data on this origin"):C.log("xd / Existing visitor; new to this origin"):C.log("xd / New visitor");var o=W.getAccountId(),u="https://a24099230963.cdn.optimizely.com".replace("__SUBDOMAIN__","a"+o+"."),c="/client_storage/a"+o+".html";t.subscribe((function(t,n){F.checkKeyForVisitorId(t)&&N.setItem(t,n)}));var s=t.fetchAll().then((function(n){if(!ot.getVisitorIdLocator()){var e=ut.getCanonicalOrigins();if(e){var i=t.getXDomainUserId(n,e);i&&(C.log("Syncing cross-origin visitor randomId:",i),F.maybePersistVisitorId({randomId:i}))}}return F.deleteOldForeignData(),n})).then(n.persistItemsWithId).then((function(t){if(F.loadForeignData(),i&&!r){var n=!a(t);C.debug("xd / Loaded foreign data? ",n),pt(n)}C.log("Loaded visitor data from foreign origins"),h.emitOriginsSyncedEvent()}),(function(t){throw i&&!r&&(C.debug("xd / Failed to load foreign data:",t),pt(!1,t)),t}));return P.all([t.load(u,c).catch((function(t){throw C.debug("xd / Failed to load iframe:",t),i&&!r&&pt(!1,t),t})),s.catch((function(t){C.debug("xd / Ignored error syncing foreign data (expected if waitForOriginSync used):",t.message),C.debug("xd / Enqueuing sync to happen after visitorId set."),O.dispatch(d.ADD_CLEANUP_FN,{lifecycle:I.Lifecycle.postVisitorProfileLoad,cleanupFn:h.emitOriginsSyncedEvent})}))])},n.decideAndExecuteLayerASAP=function(t,e,i,u){return new P((function(c,s){try{!function(t,n,e,i,r){if(n.length||e.length)return void r(gt([],void 0,i));var u=R.relatedAudienceIds(t),c=u.reduce((function(t,n){var e=H.get(n);return e&&t.push(e),t}),[]),s=tt.getAllPlugins(I.PluginTypes.audienceMatchers);if(nt.getSampleRum()){var f={};if(c.forEach((function(t){Object.assign(f,mt(t.conditions,s))})),!a(f)){var l=Object.keys(f);O.dispatch(d.RECORD_AUDIENCE_USAGE,{audienceTypes:l,layerId:t.id})}}var v=function(t){C.debug("Audience list for extracting types",t);try{var n=new Set(o(t.map((function(t){return t.conditions}))).filter((function(t){return null!=t&&"string"!=typeof t})).map((function(t){return t.type})));return n.has("time_and_day")&&n.add("currentTimestamp"),C.debug("Extracted unique types from audiences",n),n}catch(t){return C.error("An error occurred while extracting types from audiences:",t),new Set}}(c),h=tt.getAllPlugins(I.PluginTypes.visitorProfileProviders),g=et.getVisitorProfile();F.populateLazyVisitorData(h,g,v),function(t,n,e,i){var r=t.reduce((function(t,e){return Object.assign(t,p.requiredAudienceFieldsForConditions(e.conditions,n))}),{}),o=Object.keys(r).reduce((function(t,n){var e=r[n];if(void 0===F.getAttribute(e)){var i=F.getPendingAttributeValue(e);void 0!==i&&t.push(i)}return t}),[]);if(0===o.length)return i();var u=[].concat(t),c=L.firstToResolve(o.map((function(t){return P.resolve(t).then((function(){var t=et.getVisitorProfile();if(u=u.filter((function(e){return void 0===p.isInAudience(t,e,n)})),!a(u))throw new Error("At least one audience is still pending")}))})));P.race([c,new P((function(t,n){G.setTimeout(n,e)}))]).then((function(){C.log("Activating Campaign after pending Audiences resolved",t),i()}),(function(){C.log("Activating Campaign after timeout on Audiences",t),i()}))}(c,s,R.getActivationTimeout(t),(function(){var n=gt(c,t,i);
2n.forEach((function(n){!function(t,n,e){var i=t.audienceIds.map(H.get.bind(H)).filter(Boolean),r=n.filter((function(n){return!t.audienceIds.includes(n.id)}));C.log("When deciding Campaign",R.description(e),"visitor is in audiences:",bt(i),"and not in audiences:",bt(r))}(n,c,t)})),r(n)}))}(u,t,e,i,(function(o){o.forEach((function(o){var c=o.pageId?[o.pageId]:i;C.debug("Deciding layer: ",u,"with decisionTicket: ",o,"and actionViewIds: ",c),function(t,e,i,o,u){var c=R.description(t);C.log("Activating Campaign",c,"on Page(s)",o),i.length&&(C.log("Applying force audienceIds:",i,"to Campaign",c),(u=r(u)).audienceIds=i);var s=n.decideLayer(t,u,e),f=!(!e.length&&!i.length),p=n.getActionsForDecision(t,s,f),g=function(t,n){return t.filter((function(t){return void 0===t.pageId||n.includes(t.pageId)}))}(p.actions,o);if(p.maybeExecute&&function(t,n,e,i){var r=R.description(n);C.log("Preparing actions",t,"for Campaign",r,"on Page(s)",i),t.forEach(l.prepareAction)}(g,t,0,o),o.forEach((function(){v.trackDecisionEvent(s,u,t)})),h.emitLayerDecided({layer:t,decisionTicket:u,decision:s}),s.error)throw s.error;if(nt.getSampleRum()){O.dispatch(d.RECORD_LAYER_POLICY_USAGE,{policy:t.policy,layerId:t.id});var m=function(t){var n={};return t.forEach((function(t){t.changeSet.forEach((function(t){n[t.type]||(n[t.type]=!0)}))})),n}(p.actions);O.dispatch(d.RECORD_CHANGE_TYPE_USAGE,{changeTypes:Object.keys(m),layerId:t.id}),a(t.integrationSettings)||O.dispatch(d.RECORD_INTEGRATION_USAGE,{integrations:R.getIntegrationTypes(t),layerId:t.id})}if(!_.isInCohort(s))return void C.log("Not activating Campaign: "+R.description(t)+"; not in the cohort because:",s.reason);p.maybeExecute&&function(t,n,e,i){var r=R.description(n);C.log("Executing actions",t,"for Campaign",r,"on Page(s)",i),P.all(t.map((function(t){return l.executePreparedAction(t).then(h.emitActionAppliedEvent.bind(null,t))}))).then((function(){C.log("All page actions for",e,"applied:",t),h.emitActionsForDecisionAppliedEvent(e,t)})).catch((function(t){C.warn("Error evaluating page actions for decision",e,"because:",t)}))}(g,t,s,o)}(u,t,e,c,o)})),c(u)}))}catch(t){C.error("Error getting decision for Campaign: "+R.description(u),t),s(t)}}))},n.decideLayer=function(t,n,e){var i;var r=R.description(t);i=e.length?_.getDummyLayerDecision(t,e):_.decideLayer(t,n),C.log("Recording decision for Campaign",r,n,"->",i),R.recordLayerDecision(t.id,n,i),i.variationId&&i.experimentId&&F.updateVariationIdMap(t.id,i.experimentId,i.variationId),t.groupId&&F.updatePreferredLayerMap(t.groupId,t.id);return i},n.getActionsForDecision=function(t,n,e){var i=R.description(t),r="NOT applying changes for Campaign",o={actions:[],maybeExecute:!1};if(o.actions=[].concat(Y.getLayerActions(n.layerId)||[],Y.getExperimentActions(n.experimentId)||[],Y.getExperimentVariationActions(n.experimentId,n.variationId)||[]),!e&&W.isGlobalHoldback())return C.log(r,i,"(visitor is in global holdback)"),o;if(n.isLayerHoldback)return C.log(r,i,"(visitor is in layer holdback)"),o;if(!n.experimentId||!n.variationId)return C.log(r,i,"(visitor is not eligible for any Experiments)"),o;return o.maybeExecute=!0,C.log("Got Actions for Campaign:",i,o.actions),o}},9542:function(t,n,e){var i=e(3341).Promise,r=e(6310),o=e(3221).get("stores/plugins"),a=e(2044),u=e(3496);n.create=function(t,n,e){var c={identifier:t.id,action:n,startTime:e||r.now()};try{var s=o.getPlugin(a.PluginTypes.changeAppliers,t.type);if(!s)throw new Error("Unrecognized change type "+t.type);return new s(t,c)}catch(t){return u.error("Change applier was never properly constructed:",t),{apply:function(){return i.reject(t)}}}}},7042:function(t){t.exports={SELECTOR_POLLING_MAX_TIME:2e3,CHANGE_DATA_KEY:"optimizelyChangeData",CHANGE_ID_ATTRIBUTE_PREFIX:"data-optly-"}},1894:function(t,n,e){var i=e(279).isEmpty,r=e(7042).CHANGE_DATA_KEY;function o(t,n){return[t,n].join("_")}n.getData=function(t,n,e){var i=o(n,e);return t[r]&&t[r][i]?t[r][i]:null},n.hasData=function(t){return Boolean(t&&t[r]&&!i(t[r]))},n.removeData=function(t,n,e){t[r]&&delete t[r][o(n,e)]},n.setData=function(t,n,e,i){if("object"!=typeof i)throw new Error("setData expects an object");t[r]||(t[r]={}),t[r][o(n,e)]=i}},7065:function(t,n,e){var i=e(762);t.exports={changeType:{CUSTOM_CODE:"custom_code",ATTRIBUTE:"attribute",APPEND:"append",REARRANGE:"rearrange",REDIRECT:"redirect",WIDGET:"widget"},DOMInsertionType:{AFTER:"after",APPEND:"append",BEFORE:"before",PREPEND:"prepend"},insertAdjacentHTMLType:{AFTER_BEGIN:"afterbegin",AFTER_END:"afterend",BEFORE_BEGIN:"beforebegin",BEFORE_END:"beforeend"},selectorChangeType:{CLASS:"class",HTML:"html",HREF:"href",SRC:"src",SRCSET:"srcset",STYLE:"style",TEXT:"text",HIDE:"hide",REMOVE:"remove"},changeApplierState:i({APPLIED:null,APPLYING:null,UNAPPLIED:null,UNDOING:null}),changeState:i({BLOCKED:null,UNAPPLIED:null,APPLIED:null,APPLYING:null,UNDOING:null,TIMED_OUT:null,IGNORED:null,ERROR:null})}},6183:function(t,n,e){var i=e(1756),r=e(525),o=e(8548),a=e(9726).v,u=e(6310),c=e(3221),s=e(3941),f=e(3496),l=e(3341).Promise,d=e(7743),v=c.get("stores/global"),h=c.get("stores/action_data"),p=c.get("stores/change_data"),g=c.get("stores/session"),m=e(9542);e(6903).initialize();var b=a("ActionError");function _(t,n,e){if(h.getActionState(n.id))if(void 0===h.getChangeApplier(t.id,n.id)){var r={changeId:t.id,actionId:n.id,changeApplier:m.create(t,n,e)};s.dispatch(i.SET_CHANGE_APPLIER,r)}else f.warn("Action / Attempted to prepare a change which is already being applied: ",t);else f.warn("Action / Attempted to prepare change for inactive action: ",n)}function y(t,n,e,i){if(!i.includes(n)){if(!t[String(n)]){var a=p.getChange(n);if(!a){var c="Change with id "+n+" is absent";return i.length&&(c+=" but listed as a dependency for "+i[i.length-1]),void f.warn(c)}t[String(n)]=new l((function(c){var s=(a.dependencies||[]).map((function(r){return y(t,r,e,i.concat([n]))}));if(a.src){var v="change_"+a.src,g=o.makeAsyncRequest(v,(function(){return d.addScriptAsync("https://cdn.optimizely.com/public/24099230963/data"+a.src,(function(){o.resolveRequest(v)}))})).then((function(){var t=p.getChange(a.id);t||r.emitError(new b("Failed to load async change from src: "+a.src)),_(t,e,u.now())}));s.push(g)}l.all(s).then((function(){var t=u.now(),i=h.getChangeApplier(n,e.id);return i?(f.debug("Action / Applying change:",a),i.apply().then((function(n){n?f.log(n):f.debug("Action / Applied change for the first time in "+(u.now()-t)+"ms:",a),c()}))):(f.debug("Action / Not applying change ",n," - No changeApplier found."),void c())})).catch((function(t){f.error("Action / Failed to apply change:",a,t),c()}))}))}return t[String(n)]}f.error("Change with id "+n+" has circular dependencies: "+i.concat(n))}n.prepareAction=function(t){f.debug("Action / Preparing:",t),s.dispatch(i.ACTION_EXECUTED,{actionId:t.id,sessionId:g.getSessionId(),layerId:t.layerId,pageId:t.pageId,timestamp:u.now(),activationId:v.getActivationId()});var n=u.now();t.changeSet.forEach((function(e){var r="object"==typeof e&&null!==e?e.id:e,o=p.getChange(r);o||(s.dispatch(i.ADD_CHANGE,e),o=p.getChange(r)),o.src||_(o,t,n)}))},n.executePreparedAction=function(t){f.debug("Action / Executing:",t);var n={},e=t.changeSet.map((function(e){var i="object"==typeof e&&null!==e?e.id:e;return y(n,i,t,[])}));return l.all(e).then((function(){f.debug("changes for action id="+t.id+" applied")}))}},6903:function(t,n,e){var i=e(7042),r=e(3221).get("stores/directive");function o(){("interactive"===document.readyState||"complete"===document.readyState)&&(n.domReadyTime=Date.now())}n.domReadyTime=null,n.initialize=function(){o(),document.addEventListener("readystatechange",o,!0)},n.isTimedOut=function(t){var e=Date.now();if(!n.domReadyTime||!t)return!1;var o=Math.max(t,n.domReadyTime);return r.isEditor()&&(o=n.domReadyTime),!(e-o<i.SELECTOR_POLLING_MAX_TIME)}},6967:function(t,n,e){var i=e(279),r=i.omit,o=i.pick,a=e(1756),u=e(525),c=e(2030),s=e(6027),f=e(6310),l=e(6387),d=e(3221),v=e(9751),h=e(2044),p=e(7065),g=e(8701),m=e(6210),b=e(3659),_=e(6167),y=e(3941),w=e(2902),E=e(3496),I=(e(6494),e(3341).Promise),A=e(2060),T=e(5442),S=e(8597),O=e(3454),k=e(167),R=d.get("stores/client_metadata"),N=d.get("stores/global"),C=d.get("stores/session"),D=d.get("stores/view"),x=d.get("stores/plugins"),j=d.get("stores/layer"),M=d.get("stores/layer_data"),P=d.get("stores/observed_redirect"),L=d.get("stores/pending_redirect"),U=d.get("stores/visitor"),V=d.get("stores/directive"),B=d.get("stores/event_data"),z=d.get("stores/visitor_id");function F(t,n,e){return void 0===e&&(e=!1),Object.assign({},t,{isLayerHoldback:n,isLayerConcluded:e,isGlobalHoldback:!1,clientName:null!==t.clientName?t.clientName:l.NAME,integrationStringVersion:null!==t.integrationStringVersion?t.integrationStringVersion:1,anonymizeIP:null!==N.getAnonymizeIP()?N.getAnonymizeIP():void 0,activationId:N.getActivationId(),decisionTicketAudienceIds:[],sessionId:C.getSessionId(),activeViewStates:[],userFeatures:H(U.getVisitorProfile()),layerStates:j.getLayerStatesForAnalytics()})}function G(t){var n=A.getReferrer()||v.getReferrer();return{eventId:k.generate(),timestamp:f.now(),revision:N.getRevision(),clientName:R.getClientName(),clientVersion:R.getClientVersion(),projectId:N.getProjectId(),accountId:N.getAccountId(),activationId:N.getActivationId(),sessionId:C.getSessionId(),isGlobalHoldback:N.isGlobalHoldback(),namespace:N.getNamespace(),referrer:n,visitorId:z.getRandomId(),activeViewStates:t.activeViewStates,layerStates:t.layerStates,userFeatures:H(t.visitorProfile,!t.deferBehaviorFeatures)}}function q(t){var n,e;return t.pageId?(n=t.pageId,(e=D.getViewState(n))&&e.isActive?e.metadata:{}):{}}function H(t,n){void 0===n&&(n=!0);var e=x.getAllPlugins(h.PluginTypes.visitorProfileProviders),i=Object.values(e).filter((function(t){return!0===t.shouldTrack})),r={id:null,type:null,name:"",value:null,shouldIndex:!0},a=i.reduce((function(n,e){try{var i=e.provides,a=t[i],u=[];
2if(void 0!==a){null!==a&&"object"==typeof a?u=Object.keys(a).map((function(t){var n=a[t],e=null!==n&&"object"==typeof n?n:{value:n};return Object.assign({},{type:i,name:t},e)})):u.push({type:i,value:a});var c=u.map((function(t){return o(Object.assign({},r,t),Object.keys(r))})).filter((function(t){return!!t.value}));n=n.concat(c)}}catch(t){E.warn("Error evaluating userFeature against visitorProfile:",t)}return n}),[]);return n?a.concat([]):a}function Y(t){t&&t.userFeatures&&(t.userFeatures=t.userFeatures.concat([]))}function K(t,n,e){var i=function(t,n){var e=[],i=x.getAllPlugins(h.PluginTypes.analyticsTrackers);return Object.keys(i).forEach((function(r){var o=i[r];if(o[t]&&(!n||!o[n]))try{e.push({name:r,hookFn:d.evaluate(o[t])})}catch(t){E.error(t)}})),e}(t,e);E.debug("Found "+i.length+" analytics integrations defining a "+t+" hook"),E.debug("Calling each with data: ",n),i.forEach((function(t){try{E.debug("Calling plugin: "+t.name),t.hookFn(n),E.debug("Called plugin: "+t.name)}catch(t){E.error(t)}}))}function $(t,n,e){var i=function(t,n){0;var e=[],i=x.getAllPlugins(h.PluginTypes.analyticsTrackers);
2return Object.keys(i).forEach((function(r){var o=i[r];n.includes(o[t])&&e.push({name:r,hookFn:o.trackLayerDecision})})),e}(t,n);E.debug("Found "+i.length+" analytics integrations defining a trackLayerDecision "+t+" timing of "+n.join("|")),E.debug("Calling each with data: ",e),i.forEach((function(t){try{E.debug("Calling plugin: "+t.name),t.hookFn(e),E.debug("Called plugin: "+t.name)}catch(t){E.error(t)}}))}n.trackClientActivation=function(){if(!e(5296).shouldDrop()&&V.shouldSendTrackingData()){var t,n=(t=G({activeViewStates:[],visitorProfile:U.getVisitorProfile(),layerStates:j.getLayerStatesForAnalytics()}),Object.assign(t,{eventTags:{}}));return K("onClientActivation",n),n}},n.trackCustomEvent=function(t,n,i,o){if(!e(5296).shouldDrop()){n=n||{},o=o||{},i||(i=B.getByApiName(t));var a=function(t,n,e,i){var r=G({activeViewStates:D.getActiveViewStates(),visitorProfile:U.getVisitorProfile(),layerStates:j.getLayerStatesForAnalytics(),deferBehaviorFeatures:!0}),o=i&&i.pageId?q(i):D.getActiveViewTags(),a=Object.assign({},o,n),u=i&&i.category?i.category:g.OTHER;return Object.assign(r,{eventEntityId:i&&i.id,eventApiName:t,eventCategory:u,eventTags:a,eventProperties:e})}(t,n,o,i),c={name:t,type:_.CUSTOM,category:a.eventCategory,tags:r(a.eventTags,["revenue"])};if(void 0!==n.revenue&&(c.revenue=n.revenue),u.emitAnalyticsEvent({name:i?i.name||i.apiName:t,apiName:i?i.apiName:void 0,type:_.CUSTOM,properties:a.eventProperties,tags:r(a.eventTags,["revenue"]),category:a.eventCategory,metrics:c.revenue?{revenue:c.revenue}:{}},!V.shouldSendTrackingData()),V.shouldSendTrackingData())return s.addEvent(c),Y(a),K("onCustomEvent",a),a}},n.trackDecisionEvent=function(t,n,i){if(!e(5296).shouldDrop()){i||(i=M.get(t.layerId));var r=k.generate();y.dispatch(a.RECORD_LAYER_DECISION_EVENT_ID,{layerId:t.layerId,pageId:n.pageId,decisionId:r});var o=t.experimentId?i.experiments.find((function(n){return n.id===t.experimentId})):null,u=function(t,n,e,i,r){var o=null,a=null,u=null;if(r&&(o=r.name||null,u=r.integrationSettings,n.variationId)){var c=r.variations.find((function(t){return t.id===n.variationId}));c&&(a=c.name||null)}var s=A.getReferrer()||v.getReferrer(),l={sessionId:C.getSessionId(),decisionTicketAudienceIds:e.audienceIds,visitorId:z.getRandomId(),decisionId:t,activationId:N.getActivationId(),namespace:N.getNamespace(),timestamp:f.now(),pageId:e.pageId||null,variationId:n.variationId,variationName:a,experimentId:n.experimentId,experimentName:o,layerId:n.layerId,layerName:i.name,layerPolicy:i.policy,accountId:N.getAccountId(),projectId:N.getProjectId(),revision:String(N.getRevision()),clientName:R.getClientName(),clientVersion:R.getClientVersion(),referrer:s,integrationStringVersion:i.integrationStringVersion||1,integrationSettings:Object.assign({},i.integrationSettings,u)};return l}(r,t,n,i,o),s=L.isExpectingRedirect(),l=L.getLayerId(),d=w.description(i);if(s&&l===i.id&&(T.persist(u,"COOKIE"),E.log("Relaying decision for redirect Campaign",d)),V.shouldSendTrackingData()){var h=F(u,t.isLayerHoldback,t.isLayerConcluded);
2if(s&&l===i.id){var g=O.TrackLayerDecisionTimingFlags.preRedirectPolicy;h.timing=g,$(g,[O.PreRedirectPolicies.PERSIST_BEFORE_AND_TRACK_DURING_REDIRECT],h),E.log("Called trackLayerDecision for redirect Campaign",d,h)}else{g=O.TrackLayerDecisionTimingFlags.nonRedirectPolicy;h.timing=g,$(g,[O.NonRedirectPolicies.TRACK_IMMEDIATELY],h),E.log("Called trackLayerDecision for non-redirect Campaign",d,h)}(function(t){return!(!t||!t.variations)&&t.variations.some((function(t){return!!t.actions&&t.actions.some((function(t){return!(!t||!t.changes)&&t.changes.some((function(t){return t.type===p.changeType.REDIRECT}))}))}))})(o)&&(y.dispatch(a.SET_TRACKER_USE_BEACON,!0),c.emitMaybeSendEvents(),y.dispatch(a.SET_TRACKER_USE_BEACON,!1))}else E.log("Analytics / Not tracking decision for Campaign",w.description(i))}},n.trackPostRedirectDecisionEvent=function(){if(e(5296).shouldDrop()||!V.shouldSendTrackingData()||P.hasTracked())return I.resolve();var t=P.get();if(!t)return I.resolve();var n=F(t,!1),i=O.TrackLayerDecisionTimingFlags.postRedirectPolicy;n.timing=i,$(i,[O.PostRedirectPolicies.TRACK_IMMEDIATELY],n);var r=new I((function(t){var n=m.on({filter:{type:b.TYPES.LIFECYCLE,name:"originsSynced"},handler:function(){t(),m.off(n)}})})),o=S.makeTimeoutPromise(1e3);return I.race([r,o]).then((function(){E.log("Calling trackers after successful sync")}),(function(t){E.warn("Calling trackers after failed sync:",t)})).then((function(){(n=F(t,!1)).timing=O.TrackLayerDecisionTimingFlags.postRedirectPolicy,$(O.TrackLayerDecisionTimingFlags.postRedirectPolicy,[O.PostRedirectPolicies.TRACK_AFTER_SYNC],n),y.dispatch(a.REGISTER_TRACKED_REDIRECT_DATA)})).catch((function(t){E.error("Error when calling trackers after sync:",t)}))},n.trackClickEvent=function(t){if(!e(5296).shouldDrop()){var n=function(t){var n=G({activeViewStates:D.getActiveViewStates(),visitorProfile:U.getVisitorProfile(),layerStates:j.getLayerStatesForAnalytics(),deferBehaviorFeatures:!0}),e=t.config&&t.config.selector?t.config.selector:t.eventFilter.selector,i=t.apiName,r=t.category||g.OTHER,o=t.id,a=q(t);return Object.assign(n,{eventApiName:i,eventCategory:r,eventEntityId:o,eventTags:a,pageId:t.pageId,selector:e})}(t),i={name:t.apiName,type:t.eventType,category:n.eventCategory,tags:n.eventTags};if(u.emitAnalyticsEvent({name:t.name||t.apiName,apiName:t?t.apiName:void 0,type:t.eventType,category:n.eventCategory,tags:n.eventTags,metrics:{}},!V.shouldSendTrackingData()),V.shouldSendTrackingData())return s.addEvent(i),Y(n),K("onClickEvent",n),n}},n.trackViewActivation=function(t,n){if(!e(5296).shouldDrop())if(n||(n=D.getViewState(t.id)),n.isActive){var i=function(t,n){var e=G({activeViewStates:D.getActiveViewStates(),visitorProfile:U.getVisitorProfile(),layerStates:j.getLayerStatesForAnalytics(),deferBehaviorFeatures:!0});return Object.assign(e,{pageId:t.id,pageApiName:t.apiName,viewCategory:t.category,eventTags:n.metadata})}(t,n);if(u.emitAnalyticsEvent({name:t.name||i.pageApiName,apiName:i.pageApiName,type:_.PAGEVIEW,category:i.viewCategory,tags:i.eventTags,metrics:{}},!V.shouldSendTrackingData()),V.shouldSendTrackingData())return s.addEvent({name:i.pageApiName,type:_.PAGEVIEW,category:i.viewCategory,tags:i.eventTags}),Y(i),y.dispatch(a.TRACK_VIEW_ACTIVATED_EVENT,{pageId:t.id,eventData:i}),K("onPageActivated",i),i}else E.debug("Inactive view passed to `trackViewActivation`")}},5442:function(t,n,e){var i=e(1756),r=e(2658),o=e(525),a=e(3221),u=e(2044),c=e(3941),s=e(3496),f=e(3454),l=a.get("stores/plugins"),d=".",v=[{name:"sessionId",relayName:"s"},{name:"decisionTicketAudienceIds",relayName:"as",valueToValueString:function(t){return t.map(encodeURIComponent).join(",")},encodeValueString:function(t){return t},decodeValueString:function(t){return t},valueFromValueString:function(t){return t.split(",").map(r.safeDecodeURIComponent)}},{name:"decisionId",relayName:"d"},{name:"activationId",relayName:"aId"},{name:"pageId",relayName:"vId",isNullable:!0},{name:"variationId",relayName:"v",isNullable:!0},{name:"referrer",relayName:"r"},{name:"timestamp",relayName:"t",valueFromValueString:Number},{name:"visitorId",relayName:"i"},{name:"projectId",relayName:"p"},{name:"revision",relayName:"n"},{name:"clientName",relayName:"cN",isNullable:!0},{name:"clientVersion",relayName:"cV"},{name:"namespace",relayName:"ns"},{name:"accountId",relayName:"a"},{name:"layerId",relayName:"l"},{name:"layerName",relayName:"lN",isNullable:!0},{name:"layerPolicy",relayName:"lP"},{name:"experimentId",relayName:"x",isNullable:!0},{name:"experimentName",relayName:"xN",isNullable:!0},{name:"variationName",relayName:"vN",isNullable:!0},{name:"integrationStringVersion",relayName:"isv",valueFromValueString:Number,isNullable:!0},{name:"integrationSettings",relayName:"iS",isMulti:!0,valueToValueString:function(t,n){var e=null;if(t){var i=l.getPlugin(u.PluginTypes.analyticsTrackers,n);if(i&&"function"==typeof i.serializeSettings)try{e=i.serializeSettings(t)}catch(t){s.warn("Analytics / Failed to persist integrationSettings for plugin:",n,t)}}return e},valueFromValueString:function(t,n){var e=null,i=l.getPlugin(u.PluginTypes.analyticsTrackers,n);if(i&&"function"==typeof i.deserializeSettings)try{e=i.deserializeSettings(t)}catch(t){s.warn("Analytics / Failed to persist integrationSettings for plugin:",n,t)}return e},isNullable:!0}],h={},p={};v.forEach((function(t){h[t.name]=t,p[t.relayName]=t})),n.persist=function(t,n){n===f.RedirectRelayMedia.COOKIE?function(t){try{var n=function(t){var n=[],e=Object.keys(t).reduce((function(e,i){var r=t[i],o=h[i];return o?(o.isMulti?Object.keys(r).forEach((function(t){var n=r[t];null!==(n=o.valueToValueString?o.valueToValueString(n,t):String(n))&&(n=(o.encodeValueString||encodeURIComponent)(n),e.push(encodeURIComponent(o.relayName+d+t)+"="+n))})):null!==r&&(r=(o.valueToValueString||String)(r),r=(o.encodeValueString||encodeURIComponent)(r),e.push(o.relayName+"="+r)),e):(n.push(i),e)}),[]);if(n.length)throw new Error("Relay / Don't know how to relay some fields: "+n);return e.sort(),e.join("&")}(t)}
2catch(t){return s.error("Relay / Error computing redirect relay cookie: ",t),void o.emitError(t)}s.debug("Relay / Setting redirect relay cookie:",n);try{r.set(u.COOKIES.REDIRECT,n,{maxAge:5,encodeValue:!1})}catch(t){s.error("Relay / Failed to set redirect relay cookie",t),o.emitError(t)}}(t):s.error("Relay / Unsupported redirect relay medium: "+n)},n.load=function(t){if(t||(t=function(){var t=r.get(u.COOKIES.REDIRECT,!1);if(t)return s.log("Relay / Found redirect cookie:",t),t}()),t){var n=function(t){var n={};return t.split("&").forEach((function(t){var e=t.split("=");if(2===e.length){var i=r.safeDecodeURIComponent(e[0]),a=p[i];if(a||(a=v.find((function(t){return t.isMulti&&0===i.indexOf(t.relayName+d)})))){var u=e[1];try{if(a.isMulti){n[a.name]=n[a.name]||{};var c=i.substring(a.relayName.length+1);u=(a.decodeValueString||r.safeDecodeURIComponent)(u),u=(a.valueFromValueString||function(t){return t})(u,c),n[a.name][c]=u}else u=(a.decodeValueString||r.safeDecodeURIComponent)(u),u=(a.valueFromValueString||function(t){return t})(u),n[a.name]=u}catch(n){return s.warn("Relay / Skipping segment due to decode or parse error:",t,n),void o.emitError(n)}}else s.warn("Relay / Skipping segment with unknown field identifier:",t,i)}else s.warn("Relay / Skipping invalid segment:",t)})),n}(t);if(n){var e=[];if(v.forEach((function(t){null!==n[t.name]&&void 0!==n[t.name]||(t.isNullable?n[t.name]=null:(delete n[t.name],e.push(t.name)))})),!e.length)return c.dispatch(i.LOAD_REDIRECT_DATA,n),c.dispatch(i.ADD_CLEANUP_FN,{lifecycle:u.Lifecycle.postVisitorProfileLoad,cleanupFn:function(){var t,e;e=(t=n).pageId||void 0,c.dispatch(i.RECORD_LAYER_DECISION,{layerId:t.layerId,decision:{layerId:t.layerId,experimentId:t.experimentId,variationId:t.variationId,isLayerHoldback:!1},decisionTicket:{audienceIds:t.decisionTicketAudienceIds,bucketingId:t.visitorId,globalHoldback:0,preferredVariationMap:void 0,pageId:e,activationId:t.activationId},sessionId:t.sessionId,activationId:t.activationId,timestamp:t.timestamp,revision:t.revision,namespace:t.namespace,pageId:e}),c.dispatch(i.RECORD_LAYER_DECISION_EVENT_ID,{layerId:t.layerId,pageId:e,decisionId:t.decisionId}),c.dispatch(i.ACTION_EXECUTED,{sessionId:t.sessionId,layerId:t.layerId,pageId:t.pageId,timestamp:t.timestamp,activationId:t.activationId})}}),n;s.error("Relay / Observed redirect data with missing fields:",e)}}}},525:function(t,n,e){var i=e(6210);n.emitError=function(t,n,e){i.emit({type:"error",name:t.name||"Error",data:{error:t,metadata:n}},e||!1,!0)},n.emitInternalError=function(t,e){n.emitError(t,e,!0)},n.emitAnalyticsEvent=function(t,n){var e={type:"analytics",name:"trackEvent",data:t};i.emit(e,n)}},391:function(t,n,e){var i=e(4681),r=e(2103),o=e(3496),a=e(7649);function u(t,n){var e="function"==typeof t?t(n):t;return"string"==typeof e&&(e=[e]),Array.isArray(e)?e:(o.warn("Couldn't determine fieldsNeeded for matcher; assuming []"),[])}function c(t){return t.name?t.name+" ("+t.id+")":t.id}n.isInAudience=function(t,n,e){var a,s=function(t,n){return function(e){var i=e.type,a=n[i];if(!a)throw new Error("Audience / No matcher found for type="+i);if(a.fieldsNeeded)for(var c=u(a.fieldsNeeded,e),s=0;s<c.length;s++){var f=c[s];if(void 0===r.getFieldValue(t,f))return void o.debug("Audience / Required field",f,"for type",i,"has no value")}o.debug("Matching condition:",e,"to values:",t);var l=a.match(t,e);if(void 0!==l)return!!l}}(t,e);o.groupCollapsed("Checking audience",n.name,n.id,n),o.debug("Visitor Profile:",t);try{var f=i.evaluate(n.conditions,s)}catch(t){a=t,f=!1}return o.groupEnd(),a&&o.error("Audience / Error evaluating audience",c(n),":",a),o.log("Is "+(f?"in":"NOT in")+" audience:",c(n)),f},n.requiredAudienceFieldsForConditions=function t(n,e){var i={};return n.forEach((function(n){if(Array.isArray(n))Object.assign(i,t(n,e));else if(null!==n&&"object"==typeof n){var r=e[n.type];
2if(r)u(r.fieldsNeeded,n).forEach((function(t){i[a.serializeFieldKey(t)]=t}))}})),i}},6085:function(t,n){n.FIELDS={NAME:"n",TIME:"t",TYPE:"y",CATEGORY:"c",REVENUE:"r",SESSION_ID:"s",OPTIONS:"o",SESSION_INDEX:"si"},n.FIELDS_V0_2={name:n.FIELDS.NAME,time:n.FIELDS.TIME,type:n.FIELDS.TYPE,category:n.FIELDS.CATEGORY,tags:n.FIELDS.OPTIONS,session_index:n.FIELDS.SESSION_INDEX}},5507:function(t,n,e){var i=e(6085),r=e(2103).getFieldValue,o=e(243);function a(t,n,e,r,o){this[i.FIELDS.NAME]=t,this[i.FIELDS.TYPE]=n,"string"==typeof e&&e.trim().length>0&&(this[i.FIELDS.CATEGORY]=e),r&&Object.keys(r).length>0&&(this[i.FIELDS.OPTIONS]=r),void 0!==o&&(this[i.FIELDS.REVENUE]=o)}function u(t,n,e,r){this.eventBase=t,this[i.FIELDS.TIME]=n,void 0!==e&&(this[i.FIELDS.SESSION_ID]=e),void 0!==r&&(this[i.FIELDS.SESSION_INDEX]=r)}n._=a,a.prototype.digest=function(){var t=function(t,n){return encodeURIComponent(t)+"="+encodeURIComponent(n)},n=[];if(n.push(t(i.FIELDS.NAME,this[i.FIELDS.NAME])),n.push(t(i.FIELDS.TYPE,this[i.FIELDS.TYPE])),this[i.FIELDS.CATEGORY]&&n.push(t(i.FIELDS.CATEGORY,this[i.FIELDS.CATEGORY])),this[i.FIELDS.REVENUE]&&n.push(t(i.FIELDS.REVENUE,this[i.FIELDS.REVENUE])),!this[i.FIELDS.OPTIONS])return n.join("&");var e=this[i.FIELDS.OPTIONS]||{},r=Object.keys(e).filter((function(t){return e.hasOwnProperty(t)}));r=r.sort();for(var o=0;o<r.length;o++)n.push(t(r[o],e[r[o]]));return n.join("&")},a.prototype.hash=function(){return this.hash_||(this.hash_=o.hashToHex(o.toByteString(this.digest()),o.Seed.BEHAVIOR_EVENT)),this.hash_},a.prototype.setHash=function(t){this.hash_=t},a.prototype.reHash=function(){this.hash_=null,this.hash()},a.prototype.equals=function(t){if(this.hash()!==t.hash()||this[i.FIELDS.NAME]!==t[i.FIELDS.NAME]||this[i.FIELDS.TYPE]!==t[i.FIELDS.TYPE]||this[i.FIELDS.CATEGORY]!==t[i.FIELDS.CATEGORY]||this[i.FIELDS.REVENUE]!==t[i.FIELDS.REVENUE])return!1;var n=this[i.FIELDS.OPTIONS]||{},e=t[i.FIELDS.OPTIONS]||{},r=Object.keys(n).filter((function(t){return n.hasOwnProperty(t)})),o=Object.keys(e).filter((function(t){return e.hasOwnProperty(t)}));if(r.length!==o.length)return!1;for(var a=0;a<r.length;a++){var u=r[a];if(!e.hasOwnProperty(u)||n[u]!==e[u])return!1}return!0},a.prototype.getValueOrDefault=function(t,n){var e=r(this,t);return void 0!==e?e:n},a.prototype.setFieldValue=function(t,n){t!==i.FIELDS.NAME&&t!==i.FIELDS.TYPE&&t!==i.FIELDS.CATEGORY&&t!==i.FIELDS.REVENUE&&t!==i.FIELDS.OPTIONS||(this[t]=n,this.reHash())},n.J=u,u.prototype.getValueOrDefault=function(t,n){if(0===t.length)return this;var e={};e[i.FIELDS.TIME]=this[i.FIELDS.TIME],e[i.FIELDS.SESSION_ID]=this[i.FIELDS.SESSION_ID],e[i.FIELDS.SESSION_INDEX]=this[i.FIELDS.SESSION_INDEX];var o=r(e,t);return void 0!==o?o:this.eventBase.getValueOrDefault(t,n)},u.prototype.setFieldValue=function(t,n){t===i.FIELDS.TIME||t===i.FIELDS.SESSION_ID||t===i.FIELDS.SESSION_INDEX?this[t]=n:this.eventBase.setFieldValue(t,n)};var c={n:"name",y:"type",c:"category",r:"revenue",s:"session_id",o:"tags",si:"session_index"};u.prototype.readableEvent=function(){var t,n,e=function(t){return"string"==typeof t?'"'+t+'"':t},r=this,o=[];[i.FIELDS.NAME,i.FIELDS.TYPE,i.FIELDS.CATEGORY,i.FIELDS.REVENUE,i.FIELDS.SESSION_ID].forEach((function(i){t=c[i],void 0!==(n=r.getValueOrDefault([i]))&&o.push(t+": "+e(n))}));var a=[];if(t=c[i.FIELDS.OPTIONS],void 0!==(n=r.getValueOrDefault([i.FIELDS.OPTIONS]))&&(Object.keys(n).forEach((function(t){var i=n[t];a.push(t+": "+String(e(i)))})),o.push(t+": {\n\t\t"+a.join(",\n\t\t")+"\n\t}")),"number"==typeof(n=r.getValueOrDefault([i.FIELDS.TIME]))&&(n=e(new Date(n).toString())),void 0!==n){o.push("timestamp: "+n)}return"{\n\t"+o.join(",\n\t")+"\n}"},u.prototype.toObject=function(t){var n,e,r={},o=this;[i.FIELDS.NAME,i.FIELDS.TYPE,i.FIELDS.CATEGORY,i.FIELDS.REVENUE,i.FIELDS.OPTIONS,i.FIELDS.SESSION_INDEX].forEach((function(t){n=c[t],void 0!==(e=o.getValueOrDefault([t],t===i.FIELDS.OPTIONS?{}:void 0))&&(r[n]=e)}));var a=c[i.FIELDS.OPTIONS],u=c[i.FIELDS.REVENUE];if(t&&t.revenueAsTag&&r[u]&&(r[a]=r[a]||{},r[a][u]=r[u],delete r[u]),"number"==typeof(e=o.getValueOrDefault([i.FIELDS.TIME])))if(t&&t.timeAsTimestamp){r.timestamp=new Date(e)}else{r.time=e}return r}},6027:function(t,n,e){var i=e(9990);n.initializeStore=i.initialize,n.addEvent=i.addEvent,n.getEvents=i.getEvents,n.getEventC
2ount=i.getEventCount},8129:function(t,n,e){var i=e(5507).J,r=e(6310),o=e(6085),a=e(5507)._;n.CURRENT_SESSION_INDEX=0;var u=18e5;function c(t,e){var i;i=n.isInSameSession(t,e)?t.getValueOrDefault([o.FIELDS.SESSION_ID]):e.getValueOrDefault([o.FIELDS.TIME]),e.setFieldValue(o.FIELDS.SESSION_ID,i)}function s(t,e,i){var r,a=t.getValueOrDefault([o.FIELDS.SESSION_INDEX]);r=n.isInSameSession(e,t)?a:i?a+1:a-1,e.setFieldValue(o.FIELDS.SESSION_INDEX,r)}n.isInSameSession=function(t,n){var e=t.getValueOrDefault([o.FIELDS.TIME],0),i=n.getValueOrDefault([o.FIELDS.TIME],0);return this.isTimestampInSameSession(e,i)},n.isTimestampInSameSession=function(t,n){return Math.abs(t-n)<u},n.updateSessionId=function(t,n){if(t){var e=t.getValueOrDefault([o.FIELDS.TIME]),r=t.getValueOrDefault([o.FIELDS.SESSION_ID]),u=n.getValueOrDefault([o.FIELDS.TIME]);e="number"!=typeof e?u-36e5:e,r="number"!=typeof r?e:r,c(t=new i(new a("",""),e,r),n)}else n.setFieldValue(o.FIELDS.SESSION_ID,n.getValueOrDefault([o.FIELDS.TIME]))},n.updateSessionIndex=function(t,n){if(t){var e=t.getValueOrDefault([o.FIELDS.TIME]),r=t.getValueOrDefault([o.FIELDS.SESSION_INDEX]),u=n.getValueOrDefault([o.FIELDS.TIME]),c=t.getValueOrDefault([o.FIELDS.SESSION_ID]);e="number"!=typeof e?u-36e5:e,r="number"!=typeof r?0:r,c="number"!=typeof c?e:c,s(t=new i(new a("",""),e,c,r),n,!1)}else n.setFieldValue(o.FIELDS.SESSION_INDEX,0)},n.sessionize=function(t){var e=t.length;if(0!==e){t[0].setFieldValue(o.FIELDS.SESSION_ID,t[0].getValueOrDefault([o.FIELDS.TIME]));for(var i=1;i<e;i++)c(t[i-1],t[i]);var a=n.CURRENT_SESSION_INDEX,f=t[e-1].getValueOrDefault([o.FIELDS.TIME]);r.now()-f>u&&(a+=1),t[e-1].setFieldValue(o.FIELDS.SESSION_INDEX,a);for(i=e-1;i>0;i--)s(t[i],t[i-1],!0)}},n.reindexIfNecessary=function(t,n,e){var i=function(t){for(var n=0;n<t.length;n++){var e=t[n].getValueOrDefault([o.FIELDS.SESSION_INDEX]);t[n].setFieldValue(o.FIELDS.SESSION_INDEX,e+1)}};-1===t.getValueOrDefault([o.FIELDS.SESSION_INDEX])&&(i(n),i(e))},n.sessionSortPredicate=function(t,n){return t[o.FIELDS.TIME]-n[o.FIELDS.TIME]},n.applyMigrations=function(t){return!1}},9990:function(t,n,e){var i=e(1756),r=e(2658),o=e(6310),a=e(8701),u=e(3941),c=e(3496),s=e(8129),f=e(7649),l=n,d=e(5507).J,v=e(6085),h=e(2044),p=e(5507)._,g=(s=e(8129),e(3221)),m=g.get("stores/visitor_events"),b=g.get("stores/visitor_events_manager"),_={EVENTBASE:"eb",HASH:"h",TIMEBASE:"tb",TIMESTAMPS:"ts",DELTA:"d",INDEX:"i"},y=1e3;function w(t){u.dispatch(i.SET_VISITOR_EVENTS,t)}function E(t){u.dispatch(i.UPDATE_BEHAVIOR_STORE,{key:"baseMap",value:t})}function I(t){u.dispatch(i.UPDATE_BEHAVIOR_STORE,{key:"eventQueue",value:t})}function A(t){u.dispatch(i.UPDATE_BEHAVIOR_STORE,{key:"lastEvent",value:t})}function T(){return m.getEvents()}function S(){return b.getBaseMap()}function O(){return b.getEventQueue()}function k(){return b.getLastEvent()}function R(){var t=T().concat(O()),n=!1;return t.length>
2y&&(t=t.slice(-1e3),n=!0),w(t),I([]),n}n.initialize=function(t,n){if(!b.getInitialized()){l.I(t,n);var e=T();e.length>0&&A(e[e.length-1]);var r=O();r.length>0&&A(r[r.length-1]),u.dispatch(i.UPDATE_BEHAVIOR_STORE,{key:"initialized",value:!0})}},n.addEvent=function(t){c.debug("Behavior store: adding event",t);var n=l.A(t);A(n),I(O().concat(n)),s.reindexIfNecessary(k(),T(),O()),l.T(O()),n.t&&function(t){try{var n=Number(r.get(h.COOKIES.OPTIMIZELY_SESSION,!1));if(isNaN(n)||0!==n){var e=n?s.isTimestampInSameSession(t,n)?t:0:t;r.set(h.COOKIES.OPTIMIZELY_SESSION,e.toString(),{path:"/",encodeValue:!1},!0)}}catch(t){c.error("Error setting session cookie",t)}}(n.t)},n.getEvents=function(){return O().length>0&&(R()&&s.sessionize(T()),l.S(T()),l.T(O())),T()},n.getEventCount=function(){return O().length+T().length},l.I=function(t,n){l.O(t,n)&&(l.S(T()),l.T(O())),s.sessionize(T())},l.O=function(t,n){if(0===t.length&&0===n.length)return w([]),I([]),!1;var e=!1,i=t[0]||n[0];return _.EVENTBASE in i?(w(l.k(t)),I(l.k(n))):(e=!0,w(l.R(t)),I(l.R(n))),O().length>0&&(R(),e=!0),w(l._updateBaseMapAndMaybeDedupe(T())),l._migrateEventBasesAndUpdateStore()&&(e=!0),e},l.R=function(t){for(var n=[],e=0;e<t.length;e++){var i=t[e],r=l.N(i);n[e]=new d(r,i[v.FIELDS.TIME])}return n},l._migrateEventBasesAndUpdateStore=function(){var t=!1,n=l.D();return s.applyMigrations(n)&&(t=!0,E({}),w(l._updateBaseMapAndMaybeDedupe(T())),I(l._updateBaseMapAndMaybeDedupe(O()))),t},l.j=function(){return o.now()},l.A=function(t){var n,e=t.name,i=t.type||"default",r=t.category||a.OTHER,o=t.tags||{};t.revenue&&(n=t.revenue);var u=new p(e,i,r,o,n);u=l.P(u);var c=l.j(),f=new d(u,c,-1);return s.updateSessionId(k(),f),s.updateSessionIndex(k(),f),f},l._updateBaseMapAndMaybeDedupe=function(t){for(var n=0;n<t.length;n++)t[n].eventBase=l.P(t[n].eventBase);return t},l.S=function(t){var n=l.L(t);f.persistBehaviorEvents(n)},l.T=function(t){var n=l.L(t);f.persistBehaviorEventQueue(n)},l.U=function(){var t;b.getCleared()||(w([]),I([]),l.S(T()),l.T(O()),E({}),A(null),t=!0,u.dispatch(i.UPDATE_BEHAVIOR_STORE,{key:"cleared",value:t}))},l.P=function(t){var n=t.hash(),e=S(),i=e[n];if(void 0===i)return e[n]=[t],E(e),t;for(var r=0;r<i.length;r++)if(t.equals(i[r]))return i[r];return i.push(t),E(e),t},l.D=function(){var t=[],n=S();for(var e in n)!n.hasOwnProperty(e)||(t=t.concat(n[e]));return t},l.L=function(t){for(var n=function(t){var n={};n[v.FIELDS.NAME]=t.getValueOrDefault([v.FIELDS.NAME]),n[v.FIELDS.TYPE]=t.getValueOrDefault([v.FIELDS.TYPE]);var e=t.getValueOrDefault([v.FIELDS.CATEGORY]);void 0!==e&&(n[v.FIELDS.CATEGORY]=e);var i=t.getValueOrDefault([v.FIELDS.REVENUE]);void 0!==i&&(n[v.FIELDS.REVENUE]=i);var r=t.getValueOrDefault([v.FIELDS.OPTIONS]);return void 0!==r&&(n[v.FIELDS.OPTIONS]=r),n},e=_,i=[],r="_idx_",o=0;o<t.length;o++){var a,u,c=t[o],s=c.eventBase;if(s.hasOwnProperty(r)){a=i[s[r]];var f=c[v.FIELDS.TIME]-(a[e.TIMEBASE]||0);(u={})[e.DELTA]=f,u[e.INDEX]=o,a[e.TIMESTAMPS].push(u)}else(a={})[e.EVENTBASE]=n(c),a[e.HASH]=s.hash(),a[e.TIMEBASE]=c[v.FIELDS.TIME],(u={})[e.DELTA]=0,u[e.INDEX]=o,a[e.TIMESTAMPS]=[u],i.push(a),s[r]=i.length-1}for(o=0;o<t.length;o++)delete t[o].eventBase[r];return i},l.N=function(t,n){var e=new p(t[v.FIELDS.NAME],t[v.FIELDS.TYPE],t[v.FIELDS.CATEGORY],t[v.FIELDS.OPTIONS],t[v.FIELDS.REVENUE]);return void 0!==n&&e.setHash(n),e},l.k=function(t){for(var n=_,e=[],i=0;i<t.length;i++)for(var r=t[i],o=l.N(r[n.EVENTBASE],r[n.HASH]),a=r[n.TIMEBASE],u=r[n.TIMESTAMPS],c=0;c<u.length;c++){var s=u[c],f=new d(o,a+s[n.DELTA]);e[s[n.INDEX]]=f}return e},n.deserialize=function(t){return l.k(t)},n.mergeAllEvents=function(t){var n=[].concat.apply([],t);return n.sort(s.sessionSortPredicate),s.sessionize(n),n},n.MAX_EVENTS=y},1756:function(t,n,e){var i=e(762);t.exports=i({LOG:null,SET_LOGLEVEL:null,INITIALIZE_STATE:null,SET_DOMCONTENTLOADED:null,ACTIVATE:null,UPDATE_BEHAVIOR_STORE:null,DATA_LOADED:null,SET_CLIENT_NAME:null,SET_CLIENT_VERSION:null,LOAD_PERSISTED_LAYER_STATES:null,RECORD_GLOBAL_DECISION:null,RECORD_LAYER_DECISION:null,ENSURE_ORIGINAL_PUSHSTATE:null,ENSURE_ORIGINAL_REPLACESTATE:null,SET_VISITOR_ATTRIBUTES:null,SET_VISITOR_ATTRIBUTE_PENDING:null,LOAD_EXISTING_VISITOR_PROFILE:null,SET_VISITOR_EVENTS:null,SET_FOREIGN_VISITOR_EVENTS:null,SET_FOREIGN_VISITOR_EVENT_QUEUE:null,SET_VISITOR_ID:null,SET_VISITOR_ID_VIA_API:null,SET_GA4_USER_ID:null,REFRESH_SESSION:null,LOAD_SESSION_STATE:null,UPDATE_VARIATION_ID_MAP:null,MERGE_VARIATION_ID_MAP:null,UPDATE_PREFERRED_LAYER_MAP:null,MERGE_PREFERRED_LAYER_MAP:null,UPDATE_CONTEXTUAL_MAB_MAP:null,MERGE_CONTEXTUAL_MAB_MAP:null,SET_ODP_SEGMENTS:null,RECORD_LAYER_DECISION_EVENT_ID:null,TRACK_VIEW_ACTIVATED_EVENT:null,REGIST
2ER_ASYNC_DEFERRED:null,RESOLVE_DEFERRED:null,REJECT_DEFERRED:null,REGISTER_PLUGIN:null,ADD_CLEANUP_FN:null,CLEAR_CLEANUP_FN:null,ACTION_EXECUTED:null,REGISTER_ACTION:null,SET_VIEW_ACTIVE_STATE:null,UPDATE_PARSED_VIEW_METADATA:null,UPDATE_USER_SUPPLIED_METADATA:null,REGISTER_VIEWS:null,SET_GLOBAL_TAGS:null,SET_VIEW_BATCHING:null,RESET_VIEW_STATES:null,ATTACH_EVENT_STREAM_PUBLISHERS:null,DETACH_EVENT_STREAM_PUBLISHERS:null,LOAD_DIRECTIVE:null,SET_COOKIE_AGE:null,SET_COOKIE_DOMAIN:null,SET_COOKIE_AUTO_REFRESH:null,XDOMAIN_SET_DEFAULT_FRAME:null,XDOMAIN_ADD_FRAME:null,XDOMAIN_SET_MESSAGE:null,XDOMAIN_ADD_SUBSCRIBER:null,XDOMAIN_SET_CANONICAL_ORIGINS:null,XDOMAIN_SET_DISABLED:null,ADD_EMITTER_HANDLER:null,REMOVE_EMITTER_HANDLER:null,SET_INTEGRATION_SETTINGS:null,ADD_CHANGE:null,SET_CHANGE_APPLIER:null,REMOVE_ACTION_STATE:null,ANNOUNCE_PENDING_REDIRECT:null,LOAD_REDIRECT_DATA:null,REGISTER_TRACKED_REDIRECT_DATA:null,SET_PENDING_EVENT:null,REMOVE_PENDING_EVENT:null,LOAD_PENDING_EVENTS:null,SANDBOXED_FUNCTIONS_ADDED:null,SET_RUM_DATA:null,RECORD_API_USAGE:null,INITIALIZE_CHANGE_METRICS:null,RECORD_ACTIVATION_TYPE_USAGE:null,RECORD_AUDIENCE_USAGE:null,RECORD_CHANGE_MACROTASK_RATE:null,RECORD_CHANGE_OVERHEATED:null,RECORD_CHANGE_TYPE_USAGE:null,RECORD_DOM_OBSERVATION_OCCURENCE:null,RECORD_INTEGRATION_USAGE:null,RECORD_LAYER_FEATURE_USAGE:null,RECORD_LAYER_POLICY_USAGE:null,RECORD_RECOMMENDATIONS_USAGE:null,RECORD_VIEW_FEATURE_USAGE:null,RECORD_VIEWS_INITIALLY_ACTIVATED_COUNT:null,RECORD_VISITOR_ID_LOCATOR_USAGE:null,RECORD_VISITOR_ID_ERROR:null,RECORD_STICKY_BUCKETING_FEATURE:null,SET_PERFORMANCE_MARKS_DATA:null,FINALIZE_BATCH_SNAPSHOT:null,REGISTER_PREVIOUS_BATCH:null,REGISTER_TRACKER_VISITOR:null,REGISTER_TRACKER_EVENT:null,REGISTER_TRACKER_DECISION:null,RESET_TRACKER_EVENTS:null,RESET_TRACKER_PREVIOUS_BATCHES:null,RESET_TRACKER_STORE:null,SET_TRACKER_POLLING:null,SET_TRACKER_BATCHING:null,SET_TRACKER_USE_BEACON:null,SET_TRACKER_SEND_EVENTS:null,SET_TRACKER_PERSISTABLE_STATE:null,SET_TRACKER_DIRTY:null,UPDATE_TRACKER_VISITOR_ATTRIBUTES:null,SET_UA_DATA:null})},2044:function(t,n,e){var i=e(762);n.COOKIES={OPT_OUT:"optimizelyOptOut",PREVIEW:"optimizelyPreview",REDIRECT:"optimizelyRedirectData",SESSION_STATE:"optimizelySessionState",OPTIMIZELY_SESSION:"optimizelySession",TOKEN:"optimizelyToken",VISITOR_ID:"optimizelyEndUserId",VISITOR_UUID:"optimizelyPPID"},n.LayerActivationTypes={CONDITIONAL:"conditional",IMMEDIATE:"immediate",MANUAL:"manual",READY:"ready",TIMEOUT:"timeout"},n.LogLevel={OFF:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},n.Lifecycle=i({preActivate:null,postVisitorProfileLoad:null,postViewsActivated:null,postActivate:null}),n.ViewActivationTypes={immediate:"immediate",manual:"manual",callback:"callback",polling:"polling",URLChanged:"url_changed",DOMChanged:"dom_changed"},n.StorageKeys={PENDING_EVENTS:"pending_events",RELAYED_EVENTS:"relayed_events"},n.PluginTypes=i({visitorProfileProviders:null,viewProviders:null,audienceMatchers:null,viewMatchers:null,analyticsTrackers:null,viewTagLocators:null,userFeatureDefs:null,apiModules:null,changeAppliers:null,deciders:null,eventImplementations:null,viewTriggers:null}),n.ResourceTimingAttributes=i({connectStart:null,connectEnd:null,decodedBodySize:null,domainLookupStart:null,domainLookupEnd:null,duration:null,encodedBodySize:null,fetchStart:null,requestStart:null,responseStart:null,responseEnd:null,secureConnectionStart:null,startTime:null,transferSize:null,serverTiming:null}),n.RUMPerformanceTimingAttributes=i({blockTime:null}),n.AttributionTypes=i({FIRST_TOUCH:null,LAST_TOUCH:null}),n.SandboxedFunctions=i({XMLHttpRequest:null}),n.PerformanceData=i({performance_marks:null,resource_timing:null,performance_timing:null}),n.PerformanceCounters=i({mutation_observer_invocation:null,polling_invocation:null,match_selector_invocation:null}),n.VisitorStorageKeys={EVENTS:"events",EVENT_QUEUE:"event_queue",LAYER_MAP:"layer_map",LAYER_STATES:"layer_states",SESSION_STATE:"session_state",VISITOR_PROFILE:"visitor_profile",VARIATION_MAP:"variation_map",TRACKER_OPTIMIZELY:"tracker_optimizely",CONTEXTUAL_MAB:"contextual_mab",ODP_SEGMENTS:"odp_segments"},n.AllStorageKeys=Object.assign({},n.StorageKeys,n.VisitorStorageKeys),n.ListTargetingKeyTypes={COOKIE:"c",QUERY:"q",JS_VARIABLE:"j"},n.VisitorIdLocatorType={COOKIE:"cookie",JS_VARIABLE:"js",LOCALSTORAGE:"localStorage",QUERY:"query"},n.AllocationPolicyEnum={CMAB:"contextual-multi-arm-bandit",MIN_REGRET:"min-regret",MIN_TIME:"min-time",MANUAL:"manual"}},8701:function(t){t.exports={OTHER:"other"}}
2,3659:function(t,n){n.TYPES={ACTION:"action",ANALYTICS:"analytics",EDITOR:"editor",LIFECYCLE:"lifecycle"}},6167:function(t){t.exports={CLICK:"click",CUSTOM:"custom",ENGAGEMENT:"engagement",PAGEVIEW:"pageview"}},3454:function(t,n,e){var i=e(762);n.TrackLayerDecisionTimingFlags=i({preRedirectPolicy:null,postRedirectPolicy:null,nonRedirectPolicy:null}),n.PreRedirectPolicies=i({PERSIST_BEFORE_AND_TRACK_DURING_REDIRECT:null,PERSIST_BEFORE_REDIRECT:null}),n.PostRedirectPolicies=i({TRACK_IMMEDIATELY:null,TRACK_AFTER_SYNC:null}),n.NonRedirectPolicies=i({TRACK_IMMEDIATELY:null}),n.RedirectRelayMedia=i({COOKIE:null})},8917:function(t,n,e){var i=e(243),r=n.TOTAL_POINTS=1e4;n.bucketingNumber=function(t,n,e){return i.hashToInt(t+n,e,r)},n.isHoldback=function(t,e){return n.bucketingNumber(t,e.id,i.Seed.IGNORING)<(e.holdback||0)},n.chooseWeightedCandidate=function(t,e,r){for(var o=n.bucketingNumber(t,e,i.Seed.BUCKETING),a=0;a<r.length;a++)if(r[a].endOfRange>o)return r[a].entityId;throw new Error("Unable to choose candidate")}},6271:function(t,n,e){var i=e(279).isEmpty,r=e(1756),o=e(8917),a=e(4681),u=e(229).b,c=e(3941),s=e(3496),f=e(9819);n.isValidExperiment=function(t,n){var e;return s.groupCollapsed("Decision / Evaluating audiences for experiment:",n,t),e=!n.audienceIds||a.evaluate(n.audienceIds,(function(n){return t.includes(n)})),s.groupEnd(),s.debug("Decision / Experiment",n,"is valid?",e),e},n.selectVariation=function(t,n,e,i,a){if(s.debug("Decision / Selecting variation for experiment:",t.id),!t.variations||0===t.variations.length)throw new u('No variations in selected experiment "'+t.id+'"');if(!t.weightDistributions&&t.variations.length>1)throw new u('On selected experiment "'+t.id+'", weightDistributions must be defined if # variations > 1');var l;if(t.bucketingStrategy&&"impression"===t.bucketingStrategy)if(1===t.variations.length)l=t.variations[0].id;else{var d=i;l=o.chooseWeightedCandidate(e+d,t.id,t.weightDistributions)}else if(l=1===t.variations.length?t.variations[0].id:o.chooseWeightedCandidate(e,t.id,t.weightDistributions),null==t?void 0:t.deployed)s.debug("Decision / Experiment is deployed. Skipping bucketing.");else if(a&&a[t.id]){s.debug("Decision / Using preferredVariationMap to select variation for experiment:",t.id);var v=a[t.id];if(!t.variations.find((function(t){return t.id===v})))return c.dispatch(r.RECORD_STICKY_BUCKETING_FEATURE,{feature:"stoppedVariation",id:t.id}),s.debug("Decision / Preferred variation:",v,"not found on experiment:",t.id,". Visitor not bucketed."),null;v!==l&&(c.dispatch(r.RECORD_STICKY_BUCKETING_FEATURE,{feature:"preferredVariation",id:t.id}),l=v)}var h=f.processCmabExperiment(t,l);h&&(l=h);var p=t.variations.find((function(t){return t.id===l}));if(p)return s.debug("Decision / Selected variation:",p),p;throw new u('Unable to find selected variation: "'+l+'".')},n.getExperimentById=function(t,n){var e=t.experiments.find((function(t){return t.id===n}));if(e)return e;throw new u("Unable to find selected experiment.")},n.hasVariationActionsOnView=function(t,n){return s.debug("Decision / Checking variation:",t,"for actions on pageId:",n),!!(t.actions||[]).find((function(t){return t.pageId===n&&!i(t.changes)}))}},229:function(t,n){function e(t){this.message=t}e.prototype=new Error,n.b=e},8079:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.pick,a=e(1756),u=e(525),c=e(391),s=e(8917),f=e(6271),l=e(229).b,d=e(3221),v=e(2044),h=e(3941),p=e(5564),g=e(2902),m=e(3496),b=(e(6494),e(1386)),_=d.get("stores/plugins"),y=d.get("stores/global"),w=d.get("stores/layer_data");function E(t){var n=_.getPlugin(v.PluginTypes.deciders,t);if(r(n))throw new Error("No deciders found for policy: "+t);return n}n.isPageIdRelevant=function(t){if(!t)return!1;var n=E(t.policy);return"function"==typeof n.includePageIdInDecisionTicket?n.includePageIdInDecisionTicket(t):!0===n.includePageIdInDecisionTicket},n.createTicket=function(t){var n,e,i,r=o(t,["bucketingId","globalHoldback","preferredVariationMap","pageId"]);return Object.assign(r,{audienceIds:(n=t.visitorProfile,e=t.audiences,i=_.getAllPlugins(v.PluginTypes.audienceMatchers),e.reduce((function(t,e){return c.isInAudience(n,e,i)&&t.pu
2sh(e.id),t}),[])),activationId:y.getActivationId()}),r},n.decideGlobal=function(t){return{isGlobalHoldback:s.isHoldback(t.bucketingId,{id:null,holdback:t.globalHoldback})}},n.decideGroup=function(t,n){m.debug("Decision / Deciding layer for group: ",p.description(t));var e,i,r=n.preferredLayerId,o=!!r;try{(e=s.chooseWeightedCandidate(n.bucketingId,t.id,t.weightDistributions))&&"None"!==e||(i='Group traffic allocation. Visitor maps to a "hole" in the bucket space left by an experiment or campaign that\'s since been removed from the group')}catch(t){i="Group traffic allocation. Visitor maps to a point in the bucket space which has never been covered by any experiment or campaign."}if(o&&(m.debug("Decision / Using preferredLayerMap to select layer for group:",p.description(t)),r!==e&&(h.dispatch(a.RECORD_STICKY_BUCKETING_FEATURE,{feature:"preferredLayer",id:t.id}),e=r)),i)return{layerId:null,reason:i};if(!t.weightDistributions.find((function(t){return t.entityId===e}))){var u="Visitor was"+(o?" sticky-":" non-sticky ")+"bucketed into a campaign ("+e+") which is not in the group";if(!o)throw new l(u);return{layerId:null,reason:u}}return{layerId:e}},n.decideLayer=function(t,n){var e,i;m.debug("Deciding: ",t,n);var o,a,c=E(t.policy),d={layerId:t.id,experimentId:null,variationId:null,isLayerHoldback:s.isHoldback(n.bucketingId,t),isLayerConcluded:!!t.concluded};if(r(t.experiments))throw new l("No experiments in layer.");try{if(c.decideLayer){m.debug("Decision / Using decider's custom decideLayer.");var v=c.decideLayer(t,n);e=v.experiment,i=v.variation}else m.debug("Decision / Using default decideLayer behavior."),e=c.selectExperiment(t,n.audienceIds,n.bucketingId),i=f.selectVariation(e,n.audienceIds,n.bucketingId,n.activationId,n.preferredVariationMap)}catch(t){o=t,(null!=(a=l)&&"undefined"!=typeof Symbol&&a[Symbol.hasInstance]?a[Symbol.hasInstance](o):o instanceof a)?d.reason=t.message:d.error=t}return d.experimentId=e?e.id:null,d.variationId=i?i.id:null,d.error&&(d.error.name="DecisionEngineError",u.emitError(d.error)),d},n.getDummyLayerDecision=function(t,n){var e,i=function(t,n){for(var e=0;e<t.experiments.length;e++)for(var i=0;i<t.experiments[e].variations.length;i++)if(n.indexOf(t.experiments[e].variations[i].id)>-1)return{experimentId:t.experiments[e].id,variationId:t.experiments[e].variations[i].id};return null}(t,n);return i?(m.log("Decision / Applying force variation:",i.variationId,"to Campaign",g.description(t)),e={layerId:t.id,variationId:i.variationId,experimentId:i.experimentId,isLayerHoldback:!1,isLayerConcluded:!1,reason:"force"}):(m.log("No variation matches ids:",n,"in Campaign",g.description(t)),e={layerId:t.id,variationId:null,experimentId:null,isLayerHoldback:!1,isLayerConcluded:!1,reason:"force"}),e},n.isInCohort=function(t){if(!t.experimentId||!t.variationId)return!1;var n=w.get(t.layerId);return!(b.isSingleExperimentPolicy(n.policy)&&t.isLayerHoldback)}},3221:function(t,n,e){var i=e(9716),r=e(3941),o=e(2682),a=i.create(),u={action_data:e(608),async_request:e(4033),audience_data:e(9624),change_data:e(7542),cleanup:e(2735),client_metadata:e(3970),cookie_options:e(7032),event_data:e(5846),event_emitter:e(2910),dimension_data:e(890),directive:e(3650),global:e(8808),history:e(9607),integration_settings:e(6585),layer:e(6946),layer_data:e(3077),log:e(9325),observed_redirect:e(3958),pending_events:e(2446),performance:e(9969),plugins:e(7631),provider_status:e(6631),pending_redirect:e(1663),rum:e(5787),sandbox:e(9688),session:e(8147),tracker_optimizely:e(9794),ua_data:e(5756),view:e(6430),view_data:e(2161),visitor:e(1445),visitor_attribute_entity:e(7918),visitor_events:e(7577),visitor_events_manager:e(4173),visitor_id:e(9221),visitor_bucketing:e(6916),xdomain:e(1943)};u.group_data=e(2091),r.registerStores(u),Object.keys(u).forEach((function(t){a.register("stores/"+t,r.getStore(t))})),a.register("core/plugins/matchers/key_value",o),t.exports=a},7946:function(t,n,e){var i=e(1756),r=e(525),o=e(2658),a=e(9726).v,u=e(2044),c=e(3941),s=e(3496),f=n.JSONParseError=a("JSONParseError"),l=e(2122),d=e(6388),v=e(3898),h="optimizely_show_preview",p="optimizely_disable",g="optimizely_editor",m="optimizely_p13n",b="optimizely_x_audie
2nces",_="optimizely_x",y="optimizely_show_preview",w="optimizely_opt_out",E="optimizely_token",I="optimizely_force_tracking",A="optimizely_embed_editor";n.populateDirectiveData=function(){var t,n,e,a,T,S,O,k,R;!function(){var t="OFF",n=l.getQueryParamValue("optimizely_log");if(n){var e=n.split(":");""!==e[0]&&(t=String(e[0]).toUpperCase()),void 0!==e[1]&&s.setLogMatch(e[1])}s.setLogLevel(t)}(),function(){var t=v.getUserAgent()||"";if("string"!=typeof t)return void s.warn("Directive / userAgent not a string");t=t.toLowerCase(),["googlebot","yahoo! slurp","bingbot","bingpreview","msnbot","keynote","ktxn","khte","gomezagent","alertsite","yottaamonitor","pingdom.com_bot","aihitbot","baiduspider","adsbot-google","mediapartners-google","applebot","catchpoint","phantomjs","moatbot","facebookexternalhit"].some((function(n){if(t.includes(n))return s.warn("Directive / Matches bot:",n),!0}))&&(s.log("Directive / Disabling tracking"),c.dispatch(i.LOAD_DIRECTIVE,{trackingDisabled:!0}))}(),t=window.optimizely?window.optimizely.initialized:void 0,n=Boolean("function"==typeof t?t():t),c.dispatch(i.LOAD_DIRECTIVE,{alreadyInitialized:n}),c.dispatch(i.LOAD_DIRECTIVE,{mutationObserverAPISupported:v.isMutationObserverAPISupported()}),function(){var t=o.get(u.COOKIES.OPT_OUT),n=l.getQueryParamValue(w),e="You have successfully opted out of Optimizely for this domain.",r="You are NOT opted out of Optimizely for this domain.";if("true"===n||"false"===n){var a="true"===n;c.dispatch(i.LOAD_DIRECTIVE,{shouldOptOut:a}),v.alert(a?e:r)}else t&&c.dispatch(i.LOAD_DIRECTIVE,{shouldOptOut:"true"===t})}(),function(){var t=!1,n=[h,p];n.push(g);for(var e=0;e<n.length;e++)if("true"===l.getQueryParamValue(n[e])){s.warn("Directive / Not activating because "+n[e]+" is set."),t=!0;break}c.dispatch(i.LOAD_DIRECTIVE,{disabled:t})}(),c.dispatch(i.LOAD_DIRECTIVE,{isEditor:!1}),c.dispatch(i.LOAD_DIRECTIVE,{isPreview:!1}),(e=l.getQueryParamValue(y))&&s.log("Directive / Is legacy preview mode"),c.dispatch(i.LOAD_DIRECTIVE,{isLegacyPreview:!!e}),c.dispatch(i.LOAD_DIRECTIVE,{isSlave:!1}),a=v.getGlobal("optlyDesktop"),(T=!(!a||void 0===a.p13nInner))&&s.log("Directive / Is running in desktop app editor"),c.dispatch(i.LOAD_DIRECTIVE,{isRunningInDesktopApp:T}),(S="true"===l.getQueryParamValue(m))&&s.log("Directive / Is running in editor"),c.dispatch(i.LOAD_DIRECTIVE,{isRunningInV2Editor:S}),function(){var t=!1,n=v.getGlobal("sessionStorage"),e=l.getQueryParamValue(A);t="true"===e,e&&n&&("true"===e?n.setItem(A,"true"):n.removeItem(A)),n&&"true"===n.getItem(A)&&(t=!0,s.log("Directive / Should mount embedded editor"));c.dispatch(i.LOAD_DIRECTIVE,{requestedEmbeddedEditor:t})}(),O=o.get(u.COOKIES.TOKEN)||null,k=l.getQueryParamValue(E)||O,c.dispatch(i.LOAD_DIRECTIVE,{projectToken:k}),function(){var t=o.get(u.COOKIES.PREVIEW),n=[],e=l.getQueryParamValue(b);if(e)n=o.safeDecodeURIComponent(e).split(",");else if(t)try{n=d.parse(t).forceAudienceIds}catch(n){var a=new f("Failed to parse previewCookie in registerForceAudienceIds: "+t),v={originalMessage:n.message,userError:!0};r.emitError(a,v)}n.length&&(s.log("Directive / Force Audience IDs:",n),c.dispatch(i.LOAD_DIRECTIVE,{forceAudienceIds:n}))}(),function(){var t=o.get(u.COOKIES.PREVIEW),n=[],e=l.getQueryParamValue(_);if(e)n=o.safeDecodeURIComponent(e).split(",");else if(t)try{n=d.parse(t).forceVariationIds}catch(n){var a=new f("Failed to parse previewCookie in registerForceVariationIds: "+t),v={originalMessage:n.message,userError:!0};r.emitError(a,v)}n.length&&(s.log("Directive / Force Variation IDs:",n),c.dispatch(i.LOAD_DIRECTIVE,{forceVariationIds:n}))}(),(R=l.getQueryParamValue(I))&&c.dispatch(i.LOAD_DIRECTIVE,{forceTracking:R})};n.setOptOut=function(t){t?(s.warn("Directive / Opting out"),o.set(u.COOKIES.OPT_OUT,"true",{maxAge:31536e4},!0)):o.remove(u.COOKIES.OPT_OUT),c.dispatch(i.LOAD_DIRECTIVE,{shouldOptOut:t})}},6310:function(t,n){n.now=function(){return+new Date}},6387:function(t,n){n.VERSION="0.258.0",n.NAME="js"},9751:function(t,n,e){var i=e(3221).get("stores/global");n.getDocumentElement=function(){return document.documentElement},n.getCookieString=function(){return document.cookie||""},n.setCookie=function(t){document.cookie=t},n.querySelector=function(t){return document.querySelector(t)},n.querySelectorAll=function(t){return document.querySelectorAll(t)},n.parseUri=function(t){var e=n.createElement("a");return e.href=t,e},n.childrenOf=function(t){return Array.prototype.slice.call(t.querySelectorAll("*"))},n.createElement=function(t){return document.createElement(t)},n.isReady=function(){return i.domContentLoadedHasFired()||"interactive"===document.readyState||"complete"===document.readyState},n.isLoaded=function(){return"complete"===document.readyState},n.addReadyHandler=function(t){return document.addEventListener("DOMContentLoaded",t),function(){n.removeReadyHandler(t)}},n.removeReadyHandler=function(t){return function(){document.removeEventListener("DOMContentLoaded",t)}},n.getReferrer=function(){return document.referrer},n.getReadyState=function(){return document.readyState},n.write=function(t){if("loading"!==n.getReadyState())throw new Error("Aborting attempt to write to already-loaded document");document.write(t)},n.appendToHead=function(t){return n.appendTo(document.head,t)},n.appendTo=function(t,n){t.appendChild(n)},n.addEventListener=function(t,n,e){return document.addEventListener(t,n,e),function(){document.removeEventListener(t,n,e)}},n.getCurrentScript=function(){if(document.currentScript)return document.currentScript},n.parentElement=function(t){for(var n=t.parentNode;n.nodeType!==Node.ELEMENT_NODE;)n=n.parentNode;return n}},7429:function(t,n,e){var i,r,o="optimizely_data",a=e(9726).v,u=e(688),c=e(3898),s=a("StorageError");try{r=c.getGlobal("localStorage")}catch(t){throw new s("Unable to read localStorage: "+t.toString())}if(!r)throw new s("localStorage is undefined");i=u.create(r,o),n.DT=i},4462:function(t,n,e){var i=e(9682);n.create=function(t){return new(i.get("MutationObserver",MutationObserver))(t)},n.observe=function(t,n,e){t.observe(n,e)}},4645:function(t,n,e){var i=e(3341).Promise,r=e(3898);n.estimateStorage=function(){var t=r.getGlobal("navigator");try{return t.storage.estimate()}catch(t){return i.resolve({usage:null,quota:null})}}},6494:function(t,n,e){var i=e(1756),r=e(9726).v,o=e(6310),a=e(3941),u=e(3898),c=e(3221).get("stores/rum"),s="optimizely:",f=n.Error=r("PerformanceError");function l(){return u.getGlobal("performance")}
2n.time=function(t){if(c.getSampleRum()){var n=l();if(n&&n.mark){var e=s+t;n.clearMarks(e+"Begin"),n.mark(e+"Begin")}}},n.timeEnd=function(t){if(c.getSampleRum()){var n=l();if(n&&n.mark){var e=s+t,r=n.getEntriesByName(e+"Begin");if(0===r.length)throw new f("Called timeEnd without matching time: "+t);n.clearMarks(e+"End"),n.mark(e+"End");var o=t+"Time",u=n.getEntriesByName(e+"End")[0].startTime-r[0].startTime;a.dispatch(i.SET_PERFORMANCE_MARKS_DATA,{name:o,data:{startTime:Math.round(1e3*r[0].startTime)/1e3,duration:Math.round(1e3*u)/1e3}})}}},n.setMark=function(t,n,e){if(c.getSampleRum()){var r=l();if(r&&r.mark){var o=s+t;r.mark(o),a.dispatch(i.SET_PERFORMANCE_MARKS_DATA,{name:t,data:{startTime:Math.round(1e3*n)/1e3,duration:Math.round(1e3*e)/1e3}})}}},n.now=function(){var t=l();return t?t.now():o.now()}},9682:function(t,n){n.get=function(t,n){try{var e=window.Zone;if(e&&"function"==typeof e.V){var i=window[e.V(t)];if("function"==typeof i)return i}}catch(t){}return n}},3898:function(t,n,e){var i=e(3496);n.getUserAgent=function(){return window.navigator.userAgent},n.getLocationSearch=function(){return window.location.search},n.getNavigatorLanguage=function(){return window.navigator.language||window.navigator.userLanguage},n.getHref=function(){return window.location.href},n.getLocation=function(){return window.location},n.setLocation=function(t){window.location.replace(t)},n.setGlobal=function(t,n){window[t]=n},n.getGlobal=function(t){return window[t]},n.getGlobalByPath=function(t){for(var n=t.split("."),e=window;n.length;)try{e=e[n.shift()]}catch(n){throw i.error("Attempted to access nonexistent property. Path ",t),new Error("Attempted to access nonexistent property. Path "+t)}return e},n.addEventListener=function(){return window.addEventListener.apply(window,arguments)},n.removeEventListener=function(){return window.removeEventListener.apply(window,arguments)},n.isMutationObserverAPISupported=function(){return void 0!==window.MutationObserver},n.alert=function(t){alert(t)},n.setTimeout=function(t,n){return setTimeout((function(){try{t()}catch(t){i.warn("Deferred function threw error:",t)}}),n)},n.setInterval=function(t,n){return setInterval((function(){try{t()}catch(t){i.warn("Polling function threw error:",t)}}),n)}},295:function(t,n){n.create=function(t,n,e,i){return Object.assign({category:"other"},i,{id:t,apiName:n,eventType:e})}},6210:function(t,n,e){var i=e(167),r=e(1756),o=e(525),a=e(3221),u=e(3941),c=e(3496),s=a.get("stores/event_emitter");n.on=function(t){return t.token||(t.token=i.generate()),u.dispatch(r.ADD_EMITTER_HANDLER,t),t.token},n.off=function(t){u.dispatch(r.REMOVE_EMITTER_HANDLER,{token:t})},n.emit=function(t,n,e){s.getHandlers(t,n).forEach((function(i){try{i.handler.call({$di:a},t)}catch(r){!e&&i.emitErrors?(c.error("Error in handler for event:",t,r),o.emitError(r,null,n)):c.warn("Suppressed error in handler for event:",t,r)}}))}},879:function(t,n,e){var i=e(6210);n.on=function(t){return t.publicOnly=!0,i.on(t)},n.off=i.off,n.emit=function(t){i.emit(t)}},3816:function(__unused_webpack_module,exports,__webpack_require__){var createError=__webpack_require__(4254),di=__webpack_require__(3221),Logger=__webpack_require__(3496),CSP_MODE=!1,EXEC_WITH_JQUERY=!0,ExecError=exports.Error=createError("ExecError");exports.apply=function(t,n){n=(n=n||[]).concat(di.get("env/jquery"));try{return t.apply(void 0,n)}catch(e){throw Logger.warn("Error applying function",t,"with args:",n,e),new ExecError(e)}},exports.eval=function(str){try{return str="var $ = optimizely.get('jquery');"+str,eval(str)}catch(t){throw Logger.warn("Error executing JS:",str,t),new ExecError(t)}}},3941:function(t,n,e){var i=e(7283);t.exports=i.create()},5564:function(t,n){n.description=function(t){var n=!!t.name?'"'+t.name+'" ':"",e=function(t){return(t.weightDistributions||[]).map((function(t){return t.entityId}))}(t).join(", ");return n+"(id "+t.id+", campaigns: "+e+")"}},2902:function(t,n,e){var i=e(279).flattenDeep,r=e(1756),o=e(6310),a=e(3221),u=e(3941),c=a.get("stores/global"),s=a.get("stores/session");n.recordLayerDecision=function(t,n,e){return u.dispatch(r.RECORD_LAYER_DECISION,{layerId:t,decision:e,decisionTicket:n,sessionId:s.getSessionId(),activationId:c.getActivationId(),timestamp:o.now(),revision:c.getRevision(),namespace:c.getNamespace(),pageId:n.pageId}),e},n.relatedAudienceIds=function(t){var n={},e=["and","or","not"];
2return(t.experiments||[]).forEach((function(t){i(t.audienceIds).forEach((function(t){e.includes(t)||(n[t]=!0)}))})),Object.keys(n)},n.getActivationTimeout=function(t){var n=t.activation;return n&&null!==n.timeout&&void 0!==n.timeout?n.timeout:2e3},n.description=function(t){return(t.name?'"'+t.name+'" ':"")+"("+t.id+")"},n.createSingle=function(t,n,e){return{id:t,policy:"single_experiment",holdback:0,experiments:[{id:n||"",variations:[{id:e||"",actions:[]}],audienceIds:[]}],integrationStringVersion:1}},n.createLayerState=function(t,n,e,i,r){return void 0===i&&(i=!1),void 0===r&&(r=!1),{layerId:t,decision:{layerId:t,experimentId:n,variationId:e,isLayerHoldback:i||!1,isLayerConcluded:r||!1},decisionTicket:{audienceIds:[]}}},n.getIntegrationTypes=function(t){return Object.keys(Object.keys(t.integrationSettings).reduce((function(t,n){return Number.isNaN(Number(n))||(n="custom"),t[n]=1,t}),{}))}},6036:function(t,n){n.G=function(t,n){if(!n)return 0;for(var e=n.toString().split("."),i=t.toString().split("."),r=0;r<e.length;r++){if(void 0===i[r])return-1;if(isNaN(Number(i[r]))){if(i[r]!==e[r])return-1}else{if(Number(i[r])<Number(e[r]))return-1;if(Number(i[r])>Number(e[r]))return 1}}return 0}},4681:function(t,n,e){var i=e(6388),r=e(3496),o="or",a="not";var u={};function c(t,n){var e;if(Array.isArray(t)){var a,c;"string"==typeof t[0]&&t[0]in u?(a=t[0],c=t.slice(1)):(a=o,c=t),r.groupCollapsed('Condition / Applying operator "'+a+'" with args',i.stringify(c));try{e=u[a](c,n),r.debug("Condition / Result:",e)}finally{r.groupEnd()}return e}return e=n(t),r.debug("Condition / Evaluated:",i.stringify(t),":",e),e}u["and"]=function(t,n){for(var e,i,r=0;r<t.length;r++){if(!1===(e=c(t[r],n)))return!1;void 0===e&&(i=!0)}if(!i)return!0},u[o]=function(t,n){for(var e,i=!1,r=0;r<t.length;r++){if(!0===(e=c(t[r],n)))return!0;void 0===e&&(i=!0)}if(!i)return!1},u[a]=function(t,n){if(1!==t.length)return!1;var e=c(t[0],n);return void 0!==e?!e:void 0},t.exports={evaluate:c}},8409:function(t,n,e){var i=e(4779);function r(t){return(t=(t||"").toLowerCase())in u?t:Object.keys(u).find((function(n){return u[n].includes(t)}))||"unknown"}function o(t,n,e){return n||("unknown"===t?"unknown":e?"mobile":"desktop_laptop")}n.parseUA=function(t){var n=new i(t),e=n.getBrowser(),u=n.getOS(),s=n.getDevice(),f=(u.name||"unknown").toLowerCase(),l=(e.name||"unknown").toLowerCase(),d=function(t){var n=/\b(iPad|iPhone)\d+,\d+/i.exec(t);return n?n[1].toLowerCase():null}(t),v="ipad"===d?"tablet":s.type,h=a(v,l,f);return{browser:{id:r(e.name),version:e.version},platform:{name:f,version:u.version},device:{model:c[s.model]||d||"unknown",type:o(l,v,h),isMobile:h}}};var a=function(t,n,e){if(["mobile","tablet"].includes(t)||["opera mini"].includes(n))return!0;return!!["android","blackberry","ios","windows phone"].includes(e)},u={gc:["chrome","chromium","silk","yandex","maxthon","chrome webview"],edge:["edge"],ie:["internet explorer","iemobile"],ff:["firefox","iceweasel"],opera:["opera","opera mini","opera tablet"],safari:["safari","mobile safari","webkit"],ucbrowser:["uc browser"]},c={iPhone:"iphone",iPad:"ipad"}},9716:function(t){function n(){this.B={}}n.prototype.register=function(t,n){if(1!==arguments.length){if(this.B[t])throw new Error("Module already registered for: "+t);this.B[t]=n}else{var e=this;Object.keys(t).forEach((function(n){var i=t[n];e.register(n,i)}))}},n.prototype.get=function(t){return this.B[t]},n.prototype.getModuleKeys=function(){var t=this.B;return Object.keys(t)},n.prototype.evaluate=function(t){var n=t.length,e=t.slice(0,n-1),i=t[n-1];if("function"!=typeof i)throw new Error("Evaluate must take a function as last element in array");var r=e.map(this.get,this);return i.apply(null,r)},n.prototype.reset=function(){this.B={}},t.exports={create:function(){return new n}}},8564:function(t,n,e){var i=e(279).cloneDeep;function r(t,n,e){this.q=t,this.H=n,this.Y=0,this.K=!1,this.$={},Object.assign(this,e),this.W={},this.initialize&&this.initialize()}r.prototype.X=function(t,n){var e=this.$[t];e&&"function"==typeof e&&e.call(this,n,t)},r.prototype.Z=function(){return i(this.W)},r.prototype.on=function(t,n){this.$[t]=n.bind(this)},r.prototype.observe=function(t){return this.H.tt(this.q,t)},r.prototype.emitChange=function(){this.K=!0,this.Y++},r.prototype.hasChanges=function(){return this.K},r.prototype.resetChange=function(){this.K=!1},r.prototype.getStateId=function(){return this.Y},r.prototype.nt=function(){this.reset&&"function"==typeof this.reset&&this.reset(),this.initialize()},t.exports=r},7283:function(t,n,e){var i=e(8564);function r(t){t=t||{},this.et={},this.it={},this.rt=0,this.ot=[],this.ut=[]}function o(t,n){return function(){var e=t.indexOf(n);-1!==e&&t.splice(e,1)}}r.prototype.registerStores=function(t){Object.keys(t).forEach((function(n){this.et[n]=new i(n,this,t[n])}),this)},r.prototype.getStore=function(t){return this.et[t]},r.prototype.dispatch=function(t,n){this.dispatchId++;var e=this;this.ot.forEach((function(i){i.call(e,t,n)}));var i=this.et;
2Object.keys(i).forEach((function(e){i[e].X(t,n)})),this.ut.forEach((function(i){i.call(e,t,n)})),Object.keys(i).forEach((function(t){var n=i[t];n.hasChanges()&&this.it[t]&&(n.resetChange(),this.it[t].forEach((function(t){t(n)})))}),this)},r.prototype.reset=function(){this.it={};var t=this.et;Object.keys(t).forEach((function(n){t[n].nt()}))},r.prototype.getState=function(){var t={},n=this.et;return Object.keys(n).forEach((function(e){t[e]=n[e].Z()})),t},r.prototype.onPreAction=function(t){var n=this.ot;return n.push(t),o(n,t)},r.prototype.onPostAction=function(t){var n=this.ut;return n.push(t),o(n,t)},r.prototype.tt=function(t,n){return this.it[t]||(this.it[t]=[]),this.it[t].push(n),o(this.it[t],n)},t.exports={create:function(t){return new r(t)}}},6388:function(t,n){n.stringify=function(){var t=arguments;return function(t){var n,e,i=[Array.prototype],r=[];i.forEach((function(t){void 0!==t.toJSON&&(r.push(t.toJSON),delete t.toJSON)}));try{n=t()}catch(t){e=t}finally{r.forEach((function(t,n){i[n].toJSON=t}))}if(e)throw e;return n}((function(){return JSON.stringify.apply(null,t)}))},n.parse=JSON.parse},8681:function(t,n){n.hasMatch=function(t,n,e){var i=null!=e,r=null!=t;switch(n||(r?"exact":"exists")){case"exists":return i;case"exact":return i&&String(e)===t;case"substring":return i&&String(e).indexOf(t)>-1;case"regex":try{return!(!r||!i)&&new RegExp(t).test(String(e))}catch(t){}return!1;case"range":var o=t.split(":"),a=parseFloat(o[0]),u=parseFloat(o[1]),c=parseFloat(e);return c>=a&&c<=u;default:return!1}}},3341:function(t,n,e){t.exports=e(8535)},688:function(t,n,e){var i=e(3496);function r(t,n){this.ct=t,this.st=n}r.prototype.ft=function(t){return[this.st,t].join("$$")},r.prototype.dt=function(t){return t.replace(this.st+"$$","")},r.prototype.setItem=function(t,n){try{this.ct.setItem(this.ft(t),n)}catch(n){i.warn("Failed to save",t,"to localStorage:",n)}},r.prototype.removeItem=function(t){this.ct.removeItem(this.ft(t))},r.prototype.getItem=function(t){var n=null;try{n=this.ct.getItem(this.ft(t))}catch(t){}return n},r.prototype.keys=function(){var t=this;return Object.keys(this.ct).filter((function(n){return n.includes(t.st)})).map((function(n){return t.dt(n)}))},r.prototype.allKeys=function(){return Object.keys(this.ct)},r.prototype.allValues=function(){return Object.values(this.ct)},t.exports={create:function(t,n){return new r(t,n)},mockStorage:{keys:function(){},getItem:function(t){},removeItem:function(t){},setItem:function(t,n){}}}},7108:function(t,n,e){var i=e(279).isEmpty,r=e(525),o=e(2044),a=e(6388),u=e(7429).DT,c=e(3496),s=e(3341),f=e(4464),l=e(3221).get("stores/pending_events"),d=o.StorageKeys.PENDING_EVENTS,v=!1;n.persistPendingEvents=function(){try{var t=l.getEventsString();u.setItem(d,t),e(9232).setItem(d,t)}catch(t){c.warn("PendingEvents / Unable to set localStorage key, error was: ",t),r.emitInternalError(t)}},n.flushPersistPendingEvents=function(){v&&(v=!1,n.persistPendingEvents())},n.schedulePersistPendingEvents=function(){v||(v=!0,s.resolve().then(n.flushPersistPendingEvents).catch((function(t){c.warn("PendingEvents / Unable to persist pending events, error was: ",t)})))},n.getPendingEvents=function(){try{return a.parse(u.getItem(d))}catch(t){return null}},n.retryPendingEvents=function(t){Object.keys(t).forEach((function(n){var e=t[n];f.retryableRequest(e.data,n,e.retryCount)})),i(t)||c.log("Retried pending events: ",t)}},5213:function(t,n,e){var i=e(279).cloneDeep,r=e(1756),o=e(3221),a=e(2044),u=e(6210),c=e(3941);n.registerApiModule=function(t,n){Array.isArray(n)&&(n=o.evaluate(n)),c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.apiModules,name:t,plugin:n})},n.registerDependency=function(t,n){o.get(t)||o.register(t,n)},n.registerVisitorProfileProvider=function(t){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.visitorProfileProviders,name:t.provides,plugin:t})},n.registerViewProvider=function(t){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.viewProviders,name:t.provides,plugin:t})},n.registerAudienceMatcher=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.audienceMatchers,name:t,plugin:n})}
2,n.registerViewMatcher=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.viewMatchers,name:t,plugin:n})},n.registerAnalyticsTracker=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.analyticsTrackers,name:t,plugin:n})},n.registerViewTagLocator=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.viewTagLocators,name:t,plugin:n})},n.registerAudiencePlugin=function(t){t.dependencies&&Object.keys(t.dependencies).forEach((function(e){var i=t.dependencies[e];n.registerDependency(e,i)}));var e,r,a="vendor."+t.vendor;e="string"==typeof t.provider?o.get(t.provider)(t.vendor):"function"==typeof t.provider?t.provider(t.vendor):i(t.provider),n.registerVisitorProfileProvider(Object.assign(e,{provides:a})),r="string"==typeof t.matcher?o.get(t.matcher):t.matcher;var u={fieldsNeeded:[a],match:function(t,n){return r(t[a],n)}};n.registerAudienceMatcher(a,u)};var s={};n.registerWidget=function(t){Array.isArray(t)&&(t=o.evaluate(t));var n=t.widgetId,e=s[n];e&&(u.off(e.showToken),u.off(e.hideToken));var i=u.on({filter:{type:"showWidget",name:n},handler:t.showFn}),r=u.on({filter:{type:"hideWidget",name:n},handler:t.hideFn});return s[n]={showToken:i,hideToken:r},s[n]},n.hasWidget=function(t){return Object.prototype.hasOwnProperty.call(s,t)},n.registerChangeApplier=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.changeAppliers,name:t,plugin:n})},n.registerDecider=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.deciders,name:t,plugin:n})},n.registerEventImplementation=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.eventImplementations,name:t,plugin:n})},n.registerViewTrigger=function(t,n){c.dispatch(r.REGISTER_PLUGIN,{type:a.PluginTypes.viewTriggers,name:t,plugin:n})}},6555:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.mapValues,a=e(3221),u=":",c="holdback",s="treatment",f="",l=e(3496),d=e(1386);function v(t){return t.replace(/[^a-zA-Z0-9\.\~\!\*\(\)\']+/g,"_")}n.formatNamesAndIdsForAnalytics=function(t,n,e,i){var u={layer:t.name||f,experiment:n.name||f,variation:e.name||f};i&&(u=o(u,v));var c,s=!t.integrationStringVersion||1===t.integrationStringVersion;if(u.experiment===f&&s)if(c=n.audienceIds,r(c)||-1===["and","or","not"].indexOf(c[0])){var l=a.get("stores/audience_data");u.experiment=function(t,n){return r(n)?"everyone_else":n.reduce((function(n,e){var i=t.get(e);return i?n+v(i.name?i.name:i.id)+",":n}),"").slice(0,-1)}(l,n.audienceIds)}else u.experiment="Exp";return{names:u,idStrings:{layer:"("+v(t.id)+")",experiment:"("+v(n.id)+")",variation:"("+v(e.id)+")"}}},n.combineAndTruncateIdAndName=function(t,n,e){var i=e-n.length;if(i<0&&(l.warn("maxLength must be at least long enough to fit the entity ID, which is length"+n.length+". Defaulting to only use entity ID as name."),t=f),t===f)return n;if(t.length>i){var r=Math.min(t.length,i);return(t=t.substring(0,r))+n}return t+" "+n},n.generateAnalyticsString=function(t,e,i,r,o,a){return t.integrationStringVersion&&2===t.integrationStringVersion?function(t,e,i,r,o,a){if(d.isSingleExperimentPolicy(t.policy)&&r)return;var s=!d.isSingleExperimentPolicy(t.policy)&&r,f=n.formatNamesAndIdsForAnalytics(t,e,i,a),l=[f.names.experiment,f.names.variation],v=[f.idStrings.experiment,f.idStrings.variation];d.isSingleExperimentPolicy(t.policy)||(l.unshift(f.names.layer),v.unshift(f.idStrings.layer));var h=v.reduce((function(t,n){return t+n.length}),0),p=l.length-1+(s?1:0),g=h+1*p;if(s&&(g+=8),g>o)throw new Error("The analytics string size is too low to send the entity IDs.");for(var m=o-g,b=l.length,_=[],y=l.length-1;y>=0;y--){var w=l[y],E=Math.min(w.length,Math.floor(m/b));m-=E,b--,_.unshift(w.substring(0,E))}var I=_.map((function(t,n){return t+v[n]}));return s&&I.push(c),I.join(u)}(t,e,i,r,o,a):function(t,e,i,r,o,a){var f=r?c:s,l=3,v=n.formatNamesAndIdsForAnalytics(t,e,i,a),h=v.names,p=v.idStrings,g=Object.values(p).reduce((function(t,n){return t+n.length}),0);if(g+l+f.length>o)throw new Error("The analytics string size is too low to send the campaign, experiment, and variation IDs.");var m=o-g-l-f.length,b={};b.variation=Math.min(h.variation.length,Math.floor(m/3)),m-=b.variation,b.experiment=Math.min(h.experiment.length,Math.floor(m/2)),m-=b.experiment,b.layer=m;var _={};
2Object.keys(h).forEach((function(t){var n=h[t];_[t]=n.substring(0,b[t])}));var y=[];return d.isSingleExperimentPolicy(t.policy)||y.push(_.layer+p.layer),(y=y.concat([_.experiment+p.experiment,_.variation+p.variation,f])).join(u)}(t,e,i,r,o,a)}},2034:function(t){t.exports=function(t,n){t=function(t){var n=t.split("?");if(n[1]){var i=n[1].split("#"),r=i[0],o=i.slice(1).join("#"),a=r.split("&"),u=[];return a.forEach((function(t){0!==t.indexOf(e)&&u.push(t)})),n[1]="",u.length>0&&(n[1]="?"+u.join("&")),o&&(n[1]+="#"+o),n.join("")}return t}(t);var i=n.value;switch(n.match){case"exact":return(t=o(t))===o(i);case"regex":try{return Boolean(t.match(i))}catch(t){}return!1;case"simple":return(t=r(t))===(i=r(i));case"substring":return t=o(t,!0),i=o(i,!0),-1!==t.indexOf(i);default:return!1}};var n=["www."],e="optimizely_",i=["https?://.*?.?optimizelyedit.(com|test)/","https?://.*.?optimizelypreview.(com|test)/","https?://(edit|preview)(-hrd|-devel)?.optimizely.(com|test)/","https?://.*?.?optimizelyedit(-hrd)?.appspot.com/","https?://"];function r(t){return o(function(t){var n=t.indexOf("?");return-1!==n&&(t=t.substring(0,n)),-1!==(n=t.indexOf("#"))&&(t=t.substring(0,n)),t}(t))}function o(t,e){t=(t=t.replace("/?","?")).toLowerCase().replace(/[/&?]+$/,"");var r=i.slice(0);e||(r=r.concat(n));for(var o=r.length,a=0;a<o;a++){var u=r[a],c=new RegExp("^"+u);t=t.replace(c,"")}return t}},2682:function(t,n,e){var i=e(2103).getFieldValue,r=e(8681);t.exports=function(t,n){var e=i(t,n.name.split("."));return Array.isArray(e)?e.some((function(t){return r.hasMatch(n.value,n.match,t)})):r.hasMatch(n.value,n.match,e)}},815:function(t,n,e){var i=e(8548),r=e(7743),o="cdn3";n.getIP=function(){return i.makeAsyncRequest(o,u).then((function(t){return t.ip}))},n.getIPDerivedGeolocation=function(){return i.makeAsyncRequest(o,u).then((function(t){return t.location}))};var a="//cdn3.optimizely.com/js/geo4.js";function u(){r.addScriptAsync(a,void 0,"script")}},608:function(t,n,e){var i=e(1756),r=e(1423),o=e(3496),a=e(279).isEmpty;t.exports={initialize:function(){this.W={actions:{},actionState:{}},this.on(i.DATA_LOADED,this.vt),this.on(i.ACTION_EXECUTED,this.ht),this.on(i.SET_CHANGE_APPLIER,this.bt),this.on(i.REMOVE_ACTION_STATE,this._t)},vt:function(t){var n=this;a(t.data.layers)||(t.data.layers.forEach((function(t){var e;if(t.changes){var i="layerId:"+t.id;e={id:i,layerId:t.id,changeSet:t.changes,type:"layer"},r.deepFreeze(e),n.W.actions[i]=e}(t.experiments||[]).forEach((function(i){if(i.changes){var o="experimentId:"+i.id;e={id:o,layerId:t.id,experimentId:i.id,changeSet:i.changes,type:"experiment"},r.deepFreeze(e),n.W.actions[o]=e}(i.variations||[]).forEach((function(o){(o.actions||[]).forEach((function(a){var u=a.pageId||a.viewId,c=i.id+":"+o.id+":"+u;e={id:c,layerId:t.id,experimentId:i.id,variationId:o.id,pageId:u,changeSet:a.changes,type:"variation"},r.deepFreeze(e),n.W.actions[c]=e}))}))}))})),this.emitChange())},ht:function(t){var n=t.actionId;void 0===n||this.W.actionState[n]||(this.W.actionState[n]={})},bt:function(t){var n=t.actionId,e=t.changeId;this.W.actionState[n]?this.W.actionState[n][e]=t.changeApplier:o.warn("Action Data / Attempted to set changeApplier for inactive action: ",n)},_t:function(t){delete this.W.actionState[t.actionId]},get:function(t){return r.safeReference(this.W.actions[t])},getActionState:function(t){return r.safeReference(this.W.actionState[t])},getByChangeId:function(t){return Object.values(this.W.actions).find((function(n){return n.changeSet&&n.changeSet.some((function(n){return n.id===t}))}))},getAllActionIdsByPageId:function(t){return Object.values(this.W.actions).filter((function(n){return n.pageId===t})).map((function(t){return t.id}))},getChangeApplier:function(t,n){var e=this.W.actionState[n];if(e)return e[t]}
2,getExperimentVariationActions:function(t,n){return r.safeReference(Object.values(this.W.actions).filter((function(e){return e.experimentId===t&&e.variationId===n})))},getLayerActions:function(t){return r.safeReference(Object.values(this.W.actions).filter((function(n){return n.id==="layerId:"+t})))},getExperimentActions:function(t){return r.safeReference(Object.values(this.W.actions).filter((function(n){return n.id==="experimentId:"+t})))},getAll:function(){return r.safeReference(Object.values(this.W.actions))}}},4033:function(t,n,e){var i=e(1756);t.exports={initialize:function(){this.W={},this.on(i.REGISTER_ASYNC_DEFERRED,this.yt),this.on(i.RESOLVE_DEFERRED,this.wt),this.on(i.REJECT_DEFERRED,this.Et)},getRequest:function(t){return this.W[t]},getPromise:function(t){var n=this.getRequest(t);if(n)return n.promise},yt:function(t){this.W[t.source]={promise:t.promise,resolver:t.resolver,rejecter:t.rejecter}},wt:function(t){var n=this.getRequest(t.source);if(!n)throw new Error("No request registered for source: "+t.source);n.resolver(t.resolveWith)},Et:function(t){var n=this.getRequest(t.source);if(!n)throw new Error("No request registered for source: "+t.source);if(!n.rejecter)throw new Error("No rejecter registered for source: "+t.source);n.rejecter(t.rejectWith)}}},9624:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.merge,a=e(1756),u=e(1423);function c(t,n){return n||(n={}),t?(t.forEach((function(t){if("string"!=typeof t){if("object"==typeof t&&null!==t&&!Array.isArray(t)){var e=t.type,i=t.name||"_";n[e]||(n[e]={}),n[e][i]=!0}Array.isArray(t)&&c(t,n)}})),n):n}t.exports={initialize:function(){this.W={audiences:{},featuresNeeded:{}},this.on(a.DATA_LOADED,this.vt)},vt:function(t){if(!r(t.data.audiences)){var n=this;t.data.audiences.forEach((function(t){u.deepFreeze(t),o(n.W.featuresNeeded,c(t.conditions)),n.W.audiences[t.id]=t})),this.emitChange()}},getAll:function(){return u.safeReference(Object.values(this.W.audiences))},getFeaturesNeeded:function(t){return u.safeReference(this.W.featuresNeeded[t]||{})},getAudiencesMap:function(){return u.safeReference(this.W.audiences)},get:function(t){return u.safeReference(this.W.audiences[t])},getAudienceName:function(t){return Object.values(this.W.audiences).find((function(n){return n.id===t})).name||"Aud "+t}}},7542:function(t,n,e){var i=e(279).isEmpty,r=e(1756),o=e(1423);t.exports={initialize:function(){this.W={},this.on(r.ADD_CHANGE,this.It),this.on(r.DATA_LOADED,this.vt)},getChange:function(t){return this.W[t]},vt:function(t){if(!i(t.data.changes)){var n=this;
2t.data.changes.forEach((function(t){n.It(t)}))}},It:function(t){o.deepFreeze(t),this.W[t.id]=t,this.emitChange()}}},2735:function(t,n,e){var i=e(279).cloneDeep,r=e(1756),o=e(2044);t.exports={initialize:function(){this.W={};var t=this;Object.keys(o.Lifecycle).forEach((function(n){var e=o.Lifecycle[n];t.W[e]=[]})),this.on(r.ADD_CLEANUP_FN,this.At),this.on(r.CLEAR_CLEANUP_FN,this.Tt)},getCleanupFns:function(t){return i(this.W[t])},At:function(t){this.W[t.lifecycle].push(t.cleanupFn),this.emitChange()},Tt:function(t){var n=this.W[t.lifecycle];if(t.cleanupFn){var e=n.indexOf(t.cleanupFn);e>-1&&(n.splice(e,1),this.emitChange())}else this.W[t.lifecycle]=[],this.emitChange()}}},3970:function(t,n,e){var i=e(1756),r=e(6387);t.exports={initialize:function(){this.W={name:r.NAME,version:r.VERSION},this.on(i.SET_CLIENT_NAME,this.St),this.on(i.SET_CLIENT_VERSION,this.Ot)},getClientName:function(){return this.W.name},getClientVersion:function(){return this.W.version},St:function(t){t&&(this.W.name=t),this.emitChange()},Ot:function(t){t&&(this.W.version=t),this.emitChange()}}},7032:function(t,n,e){var i=e(1756);t.exports={initialize:function(){this.W={currentDomain:null,defaultAgeSeconds:15552e3,autoRefresh:true},this.on(i.SET_COOKIE_DOMAIN,this.kt),this.on(i.SET_COOKIE_AGE,this.Rt),this.on(i.SET_COOKIE_AUTO_REFRESH,this.Nt)},getCurrentDomain:function(){return this.W.currentDomain},getDefaultAgeInSeconds:function(){return this.W.defaultAgeSeconds},getAutoRefresh:function(){return this.W.autoRefresh},kt:function(t){this.W.currentDomain=t,this.emitChange()},Rt:function(t){this.W.defaultAgeSeconds=t,this.emitChange()},Nt:function(t){this.W.autoRefresh=t,this.emitChange()}}},890:function(t,n,e){var i=e(1756),r=e(1423),o=e(279).isEmpty;t.exports={initialize:function(){this.W={},this.on(i.DATA_LOADED,this.vt)},vt:function(t){if(!o(t.data.dimensions)){var n=this;t.data.dimensions.forEach((function(t){r.deepFreeze(t),n.W[t.id]=t})),this.emitChange()}}
2,getAll:function(){return r.safeReference(Object.values(this.W))},getById:function(t){return r.safeReference(this.W[t])},getByApiName:function(t){var n=Object.values(this.W);return r.safeReference(n.find((function(n){return n.apiName===t})))}}},3650:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.isEmpty,a=e(1756);t.exports={initialize:function(){this.W={disabled:!1,forceAudienceIds:[],forceVariationIds:[],alreadyInitialized:!1,mutationObserverAPISupported:!1,isEditor:!1,isPreview:!1,isLegacyPreview:!1,isSlave:!1,previewLayerIds:[],projectToken:null,shouldOptOut:!1,trackingDisabled:!1,isRunningInV2Editor:!1,isRunningInDesktopApp:!1,forceTracking:!1,requestedEmbeddedEditor:!1},this.on(a.LOAD_DIRECTIVE,this.Ct)},getAll:function(){return r(this.W)},conflictInObservingChanges:function(){return!this.W.mutationObserverAPISupported},isDisabled:function(){return this.W.disabled},isEditor:function(){return this.W.isEditor},clientHasAlreadyInitialized:function(){return this.W.alreadyInitialized},getForceAudienceIds:function(){return this.W.forceAudienceIds},getForceVariationIds:function(){return this.W.forceVariationIds},getPreviewLayerIds:function(){return this.W.previewLayerIds},getProjectToken:function(){return this.W.projectToken},getForceTracking:function(){return this.W.forceTracking},shouldActivate:function(){return!this.W.isEditor&&!this.isDisabled()},shouldBootstrapDataForPreview:function(){return this.W.isPreview},shouldBootstrapDataForEditor:function(){return this.W.isEditor},shouldInitialize:function(){return!(this.shouldLoadPreview()||this.isDisabled()||this.getProjectToken())},shouldLoadPreview:function(){return!(this.W.isPreview||this.W.isLegacyPreview||!this.getProjectToken()||this.W.isEditor)},shouldLoadEmbeddedEditor:function(){return this.W.requestedEmbeddedEditor&&!this.W.isEditor},shouldBailForDesktopApp:function(){return!this.W.isEditor&&this.W.isRunningInDesktopApp},shouldLoadInnie:function(){return!this.W.isSlave&&!this.W.isEditor&&this.W.isRunningInV2Editor},shouldObserveChangesIndefinitely:function(){return this.W.mutationObserverAPISupported},shouldObserveChangesUntilTimeout:function(){return!this.shouldObserveChangesIndefinitely()},shouldOptOut:function(){return this.W.shouldOptOut},shouldSendTrackingData:function(){return!this.W.trackingDisabled&&(!!this.W.forceTracking||!this.W.isPreview&&o(this.getForceVariationIds())&&o(this.getForceAudienceIds()))},isSlave:function(){return this.W.isSlave},isRunningInDesktopApp:function(){return this.W.isRunningInDesktopApp},isRunningInV2Editor:function(){return this.W.isRunningInV2Editor},Ct:function(t){Object.assign(this.W,t),this.emitChange()}}},5846:function(t,n,e){var i=e(1756),r=e(1423),o=e(279).isEmpty;t.exports={initialize:function(){this.W={},this.on(i.DATA_LOADED,this.vt)}
2,getAll:function(){return r.safeReference(Object.values(this.W))},getEventsMap:function(){return r.safeReference(this.W)},get:function(t){return r.safeReference(this.W[t])},getByApiName:function(t){var n=Object.values(this.W);return r.safeReference(n.find((function(n){return n.apiName===t})))},getByPageId:function(t){var n=Object.values(this.W);return r.safeReference(n.filter((function(n){return n.pageId===t})))},vt:function(t){if(!o(t.data.events)){var n=this;t.data.events.forEach((function(t){t.pageId||(t.pageId=t.viewId),r.deepFreeze(t),n.W[t.id]=t})),this.emitChange()}}}},2910:function(t,n,e){var i=e(1756);function r(t){var n=[];return t&&"object"==typeof t&&null!==t?(t.type&&n.push(t.type),n.push("|"),t.type&&t.name&&n.push(t.name),n.join("")):"|"}t.exports={initialize:function(){this.W={handlers:{}},this.on(i.ADD_EMITTER_HANDLER,this.Dt),this.on(i.REMOVE_EMITTER_HANDLER,this.xt)},getHandlers:function(t,n){var e=[null,{type:t.type},{type:t.type,name:t.name}],i=[],o=this;return e.forEach((function(t){var n=r(t),e=o.W.handlers[n];e&&(i=i.concat(e))})),n&&(i=i.filter((function(t){return!t.publicOnly}))),i},Dt:function(t){var n=r(t.filter);this.W.handlers[n]||(this.W.handlers[n]=[]),this.W.handlers[n].push({handler:t.handler,token:t.token,publicOnly:!!t.publicOnly,emitErrors:!!t.emitErrors}),this.emitChange()},xt:function(t){var n=!1,e=t.token;Object.keys(this.W.handlers).forEach(function(t){var i=this.W.handlers[t],r=i.filter((function(t){return t.token!==e}));r.length!==i.length&&(n=!0,this.W.handlers[t]=r)}.bind(this)),n&&this.emitChange()}}},8808:function(t,n,e){var i=e(1756),r=e(1423);t.exports={initialize:function(){this.W={holdback:0,isGlobalHoldback:null,listTargetingKeys:[],revision:null,projectId:null,accountId:null,namespace:null,activationId:null,activationTimestamp:null,dcpServiceId:null,dcpKeyfieldLocators:[],recommenderServices:[],anonymizeIP:null,projectJS:null,snippetId:null,plugins:[],domContentLoaded:!1,experimental:{},ga4UserId:null,trafficExclusion:null},this.on(i.DATA_LOADED,this.jt),this.on(i.ACTIVATE,this.Mt),this.on(i.RECORD_GLOBAL_DECISION,this.Pt),this.on(i.SET_DOMCONTENTLOADED,this.Lt),this.on(i.SET_GA4_USER_ID,this.Ut)},getRevision:function(){return this.W.revision},getGlobalHoldbackThreshold:function(){return this.W.holdback},getProjectId:function(){return this.W.projectId},getSnippetId:function(){return this.W.snippetId},getAccountId:function(){return this.W.accountId},getNamespace:function(){return this.W.namespace},getActivationId:function(){return this.W.activationId},getActivationTimestamp:function(){return this.W.activationTimestamp},getAnonymizeIP:function(){return this.W.anonymizeIP},getTrafficExclusion:function(){return this.W.trafficExclusion},isGlobalHoldback:function(){return!!this.W.isGlobalHoldback},getListTargetingKeys:function(){return this.W.listTargetingKeys.slice()},getDCPServiceId:function(){return this.W.dcpServiceId},getDCPKeyfieldLocators:function(){return this.W.dcpKeyfieldLocators},getRecommenderServices:function(){return this.W.recommenderServices},getProjectJS:function(){return this.W.projectJS},getPlugins:function(){return this.W.plugins}
2,getExperimental:function(){return r.safeReference(this.W.experimental)},getGA4UserId:function(){return this.W.ga4UserId},domContentLoadedHasFired:function(){return this.W.domContentLoaded},Mt:function(t){this.W.activationId=t.activationId,this.W.activationTimestamp=t.activationTimestamp,this.W.isGlobalHoldback=null},Pt:function(t){var n=t.isGlobalHoldback;if(null!==this.W.isGlobalHoldback&&this.W.isGlobalHoldback!==n)throw new Error("Attempted to change already set global holdback!");this.W.isGlobalHoldback=n,this.emitChange()},Ut:function(t){var n=t.ga4UserId;if(!n)throw new Error('Argument "payload.ga4UserId" is missing');this.W.ga4UserId=n,this.emitChange()},jt:function(t){var n=t.data,e={};if(["holdback","accountId","projectId","snippetId","namespace","revision","listTargetingKeys","dcpServiceId","dcpKeyfieldLocators","recommenderServices","anonymizeIP","plugins","projectJS","experimental","ga4UserId","trafficExclusion"].forEach((function(t){t in n&&(e[t]=n[t])})),0!==Object.keys(e).length){Object.assign(this.W,{listTargetingKeys:[],dcpServiceId:null,dcpKeyfieldLocators:[]},e),this.emitChange()}},Lt:function(){this.W.domContentLoaded=!0,this.emitChange()}}},2091:function(t,n,e){var i=e(1756),r=e(1423),o=e(279).isEmpty;t.exports={initialize:function(){this.W={},this.on(i.DATA_LOADED,this.vt)},vt:function(t){if(!o(t.data.groups)){var n=this;t.data.groups.forEach((function(t){r.deepFreeze(t),n.W[t.id]=t})),this.emitChange()}}
2,getAll:function(){return r.safeReference(Object.values(this.W))},getGroupsMap:function(){return r.safeReference(this.W)},get:function(t){return r.safeReference(this.W[t])}}},9607:function(t,n,e){var i=e(1756),r=e(3898);t.exports={initialize:function(){this.W={originalPushState:null,originalReplaceState:null},this.on(i.ENSURE_ORIGINAL_PUSHSTATE,this.Vt),this.on(i.ENSURE_ORIGINAL_REPLACESTATE,this.Bt)},getOriginalPushState:function(){return this.W.originalPushState},getOriginalReplaceState:function(){return this.W.originalReplaceState},Vt:function(){this.W.originalPushState||(this.W.originalPushState=r.getGlobal("history").pushState.bind(r.getGlobal("history")))},Bt:function(){this.W.originalReplaceState||(this.W.originalReplaceState=r.getGlobal("history").replaceState.bind(r.getGlobal("history")))}}},6585:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.isEmpty,a=e(1756);t.exports={initialize:function(){this.W={},this.on(a.DATA_LOADED,this.vt),this.on(a.SET_INTEGRATION_SETTINGS,this.zt)},vt:function(t){if(!o(t.data.integrationSettings)){var n=this;t.data.integrationSettings.forEach((function(t){n.W[t.id]=t})),this.emitChange()}},zt:function(t){var n=this.W[t.id];n?Object.assign(n,t):this.W[t.id]=t},getAll:function(){return r(Object.values(this.W))},get:function(t){return r(this.W[t])},getReference:function(t){return this.W[t]}}},6946:function(t,n,e){var i=e(279).cloneDeep,r=e(1756),o=e(3496),a="*";t.exports={initialize:function(){this.W={},this.on(r.LOAD_PERSISTED_LAYER_STATES,this.Ft),this.on(r.RECORD_LAYER_DECISION,this.Gt),this.on(r.RECORD_LAYER_DECISION_EVENT_ID,this.qt)},getLayerState:function(t,n){if(this.W[t]){var e=this.W[t];if(Object.keys(e).length>1&&!n)throw new Error("View Id must be specified when more than one layerState for layer.");return i(n?e[n]:e[a])}},getLayerStates:function(t){var n=this,e=function(e){var o=n.W[e];Object.keys(o).forEach((function(n){var e=o[n];(void 0===t||e.namespace===t)&&r.push(i(e))}))},r=[];for(var o in this.W)e(o);return r},getLayerStatesForAnalytics:function(){var t=this,n=function(n){var i=t.W[n];
2Object.keys(i).forEach((function(t){var n=i[t];e.push({layerId:n.layerId,decision:n.decision,decisionEventId:n.decisionEventId})}))},e=[];for(var i in this.W)n(i);return e},Ft:function(t){t.merge||(this.W={});var n=this;t.layerStates.forEach((function(t){var e=t.layerId;t.pageId||(t.pageId=t.viewId);var i=t.pageId||a,r=n.W[e];if(void 0===r)n.W[e]={},n.W[e][i]=t;else{var o=r[i];(!o||t.decisionTimestamp>(o.decisionTimestamp||0))&&(n.W[e][i]=t)}})),this.emitChange()},Gt:function(t){var n={layerId:t.layerId,revision:t.revision,namespace:t.namespace,pageId:t.pageId,decisionTicket:t.decisionTicket,decision:t.decision,decisionActivationId:t.activationId,decisionTimestamp:t.timestamp,decisionEventId:null},e=this.W[t.layerId]||{};t.pageId?(delete e[a],e[t.pageId]=n):(e={})[a]=n,this.W[t.layerId]=e,this.emitChange()},qt:function(t){var n=t.layerId,e=t.pageId||a;this.W[n]?this.W[n][e]?(this.W[n][e].decisionEventId=t.decisionId,this.emitChange()):o.warn("Not recording decision event: Layer state not found for view",e):o.warn("Not recording decision event: Campaign not registered",n)}}},3077:function(t,n,e){var i=e(1756),r=e(1423),o=e(1386),a=e(279).isEmpty;t.exports={initialize:function(){this.W={layers:{},experiments:{},variations:{}},this.on(i.DATA_LOADED,this.vt)},vt:function(t){if(!a(t.data.layers)){var n=this;(t.data.layers||[]).forEach((function(t){(t.experiments||[]).forEach((function(e){t.pageIds||(t.pageIds=t.viewIds),e.campaignName||o.isSingleExperimentPolicy(t.policy)?o.isSingleExperimentPolicy(t.policy)&&t.groupId&&(e.groupId=t.groupId):e.campaignName=t.name,(e.variations||[]).forEach((function(t){(t.actions||[]).forEach((function(t){t.pageId||(t.pageId=t.viewId)})),n.W.variations[t.id]=t})),n.W.experiments[e.id]=e})),r.deepFreeze(t),n.W.layers[t.id]=t})),this.emitChange()}}
2,getAll:function(){return r.safeReference(Object.values(this.W.layers))},getCampaignsMap:function(){return r.safeReference(this.W.layers)},getExperimentsMap:function(){return r.safeReference(this.W.experiments)},getVariationsMap:function(){return r.safeReference(this.W.variations)},getCount:function(){return Object.keys(this.W.layers).length},getAllByPageIds:function(t){var n=this.W.layers;return r.safeReference(Object.keys(n).reduce((function(e,i){var r=n[i];return t.some((function(t){return(r.pageIds||[]).includes(t)}))&&e.push(r),e}),[]))},get:function(t){return r.safeReference(this.W.layers[t])},getLayerByExperimentId:function(t){var n,e=this.W.layers;return Object.keys(e).some((function(i){var r=e[i];return!!(r.experiments||[]).find((function(n){return n.id===t}))&&(n=r,!0)})),r.safeReference(n)},getExperimentByVariationId:function(t){var n,e=this.W.layers;return Object.keys(e).some((function(i){return(e[i].experiments||[]).some((function(e){return(e.variations||[]).find((function(n){return n.id===t}))&&(n=e),!!n}))})),r.safeReference(n)}}},9325:function(t,n,e){var i=e(1756);t.exports={initialize:function(){this.W={logs:[]},this.on(i.LOG,this.Ht)},getLogs:function(){return this.W.logs},Ht:function(t){this.W.logs.push(t),this.emitChange()},Z:function(){return this.W.logs.slice()}}},3958:function(t,n,e){var i=e(1756),r=e(1423);t.exports={initialize:function(){this.W={data:null,hasTracked:null},this.on(i.LOAD_REDIRECT_DATA,this.Yt),this.on(i.REGISTER_TRACKED_REDIRECT_DATA,this.Kt)}
2,get:function(){return r.safeReference(this.W.data)},hasTracked:function(){return this.W.hasTracked},Yt:function(t){r.deepFreeze(t),this.W.data=t,this.W.hasTracked=!1,this.emitChange()},Kt:function(){this.W.hasTracked=!0}}},2446:function(t,n,e){var i=e(1756),r=e(6388);t.exports={initialize:function(){this.W={},this.on(i.SET_PENDING_EVENT,this.$t),this.on(i.REMOVE_PENDING_EVENT,this.Wt),this.on(i.LOAD_PENDING_EVENTS,this.Xt)},getEvents:function(){return this.W},getEventsString:function(){return r.stringify(this.W)},$t:function(t){Object.keys(this.W).length>=1e3&&this.Jt();var n=t.id,e=t.retryCount;this.W[n]&&this.W[n].retryCount===e||(this.W[n]={id:n,timeStamp:t.timeStamp,data:t.data,retryCount:e},this.emitChange())},Wt:function(t){delete this.W[t.id],this.emitChange()},Xt:function(t){this.W=t.events,this.Jt(),this.emitChange()},Jt:function(){for(var t=Object.values(this.W).sort((function(t,n){return t.timeStamp-n.timeStamp})),n=0;n<=t.length-1e3;n++)delete this.W[t[n].id];this.emitChange()}}},1663:function(t,n,e){var i=e(1756);t.exports={initialize:function(){this.W={layerId:null},this.on(i.ANNOUNCE_PENDING_REDIRECT,this.Yt)},isExpectingRedirect:function(){return"string"==typeof this.W.layerId},getLayerId:function(){return this.W.layerId},Yt:function(t){this.isExpectingRedirect()||(this.W.layerId=t.layerId,this.emitChange())}}},9969:function(t,n,e){var i=e(279).mapValues,r=e(1756),o=e(2044);t.exports={initialize:function(){this.W={},this.W[o.PerformanceData.performance_marks]={},this.on(r.SET_PERFORMANCE_MARKS_DATA,this.Qt)},Qt:function(t){void 0===this.W[o.PerformanceData.performance_marks][t.name]&&(this.W[o.PerformanceData.performance_marks][t.name]=[]),this.W[o.PerformanceData.performance_marks][t.name].push(t.data),this.emitChange()},getMarks:function(){return i(this.W[o.PerformanceData.performance_marks],(function(t){return t.map((function(t){return[t.startTime,t.duration]}))}))},getDurationsFor:function(t){var n=this;return t.reduce((function(t,e){var i=n.W[o.PerformanceData.performance_marks][e];return i&&(t[e]=Math.round(i.reduce((function(t,n){return t+n.duration}),0))),t}),{})}}},7631:function(t,n,e){var i=e(279).mapValues,r=e(1756),o=e(2044),a=e(3496);t.exports={initialize:function(){this.W=i(o.PluginTypes,(function(){return{}})),this.on(r.REGISTER_PLUGIN,this.Zt)},Zt:function(t){var n=t.type,e=t.name,i=t.plugin;if(!n||!e)throw new Error("Missing information needed to register plugins: "+n+":"+e);if(!this.W[n])throw new Error("Invalid plugin type specified: "+n);this.W[n][e]=i,a.debug("Plugin Store: Registering Plugin :",t)},getAllPlugins:function(t){if(!t)return this.W;if(this.W[t])return this.W[t];throw new Error("Invalid plugin type: "+t)},getPlugin:function(t,n){if(!n||!t)throw new Error("Missing plugin parameters");return this.getAllPlugins(t)[n]||null}}},6631:function(t,n,e){var i=e(1756),r=e(2103);t.exports={initialize:function(){this.W={},this.on(i.SET_VISITOR_ATTRIBUTE_PENDING,this.tn)},getPendingAttributeValue:function(t){return t=Array.isArray(t)?t.concat("pending"):[t,"pending"],r.getFieldValue(this.W,t)},tn:function(t){r.setFieldValue(this.W,t.key,{pending:t.pending}),this.emitChange()}}},5787:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.isEmpty,a=i.merge,u=e(1756);t.exports={initialize:function(){this.W={inRumSample:!1,id:null,src:null,RumHost:null,data:{extras:{}},apis:{},DOMObservation:{},featuresNeeded:{}},this.on(u.SET_RUM_DATA,this.nn),this.on(u.RECORD_API_USAGE,this.en),this.on(u.INITIALIZE_CHANGE_METRICS,this.rn),this.on(u.RECORD_ACTIVATION_TYPE_USAGE,this.an),this.on(u.RECORD_AUDIENCE_USAGE,this.un),this.on(u.RECORD_CHANGE_MACROTASK_RATE,this.cn),this.on(u.RECORD_CHANGE_OVERHEATED,this.sn),this.on(u.RECORD_CHANGE_TYPE_USAGE,this.fn),this.on(u.RECORD_DOM_OBSERVATION_OCCURENCE,this.ln),this.on(u.RECORD_INTEGRATION_USAGE,this.dn),this.on(u.RECORD_LAYER_FEATURE_USAGE,this.vn),this.on(u.RECORD_LAYER_POLICY_USAGE,this.hn),this.on(u.RECORD_VIEW_FEATURE_USAGE,this.pn),this.on(u.RECORD_VIEWS_INITIALLY_ACTIVATED_COUNT,this.gn),this.on(u.RECORD_VISITOR_ID_LOCATOR_USAGE,this.mn),this.on(u.RECORD_VISITOR_ID_ERROR,this.bn),this.on(u.RECORD_STICKY_BUCKETING_FEATURE,this._n)},nn:function(t){a(this.W,t),this.emitChange()},en:function(t){this.W.apis[t.methodName]||(this.W.apis[t.methodName]=0),this.W.apis[t.methodName]++,this.emitChange()},rn:function(){void 0===this.W.data.extras.changeMacrotaskRate&&(this.W.data.extras.changeMacrotaskRate=0),void 0===this.W.data.extras.numOverheatedChanges&&(this.W.data.extras.numOverheatedChanges=0)},cn:function(t){void 0===this.W.data.extras.changeMacrotaskRate&&(this.W.data.extras.changeMacrotaskRate=0),t.changeMacrotaskRate>this.W.data.extras.changeMacrotaskRate&&(this.W.data.extras.changeMacrotaskRate=t.changeMacrotaskRate),this.emitChange()},sn:function(){void 0===this.W.data.extras.numOverheatedChanges&&(this.W.data.extras.numOverheatedChanges=0),this.W.data.extras.numOverheatedChanges++,this.emitChange()},ln:function(t){this.W.DOMObservation[t.counterName]||(this.W.DOMObservation[t.counterName]=0),this.W.DOMObservation[t.counterName]++,this.emitChange()},yn:function(t,n,e){void 0===this.W.featuresNeeded[t]&&(this.W.featuresNeeded[t]={});var i=this.W.featuresNeeded[t];
2n.forEach((function(t){i[t]||(i[t]={}),i[t][e]||(i[t][e]=!0)}))},dn:function(t){this.yn("integrations",t.integrations,t.layerId)},fn:function(t){this.yn("changeTypes",t.changeTypes,t.layerId)},an:function(t){this.yn("activationTypes",[t.activationType],t.entityId),this.emitChange()},pn:function(t){this.yn("viewFeatures",t.featuresUsed,t.entityId),this.emitChange()},vn:function(t){this.yn("layerFeatures",[t.feature],t.entityId),this.emitChange()},hn:function(t){this.yn("policy",[t.policy],t.layerId),this.emitChange()},un:function(t){this.yn("audiences",t.audienceTypes,t.layerId),this.emitChange()},gn:function(t){this.W.data.extras.viewsInitiallyActivatedCount=t.viewsInitiallyActivatedCount,this.emitChange()},mn:function(t){this.yn("visitorIdLocatorType",[t.visitorIdLocatorType],t.entityId),this.emitChange()},bn:function(t){this.W.data.extras.errorCustomVisitorId=t.isError,this.emitChange()},_n:function(t){this.yn("stickyBucketing",[t.feature],t.id)},getSampleRum:function(){return this.W.inRumSample},getRumId:function(){return this.W.id},getRumHost:function(){return this.W.RumHost},getApiData:function(){return this.W.apis},getDOMObservationData:function(){return this.W.DOMObservation},getRumData:function(){return r(this.W.data)},getScriptSrc:function(){return this.W.src},getFeaturesNeededData:function(){var t=this.W.featuresNeeded,n={};return Object.keys(t).forEach((function(e){var i=t[e],r=Object.keys(i);o(r)||(n[e]={}),r.forEach((function(t){n[e][t]=Object.keys(i[t]).length}))})),n}}},9688:function(t,n,e){var i=e(1756);t.exports={initialize:function(){this.W={initialized:!1,natives:{}},this.on(i.SANDBOXED_FUNCTIONS_ADDED,this.wn)},wn:function(t){if(!t.sandboxedFunctions)throw new Error("No sandboxedFunctions found in payload");this.W.natives=t.sandboxedFunctions,this.W.initialized=!0,this.emitChange()},getAll:function(){return this.W.natives},get:function(t){if(!t)throw new Error("Missing name parameter");return this.W.natives[t]||null},isInitialized:function(){return this.W.initialized}}},8147:function(t,n,e){var i=e(279).cloneDeep,r=e(1756),o=e(6310),a=e(167);t.exports={initialize:function(){this.W={lastSessionTimestamp:0,sessionId:null},this.on(r.REFRESH_SESSION,this.En),this.on(r.LOAD_SESSION_STATE,this.In)},getState:function(){return i(this.W)},getSessionId:function(){return this.W.sessionId},In:function(t){this.W.sessionId=t.sessionId,this.W.lastSessionTimestamp=t.lastSessionTimestamp,this.emitChange()},En:function(){var t=o.now(),n=this.W.lastSessionTimestamp;(!this.W.sessionId||t-n>18e5)&&(this.W.sessionId=a.generate()),this.W.lastSessionTimestamp=t,this.emitChange()}}},9794:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.isEmpty,a=e(1756);t.exports={initialize:function(){this.An(),this.on(a.FINALIZE_BATCH_SNAPSHOT,this.Tn),this.on(a.REGISTER_PREVIOUS_BATCH,this.Sn),this.on(a.REGISTER_TRACKER_VISITOR,this.On),this.on(a.REGISTER_TRACKER_EVENT,this.kn),this.on(a.REGISTER_TRACKER_DECISION,this.Rn),this.on(a.RESET_TRACKER_EVENTS,this.Nn),this.on(a.RESET_TRACKER_STORE,this.An),this.on(a.RESET_TRACKER_PREVIOUS_BATCHES,this.Cn),this.on(a.SET_TRACKER_POLLING,this.Dn),this.on(a.SET_TRACKER_BATCHING,this.xn),this.on(a.SET_TRACKER_USE_BEACON,this.jn),this.on(a.SET_TRACKER_SEND_EVENTS,this.Mn),this.on(a.SET_TRACKER_PERSISTABLE_STATE,this.Pn),this.on(a.SET_TRACKER_DIRTY,this.Ln),this.on(a.UPDATE_TRACKER_VISITOR_ATTRIBUTES,this.Un)},getPersistableState:function(){return this.W.isDirty?this.hasEventsToSend()||this.hasPreviousBatchesToSend()?{data:this.W.data,decisions:this.W.decisions,decisionEvents:this.W.decisionEvents,previousBatches:this.W.previousBatches}:{}:null},Pn:function(t){o(this.W.data)||o(t.data)||(this.Tn(),this.W.previousBatches.push(this.getEventBatch())),this.W.data=t.data||{},this.W.decisions=t.decisions||[],this.W.decisionEvents=t.decisionEvents||[],o(this.W.previousBatches)||o(t.previousBatches)?this.W.previousBatches=t.previousBatches||[]:this.W.previousBatches=this.W.previousBatches.concat(t.previousBatches),this.emitChange()},Ln:function(t){this.W.isDirty=t,this.emitChange()},kn:function(t){var n=this.Vn();(o(n.snapshots)||!o(this.W.decisionEvents))&&this.Bn(),this.zn().events.push(t.event),this.W.decisions=t.decisions,this.Ln(!0)},Rn:function(t){this.W.decisionEvents.push(t.decisionEvent),this.W.decisions=t.decisions,this.Ln(!0)},On:function(t){o(this.W.data)?this.W.data=t.data:this.Tn(),this.W.data.visitors.push(t.visitor),this.W.decisions=t.decisions,this.W.decisionEvents=[],this.Ln(!0)},Sn:function(t){this.W.previousBatches.push(t),this.Ln(!0)},An:function(){this.W={polling:!1,shouldBatch:!0,data:{},decisions:[],decisionEvents:[],canSend:!1,isDirty:!1,previousBatches:[]},this.emitChange()},Nn:function(){var t=this.Vn();this.W.data.visitors=[t],t.snapshots=[],this.Ln(!0)},Cn:function(){this.W.previousBatches=[],this.Ln(!0)},Dn:function(t){this.W.polling=t,this.emitChange()},xn:function(t){this.W.shouldBatch=t,this.emitChange()},jn:function(t){this.W.shouldUseBeacon=t,this.emitChange()},Mn:function(t){this.W.canSend=t,this.emitChange()},getEventBatch:function(){return r(this.W.data)},getPreviousBatches:function(){return r(this.W.previousBatches)},Fn:function(){return this.W.decisionEvents.slice()},Gn:function(){this.W.decisionEvents=[]},qn:function(){return this.W.decisions.slice()},isPolling:function(){return this.W.polling},shouldBatch:function(){return this.W.shouldBatch},shouldUseBeacon:function(){return this.W.shouldUseBeacon},zn:function(){var t=this.Vn(),n=t&&t.snapshots;return n&&n[n.length-1]},Vn:function(){var t=this.W.data.visitors;return t&&t[t.length-1]},Bn:function(){var t=this.Fn();this.Vn().snapshots.push({decisions:this.qn(),events:t}),this.Gn(),this.Ln(!0)},Tn:function(){this.W.decisionEvents.length>0&&this.Bn()},hasEventsToSend:function(){if(!o(this.W.decisionEvents))return!0;
2if(!o(this.W.data)&&(this.W.data.visitors||[]).some((function(t){return t.snapshots.length>0})))return!0;return!1},hasPreviousBatchesToSend:function(){return!o(this.W.previousBatches)},canSend:function(){return this.W.canSend},Un:function(t){var n=this.Vn();n&&(n.attributes=t.attributes)}}},5756:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.isEmpty,a=e(1756);t.exports={initialize:function(){this.W={},this.on(a.SET_UA_DATA,this.vt)},vt:function(t){o(this.W)&&(this.W=t.data)},get:function(){return r(this.W)}}},6430:function(t,n,e){var i=e(279).cloneDeep,r=e(1756),o=e(3496),a={globalTags:{},viewStates:{},shouldBatch:!1};t.exports={initialize:function(){this.W=i(a),this.on(r.REGISTER_VIEWS,this.Hn),this.on(r.SET_VIEW_ACTIVE_STATE,this.Yn),this.on(r.UPDATE_PARSED_VIEW_METADATA,this.Kn),this.on(r.UPDATE_USER_SUPPLIED_METADATA,this.$n),this.on(r.TRACK_VIEW_ACTIVATED_EVENT,this.Wn),this.on(r.SET_GLOBAL_TAGS,this.Xn),this.on(r.RESET_VIEW_STATES,this.Jn),this.on(r.SET_VIEW_BATCHING,this.xn)},getAll:function(){var t={};for(var n in this.W.viewStates)t[n]=this.getViewState(n);return t},getActiveViewIds:function(){var t=this,n=this.W.viewStates;return Object.keys(n).reduce((function(n,e){return t.isViewActive(e)&&n.push(e),n}),[])},shouldBatch:function(){return this.W.shouldBatch},getViewState:function(t){var n=i(this.W.viewStates[t]),e=this.W.globalTags;return n.metadata=Object.assign({},n.parsedMetadata,e,n.userSuppliedMetadata),n},getActiveViewTags:function(){var t=this.getActiveViewStates().map((function(t){return t.metadata})),n=[{}].concat(t);return Object.assign.apply(Object,n)},getActivationEventId:function(t){return this.W.viewStates[t]?this.W.viewStates[t].activationEventId:null},getActiveViewStates:function(){var t=this,n=this.W.viewStates;return Object.keys(n).reduce((function(n,e){return t.isViewActive(e)&&n.push(t.getViewState(e)),n}),[])},isViewActive:function(t){var n=this.W.viewStates[t];return n||o.warn("No Page registered with id",t),!!n.isActive},getGlobalTags:function(){return i(this.W.globalTags)},Jn:function(){this.W.viewStates={},this.emitChange()},Hn:function(t){var n=t.forceClean||!1,e=this;t.views.forEach((function(t){var i=t.id;e.W.viewStates[i]={id:i,isActive:"boolean"!=typeof t.isActive||n?null:t.isActive,activatedTimestamp:null,activationEventId:null,parsedMetadata:{},userSuppliedMetadata:{}}})),this.emitChange()},Yn:function(t){var n=t.view.id;if(!this.W.viewStates[n])throw new Error("No view exists with id "+n);this.W.viewStates[n].isActive=t.isActive,t.isActive?this.W.viewStates[n].activatedTimestamp=t.timestamp:(this.W.viewStates[n].parsedMetadata={},this.W.viewStates[n].userSuppliedMetadata={}),this.emitChange()},Kn:function(t){var n=t.pageId;if(!this.W.viewStates[n])throw new Error("No view exists with id "+n);Object.assign(this.W.viewStates[n].parsedMetadata,t.metadata),this.emitChange()},$n:function(t){var n=t.pageId;if(!this.W.viewStates[n])throw new Error("No view exists with id "+n);Object.assign(this.W.viewStates[n].userSuppliedMetadata,t.metadata),this.emitChange()},Wn:function(t){var n=t.pageId;this.W.viewStates[n]&&(this.W.viewStates[n].activationEventId=t.eventData.eventId,this.emitChange())},Xn:function(t){Object.assign(this.W.globalTags,t),this.emitChange()},xn:function(t){this.W.shouldBatch=t,this.emitChange()}}},2161:function(t,n,e){var i=e(1756),r=e(1423),o=e(279).isEmpty;t.exports={initialize:function(){this.W={views:{},apiNamesToViews:{}},this.on(i.DATA_LOADED,this.vt)}
2,getAll:function(){return r.safeReference(Object.values(this.W.views))},getPagesMap:function(){return r.safeReference(this.W.views)},get:function(t){return r.safeReference(this.W.views[t])},getByApiName:function(t){return r.safeReference(this.W.apiNamesToViews[t])},apiNameToId:function(t){var n=this.W.apiNamesToViews[t];if(n)return n.id},idToApiName:function(t){var n=this.W.views[t];if(n)return n.apiName},getNumberOfPages:function(){return Object.keys(this.W.views).length},getAllViewsForActivationType:function(t){var n=this.W.views;return Object.keys(n).map((function(t){return n[t]})).filter((function(n){return n.activationType===t}))},vt:function(t){if(!o(t.data.views)){var n=this;t.data.views.forEach((function(t){r.deepFreeze(t),n.W.views[t.id]=t,n.W.apiNamesToViews[t.apiName]=t})),this.emitChange()}}}},1445:function(t,n,e){var i=e(279).cloneDeep,r=e(1756),o=e(2103);t.exports={initialize:function(){this.W={profile:{},metadata:{},visitorId:null},this.on(r.SET_VISITOR_ID_VIA_API,this.Qn),this.on(r.SET_VISITOR_ATTRIBUTES,this.Zn),this.on(r.LOAD_EXISTING_VISITOR_PROFILE,this.te)},getVisitorProfile:function(){return this.W.profile},getVisitorProfileMetadata:function(){return this.W.metadata},getAttribute:function(t){var n=this.W.profile;return i(o.getFieldValue(n,t))},getAttributeMetadata:function(t){return i(this.W.metadata[t])},getVisitorIdFromAPI:function(){return this.W.visitorId},te:function(t){this.W.profile=t.profile,this.W.metadata=t.metadata,this.emitChange()},Zn:function(t){var n=this;t.attributes.forEach((function(t){var e=t.key;o.setFieldValue(n.W.profile,e,t.value),t.metadata&&Object.keys(t.metadata).forEach((function(i){var r=t.metadata[i];o.setFieldValue(n.W.metadata,e.concat(i),r)}))})),this.emitChange()},Qn:function(t){this.W.visitorId=t,this.emitChange()}}},7918:function(t,n,e){var i=e(1756),r=e(279).isEmpty;t.exports={initialize:function(){this.W={},this.on(i.DATA_LOADED,this.ne)},getCustomBehavioralAttributes:function(){var t=this.W;return Object.keys(t).reduce((function(n,e){var i=t[e];return i.rule_json&&n.push(i),n}),[])},getVisitorAttribute:function(t){var n=Object.values(this.W);if(t.datasourceId&&(n=n.filter((function(n){return n.dcp_datasource_id===String(t.datasourceId)}
2))),t.attributeName&&t.attributeId)throw new Error("Must not specify both attribute name and attribute ID");if(t.attributeId){var e=this.W[t.attributeId];if(!e)throw new Error("Unrecognized attribute ID: "+t.attributeId);return e}if(t.attributeName){var i=n.filter((function(n){return n.name===t.attributeName}));if(!i.length)throw new Error("Unrecognized attribute name: "+t.attributeName);if(i.length>1)throw new Error("Too many attributes with name: "+t.attributeName);return i[0]}throw new Error("Must specify attribute name or attribute ID")},ne:function(t){if(!r(t.data.visitorAttributes)){var n=this;t.data.visitorAttributes.forEach((function(t){n.W[t.id]=t})),this.emitChange()}}}},6916:function(t,n,e){Object.defineProperty(n,"u",{value:!0});var i=e(279),r=i.cloneDeep,o=i.isEqual,a=e(1756),u=e(6388);t.exports={initialize:function(){this.W={variationIdMap:{},preferredLayerMap:{},contextualMabMap:{},odpSegments:{}},this.on(a.UPDATE_VARIATION_ID_MAP,this.ee),this.on(a.MERGE_VARIATION_ID_MAP,this.re),this.on(a.UPDATE_PREFERRED_LAYER_MAP,this.oe),this.on(a.MERGE_PREFERRED_LAYER_MAP,this.ae),this.on(a.UPDATE_CONTEXTUAL_MAB_MAP,this.ue),this.on(a.MERGE_CONTEXTUAL_MAB_MAP,this.ce),this.on(a.SET_ODP_SEGMENTS,this.se)},se:function(t){this.W.odpSegments=t,this.emitChange()},getOdpSegments:function(){return this.W.odpSegments},getContextualMabMap:function(){return r(this.W.contextualMabMap)},getContextualMabMapString:function(){return u.stringify(this.W.contextualMabMap)},ue:function(t){var n=this.W.contextualMabMap[t.layerId]||{};o(n[t.experimentId],t.variationData)||(n[t.experimentId]=t.variationData,this.W.contextualMabMap[t.layerId]=n,this.emitChange())},ce:function(t){var n=this.W.contextualMabMap;Object.keys(t.contextualMabMap).forEach((function(e){var i=t.contextualMabMap[e];n[e]||(n[e]={}
2),Object.keys(i).forEach((function(t){var r=i[t];n[e][t]||(n[e][t]=r)}))})),this.W.contextualMabMap=n,this.emitChange()},getVariationIdMap:function(){return r(this.W.variationIdMap)},getVariationIdMapString:function(){return u.stringify(this.W.variationIdMap)},ee:function(t){var n=this.W.variationIdMap[t.layerId]||{};n[t.experimentId]!==t.variationId&&(n[t.experimentId]=t.variationId,this.W.variationIdMap[t.layerId]=n,this.emitChange())},re:function(t){var n=this.getVariationIdMap(),e=t.variationIdMap;Object.keys(n||{}).forEach((function(t){var i=(n||{})[t];e[t]?Object.assign(e[t],i):e[t]=i})),this.W.variationIdMap=e,this.emitChange()},getPreferredLayerMap:function(){return r(this.W.preferredLayerMap)},getPreferredLayerMapString:function(){return u.stringify(this.W.preferredLayerMap)},getPreferredLayerId:function(t){return this.W.preferredLayerMap[t]},oe:function(t){this.W.preferredLayerMap[t.groupId]!==t.layerId&&(this.W.preferredLayerMap[t.groupId]=t.layerId,this.emitChange())},ae:function(t){var n=this.getPreferredLayerMap(),e=t.preferredLayerMap;Object.assign(e,n),this.W.preferredLayerMap=e,this.emitChange()}}},7577:function(t,n,e){var i=e(1756);e(5507).J;t.exports={initialize:function(){this.W={events:[],foreignEvents:{},foreignEventQueues:{}},this.on(i.SET_VISITOR_EVENTS,this.vt),this.on(i.SET_FOREIGN_VISITOR_EVENTS,this.fe),this.on(i.SET_FOREIGN_VISITOR_EVENT_QUEUE,this.le)},getEvents:function(){return this.W.events},getForeignEvents:function(){return this.W.foreignEvents},getForeignEventQueues:function(){return this.W.foreignEventQueues},vt:function(t){this.W.events=t,this.emitChange()},fe:function(t){this.W.foreignEvents[t.key]=t.value},le:function(t){this.W.foreignEventQueues[t.key]=t.value}}},4173:function(t,n,e){var i=e(1756);t.exports={initialize:function(){this.W={baseMap:{},eventQueue:[],lastEvent:null,initialized:!1,cleared:!1},this.on(i.UPDATE_BEHAVIOR_STORE,this.de)},getBaseMap:function(){return this.W.baseMap},getEventQueue:function(){return this.W.eventQueue},getLastEvent:function(){return this.W.lastEvent},getCleared:function(){return this.W.cleared},getInitialized:function(){return this.W.initialized},de:function(t){this.W[t.key]=t.value}}},9221:function(t,n,e){var i=e(279).isEmpty,r=e(1756);t.exports={initialize:function(){this.W={randomId:null,visitorIdLocator:null},this.on(r.SET_VISITOR_ID,this.vt),this.on(r.DATA_LOADED,this.ve)},getBucketingId:function(){return this.getRandomId()},getRandomId:function(){return this.W.randomId},getVisitorIdLocator:function(){return this.W.visitorIdLocator},vt:function(t){Object.assign(this.W,t),this.emitChange()},ve:function(t){i(t.data.visitorIdLocator)||(this.W.visitorIdLocator=t.data.visitorIdLocator,this.emitChange())}}},1943:function(t,n,e){var i=e(279).cloneDeep,r=e(3496),o=e(1756);t.exports={initialize:function(){this.W={frames:[],defaultFrame:null,messages:[],subscribers:[],canonicalOrigins:null,disabled:!1},this.on(o.XDOMAIN_SET_DEFAULT_FRAME,this.he),this.on(o.XDOMAIN_ADD_FRAME,this.pe),this.on(o.XDOMAIN_SET_MESSAGE,this.ge),this.on(o.XDOMAIN_ADD_SUBSCRIBER,this.me),this.on(o.XDOMAIN_SET_CANONICAL_ORIGINS,this.be),this.on(o.XDOMAIN_SET_DISABLED,this._e)},getMessages:function(){return i(this.W.messages)},getOffset:function(){return 0===this.W.messages.length?0:this.W.messages[0].data.id},getNextMessageId:function(){return this.W.messages.length+this.getOffset()},getMessageById:function(t){return this.W.messages[t-this.getOffset()]},getSubscribers:function(){return this.W.subscribers},getFrames:function(){return this.W.frames},getNextFrameId:function(){return this.W.frames.length},getDefaultFrame:function(){return this.W.defaultFrame},getCanonicalOrigins:function(){return i(this.W.canonicalOrigins)},isDisabled:function(){return this.W.disabled},he:function(t){this.W.defaultFrame=t},pe:function(t){this.W.frames.push(t)},ge:function(t){for(this.W.messages[t.messageId-this.getOffset()]=t.message;this.W.messages.length>1e3;){var n=this.W.messages.shift();r.debug("XDomainStorage: Cleared old message: "+n.data.id)}},me:function(t){this.W.subscribers.push(t.subscriber)},be:function(t){this.W.canonicalOrigins=t.canonicalOrigins},_e:function(t){this.W.disabled=t.disabled}}},2858:function(t,n){n.locatorType={CSS_SELECTOR:"css_selector",JAVASCRIPT:"javascript",URL_REGEX:"url_regex"},n.valueType={STRING:"string",NUMBER:"number",CURRENCY:"currency"},n.nodeNames={INPUT:"INPUT",SELECT:"SELECT"}},4634:function(t,n,e){var i=e(9726).v;n.Error=i("TagError")}
2,6952:function(t,n,e){var i=e(2044).PluginTypes,r=e(3221).get("stores/plugins");n.getTagValue=function(t){var e=r.getPlugin(i.viewTagLocators,t.locatorType);if(!e)throw new n.Error("No locator registered for tag locatorType: "+t.locatorType);return e(t)},n.enums=e(2858),n.Error=e(4634).Error},8548:function(t,n,e){var i=e(1756),r=e(3941),o=e(3341).Promise,a=e(3221).get("stores/async_request");n.makeAsyncRequest=function(t,n){var e,u,c=a.getPromise(t);if(c)return c;var s=new o((function(t,n){e=t,u=n}));return r.dispatch(i.REGISTER_ASYNC_DEFERRED,{source:t,promise:s,resolver:e,rejecter:u}),n&&n(),s},n.resolveRequest=function(t,n){r.dispatch(i.RESOLVE_DEFERRED,{source:t,resolveWith:n})},n.rejectRequest=function(t,n){r.dispatch(i.REJECT_DEFERRED,{source:t,rejectWith:n})}},2122:function(t,n,e){var i=e(950),r=e(3898);n.getLanguage=function(){return r.getNavigatorLanguage()},n.getQueryParams=i.getQueryParams,n.getQueryParamValue=i.getQueryParamValue,n.getUrl=function(){return r.getHref()}},2658:function(t,n,e){var i=e(9726).v,r=e(6310),o=e(9751),a=e(3898),u=e(1756),c=e(3221),s=e(3941),f=c.get("stores/cookie_options"),l=n.SetError=i("CookieSetError"),d=n.MismatchError=i("CookieMismatchError"),v=["co","com","net","org","edu","gov","mil","int","ac","com","net","org"];n.getAll=function(t){var e,i,r,a,u;void 0===t&&(t=!0),e=o.getCookieString().split(/\s*;\s*/);var c={};for(r=0;r<e.length;r++)if((a=(i=e[r]).indexOf("="))>0&&void 0===c[u=n.safeDecodeURIComponent(i.substring(0,a))]){var s=i.substring(a+1);t&&(s=n.safeDecodeURIComponent(s)),c[u]=s}return c},n.safeDecodeURIComponent=function(t){try{return decodeURIComponent(t)}catch(n){return t}},n.get=function(t,e){return n.getAll(e)[t]},n.set=function(t,e,i,c){!1!==c&&(c=!0);var g=[];if(void 0===(i=Object.assign({encodeValue:!0},i)).domain){var m=f.getCurrentDomain();m||(m=function(t,e){!1!==e&&(e=!0);for(var i,r,o=t.hostname.split("."),a=[],c=null,f=o.length-1;f>=0;f--)if(a.unshift(o[f]),i=a.join("."),!(o.length>1&&(1===a.length||2===a.length&&v.includes(a[0]))||h.includes(i))){r={domain:e?"."+i:i};try{n.set(p,Math.random().toString(),r),n.remove(p,r),c=r.domain;break}catch(t){}}return s.dispatch(u.SET_COOKIE_DOMAIN,c),c}(a.getLocation(),!0)),i.domain=m}if(i.domain&&g.push("domain="+i.domain),void 0===i.path&&(i.path="/"),i.path&&g.push("path="+i.path),void 0===i.expires){var b=void 0===i.maxAge?f.getDefaultAgeInSeconds():i.maxAge;i.expires=new Date(r.now()+1e3*b)}if(void 0!==i.expires&&g.push("expires="+i.expires.toUTCString()),i.secure&&g.push("secure"),o.setCookie(t+"="+(i.encodeValue?encodeURIComponent(e):e)+";"+g.join(";")),c){var _=i.encodeValue,y=n.get(t,_);if(y!==e){if(!y)throw new l('Failed to set cookie "'+t+'"');throw new d('Expected "'+e+'" for "'+t+'", got "'+y+'"')}}},n.remove=function(t,e){for(var i=a.getLocation().hostname.split("."),r=1===i.length?0:1;i.length>r&&(2!==i.length||!v.includes(i[0]));)n.set(t,null,Object.assign({},e,{domain:"."+i.join("."),expires:new Date(0)}),!1),i.shift()};var h=["optimizely.test"],p="optimizelyDomainTestCookie"},9726:function(t,n,e){var i=e(4254),r=i("InternalError");n.C=r,n.v=function(t){return i(t,r)}},1623:function(t,n,e){var i=e(3341).Promise;t.exports=function(){var t,n,e=new i((function(e,i){t=e,n=i}));return e.resolve=function(){return t.apply(null,Array.from(arguments)),e},e.reject=function(){return n.apply(null,Array.from(arguments)),e},e}},4143:function(t,n,e){Object.defineProperty(n,"u",{value:!0}),n.getEditorConfig=f,n.getEditorScriptUrl=l,n.persistEditorParams=v,n.loadEmbeddedEditor=function(t){"function"!=typeof(null==window.optimizely?void 0:window.optimizely.push)&&(o.warn("EditorLoader / window.optimizely does not have a push method; it may have been overridden by page code. Resetting to ensure embedded editor compatibility."),window.optimizely=[]);v(),r.setOptOut(!1);var n=f(t),e=l(n);n.pullRequestId&&!isNaN(Number(n.pullRequestId))&&o.debug("Main / Loading editor pull request ID: "+n.pullRequestId),a.addScriptAsync(e)};var i=e(2658),r=e(7946),o=e(3496),a=e(7743),u=e(3898),c=["optimizely_project_id","optimizely_experiment_id","optimizely_section_id","optimizely_variation_id","optimizely_embed_editor","optimizely_use_shadow_dom","optimizely_page_id","optimizely_device_mode","optimizely_events_mode"],s=["optimizely_oauth_token","optimizely_token_expires_in"];function f(t){var n,e={true:"http://localhost:9888/main.js",http:"http://localhost:9888/main.js",https:"https://localhost:9888/main.js"},r=null==(n=i.get("useLocalBundle"))?void 0:n.toLowerCase(),o=i.get("optimizelyVePr");return{useLocalBundle:!!e[r],pullRequestId:o,mfeEntrypoint:e[r]?e[r]:t}}function l(t){var n=t.pullRequestId;return n&&!isNaN(Number(n))?"https://develrc-app.optimizely.com/dist/visual-editor/pull-request/"+n+"/main.js":t.mfeEntrypoint}function d(t){var n={};if(!t)return n;for(var e=t.split("&"),i=0;i<e.length;i++){var r=e[i].indexOf("=");if(-1!==r){var o=e[i].substring(0,r),a=e[i].substring(r+1);try{n[o]=decodeURIComponent(a)}catch(t){n[o]=a}}}return n}function v(){var t=u.getGlobal("sessionStorage");if(t){var n=u.getHref()||"",e=n.indexOf("?"),i=n.indexOf("#"),r=-1!==e?n.substring(e+1,-1!==i?i:void 0):"",a=-1!==i?n.substring(i+1):"";a=a.replace(/^#?\/*/,"");var f=d(r),l=d(a);
2c.forEach((function(n){f[n]&&t.setItem(n,f[n])})),s.forEach((function(n){l[n]&&t.setItem(n,l[n])})),o.log("EditorLoader / Persisted visual editor params to sessionStorage")}}},1423:function(t,n,e){var i=e(279).cloneDeep;n.deepFreeze=function(t){},n.safeReference=function(t){return i(t)}},279:function(t,n){function e(t,n){return null!=n&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?!!n[Symbol.hasInstance](t):t instanceof n}Object.defineProperty(n,"u",{value:!0}),n.cloneDeep=function t(n,r,o){if(void 0===r&&(r=0),null==n)return n;if("object"!==(void 0===n?"undefined":i(n)))return n;if(r>100)throw new Error("cloneDeep: Maximum recursion depth exceeded");if(o||(o=new Map),o.has(n))return o.get(n);var a=Date,u=RegExp,c=Array;if(e(n,a)){return new a(n.getTime())}if(e(n,u)){var s=n,f="";return s.global&&(f+="g"),s.ignoreCase&&(f+="i"),s.multiline&&(f+="m"),s.unicode&&(f+="u"),s.sticky&&(f+="y"),new u(s.source,f)}if(c.isArray(n)){var l=n,d=[];o.set(n,d);for(var v=l.length,h=0;h<v;h++)d[h]=t(l[h],r+1,o);return d}var p=Object.getPrototypeOf(n),g=p&&p!==Object.prototype?Object.create(p):{};for(var m in o.set(n,g),n)Object.prototype.hasOwnProperty.call(n,m)&&(g[m]=t(n[m],r+1,o));return g},n.isEmpty=function(t){return null==t||("string"==typeof t||Array.isArray(t)?0===t.length:"object"==typeof t&&0===Object.keys(t).length)},n.isEqual=function t(n,r){if(n===r)return!0;if(null==n||null==r)return n===r;if((void 0===n?"undefined":i(n))!==(void 0===r?"undefined":i(r)))return!1;if("object"!=typeof n)return n===r;if(Array.isArray(n)&&Array.isArray(r)){if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!t(n[o],r[o]))return!1;return!0}if(Array.isArray(n)!==Array.isArray(r))return!1;if(e(n,Date)&&e(r,Date))return n.getTime()===r.getTime();if(e(n,RegExp)&&e(r,RegExp))return n.source===r.source&&n.global===r.global&&n.ignoreCase===r.ignoreCase&&n.multiline===r.multiline&&n.sticky===r.sticky&&n.unicode===r.unicode;var a=Object.keys(n),u=Object.keys(r);if(a.length!==u.length)return!1;for(var c=0;c<a.length;c++){var s=a[c];if(!Object.prototype.hasOwnProperty.call(r,s)||!t(n[s],r[s]))return!1}return!0},n.isObject=r,n.pick=function(t,n){var e={};if(null==t)return e;for(var i=0;i<n.length;i++){var r=n[i];Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},n.omit=function(t,n){var e={};if(null==t)return e;var i=new Set(n);for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&!i.has(r)&&(e[r]=t[r]);return e},n.merge=function t(n){for(var e=arguments.length,i=new Array(e>1?e-1:0),o=1;o<e;o++)i[o-1]=arguments[o];if(!r(n))throw new TypeError("Target must be an object");for(var a=0;a<i.length;a++){var u=i[a];if(r(u))for(var c in u)if(Object.prototype.hasOwnProperty.call(u,c)){var s=u[c],f=n[c];if(void 0===s)continue;r(s)&&r(f)?n[c]=t({},f,s):n[c]=s}}return n},n.mapValues=function(t,n){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=n(t[i],i,t));return e},n.flatten=function(t){for(var n=[],e=0;e<t.length;e++){var i=t[e];if(Array.isArray(i))for(var r=0;r<i.length;r++)n.push(i[r]);else n.push(i)}return n},n.flattenDeep=function t(n){var e=[];if(null==n)return e;for(var i=0;i<n.length;i++){var r=n[i];if(Array.isArray(r))for(var o=t(r),a=0;a<o.length;a++)e.push(o[a]);else e.push(r)}return e},n.pickBy=o,n.omitBy=function(t,n){var e="function"==typeof n;return o(t,(function(t,i){return!(e?n(t,i):r(t)&&Object.keys(n).every((function(e){return t[e]===n[e]})))}))};var i=function(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t};function r(t){var n=void 0===t?"undefined":i(t);return null!=t&&("object"===n||"function"===n)}function o(t,n){var e=function(e){if(!Object.prototype.hasOwnProperty.call(t,e))return"continue";var a=t[e];(i?n(a,e):r(a)&&Object.keys(n).every((function(t){return a[t]===n[t]})))&&(o[e]=a)},i="function"==typeof n,o={};for(var a in t)e(a);return o}},2103:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.isObject;n.getFieldValue=function(t,n){Array.isArray(n)||(n=[n]);for(var e=t,i=0;i<n.length;i++){var r=n[i];if(!o(e)||!e.hasOwnProperty(r))return;e=e[r]}return e},n.setFieldValue=function(t,n,e){if(!Array.isArray(n)||r(n))throw new Error("Attempted to set an invali
2d key path: "+n);for(var i=t,a=0;a<n.length-1;a++){var u=n[a];o(i[u])||(i[u]={}),i=i[u]}i[n[n.length-1]]=e}},123:function(t,n,e){var i=e(279).isEmpty;n.create=function(t){if(i(t))return null;var n=document.createElement("a");return n.href=t,n}},3496:function(t,n,e){var i=e(1756),r=e(6310),o=e(2044),a=e(3941),u=e(6388);function c(){this.logLevel=null,this.logMatch=null,this.logs=[],this.timebase=r.now()}c.prototype.ye=function(){return null!==this.logLevel},c.prototype.setLogLevel=function(t){var n=this.we(t);null===n?console.error("Unknown log level: "+t):this.logLevel!==n&&(this.log("Setting log level to "+n),this.logLevel=n,this.flush())},c.prototype.setLogMatcher=function(t){this.logMatcher="string"==typeof t?t:"",this.logGroup=0},c.prototype.shouldLog=function(t){return this.ye()&&this.logLevel>=t},c.prototype.matchesLogMessage=function(t,n){var e=this.logMatcher;if(!this.logMatcher)return!0;if(this.logGroup)return"GROUPSTART"===t?this.logGroup++:"GROUPEND"===t&&this.logGroup--,!0;var i=n.some((function(t){if("string"!=typeof t)try{t=u.stringify(t)}catch(t){}return"string"==typeof t&&t.includes(e)}));return i&&"GROUPSTART"===t&&this.logGroup++,i},c.prototype.storeLog=function(t,n){var e={logLevel:t,logMessage:n};a.dispatch(i.LOG,e)},c.prototype.flush=function(){var t=e(3221).get("stores/log");this.logGroup=0;var n=t.getLogs(),i=this;n.forEach((function(t){i.Ee(t.logLevel,t.logMessage,!0)}))},c.prototype.Ee=function(t,n,e){var i,r=t;if(console)switch(t){case"GROUPSTART":i=console.groupCollapsed,r=o.LogLevel.DEBUG;break;case"GROUPEND":i=console.groupEnd,r=o.LogLevel.DEBUG;break;case o.LogLevel.ERROR:i=console.error;break;case o.LogLevel.WARN:i=console.warn;break;case o.LogLevel.DEBUG:i=console.debug;break;default:i=console.log}try{e||this.ye()&&!this.shouldLog(r)||(Array.isArray(n)&&"string"==typeof n[0]&&(n=this.Ie(n)),this.storeLog(t,n)),i&&this.shouldLog(r)&&this.matchesLogMessage(t,n)&&i.apply(console,n)}catch(t){console&&(console.error?console.error(t):console.log(t))}},c.prototype.debug=function(){this.Ee(o.LogLevel.DEBUG,[].slice.call(arguments))},c.prototype.log=function(){this.Ee(o.LogLevel.INFO,[].slice.call(arguments))},c.prototype.logAlways=function(){var t=this.Ie([].slice.call(arguments));console&&console.log&&console.log.apply&&console.log.apply(console,t),this.storeLog(o.LogLevel.INFO,t)},c.prototype.warn=function(){this.Ee(o.LogLevel.WARN,[].slice.call(arguments))},c.prototype.error=function(t){var n=[].slice.call(arguments);1===n.length&&t.stack?(this.Ee(o.LogLevel.ERROR,[this.Ae(),t]),this.Ee(o.LogLevel.INFO,[t.stack])):this.Ee(o.LogLevel.ERROR,n)},c.prototype.groupCollapsed=function(){this.Ee("GROUPSTART",[].slice.call(arguments))},c.prototype.groupEnd=function(){this.Ee("GROUPEND",[].slice.call(arguments))},c.prototype.Ie=function(t){var n=this.Ae().toString();return n.length<6&&(n=(" "+n).slice(-6)),[n+"| Optly / "+t[0]].concat(t.slice(1))},c.prototype.Ae=function(){return this.timebase?r.now()-this.timebase:0},c.prototype.we=function(t){return t&&("TRUE"===(t=t.toUpperCase())&&(t="INFO"),"FALSE"===t&&(t="OFF"),"ALL"===t&&(t="DEBUG"),void 0!==o.LogLevel[t])?o.LogLevel[t]:null},t.exports=new c},1386:function(t,n){n.isSingleExperimentPolicy=function(t){return"single_experiment"===t||"multivariate"===t}},8805:function(t,n,e){var i=e(3341).Promise,r=e(3898);n.pollFor=function(t,n,e){var o,a;return"function"==typeof e?a=e:(o=e||100,a=function(){return--o<-1}),n=n||50,new i((function(e,i){!function o(){var u;if(!a()){try{var c=t();if(c)return e(c)}catch(t){u=t}return r.setTimeout(o,n)}i(u||new Error("Poll timed out"))}()}))}},8767:function(t,n,e){var i=e(3341).Promise;n.firstToResolve=function(t){return new i((function(n){t.forEach((function(t){i.resolve(t).then(n,(function(){}))}))}))}},950:function(t,n,e){var i=e(3898);n.getQueryParams=function(){var t=i.getLocationSearch()||"";if(0===t.indexOf("?")&&(t=t.substring(1)),0===t.length)return[];for(var n=t.split("&"),e=[],r=0;r<n.length;r++){var o="",a="",u=n[r].split("=");u.length>0&&(o=u[0]),u.length>1&&(a=u[1]),e.push([o,a])}return e},n.getQueryParamValue=function(t){for(var e=n.getQueryParams(),i=0;i<e.length;i++)if(e[i][0]===t)return e[i][1]},n.queryStringFromMap=function(t){return Object.keys(t).map((function(n){return n+"="+t[n]})).join("&")}},1148:function(t,n,e){var i=e(3496),r=e(3898);function o(t){this.windowLength=t,this.count=0,this.listeners={},this.isIncrementingTick=!1}o.prototype.countCurrentTick=function(){this.isIncrementingTick||(this.isIncrementingTick=!0,this.increment(),r.setTimeout(function(){this.isIncrementingTick=!1}.bind(this),0))},o.prototype.increment=function(){this.count+=1,(this.listeners[String(this.count)]||[]).forEac
2h((function(t){t()})),r.setTimeout(this.decrement.bind(this),this.windowLength)},o.prototype.decrement=function(){this.count-=1,this.count<0&&(i.warn("Decremented down to negative count: ",this.count),this.count=0)},o.prototype.addListener=function(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)},t.exports=o},2060:function(t,n,e){var i=e(279).pick,r=e(3221).get("stores/observed_redirect");n.getReferrer=function(){var t=r.get();return t?t.referrer:null},n.getExperimentAndVariation=function(){var t=r.get();return t&&"string"==typeof t.variationId?i(t,["experimentId","variationId"]):null}},2530:function(t,n,e){var i=e(279).mapValues,r=e(1756),o=e(6310),a=e(3221),u=e(9751),c=e(2044),s=e(3941),f=e(3496),l=a.get("stores/sandbox"),d=e(3898);n.shouldSandbox=function(){return!1},n.get=function(t){if(!t)throw new Error("Name is required");if(n.shouldSandbox()){l.isInitialized()||v();var e=l.get(t);if(e)return e}return d.getGlobal(t)};var v=function(){try{var t="optimizely_"+o.now(),n=u.createElement("iframe");n.name=t,n.style.display="none",u.appendToHead(n);var e=n.contentWindow,a=n.contentDocument;a.write("<scr"),a.write("ipt></scr"),a.write("ipt>"),a.close();var l=i(c.SandboxedFunctions,(function(t){return e[t]}));s.dispatch(r.SANDBOXED_FUNCTIONS_ADDED,{sandboxedFunctions:l})}catch(t){f.warn("Unable to create a sandbox: ",t)}}},7743:function(t,n,e){var i=e(9751),r=e(3496),o=e(4464);n.addScriptAsync=function(t,n,e){var o,a=i.querySelector("head"),u=e?i.querySelector(e):null,c=i.createElement("script");(c.type="text/javascript",c.async=!0,c.src=t,n&&(c.onload=n),u)?(r.debug("Target element found for selector: "+e+", adding script before it."),null==(o=u.parentNode)||o.insertBefore(c,u)):(r.debug("Target element not found for selector: "+e+", adding script to HEAD instead."),a.insertBefore(c,a.firstChild));r.debug("Asynchronously requesting "+t)},n.addScriptSync=function(t,e){try{var a="optimizely_synchronous_script_"+Math.floor(1e5*Math.random());if(-1!==t.indexOf('"'))return void r.error("Blocked attempt to load unsafe script: "+t);i.write("<scr"),i.write('ipt id="'+a+'" src="'+t+'"></scr'),i.write("ipt>");var u=i.querySelector("#"+a);if(!u)throw new Error("DocumentEnv.write failed to append script");u.onload=e,u.onerror=function(i){r.warn("Failed to load script ("+t+") synchronously:",i),n.addScriptAsync(t,e)}}catch(i){r.debug("DocumentEnv.write failed for "+t+": "+i.message);return o.request({url:t,async:!1,contentType:"text/plain",success:function(t){new Function(t.responseText)(),e&&e()}}).catch((function(i){r.error("Failed to load "+t+" via synchronous XHR: "+i.message),n.addScriptAsync(t,e)}))}}},8597:function(t,n,e){var i=e(3341).Promise,r=e(3898);n.makeTimeoutPromise=function(t){return new i((function(n,e){r.setTimeout((function(){e(new Error("Timed out after "+t+" ms"))}),t)}))}},7566:function(t,n,e){var i=e(279).isEmpty,r=e(8409),o=e(3898),a=e(1756),u=e(3221),c=e(3941),s=u.get("stores/ua_data");n.get=function(){var t=s.get();return i(t)&&(t=r.parseUA(o.getUserAgent()),c.dispatch(a.SET_UA_DATA,{data:t})),t}},2291:function(t,n){n.guessDomain=function(t,n){if(!t)return"";try{return n?t.match(/:\/\/(.[^/]+)/)[1]:t.match(/:\/\/(?:www[0-9]?\.)?(.[^/:]+)/)[1]}catch(t){return""}}},167:function(t,n){n.generate=function(){var t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=15&t[6]|64,t[8]=63&t[8]|128;var n=Array.prototype.map.call(t,(function(t){return("0"+t.toString(16)).slice(-2)})).join("");return n.slice(0,8)+"-"+n.slice(8,12)+"-"+n.slice(12,16)+"-"+n.slice(16,20)+"-"+n.slice(20)}},9232:function(t,n,e){var i=e(3341).Promise,r=e(1756),o=e(3221),a=e(3941),u=e(525),c=e(9726).v,s=e(6310),f=e(9751),l=e(6388),d=e(8805),v=e(7649),h=e(3898),p=e(2044).VisitorStorageKeys,g=e(3496),m=o.get("stores/xdomain"),b=n.Error=c("XDomainStorageError");function _(t){var n;if(m.getFrames().find((function(n){return n.origin===t.origin}))){try{n=l.parse(t.data)}catch(n){return void g.debug("XDomain","Ignoring malformed message event:",t)}if("ERROR"===n.type)a.dispatch(r.XDOMAIN_SET_DISABLED,{disabled:!0}),u.emitInternalError(new b("Xdomain Error: "+n.response));
2else if("SYNC"===n.type)m.getSubscribers().forEach((function(t){t(n.response.key,n.response.value)}));else{var e=m.getMessageById(n.id);if(!e){if(g.warn("XDomain","No stored message found for ID",n.id),"number"!=typeof n.id)u.emitInternalError(new b("Message ID is not a number: "+n.id));else{var i=m.getNextMessageId();n.id>=i?u.emitInternalError(new b("Message ID is greater than expected maximum ID ("+n.id+">"+i+")")):n.id<0?u.emitInternalError(new b("Message ID is < 0: "+n.id)):u.emitInternalError(new b("No stored message found for message ID: "+n.id))}return}if(!e.resolver)return void g.warn("XDomain","Message already resolved, ignoring:",n.id);e.resolver(n.response),a.dispatch(r.XDOMAIN_SET_MESSAGE,{messageId:n.id,message:{data:{id:n.id,type:e.data.type,key:e.data.key},startTime:e.startTime,endTime:s.now()}})}}else g.debug("XDomain","No frame found for origin: "+t.origin)}function y(t){return!(["GET","PUT"].includes(t.type)&&!t.key.includes(p.SESSION_STATE))}function w(t,n){return n||(n=m.getDefaultFrame()),new i((function(e){var i={data:Object.assign({},t,{id:m.getNextMessageId(),use_cookie:y(t)}),resolver:e};n?m.isDisabled()||E(i,n):a.dispatch(r.XDOMAIN_SET_MESSAGE,{messageId:i.data.id,message:i})}))}function E(t,n){var e=t.data;a.dispatch(r.XDOMAIN_SET_MESSAGE,{messageId:t.data.id,message:Object.assign({},t,{startTime:s.now()})}),n.target.postMessage(l.stringify(e),n.origin)}n.setItem=function(t,n,e){return w({type:"PUT",key:t,value:n},e)},n.getItem=function(t,n){return w({type:"GET",key:t},n)},n.fetchAll=function(t){return w({type:"GETALL"},t)},n.deleteData=function(t,n){return w({type:"DELETE",visitorId:t},n)},n.subscribe=function(t){a.dispatch(r.XDOMAIN_ADD_SUBSCRIBER,{subscriber:t})},n.loadIframe=function(t,n){return new i((function(e){var i=f.createElement("iframe");i.src=t+n,i.hidden=!0,i.setAttribute("tabindex","-1"),i.setAttribute("title","Optimizely Internal Frame"),i.style.display="none",i.height=0,i.width=0,i.onload=function(){var o={id:m.getNextFrameId(),target:i.contentWindow,origin:t,path:n};a.dispatch(r.XDOMAIN_ADD_FRAME,o),e(o)},f.appendTo(f.querySelector("body"),i)}))},n.getXDomainUserId=function(t,n){var e,i={},r=Object.keys(t);return n.forEach((function(t){i[t]=[],r.forEach((function(n){var r=v.getUserIdFromKey(n,t);!e&&r&&(e=r),r&&!i[t].includes(r)&&i[t].push(r)}))})),g.debug("XDomain: Found userIds:",i),e},n.load=function(t,e){h.addEventListener("message",_);return d.pollFor((function(){return!!f.querySelector("body")})).then((function(){return n.loadIframe(t,e)})).then((function(t){a.dispatch(r.XDOMAIN_SET_DEFAULT_FRAME,t),m.isDisabled()||m.getMessages().forEac
2h((function(n){n.startTime||E(n,t)}))}))}},4464:function(t,n,e){var i=e(279).isObject,r=e(1756),o=e(6310),a=e(3941),u=e(6388),c=e(3496),s=e(3341).Promise,f=e(2530);n.isCORSSupported=function(){return"withCredentials"in new(f.get("XMLHttpRequest"))},n.request=function(t){return t=Object.assign({method:"GET",async:!0,contentType:"text/plain;charset=UTF-8"},t),new s((function(e,r){if(!n.isCORSSupported())return r("CORS is not supported");var o=new(f.get("XMLHttpRequest"));o.onload=function(){t.success&&t.success(o),e(o)},o.onerror=function(){t.error&&t.error(o),r(o)},i(t.data)&&(t.data=u.stringify(t.data)),o.open(t.method,t.url,t.async),t.withCredentials&&(o.withCredentials=t.withCredentials),o.setRequestHeader("Content-Type",t.contentType),i(t.headers)&&Object.keys(t.headers).forEach((function(n){o.setRequestHeader(n,t.headers[n])})),o.send(t.data)}))},n.retryableRequest=function(t,e,i,u){if(!e)return s.reject(new Error("No id specified for request."));if(!n.isCORSSupported())return s.reject(new Error("CORS is not supported."));void 0===u&&(u=3),void 0===i&&(i=0);var f={id:e,timeStamp:o.now(),data:t,retryCount:i};return a.dispatch(r.SET_PENDING_EVENT,f),c.debug("Sending event ",e),n.request(t).then((function(t){return a.dispatch(r.REMOVE_PENDING_EVENT,{id:e}),t}),(function(t){throw f.retryCount>=u?(a.dispatch(r.REMOVE_PENDING_EVENT,{id:e}),c.warn("Event ",f," could not be sent after ",u," attempts.")):(f.retryCount++,a.dispatch(r.SET_PENDING_EVENT,f),c.debug("Event ",f," failed to send, with error ",t," It will be retried ",u-i," times.")),t}))},n.sendBeacon=function(t,e){if(!t.url||!t.data)return s.reject(new Error("Mu
2st provide required options"));if(navigator&&navigator.sendBeacon)try{var r=i(t.data)?u.stringify(t.data):t.data;if(navigator.sendBeacon(t.url,r))return s.resolve();throw new Error("Unable to sendBeacon")}catch(t){c.warn("sendBeacon failed: ",t)}return t=Object.assign({method:"POST"},t),n.request(t,e)}},3432:function(t,n,e){var i=e(279).isEmpty,r=e(1756),o=e(2030),a=e(4681),u=e(6310),c=e(3221),s=e(2044),f=e(6167),l=e(3941),d=e(3496),v=e(6952),h=c.get("stores/event_data"),p=c.get("stores/plugins"),g=c.get("stores/rum"),m=c.get("stores/view"),b=c.get("stores/view_data");n.parseViewTags=function(t){var e=n.evaluateViewTags(t);n.setParsedViewTags(t.id,e)},n.updateAllViewTags=function(){m.getActiveViewStates().forEach((function(t){var e=b.get(t.id);n.parseViewTags(e)}))},n.evaluateViewTags=function(t){return t.tags?t.tags.reduce((function(t,n){try{t[n.apiName]=v.getTagValue(n)}catch(t){e=t,(null!=(i=v.Error)&&"undefined"!=typeof Symbol&&i[Symbol.hasInstance]?i[Symbol.hasInstance](e):e instanceof i)?d.warn("Page / Ignoring unparseable tag",n,t):d.error(t)}var e,i;return t}),{}):{}},n.createViewTicket=function(){var t={},n=p.getAllPlugins(s.PluginTypes.viewProviders);return Object.keys(n).forEach((function(e){var i=n[e];t[i.provides]=c.evaluate(i.getter)})),t},n.registerViews=function(t,n){l.dispatch(r.REGISTER_VIEWS,{views:t,forceClean:n})},n.activateViaAPI=function(t,e){e&&n.setUserSuppliedViewTags(t.id,e),n.activateMultiple([t],e)},n.getViewsAndActivate=function(t){var e=b.getAllViewsForActivationType(t);n.activateMultiple(e)},n.activateMultiple=function(t,e){var a=[];return t.forEach((function(t){var i=m.getViewState(t.id),u=n.createViewTicket();if(i.isActive)if(t.deactivationEnabled)try{n.hasValidStaticConditions(t,u)||n.deactivate(t)}catch(e){d.error("Page / Error evaluating whether to deactivate page ",n.description(t),e)}else d.log("Not activating Page, already active ",n.description(t));else{try{if(!n.hasValidStaticConditions(t,u))return"boolean"!=typeof i.isActive&&n.setViewActiveState(t,!1),void d.log("Page / Failed to match page conditions for "+n.description(t),t.staticConditions)}catch(e){return"boolean"!=typeof i.isActive&&n.setViewActiveState(t,!1),void d.error("Page / Error evaluating whether to activate page ",n.description(t),e)}if(a.push(t),n.setViewActiveState(t,!0),d.log("Activated Page",n.description(t)),o.emitViewActivated({view:t,metadata:e}),g.getSampleRum()){var c=t.activationType||s.ViewActivationTypes.immediate;l.dispatch(r.RECORD_ACTIVATION_TYPE_USAGE,{activationType:c,entityId:t.id})}var f=h.getByPageId(t.id);n.toggleEventImplementations(f,!0)}})),i(a)||o.emitViewsActivated({views:a}),a},n.deactivate=function(t){if(m.getViewState(t.id).isActive){n.setViewActiveState(t,!1),d.log("Deactivated Page",n.description(t)),o.emitPageDeactivated({page:t});var e=h.getByPageId(t.id);n.toggleEventImplementations(e,!1)}else d.log("Not deactivating Page, already inactive ",n.description(t))},n.setViewActiveState=function(t,n){l.dispatch(r.SET_VIEW_ACTIVE_STATE,{view:t,timestamp:u.now(),isActive:n})},n.setGlobalTags=function(t){l.dispatch(r.SET_GLOBAL_TAGS,t)},n.setParsedViewTags=function(t,n){l.dispatch(r.UPDATE_PARSED_VIEW_METADATA,{pageId:t,metadata:n})},n.setUserSuppliedViewTags=function(t,n){l.dispatch(r.UPDATE_USER_SUPPLIED_METADATA,{pageId:t,metadata:n})},n.hasValidStaticConditions=function(t,n){var e={};if(i(t.staticConditions))return!0;var o=p.getAllPlugins(s.PluginTypes.viewMatchers);d.groupCollapsed("Page / Evaluating staticConditions:",t.staticConditions),d.debug("Matching to current value:",n);var u=a.evaluate(t.staticConditions,(function(t){var i=t.type,r=o[i];if(!r)throw new Error("Page / No matcher found for type="+i);return r&&(e[t.type]||(e[t.type]=!0)),r.match(n,t)}));return d.groupEnd(),g.getSampleRum()&&u&&l.dispatch(r.RECORD_VIEW_FEATURE_USAGE,{featuresUsed:Object.keys(e),entity
2Id:t.id}),u},n.description=function(t){return'"'+t.name+'" ('+t.id+")"},n.toggleEventImplementations=function(t,n){t.forEach((function(t){if(t.eventType!==f.CUSTOM){var e=p.getPlugin(s.PluginTypes.eventImplementations,t.eventType);e?n?e.attach(t):e.detach(t):d.warn("No implementation found for event type:",t.eventType,"needed for event:",t)}}))},n.isActivationTypeImmediate=function(t){return t===s.ViewActivationTypes.immediate||!t},n.shouldTriggerImmediately=function(t){return t===s.ViewActivationTypes.DOMChanged||t===s.ViewActivationTypes.URLChanged||t===s.ViewActivationTypes.immediate||!t},n.create=function(t,n){return{id:t,apiName:n,category:"other"}},n.createState=function(t){return{id:t,isActive:!0,metadata:{},parsedMetadata:{},userSuppliedMetadata:{}}}},7649:function(t,n,e){Object.defineProperty(n,"u",{value:!0});var i,r=e(279),o=(r.flattenDeep,r.isEmpty),a=r.omit,u=r.omitBy,c=e(3941),s=e(1756),f=e(6027),l=e(9990),d=e(2658),v=e(6310),h=e(3221),p=e(2044),g=e(6388),m=e(2103),b=e(7429).DT,_=e(3496),y=e(3341).Promise,w=e(950),E=e(2044).VisitorStorageKeys,I=e(3898);i=e(9232);var A=h.get("stores/cookie_options"),T=h.get("stores/global"),S=h.get("stores/layer"),O=h.get("stores/plugins"),k=h.get("stores/rum"),R=h.get("stores/session"),N=h.get("stores/visitor_id"),C=h.get("stores/visitor_bucketing"),D=h.get("stores/visitor"),x=h.get("stores/provider_status");function j(t){var n=L(t),e=b.getItem(n);return"string"==typeof e&&(e=B(e)),e}function M(t){var n;if(t.layerId)n=t;else{var e=t;n={layerId:e.i,pageId:e.p,decisionTimestamp:e.t,decisionTicket:{audienceIds:e.a||[]},decision:{layerId:e.i,experimentId:e.x||null,variationId:e.v||null,isLayerHoldback:e.h||!1}}}return n}function P(t,n,e){try{var r=L(t);e||(n=g.stringify(n));try{b.setItem(r,n)}catch(t){throw _.warn("Visitor / Unable to set localStorage key, error was:",t),new Error("Unable to set localStorage")}i.setItem(r,n)}catch(t){_.warn("Unable to persist visitor data:",t.message)}}function L(t){var e=N.getBucketingId();if(!e)throw new Error("Visitor bucketingId not set");var i=n.getNamespace();if(!i)throw new Error("Namespace is not set");return[e,i,t].join("$$")}function U(t,e){if(!N.getBucketingId())throw new Error("Cannot update local store because bucketingId not set");if(V(t)){var i=n.getStorageKeyFromKey(t);if(Object.keys(E).some((function(t){return E[t]===i}))){var r=L(i);if(!(t.indexOf(r)<=0)&&(e=B(e)))if(i===E.EVENT_QUEUE)c.dispatch(s.SET_FOREIGN_VISITOR_EVENT_QUEUE,{key:t,value:l.deserialize(e)});else if(i===E.EVENTS)c.dispatch(s.SET_FOREIGN_VISITOR_EVENTS,{key:t,value:l.deserialize(e)});else if(i===E.LAYER_STATES)c.dispatch(s.LOAD_PERSISTED_LAYER_STATES,{layerStates:e.map(M),merge:!0});else if(i===E.VARIATION_MAP)c.dispatch(s.MERGE_VARIATION_ID_MAP,{variationIdMap:e});else if(i===E.CONTEXTUAL_MAB)c.dispatch(s.MERGE_CONTEXTUAL_MAB_MAP,{contextualMabMap:e});else if(i===E.VISITOR_PROFILE){var a=e;["custom"].forEach((function(t){var n=O.getPlugin(p.PluginTypes.visitorProfileProviders,t);if(n){if(a.profile&&a.metadata){var e=function(t,n,e){var i=D.getAttribute(n),r=D.getAttributeMetadata(n),a=t.profile[n],u=t.metadata[n];if(o(i))return{data:a,metadata:u};var c={};return Object.keys(a).forEach((function(t){var n,i,o=a[t];r&&r[t]&&(n=r[t].lastModified),u&&u[t]&&(i=u[t].lastModified),(e===p.AttributionTypes.FIRST_TOUCH&&n>=i||e===p.AttributionTypes.LAST_TOUCH&&i>=n||void 0===n&&i)&&(c.data=c.data||{},c.data[t]=o,i&&(c.metadata=c.metadata||{},c.metadata[t]=c.metadata[t]||{},c.metadata[t].lastModified=i))})),c}(a,t,n.attributionType);if(!o(e)){var i=[];Object.keys(e.data||{}).forEach((function(n){var r=e.data[n],o=e.metadata[n],a={key:[t,n],value:r,metadata:o};i.push(a)})),c.dispatch(s.SET_VISITOR_ATTRIBUTES,{attributes:i})}}}else _.debug("Attribute type",t,"not used by any audiences")}))}}}}function V(t){return t.split("$$")[0].indexOf("://")>0}function B(t){try{return g.parse(t)}catch(n){return _.debug("Failed to parse: ",t,n),null}}n.getOrGenerateId=function(){return{randomId:n.getCurrentId()||"oeu"+v.now()+"r"+Math.random()}},n.getCurrentId=function(){var t=N.getVisitorIdLocator();return D.getVisitorIdFromAPI()||(t?function(t){var n,e=t.name;switch(t.type){case p.VisitorIdLocatorType.COOKIE:n=d.get(e);break;case p.VisitorIdLocatorType.JS_VARIABLE:n=I.getGlobalByPath(e);break;case p.VisitorIdLocatorType.LOCALSTORAGE:try{n=I.getGlobal("localStorage").getItem(e)}catch(t){throw new Error("Unable to read localStorage: "+t.toString())}break;case p.VisitorIdLocatorType.QUERY:n=w.getQueryParamValue(e)}
2try{if(!n)throw _.error("Visitor / Customer provided visitor id cannot be found. Type:",t.type," Name:",e),new Error("Failure to obtain visitor id from "+t.type);if("string"!=typeof n&&"number"!=typeof n)throw _.error("Visitor / Customer provided visitor id is not a string or number. Type:",t.type," Name:",e," Id Type:",(i=n)&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i),new Error("Customer provided visitor id is not a string or number")}catch(t){throw k.getSampleRum()&&c.dispatch(s.RECORD_VISITOR_ID_ERROR,{isError:!0}),t}var i;k.getSampleRum()&&(c.dispatch(s.RECORD_VISITOR_ID_ERROR,{isError:!1}),c.dispatch(s.RECORD_VISITOR_ID_LOCATOR_USAGE,{visitorIdLocatorType:t.type,entityId:n}));return String(n)}(t):d.get(p.COOKIES.VISITOR_ID))},n.hasSomeData=function(){return b.keys().length>0},n.setId=function(t){var e,r,o=N.getBucketingId();c.dispatch(s.SET_VISITOR_ID,t),N.getBucketingId()!==o&&(!function(){!function(t,n){0;f.initializeStore(t,n)}(j(E.EVENTS)||[],j(E.EVENT_QUEUE)||[]);var t=(e=E.LAYER_STATES,i=N.getBucketingId(),r=[],o=new RegExp(i+"\\$\\$([^$]+?)\\$\\$"+e),b.keys().forEach((function(t){var n=t.match(o);if(n){var e={namespace:n[1],userId:i,item:B(b.getItem(t))};r.push(e)}})),r);var e,i,r,o;t.forEach((function(t){t.item=(t.item||[]).map(M)})),u=t,l=[],u.forEach((function(t){t.item.forEach((function(n){n.namespace=t.namespace,l.push(n)}))})),v=l,c.dispatch(s.LOAD_PERSISTED_LAYER_STATES,{layerStates:v.filter((function(t){return!!t.decision}))}),d=j(E.SESSION_STATE)||{},d=Object.assign({lastSessionTimestamp:0,sessionId:null},d),c.dispatch(s.LOAD_SESSION_STATE,d),function(t){var n,e,i=O.getAllPlugins(p.PluginTypes.visitorProfileProviders),r=Object.keys(i||{}).map((function(t){return i[t]})).filter((function(t){return"function"==typeof t.restorer}));t.profile&&t.metadata?(n=t.profile,e=t.metadata):(n=t,e={});n=Object.keys(n||{}).reduce((function(t,e){var i=n[e],o=i,a=r.find((function(t){return t.provides===e}));return a&&(o=a.restorer(i)),t[e]=o,t}),{}),c.dispatch(s.LOAD_EXISTING_VISITOR_PROFILE,{profile:n,metadata:e})}(j(E.VISITOR_PROFILE)||{});var a=j(E.TRACKER_OPTIMIZELY);a&&(h=a,c.dispatch(s.SET_TRACKER_PERSISTABLE_STATE,h));var u,l;var d;var v;var h;n.loadForeignData(),n.removeLegacySessionStateCookies()}(),n.deleteOldLocalData(),i.deleteData(t));try{N.getVisitorIdLocator()||n.maybePersistVisitorId(t)}catch(t){if(_.error("Visitor / Unable to persist visitorId, disabling tracking"),c.dispatch(s.LOAD_DIRECTIVE,{trackingDisabled:!0}),e=t,null!=(r=d.MismatchError)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?r[Symbol.hasInstance](e):e instanceof r)throw _.error("Visitor / Cookie not set to correct value:",t),new Error("Cookie mismatch error while persisting visitorId");throw t}n.refreshSession()},n.getVariationIdMap=function(){return j(E.VARIATION_MAP)||{}},n.updateVariationIdMap=function(t,n,e){c.dispatch(s.UPDATE_VARIATION_ID_MAP,{layerId:t,experimentId:n,variationId:e})},n.persistVariationIdMap=function(){var t=C.getVariationIdMapString();P(E.VARIATION_MAP,t,!0)},n.getContextualMabMap=function(){return j(E.CONTEXTUAL_MAB)||{}},n.updateContextualMabMap=function(t,n,e){c.dispatch(s.UPDATE_CONTEXTUAL_MAB_MAP,{layerId:t,experimentId:n,variationData:e})},n.persistContextualMabMap=function(){var t=C.getContextualMabMapString();P(E.CONTEXTUAL_MAB,t,!0)},n.getOdpSegments=function(){return j(E.ODP_SEGMENTS)||{}},n.persistOdpSegments=function(t){P(E.ODP_SEGMENTS,t,!1)},n.getPreferredLayerMap=function(){return j(E.LAYER_MAP)||{}},n.updatePreferredLayerMap=function(t,n){c.dispatch(s.UPDATE_PREFERRED_LAYER_MAP,{groupId:t,layerId:n})},n.persistTrackerOptimizelyData=function(t){P(E.TRACKER_OPTIMIZELY,t)},n.refreshSession=function(){c.dispatch(s.REFRESH_SESSION)},n.populateEagerVisitorData=function(t,e){var i=Object.keys(t||{}).reduce((function(n,e){var i=t[e];return i.isLazy||n.push(i),n}),[]);return n.populateVisitorData(i,e)},n.populateLazyVisitorData=function(t,e,i){_.debug("Populating lazy visitor. List of all providers",t);var r=Object.keys(t||{}).reduce((function(n,e){var r=t[e];return r.isLazy&&i.has(r.provides)&&n.push(r),n}),[]);return _.debug("Filtered list of providers that are lazy and present in audiences",r),n.populateVisitorData(r,e)},n.populateVisitorData=function(t,n){n=n||{};var e=function(t){return function(t,n){var e=function(t,e){var i;n.attributionType&&(i=v.now()),c.dispatch(s.SET_VISITOR_ATTRIBUTES,{attributes:[{key:t,value:e,metadata:{lastModified:i}}]})};if(!n.getter)return;var i=n.provides;Array.isArray(i)||(i=[i]),!1;var r,o=n.isSticky&&void 0!==m.getFieldValue(t,i);if(o)return;try{var a=h.evaluate(n.getter);"function"==typeof a&&(a=a((function(){return m.getFieldValue(t,i)}),(function(t){e(i,t)}
2))),void 0!==a&&(n.isAsync?(r=a.then((function(t){e(i,t)}),(function(t){_.warn('Failed to evaluate provider for "'+n.provides+'"; error was:',t)})),c.dispatch(s.SET_VISITOR_ATTRIBUTE_PENDING,{key:i,pending:r})):e(i,a))}catch(t){_.warn('Failed to evaluate getter for provider for "'+n.provides+'"; error was: '+t.message)}return r}(n,t)},i=t.filter((function(t){return!0===t.isAsync})).map(e).filter(Boolean);return t.filter((function(t){return!t.isAsync})).forEach(e),i.length>0?y.all(i):y.resolve()},n.persistBehaviorEvents=function(t){P(E.EVENTS,t)},n.persistBehaviorEventQueue=function(t){P(E.EVENT_QUEUE,t)},n.getPersistedBehaviorEventCount=function(){var t=j(E.EVENTS)||[],n=j(E.EVENT_QUEUE)||[];return l.deserialize(t).length+l.deserialize(n).length},n.persistLayerStates=function(){var t=S.getLayerStates(n.getNamespace());t=t.map((function(t){return a(t,["namespace"])})),P(E.LAYER_STATES,t)},n.persistSessionState=function(){P(E.SESSION_STATE,R.getState())},n.persistVisitorProfile=function(){var t=function(){var t=D.getVisitorProfile(),n=D.getVisitorProfileMetadata(),e=O.getAllPlugins(p.PluginTypes.visitorProfileProviders);if(e){var i=Object.keys(e).reduce((function(t,n){var i=e[n];return i.provides&&(t[i.provides]=i),t}),{});t=u(t,(function(t,n){var e=i[n];return e&&e.isTransient}))}return{profile:t,metadata:n}}();P(E.VISITOR_PROFILE,t)},n.persistVisitorBucketingStore=function(){var t;n.persistVariationIdMap(),t=C.getPreferredLayerMapString(),P(E.LAYER_MAP,t,!0),n.persistContextualMabMap()},n.getUserIdFromKey=function(t,e){var i;return t.includes(e)&&t.includes("_")&&t.includes("$$")&&t.slice(t.indexOf("$$")).includes(n.getNamespace())&&(i=t.slice(t.indexOf("_")+1,t.indexOf("$$"))),i},n.maybePersistVisitorId=function(t){t.randomId&&(A.getAutoRefresh()||n.getCurrentId()!==t.randomId?(d.set(p.COOKIES.VISITOR_ID,t.randomId),_.log("Persisting visitorId:",t.randomId)):_.log("Not persisting visitorId: value is not changed and also auto-refresh is disabled"))},n.getAttribute=function(t){return D.getAttribute(t)},n.getPendingAttributeValue=function(t){return x.getPendingAttributeValue(t)},n.isForeignKey=V,n.checkKeyForVisitorId=function(t){var e=N.getBucketingId()||n.getCurrentId(),i=n.getIdFromKey(t);return!i||i===e},n.getIdFromKey=function(t){var e=t.split("$$")[0],i=n.getStorageKeyFromKey(t);if(Object.keys(p.StorageKeys).some((function(t){return p.StorageKeys[t]===i})))return null;var r=e.indexOf("_");return-1===r?e:e.substring(r+1)},n.getStorageKeyFromKey=function(t){var n,e=t.split("$$").pop();if(e.indexOf("://")>-1){var i=e.indexOf("_");n=e.substring(i+1)}else n=e;return Object.keys(p.AllStorageKeys).some((function(t){return p.AllStorageKeys[t]===n}))?n:null},n.deleteOldLocalData=function(){b.keys().forEach((function(t){n.isForeignKey(t)||n.checkKeyForVisitorId(t)||b.removeItem(t)}))},n.deleteOldForeignData=function(){b.keys().forEach((function(t){n.isForeignKey(t)&&b.removeItem(t)}))},n.loadForeignData=function(){b.keys().forEach((function(t){var n=b.getItem(t);n&&U(t,n)}))},n.getNamespace=function(){return T.getNamespace()},n.serializeFieldKey=function(t){return Array.isArray(t)?t.join("$$"):t},n.removeLegacySessionStateCookies=function(){var t=d.getAll();Object.keys(t).forEach((function(t){0===t.indexOf(p.COOKIES.SESSION_STATE+"$$")&&d.remove(t)}))}},9663:function(t,n,e){var i=e(2044);n.normalizeClientData=function(t){!t.listTargetingKeys&&t.listTargetingCookies&&(t.listTargetingKeys=t.listTargetingCookies.map((function(t){return{type:i.ListTargetingKeyTypes.COOKIE,key:t}})),delete t.listTargetingCookies)}},8558:function(t,n,e){e(3221).register("env/jquery",e(3790))},3790:function(t,n,e){var i,r=e(3898);try{i=$}catch(t){}var o=r.getGlobal("$");t.exports=i&&i!==o?i:o},8813:function(t,n,e){e(279).isEmpty,e(9726).C,e(6310);var i=e(3221),r=(e(9751),e(3496));e(3898),e(4464),i.get("stores/client_metadata"),i.get("stores/global");n.handleError=function(t,n){n?r.error("Uncaught error:",t,n):r.error("Uncaught error:",t)}},1139:function(t,n,e){var i=e(1756),r=e(525),o=e(7042),a=e(9726).v,u=e(1894),c=e(1623),s=e(3221).get("stores/directive"),f=e(9751),l=e(7065),d=e(3941),v=e(3496),h=e(1148),p=e(6903),g=e(6139).create(),m=1e3,b=10,_=a("ChangeOverheatError");function y(t,n){if(this.change=t,this.identifier=n.identifier,this.startTime=n.startTime,s.shouldObserveChangesIndefinitely()){d.dispatch(i.INITIALIZE_CHANGE_METRICS),this.rateMeter=new h(m);var e=null===b?Number.POSITIVE_INFINITY:b;this.rateMeter.addListener(e,function(){v.warn("AppendChange",this,"has overheated and will no longer apply or reapply"),this.cancel(),d.dispatch(i.RECORD_CHANGE_OVERHEATED),r.emitError(new _("Change "+this.identifier+" has overheated"),{layerId:n.action&&n.action.layerId,experimentId:n.action&&n.action.experimentId,variationId:n.action&&n.action.variationId,changeId:t.id,changeType:t.type,movingWindowMilliseconds:m,maxMacroTasksInMovingWindow:e})}.bind(this));for(var o=Math.min(e,50),a=0;a<=o;a++)this.rateMeter.addListener(a,function(t){return function(){d.dispatch(i.RECORD_CHANGE_MACROTASK_RATE,{changeMacrotaskRate:t})}}(a))}}y.prototype.numberOfRootNodes=function(t){var n=document.createElement("div");return n.innerHTML=t,n.childNodes.length},y.prototype.getSiblingElements=function(t,n,e){for(var i=t,r=[],o=0;o<n;o++)e?(r.push(i.nextSibling),i=i.nextSibling):(r.push(i.previousSibling),i=i.previousSibling);return r},y.prototype.apply=function(){this.applyDeferred=c();try{if(!this.numberOfRootNodes(this.change.value))throw new Error("No DOM elements to be created for this change: "+this.change.value);var t=this.applyDeferred.reject.bind(this.applyDeferred,new Error("Unable to find selector.")),n={};s.shouldObserveChangesUntilTimeout()?n={timeout:p.isTimedOut.bind(null,this.startTime),onTimeout:t}:s.isEditor()&&g.waitUntil(p.isTimedOut.bind(null,this.startTime)).then(t,t),this.unobserveSelector=g.observeSelector(this.change.selector,this.maybeApplyToElement.bind(this),n);var e=f.querySelectorAll(this.change.selector),i=this;e.forEach((function(t){i.maybeApplyToElement(t)}))}catch(t){this.applyDeferred.reject(t)}return this.applyDeferred},y.prototype.maybeApplyToElement=function(t){var n=o.CHANGE_ID_ATTRIBUTE_PREFIX+this.change.id;if(t.hasAttribute(n))return v.debug("Not applying AppendChange to element",t,"because it was inserted by this change"),void this.applyDeferred.resolve();this.rateMeter&&this.rateMeter.countCurrentTick(),this.applyOrReapplyToElement.bind(this,t,n)(),this.applyDeferred.resolve()},y.prototype.applyOrReapplyToElement=function(t,n){var e;switch(this.change.operator){case l.DOMInsertionType.AFTER:e=l.insertAdjacentHTMLType.AFTER_END;break;case l.DOMInsertionType.APPEND:e=l.insertAdjacentHTMLType.BEFORE_END;break;case l.DOMInsertionType.BEFORE:e=l.insertAdjacentHTMLType.BEFORE_BEGIN;break;case l.DOMInsertionType.PREPEND:e=l.insertAdjacentHTMLType.AFTER_BEGIN;break;default:e=l.insertAdjacentHTMLType.BEFORE_END}t.insertAdjacentHTML(e,this.change.value),t.setAttribute(n,""),u.setData(t,this.change.id,this.identifier,[]);var i,r,o=this.numberOfRootNodes(this.change.value)-1;e===l.insertAdjacentHTMLType.BEFORE_END?(i=t.lastChild,r=this.getSiblingElements(i,o,!1)):e===l.insertAdjacentHTMLType.AFTER_BEGIN?(i=t.firstChild,r=this.getSiblingElements(i,o,!0)):e===l.insertAdjacentHTMLType.BEFORE_BEGIN?(i=t.previousSibling,r=this.getSiblingElements(i,o,!1)):e===l.insertAdjacentHTMLType.AFTER_END&&(i=t.nextSibling,r=this.getSiblingElements(i,o,!0)),r.unshift(i);var a=this;r.forEach((function(t){var e=t.nodeType===Node.ELEMENT_NODE?t:f.parentElement(t);e.setAttribute(n,"");var i=u.getData(e,a.change.id,a.identifier)||[];i.push(t),u.setData(e,a.change.id,a.identifier,i),f.childrenOf(e).forEach((function(t){t.setAttribute(n,"")}))}))},y.prototype.cancel=function(){this.unobserveSelector&&this.unobserveSelector()},t.exports=function(t){t.registerChangeApplier(l.changeType.APPEND,y)}},3160:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.isEmpty,a=e(7065);n.transformVisibilityAttributesToCSS=function(t){if(!t.attributes)return t;if(t.attributes[a.selectorChangeType.HIDE]||t.attributes[a.selectorChangeType.REMOVE]){var n=Object.assign({css:{}},r(t));return t.attributes[a.selectorChangeType.HIDE]&&(n.css.visibility="hidden",delete n.attributes[a.selectorChangeType.HIDE]),t.attributes[a.selectorChangeType.REMOVE]&&(n.css.display="none",delete n.attributes[a.selectorChangeType.REMOVE]),n}return t},n.createStylesFromChange=function(t,n){if(o(n.css))return n.attributes.style;var e="",i=n.attributes.style||"";
2return Object.keys(n.css).forEach((function(t){var r=n.css[t];new RegExp(t+"\\s?:").test(i)||(e+=t+":"+r+";")})),void 0===n.attributes.style?(t||"")+e:e+i}},7601:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.isEmpty,a=e(1756),u=e(525),c=e(7042),s=e(9726).v,f=e(1894),l=e(1623),d=e(3221).get("stores/directive"),v=e(9751),h=e(7065),p=e(3941),g=e(3496),m=e(4462),b=(e(3341).Promise,e(1148)),_=e(6903),y=e(3898),w=e(3160),E=e(6139).create(),I={attributes:!0,childList:!0,subtree:!0,characterData:!0},A=1e3,T=10,S=s("ChangeOverheatError");function O(t,n){if(this.change=r(t),this.change=w.transformVisibilityAttributesToCSS(this.change),this.identifier=n.identifier,this.startTime=n.startTime,this.disconnectObserverQueue=[],d.shouldObserveChangesIndefinitely()){p.dispatch(a.INITIALIZE_CHANGE_METRICS),this.rateMeter=new b(A);var e=null===T?Number.POSITIVE_INFINITY:T;this.rateMeter.addListener(e,function(){g.warn("AttributeChange",this,"has overheated and will no longer apply or reapply"),this.cancel(),p.dispatch(a.RECORD_CHANGE_OVERHEATED),u.emitError(new S("Change "+this.identifier+" has overheated"),{layerId:n.action&&n.action.layerId,experimentId:n.action&&n.action.experimentId,variationId:n.action&&n.action.variationId,changeId:t.id,changeType:t.type,movingWindowMilliseconds:A,maxMacroTasksInMovingWindow:e})}.bind(this));for(var i=Math.min(e,50),o=0;o<=i;o++)this.rateMeter.addListener(o,function(t){return function(){p.dispatch(a.RECORD_CHANGE_MACROTASK_RATE,{changeMacrotaskRate:t})}}(o))}this.cancelled=!1}O.prototype.apply=function(){this.applyDeferred=l();try{if(o(this.change.attributes)&&o(this.change.css))return g.debug("Not applying empty AttributeChange"),this.applyDeferred.resolve(),this.applyDeferred;var t=this.applyDeferred.reject.bind(this.applyDeferred,new Error("Unable to find selector.")),n={};d.shouldObserveChangesUntilTimeout()?n={timeout:_.isTimedOut.bind(null,this.startTime),onTimeout:t}:d.isEditor()&&E.waitUntil(_.isTimedOut.bind(null,this.startTime)).then(t,t),this.unobserveSelector=E.observeSelector(this.change.selector,this.maybeApplyToElement.bind(this),n);var e=v.querySelectorAll(this.change.selector),i=this;e.forEach((function(t){i.maybeApplyToElement(t)}))}catch(t){this.applyDeferred.reject(t)}return this.applyDeferred},O.prototype.maybeApplyToElement=function(t){var n=c.CHANGE_ID_ATTRIBUTE_PREFIX+this.change.id;if(t.hasAttribute(n))return g.debug("AttributeChange not being applied. Element already changed, or is a child of an element that was changed by this AttributeChange. "+t),void this.applyDeferred.resolve();this.rateMeter&&this.rateMeter.countCurrentTick();var e=this.applyOrReapplyToElement.bind(this,t,n);e(!1);var i=function(){var n=function(){this.cancelled||m.observe(r,t,I)}.bind(this);return y.setTimeout(n)}.bind(this),r=m.create(function(){this.rateMeter&&this.rateMeter.countCurrentTick(),r.disconnect(),e(!0),i()}.bind(this));i(),this.disconnectObserverQueue.push(r.disconnect.bind(r)),this.applyDeferred.resolve()},O.prototype.applyOrReapplyToElement=function(t,n,e){void 0===e&&(e=!1);var i={},r=this.change.attributes;Object.keys(r).forEach((function(e){var o=r[e];switch(e){case h.selectorChangeType.CLASS:void 0!==t.className&&(i[h.selectorChangeType.CLASS]=t.getAttribute("class")||"",t.setAttribute("class",o));break;case h.selectorChangeType.HREF:void 0!==t.getAttribute("href")&&(i[h.selectorChangeType.HREF]=t.getAttribute("href")||"",t.setAttribute("href",o));break;case h.selectorChangeType.HTML:void 0!==t.innerHTML&&(i[h.selectorChangeType.HTML]=t.innerHTML,t.innerHTML=o,v.childrenOf(t).forEach((function(t){t.setAttribute(n,"")})));break;case h.selectorChangeType.SRC:void 0!==t.src&&(i[h.selectorChangeType.SRCSET]=t.src,t.srcset=o);break;case h.selectorChangeType.SRCSET:void 0!==t.srcset&&(i[h.selectorChangeType.SRCSET]=t.srcset,t.srcset=o);break;case h.selectorChangeType.STYLE:break;case h.selectorChangeType.TEXT:void 0!==t.textContent&&(i[h.selectorChangeType.TEXT]=t.textContent,t.textContent=o);break;default:throw new Error("Unrecognized attribute: "+e)}}));var o=w.createStylesFromChange(t.style.cssText,this.change);"string"==typeof o&&(i[h.selectorChangeType.STYLE]=t.style.cssText,t.style.cssText=o),t.setAttribute(n,""),e&&f.hasData(t)||f.setData(t,this.change.id,this.identifier,i)},O.prototype.cancel=function(){this.cancelled=!0,this.unobserveSelector&&this.unobserveSelector(),this.disconnectObserverQueue.forEach((function(t){try{t()}catch(t){}}))},t.exports=function(t){t.registerChangeApplier(h.changeType.ATTRIBUTE,O)}},936:function(t,n,e){var i=e(1623),r=e(7065),o=e(3816);function a(t,n){if("function"!=typeof t.value)throw new Error("Custom code must be a function");this.change=t}a.prototype.apply=function(){var t=i();try{o.apply(this.change.value),t.resolve()}catch(n){t.reject(n)}return t}
2,t.exports=function(t){t.registerChangeApplier(r.changeType.CUSTOM_CODE,a)}},2571:function(t,n,e){var i=e(3341).Promise,r=e(1756),o=e(2044),a=e(2658),u=e(9751),c=e(7065),s=e(3941),f=e(123),l=e(3496),d=e(3898);function v(t,n){if(this.change=t,this.config=n,this.reasonShouldNotRedirect=this._checkForReasonNotToRedirect(),!this.reasonShouldNotRedirect){if("string"!=typeof this.change.dest&&"function"!=typeof this.change.dest)throw new Error("Redirect destination is not a string or function");if("function"==typeof this.change.dest&&(this.change.dest=this.change.dest(),"string"!=typeof this.change.dest))throw new Error("Redirect destination function did not evaluate to a string");if(!this.config.action)throw new Error("Redirect changes require an action to be passed in the config.");s.dispatch(r.ANNOUNCE_PENDING_REDIRECT,{layerId:this.config.action.layerId})}}v.prototype.apply=function(){if(this.reasonShouldNotRedirect)return l.warn("Redirect change is not being applied because: "+this.reasonShouldNotRedirect),i.resolve(c.changeState.IGNORED);if(this.reasonInvalid)return l.error("Redirect change cannot be applied because:",this.reasonInvalid),i.reject(this.reasonInvalid);try{this.Te(this.Se())}catch(t){return i.reject(t)}return i.resolve(c.changeState.APPLIED)},v.prototype.Se=function(){var t=f.create(this.change.dest);if(this.change.preserveParameters){var n=d.getLocation().search;n&&(t.search?t.search+="&"+n.substr(1):t.search=n)}return t.toString()},v.prototype.Oe=function(){var t=u.createElement("style");t.setAttribute("type","text/css"),t.innerHTML="body{display:none;visibility:hidden;}",u.appendToHead(t)},v.prototype.Te=function(t){(!this.change.hasOwnProperty("hidePage")||this.change.hidePage)&&this.Oe(),d.setLocation(t)},v.prototype._checkForReasonNotToRedirect=function(){var t=a.get(o.COOKIES.REDIRECT);if(!this.change.allowAdditionalRedirect&&void 0!==t)return"Page was already redirected."},t.exports=function(t){t.registerChangeApplier(c.changeType.REDIRECT,v)}},3252:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.pick,a=e(8917),u=e(6271),c=e(229).b,s=e(3496),f={decideLayer:function(t,n){if(!t.decisionMetadata||!t.decisionMetadata.experimentPriorities)throw new c("No decisionMetadata.experimentPriorities on layer.");for(var e=t.decisionMetadata.experimentPriorities.length,i=0;i<e;i++){var r=l(t,n.audienceIds,n.bucketingId,i);if(r){var o=u.selectVariation(r,n.audienceIds,n.bucketingId,n.activationId,n.preferredVariationMap);if(!t.decisionMetadata.offerConsistency||u.hasVariationActionsOnView(o,n.pageId))return{experiment:r,variation:o}}}throw new c("No eligible experiment and variation found.")},includePageIdInDecisionTicket:function(t){return!(!t.decisionMetadata||!t.decisionMetadata.offerConsistency)}};function l(t,n,e,i){var f,l,d=t.decisionMetadata.experimentPriorities[i],v=null==(f=t.decisionMetadata)?void 0:f.experimentWeights,h=(d||[]).reduce((function(e,i){var r=u.getExperimentById(t,i.entityId);return u.isValidExperiment(n,r)&&e.push(i.entityId),e}),[]);if(!r(h)){var p,g=(d||[]).filter((function(t){return null===t.endOfRange}));if(g&&g.length===d.length){if(p=function(t){for(var n=[],e=Math.round(1e4/t.length),i=0;i<t.length;i++)n.push({entityId:t[i],endOfRange:e*(i+1)});return n[n.length-1].endOfRange=1e4,n}(h),!r(v))try{p=function(t,n){var e=0,i=Object.values(n).reduce((function(t,n){return t+n}),0);if(i>1e4)throw new c("Weight distribution is invalid. Total weights: "+i);return t.map((function(r,o){var a=n[r];if("number"!=typeof a)throw new c("Weight distribution for Experiment ID "+r+" not found.");return i<1e4&&(a=o===t.length-1?1e4-e:Math.floor(n[r]/i*1e4)),{entityId:r,endOfRange:e+=a}}))}(h,o(v,h))}catch(t){s.warn("Decider / Could not allocate user-defined weights",t)}}else{if(0!==g.length)throw new c("You must specify weights for all or none of the experiments in each priority layer.");p=function(t,n){for(var e=[],i=[],o=0,a=0;a<n.length;a++){var u=0;t.indexOf(n[a].entityId)>=0&&(o+=u=0===a?n[0].endOfRange:n[a].endOfRange-n[a-1].endOfRange,i.push({entityId:n[a].entityId,points:u}))}if(r(e))for(var c=0,s=0;s<i.length;s++){var f=Math.round(1e4*i[s].points/o)+c;e.push({entityId:i[s].entityId,endOfRange:f}),c=f}return e[e.length-1].endOfRange=1e4,e}(h,d)}if(l=a.chooseWeightedCandidate(e,t.id,p)){var m=u.getExperimentById(t,l);if(m)return m}}}t.exports=function(t){t.registerDecider("equal_priority",f)}}
2,481:function(t,n,e){var i=e(6271),r=e(229).b,o={selectExperiment:function(t,n,e){if(t.experiments.length<1)throw new r("Unable to find experiment to bucket user into");var o=t.experiments[0];if(!i.isValidExperiment(n,o))throw new r('Audience conditions failed for experiment: "'+o.id+'".');return o}};t.exports=function(t){t.registerDecider("single_experiment",o),t.registerDecider("multivariate",o)}},6624:function(t,n,e){var i=e(279),r=i.cloneDeep,o=i.flatten,a=e(7512),u=e(7467),c=e(7518);function s(t,n){var e=u.buildFromSpecV0_1(n);if(1!==e.length)throw new Error("Invalid query descriptor; verify that no aggregators are specified");return c.execute(e[0],t)}function f(t,n){return t.map((function(t){return"function"==typeof t.toObject?t.toObject(n):t}))}function l(t,n){if(!t)return["Descriptor not defined"];var e=[];return t.count&&e.push('Unexpected "count" clause specified'),t.pick&&t.pick.modifier&&-1===n.indexOf(t.pick.modifier)&&e.push('Invalid "pick" modifier "'+t.pick.modifier+'"'),(t.filters||[]).forEach((function(t){void 0!==t.modifier&&e.push('Unexpected "filter" modifier "'+t.modifier+'"')})),e.length>0?e:void 0}function d(t,n){var e={revenueAsTag:!1,timeAsTimestamp:!0};if(void 0===n)return f(a.getEvents(t),e);if("number"==typeof n){if(n<=0)throw new Error("Count must be a positive integer, got "+n);return f(a.getEvents(t).slice(-n),e)}var i=l(n,Object.values(u.RECENCY_FILTERS));if(i)throw new Error(i.join("\n"));return f(s(a.getEvents(t),n),e)}function v(t,n){if(!(n=r(n)||{}).pick)throw new Error('No "pick" clause provided in query descriptor');if(!n.pick.name)throw new Error('No field name provided in "pick" clause');n.pick.modifier=n.pick.modifier||u.FREQUENCY_FILTERS.MOST_FREQUENT;var e=l(n,Object.values(u.FREQUENCY_FILTERS));if(e)throw new Error(e.join("\n"));return s(a.getEvents(t),n)}function h(t,n){var e=u.buildFromSpecV0_2(n),i=a.getEvents(t),r=f(c.execute(e,i),{revenueAsTag:!0,timeAsTimestamp:!1});return(n.pick||n.reduce&&"count"===n.reduce.aggregator)&&(r=o(r)),n.reduce&&(r=r[0]),r}t.exports=["stores/visitor_events",function(t){return{getEvents:d.bind(null,t),getByFrequency:v.bind(null,t),query:h.bind(null,t)}}]},9176:function(t,n,e){t.exports=function(t){t.registerApiModule("behavior",e(6624))}},5506:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(9853)),t.registerAudienceMatcher("behavior",e(8916))}},8916:function(t,n,e){var i=e(6388),r=e(7467),o=e(7518);t.exports={fieldsNeeded:["events"],match:function(t,n){var e=i.parse(n.value);return(void 0===e.version?[e]:r.buildFromSpecV0_1(e)).every((function(n){return o.isSatisfied(n,t.events)}))}}},9853:function(t,n,e){var i=e(7512);t.exports={provides:"events",isTransient:!0,getter:[function(){return i.getEvents()}]}},2062:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(4845))}},4845:function(t,n,e){var i=e(571),r=e(7512),o=e(6388),a=e(7467);t.exports={provides:"customBehavior",shouldTrack:!0,isLazy:!1,getter:["stores/global","stores/visitor_attribute_entity",function(t,n){var e=t.getProjectId(),u=n.getCustomBehavioralAttributes(e).map((function(t){try{return{id:t.id,granularity:i.GRANULARITY.ALL,rule:a.buildFromSpecV0_2(o.parse(t.rule_json))}}catch(t){return}})).filter((function(t){return t})),c=r.getEvents();return i.evaluate(u,c)}]}},8453:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(3121)),t.registerAudienceMatcher("first_session",e(6304))}},6304:function(t){t.exports={fieldsNeeded:["first_session"],match:function(t){return!!t.first_session}}},3121:function(t,n,e){var i=e(6085),r=e(7512),o=e(2103).getFieldValue,a=e(8129).CURRENT_SESSION_INDEX;t.exports={provides:"first_session",shouldTrack:!0,getter:[function(){var t=r.getEvents();if(t&&t.length>0){var n=t[0];return o(n,[i.FIELDS.SESSION_INDEX])===a}return!0}]}},571:function(t,n,e){var i=e(3496),r={FIELDS:e(6085).FIELDS},o=e(7467),a=e(7518);n.GRANULARITY={ALL:"all",CURRENT_SESSION:"current_session",LAST_30_DAYS:"last_30_days",LAST_60_DAYS:"last_60_days"},n.evaluate=function(t,e){var u={};if(0===e.length){for(var c=0;c<t.length;c++)u[t[c].id]=t[c].defaultValue;return u}var s=function(t){if(0===t.length)return[];for(var n=t.length-1,e=r.FIELDS.SESSION_ID,i=t[n][e];n>0&&i===t[n-1][e];)n--;return t.slice(n)}(e),f=function(t,n){if(0===t.length||n<=0)return[];var e=+new Date-n*o.MILLIS_IN_A_DAY;e-=e%o.MILLIS_IN_A_DAY;for(var i=t.length;i>0&&e<=t[i-1][r.FIELDS.TIME];)i--;return t.slice(i)}(e,60);for(c=0;c<t.length;c++){var l=t[c],d=e;l.granularity===n.GRANULARITY.CURRENT_SESSION?d=s:l.granularity===n.GRANULARITY.LAST_60_DAYS&&(d=f);try{var v=d;l.rule&&(v=a.execute(l.rule,d)),u[l.id]=l.defaultValue,1===v.length?u[l.id]=v[0][0]||l.defaultValue:i.debug("Behavior / Rule for",l.id,"returned",v.length,"results, expected 1")}catch(t){i.error("Behavior / Rule for",l.id,"failed with",t.message||"")}}return u}},7512:function(t,n,e){var i=e(9990),r=e(3221).get("stores/visitor_events");n.getEvents=function(){var t=i.getEvents(),n=[].concat.apply([],Object.values(r.getForeignEvents())),e=[].concat.apply([],Object.values(r.getForeignEventQueues())),o=i.mergeAllEvents([t,n,e]);return o.slice(o.length-1e3)}},7467:function(t,n,e){var i=n,r={FIELDS:e(6085).FIELDS,FIELDS_V0_2:e(6085).FIELDS_V0_2},o=e(6388),a=e(3496),u=e(7518);i.MILLIS_IN_A_DAY=864e5,i.aggregateField=function(t,n){return"string"==typeof n&&(n=[n]),n=n||u.DEFAULT_FIELD,[u.generateAlias(t,n)]},i.groupField=function(t){return"string"==typeof t&&(t=[t]),[(t=t||u.DEFAULT_FIELD).join(".")]};var c={"<":"lt","<=":"lte",">":"gt",">=":"gte","=":"eq","==":"eq"};function s(t){return t=(t||"").toString().trim(),c[t]||t}function f(t,n,e){var o={where:n};if(t.count&&(o.limit=t.count),t.modifier===i.FREQUENCY_FILTERS.MOST_FREQUENT){var a=i.getFieldKeyPathForSource(t.name,e),u=i.aggregate("count"),c=i.aggregateField("count"),s=i.groupField(a);return Object.assign(o,{select:[{field:s}],groupBy:i.groupBy([a]),aggregate:[u],orderBy:[{field:c,direction:"DESC"}]})}return Object.assign(o,{orderBy:[{field:[r.FIELDS.TIME],direction:"DESC"}]})}i.fieldComparison=function(t,n,e){return"string"==typeof n&&(n=[n]),"exists"===(t=s(t))?{op:t,args:[{field:n}]}:{op:t,args:[{field:n},{value:e}]}},i.relativeTimeComparison=function(t,n){return{op:s(t),args:[{op:"-",args:[{eval:"now"},{field:[r.FIELDS.TIME]}]},{value:n*i.MILLIS_IN_A_DAY}]}},i.rangeTimeComparison=function(t){return Array.isArray(t)?{op:"between",args:[{field:[r.FIELDS.TIME]},{value:[t[0]||+new Date(0),t[1]||+new Date]}]}
2:(a.error("Rule builder","rangeTimeComparison passed invalid range",t),null)},i.groupBy=function(t){for(var n=[],e=0;e<t.length;e++)n[e]={field:t[e]};return n},i.aggregate=function(t,n){return"string"==typeof n&&(n=[n]),{op:t,args:[{field:n=n||u.DEFAULT_FIELD}]}},i.SOURCE_TYPES={BEHAVIOR:"events",CUSTOM_BEHAVIOR:"custom_behavior",DCP:"dcp"},i.FREQUENCY_FILTERS={MOST_FREQUENT:"most_frequent",LEAST_FREQUENT:"least_frequent"},i.RECENCY_FILTERS={MOST_RECENT:"most_recent",LEAST_RECENT:"least_recent"},i.getFieldKeyPathForSource=function(t,n){n=n||i.SOURCE_TYPES.BEHAVIOR;var e=[];return"string"==typeof t?(e=[t],n!==i.SOURCE_TYPES.BEHAVIOR||Object.values(r.FIELDS).includes(t)||(e=[r.FIELDS.OPTIONS,t])):e=t,e},i.buildFromSpecV0_1=function(t){if(!(t.action||t.filters&&0!==t.filters.length))throw new Error('Audience spec must have an "action" field or at least one "filter" '+o.stringify(t));var n=i.fieldComparison("gt",r.FIELDS.TIME,0),e=[],u=[];if(t.action&&(u.push(i.fieldComparison("eq",r.FIELDS.NAME,t.action.value)),t.action.type&&u.push(i.fieldComparison("eq",r.FIELDS.TYPE,t.action.type))),t.time)if("last_days"===t.time.type)u.push(i.relativeTimeComparison("lte",t.time.days));else if("range"===t.time.type){var c=i.rangeTimeComparison([t.time.start,t.time.stop]);c&&u.push(c)}else a.error("Rule builder",'Audience spec has bad "time" type',t.time.type);if(n={op:"and",args:u},t.count&&e.push({where:i.fieldComparison(t.count.comparator,"0",t.count.value),from:{select:[{field:i.aggregateField("count")}],where:n,aggregate:[i.aggregate("count")]}}),t.filters&&t.filters.forEach((function(o){var a,c,s=i.getFieldKeyPathForSource(o.name,t.source);if(o.modifier===i.FREQUENCY_FILTERS.MOST_FREQUENT?(a=i.aggregate("count"),c=i.aggregateField("count")):o.modifier===i.RECENCY_FILTERS.MOST_RECENT&&(a=i.aggregate("max",r.FIELDS.TIME),c=i.aggregateField("max",r.FIELDS.TIME)),a){var f=s,l=i.groupField(f);e.push({where:i.fieldComparison(o.comparator,"0",o.value),from:{select:[{field:l}],where:n,groupBy:i.groupBy([f]),aggregate:[a],orderBy:[{field:c,direction:"DESC"}],limit:1}})}else u.push(i.fieldComparison(o.comparator,s,o.value))})),t.pick){if(e.length>0)throw new Error('A "pick" clause must not be specified with "count" or "most_recent", "most_frequent" modifiers'+o.stringify(t));return[f(t.pick,n,t.source)]}return e.length>0?e:[{where:n}]},i.buildFromSpecV0_2=function(t){!function(t){var n=[];if(void 0===t)throw new Error("rule is undefined");if("object"!=typeof t||null===t)throw new Error("rule is not an Object");"0.2"!==t.version&&n.push('version: not "0.2"'),t.filter&&(Array.isArray(t.filter)?t.filter.forEach((function(t,e){var r=i.validateFieldKeyPathV0_2(t.field,i.FieldPurpose.FILTER);r&&n.push("filter["+e+"]: "+r);var o=i.validateComparatorAndValue(t.comparator,t.value);o&&n.push("filter["+e+"]: "+o)})):n.push("filter: not an array"));var e=[],r=[];t.sort&&(t.reduce&&t.reduce.aggregator&&"nth"!==t.reduce.aggregator&&n.push("sort: superfluous because we can apply aggregator "+o.stringify(t.reduce.aggregator)+" to unsorted items"),Array.isArray(t.sort)?t.sort.forEach((function(t,a){var u=i.validateFieldKeyPathV0_2(t.field,i.FieldPurpose.SORT);u&&n.push("sort["+a+"]: "+u),t.field&&"frequency"===t.field[0]?e.push(t):r.push(t);var c=function(t){var n="direction "+(o.stringify(t)||String(t));if(!["ascending","descending"].includes(t))return n+' is not "ascending" or "descending"'}(t.direction);c&&n.push("sort["+a+"]: "+c)})):n.push("sort: not an array"),e.length&&r.length&&n.push('sort: sorting by non-["frequency"] field is pointless because we are going to sort the picked values by ["frequency"]'),e.length&&!t.pick&&n.push('sort: sorting by ["frequency"] is impossible because no values have been picked'));if(t.pick){t.reduce&&"count"===t.reduce.aggregator&&n.push('pick: superfluous because we can apply aggregator "count" to raw events');var a=i.validateFieldKeyPathV0_2(t.pick.field);a&&n.push("pick: "+a)}if(t.reduce){var u=t.reduce.aggregator,c="aggregator "+(o.stringify(u)||String(u)),s=t.reduce.n,f="index "+(o.stringify(s)||String(s));["sum","avg","max","min","count","nth"].includes(u)||n.push("reduce: "+c+" is unknown"),["sum","avg","max","min"].includes(u)&&(t.pick||n.push("reduce: "+c+" is impossible to use because no values have been picked")),"nth"===u?(("number"!=typeof s||isNaN(s)||Math.floor(s)!==s||s<0)&&n.push("reduce: "+f+" is not a non-negative integer (mandated by "+c+")"),t.sort||n.push('reduce: aggregator "nth" is meaningless without a specific sort order')):void 0!==s&&n.push("reduce: "+f+" is defined (not mandated by "+c+")")}if(n.length)throw new Error(n.join("\n"))}(t);var n={where:{op:"and",args:(t.filter||[]).map((function(t){return"age"===t.field[0]?i.relativeTimeComparison(t.comparator||"eq",t.value/i.MILLIS_IN_A_DAY):i.fieldComparison(t.comparator||"eq",i.convertFieldKeyPathFromSpecV0_2(t.field),t.value)}))}};if(t.reduce&&"count"===t.reduce.aggregator)return Object.assign(n,{aggregate:[{op:"count",args:[{field:["*"]}]}],select:[{field:["_count_*"]}]});var e=[],r=[];if(t.sort&&(t.sort.forEach((function(t){["ascending","descending"].includes(t.direction)&&(["time","age"].includes(t.field[0])&&r.push(t),"frequency"===t.field[0]&&e.push(t))})),r.length&&!e.length&&(n.orderBy=r.map((function(t){return"time"===t.field[0]?{field:i.convertFieldKeyPathFromSpecV0_2(["time"]),direction:"ascending"===t.direction?"ASC":"DESC"}:"age"===t.field[0]?{field:i.convertFieldKeyPathFromSpecV0_2(["time"]),direction:"ascending"===t.direction?"DESC":"ASC"}:void 0})).filter((function(t){return t})))),t.pick&&t.pick.field){var a=i.convertFieldKeyPathFromSpecV0_2(t.pick.field);if(t.reduce&&["avg","max","min","sum"].includes(t.reduce.aggregator))return Object.assign(n,{aggregate:[{op:t.reduce.aggregator,args:[{field:a}]}],select:[{field:[u.generateAlias(t.reduce.aggregator,a)]}]});n=e.length?Object.assign(n,{groupBy:[{field:a}],aggregate:[{op:"count",args:[{field:["*"]}]}],orderBy:[{field:["_count_*"],direction:"ascending"===e[0].direction?"ASC":"DESC"}],select:[{field:[a.join(".")]}]}):Object.assign(n,{select:[{field:a}]})}if(t.reduce&&"nth"===t.reduce.aggregator){var c=t.reduce.n;if("number"==typeof c&&c>=0&&Number(c)===Math.floor(Number(c)))return Object.assign(n,{offset:c,limit:1})}return n},i.convertFieldKeyPathFromSpecV0_2=function(t){return"tags"===t[0]&&"revenue"===t[1]?["r"]:[r.FIELDS_V0_2[t[0]]].concat(t.slice(1))},i.FieldPurpose={FILTER:"filter",SORT:"sort",PICK:"pick"},i.validateFieldKeyPathV0_2=function(t,n){var e="field "+(o.stringify(t)||String(t));if(!Array.isArray(t)||!t.every((function(t){return"string"==typeof t}
2)))return e+" is not an array of strings";if("tags"===t[0]&&t.length>2||"tags"!==t[0]&&t.length>1)return e+" includes too many strings";if("tags"===t[0]&&t.length<2)return e+" does not specify an exact tag";if(t.length<1)return e+" does not specify a top-level field";var a=Object.keys(r.FIELDS_V0_2),u=["age","frequency"];return n===i.FieldPurpose.FILTER&&(a.push("age"),u=["frequency"]),n===i.FieldPurpose.SORT&&(a=["time","age","frequency"],u=["name","type","category","tags"]),u.includes(t[0])?e+" is not supported here":a.includes(t[0])?void 0:e+" is unknown"},i.validateComparatorAndValue=function(t,n){var e="comparator "+(o.stringify(t)||String(t)),i="value "+(o.stringify(n)||String(n));if("string"!=typeof t&&void 0!==t)return e+" is not a string";switch(t){case void 0:case"eq":case"is":case"contains":break;case"lt":case"gt":case"lte":case"gte":if("number"!=typeof n)return i+" is not a number (mandated by "+e+")";break;case"in":if(!Array.isArray(n))return i+" is not an array (mandated by "+e+")";break;case"between":if(!(Array.isArray(n)&&2===n.length&&"number"==typeof n[0]&&"number"==typeof n[1]&&n[0]<=n[1]))return i+" is not a pair of increasing numbers (mandated by "+e+")";break;case"regex":if(!("string"==typeof n||Array.isArray(n)&&2===n.length&&"string"==typeof n[0]&&"string"==typeof n[1]))return i+" is not a pattern string or a [pattern string, flags string] array (mandated by "+e+")";break;case"exists":if(void 0!==n)return i+" is not undefined (mandated by "+e+")";break;default:return e+" is unknown"}}},7518:function(t,n,e){var i=e(2044),r=e(3496),o=r.log.bind(r),a=e(6310),u=e(2103).getFieldValue,c=e(6388),s=function(t,n,e){if(t.getValueOrDefault)return t.getValueOrDefault(n,e);if(!Array.isArray(n))return e;var i=u(t,n);return void 0===i&&(i=e),i},f=function(t){return"string"==typeof t?t.trim().toLowerCase():t};n.clause={WHERE:"where",GROUP_BY:"groupBy",AGGREGATE:"aggregate",HAVING:"having",ORDER_BY:"orderBy",SELECT:"select",OFFSET:"offset",LIMIT:"limit",FROM:"from"},n.DEFAULT_FIELD=["*"],n.booleanOperators={eq:function(t){var n=t.map(f);return n[0]==n[1]},is:function(t){return t[0]===t[1]},gt:function(t){return t[0]>t[1]},lt:function(t){return t[0]<t[1]},gte:function(t){return t[0]>=t[1]},lte:function(t){return t[0]<=t[1]},in:function(t){return(t[1]||[]).map(f).includes(f(t[0]))},between:function(t){return t[1][0]<=t[0]&&t[0]<=t[1][1]},contains:function(t){var n=t.map((function(t){return"string"==typeof t?t.toLowerCase():t}));return-1!==(n[0]||"").indexOf(n[1])},regex:function(t){try{var n,e;return"string"==typeof t[1]?(n=t[1],e="i"):(n=t[1][0]||"",e=t[1][1]||""),new RegExp(n,e).test(t[0])}catch(t){return r.error("Rules",'In operator "regex", error: '+(t.message||"invalid RegExp /"+[n,e].join("/"))),!1}},exists:function(t){return void 0!==t[0]},and:function(t){return t.every((function(t){return t}))},or:function(t){return t.some((function(t){return t}))},not:function(t){return!t[0]}},n.arithmeticOperators={"+":function(t){return(t[0]||0)+(t[1]||0)},"-":function(t){return(t[0]||0)-(t[1]||0)},"/":function(t){return(t[0]||0)/(t[1]||1)},"%":function(t){return(t[0]||0)%(t[1]||1)}},n.aggregateOperators={sum:function(t,e){for(var i=t[0]||n.DEFAULT_FIELD,r=0,o=0;o<e.length;o++)r+=s(e[o],i,0);return r},avg:function(t,e){if(0===e.length)return 0;for(var i=t[0]||n.DEFAULT_FIELD,r=0,o=0;o<e.length;o++)r+=s(e[o],i,0);return r/e.length},max:function(t,e){for(var i=t[0]||n.DEFAULT_FIELD,r=Number.NEGATIVE_INFINITY,o=0;o<e.length;o++)r=Math.max(r,s(e[o],i,Number.NEGATIVE_INFINITY));return r},min:function(t,e){for(var i=t[0]||n.DEFAULT_FIELD,r=Number.POSITIVE_INFINITY,o=0;o<e.length;o++)r=Math.min(r,s(e[o],i,Number.POSITIVE_INFINITY));return r},count:function(t,n){return n.length}};var l={now:function(){return a.now()}},d=function(t,e){if(e.hasOwnProperty("value"))return e.value;if(e.hasOwnProperty("field"))return s(t,e.field);if(e.hasOwnProperty("eval"))return e.eval in l?l[e.eval]():void r.error("Rules","Unknown function: "+e.eval);if(e.op){var i,o=(i=e.op)in n.booleanOperators?n.booleanOperators[i]:i in n.arithmeticOperators?n.arithmeticOperators[i]:null;if(o){var a=d.bind(null,t);return o((e.args||[]).map((function(t){return a(t)})),t)}r.error("Rules","Unknown operator: "+e.op)}else r.error("Rules","No operator specified: "+c.stringify(e))};n.generateAlias=function(t,n){return"_"+t+"_"+n.join(".")};n.rewrite=function(t){var e=[],i={};function o(t,a){if(Array.isArray(t)&&("and"!==t[0]&&"or"!==t[0]&&"not"!==t[0]&&r.error("Rules","Unexpected operation "+t[0]+". Continuing optimistically."),t={op:t[0],args:t.slice(1)}),t.hasOwnProperty("field")||t.hasOwnProperty("value")||t.hasOwnProperty("eval"))return t;if(a&&t.op in n.aggregateOperators){var u=(t.args&&t.args[0]||{}).field||n.DEFAULT_FIELD,c=n.generateAlias(t.op,u);return c in i||(e.push({op:t.op,args:t.args}),i[c]=!0),{field:[c]}}for(var s=[],f=t.args||[],l=0;l<f.length;l++)s[l]=o(f[l],a);return{op:t.op,args:s}}var a={};t.hasOwnProperty(n.clause.WHERE)&&(a[n.clause.WHERE]=o(t[n.clause.WHERE],!1)),t.hasOwnProperty(n.clause.HAVING)&&(a[n.clause.HAVING]=o(t[n.clause.HAVING],!0)),(t.hasOwnProperty(n.clause.AGGREGATE)||e.length>0)&&(a[n.clause.AGGREGATE]=(t[n.clause.AGGREGATE]||[]).concat(e));for(var u=[n.clause.GROUP_BY,n.clause.ORDER_BY,n.clause.SELECT,n.clause.OFFSET,n.clause.LIMIT],c=0;c<u.length;c++)t.hasOwnProperty(u[c])&&(a[u[c]]=t[u[c]]);return t.hasOwnProperty(n.clause.FROM)&&(a[n.clause.FROM]=n.rewrite(t[n.clause.FROM])),a};var v=function(t,e){e=e||0;var i=[];if(t.hasOwnProperty(n.clause.WHERE)?t[n.clause.WHERE].op?t[n.clause.WHERE].op in n.booleanOperators||i.push("Non-boolean WHERE clause operator"):i.push("Missing WHERE clause operator"):i.push("Missing WHERE clause"),!t.hasOwnProperty(n.clause.HAVING)||(t[n.clause.HAVING].op?t[n.clause.HAVING].op in n.booleanOperators||i.push("Non-boolean HAVING clause operator"):i.push("Missing HAVING clause operator")),t.hasOwnProperty(n.clause.GROUP_BY)&&!t.hasOwnProperty(n.clause.AGGREGATE)&&i.push("No AGGREGATE clause specified with GROUP_BY clause"),t.hasOwnProperty(n.clause.SELECT)){var r=t[n.clause.SELECT];if(Array.isArray(r))for(var o=0;o<r.length;o++)r[o].op&&r[o].op in n.aggregateOperators&&i.push('In SELECT clause, aggregate operator "'+r[o].op+'" specified in selector at index '+o);else i.push("SELECT clause must be an array")}if(t.hasOwnProperty(n.clause.OFFSET)){var a=t[n.clause.OFFSET];("number"!=typeof a||Number(a)<0||Number(a)!==Math.floor(Number(a)))&&i.push("OFFSET must be a non-negative integer")}if(t.hasOwnProperty(n.clause.LIMIT)){var u=t[n.clause.LIMIT];("number"!=typeof u||Number(u)<0||Number(u)!==Math.floor(Number(u)))&&i.push("LIMIT must be a non-negative integer")}return e>0&&(i=i.map((function(t){return"Sub-rule "+e+": "+t}))),t.hasOwnProperty(n.clause.FROM)&&(i=i.concat(v(t[n.clause.FROM],e+1))),i},h=function(t,e){var i,a,u,f=e;if(t.hasOwnProperty(n.clause.FROM)&&(r.debug("Evaluating FROM clause:",t[n.clause.FROM]),f=h(t[n.clause.FROM],f),r.debug("Results after FROM:",f)),r.debug("Evaluating WHERE clause:",t[n.clause.WHERE]),f=f.filter((function(e){return d(e,t[n.clause.WHERE])})),r.debug("Results after WHERE:",f),t.hasOwnProperty(n.clause.AGGREGATE)){r.debug("Evaluating AGGREGATE clause:",t[n.clause.AGGREGATE]);var l=function(t,n){var e={};if(void 0===t||!Array.isArray(t)||0===t.length)return e["*"]={fieldValues:{},events:n},e;
2for(var i=t.map((function(t){return t.field})),r=0;r<n.length;r++){for(var o=n[r],a=[],u={},f=0;f<i.length;f++){var l=i[f],d=s(o,l),v=l.join(".");u[v]=d,a.push(encodeURIComponent(v)+"="+encodeURIComponent(c.stringify(d)))}var h=a.join("&");e.hasOwnProperty(h)||(e[h]={fieldValues:u,events:[]}),e[h].events.push(o)}return e}(t[n.clause.GROUP_BY],f);f=function(t,n){var e=[];return Object.keys(t).forEach((function(i){var r=t[i],o=Object.assign({},r.fieldValues),a=n[i]||{};Object.assign(o,a),e.push(o)})),e}(l,(i=t[n.clause.AGGREGATE],a=l,u={},Object.keys(a).forEach((function(t){var e=a[t];u[t]={};for(var o=0;o<i.length;o++){var c=i[o],s=c.op;if(s in n.aggregateOperators){var f=(c.args&&c.args[0]||{}).field||n.DEFAULT_FIELD,l=n.generateAlias(s,f),d=n.aggregateOperators[s]([f],e.events);u[t][l]=d}else r.error("Rules","Unknown aggregate operator "+s)}})),u)),r.debug("Results after AGGREGATE:",f)}t.hasOwnProperty(n.clause.HAVING)&&(r.debug("Evaluating HAVING clause:",t[n.clause.HAVING]),f=f.filter((function(e){return d(e,t[n.clause.HAVING])})),r.debug("Results after HAVING:",f)),t.hasOwnProperty(n.clause.ORDER_BY)&&(r.debug("Evaluating ORDER_BY clause:",t[n.clause.ORDER_BY]),f=function(t,n){return Array.isArray(t)?0===t.length?n:n.sort((function(n,e){for(var i=0;i<t.length;i++){var r=t[i],o="ASC"===(r.direction||"ASC")?1:-1,a=r.field,u=s(n,a,0),c=s(e,a,0);if(u<c)return-o;if(u>c)return o}return 0})):(o("Rules","groupBy rule must be an array"),n)}(t[n.clause.ORDER_BY],f),r.debug("Results after ORDER_BY:",f));var v,p=0;return t.hasOwnProperty(n.clause.OFFSET)&&(r.debug("Evaluating OFFSET clause:",t[n.clause.OFFSET]),p=Number(t[n.clause.OFFSET])),t.hasOwnProperty(n.clause.LIMIT)&&(r.debug("Evaluating LIMIT clause:",t[n.clause.LIMIT]),v=p+Number(t[n.clause.LIMIT])),(p>0||void 0!==v)&&(f=f.slice(p,v),r.debug("Results after OFFSET/LIMIT:",f)),t.hasOwnProperty(n.clause.SELECT)&&(r.debug("Evaluating SELECT clause:",t[n.clause.SELECT]),f=function(t,n){return n.map((function(n){return t.map((function(t){return d(n,t)}))}))}(t[n.clause.SELECT],f),r.debug("Results after SELECT:",f)),f};n.execute=function(t,e){t=n.rewrite(t),r.shouldLog(i.LogLevel.DEBUG)&&r.groupCollapsed("Evaluating Behavioral Rule"),r.debug("Rule:",t,c.stringify(t)),r.debug("Events:",e);var o=v(t);if(o.length>0)throw new Error("Rule "+c.stringify(t)+" has violations: "+o.join("\n"));var a=h(t,e);return r.debug("Rule result:",a),r.shouldLog(i.LogLevel.DEBUG)&&r.groupEnd(),a},n.isSatisfied=function(t,e){try{return n.execute(t,e).length>0}catch(n){return r.error("Rules","Error "+n.toString()+" while evaluating rule "+c.stringify(t)),!1}}},3268:function(t,n,e){t.exports=function(t){t.registerDependency("sources/browser_id",e(8605)),t.registerVisitorProfileProvider(e(6065)),t.registerVisitorProfileProvider(e(9310)),t.registerAudienceMatcher("browser_version",e(2762))}},2762:function(t,n,e){var i=e(6036).G;t.exports={fieldsNeeded:["browserVersion","browserId"],match:function(t,n){var e=n.value,r=t.browserId,o=t.browserVersion;if(0===e.indexOf(r)){var a=e.substr(r.length);return 0===i(o,a)}return!1}}},6065:function(t){t.exports={provides:"browserId",shouldTrack:!0,isSticky:!0,getter:["sources/browser_id",function(t){return t.getId()}]}},9310:function(t){t.exports={provides:"browserVersion",getter:["sources/browser_id",function(t){return t.getVersion()}]}},8605:function(t,n,e){var i=e(7566);n.getId=function(){return i.get().browser.id},n.getVersion=function(){return i.get().browser.version}},679:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(3670)),t.registerAudienceMatcher("campaign",e(6233))}},6233:function(t,n,e){var i=e(8681);t.exports={fieldsNeeded:["campaign"],match:function(t,n){return i.hasMatch(n.value,n.match,t.campaign)}}},3670:function(t,n,e){var i=e(2122);t.exports={provides:"campaign",shouldTrack:!0,isSticky:!0,getter:[function(){return i.getQueryParamValue("utm_campaign")}]}},6539:function(t,n,e){var i=e(6388),r=e(4464),o=e(3496),a=e(7649),u=e(6484);n.getCmabPredictionUrl=function(){return"https://prediction.cmab.optimizely.com/predict"},n.getCmabPredictionUrlForExperiment=function(t){return t?n.getCmabPredictionUrl()+"/"+t:""},n.createPayload=function(t,n){var e=t.variations.map((function(t){return t.id})),i=u.getVisitorCmabAttributesForExperiment(t),r=u.getDcpCustomerIds(),o=u.getDcpServiceId();return{instances:[{visitorId:a.getCurrentId(),experimentId:t.id,cmabUUID:n,variationIds:e,attributes:i,dcpCustomerIds:r,dcpServiceId:o}]}},n.parseApiResponse=function(t){var n=null;try{n=i.parse(t)}catch(t){return o.error("CMAB API / Error parsing response:",t),null}return n&&n.predictions&&0!==n.predictions.length?n.predictions[0].variation_id.toString():(o.debug("CMAB API / No predictions foun
2d in API response",n),null)},n.validateVariationId=function(t,n){return t&&n.variations.find((function(n){return n.id===t}))?(o.debug("CMAB API / Variation ID:",t,"from API response found in experiment:",n.id),t):(o.debug("CMAB API / Variation ID:",t,"from API response not found in experiment:",n.id),null)},n.handleCmabApiResponse=function(t,e){if(200!==t.status)return o.error("CMAB API / API call failed with status:",t.status,t.statusText),null;o.debug("CMAB API / API call successful:",t.responseText);var i=n.parseApiResponse(t.responseText);return n.validateVariationId(i,e)},n.makeSyncApiCallWithXHR=function(t,e){o.debug("CMAB API / SYNC / Making a synchronous API call to get variation.");try{var r=n.createPayload(t,e),a=n.getCmabPredictionUrlForExperiment(t.id),u=new XMLHttpRequest;return u.open("POST",a,!1),u.send(i.stringify(r)),n.handleCmabApiResponse(u,t)}catch(t){return o.error("CMAB API / SYNC / API call encountered an error:",t),null}},n.makeAsyncApiCall=function(t,e){o.debug("CMAB API / ASYNC / Making an asynchronous API call to get variation.");var i=n.createPayload(t,e),a=n.getCmabPredictionUrlForExperiment(t.id);return r.request({url:a,contentType:"application/json",method:"POST",data:i})}},9819:function(t,n,e){var i=e(3496),r=e(6484),o=e(6539),a=e(7883);n.isCmabEnabled=function(){return!0},n.isExperimentSyncApiEnabled=function(t){return!0},n.defaultToSnippetBucketing=function(t,n,e){i.debug("CMAB / Defaulting to snippet bucketing with variation:",n,"for experiment:",t.id),r.setCmabVariationDataInVisitorStore(t,n,e)},n.processCmabExperiment=function(t,e){if(!n.isCmabEnabled())return i.debug("CMAB / Feature flag is disabled. Defaulting to snippet bucketing with variation:",e,"for experiment:",t.id),e;if(i.debug("CMAB / Feature flag is enabled. Processing CMAB for experiment:",t.id),r.activateTimeoutForNonBucketedCmabExperiments(t),!r.isCmabExperiment(t))return e;var u=r.getCmabVariationDataFromVisitorStore(t);if(!r.isCmabTimeout(t,u))return u.variationId;a.startCmabApiCallPerformanceTimer(t.id);
2var c=null,s=r.generateCmabUUID();if(n.isExperimentSyncApiEnabled(t))try{return(c=o.makeSyncApiCallWithXHR(t,s))?(r.setCmabVariationDataInVisitorStore(t,c,s),a.endCmabApiCallPerformanceTimer(t.id),c):(n.defaultToSnippetBucketing(t,e,s),a.endCmabApiCallPerformanceTimer(t.id),e)}catch(r){return i.error("CMAB API / SYNC / API call failed with error:",r),n.defaultToSnippetBucketing(t,e,s),a.endCmabApiCallPerformanceTimer(t.id),null}return o.makeAsyncApiCall(t,s).then((function(u){return(c=o.handleCmabApiResponse(u,t))?(i.debug("CMAB API / ASYNC / Variation:",c,"for experiment:",t.id),r.setCmabVariationDataInVisitorStore(t,c,s),a.endCmabApiCallPerformanceTimer(t.id),c):(n.defaultToSnippetBucketing(t,e,s),a.endCmabApiCallPerformanceTimer(t.id),e)}),(function(r){return i.error("CMAB API / ASYNC / API call failed with error:",r),n.defaultToSnippetBucketing(t,e,s),a.endCmabApiCallPerformanceTimer(t.id),null})),n.defaultToSnippetBucketing(t,e,s),a.endCmabApiCallPerformanceTimer(t.id),e},n.getCmabUUIDAndUpdateSessionTimeout=function(t,n){var e=r.getCmabUUIDFromVisitorStore(t,n);return r.updateCmabTimeoutInVisitorStore(t,n),e}},7883:function(t,n,e){e(6494),e(3496);n.startCmabApiCallPerformanceTimer=function(t){0},n.endCmabApiCallPerformanceTimer=function(t){0}},6484:function(t,n,e){var i=e(279),r=i.omit,o=i.omitBy,a=e(243),u=e(6388),c=e(3221),s=e(167),f=e(7649),l=e(3496),d=e(2044),v=e(1190),h=c.get("stores/visitor"),p=c.get("stores/plugins"),g=c.get("stores/global"),m=c.get("stores/layer");n.generateCmabUUID=function(){return s.generate()},n.getCmabLayerIdFromExperiment=function(t){return t.experimentMetadata&&t.experimentMetadata.layerId||t.id},n.isCmabExperiment=function(t){var n=t.experimentMetadata&&t.experimentMetadata.allocationPolicy;return n?n===d.AllocationPolicyEnum.CMAB:(l.debug("No allocation policy found in metadata for experiment:",t.id),!1)},n.isVisitorInHoldback=function(t){if(g.isGlobalHoldback())return l.debug("CMAB / Visitor is in global holdback, no timeout"),!0;var e=n.getCmabLayerIdFromExperiment(t),i=m.getLayerState(e);return!!(i&&i.decision&&i.decision.isLayerHoldback)&&(l.debug("CMAB / Visitor is in layer holdback, no timeout"),!0)},n.isCmabTimeout=function(t,e){if(!n.isCmabVariationStorageDataValid(e))return l.debug("CMAB / Timeout CMAB Storage Variation Data is invalid"),!0;if(n.isVisitorInHoldback(t))return!1;var i=e.variationId;return t.variations.find((function(t){return t.id===i}))?n.hasSessionOrAbsoluteTimeoutOccurred(e)?(l.debug("CMAB / Timeout Session or absolute timeout occurred:",e.cmabUUID),!0):(l.debug("CMAB / No timeout happened for:",e.cmabUUID),!1):(l.debug("CMAB / Timeout Variation ID:",i,"not found in experiment:",t.id),!0)},n.hasSessionOrAbsoluteTimeoutOccurred=function(t){if(!n.isCmabVariationStorageDataValid(t))return l.debug("CMAB / Timeout CMAB Storage Variation Data is invalid"),!0;var e=(new Date).getTime();new Date(t.stSessionTimeout).getTime();
2return e-new Date(t.stAbsoluteTimeout).getTime()>864e5},n.isCmabVariationStorageDataValid=function(t){if(!t)return!1;for(var n=["variationId","visitorId","cmabUUID","stSessionTimeout","stAbsoluteTimeout","userAttributeHash"],e=0;e<n.length;e++){var i=n[e];if(!t[i])return l.debug("CMAB / Storage data not found: "+i+" is missing"),!1}return!0},n.activateTimeoutForNonBucketedCmabExperiments=function(t){var e=n.getCmabLayerIdFromExperiment(t),i=t.id;l.debug("CMAB / Visitor is bucketed into experiment id:",i+" from layer id:",e);var a=f.getContextualMabMap();if(a&&a[e]){var u=a[e];l.debug("CMAB / All CMAB experiments found for the layer id:",e,"are:",u),l.debug("CMAB / Excluding the currently bucketed experiment id: ",i," from all CMAB experiments found for the current layer id: ",e);var c=r(u,[i]);c=o(c,(function(t){return t.isTimeout})),l.debug("CMAB / Non-bucketed CMAB experiments which will be timed out:",c),Object.keys(c).forEach((function(t){var n=c[t];n.isTimeout=!0,f.updateContextualMabMap(e,t,n)})),f.persistContextualMabMap()}else l.debug("CMAB / No CMAB experiments found for the current layer id:",e)},n.getCmabUUIDFromVisitorStore=function(t,n){if(!n||!t)return null;var e=f.getContextualMabMap();return e&&e[t]&&e[t][n]?e[t][n].cmabUUID:null},n.updateCmabTimeoutInVisitorStore=function(t,e){var i;if(!e||!t)return null;var r=f.getContextualMabMap();if(null==r||null==(i=r[t])?void 0:i[e]){var o=r[t][e];o.isTimeout||n.hasSessionOrAbsoluteTimeoutOccurred(o)||(o.stSessionTimeout=(new Date).toISOString(),f.updateContextualMabMap(t,e,o),f.persistContextualMabMap())}},n.getCmabVariationDataFromVisitorStore=function(t){var e,i=n.getCmabLayerIdFromExperiment(t),r=f.getContextualMabMap();if(!(null==r||null==(e=r[i])?void 0:e[t.id]))return l.debug("CMAB / No CMAB store found for experiment:",t.id),null;l.debug("CMAB / CMAB store found for experiment:",t.id);var o=r[i][t.id];return l.debug("CMAB / Contextual MAB Variation Data:",o),o},n.setCmabVariationDataInVisitorStore=function(t,e,i){l.debug("CMAB / Setting CMAB store for experiment:",t.id+" with variation:",e+" and cmabUUID:",i);var r=(new Date).toISOString(),o=n.getCmabLayerIdFromExperiment(t),a=n.getVisitorAttributesHash(t),u={variationId:e,visitorId:f.getCurrentId(),cmabUUID:i,stSessionTimeout:r,stAbsoluteTimeout:r,userAttributeHash:a,isTimeout:!1};f.updateContextualMabMap(o,t.id,u),f.persistContextualMabMap()},n.getStringifiedValue=function(t){if("string"==typeof t)return t;var n="";try{n=u.stringify(t)}catch(n){l.error("CMAB / Failed to stringify value for attributes:",t,n)}return n},n.getVisitorCmabAttributesForExperiment=function(t,e){var i;void 0===e&&(e=!0);var r=[],o=p.getAllPlugins(d.PluginTypes.audienceMatchers);if(!(null==t||null==(i=t.experimentMetadata)?void 0:i.cmabAttributes))return r;var a=t.experimentMetadata.cmabAttributes,u=a.customAttributes,c=a.standardAttributes;return u.forEach((function(t){var e,i=(null==(e=h.getAttribute(["custom",t.id]))?void 0:e.value)||"";i=n.getStringifiedValue(i),r.push({id:t.id,type:t.type,value:i,client_api_name:t.clientApiName})})),c.forEach((function(t){var e,i,a=(null==(e=o[t.id])||null==(i=e.fieldsNeeded)?void 0:i[0])||t.id,u=h.getAttribute(a)||"";u=n.getStringifiedValue(u),r.push({id:t.id,type:t.type,value:u})})),l.debug("CMAB / Current Visitor CMAB Attributes for Experiment:",t.id,"are:",r),r},n.generateAttributesHash=function(t){return a.hashToHex(a.toByteString(u.stringify(t)),a.Seed.BEHAVIOR_EVENT)},n.getVisitorAttributesHash=function(t){var e=n.getVisitorCmabAttributesForExperiment(t,!1);return n.generateAttributesHash(e)},n.hasAttributesChanged=function(t,e){var i=n.getVisitorAttributesHash(t);return i!==e.userAttributeHash&&(l.debug("CMAB / User attributes hash has changed from:",e.userAttributeHash," to ",i),!0)},n.getDcpCustomerIds=function(){var t=g.getDCPKeyfieldLocators(),n=f.getCurrentId();return v.getCurrentAliases(t,n)},n.getDcpServiceId=function(){return g.getDCPServiceId()}},168:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(2354)),t.registerAudienceMatcher("cookies",e(3957))}},3957:function(t,n,e){var i=e(8681);t.exports={fieldsNeeded:["cookies"],match:function(t,n){var e=n.name,r=n.value,o=n.match,a=t.cookies[e];return i.hasMatch(r,o,a)}}},2354:function(t,n,e){var i=e(2658),r=e(3221).get("stores/audience_data");t.exports={provides:"cookies",isLazy:!0,getter:[function(){var t=i.getAll(),n=r.getFeaturesNeeded("cookies");return Object.keys(t).reduce((function(e,i){var r=t[i];return Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=r),e}),{})}]}},3585:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(9864));var n=e(917);t.registerAudienceMatcher("custom_attribute",n),t.registerAudienceMatcher("custom_dimension",n)}},917:function(t,n,e){var i=e(8681);n.match=function(t,n){var e;return t.custom&&(e=t.custom[n.name]),"object"==typeof e&&null!==e&&(e=e.value),i.hasMatch(n.value,
2n.match,e)}},9864:function(t,n,e){var i=e(2044),r=e(3496),o=e(3221).get("stores/dimension_data");t.exports={provides:"custom",attributionType:i.AttributionTypes.LAST_TOUCH,restorer:function(t){return Object.keys(t).reduce((function(n,e){var i=t[e],a=e,u=o.getByApiName(e),c=o.getById(e);return"object"!=typeof i||null===i?(r.error('Unable to restore custom attribute "'+e+'" because value is not an object'),n):(!i.id&&u&&(c=u,a=u.id,Object.assign(i,{id:c.segmentId||c.id})),!i.name&&c&&c.apiName&&(i.name=c.apiName),i.id||c||r.warn("Unable to determine ID for custom attribute:",e,"; segmentation is disabled."),n[a]=i,n)}),{})},shouldTrack:!0}},1190:function(t,n,e){var i=e(2122),r=e(2658),o=e(3496),a=e(3898),u="cookie",c="js_variable",s="query_param",f="uid";n.getCurrentAliases=function(t,n){var e={};return t.forEach((function(t){if(!t.is_optimizely){var l=t.dcp_datasource_id,d=t.type,v=t.name||"";if(l){var h=null;switch(d){case u:h=r.get(v);break;case c:try{h=a.getGlobal(v)}catch(t){o.warn("Failed getting global DCP keyfieldLocator:",v)}break;case s:h=i.getQueryParamValue(v);break;case f:h=n}("number"==typeof h||"string"==typeof h)&&(e[l]=h)}else o.error("DCP / No DCP datasource id specified")}})),e}},219:function(t,n,e){t.exports=function(t){t.registerDependency("sources/device",e(7618)),t.registerVisitorProfileProvider(e(3850)),t.registerAudienceMatcher("device",e(521))}},521:function(t){t.exports={fieldsNeeded:["device"],match:function(t,n){return t.device===n.value}}},3850:function(t){t.exports={provides:"device",shouldTrack:!0,isSticky:!0,getter:["sources/device",function(t){return t.getDevice()}]}},7618:function(t,n,e){var i=e(7566);n.getDevice=function(){var t=i.get().device;return"unknown"!==t.model?t.model:"tablet"===t.type?"tablet":t.isMobile?"mobile":"desktop"}},6384:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(5762)),t.registerAudienceMatcher("device_type",e(1797))}},1797:function(t){t.exports={fieldsNeeded:["device_type"],match:function(t,n){return t.device_type===n.value}}},5762:function(t,n,e){var i=e(7566);t.exports={provides:"device_type",shouldTrack:!0,isSticky:!0,getter:[function(){var t=i.get().device;switch(t.type){case"mobile":return"phone";case"tablet":case"desktop_laptop":return t.type;default:return"other"}}]}},6507:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(5947)),t.registerAudienceMatcher("query",e(4035))}},4035:function(t,n,e){var i=e(8681);n.fieldsNeeded=["queryParams"],n.match=function(t,n){var e=t.queryParams.find((function(t){return t[0]===n.name}));return i.hasMatch(n.value,n.match,e?e[1]:null)}},5947:function(t,n,e){var i=e(2122);t.exports={provides:"queryParams",getter:[function(){return i.getQueryParams()}]}},5038:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(4920)),t.registerAudienceMatcher("referrer",e(9301))}},9301:function(t,n,e){var i=e(2034);n.fieldsNeeded=["referrer"],n.match=function(t,n){return null!==t.referrer&&i(t.referrer,n)}},4920:function(t,n,e){var i=e(9751),r=e(2060);t.exports={provides:"referrer",shouldTrack:!0,isSticky:!0,getter:[function(){var t=r.getReferrer()||i.getReferrer();return""===t&&(t=null),t}]}},1653:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(4630)),t.registerAudienceMatcher("source_type",e(6755))}},6755:function(t,n,e){var i=e(8681);n.fieldsNeeded=["source_type"],n.match=function(t,n){return i.hasMatch(n.value,n.match,t.source_type)}},4630:function(t,n,e){var i=e(2122),r=e(9751),o=e(2060),a=e(2291),u=["google\\.\\w{2,3}(\\.\\w{2,3})?/(search|url)","bing\\.\\w{2,3}(\\.\\w{2,3})?/(search|url)","yahoo\\.\\w{2,3}(\\.\\w{2,3})?/search","baidu\\.\\w{2,3}(\\.\\w{2,3})?/","https://(www)?\\.google\\..*?/?$","https://search\\.yahoo\\..*?/?$","https://(www)?\\.bing\\..*?/?$"];t.exports={provides:"source_type",shouldTrack:!0,isSticky:!1,getter:[function(){return function(t,n){var e,c=t(),s=function(){if(i.getQueryParamValue("utm_source")||i.getQueryParamValue("utm_campaign")||i.getQueryParamValue("gclid")||i.getQueryParamValue("otm_source"))return"campaign";for(var t=o.getReferrer()||r.getReferrer(),n=0;n<u.length;n++){var e=u[n];if(t.match(e))return"search"}return t&&a.guessDomain(t)!==a.guessDomain(i.getUrl())?"referral":"direct"}();e=s,(!c||"direct"!==e)&&n(s)}}]}},927:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(632)),t.registerVisitorProfileProvider(e(2519)),t.registerAudienceMatcher("time_and_day",e(6177))}},6177:function(t,n,e){var i=e(3845);n.fieldsNeeded=["currentTimestamp"],n.match=function(t,n){return i.test(n.value,
2new Date(t.currentTimestamp))}},632:function(t,n,e){var i=e(6310);t.exports={provides:"currentTimestamp",shouldTrack:!0,isLazy:!0,getter:[function(){return i.now()}]}},2519:function(t){t.exports={provides:"offset",shouldTrack:!0,isLazy:!0,getter:[function(){return(new Date).getTimezoneOffset()}]}},3845:function(t,n){function e(t){var n=t.split(":");if(2!==n.length)throw new Error("optly.timeAndDayInterval.timeStringToMinutes: Invalid time string "+t);return 60*parseInt(n[0],10)+parseInt(n[1],10)}n.test=function(t,n){var i=function(t){var n=t.split("_");if(3!==n.length)throw new Error("Invalid time and day string "+t);var e=n[2].split(",");return{start_time:n[0],end_time:n[1],days:e}}(t),r=e(i.start_time),o=e(i.end_time),a=60*n.getHours()+n.getMinutes(),u=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"][n.getDay()];return a>=r&&a<=o&&i.days.includes(u)}},1059:function(t,n,e){t.exports=function(t){t.registerVisitorProfileProvider(e(9898))}},9898:function(t){t.exports={provides:"visitorId",getter:["stores/visitor_id",function(t){return t.getRandomId()}]}},2700:function(t,n,e){var i,r=e(6388),o=e(3496),a=e(6494),u=e(8805),c=e(3454),s=e(3898),f=e(6210),l=e(3659),d=e(3341),v=e(3941),h=e(3221),p=e(1756),g=h.get("stores/tracker_optimizely"),m=h.get("stores/rum"),b=h.get("stores/integration_settings"),_="google_analytics_4",y="gtag",w="dataLayer",E="optimizely_decision",I="experience_impression",A=[],T=function(){var t=g.canSend();if(o.debug("GA4 Integration: Got canSend:",t),t){for(var n=[];A.length>0;){o.debug("GA4 Integration: decisionEventQueue length:",A.length);var e=A.shift(),r=e.firstPartyData,a=e.customEventData;o.debug("GA4 Integration: calling track with decision data:",{firstPartyData:r,customEventData:a}),i?n.push(O(r,a).catch((function(t){o.warn("Tracker for GTM ",_,"failed:",t)}))):n.push(S(r,a).catch((function(t){o.warn("Tracker for ",_,"failed:",t)})))}return Promise.all(n)}return o.debug("GA4 Integration: Not sending events (holding)"),Promise.resolve()},S=function(t,n){return u.pollFor((function(){return function(t){var n=t.getGlobal(y);return n||null}(s)}),200,50).then((function(e){o.log("GA4 Integration: gtag finally exists, sending now."),m.getSampleRum()&&a.timeEnd("gtagReady"),o.debug("GA4 Integration: calling ga4 with data: "+r.stringify(t)),e("event",I,t),o.debug("GA4 Integration: calling ga4 with custom event data: "+r.stringify(n)),e("event",E,n)}))};var O=function(t,n){var e=s.getGlobal(w);o.debug("GA4 Integration: found dataLayer object "+e),e||(o.debug("GA4 Integration: dataLayer object "+w+" is empty, initializing it"),s.setGlobal(w,[]),e=s.getGlobal(w)),o.log("GA4 Integration: attempting push to "+w);try{var i=Object.assign({event:I},t);o.debug("GA4 Integration: pushing data to GTM: "+r.stringify(i)),e.push(i);var a=Object.assign({event:E},n);o.debug("GA4 Integration: pushing custom data to GTM: "+r.stringify(a)),e.push(a)}catch(t){o.warn("GA4 Integration: Push to "+w+" failed: "+t)}return Promise.resolve()},k={preRedirectPolicy:c.PreRedirectPolicies.PERSIST_BEFORE_REDIRECT,postRedirectPolicy:c.PostRedirectPolicies.TRACK_IMMEDIATELY,nonRedirectPolicy:c.NonRedirectPolicies.TRACK_IMMEDIATELY,trackLayerDecision:function(t){var n=t.integrationSettings;if(!n||!n[_])return o.debug("GA4 Integration: did not find vendor "+_+" in integration settings, exiting"),d.resolve();if(!t.experimentId||!t.variationId)return o.debug("GA4 Integration: empty experiment or variation ID, exiting"),d.resolve();var e=b.get(_)||{};i="on"===e.global_is_use_gtm||"on"===n[_].is_using_gtm,o.debug("GA4 Integration: is using GTM: "+i);var r,a,u,c="equal_priority"===t.layerPolicy;return o.debug("GA4 Integration: is personalization campaign: "+c),c?(u="OPT-"+t.layerId+"("+t.layerName+")-"+t.experimentId+"("+t.experimentName+")-"+t.variationId+"("+t.variationName+")",a={Campaign:t.layerName+" ("+t.layerId+")",Variation:t.variationName+" ("+t.variationId+")",Holdback:t.isLayerHoldback}):(u="OPT-"+t.experimentId+"("+t.experimentName+")-"+t.variationId+"("+t.variationName+")",a={Experiment:t.experimentName+" ("+t.experimentId+")",Variation:t.variationName+" ("+t.variationId+")",Holdback:t.isLayerHoldback}
2),r={exp_variant_string:u,Holdback:t.isLayerHoldback},o.debug("GA4 Integration: pushing decision data to queue:",{firstPartyData:r,customEventData:a}),A.push({firstPartyData:r,customEventData:a}),T()},serializeSettings:r.stringify,deserializeSettings:r.parse};t.exports=function(t){t.registerAnalyticsTracker("google_analytics_4",k),f.on({filter:{type:l.TYPES.ANALYTICS,name:"sendEvents"},handler:function(){v.dispatch(p.SET_TRACKER_SEND_EVENTS,!0),T()}}),f.on({filter:{type:l.TYPES.ANALYTICS,name:"maybeSendEvents"},handler:function(){T()}})}},3707:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.omit,a=i.pick,u=e(525),c=e(167),s=e(1756),f=e(9726).v,l=e(6388),d=e(3496),v=e(3454),h=e(7649),p=e(3898),g=e(4464),m=e(3221),b=(e(9751),e(6210)),_=e(3659),y=e(3941),w=m.get("stores/global"),E=m.get("stores/tracker_optimizely"),I=e(9819),A=n.Error=f("OptimizelyTrackerError"),T="client_activation",S="campaign_activated",O="view_activated",k={revenue:{validate:L,sanitize:Math.floor,excludeFeature:!0},quantity:{validate:L,sanitize:Math.floor,excludeFeature:!0},value:{validate:L,sanitize:function(t){return t}}},R="AUTO",N=[function(){return function(t){V(function(t){var n=Object.assign({entity_id:t.pageId,key:t.pageApiName,timestamp:t.timestamp,uuid:t.eventId,type:O},j(t.eventTags));return n}(t),t.userFeatures,Q(t.layerStates))}}],C=[function(){return function(t){!function(t){var n=null!==w.getAnonymizeIP()?w.getAnonymizeIP():void 0,e={account_id:t.accountId,anonymize_ip:n,client_name:t.clientName,client_version:t.clientVersion,project_id:t.projectId,visitors:[]};e.revision=t.revision,e.enrich_decisions=!0;var i={session_id:z(t.sessionId),visitor_id:t.visitorId,attributes:[],snapshots:[]},r=Q(t.layerStates);y.dispatch(s.REGISTER_TRACKER_VISITOR,{data:e,visitor:i,decisions:r}),J()}(t),V(function(t){return{entity_id:null,type:T,uuid:t.eventId,timestamp:t.timestamp}}(t),t.userFeatures,Q(t.layerStates))}}],D=[function(){return function(t){var n;V((n=t,Object.assign({entity_id:n.eventEntityId,key:n.eventApiName,timestamp:n.timestamp,uuid:n.eventId,type:n.eventCategory,properties:M(n.eventProperties)},j(n.eventTags))),t.userFeatures,Q(t.layerStates))}}],x=[function(){return function(t){var n;V((n=t,Object.assign({entity_id:n.eventEntityId,key:n.eventApiName,timestamp:n.timestamp,uuid:n.eventId,type:n.eventCategory},j(n.eventTags))),t.userFeatures,Q(t.layerStates))}}];function j(t){var n=function(t,n,e){try{P(e),t[n]=e}catch(t){u.emitError(new A("Bad value for eventTags["+n+"]: "+t.message))}return t},e=Object.keys(k),i=o(t,e),r=a(t,e),c=Object.keys(i).reduce((function(t,e){return n(t,e,i[e])}),{}),s=Object.keys(r).reduce((function(t,e){var i=r[e],o=k[e];o.excludeFeature||n(c,e,i);try{o.validate(i),t[e]=o.sanitize(i),c[e]=t[e]}catch(t){u.emitError(new A("Bad value for eventMetrics["+e+"]: "+t.message))}return t}),{});return s.tags=c,s}function M(t){var n={},e={},i=0;for(var r in t){var o=t[r];"object"==typeof o&&null!==o?e[r]=o:i<15?(n[r]=o,i++):e[r]=o}return Object.keys(e).length>0&&d.log("Custom event properties dropped (complex values, or over the 15-property limit). The following properties were not pushed",e),n}function P(t){if(null==t)throw new Error("Feature value is null");if("object"==typeof t){var n;try{n=l.stringify(t)}catch(t){}throw new Error('Feature value is complex: "'+n)}}function L(t){if(null==t)throw new Error("Metric value is null");if("number"!=typeof t)throw new Error("Metric value is not numeric")}function U(t){return(t||[]).reduce((function(t,n){try{P(n.value),t.push({entity_id:n.id||null,key:n.name,type:n.type,value:n.value})}catch(t){d.warn("Error evaluating user feature",n,t)}return t}),[])}function V(t,n,e){y.dispatch(s.REGISTER_TRACKER_EVENT,{event:t,decisions:e}),B(n),J()}function B(t){var n=U(t);y.dispatch(s.UPDATE_TRACKER_VISITOR_ATTRIBUTES,{attributes:n})}function z(t){return R}function F(){if(E.canSend()){var t=E.hasEventsToSend(),n=E.hasPreviousBatchesToSend();t||n?(n&&(E.getPreviousBatches().forEach(G),y.dispatch(s.RESET_TRACKER_PREVIOUS_BATCHES)),t&&(y.dispatch(s.FINALIZE_BATCH_SNAPSHOT),G(E.getEventBatch()),y.dispatch(s.RESET_TRACKER_EVENTS))):d.debug("Not sending events because there are no events to send")}else d.debug("Not sending events (holding)")}function G(t){d.debug("Sending ticket:",t);var n=c.generate(),e={url:"https://logx.optimizely.com/v1/events",method:"POST",data:q(t)};E.shouldUseBeacon()?g.sendBeacon(e,n):g.retryableRequest(e,n)}function q(t){return Object.assign({},a(t,["account_id","anonymize_ip","client_name","client_version","enrich_decisions","project_id","revision"]),{visitors:t.visitors.map(H)})}function H(t){return{visitor_id:t.visitor_id,session_id:R,attributes:t.attributes.map(Y),snapshots:t.snapshots.map(K)}}function Y(t){return X(t,{entity_id:"e",key:"k",type:"t",value:"v"})}function K(t){var n=t.events;return n=function(t){var n=t.reduce((function(t,n){var e;if(t[e=n.type===O&&r(n.tags)&&r(a(n,Object.keys(k)))?n.type:n.uuid]){var i=t[e].timestamp;n.timestamp>i&&(i=n.timestamp),t[e]=Object.assign({},t[e],{key:t[e].key+"-"+(n.key||""),entity_id:t[e].entity_id+"-"+n.entity_id,timestamp:i})}else t[e]=n;return t}),{});return Object.values(n)}(n),{activationTimestamp:w.getActivationTimestamp(),decisions:t.decisions.map($),events:n.map(W)}}function $(t){var n=X(t,{campaign_id:"c",experiment_id:"x",is_campaign_holdback:"h",variation_id:"v"});return n.m=t.metadata?X(t.metadata,{cmab_uuid:"cmab_uuid"}):{},n}function W(t){return t.key===S&&(t.type=S,delete t.key),X(t,{entity_id:"e",key:"k",quantity:"q",revenue:"$",tags:"a",properties:"p",timestamp:"t",uuid:"u",value:"v",type:"y"})}function X(t,n){return Object.keys(t).reduce((function(e,i){var r=t[i];return i in n&&(e[n[i]||i]=r),e}),{})}function J(){if(E.shouldBatch()){if(!E.isPolling()){p.setTimeout((function t(){F(),E.isPolling()&&p.setTimeout(t,1e3)}),1e3),y.dispatch(s.SET_TRACKER_POLLING,!0),p.setTimeout((function(){y.dispatch(s.SET_TRACKER_BATCHING,!1),y.dispatch(s.SET_TRACKER_POLLING,!1)}),1e4)}}else F()}function Q(t){return t.map((function(t){var n=I.getCmabUUIDAndUpdateSessionTimeout(t.layerId,t.decision.experimentId),e=n?{cmab_uuid:n}:{};return{campaign_id:t.layerId,experiment_id:t.decision.experimentId,variation_id:t.decision.variationId,is_campaign_holdback:t.decision.isLayerHoldback,metadata:e}}))}function Z(){var t=E.getPersistableState();if(t)try{d.debug("Persisting pending batch:",t),h.persistTrackerOptimizelyData(t),y.dispatch(s.SET_TRACKER_DIRTY,!1)}catch(t){d.debug("Failed to persist pending batch:",t)}}var tt={trackLayerDecision:function(t){t.isLayerConcluded?d.debug("Layer is already concluded, skipping decision tracking"):t.timing===v.TrackLayerDecisionTimingFlags.postRedirectPolicy?function(t){var n=U(t.userFeatures),e={account_id:t.accountId,anonymize_ip:t.anonymizeIP,client_name:t.clientName,client_version:t.clientVersion,project_id:t.projectId,visitors:[{session_id:z(t.sessionId),visitor_id:t.visitorId,attributes:n,snapshots:[{decisions:[{campaign_id:t.layerId,experiment_id:t.experimentId,variation_id:t.variationId,is_campaign_holdback:t.isLayerHoldback}],events:[{uuid:t.decisionId,entity_id:t.layerId,timestamp:t.timestamp,type:S}]}]}]};y.dispatch(s.REGISTER_PREVIOUS_BATCH,e),J()}(t):function(t){var n={entity_id:t.layerId,type:S,uuid:t.decisionId,timestamp:t.timestamp};y.dispatch(s.REGISTER_TRACKER_DECISION,{decisionEvent:n,decisions:Q(t.layerStates)}),B(t.userFeatures),J()}(t)},preRedirectPolicy:v.PreRedirectPolicies.PERSIST_BEFORE_AND_TRACK_DURING_REDIRECT,postRedirectPolicy:v.PostRedirectPolicies.TRACK_AFT
2ER_SYNC,nonRedirectPolicy:v.NonRedirectPolicies.TRACK_IMMEDIATELY,onPageActivated:N,onClientActivation:C,onClickEvent:x,onCustomEvent:D};t.exports=function(t){t.registerAnalyticsTracker("optimizely",tt),b.on({filter:{type:_.TYPES.ANALYTICS,name:"sendEvents"},handler:function(){y.dispatch(s.SET_TRACKER_SEND_EVENTS,!0),F()}}),b.on({filter:{type:_.TYPES.ANALYTICS,name:"maybeSendEvents"},handler:function(){F()}}),b.on({filter:{type:_.TYPES.ANALYTICS,name:"holdEvents"},handler:function(){y.dispatch(s.SET_TRACKER_SEND_EVENTS,!1)}}),y.dispatch(s.SET_TRACKER_SEND_EVENTS,!0);var n=b.on({filter:{type:"lifecycle",name:"activated"},handler:function(){E.observe(Z),b.off(n)}})}},5215:function(t,n,e){var i=e(2306),r=e(8229);function o(t){if(!t||"string"!=typeof t.value)return{configured:!1,valid:!1,leg:null};var n=t.value.replace(/^\s+|\s+$/g,"");if(""===n||n.length<3)return{configured:!0,valid:!1,leg:null};var e=i.makeUaTest(n);return e?{configured:!0,valid:!0,leg:{value:n,test:e}}:{configured:!0,valid:!1,leg:null}}function a(t){if(!t)return{configured:!1,legs:[]};if("string"!=typeof t.value||""===t.value.replace(/^\s+|\s+$/g,""))return{configured:!0,legs:[]};for(var n=t.value.split(","),e=[],i=0;i<n.length;i++){var o=n[i].replace(/^\s+|\s+$/g,"");if(""!==o){var a=r.makeIpTest(o);a&&e.push({value:o,test:a})}}return{configured:!0,legs:e}}n.compile=function(t){var n=[];if(!t||!t.rules||!Array.isArray(t.rules))return n;for(var e=0;e<t.rules.length;e++){var i=t.rules[e];if(i){var r=String(e),u=o(i.user_agent),c=a(i.ip);if((u.configured||c.configured)&&(!u.configured||u.valid)){var s=u.configured?u.leg:null;if(c.configured){if(0===c.legs.length)continue;for(var f=0;f<c.legs.length;f++)n.push({id:r,ua:s,ip:c.legs[f]})}else n.push({id:r,ua:s,ip:null})}}}return n}},5296:function(t,n,e){var i=e(5215),r=e(6519),o=e(3898),a=e(3221),u=e(6210),c=e(3659),s=a.get("stores/directive"),f=a.get("stores/global"),l=null,d=!1,v=void 0,h=!1,p=!1;function g(){p&&(p=!1,u.emit({type:c.TYPES.ANALYTICS,name:"sendEvents"}))}function m(){return{enabled:!1,mode:"monitor",compiledRules:[],hasIpRules:!1,hasUaRules:!1,stats:r.createStats()}}function b(){return!!(s&&s.shouldBootstrapDataForPreview&&s.shouldBootstrapDataForPreview())}function _(){if(!d){try{var t=function(){try{return f&&f.getTrafficExclusion?f.getTrafficExclusion():void 0}catch(t){return}}();if(!t)return;d=!0,l=function(t){if(!t||"object"!=typeof t||!t.enabled)return m();for(var n="enforce"===t.mode?"enforce":"monitor",e=i.compile(t),o=!1,a=!1,u=0;u<e.length;u++)e[u].ip&&(o=!0),e[u].ua&&(a=!0);return{enabled:!0,mode:n,compiledRules:e,hasIpRules:o,hasUaRules:a,stats:r.createStats()}}(t)}catch(t){return d=!0,void(l=m())}try{l.enabled&&l.hasIpRules&&!b()&&function(){if(!p){p=!0,u.emit({type:c.TYPES.ANALYTICS,name:"holdEvents"});var t=y;o.setTimeout((function(){y===t&&g()}),2e3)}}()}catch(t){}}}n.evaluate=function(t,n){if(!l||!l.compiledRules)return{matched:!1,ruleId:void 0};for(var e=l.compiledRules,i=null!=n,r=0;r<e.length;r++){var o=e[r];if(o.ua||o.ip){var a=!o.ua||!!o.ua.test(t),u=!o.ip||i&&!!o.ip.test(n);if(a&&u)return{matched:!0,ruleId:o.id}}}return{matched:!1,ruleId:void 0}},n.shouldDrop=function(){try{if(_(),!l||!l.enabled||b()||!l.compiledRules.length)return!1;var t=o.getUserAgent();l.hasIpRules&&function(){if(h)return;h=!0;var t=y;try{var i=e(815).getIP();i&&"function"==typeof i.then&&i.then((function(i){if(y===t&&"string"==typeof i&&i&&(v=i,l&&l.enabled&&"enforce"===l.mode)){var a=o.getUserAgent(),u=n.evaluate(a,i);if(u.matched){r.recordMatch(l.stats,u.ruleId);try{var c=e(3941),s=e(1756);c.dispatch(s.RESET_TRACKER_EVENTS),c.dispatch(s.RESET_TRACKER_PREVIOUS_BATCHES)}catch(t){}}}g()}),(function(){g()}))}catch(t){}}();var i=l.hasIpRules?v:void 0;r.recordEvaluation(l.stats),l.hasUaRules&&("string"!=typeof t||!t)&&r.recordUnusableUa(l.stats),l.hasIpRules&&("string"!=typeof i||!i)&&r.recordUnresolvedIp(l.stats);var a=n.evaluate(t,i);return!!a.matched&&(r.recordMatch(l.stats,a.ruleId),"enforce"===l.mode)}catch(t){try{l&&r.recordThrew(l.stats)}catch(t){}return!1}};var y=0;n.config=function(){return _(),l},n.getStats=function(){if(_(),!l||!l.enabled)return null;var t=l.stats,n={};for(var e in t.perRuleHits)Object.prototype.hasOwnProperty.call(t.perRuleHits,e)&&(n[e]=t.perRuleHits[e]);for(var i=[],r=l.compiledRules,o=0;o<r.length;o++){var a=r[o];n[a.id]&&i.push({id:a.id,type:a.ua&&a.ip?"ua+ip":a.ua?"ua":"ip",ua:a.ua?a.ua.value:null,ip:a.ip?a.ip.value:null,drops:n[a.id]})}return{enabled:!0,mode:l.mode,evaluated:t.evaluated,matched:t.matched,unusableUa:t.unus
2ableUa,unresolvedIp:t.unresolvedIp,threw:t.threw,perRuleHits:n,matchedRules:i}}},8229:function(t,n){function e(t){if(!/^\d{1,3}$/.test(t))return!1;var n=Number(t);return!(n>255||String(n)!==t)}n.anonymizeIp=function(t){if("string"==typeof t&&""!==t){var n=t.split(".");if(4===n.length){for(var i=0;i<4;i++)if(!e(n[i]))return;return n[0]+"."+n[1]+"."+n[2]+".0"}}},n.makeIpTest=function(t){if(!t||"string"!=typeof t)return null;var e=n.anonymizeIp(t);return void 0===e||e!==t?null:function(e){var i=n.anonymizeIp(e);return void 0!==i&&i===t}}},2306:function(t,n){n.makeUaTest=function(t){if(!t||"string"!=typeof t)return null;var n=t.toLowerCase();return function(t){return"string"==typeof t&&-1!==t.toLowerCase().indexOf(n)}}},6519:function(t,n){n.createStats=function(){return{evaluated:0,matched:0,unusableUa:0,unresolvedIp:0,threw:0,perRuleHits:{}}},n.recordEvaluation=function(t){t&&t.evaluated++},n.recordUnusableUa=function(t){t&&t.unusableUa++},n.recordUnresolvedIp=function(t){t&&t.unresolvedIp++},n.recordThrew=function(t){t&&t.threw++},n.recordMatch=function(t,n){t&&(t.matched++,t.perRuleHits[n]=(t.perRuleHits[n]||0)+1)}},4328:function(t,n,e){t.exports=function(t){t.registerViewProvider(e(5164)),t.registerViewMatcher("url",e(9015))}},9015:function(t,n,e){var i=e(2034);t.exports={fieldsNeeded:["url"],match:function(t,n){return i(t.url,n)}}},5164:function(t,n,e){var i=e(2122);t.exports={provides:"url",getter:[function(){return i.getUrl()}]}},843:function(t,n,e){var i=e(3221),r=e(6210),o=e(3659),a=e(3898),u=i.get("stores/directive"),c="optimizelyPreview",s=function(t){a.getGlobal(c).push(t)};n.initialize=function(t){u.isSlave()&&function(t){var n=!1;if(Array.isArray(window.optimizely)&&window.optimizely.forEach((function(e){Array.isArray(e)&&"verifyPreviewProject"===e[0]&&String(e[1])===t&&(n=!0)})),!n)throw new Error("Preview projectId: "+t+" does not match expected")}(t),r.on({filter:{type:o.TYPES.ANALYTICS,name:"trackEvent"},handler:s}),r.on({filter:{type:o.TYPES.LIFECYCLE,name:"viewActivated"},handler:s}),r.on({filter:{type:o.TYPES.LIFECYCLE,name:"layerDecided"},handler:s}),r.on({filter:{type:"error"},publicOnly:!0,handler:s})},n.setupPreviewGlobal=function(){a.getGlobal(c)||a.setGlobal(c,[])},n.pushToPreviewGlobal=function(t){s(t)}},8942:function(t,n,e){var i=e(279),r=i.isEmpty,o=i.mapValues,a=i.pick,u=i.pickBy,c=e(167),s=e(8548),f=e(6027),l=e(6310),d=e(9751),v=e(3941),h=e(7429).DT,p=e(3496),g=e(4645),m=e(3341).Promise,b=e(7649),_=e(3898),y=e(4464),w=e(1756),E=e(2044),I=e(3221),A=I.get("stores/async_request"),T=I.get("stores/client_metadata"),S=I.get("stores/global"),O=I.get("stores/rum"),k=I.get("stores/performance"),R=I.get("stores/xdomain"),N=I.get("stores/view_data"),C=e(5205),D="https://rum.optimizely.com/rum",x="1.0";function j(t){return r(t)?m.resolve():(n=function(){return y.request({url:D,method:"POST",data:t,withCredentials:!0}).then((function(t){return s.resolveRequest("RUM_FIRST_BEACON",t),t})).catch((function(t){throw p.error("POST to client-rum failed:",t),s.rejectRequest("RUM_FIRST_BEACON",t),t}))},(e=A.getPromise("RUM_FIRST_BEACON"))?e.then(n):s.makeAsyncRequest("RUM_FIRST_BEACON",n));var n,e}function M(){try{return!d.querySelector("body")}catch(t){return null}}function P(){var t=_.getGlobal("performance"),n=t?t.timing:{},e=k.getMarks()||{},i=O.getApiData(),r=O.getDOMObservationData(),o=C.get("state").getActiveExperimentIds(),a=O.getFeaturesNeededData(),u=d.parseUri(O.getScriptSrc()),c=O.getRumData()||{},s=c.extras||{};Object.assign(s,{apiCalls:i,DOMObservationData:r,paintTimings:U(),activeExperimentIds:o,numPages:N.getNumberOfPages(),snippet:{scheme:u.protocol.slice(0,-1),host:u.host,path:u.pathname},networkInfo:L(),experimental:S.getExperimental(),featuresNeeded:a,beacon:{cjsOnload:!0}});var f=_.getGlobal("Prototype");f&&void 0!==f.Version&&(s.prototypeJS=f.Version);var l=!1;l=!0;var v=R.getFrames();v.length&&(s.xdFramesLoaded=v.length);var m={id:O.getRumId(),v:x,project:S.getSnippetId()||S.getProjectId(),navigationTimings:n,userTimings:e,xd:l,apis:Object.keys(i),extras:s,sampleRate:c.sampleRate};(function(){var t=h.keys().map((function(t){var n=b.getStorageKeyFromKey(t);return n?{key:t,isForeign:b.isForeignKey(t),category:n,size:t.length+h.getItem(t).length}:null}
2)).filter(Boolean),n=t.reduce((function(t,n){var e=n.key,i=b.getIdFromKey(e);return i?((n.isForeign?t.foreign:t.local)[i]=!0,t):t}),{local:{},foreign:{}}),e=t.filter((function(t){return!0===t.isForeign})).reduce((function(t,n){return t[n.key.split("_")[0]]=!0,t}),{}),i={local:0,foreign:0},r={local:{},foreign:{}};t.forEach((function(t){var n=t.isForeign?"foreign":"local";i[n]+=t.size,r[n][t.category]||(r[n][t.category]=0),r[n][t.category]+=t.size}));var o={numKeys:h.allKeys().length,sizeKeys:h.allKeys().toString().length,sizeValues:h.allValues().toString().length,idCounts:{local:Object.keys(n.local).length,foreign:Object.keys(n.foreign).length},foreignOriginCount:Object.keys(e).length,byteTotals:i,byteTotalsByCategory:r};return g.estimateStorage().then((function(t){return Object.assign(o,{storageEstimate:t})}))})().then((function(t){return j(Object.assign(m,{lsMetrics:t}))})).catch((function(t){p.warn("RUM / Error sending onload beacon:",t)}))}function L(){var t=_.getGlobal("navigator");if(t&&t.connection)return a(t.connection,["downlink","rtt","effectiveType"])}function U(){var t=_.getGlobal("performance");if(t)try{var n=t.getEntriesByType("paint");if(r(n))return;return n.reduce((function(t,n){return t[n.name]=Math.round(n.startTime),t}),{})}catch(t){return}}n.initialize=function(){var t,n=c.generate().replace(/-/g,"");t=Math.random()<.01;var e=function(){var t=d.getCurrentScript();if(t)return t.src}();v.dispatch(w.SET_RUM_DATA,{id:n,RumHost:D,inRumSample:t,src:e,data:{id:n,sync:M(),timebase:l.now(),sampleRate:.01,url:e,extras:{initialDOMState:d.getReadyState()}}})},n.queueBeacons=function(){return O.getSampleRum()?(function(){try{_.getGlobal("requestAnimationFrame")((function(){var t=O.getRumData().timebase;v.dispatch(w.SET_RUM_DATA,{data:{render:l.now()-(t||0)}})}))}catch(t){return}}(),d.isLoaded()?_.setTimeout(P,3e3):_.addEventListener("load",P),new m((function(t,n){_.setTimeout((function(){(function(){!function(){var t={id:O.getRumId(),v:x,account:S.getAccountId(),project:S.getSnippetId()||S.getProjectId(),snippet:S.getSnippetId(),revision:S.getRevision(),clientVersion:T.getClientVersion(),hasSlave:!1,wxhr:!0,extras:{}},n=b.getPersistedBehaviorEventCount(),e=f.getEventCount();t.numBehaviorEvents=e;var i=e-n;Object.assign(t.extras,{behaviorEventCountDiff:i,behaviorEventCountDecreased:i<0}),Object.assign(t,function(){var t=_.getGlobal("performance");if(!t)return;var n,e=O.getScriptSrc();try{if(e){p.debug("Using derived script src: ",e);var i=t.getEntriesByName(e);i.length>0&&(n=i[0])}if(!n){var r=/\/\/[^.]+\.optimizely\.(com|test)\/(js|api\/client)\/[\d]+\.js/gi;p.debug("Scanning resource timing entries with regex");var a=t.getEntriesByType("resource");n=a.find((function(t){return r.test(t.name)}))}if(n)return o(E.ResourceTimingAttributes,(function(t,e){var i=n[e];return"number"==typeof i?Math.round(1e3*(i||0))/1e3:"serverTiming"===e?function(t){if(!t||!t.length)return[];for(var n=[],e=0;e<t.length;e++)try{var i=t[e];n.push({name:i.name,duration:i.duration,description:i.description})}catch(t){}return n}(i):void 0}))}catch(t){return}}(),k.getDurationsFor(Object.values(E.RUMPerformanceTimingAttributes))),v.dispatch(w.SET_RUM_DATA,{data:t})}();var t=O.getRumData(),n=k.getMarks()||{};return t.extras=t.extras||{},t.extras.beacon={cjsTimeout:!0},t.userTimings=n,j(t=u(t,(function(t){return void 0!==t})))})().then(t,n)}),3e3)})).catch((function(t){p.warn("RUM / Error sending data:",t)}))):m.resolve()}},4779:function(t,n,e){var i;!function(r,o){"use strict";var a="function",u="undefined",c="object",s="string",f="major",l="model",d="name",v="type",h="vendor",p="version",g="architecture",m="console",b="mobile",_="tablet",y="smarttv",w="wearable",E="embedded",I="Amazon",A="Apple",T="ASUS",S="BlackBerry",O="Browser",k="Chrome",R="Firefox",N="Google",C="Honor",D="Huawei",x="LG",j="Microsoft",M="Motorola",P="Nvidia",L="OnePlus",U="Opera",V="OPPO",B="Samsung",z="Sharp",F="Sony",G="Xiaomi",q="Zebra",H="Facebook",Y="Chromium OS",K="Mac OS",$=" Browser",W=function(t){for(var n={},e=0;e<t.length;e++)n[t[e].toUpperCase()]=t[e];return n},X=function(t,n){return typeof t===s&&-1!==J(n).indexOf(J(t))},J=function(t){return t.toLowerCase()},Q=function(t,n){if(typeof t===s)return t=t.replace(/^\s\s*/,""),typeof n===u?t:t.substring(0,500)},Z=function(t,n){for(var e,i,r,u,s,f,l=0;l<n.length&&!s;){var d=n[l],v=n[l+1];for(e=i=0;e<d.length&&!s&&d[e];)if(s=d[e++].exec(t))for(r=0;r<v.length;r++)f=s[++i],typeof(u=v[r])===c&&u.length>0?2===u.length?typeof u[1]==a?this[u[0]]=u[1].call(this,f):this[u[0]]=u[1]:3===u.length?typeof u[1]!==a||u[1].exec&&u[1].test?this[u[0]]=f?f.replace(u[1],u[2]):o:this[u[0]]=f?u[1].call(this,f,u[2]):o:4===u.length&&(this[u[0]]=f?u[3].call(this,f.replace(u[1],u[2])):o):this[u]=f||o;l+=2}},tt=function(t,n){for(var e in n)if(typeof n[e]===c&&n[e].length>0){for(var i=0;i<n[e].length;i++)if(X(n[e][i],t))return"?"===e?o:e}else if(X(n[e],t))return"?"===e?o:e;return n.hasOwnProperty("*")?n["*"]:t},nt={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},et={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[d,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[d,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[d,p],[/opios[\/ ]+([\w\.]+)/i],[p,[d,U+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[d,U+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[d,U]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[d,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[d,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[d,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[d,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[d,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[d,"UC"+O]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[d,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[d,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[d,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[d,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[d,"Smart Lenovo "+O]],[/(avast|avg)\/([\w\.]+)/i],[[d,/(.+)/,"$1 Secure "+O],p],[/\bfocus\/([\w\.]+)/i],[p,[d,R+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[d,U+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[d,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[d,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[d,U+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[d,"MIUI"+$]],[/fxios\/([\w\.-]+)/i],[p,[d,R]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[d,"360"]],[/\b(qq)\/([\w\.]+)/i],[[d,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[d,/(.+)/,"$1"+$],p],[/samsungbrowser\/([\w\.]+)/i],[p,[d,B+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[d,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[d,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[d,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[d],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,d],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[d,H],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[d,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[d,"GSA"]],[/musical_ly(?:.
vendor: 4,233 bytes, line 2
2+app_?version\/|_)([\w\.]+)/i],[p,[d,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[d,k+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[d,k+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[d,"Android "+O]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[d,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[d,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,d],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[d,[p,tt,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[d,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[d,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[d,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[d,R+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[d,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[d,[p,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[g,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[g,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[g,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[g,/ower/,"",J]],[/ sun4\w[;\)]/i],[[g,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[g,J]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[h,B],[v,_]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,B],[v,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[l,[h,A],[v,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,A],[v,_]],[/(macintosh);/i],[l,[h,A]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,z],[v,b]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[l,[h,C],[v,_]],[/honor([-\w ]+)[;\)]/i],[l,[h,C],[v,b]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[l,[h,D],[v,_]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,D],[v,b]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[l,/_/g," "],[h,G],[v,_]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[l,/_/g," "],[h,G],[v,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[l,[h,V],[v,b]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[l,[h,tt,{OnePlus:["304","403","203"],"*":V}],[v,_]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[v,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[l,[h,"Realme"],[v,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[l,[h,M],[v,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,M],[v,_]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,x],[v,_]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,x],[v,b]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}
vendor: 4,171 bytes, line 2
2(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[l,[h,"Lenovo"],[v,_]],[/(nokia) (t[12][01])/i],[h,l,[v,_]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[l,/_/g," "],[v,b],[h,"Nokia"]],[/(pixel (c|tablet))\b/i],[l,[h,N],[v,_]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,N],[v,b]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[l,[h,F],[v,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,F],[v,_]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,L],[v,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,I],[v,_]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,I],[v,b]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[v,_]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,S],[v,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,T],[v,_]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,T],[v,b]],[/(nexus 9)/i],[l,[h,"HTC"],[v,_]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[v,b]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[l,[h,"TCL"],[v,_]],[/(itel) ((\w+))/i],[[h,J],l,[v,tt,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[v,_]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[v,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[l,[h,"Ulefone"],[v,b]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[l,[h,"Energizer"],[v,b]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[l,[h,"Cat"],[v,b]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[l,[h,"Smartfren"],[v,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[l,[h,"Nothing"],[v,b]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[l,[h,"Archos"],[v,_]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[l,[h,"Archos"],[v,b]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[h,l,[v,_]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[h,l,[v,b]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[h,l,[v,_]],[/(surface duo)/i],[l,[h,j],[v,_]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[v,b]],[/(u304aa)/i],[l,[h,"AT&T"],[v,b]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[v,b]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[v,_]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[v,_]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[v,_]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[v,_]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[v,_]],[/\b(k88) b/i],[l,[h,"ZTE"],[v,_]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[v,b]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[v,b]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[v,_]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[v,_]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[v,_]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[v,_]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[v,_]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[v,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[v,b]],[/\b(ph-1) /i],[l,[h,"Essential"],[v,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[v,_]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[v,_]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[v,_]
vendor: 5,528 bytes, line 2
2],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[l,[h,P],[v,_]],[/(sprint) (\w+)/i],[h,l,[v,b]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,j],[v,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,q],[v,_]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,q],[v,b]],[/smart-tv.+(samsung)/i],[h,[v,y]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,B],[v,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,x],[v,y]],[/(apple) ?tv/i],[h,[l,A+" TV"],[v,y]],[/crkey/i],[[l,k+"cast"],[h,N],[v,y]],[/droid.+aft(\w+)( bui|\))/i],[l,[h,I],[v,y]],[/(shield \w+ tv)/i],[l,[h,P],[v,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,z],[v,y]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,F],[v,y]],[/(mi(tv|box)-?\w+) bui/i],[l,[h,G],[v,y]],[/Hbbtv.*(technisat) (.*);/i],[h,l,[v,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[h,Q],[l,Q],[v,y]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[l,[v,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[v,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[v,m]],[/droid.+; (shield)( bui|\))/i],[l,[h,P],[v,m]],[/(playstation \w+)/i],[l,[h,F],[v,m]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,j],[v,m]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[l,[h,B],[v,w]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[h,l,[v,w]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[l,[h,V],[v,w]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[l,[h,A],[v,w]],[/(opwwe\d{3})/i],[l,[h,L],[v,w]],[/(moto 360)/i],[l,[h,M],[v,w]],[/(smartwatch 3)/i],[l,[h,F],[v,w]],[/(g watch r)/i],[l,[h,x],[v,w]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,q],[v,w]],[/droid.+; (glass) \d/i],[l,[h,N],[v,w]],[/(pico) (4|neo3(?: link|pro)?)/i],[h,l,[v,w]],[/; (quest( \d| pro)?)/i],[l,[h,H],[v,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[v,E]],[/(aeobc)\b/i],[l,[h,I],[v,E]],[/(homepod).+mac os/i],[l,[h,A],[v,E]],[/windows iot/i],[[v,E]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[l,[v,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[v,_]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[v,_]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[v,b]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[l,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[d,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[d,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[d,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[d,p],[/ladybird\//i],[[d,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,d]],os:[[/microsoft (windows) (vista|xp)/i],[d,p],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[d,[p,tt,nt]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,tt,nt],[d,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[d,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[d,K],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,d],[/(ubuntu) ([\w\.]+) like android/i],[[d,/(.+)/,"$1 Touch"],p],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[d,p],[/\(bb(10);/i],[p,[d,S]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[p,[d,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[d,R+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[d,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[d,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[d,k+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[d,Y],p],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[d,p],[/(sunos) ?([\w\.\d]*)/i],[[d,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[d,p]]},it=function(t,n){if(typeof t===c&&(n=t,t=o),!(this instanceof it))return new it(t,n).getResult();var e=typeof r!==u&&r.navigator?r.navigator:o,i=t||(e&&e.userAgent?e.userAgent:""),m=e&&e.userAgentData?e.userAgentData:o,y=n?function(t,n){var e={};for(var i in t)n[i]&&n[i].length%2==0?e[i]=n[i].concat(t[i]):e[i]=t[i];return e}(et,n):et,w=e&&e.userAgent==i;return this.getBrowser=function(){var t,n={};return n[d]=o,n[p]=o,Z.call(n,i,y.browser),n[f]=typeof(t=n[p])===s?t.replace(/[^\d\.]/g,"").split(".")[0]:o,w&&e&&e.brave&&typeof e.brave.isBrave==a&&(n[d]="Brave"),n},this.getCPU=function(){var t={};return t[g]=o,Z.call(t,i,y.cpu),t},this.getDevice=function(){var t={};
2return t[h]=o,t[l]=o,t[v]=o,Z.call(t,i,y.device),w&&!t[v]&&m&&m.mobile&&(t[v]=b),w&&"Macintosh"==t[l]&&e&&typeof e.standalone!==u&&e.maxTouchPoints&&e.maxTouchPoints>2&&(t[l]="iPad",t[v]=_),t},this.getEngine=function(){var t={};return t[d]=o,t[p]=o,Z.call(t,i,y.engine),t},this.getOS=function(){var t={};return t[d]=o,t[p]=o,Z.call(t,i,y.os),w&&!t[d]&&m&&m.platform&&"Unknown"!=m.platform&&(t[d]=m.platform.replace(/chrome os/i,Y).replace(/macos/i,K)),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return i},this.setUA=function(t){return i=typeof t===s&&t.length>500?Q(t,500):t,this},this.setUA(i),this};it.VERSION="1.0.41",it.BROWSER=W([d,p,f]),it.CPU=W([g]),it.DEVICE=W([l,h,v,m,b,y,_,w,E]),it.ENGINE=it.OS=W([d,p]),typeof n!==u?(t.exports&&(n=t.exports=it),n.UAParser=it):e.amdO?(i=function(){return it}.call(n,e,n,t))===o||(t.exports=i):typeof r!==u&&(r.UAParser=it);var rt=typeof r!==u&&(r.jQuery||r.Zepto);if(rt&&!rt.ua){var ot=new it;rt.ua=ot.getResult(),rt.ua.get=function(){return ot.getUA()},rt.ua.set=function(t){ot.setUA(t);var n=ot.getResult();for(var e in n)rt.ua[e]=n[e]}}}("object"==typeof window?window:this)},6694:function(){}},__webpack_module_cache__={};function __webpack_require__(t){var n=__webpack_module_cache__[t];if(void 0!==n)return n.exports;var e=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t].call(e.exports,e,e.exports,__webpack_require__),e.exports}__webpack_require__.amdO={},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var __webpack_exports__={};function main(){var t=function(t){var n=[__webpack_require__(1059)];n.push(__webpack_require__(5506)),n.push(__webpack_require__(2062)),n.push(__webpack_require__(8453)),n.push(__webpack_require__(9176)),n.push(__webpack_require__(3268)),n.push(__webpack_require__(679)),n.push(__webpack_require__(168)),n.push(__webpack_require__(3585)),n.push(__webpack_require__(219)),n.push(__webpack_require__(6384)),n.push(__webpack_require__(6507)),n.push(__webpack_require__(5038)),n.push(__webpack_require__(1653)),n.push(__webpack_require__(927)),n.push(__webpack_require__(2700)),n.push(__webpack_require__(3707)),n.push(__webpack_require__(4328)),n.push(__webpack_require__(1139)),n.push(__webpack_require__(7601)),n.push(__webpack_require__(936)),n.push(__webpack_require__(2571)),n.push(__webpack_require__(3252)),n.push(__webpack_require__(481)),l.initializePlugins(n)};window.performance&&window.performance.mark&&window.performance.mark("optimizely:blockBegin"),__webpack_require__(8942).initialize();var n=__webpack_require__(6494);n.time("gtagReady");var e=__webpack_require__(3496),i=__webpack_require__(3221);__webpack_require__(8558);var r=i.get("stores/directive");if(!__webpack_require__(4464).isCORSSupported())throw new Error("CORS is not supported on this browser, aborting.");var o,a=__webpack_require__(2945),u=__webpack_require__(7946),c=__webpack_require__(7743),s=__webpack_require__(4143),f={"accountId": "24099230963", "namespace": "24099230963", "revision": "45297", "anonymizeIP": true, "enableForceParameters": true, "experimental": {"trimPages": false}, "projectId": "24099230963", "layers": [{"changes": null, "id": "4536210236899328", "name": null, "commitId": "6279912338751488", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6310503511752704", "integrationSettings": null, "variations": [{"id": "6269179148369920", "name": null, "actions": [{"viewId": "4555696107159552", "changes": []}]}, {"id": "4748801907359744", "name": null, "actions": [{"viewId": "4555696107159552", "changes": [{"id": "70f5abf797604866960eefeb0bdd7ae9", "type": "custom_code", "value": function($){(function(){'use strict';var N='it-aya-cta-copy-update',D=!1,S='a.ef-button,button.ef-button,[role="button"].ef-button,[data-cy="cta"],[component="cta"]',A=['aria-label','title','value','data-label','data-title','data-cta-label'],M={'Catalogo gratis':'Richiedi un catalogo gratuito','Catalogo gratuito':'Richiedi un catalogo gratuito','Free catalog':'Richiedi un catalogo gratuito','Free brochure':'Richiedi un catalogo gratuito','Preventivo gratis':'Richiedi un preventivo gratis','Preventivo gratuito':'Richiedi un preventivo gratis','Free quote':'Richiedi un preventivo gratis','Incontra un consulente':'Prenota una consulenza','Meet with a consultant':'Prenota una consulenza','Meet with an advisor':'Prenota una consulenza'};
2function ok(){return/(^|\.)ef-italia\.it$/i.test(location.hostname)&&/^\/aya(?:\/|$)/i.test(location.pathname)}function l(){D&&console&&console.log.apply(console,[N].concat([].slice.call(arguments)))}function n(v){return String(v||'').replace(/\s+/g,' ').trim()}function r(v){return M[n(v)]||null}function z(){[].slice.call(document.querySelectorAll('[data-sentry-source-file="sticky-cta.tsx"],[data-clicklabel="page:sticky"]')).forEach(function(e){for(var p=e,i=0;p&&p!==document.body&&i<10;p=p.parentElement,i++){var s=getComputedStyle(p),sc=s.position!='static'||s.transform!='none'||s.filter!='none'||s.perspective!='none'||s.isolation=='isolate'||s.contain!='none';if(sc)p.style.setProperty('z-index','2147483000','important')}})}function tx(t){var v=t.nodeValue,m=r(v);if(!m||n(v)===m)return!1;t.nodeValue=(v.match(/^\s*/)||[''])[0]+m+(v.match(/\s*$/)||[''])[0];return!0}function at(e){var c=!1;A.forEach(function(a){if(e.hasAttribute&&e.hasAttribute(a)){var v=e.getAttribute(a),m=r(v);if(m&&v!==m)e.setAttribute(a,m),c=!0}});return c}function inn(e){var c=!1,w=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(o){var p=o.parentElement;return p&&!p.closest('script,style,noscript,svg')&&r(o.nodeValue)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},!1),o;while(o=w.nextNode())c=tx(o)||c;return c}function run(){if(!ok()||!document.body)return;var c=0;[].slice.call(document.querySelectorAll(S)).forEach(function(e){if(at(e))c++;if(inn(e))c++});z();c&&l('Updated CTA copy:',c)}var q=!1;function sch(){if(q)return;q=!0;requestAnimationFrame(function(){q=!1;run()})}function h(m){var o=history[m];typeof o=='function'&&(history[m]=function(){var v=o.apply(this,arguments);sch();setTimeout(sch,100);setTimeout(sch,500);return v})}function init(){if(!ok())return;sch();new MutationObserver(sch).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:A});h('pushState');h('replaceState');['popstate','pageshow','load','scroll','resize'].forEach(function(e){addEventListener(e,sch,{passive:!0})});setInterval(sch,1000)}document.readyState==='loading'?document.addEventListener('DOMContentLoaded',init):init()})(); 3}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "6269179148369920", "endOfRange": 5000}, {"entityId": "4748801907359744", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4536210236899328"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4555696107159552"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4541966237564928", "name": null, "commitId": "5037589156069376", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6455968081379328", "integrationSettings": null, "variations": [{"id": "6428407611785216", "name": null, "actions": [{"viewId": "6037997299171328", "changes": []}]}, {"id": "4856448709033984", "name": null, "actions": [{"viewId": "6037997299171328", "changes": [{"id": "e2addc5fc5964f078c93321c9984b266", "type": "redirect", "dependencies": [], "dest": "https://www.ef.de/cc/test/brochure-auto/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "6428407611785216", "endOfRange": 5000}, {"entityId": "4856448709033984", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4541966237564928"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6037997299171328"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4618471460306944", "name": null, "commitId": "4553766391775232", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6440435913064448", "integrationSettings": null, "variations": [{"id": "5850719723454464", "name": null, "actions": [{"viewId": "47248
319816611840", "changes": []}]}, {"id": "5430674606260224", "name": null, "actions": [{"viewId": "4724819816611840", "changes": [{"id": "bb8a56b5cddf429c858f80d2d4165397", "type": "custom_code", "value": function($){// inject last spots 4var EXPERIMENT_ID = "optly-faplatserkvar"; 5var MAX_TRIPS = 6; 6var BUTTON_TEXT = "Descubre nuestros viajes"; 7var LAST_SPOTS_HEADER = "Ãltimas plazas"; 8var JUNO_MARKET_CODE = "esb"; 9console.log("LTONB: Experiment script started version ESB.20260722.1"); 10 11function normalizeLtPath(path) { 12 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 13 if (match) return match[1] + "/"; 14 return path; 15} 16 17function fetchLastSpots() { 18 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 19 .then(function (response) { 20 if (!response.ok) { 21 throw new Error("Network response was not ok"); 22 } 23 return response.json(); 24 }) 25 .then(function (data) { 26 var items = Array.isArray(data) 27 ? data 28 : Array.isArray(data && data.items) 29 ? data.items 30 : Array.isArray(data && data.trips) 31 ? data.trips 32 : null; 33 34 if (!items) { 35 throw new Error("Expected trips in response payload"); 36 } 37 38 var today = new Date(); 39 today.setHours(0, 0, 0, 0); 40 var availableTrips = items 41 .map(function (trip) { 42 var availableDeparture = (trip.availabilities || []) 43 .filter(function (availability) { 44 var startDate = new Date(availability.startDate + "T00:00:00"); 45 return availability.availableSpots >= 1 && startDate >= today; 46 }) 47 .sort(function (a, b) { 48 return a.availableSpots - b.availableSpots || a.price - b.price; 49 })[0]; 50 51 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 52 }) 53 .filter(Boolean); 54 55 availableTrips.sort(function (a, b) { 56 return a.availableSpots - b.availableSpots || a.price - b.price; 57 }); 58 59 return availableTrips.slice(0, MAX_TRIPS); 60 }) 61 .catch(function (error) { 62 console.error("There was a problem with the fetch operation:", error); 63 return []; 64 }); 65} 66 67function escapeHtml(value) { 68 return String(value) 69 .replace(/&/g, "&") 70 .replace(/</g, "<") 71 .replace(/>/g, ">") 72 .replace(/"/g, """) 73 .replace(/'/g, "'"); 74} 75 76function formatCurrency(amount, currency, locale) { 77 if (typeof amount !== "number" || !currency) return ""; 78 try { 79 return new Intl.NumberFormat(locale, { 80 style: "currency", 81 currency: currency, 82 currencyDisplay: "symbol", 83 minimumFractionDigits: 0, 84 maximumFractionDigits: 2 85 }).format(amount); 86 } catch (error) { 87 console.warn("Could not format currency", error); 88 return String(amount); 89 } 90} 91 92function getLocale() { 93 return document.documentElement.lang || navigator.language || "sv-SE"; 94} 95 96function renderTripCard(trip, locale) { 97 var title = escapeHtml(trip && trip.title ? trip.title : ""); 98 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 99 var image = 100 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 101 var currency = trip && trip.currency ? trip.currency : ""; 102 var originalAmount = 103 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 104 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 105 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 106 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 107 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 108 109 return ( 110 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 111 href + 112 '">' + 113 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 114 '<div class="flex w-full items-center">' + 115 (image 116 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 117 title + 118 '" src="' + 119 image + 120 '" width="100%" height="100%"></div>' 121 : "") + 122 '<div class="flex w-full items-center justify-between px-2">' + 123 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 124 title + 125 "</span></p>" + 126 '<div class="flex shrink-0 items-center gap-1">' + 127 (originalAmount > discountedAmount 128 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 129 originalPrice + 130 "</span></p>" 131 : "") + 132 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 133 discountedPrice + 134 "</span></p>" + 135 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
135' + 136 "</div>" + 137 "</div>" + 138 "</div>" + 139 "</div>" + 140 "</a>" 141 ); 142} 143 144function onElementVisible(selector, callback) { 145 var seen = new WeakMap(); 146 147 function isVisible(el) { 148 var style = getComputedStyle(el); 149 return ( 150 style.display !== "none" && 151 style.visibility !== "hidden" && 152 style.opacity !== "0" && 153 el.offsetParent !== null 154 ); 155 } 156 157 function check() { 158 document.querySelectorAll(selector).forEach((el) => { 159 var visible = isVisible(el); 160 var prev = seen.get(el); 161 162 // Trigger only when it becomes visible (false â true) 163 if (visible && !prev) { 164 console.log("LTONB: Element became visible for selector '" + selector + "'"); 165 callback(el); 166 } 167 168 seen.set(el, visible); 169 }); 170 } 171 172 // Initial check 173 check(); 174 175 var observer = new MutationObserver(check); 176 177 observer.observe(document.body, { 178 childList: true, 179 subtree: true, 180 attributes: true, 181 attributeFilter: ["style", "class", "hidden"] 182 }); 183 184 return observer; // so you can disconnect() later if needed 185} 186 187function replaceHTML(target, trips) { 188 if (document.getElementById(EXPERIMENT_ID)) return; 189 if (!trips || !trips.length) { 190 console.warn("LTONB: No trips returned for replacement"); 191 return; 192 } 193 if (!target) { 194 console.warn("LTONB: Target element not available for replacement"); 195 return; 196 } 197 198 var locale = getLocale(); 199 var cardsHtml = trips 200 .map(function (trip) { 201 return renderTripCard(trip, locale); 202 }) 203 .join(""); 204 205 var wrapper = document.createElement("div"); 206 wrapper.id = EXPERIMENT_ID; 207 208 wrapper.innerHTML = ` 209 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 210 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 211 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 212 ${cardsHtml} 213 </div> 214 </div> 215 </section> 216 `; 217 218 target.replaceWith(wrapper); 219} 220 221function replaceText(node, newText) { 222 if (node.nodeType === Node.TEXT_NODE) { 223 node.textContent = newText; 224 } else { 225 node.childNodes.forEach((child) => replaceText(child, newText)); 226 } 227} 228 229function updateHero() { 230 // hide original hero 231 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 232 if (hero) { 233 hero.style.setProperty("display", "none", "important"); 234 } else { 235 console.warn("LTONB: Original hero element not found"); 236 } 237 238 // show test hero 239 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 240 if (testHero) { 241 testHero.style.setProperty("display", "block", "important"); 242 testHero.style.setProperty("visibility", "visible", "important"); 243 testHero.style.setProperty("opacity", "1", "important"); 244 testHero.removeAttribute("hidden"); 245 testHero.classList.remove("hidden"); 246 } else { 247 console.warn("LTONB: Test hero element not found"); 248 } 249} 250 251function updateHeroButton() { 252 var testHeroOffersButton = document.querySelector( 253 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 254 ); 255 if (testHeroOffersButton) { 256 replaceText(testHeroOffersButton, BUTTON_TEXT); 257 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 258 } else { 259 console.warn("LTONB: Offers button in test hero not found"); 260 } 261} 262 263function updatePromotionsCarousel(target, trips) { 264 var element = document.querySelector(target); 265 var headerElement = document.querySelector( 266 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 267 ); 268 if (headerElement && element) { 269 replaceText(headerElement, LAST_SPOTS_HEADER); 270 replaceHTML(element, trips); 271 } 272} 273 274onElementVisible('[data-cy="promotions-carousel-container"]', function () { 275 fetchLastSpots().then(function (trips) { 276 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 277 }); 278}); 279 280onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 281 updateHeroButton(); 282}); 283 284onElementVisible('#hero, .hero, [data-component="hero"]', function () { 285 updateHero(); 286}); 287}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5850719723454464", "endOfRange": 1000}, {"entityId": "5430674606260224", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4618471460306944"}, "deployed": false}
287], "policy": "single_experiment", "viewIds": ["4724819816611840"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4624410645102592", "name": null, "commitId": "5831508894679040", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5418156437536768", "integrationSettings": null, "variations": [{"id": "5213535689506816", "name": null, "actions": [{"viewId": "5746245583503360", "changes": []}]}, {"id": "5500826186153984", "name": null, "actions": [{"viewId": "5746245583503360", "changes": [{"id": "406f8d90d07a41d2ad5c7d699f401f30", "type": "custom_code", "value": function($){// inject last spots 288var EXPERIMENT_ID = "optly-faplatserkvar"; 289var MAX_TRIPS = 6; 290var BUTTON_TEXT = "Odkryj nasze wycieczki"; 291var LAST_SPOTS_HEADER = "PozostaÅy ostatnie miejsca"; 292var JUNO_MARKET_CODE = "plw"; 293console.log("LTONB: Experiment script started version PLW.20260722.1"); 294 295function normalizeLtPath(path) { 296 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 297 if (match) return match[1] + "/"; 298 return path; 299} 300 301function fetchLastSpots() { 302 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 303 .then(function (response) { 304 if (!response.ok) { 305 throw new Error("Network response was not ok"); 306 } 307 return response.json(); 308 }) 309 .then(function (data) { 310 var items = Array.isArray(data) 311 ? data 312 : Array.isArray(data && data.items) 313 ? data.items 314 : Array.isArray(data && data.trips) 315 ? data.trips 316 : null; 317 318 if (!items) { 319 throw new Error("Expected trips in response payload"); 320 } 321 322 var today = new Date(); 323 today.setHours(0, 0, 0, 0); 324 var availableTrips = items 325 .map(function (trip) { 326 var availableDeparture = (trip.availabilities || []) 327 .filter(function (availability) { 328 var startDate = new Date(availability.startDate + "T00:00:00"); 329 return availability.availableSpots >= 1 && startDate >= today; 330 }) 331 .sort(function (a, b) { 332 return a.availableSpots - b.availableSpots || a.price - b.price; 333 })[0]; 334 335 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 336 }) 337 .filter(Boolean); 338 339 availableTrips.sort(function (a, b) { 340 return a.availableSpots - b.availableSpots || a.price - b.price; 341 }); 342 343 return availableTrips.slice(0, MAX_TRIPS); 344 }) 345 .catch(function (error) { 346 console.error("There was a problem with the fetch operation:", error); 347 return []; 348 }); 349} 350 351function escapeHtml(value) { 352 return String(value) 353 .replace(/&/g, "&") 354 .replace(/</g, "<") 355 .replace(/>/g, ">") 356 .replace(/"/g, """) 357 .replace(/'/g, "'"); 358} 359 360function formatCurrency(amount, currency, locale) { 361 if (typeof amount !== "number" || !currency) return ""; 362 try { 363 return new Intl.NumberFormat(locale, { 364 style: "currency", 365 currency: currency, 366 currencyDisplay: "symbol", 367 minimumFractionDigits: 0, 368 maximumFractionDigits: 2 369 }).format(amount); 370 } catch (error) { 371 console.warn("Could not format currency", error); 372 return String(amount); 373 } 374} 375 376function getLocale() { 377 return document.documentElement.lang || navigator.language || "sv-SE"; 378} 379 380function renderTripCard(trip, locale) { 381 var title = escapeHtml(trip && trip.title ? trip.title : ""); 382 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 383 var image = 384 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 385 var currency = trip && trip.currency ? trip.currency : ""; 386 var originalAmount = 387 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 388 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 389 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 390 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 391 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 392 393 return ( 394 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 395 href + 396 '">' + 397 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 398 '<div class="flex w-full items-center">' + 399 (image 400 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 401 title + 402 '" src="' + 403 image + 404 '" width="100%" height="100%"></div>' 405 : "") + 406 '<div class="flex w-full items-center justify-between px-2">' + 407 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 408 title + 409 "</span></p>" + 410 '<div class="flex shrink-0 items-center gap-1">' + 411 (originalAmount > discountedAmount 412 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 413 originalPrice + 414 "</span></p>" 415 : "") + 416 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 417 discountedPrice + 418 "</span></p>" + 419 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
419' + 420 "</div>" + 421 "</div>" + 422 "</div>" + 423 "</div>" + 424 "</a>" 425 ); 426} 427 428function onElementVisible(selector, callback) { 429 var seen = new WeakMap(); 430 431 function isVisible(el) { 432 var style = getComputedStyle(el); 433 return ( 434 style.display !== "none" && 435 style.visibility !== "hidden" && 436 style.opacity !== "0" && 437 el.offsetParent !== null 438 ); 439 } 440 441 function check() { 442 document.querySelectorAll(selector).forEach((el) => { 443 var visible = isVisible(el); 444 var prev = seen.get(el); 445 446 // Trigger only when it becomes visible (false â true) 447 if (visible && !prev) { 448 console.log("LTONB: Element became visible for selector '" + selector + "'"); 449 callback(el); 450 } 451 452 seen.set(el, visible); 453 }); 454 } 455 456 // Initial check 457 check(); 458 459 var observer = new MutationObserver(check); 460 461 observer.observe(document.body, { 462 childList: true, 463 subtree: true, 464 attributes: true, 465 attributeFilter: ["style", "class", "hidden"] 466 }); 467 468 return observer; // so you can disconnect() later if needed 469} 470 471function replaceHTML(target, trips) { 472 if (document.getElementById(EXPERIMENT_ID)) return; 473 if (!trips || !trips.length) { 474 console.warn("LTONB: No trips returned for replacement"); 475 return; 476 } 477 if (!target) { 478 console.warn("LTONB: Target element not available for replacement"); 479 return; 480 } 481 482 var locale = getLocale(); 483 var cardsHtml = trips 484 .map(function (trip) { 485 return renderTripCard(trip, locale); 486 }) 487 .join(""); 488 489 var wrapper = document.createElement("div"); 490 wrapper.id = EXPERIMENT_ID; 491 492 wrapper.innerHTML = ` 493 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 494 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 495 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 496 ${cardsHtml} 497 </div> 498 </div> 499 </section> 500 `; 501 502 target.replaceWith(wrapper); 503} 504 505function replaceText(node, newText) { 506 if (node.nodeType === Node.TEXT_NODE) { 507 node.textContent = newText; 508 } else { 509 node.childNodes.forEach((child) => replaceText(child, newText)); 510 } 511} 512 513function updateHero() { 514 // hide original hero 515 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 516 if (hero) { 517 hero.style.setProperty("display", "none", "important"); 518 } else { 519 console.warn("LTONB: Original hero element not found"); 520 } 521 522 // show test hero 523 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 524 if (testHero) { 525 testHero.style.setProperty("display", "block", "important"); 526 testHero.style.setProperty("visibility", "visible", "important"); 527 testHero.style.setProperty("opacity", "1", "important"); 528 testHero.removeAttribute("hidden"); 529 testHero.classList.remove("hidden"); 530 } else { 531 console.warn("LTONB: Test hero element not found"); 532 } 533} 534 535function updateHeroButton() { 536 var testHeroOffersButton = document.querySelector( 537 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 538 ); 539 if (testHeroOffersButton) { 540 replaceText(testHeroOffersButton, BUTTON_TEXT); 541 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 542 } else { 543 console.warn("LTONB: Offers button in test hero not found"); 544 } 545} 546 547function updatePromotionsCarousel(target, trips) { 548 var element = document.querySelector(target); 549 var headerElement = document.querySelector( 550 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 551 ); 552 if (headerElement && element) { 553 replaceText(headerElement, LAST_SPOTS_HEADER); 554 replaceHTML(element, trips); 555 } 556} 557 558onElementVisible('[data-cy="promotions-carousel-container"]', function () { 559 fetchLastSpots().then(function (trips) { 560 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 561 }); 562}); 563 564onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 565 updateHeroButton(); 566}); 567 568onElementVisible('#hero, .hero, [data-component="hero"]', function () { 569 updateHero(); 570}); 571}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5213535689506816", "endOfRange": 1000}, {"entityId": "5500826186153984", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4624410645102592"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5746245583503360"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4645010321178624", "name": null, "commitId": "4708055609245696", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5167194374406144", "integrationSettings": null, "variations": [{"id": "6565751555883008", "name": null, "actions": [{"viewId": "5695199484051456", "changes": [{"id": "ec518b5ca0b84258976b4fdb70064dd4", "type": "custom_code", "value": function($){(function () { 572 var chatbotId = "uHXV8y9ba5f8HX9EfVdFD"; 573 574 /* ===== Disable floating messages BEFORE SDK loads ===== */ 575 window.chatbaseConfig = { showFloatingInitialMessages: false }; 576 577 /* ================= Helpers (ES5) ================= */ 578 function chatbaseReady() { 579 try { 580 return typeof window.chatbase === "function" &&
581 window.chatbase("getState") !== "uninitialized"; 582 } catch (_e) { return false; } 583 } 584 585 /* --- URL param helpers (ES5, robust decoding) --- */ 586 function getQueryParam(name) { 587 try { 588 var qs = window.location && window.location.search ? window.location.search : ""; 589 if (!qs || qs.length < 2) return ""; 590 var query = qs.substring(1); 591 var parts = query.split("&"); 592 var i, kv, k, v; 593 for (i = 0; i < parts.length; i++) { 594 kv = parts[i].split("="); 595 if (!kv || kv.length === 0) continue; 596 k = kv[0] ? decodeURIComponent(kv[0].replace(/\+/g, " ")) : ""; 597 if (k !== name) continue; 598 v = kv.length > 1 ? kv.slice(1).join("=") : ""; 599 v = v ? decodeURIComponent(v.replace(/\+/g, " ")) : ""; 600 return v || ""; 601 } 602 } catch (_e) {} 603 return ""; 604 } 605 606 function deriveCountryCodeFromDestination(dest) { 607 // destination expected like "US-NYC". Take first 2 chars. 608 if (!dest || dest.length < 2) return ""; 609 return String(dest).substring(0, 2).toLowerCase(); 610 } 611 612 /* Optimizely end user id from Local Storage (robust scan) */ 613 function getOptimizelyEndUserId() { 614 try { 615 var direct = localStorage.getItem("profile.visitorId"); 616 if (direct) { 617 try { 618 var pd = JSON.parse(direct); 619 if (pd && typeof pd === "object") { 620 if (pd.endUserId) return String(pd.endUserId); 621 if (pd.value) return String(pd.value); 622 if (pd.id) return String(pd.id); 623 } 624 } catch (_ignore) {} 625 return String(direct); 626 } 627 var i, k, v, obj; 628 for (i = 0; i < localStorage.length; i++) { 629 k = localStorage.key(i); 630 if (k && k.indexOf("$visitor_profile") !== -1) { 631 v = localStorage.getItem(k); 632 if (!v) continue; 633 try { obj = JSON.parse(v); } catch (_e) { obj = null; } 634 if (obj) { 635 if (obj.profile && obj.profile.visitorId) return String(obj.profile.visitorId); 636 if (obj.visitorId) return String(obj.visitorId); 637 } 638 } 639 } 640 } catch (_e) {} 641 return ""; 642 } 643 644 /* ---- UTM -> EF Partners (sourceCode + eTag) ---- */ 645 function extractUtmFromDl(dl) { 646 var utm = { source: "(direct)", medium: "(none)", content: "noref" }; 647 try { 648 if (dl && dl.channel && dl.channel.utm && dl.channel.utm[0]) { 649 var u = dl.channel.utm[0]; 650 if (u.source) utm.source = String(u.source); 651 if (u.medium) utm.medium = String(u.medium); 652 if (u.content) utm.content = String(u.content); 653 } 654 } catch (_e) {} 655 return utm; 656 } 657 658 function bestGuessDL() { 659 if (window.dl) return window.dl; 660 if (window.dataLayer && window.dataLayer.length) { 661 var i; 662 for (i = window.dataLayer.length - 1; i >= 0; i--) { 663 var it = window.dataLayer[i]; 664 if (it && it.channel && it.channel.utm) return it; 665 } 666 } 667 return null; 668 } 669 670 function fetchEfPartnersSourceCode(utm, cb) { 671 var url = "https://www.ef.fr/utm2efpartners/getefpartners/"; 672 var xhr = new XMLHttpRequest(); 673 xhr.open("POST", url, true); 674 xhr.setRequestHeader("Content-Type", "application/json"); 675 xhr.onreadystatechange = function () { 676 if (xhr.readyState !== 4) return; 677 if (xhr.status >= 200 && xhr.status < 300) { 678 var data; 679 try { data = JSON.parse(xhr.responseText); } catch (e) { return cb(e); } 680 if (data && data.status === "Success" && data.result) { 681 return cb(null, { 682 sourceCode: data.result.sourceCode || "", 683 eTag: data.result.eTag || "" 684 }); 685 } 686 return cb(new Error((data && data.errorMessage) || "No partner match")); 687 } 688 cb(new Error("HTTP " + xhr.status)); 689 }; 690 try { 691 xhr.send(JSON.stringify({ 692 source: utm.source, 693 medium: utm.medium, 694 content: utm.content 695 })); 696 } catch (err) { cb(err); } 697 } 698 699 /* =============== ONE-TIME IDENTIFY COORDINATOR =============== */ 700 var meta = { 701 destinationCode: "", 702 productCode: "ils", 703 courseCode: "", 704 countryCode: "", 705 duration: "", 706 bookingFor: "", 707 optimizelyEndUserId: "", 708 sourceCode: "", 709 eTag: "", 710 accommodationType: "", 711 residenceCode: "", 712 roomType: "", 713 packageCode: "" 714 }; 715 716 var gotPartners = false;
717 var sentOnce = false; 718 719 function populateMetaFromUrl() { 720 // destinationCode from URL param destination 721 var dest = getQueryParam("destination"); 722 meta.destinationCode = dest || ""; 723 724 // courseCode from URL param course 725 meta.courseCode = getQueryParam("course") || ""; 726 727 // duration from URL param duration 728 meta.duration = getQueryParam("duration") || ""; 729 730 // bookingFor from URL param bookingFor 731 meta.bookingFor = getQueryParam("bookingFor") || ""; 732 733 // countryCode derived from destinationCode (first 2 letters lowercased) 734 meta.countryCode = deriveCountryCodeFromDestination(meta.destinationCode); 735 736 // packageCode from URL param packageCode (e.g. ILS_LAN_ROM_I_200) 737 meta.packageCode = getQueryParam("packageCode") || ""; 738 } 739 740 /* ---- EF Booking (window.__efBooking) -> user_metadata ---- */ 741 function normalizeEfBooking(obj) { 742 var b = (obj && typeof obj === "object") ? obj : {}; 743 return { 744 accommodationType: b.accommodationType ? String(b.accommodationType) : "", 745 residenceCode: b.residenceCode ? String(b.residenceCode) : "", 746 roomType: b.roomType ? String(b.roomType) : "" 747 }; 748 } 749 750 function efBookingSignature(b) { 751 return (b.accommodationType || "") + "|" + (b.residenceCode || "") + "|" + (b.roomType || ""); 752 } 753 754 function applyEfBookingToMeta(b) { 755 meta.accommodationType = b.accommodationType || ""; 756 meta.residenceCode = b.residenceCode || ""; 757 meta.roomType = b.roomType || ""; 758 } 759 760 var lastEfBookingSig = ""; 761 762 function sendUserMetadataUpdate(reason) { 763 if (!chatbaseReady()) return; 764 765 // If initial identify has not happened yet, keep the existing gating behavior. 766 if (!sentOnce) { 767 maybeSendOnce(reason || "efBooking-pre"); 768 return; 769 } 770 771 try { 772 window.chatbase("identify", { user_metadata: meta }); 773 console.log("ð¦ [update] user_metadata updated:", reason, meta); 774 } catch (e) { 775 console.warn("â identify update failed:", e); 776 } 777 } 778 779 function readEfBookingAndMaybeUpdate(reason) { 780 var b = normalizeEfBooking(window.__efBooking); 781 var sig = efBookingSignature(b); 782 if (sig === lastEfBookingSig) return; 783 784 lastEfBookingSig = sig; 785 applyEfBookingToMeta(b); 786 sendUserMetadataUpdate(reason || "efBooking-change"); 787 } 788 789 function startEfBookingWatch() {
790 // Initial sync (so first identify includes booking info when available). 791 readEfBookingAndMaybeUpdate("efBooking-initial"); 792 793 // Capture re-assignments: window.__efBooking = {...} 794 try { 795 var current = window.__efBooking; 796 Object.defineProperty(window, "__efBooking", { 797 configurable: true, 798 enumerable: true, 799 get: function () { return current; }, 800 set: function (v) { 801 current = v; 802 readEfBookingAndMaybeUpdate("efBooking-setter"); 803 } 804 }); 805 } catch (_e) {} 806 807 // Capture in-place mutations: window.__efBooking.roomType = "single" 808 setInterval(function () { 809 readEfBookingAndMaybeUpdate("efBooking-poll"); 810 }, 500); 811 } 812 813 function maybeSendOnce(tag) { 814 if (sentOnce) return; 815 if (!chatbaseReady()) return; 816 817 // Same gating behavior as today: wait for partners AND require Optimizely end user id 818 if (!gotPartners || !meta.optimizelyEndUserId) return; 819 820 try { 821 window.chatbase("identify", { user_metadata: meta }); 822 sentOnce = true; 823 console.log("ð¦ [one-shot] user_metadata sent:", meta); 824 } catch (e) { 825 console.warn("â identify failed:", e); 826 } 827 } 828 829 /* ===== Place custom button & relay to native bubble ===== */ 830 function insertCustomChatButton() { 831 var stickyParent = document.querySelector('[data-clicksubregion="sticky"]'); 832 if (!stickyParent || !stickyParent.firstElementChild) return; 833 834 var buttonGroup = stickyParent.firstElementChild; 835 var anchors = buttonGroup.getElementsByTagName("a"); 836 if (!anchors.length) return; 837 838 var firstAnchor = anchors[0]; 839 if (!firstAnchor) return; 840 841 var existingBtn = document.getElementById("custom-chatbase-button"); 842 if (existingBtn) { 843 if (firstAnchor.nextSibling !== existingBtn) { 844 buttonGroup.insertBefore(existingBtn, firstAnchor.nextSibling); 845 } 846 return; 847 } 848 849 var customBtn = document.createElement("button"); 850 customBtn.setAttribute("aria-label", "chatbase-custom-button"); 851 customBtn.setAttribute("id", "custom-chatbase-button"); 852 customBtn.setAttribute("type", "button"); 853 customBtn.className = "md:order-4"; 854 customBtn.style.cssText = 855 "background: transparent; border: none; cursor: pointer; display: flex;" + 856 "align-items: center; justify-content: center; width: 48px; height: 48px;" + 857 "padding: 0px; margin-left: 10px;"; 858 859 var img = document.createElement("img"); 860 img.src = "https://storage.googleapis.com/analytics_tactical/digital_factory/ori-chat-button.svg"; 861 img.alt = "Chat"; 862 img.width = 48; 863 img.height = 48; 864 customBtn.appendChild(img); 865 866 buttonGroup.insertBefore(customBtn, firstAnchor.nextSibling); 867 868 // Toggle Chatbase via native bubble 869 customBtn.addEventListener("click", function () { 870 var realChatBtn = document.getElementById("chatbase-bubble-button"); 871 if (realChatBtn && typeof realChatBtn.click === "function") { 872 realChatBtn.click(); 873 } else { 874 console.warn("â ï¸ Chatbase bubble not found"); 875 } 876 }); 877 } 878 879 /* ===== Load Chatbase ===== */ 880 var script = document.createElement("script"); 881 script.src = "https://www.chatbase.co/embed.min.js"; 882 script.defer = true; 883 script.setAttribute("chatbotId", chatbotId); 884 script.setAttribute("domain", "www.chatbase.co"); 885 886 script.onload = function () { 887 // Hide native bubble 888 var style = document.createElement("style"); 889 style.innerHTML = "#chatbase-bubble-button { " + 890 "position: absolute !important;" + 891 "width: 1px !important;" + 892 "height: 1px !important;" + 893 "opacity: 0 !important;" + 894 "pointer-events: none !important;" + 895 "overflow: hidden !important;" + 896 "z-index: -1 !important;" + 897 "}"; 898 document.head.appendChild(style); 899 900 // Keep custom button placed (handles re-renders) 901 setInterval(insertCustomChatButton, 1000); 902 903 /* ------- Collect ALL metadata, then send ONCE ------- */ 904 905 // URL params (sync) 906 populateMetaFromUrl(); 907 908 // Optimizely (sync) 909 meta.optimizelyEndUserId = getOptimizelyEndUserId(); 910 911 // EF booking object (accommodation selection) 912 startEfBookingWatch(); 913 914 // EF Partners (async request) 915 var utm = extractUtmFromDl(bestGuessDL()); 916 fetchEfPartnersSourceCode(utm, function (err, result) { 917 if (err) { 918 console.warn("EF Partners lookup failed:", err && err.message ? err.message : err); 919 } else { 920 meta.sourceCode = result.sourceCode || ""; 921 meta.eTag = result.eTag || ""; 922 } 923 gotPartners = true; // proceed either way 924 maybeSendOnce("partners"); 925 }); 926 927 // As a last resort, attempt send after a hard cap if still not sent 928 setTimeout(function () { maybeSendOnce("hard-cap"); }, 8000); 929 930 /* ----- SPA navigation: keep UI behavior but DO NOT re-identify ----- */ 931 (function patchHistoryForSpaEvents() { 932 var pushState = history.pushState; 933 var replaceState = history.replaceState; 934 935 history.pushState = function () { 936 var ret = pushState.apply(history, arguments); 937 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 938 return ret; 939 }; 940 history.replaceState = function () { 941 var ret = replaceState.apply(history, arguments); 942 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 943 return ret; 944 }; 945 window.addEventListener("popstate", function () { 946 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 947 }); 948 949 window.addEventListener("spa:navigation", function () { 950 setTimeout(function () { 951 insertCustomChatButton(); 952 953 // We intentionally DO NOT re-identify on SPA navigation. 954 // If your routing changes URL params and you want the bot to reflect that, 955 // you would need a decision on whether to allow re-identify updates. 956 // Keeping behavior identical to current script. 957 }, 150); 958 }); 959 })(); 960 }; 961 962 if (document.readyState === "complete") { 963 document.body.appendChild(script); 964 } else { 965 window.addEventListener("load", function () { 966 document.body.appendChild(script); 967 }); 968 } 969})(); 970}, "dependencies": []}, {"id": "b84588ea664e4ef98a37bdd7b851b124", "type": "append", "selector": "head", "value": "<style>button[data-cy=\"gudl-chat-button\"] {\n width: 0 !important;\n height: 0 !important;\n color: transparent !important;\n background: transparent !important;\n border: none !important;\n pointer-events: none !important;\n}\n\nbutton[data-cy=\"gudl-chat-button\"] {\n visibility: hidden !important;\n}\n\n#chatbase-bubble-button {\n width: 1px !important;\n height: 1px !important;\n opacity: 0 !important;\n pointer-events: none !important;\n overflow: hidden !important;\n position: absolute !important;\n z-index: -1 !important;\n}</style>
970", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4645010321178624"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5695199484051456"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5167194374406144", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "4706514095570944", "name": null, "commitId": "4629095061913600", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5690635756240896"], "audienceName": null, "changes": null, "id": "5832414002413568", "integrationSettings": null, "variations": [{"id": "5603016544354304", "name": null, "actions": [{"viewId": "4936724309082112", "changes": []}]}, {"id": "6360611798384640", "name": null, "actions": [{"viewId": "4936724309082112", "changes": [{"id": "9de9ab4cd8e64bd7aeef301792fea19e", "type": "redirect", "dependencies": [], "dest": "https://www.ef-italia.it/cc/ccr/erasmus_all_generic_ilc_x/", "preserveParameters": true, "allowAdditionalRedirect": false, "isOpalManaged": false}]}]}], "weightDistributions": [{"entityId": "5603016544354304", "endOfRange": 5000}, {"entityId": "6360611798384640", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4706514095570944"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4936724309082112"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4706926370488320", "name": null, "commitId": "4617055580717056", "groupId": null, "holdback": null, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5161172983349248", "integrationSettings": null, "variations": [{"id": "5651597582139392", "name": null, "actions": [{"viewId": "5180453729075200", "changes": [{"id": "CACA91B5-B237-4AE3-BEA7-F848D3541112", "src": "/actions/bb633f14fd0ccfa60a4790b77d82da21da40662f0f6b9c6278f025af4b8890df.js", "dependencies": [], "type": "custom_code"}, {"id": "E7287D67-A677-4B22-93B3-B560FEEBEFD9", "type": "append", "selector": "head", "value": "<style>#mycal {\n color: #333;\n margin: 0 auto;\n width: 100%;\n border-radius: 8px;\n background-color: #fff;\n }\n \n .timeslot-calendar {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n height: fit-content;\n }\n \n .timeslot-calendar th,\n .timeslot-calendar td {\n padding: 10px;\n text-align: center;\n border: 1px solid #e0e0e0;\n }\n \n .timeslot-calendar th {\n background-color: #003C64;\n color: #fff;\n font-weight: normal;\n }\n \n .timeslot-calendar .timeslot {\n cursor: pointer;\n transition: background-color 0.3s;\n }\n \n .timeslot-calendar .timeslot:hover {\n background-color: #e0f3ff;\n }\n \n .timeslot-calendar .selected {\n background-color: #0073e6;\n color: #fff;\n }\n\n .calendar-navigation {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n font-family: Arial, sans-serif;\n }\n .calendar-title {\n font-size: 16px;\n font-weight: bold;\n }\n .calendar-btn {\n background: #0073e6;\n border: none;\n color: #fff;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background 0.3s;\n }\n .calendar-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n }\n .calendar-btn:hover:not(:disabled) {\n background: #005bb5;\n }\n .japanese-day {\n font-size: 12px;\n color: #555;\n }\n .japanese-day {\n font-size: 12px;\n color: #FFF;\n }\n .timeslot.unavailable {\n background-color: #d3d3d3;\n color: #888;\n pointer-events: none;\n }\n .timeslot.selected {\n background-color: #0073e6;\n color: #FFF;\n }\n \n /* Mobile specific styles */\n @media (max-width: 767px) {\n .timeslot-calendar th,\n .timeslot-calendar td {\n font-size: 10px;\n } }</style>
970", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4706926370488320"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5180453729075200"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5161172983349248", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "4733798974226432", "name": null, "commitId": "4784304836837376", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5681296744120320", "integrationSettings": null, "variations": [{"id": "5742179851698176", "name": null, "actions": [{"viewId": "5562566835961856", "changes": [{"id": "6BDF9CA3-00B0-4F8E-8C46-A4F02C340B90", "src": "/actions/3e863bc1322d9a6167718ae9a7b20fa5b161ff9f606e50c6f3641d587536b535.js", "dependencies": [], "type": "custom_code"}, {"id": "F5E8FE6C-8AEF-4F60-99ED-E67C1E8BBC83", "type": "append", "selector": "head", "value": "<style>#mycal {\n color: #333;\n margin: 0 auto;\n width: 100%;\n border-radius: 8px;\n background-color: #fff;\n }\n \n .timeslot-calendar {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n height: fit-content;\n }\n \n .timeslot-calendar th,\n .timeslot-calendar td {\n padding: 10px;\n text-align: center;\n border: 1px solid #e0e0e0;\n }\n \n .timeslot-calendar th {\n background-color: #003C64;\n color: #fff;\n font-weight: normal;\n }\n \n .timeslot-calendar .timeslot {\n cursor: pointer;\n transition: background-color 0.3s;\n }\n \n .timeslot-calendar .timeslot:hover {\n background-color: #e0f3ff;\n }\n \n .timeslot-calendar .selected {\n background-color: #0073e6;\n color: #fff;\n }\n\n .calendar-navigation {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n font-family: Arial, sans-serif;\n }\n .calendar-title {\n font-size: 16px;\n font-weight: bold;\n }\n .calendar-btn {\n background: #0073e6;\n border: none;\n color: #fff;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background 0.3s;\n }\n .calendar-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n }\n .calendar-btn:hover:not(:disabled) {\n background: #005bb5;\n }\n .japanese-day {\n font-size: 12px;\n color: #555;\n }\n .japanese-day {\n font-size: 12px;\n color: #FFF;\n }\n .timeslot.unavailable {\n background-color: #d3d3d3;\n color: #888;\n pointer-events: none;\n }\n .timeslot.selected {\n background-color: #0073e6;\n color: #FFF;\n }\n \n /* Mobile specific styles */\n @media (max-width: 767px) {\n .timeslot-calendar th,\n .timeslot-calendar td {\n font-size: 10px;\n } }</style>", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4733798974226432"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5562566835961856"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5681296744120320", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "4820122490109952", "name": null, "commitId": "4971205279612928", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "4851055238840320"], "audienceName": null, "changes": null, "id": "6742799664545792", "integrationSettings": null, "variations": [{"id": "5302945567211520", "name": null, "actions": [{"viewId": "4830370986721280", "changes": []}]}, {"id": "4753894329286656", "name": null, "actions": [{"viewId": "4830370986721280", "changes": [{"id": "7f57f5e0dd68446ead5dda2138c4dcb2", "type": "redirect", "depen
970dencies": [], "dest": "https://www.ef-italia.it/cc/ccr/study-abroad_all_generic_ilc_x/", "preserveParameters": true, "allowAdditionalRedirect": false, "isOpalManaged": false}]}]}], "weightDistributions": [{"entityId": "5302945567211520", "endOfRange": 5000}, {"entityId": "4753894329286656", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4820122490109952"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4830370986721280"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4821873987420160", "name": null, "commitId": "4604396841992192", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6323794556485632"], "audienceName": null, "changes": null, "id": "4735234564947968", "integrationSettings": null, "variations": [{"id": "5767921249550336", "name": null, "actions": []}, {"id": "5142101833285632", "name": null, "actions": [{"viewId": "6564821913567232", "changes": [{"id": "8b6f16d5ae864559a25ca1bca094aaaa", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": false, "preserveParameters": false, "dest": function redirectFn() { 971document.cookie = "multipg_visit=true; Path=/; SameSite=Lax; Secure"; 972return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search + window.location.hash; 973} 974}]}]}], "weightDistributions": [{"entityId": "5767921249550336", "endOfRange": 5000}, {"entityId": "5142101833285632", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4821873987420160"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6564821913567232"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4907611634532352", "name": null, "commitId": "5970975341150208", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6474337656504320", "integrationSettings": null, "variations": [{"id": "5481043791183872", "name": null, "actions": [{"viewId": "5787331129507840", "changes": []}]}, {"id": "6017431183818752", "name": null, "actions": [{"viewId": "5787331129507840", "changes": [{"id": "d49bfef43d134be4a65479e4c7a2f87f", "type": "custom_code", "value": function($){(function(){'use strict';var N='de-aya-cta-copy-update',D=!1,S='a.ef-button,button.ef-button,[role="button"].ef-button,[data-cy="cta"],[component="cta"]',A=['aria-label','title','value','data-label','data-title','data-cta-label'],M={'Gratis Katalog bestellen':'Kostenlosen Katalog anfordern','Gratis Katalog':'Kostenlosen Katalog anfordern','Order a free catalog':'Kostenlosen Katalog anfordern','Preisangebot':'Angebot anfordern','Kostenloses Angebot':'Angebot anfordern','Free quote':'Angebot anfordern','Buche einen Beratungstermin':'Beratung buchen','Book a consultation appointment':'Beratung buchen'};function ok(){return/(^|\.)ef\.de$/i.test(location.hostname)&&/^\/aya(?:\/|$)/i.test(location.pathname)}function l(){D&&console&&console.log.apply(console,[N].concat([].slice.call(arguments)))}function n(v){return String(v||'').replace(/\s+/g,' ').trim()}function r(v){return M[n(v)]||null}function z(){[].slice.call(document.querySelectorAll('[data-sentry-source-file="sticky-cta.tsx"],[data-clicklabel="page:sticky"]')).forEach(function(e){for(var p=e,i=0;p&&p!==document.body&&i<10;p=p.parentElement,i++){var s=getComputedStyle(p),sc=s.position!='static'||s.transform!='none'||s.filter!='none'||s.perspective!='none'||s.isolation=='isolate'||s.contain!='none';if(sc)p.style.setProperty('z-index','2147483000','important')}})}function tx(t){var v=t.nodeValue,m=r(v);if(!m||n(v)===m)return!1;t.nodeValue=(v.match(/^\s*/)||[''])[0]+m+(v.match(/\s*$/)||[''])[0];return!0}function at(e){var c=!1;
974A.forEach(function(a){if(e.hasAttribute&&e.hasAttribute(a)){var v=e.getAttribute(a),m=r(v);if(m&&v!==m)e.setAttribute(a,m),c=!0}});return c}function inn(e){var c=!1,w=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(o){var p=o.parentElement;return p&&!p.closest('script,style,noscript,svg')&&r(o.nodeValue)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},!1),o;while(o=w.nextNode())c=tx(o)||c;return c}function run(){if(!ok()||!document.body)return;var c=0;[].slice.call(document.querySelectorAll(S)).forEach(function(e){if(at(e))c++;if(inn(e))c++});z();c&&l('Updated CTA copy:',c)}var q=!1;function sch(){if(q)return;q=!0;requestAnimationFrame(function(){q=!1;run()})}function h(m){var o=history[m];typeof o=='function'&&(history[m]=function(){var v=o.apply(this,arguments);sch();setTimeout(sch,100);setTimeout(sch,500);return v})}function init(){if(!ok())return;sch();new MutationObserver(sch).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:A});h('pushState');h('replaceState');['popstate','pageshow','load','scroll','resize'].forEach(function(e){addEventListener(e,sch,{passive:!0})});setInterval(sch,1000)}document.readyState==='loading'?document.addEventListener('DOMContentLoaded',init):init()})(); 975}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5481043791183872", "endOfRange": 5000}, {"entityId": "6017431183818752", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4907611634532352"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5787331129507840"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4911731179257856", "name": null, "commitId": "5692941841203200", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5157975076110336", "integrationSettings": null, "variations": [{"id": "6370093022576640", "name": null, "actions": [{"viewId": "4595025122689024", "changes": []}]}, {"id": "6505892848336896", "name": null, "actions": [{"viewId": "4595025122689024", "changes": [{"id": "6DC1DF9E-4B2E-4C62-83E2-1D316B16AD1D", "type": "append", "dependencies": [], "name": "", "isOpalManaged": true, "selector": "head", "value": "<style>/* Added via Opal */\n[data-cy='form'] > div:nth-of-type(1) { display: none !important; }\n[data-cy='form'] > fieldset:nth-of-type(1) { margin-top: 0 !important; }</style>"}]}]}], "weightDistributions": [{"entityId": "6370093022576640", "endOfRange": 5000}, {"entityId": "6505892848336896", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4911731179257856"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4595025122689024"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4913628516712448", "name": null, "commitId": "5295267633692672", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6271745259208704", "integrationSettings": null, "variations": [{"id": "5323382120513536", "name": null, "actions": [{"viewId": "5886332073934848", "changes": [{"id": "6f5a804eb97f4d4f985d41e4b3a4ce95", "type": "custom_code", "value": function($){const loadOri = (url, suppresstrigger, shownotification, async = true) => { 976 const scriptEle = document.createElement("script"); 977 scriptEle.setAttribute("src", url); 978 scriptEle.setAttribute("type", "text/javascript"); 979 scriptEle.setAttribute("async", async); 980 scriptEle.setAttribute("suppresstrigger", suppresstrigger); 981 scriptEle.setAttribute("shownotification", shownotification); 982 scriptEle.setAttribute("id", "ori-chatbot"); 983 document.body.appendChild(scriptEle); 984 scriptEle.addEventListener("error", (ev) => { 985 console.log("Error loading Ori bot file"); 986 }); 987}; 988 989 990loadOri( 991 "https://ef-enterprise.oriserve.com/chatbot/static/js/ef-enterpriseprod.js", 992 true, 993 false 994); 995}, "dependencies": []}]}]}
995, {"id": "5423810904588288", "name": null, "actions": [{"viewId": "5886332073934848", "changes": [{"id": "41fdfcdcf7e642e488b8a3025c3affbb", "src": "/actions/537dd0b6bd7ba6fc9b4122393a9cc417cf38be8d111c293514a36ce54bd47baf.js", "dependencies": [], "type": "custom_code"}, {"id": "602d46743b4c481d840608bb384115b6", "type": "append", "selector": "head", "value": "<style>button[data-cy=\"gudl-chat-button\"] {\n width: 0 !important;\n height: 0 !important;\n color: transparent !important;\n background: transparent !important;\n border: none !important;\n pointer-events: none !important;\n}\n\nbutton[data-cy=\"gudl-chat-button\"] {\n visibility: hidden !important;\n}\n\n#chatbase-bubble-button {\n width: 1px !important;\n height: 1px !important;\n opacity: 0 !important;\n pointer-events: none !important;\n overflow: hidden !important;\n position: absolute !important;\n z-index: -1 !important;\n}</style>", "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5423810904588288", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4913628516712448"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5886332073934848"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4949896627748864", "name": null, "commitId": "4773974767304704", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5222193645223936", "integrationSettings": null, "variations": [{"id": "6700591651487744", "name": null, "actions": []}, {"id": "5270590880219136", "name": null, "actions": [{"viewId": "5942710849241088", "changes": [{"id": "4acc1e7a0afd4e849e549a77430abd0f", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": true, "dest": "https://www.ef.com.ec/cp/brochure/v2/", "preserveParameters": true}]}]}], "weightDistributions": [{"entityId": "6700591651487744", "endOfRange": 5000}, {"entityId": "5270590880219136", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4949896627748864"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5942710849241088"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4974407882375168", "name": null, "commitId": "5078151005470720", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "27831550777"], "audienceName": null, "changes": null, "id": "6655196458123264", "integrationSettings": null, "variations": [{"id": "5006602957225984", "name": null, "actions": [{"viewId": "5214616813305856", "changes": []}]}, {"id": "4870343307821056", "name": null, "actions": [{"viewId": "5214616813305856", "changes": [{"id": "360ada2de40346cea84d2a071ff69a0e", "type": "custom_code", "value": function($){var redirects = { 996 "https://www.ef.edu.pt/cc/destinations/ireland/dublin": "https://www.ef.edu.pt/cc/pad/dublin/", 997 "https://www.ef.com.br/cc/destinations/malta": "https://www.ef.com.br/cc/pad/malta/", 998 "https://www.ef.nl/cc/destinations/korea/seoul": "https://www.ef.nl/cc/pad/seoul/", 999 "https://www.ef.de/cc/destinations/japan/tokyo": "https://www.ef.de/cc/pad/tokyo/", 1000 "https://www.ef.de/cc/destinations/korea/seoul": "https://www.ef.de/cc/pad/seoul/", 1001 "https://www.ef.com.tr/cc/destinations/malta": "https://www.ef.com.tr/cc/pad/malta/", 1002 "https://www.ef.com.mx/cc/destinations/united-states/new-york": "https://www.ef.com.mx/cc/pad/new-york/", 1003 "https://www.ef.fr/cc/destinations/united-states/miami-beach": "https://www.ef.fr/cc/pad/miami/" 1004}; 1005 1006var currentUrl = (window.location.origin + window.location.pathname).replace(/\/+$/, ""); 1007var targetUrl = redirects[currentUrl]; 1008 1009if (targetUrl) { 1010 window.location.replace(targetUrl + (window.location.search || "")); 1011} 1012}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5006602957225984", "endOfRange": 5000}, {"entityId": "4870343307821056", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4974407882375168"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5214616813305856"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4974900585168896", "name": null, "commitId": "5764071079804928", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6317608964718592", "integrationSettings": null, "variations": [{"id": "6390792707637248", "name": null, "actions": []}, {"id": "5869509641240576", "name": null, "actions": [{"viewId": "5754659011297280", "changes": [{"id": "248c3dd7e2474667a0c0eb16db38f7e8", "type": "redirect", "depen
1012dencies": [], "isOpalManaged": false, "allowAdditionalRedirect": true, "dest": "https://www.ef.fr/cp/brochure/v2/", "preserveParameters": true}]}]}], "weightDistributions": [{"entityId": "6390792707637248", "endOfRange": 5000}, {"entityId": "5869509641240576", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4974900585168896"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5754659011297280"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4983902511562752", "name": null, "commitId": "5624522475307008", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6495389080092672", "integrationSettings": null, "variations": [{"id": "5049282517008384", "name": null, "actions": [{"viewId": "5906294184345600", "changes": []}]}, {"id": "4591397462867968", "name": null, "actions": [{"viewId": "5906294184345600", "changes": [{"id": "372f8965b5b34e0b8ba0165d6d2c7cba", "type": "custom_code", "value": function($){// inject last spots 1013var EXPERIMENT_ID = "optly-faplatserkvar"; 1014var MAX_TRIPS = 6; 1015var BUTTON_TEXT = "Entdecke unsere Gruppenreisen"; 1016var LAST_SPOTS_HEADER = "Limitierte Plätze verfügbar"; 1017var JUNO_MARKET_CODE = "deb"; 1018console.log("LTONB: Experiment script started version DEB.20260722.1"); 1019 1020function normalizeLtPath(path) { 1021 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 1022 if (match) return match[1] + "/"; 1023 return path; 1024} 1025 1026function fetchLastSpots() { 1027 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 1028 .then(function (response) { 1029 if (!response.ok) { 1030 throw new Error("Network response was not ok"); 1031 } 1032 return response.json(); 1033 }) 1034 .then(function (data) { 1035 var items = Array.isArray(data) 1036 ? data 1037 : Array.isArray(data && data.items) 1038 ? data.items 1039 : Array.isArray(data && data.trips) 1040 ? data.trips 1041 : null; 1042 1043 if (!items) { 1044 throw new Error("Expected trips in response payload"); 1045 } 1046 1047 var today = new Date(); 1048 today.setHours(0, 0, 0, 0); 1049 var availableTrips = items 1050 .map(function (trip) { 1051 var availableDeparture = (trip.availabilities || []) 1052 .filter(function (availability) { 1053 var startDate = new Date(availability.startDate + "T00:00:00"); 1054 return availability.availableSpots >= 1 && startDate >= today; 1055 }) 1056 .sort(function (a, b) { 1057 return a.availableSpots - b.availableSpots || a.price - b.price; 1058 })[0]; 1059 1060 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 1061 }) 1062 .filter(Boolean); 1063 1064 availableTrips.sort(function (a, b) { 1065 return a.availableSpots - b.availableSpots || a.price - b.price; 1066 }); 1067 1068 return availableTrips.slice(0, MAX_TRIPS); 1069 }) 1070 .catch(function (error) { 1071 console.error("There was a problem with the fetch operation:", error); 1072 return []; 1073 }); 1074} 1075 1076function escapeHtml(value) { 1077 return String(value) 1078 .replace(/&/g, "&") 1079 .replace(/</g, "<") 1080 .replace(/>/g, ">") 1081 .replace(/"/g, """) 1082 .replace(/'/g, "'"); 1083} 1084 1085function formatCurrency(amount, currency, locale) { 1086 if (typeof amount !== "number" || !currency) return ""; 1087 try { 1088 return new Intl.NumberFormat(locale, { 1089 style: "currency", 1090 currency: currency, 1091 currencyDisplay: "symbol", 1092 minimumFractionDigits: 0, 1093 maximumFractionDigits: 2 1094 }).format(amount); 1095 } catch (error) { 1096 console.warn("Could not format currency", error); 1097 return String(amount); 1098 } 1099} 1100 1101function getLocale() { 1102 return document.documentElement.lang || navigator.language || "sv-SE"; 1103} 1104 1105function renderTripCard(trip, locale) { 1106 var title = escapeHtml(trip && trip.title ? trip.title : ""); 1107 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 1108 var image = 1109 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 1110 var currency = trip && trip.currency ? trip.currency : ""; 1111 var originalAmount = 1112 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 1113 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 1114 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 1115 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 1116 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 1117 1118 return ( 1119 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 1120 href + 1121 '">' + 1122 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 1123 '<div class="flex w-full items-center">' + 1124 (image 1125 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 1126 title + 1127 '" src="' + 1128 image + 1129 '" width="100%" height="100%"></div>' 1130 : "") + 1131 '<div class="flex w-full items-center justify-between px-2">' + 1132 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 1133 title + 1134 "</span></p>" + 1135 '<div class="flex shrink-0 items-center gap-1">' + 1136 (originalAmount > discountedAmount 1137 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 1138 originalPrice + 1139 "</span></p>" 1140 : "") + 1141 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 1142 discountedPrice + 1143 "</span></p>" + 1144 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
1144' + 1145 "</div>" + 1146 "</div>" + 1147 "</div>" + 1148 "</div>" + 1149 "</a>" 1150 ); 1151} 1152 1153function onElementVisible(selector, callback) { 1154 var seen = new WeakMap(); 1155 1156 function isVisible(el) { 1157 var style = getComputedStyle(el); 1158 return ( 1159 style.display !== "none" && 1160 style.visibility !== "hidden" && 1161 style.opacity !== "0" && 1162 el.offsetParent !== null 1163 ); 1164 } 1165 1166 function check() { 1167 document.querySelectorAll(selector).forEach((el) => { 1168 var visible = isVisible(el); 1169 var prev = seen.get(el); 1170 1171 // Trigger only when it becomes visible (false â true) 1172 if (visible && !prev) { 1173 console.log("LTONB: Element became visible for selector '" + selector + "'"); 1174 callback(el); 1175 } 1176 1177 seen.set(el, visible); 1178 }); 1179 } 1180 1181 // Initial check 1182 check(); 1183 1184 var observer = new MutationObserver(check); 1185 1186 observer.observe(document.body, { 1187 childList: true, 1188 subtree: true, 1189 attributes: true, 1190 attributeFilter: ["style", "class", "hidden"] 1191 }); 1192 1193 return observer; // so you can disconnect() later if needed 1194} 1195 1196function replaceHTML(target, trips) { 1197 if (document.getElementById(EXPERIMENT_ID)) return; 1198 if (!trips || !trips.length) { 1199 console.warn("LTONB: No trips returned for replacement"); 1200 return; 1201 } 1202 if (!target) { 1203 console.warn("LTONB: Target element not available for replacement"); 1204 return; 1205 } 1206 1207 var locale = getLocale(); 1208 var cardsHtml = trips 1209 .map(function (trip) { 1210 return renderTripCard(trip, locale); 1211 }) 1212 .join(""); 1213 1214 var wrapper = document.createElement("div"); 1215 wrapper.id = EXPERIMENT_ID; 1216 1217 wrapper.innerHTML = ` 1218 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 1219 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 1220 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 1221 ${cardsHtml} 1222 </div> 1223 </div> 1224 </section> 1225 `; 1226 1227 target.replaceWith(wrapper); 1228} 1229 1230function replaceText(node, newText) { 1231 if (node.nodeType === Node.TEXT_NODE) { 1232 node.textContent = newText; 1233 } else { 1234 node.childNodes.forEach((child) => replaceText(child, newText)); 1235 } 1236} 1237 1238function updateHero() { 1239 // hide original hero 1240 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 1241 if (hero) { 1242 hero.style.setProperty("display", "none", "important"); 1243 } else { 1244 console.warn("LTONB: Original hero element not found"); 1245 } 1246 1247 // show test hero 1248 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 1249 if (testHero) { 1250 testHero.style.setProperty("display", "block", "important"); 1251 testHero.style.setProperty("visibility", "visible", "important"); 1252 testHero.style.setProperty("opacity", "1", "important"); 1253 testHero.removeAttribute("hidden"); 1254 testHero.classList.remove("hidden"); 1255 } else { 1256 console.warn("LTONB: Test hero element not found"); 1257 } 1258} 1259 1260function updateHeroButton() { 1261 var testHeroOffersButton = document.querySelector( 1262 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 1263 ); 1264 if (testHeroOffersButton) { 1265 replaceText(testHeroOffersButton, BUTTON_TEXT); 1266 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 1267 } else { 1268 console.warn("LTONB: Offers button in test hero not found"); 1269 } 1270} 1271 1272function updatePromotionsCarousel(target, trips) { 1273 var element = document.querySelector(target); 1274 var headerElement = document.querySelector( 1275 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 1276 ); 1277 if (headerElement && element) { 1278 replaceText(headerElement, LAST_SPOTS_HEADER); 1279 replaceHTML(element, trips); 1280 } 1281} 1282 1283onElementVisible('[data-cy="promotions-carousel-container"]', function () { 1284 fetchLastSpots().then(function (trips) { 1285 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 1286 }); 1287}); 1288 1289onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 1290 updateHeroButton(); 1291}); 1292 1293onElementVisible('#hero, .hero, [data-component="hero"]', function () { 1294 updateHero(); 1295}); 1296}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5049282517008384", "endOfRange": 1000}, {"entityId": "4591397462867968", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4983902511562752"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5906294184345600"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "4987948362366976", "name": null, "commitId": "6238357424963584", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "4886729002319872", "integrationSettings": null, "variations": [{"id": "5121916176957440", "name": null, "actions": [{"viewId": "6493935695036416", "changes": [{"id": "25eda22d3cd34f5c88768f56a2020c4a", "type": "custom_code", "value": function($){const loadOri = (url, suppresstrigger, shownotification, async = true) => { 1297 const scriptEle = document.createElement("script"); 1298 scriptEle.setAttribute("src", url); 1299 scriptEle.setAttribute("type", "text/javascript"); 1300 scriptEle.setAttribute("async", async); 1301 scriptEle.setAttribute("suppresstrigger", suppresstrigger); 1302 scriptEle.setAttribute("shownotification", shownotification); 1303 scriptEle.setAttribute("id", "ori-chatbot"); 1304 document.body.appendChild(scriptEle); 1305 scriptEle.addEventListener("error", (ev) => { 1306 console.log("Error loading Ori bot file"); 1307 }); 1308}; 1309 1310 1311loadOri( 1312 "https://ef-enterprise.oriserve.com/chatbot/static/js/ef-enterpriseprod.js", 1313 true, 1314 false 1315); 1316}, "dependencies": []}]}]}, {"id": "6113848269209600", "name": null, "actions": [{"viewId": "6493935695036416", "changes": [{"id": "6DD35AB5-0F71-4AFE-AF4B-9D6D08125459", "type": "custom_code", "value": function($){(function () { 1317 "use strict"; 1318 1319 /* ================== Config ================== */ 1320 var CHATBOT_ID = "MirzcSzS6QSU6yLH8OCdz"; 1321 1322 /* ===== BlueConic keys ===== */ 1323 var BLUECONIC_PROFILE_KEYS = { 1324 destinationCode: "destinationcode_interests_top_",
1325 productCode: "Product_interests_top", 1326 courseCode: "coursecode_top", 1327 countryCode: "countrycode_top" 1328 }; 1329 1330 /* ===== Chatbase pre-config ===== */ 1331 window.chatbaseConfig = { showFloatingInitialMessages: false }; 1332 1333 /* ================= Helpers ================= */ 1334 function chatbaseReady() { 1335 try { 1336 return typeof window.chatbase === "function" && 1337 window.chatbase("getState") !== "uninitialized"; 1338 } catch (_e) { return false; } 1339 } 1340 1341 function getBlueConicProfile() { 1342 try { 1343 if (window.blueConicClient && 1344 window.blueConicClient.profile && 1345 typeof window.blueConicClient.profile.getProfile === "function") { 1346 return window.blueConicClient.profile.getProfile(); 1347 } 1348 } catch (_e) {} 1349 return null; 1350 } 1351 1352 function readBlueConic(metaOut) { 1353 var p = getBlueConicProfile(); 1354 if (!p) { return false; } 1355 try { metaOut.destinationCode = p.getValue(BLUECONIC_PROFILE_KEYS.destinationCode) || ""; } catch (_e) {} 1356 try { metaOut.productCode = p.getValue(BLUECONIC_PROFILE_KEYS.productCode) || ""; } catch (_e) {} 1357 try { metaOut.courseCode = p.getValue(BLUECONIC_PROFILE_KEYS.courseCode) || ""; } catch (_e) {} 1358 try { metaOut.countryCode = p.getValue(BLUECONIC_PROFILE_KEYS.countryCode) || ""; } catch (_e) {} 1359 return true; 1360 } 1361 1362 function getOptimizelyEndUserId() { 1363 try { 1364 var direct = localStorage.getItem("profile.visitorId"); 1365 if (direct) { 1366 try { 1367 var pd = JSON.parse(direct); 1368 if (pd && typeof pd === "object") { 1369 if (pd.endUserId) return String(pd.endUserId); 1370 if (pd.value) return String(pd.value); 1371 if (pd.id) return String(pd.id); 1372 } 1373 } catch (_ignore) {} 1374 return String(direct); 1375 } 1376 for (var i = 0; i < localStorage.length; i++) { 1377 var k = localStorage.key(i); 1378 if (k && k.indexOf("$visitor_profile") !== -1) { 1379 var v = localStorage.getItem(k); 1380 if (!v) continue; 1381 try { 1382 var obj = JSON.parse(v); 1383 if (obj) { 1384 if (obj.profile && obj.profile.visitorId) return String(obj.profile.visitorId); 1385 if (obj.visitorId) return String(obj.visitorId); 1386 } 1387 } catch (_e) {} 1388 } 1389 } 1390 } catch (_e) {} 1391 return ""; 1392 } 1393 1394 function bestGuessDL() { 1395 if (window.dl) return window.dl; 1396 if (window.dataLayer && window.dataLayer.length) { 1397 for (var i = window.dataLayer.length - 1; i >= 0; i--) { 1398 var it = window.dataLayer[i]; 1399 if (it && it.channel && it.channel.utm) return it; 1400 } 1401 } 1402 return null; 1403 } 1404 1405 function extractUtmFromDl(dl) { 1406 var utm = { source: "(direct)", medium: "(none)", content: "noref" }; 1407 try { 1408 if (dl && dl.channel && dl.channel.utm && dl.channel.utm[0]) { 1409 var u = dl.channel.utm[0]; 1410 if (u.source) utm.source = String(u.source); 1411 if (u.medium) utm.medium = String(u.medium); 1412 if (u.content) utm.content = String(u.content); 1413 } 1414 } catch (_e) {} 1415 return utm; 1416 } 1417 1418 function fetchEfPartnersSourceCode(utm, cb) { 1419 var xhr = new XMLHttpRequest(); 1420 xhr.open("POST", "https://www.ef.fr/utm2efpartners/getefpartners/", true); 1421 xhr.setRequestHeader("Content-Type", "application/json"); 1422 xhr.onreadystatechange = function () { 1423 if (xhr.readyState !== 4) return; 1424 if (xhr.status >= 200 && xhr.status < 300) { 1425 try { 1426 var data = JSON.parse(xhr.responseText); 1427 if (data && data.status === "Success" && data.result) { 1428 return cb(null, { 1429 sourceCode: data.result.sourceCode || "", 1430 eTag: data.result.eTag || "" 1431 }); 1432 } 1433 } catch (_ignore) {} 1434 return cb(null, { sourceCode: "", eTag: "" }); 1435 } 1436 cb(null, { sourceCode: "", eTag: "" }); // non-fatal 1437 }; 1438 try { 1439 xhr.send(JSON.stringify({ 1440 source: utm.source, medium: utm.medium, content: utm.content 1441 })); 1442 } catch (_e) { cb(null, { sourceCode: "", eTag: "" }); } 1443 } 1444 1445 /* =============== One-shot identify coordinator =============== */ 1446 var meta = { 1447 destinationCode: "",
1448 productCode: "", 1449 courseCode: "", 1450 countryCode: "", 1451 optimizelyEndUserId: "", 1452 sourceCode: "", 1453 eTag: "", 1454 lineUserId: "" // LIFF user id (optional) 1455 }; 1456 1457 var gotBlueConic = false; 1458 var gotPartners = false; 1459 var gotLiff = false; 1460 var sentOnce = false; 1461 1462 function maybeSendOnce(tag) { 1463 if (sentOnce) return; 1464 if (!chatbaseReady()) return; 1465 1466 // PROCEED even if Optimizely is missing (we still include it if found) 1467 if (!gotBlueConic || !gotPartners || !gotLiff) return; 1468 1469 try { 1470 window.chatbase("identify", { user_metadata: meta }); 1471 sentOnce = true; 1472 console.log("ð¦ user_metadata sent:", meta, "tag:", tag); 1473 } catch (e) { 1474 console.warn("â identify failed:", e); 1475 } 1476 } 1477 1478 /* ===== ORI detection ===== */ 1479 function getOriStickyParent() { 1480 return document.querySelector('[data-clicksubregion="sticky"]'); 1481 } 1482 1483 function ensureCustomChatButtonForOri() { 1484 var stickyParent = getOriStickyParent(); 1485 if (!stickyParent || !stickyParent.firstElementChild) return false; 1486 1487 var buttonGroup = stickyParent.firstElementChild; 1488 var anchors = buttonGroup.getElementsByTagName("a"); 1489 if (!anchors.length) return false; 1490 1491 var firstAnchor = anchors[0]; 1492 if (!firstAnchor) return false; 1493 1494 var existingBtn = document.getElementById("custom-chatbase-button"); 1495 if (existingBtn) { 1496 if (firstAnchor.nextSibling !== existingBtn) { 1497 buttonGroup.insertBefore(existingBtn, firstAnchor.nextSibling); 1498 } 1499 } else { 1500 var customBtn = document.createElement("button"); 1501 customBtn.setAttribute("aria-label", "chatbase-custom-button"); 1502 customBtn.setAttribute("id", "custom-chatbase-button"); 1503 customBtn.setAttribute("type", "button"); 1504 customBtn.className = "md:order-4"; 1505 customBtn.style.cssText = 1506 "background: transparent; border: none; cursor: pointer; display: flex;" + 1507 "align-items: center; justify-content: center; width: 48px; height: 48px;" + 1508 "padding: 0px; margin-left: 10px;"; 1509 1510 var img = document.createElement("img"); 1511 img.src = "https://storage.googleapis.com/analytics_tactical/digital_factory/ori-chat-button.svg"; 1512 img.alt = "Chat"; 1513 img.width = 48; 1514 img.height = 48; 1515 customBtn.appendChild(img); 1516 1517 buttonGroup.insertBefore(customBtn, firstAnchor.nextSibling); 1518 1519 customBtn.addEventListener("click", function () { 1520 var realChatBtn = document.getElementById("chatbase-bubble-button"); 1521 if (realChatBtn && typeof realChatBtn.click === "function") { 1522 realChatBtn.click(); 1523 } else { 1524 console.warn("â ï¸ Chatbase bubble not found"); 1525 } 1526 }); 1527 } 1528 return true; 1529 } 1530 1531 /* Prefer MutationObserver over polling on ORI pages */ 1532 function observeOriArea() { 1533 var parent = getOriStickyParent(); 1534 if (!parent) return; 1535 1536 // Make sure the button is present once immediately 1537 ensureCustomChatButtonForOri(); 1538 1539 try { 1540 var mo = new MutationObserver(function () { 1541 ensureCustomChatButtonForOri(); 1542 }); 1543 mo.observe(parent, { childList: true, subtree: true }); 1544 } catch (_e) { 1545 // Fallback: minimal polling if observer not supported 1546 var iv = setInterval(ensureCustomChatButtonForOri, 1000); 1547 setTimeout(function () { clearInterval(iv); }, 30000); // cap 1548 } 1549 } 1550 1551 /* ===== Landing pages: auto-open bubble once ===== */ 1552 var autoOpenedOnce = false; 1553 function autoOpenDefaultBubbleWhenReady() { 1554 if (autoOpenedOnce) return; 1555 var tries = 0, maxTries = 40; // ~20s 1556 var iv = setInterval(function () { 1557 tries++; 1558 var btn = document.getElementById("chatbase-bubble-button"); 1559 if (btn && typeof btn.click === "function") { 1560 try { btn.click(); } catch (_e) {} 1561 autoOpenedOnce = true; 1562 clearInterval(iv); 1563 } else if (tries >= maxTries) { 1564 clearInterval(iv); 1565 } 1566 }, 500); 1567 } 1568 1569 /* ===== Load Chatbase ===== */ 1570 var script = document.createElement("script"); 1571 script.src = "https://www.chatbase.co/embed.min.js"; 1572 script.defer = true; 1573 script.setAttribute("chatbotId", CHATBOT_ID); 1574 script.setAttribute("domain", "www.chatbase.co"); 1575 1576 script.onload = function () { 1577 var hasOri = !!getOriStickyParent(); 1578 1579 if (hasOri) { 1580 // Hide native bubble; weâll show our custom button next to ORI 1581 var style = document.createElement("style"); 1582 style.innerHTML = "#chatbase-bubble-button { " + 1583 "position: absolute !important;" + 1584 "width: 1px !important;" + 1585 "height: 1px !important;" + 1586 "opacity: 0 !important;" + 1587 "pointer-events: none !important;" + 1588 "overflow: hidden !important;" + 1589 "z-index: -1 !important;" + 1590 "}"; 1591 document.head.appendChild(style); 1592 observeOriArea(); 1593 } else { 1594 // Landing pages: keep default bubble and auto-open it 1595 autoOpenDefaultBubbleWhenReady(); 1596 } 1597 1598 /* ------- Collect ALL metadata, then send ONCE ------- */ 1599 // Optimizely (optional) 1600 meta.optimizelyEndUserId = getOptimizelyEndUserId(); 1601
1602 // BlueConic (retry until available or timeout) 1603 (function waitBlueConic() { 1604 var tries = 0, t = setInterval(function () { 1605 tries++; 1606 if (readBlueConic(meta)) { 1607 gotBlueConic = true; 1608 clearInterval(t); 1609 maybeSendOnce("blueconic"); 1610 } else if (tries >= 12) { // ~6s 1611 clearInterval(t); 1612 gotBlueConic = true; // proceed even if empty 1613 console.warn("â ï¸ BlueConic not ready; proceeding without it."); 1614 maybeSendOnce("blueconic-timeout"); 1615 } 1616 }, 500); 1617 })(); 1618 1619 // EF Partners (async; non-fatal) 1620 var utm = extractUtmFromDl(bestGuessDL()); 1621 fetchEfPartnersSourceCode(utm, function (err, result) { 1622 if (!err && result) { 1623 meta.sourceCode = result.sourceCode || ""; 1624 meta.eTag = result.eTag || ""; 1625 } 1626 gotPartners = true; 1627 maybeSendOnce("partners"); 1628 }); 1629 1630 // LIFF (non-invasive): read if app already initialized it 1631 (function collectLiffIdIfAvailable() { 1632 var start = Date.now(); 1633 var MAX_WAIT_MS = 6000, POLL_EVERY = 250; 1634 var timer = setInterval(function () { 1635 var elapsed = Date.now() - start; 1636 var l = window.liff; 1637 1638 if (elapsed >= MAX_WAIT_MS) { 1639 clearInterval(timer); 1640 gotLiff = true; // continue without LIFF 1641 meta.lineUserId = ""; 1642 console.warn("â ï¸ LIFF not available in time; continuing without lineUserId."); 1643 maybeSendOnce("liff-timeout"); 1644 return; 1645 } 1646 if (!l || typeof l.getProfile !== "function") return; 1647 1648 clearInterval(timer); 1649 try { 1650 if (typeof l.isLoggedIn === "function" && l.isLoggedIn()) { 1651 l.getProfile() 1652 .then(function (profile) { 1653 meta.lineUserId = (profile && profile.userId) ? String(profile.userId) : ""; 1654 }) 1655 .catch(function (err) { 1656 console.warn("LIFF getProfile error:", err && err.message ? err.message : err); 1657 meta.lineUserId = ""; 1658 }) 1659 .finally(function () { 1660 gotLiff = true; 1661 maybeSendOnce(meta.lineUserId ? "liff-ok" : "liff-empty"); 1662 }); 1663 } else { 1664 gotLiff = true; 1665 meta.lineUserId = ""; 1666 console.log("â¹ï¸ LIFF present but user not logged in; sending without lineUserId."); 1667 maybeSendOnce("liff-not-logged"); 1668 } 1669 } catch (e) { 1670 gotLiff = true; 1671 meta.lineUserId = ""; 1672 console.warn("LIFF access failed:", e); 1673 maybeSendOnce("liff-catch"); 1674 } 1675 }, POLL_EVERY); 1676 })(); 1677 1678 // Safety cap to avoid deadlocks 1679 setTimeout(function () { maybeSendOnce("hard-cap"); }, 10000); 1680 1681 /* ----- SPA nav: keep UI behavior, no re-identify ----- */ 1682 (function patchHistoryForSpaEvents() { 1683 var pushState = history.pushState; 1684 var replaceState = history.replaceState; 1685 1686 history.pushState = function () { 1687 var ret = pushState.apply(history, arguments); 1688 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 1689 return ret; 1690 }; 1691 history.replaceState = function () { 1692 var ret = replaceState.apply(history, arguments); 1693 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 1694 return ret; 1695 }; 1696 window.addEventListener("popstate", function () { 1697 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 1698 }); 1699 1700 window.addEventListener("spa:navigation", function () { 1701 setTimeout(function () { 1702 if (hasOri) { 1703 ensureCustomChatButtonForOri(); 1704 } else { 1705 autoOpenDefaultBubbleWhenReady(); 1706 } 1707 }, 150); 1708 }); 1709 })(); 1710 }; 1711 1712 if (document.readyState === "complete") { 1713 document.body.appendChild(script); 1714 } else { 1715 window.addEventListener("load", function () { 1716 document.body.appendChild(script); 1717 }); 1718 } 1719})(); 1720}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "6113848269209600", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "4987948362366976"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6493935695036416"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5046701124222976", "name": null, "commitId": "6639736444420096", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "26158870391"], "audienceName": null, "changes": null, "id": "6010285794787328", "integrationSettings": null, "variations": [{"id": "5346281334243328", "name": null, "actions": [{"viewId": "5847807953731584", "changes": []}]}, {"id": "4709397813788672", "name": null, "actions": [{"viewId": "5847807953731584", "changes": [{"id": "ae43bd3f25fa41169b0e559484d637aa", "type": "redirect", "depen
1720dencies": [], "dest": "https://www.ef.se/cc/discover/study-and-work-abroad/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "5346281334243328", "endOfRange": 5000}, {"entityId": "4709397813788672", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5046701124222976"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5847807953731584"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5066733210304512", "name": null, "commitId": "6714295566729216", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6323794556485632"], "audienceName": null, "changes": null, "id": "6192633117147136", "integrationSettings": null, "variations": [{"id": "4785258233593856", "name": null, "actions": []}, {"id": "4875349467594752", "name": null, "actions": [{"viewId": "4601302586490880", "changes": [{"id": "df4c13a3f27f476a90df7e61fc0ec561", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": false, "preserveParameters": false, "dest": function redirectFn() { 1721document.cookie = "multipg_visit=true; Path=/; SameSite=Lax; Secure"; 1722return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search; 1723} 1724}]}]}], "weightDistributions": [{"entityId": "4785258233593856", "endOfRange": 5000}, {"entityId": "4875349467594752", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5066733210304512"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4601302586490880"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5122236485468160", "name": null, "commitId": "5337219731292160", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6323794556485632"], "audienceName": null, "changes": null, "id": "6248136392310784", "integrationSettings": null, "variations": [{"id": "4794360611471360", "name": null, "actions": []}, {"id": "5770660633378816", "name": null, "actions": [{"viewId": "4552820240678912", "changes": [{"id": "fb0c7e4b3711441099fdf3cdc523ef38", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": false, "preserveParameters": false, "dest": function redirectFn() { 1725document.cookie = "multipg_visit=true; Path=/; SameSite=Lax; Secure"; 1726return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search; 1727} 1728}]}]}], "weightDistributions": [{"entityId": "4794360611471360", "endOfRange": 5000}, {"entityId": "5770660633378816", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5122236485468160"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4552820240678912"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5129646891597824", "name": null, "commitId": "5206092846727168", "groupId": null, "holdback": 10000, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5303473009328128"], "audienceName": null, "changes": null, "id": "5522059330060288", "integrationSettings": null, "variations": [{"id": "5495113216950272", "name": null, "actions": [{"viewId": "5236246948085760", "changes": []}]}, {"id": "5616733965254656", "name": null, "actions": [{"viewId": "5236246948085760", "changes": [{"id": "79cc0e5dc4db4e749e6651b052cf3b4e", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.tr/cc/test/language-abroad_all_generic_ilc_x_dest/", "preserveParameters": true, "allowAdditionalRedirect": false, "isOpalManaged": false}]}]}], "weightDistributions": [{"entityId": "5495113216950272", "endOfRange": 5000}, {"entityId": "5616733965254656", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5129646891597824"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5236246948085760"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5139203820879872", "name": null, "commitId": "5303560257142784", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "4860575669288960", "integrationSettings": null, "variations": [{"id": "5827162136117248", "name": null, "actions": []}, {"id": "5079526709919744", "name": null, "actions": [{"viewId": "5705322503864320", "changes": [{"id": "0f461dba5ea84f71b7f70f3e0c535553", "type": "redirect", "depen
1728dencies": [], "isOpalManaged": false, "allowAdditionalRedirect": true, "dest": "https://www.ef.com.tr/cp/brochure/v2/", "preserveParameters": true}]}]}], "weightDistributions": [{"entityId": "5827162136117248", "endOfRange": 5000}, {"entityId": "5079526709919744", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5139203820879872"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5705322503864320"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5181897031024640", "name": null, "commitId": "6202580848607232", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5449439335153664"], "audienceName": null, "changes": null, "id": "6402387821199360", "integrationSettings": null, "variations": [{"id": "4995012937646080", "name": null, "actions": [{"viewId": "4970790798491648", "changes": []}]}, {"id": "4800898333933568", "name": null, "actions": [{"viewId": "4970790798491648", "changes": [{"id": "78080a760c6b419487c07f2ba796f340", "src": "/actions/d0e158cac7769c942655e41e0b182afc2a02813883f0f12d9c3f7603e3df4822.js", "dependencies": [], "type": "custom_code"}]}]}], "weightDistributions": [{"entityId": "4800898333933568", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5181897031024640"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4970790798491648"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5194036554760192", "name": null, "commitId": "5727919383773184", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "27831550777"], "audienceName": null, "changes": null, "id": "6487225773326336", "integrationSettings": null, "variations": [{"id": "4559211940544512", "name": null, "actions": [{"viewId": "5182927091269632", "changes": []}]}, {"id": "5856180394786816", "name": null, "actions": [{"viewId": "5182927091269632", "changes": [{"id": "9d7a92bf18fe4134ae400d46dc12db69", "src": "/actions/cc2b379803587467231a1063b454d5824357592bff957235748fffec34fabad6.js", "dependencies": [], "type": "custom_code"}, {"id": "ab9485749b1f4d8695d135c876a78bdb", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.mx/cc/test/brochure-advisorcall/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "4559211940544512", "endOfRange": 5000}, {"entityId": "5856180394786816", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5194036554760192"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5182927091269632"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5201210230177792", "name": null, "commitId": "5346586954301440", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6496950323773440"], "audienceName": null, "changes": null, "id": "5876192660684800", "integrationSettings": null, "variations": [{"id": "6247339508105216", "name": null, "actions": [{"viewId": "4750292753842176", "changes": []}]}, {"id": "4718020101144576", "name": null, "actions": [{"viewId": "4750292753842176", "changes": [{"id": "03c11d327f9140ebaa6bc477a174d6b4", "type": "redirect", "dependencies": [], "dest": "https://www.ef.co.kr/cc/test-cons-bo/language-abroad/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "6247339508105216", "endOfRange": 5000}, {"entityId": "4718020101144576", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5201210230177792"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4750292753842176"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5235382634151936", "name": null, "commitId": "6594428381429760", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5449439335153664"], "audienceName": null, "changes": null, "id": "4994459530690560", "integrationSettings": null, "variations": [{"id": "4812064735100928", "name": null, "actions": []}, {"id": "5669082324795392", "name": null, "actions": [{"viewId": "5333480760934400", "changes": [{"id": "001F6334-7271-46D5-A37E-04D0C6424ABB", "type": "custom_code", "value": function($){(() => { 1729 window.__efHeaderExpObs && window.__efHeaderExpObs.disconnect(); 1730 let O = location.origin, 1731 P = location.pathname,
1732 B = P.split("/").filter(Boolean)[0] || "ils", 1733 I = T(P, "/ils"), 1734 Z = I || T(P, "/multi/packages"), 1735 u = O + "/multi/", 1736 G = "Packages", 1737 F0 = "/multi/results/", 1738 K = "ef_pkg_results_url", 1739 g = "data-ef-exp-pkg", 1740 h = "#cefcom-globalheader", 1741 p = '.ef-product-logo[data-clicklabel="global-header:site-header"]', 1742 m = 1743 '.ef-backpack-header .ef-menu-button[data-clicklabel="global-header:site-header"]', 1744 c = "ef-header-exp-css", 1745 q = 0, 1746 W = "", 1747 css = 1748 '#topbar-header a[data-info="open"][data-clicklabel="global-header:topbar"]{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}#cefcom-globalheader .ef-header-exp-mobile-menu{width:69px!important;min-width:69px!important;height:32px!important;min-height:32px!important;max-height:32px!important;aspect-ratio:auto!important;padding:0!important;border-radius:var(--item-radius,6px)!important;background:#191919!important;color:#fff!important;font-family:"EF Circular",Arial,sans-serif!important;font-weight:450!important;font-size:14px!important;line-height:20px!important;text-align:center!important}#cefcom-globalheader .ef-header-exp-mobile-menu .ef-button-bg{background:#191919!important;border-radius:inherit!important}#cefcom-globalheader .ef-header-exp-mobile-menu svg,#cefcom-globalheader .ef-header-exp-mobile-menu .ef-animated-chevron{display:none!important}#cefcom-globalheader .ef-header-exp-mobile-menu .pointer-events-none{gap:0!important}#cefcom-globalheader .ef-header-exp-menu-text{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:37px!important;height:20px!important;color:#fff!important;font-family:"EF Circular",Arial,sans-serif!important;font-weight:450!important;font-size:14px!important;line-height:20px!important;text-align:center!important}'; 1749 function T(s, b) { 1750 return s === b || s.indexOf(b + "/") === 0; 1751 } 1752 function Y(s) { 1753 if (!s || "/" !== s.charAt(0) || "/" === s.charAt(1)) return false; 1754 if (s.indexOf("#") > -1) return false; 1755 for (let i = 0; i < s.length; i++) if (s.charCodeAt(i) <= 32) return false; 1756 let n = s.indexOf("?"); 1757 return T((n > -1 ? s.slice(0, n) : s).toLowerCase(), "/multi/results"); 1758 } 1759 function A(e, n, v) { 1760 e.getAttribute(n) !== v && e.setAttribute(n, v); 1761 } 1762 function R(e) { 1763 e.getAttribute("href") !== u && ((e.href = u), e.setAttribute("href", u)); 1764 } 1765 function C() { 1766 if (!T(location.pathname.toLowerCase(), "/multi/results")) return; 1767 let s = location.pathname + location.search; 1768 if (s === W || !Y(s) || s.length > 1800) return; 1769 W = s; 1770 try { 1771 document.cookie = 1772 K + 1773 "=" + 1774 encodeURIComponent(s) + 1775 ";path=/;samesite=lax" + 1776 ("https:" === location.protocol ? ";secure" : ""); 1777 } catch (e) {} 1778 } 1779 function F() { 1780 try { 1781 let a = document.cookie ? document.cookie.split(";") : [], 1782 i, 1783 e, 1784 n, 1785 s; 1786 for (i = 0; i < a.length; i++) { 1787 e = a[i]; 1788 n = e.indexOf("="); 1789 if (n > 0 && e.slice(0, n).trim() === K) { 1790 s = decodeURIComponent(e.slice(n + 1).trim()); 1791 if (Y(s)) return O + s; 1792 break; 1793 } 1794 } 1795 } catch (e) {} 1796 return O + F0; 1797 } 1798 function D(r) { 1799 let l = r.querySelector("nav.ef-nav-list > ul > li"); 1800 return l ? l.querySelector("a.ef-nav-item-link") : null; 1801 } 1802 function M(r) { 1803 let l = r.querySelector("nav.ef-mobile-menu > ul > li"); 1804 return l ? l.querySelector('a.ef-nav-menu-item[role="menuitem"]') : null; 1805 } 1806 function w(n, s, t) { 1807 let a = Array.prototype.filter.call( 1808 n.querySelectorAll("span"), 1809 (e) => e.textContent.trim() === s && !e.querySelector("span") 1810 ); 1811 a.length ? a.forEach((e) => (e.textContent = t)) : (n.textContent = t); 1812 } 1813 function j(o) { 1814 let l = o.closest("li"); 1815 if (!l) return; 1816 let s = o.textContent.trim(); 1817 if (!s) return; 1818 let d = l.cloneNode(!0); 1819 d.setAttribute(g, "1"); 1820 let a = d.querySelector("a"); 1821 if (!a) return; 1822 let z = F(); 1823 a.href = z; 1824 a.setAttribute("href", z); 1825 a.setAttribute("aria-label", G); 1826 a.setAttribute("data-active", "false"); 1827 a.removeAttribute("target"); 1828 w(d, s, G); 1829 l.after(d); 1830 } 1831 function N(n, o) { 1832 if (!n || !o) return; 1833 let l = o.closest("li"); 1834 if (!l) return; 1835 let t = l.nextElementSibling; 1836 if (t && t.hasAttribute(g)) return; 1837 n.querySelectorAll("[" + g + "]").forEach((e) => e.remove()); 1838 j(o); 1839 } 1840 function k(r) { 1841 N(r.querySelector("nav.ef-nav-list"), D(r)); 1842 N(r.querySelector("nav.ef-mobile-menu"), M(r)); 1843 } 1844 function x() { 1845 C(); 1846 let r = document.querySelector(h); 1847 if (!r) return; 1848 r.querySelectorAll( 1849 '#topbar-header a[data-info="open"][data-clicklabel="global-header:topbar"]' 1850 ).forEach((e) => { 1851 let t = e.closest("div.absolute") || e.parentElement || e; 1852 t && t.remove(); 1853 });
1854 r.querySelectorAll( 1855 '#topbar-header a[data-info="ef-logo"][data-clicklabel="global-header:topbar"]' 1856 ).forEach(R); 1857 r.querySelectorAll(p).forEach((e) => { 1858 e.hasAttribute("href") && e.removeAttribute("href"); 1859 A(e, "aria-disabled", "true"); 1860 A(e, "tabindex", "-1"); 1861 "default" !== e.style.cursor && (e.style.cursor = "default"); 1862 }); 1863 r.querySelectorAll(m).forEach((e) => { 1864 e.classList.contains("ef-header-exp-mobile-menu") || 1865 e.classList.add("ef-header-exp-mobile-menu"); 1866 A(e, "aria-label", "Menu"); 1867 let t = e.querySelector(".pointer-events-none"); 1868 t && 1869 !t.querySelector(".ef-header-exp-menu-text") && 1870 t.insertAdjacentHTML( 1871 "beforeend", 1872 '<span class="ef-header-exp-menu-text">Menu</span>' 1873 ); 1874 }); 1875 Z && k(r); 1876 r.querySelectorAll( 1877 'button.ef-nav-menu-item[role="menuitem"][aria-label="Book now"]' 1878 ).forEach((e) => { 1879 let t = e.closest("li"); 1880 t && t.remove(); 1881 }); 1882 r.querySelectorAll( 1883 'a.ef-nav-menu-item[href="/' + 1884 B + 1885 '/"][role="menuitem"],a.ef-nav-menu-item[href="/ils/"][role="menuitem"]' 1886 ).forEach(R); 1887 [D(r), M(r)].forEach((e) => { 1888 e && R(e); 1889 }); 1890 } 1891 let S = document.getElementById(c); 1892 S 1893 ? (S.textContent = css) 1894 : ((S = document.createElement("style")), 1895 (S.id = c), 1896 (S.textContent = css), 1897 (document.head || document.documentElement).appendChild(S)); 1898 window.__efHeaderExpBound || 1899 (document.addEventListener( 1900 "click", 1901 (e) => { 1902 e.target.closest && 1903 e.target.closest(m) && 1904 [1, 60, 200, 500, 1000].forEach((v) => setTimeout(x, v)); 1905 }, 1906 !0 1907 ), 1908 document.addEventListener( 1909 "click", 1910 (e) => { 1911 let t = e.target.closest && e.target.closest(p); 1912 t && (e.preventDefault(), e.stopImmediatePropagation()); 1913 }, 1914 !0 1915 ), 1916 document.addEventListener( 1917 "keydown", 1918 (e) => { 1919 let t = e.target.closest && e.target.closest(p); 1920 t && 1921 ("Enter" === e.key || " " === e.key) && 1922 (e.preventDefault(), e.stopImmediatePropagation()); 1923 }, 1924 !0 1925 ), 1926 (window.__efHeaderExpBound = 1)); 1927 if (!window.__efHeaderExpNav) { 1928 let H = history, 1929 f1 = H.pushState, 1930 f2 = H.replaceState; 1931 f1 && 1932 (H.pushState = function () { 1933 let v = f1.apply(this, arguments); 1934 C(); 1935 return v; 1936 }); 1937 f2 && 1938 (H.replaceState = function () { 1939 let v = f2.apply(this, arguments); 1940 C(); 1941 return v; 1942 }); 1943 addEventListener("popstate", C); 1944 addEventListener("hashchange", C); 1945 window.__efHeaderExpNav = 1; 1946 } 1947 x(); 1948 [1, 100, 300, 700, 1500, 3000, 6000].forEach((v) => setTimeout(x, v)); 1949 "loading" === document.readyState && 1950 document.addEventListener("DOMContentLoaded", x); 1951 addEventListener("load", x); 1952 addEventListener("pageshow", x); 1953 window.__efHeaderExpObs = new MutationObserver(() => { 1954 q || 1955 ((q = 1), 1956 requestAnimationFrame(() => { 1957 q = 0; 1958 x(); 1959 })); 1960 }); 1961 window.__efHeaderExpObs.observe(document.documentElement, { 1962 childList: !0, 1963 subtree: !0, 1964 attributes: !0, 1965 attributeFilter: ["href", "class", "style", "aria-label"] 1966 }); 1967})(); 1968}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5669082324795392", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5235382634151936"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5333480760934400"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5237516729581568", "name": null, "commitId": "5874992921968640", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6323794556485632"], "audienceName": null, "changes": null, "id": "4773229825359872", "integrationSettings": null, "variations": [{"id": "6743449144131584", "name": null, "actions": [{"viewId": "4630904943935488", "changes": []}]}, {"id": "5716637209329664", "name": null, "actions": [{"viewId": "4630904943935488", "changes": [{"isOpalManaged": false, "depen
1968dencies": [], "allowAdditionalRedirect": false, "preserveParameters": false, "type": "redirect", "id": "686612cea7834b5d87c045b47d34a0fd", "dest": function redirectFn() { 1969document.cookie="multipg_visit=true; path=/"; 1970return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search; 1971} 1972}]}]}], "weightDistributions": [{"entityId": "6743449144131584", "endOfRange": 5000}, {"entityId": "5716637209329664", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5237516729581568"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4630904943935488"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5301471946735616", "name": null, "commitId": "5642189464666112", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5400001354924032"], "audienceName": null, "changes": null, "id": "5474102520053760", "integrationSettings": null, "variations": [{"id": "5278058335174656", "name": null, "actions": [{"viewId": "6579911039647744", "changes": []}]}, {"id": "6721220429742080", "name": null, "actions": [{"viewId": "6579911039647744", "changes": [{"id": "bb6989d33f5f41d080db1d3bed674c19", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.tw/cc/test-cons-bo/language-travel/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "5278058335174656", "endOfRange": 5000}, {"entityId": "6721220429742080", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5301471946735616"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6579911039647744"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5317444930109440", "name": null, "commitId": "6175719787593728", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6500026017382400", "integrationSettings": null, "variations": [{"id": "6443344836952064", "name": null, "actions": [{"viewId": "6002700922388480", "changes": []}]}, {"id": "5544690844434432", "name": null, "actions": [{"viewId": "6002700922388480", "changes": [{"id": "51d47582d3d44b7ca0b8c60df44a8e7a", "type": "custom_code", "value": function($){(function(){'use strict';var N='de-ils-cta-copy-update',D=!1,S='a.ef-button,button.ef-button,[role="button"].ef-button,[data-cy="cta"],[component="cta"]',A=['aria-label','title','value','data-label','data-title','data-cta-label'],M={'Gratis Katalog bestellen':'Kostenlosen Katalog anfordern','Gratis Katalog':'Kostenlosen Katalog anfordern','Order a free catalog':'Kostenlosen Katalog anfordern','Preisangebot':'Angebot anfordern','Kostenloses Angebot':'Angebot anfordern','Free quote':'Angebot anfordern','Buche einen Beratungstermin':'Beratung buchen','Book a consultation appointment':'Beratung buchen'};function ok(){return/(^|\.)ef\.de$/i.test(location.hostname)&&/^\/ils(?:\/|$)/i.test(location.pathname)}function l(){D&&console&&console.log.apply(console,[N].concat([].slice.call(arguments)))}function n(v){return String(v||'').replace(/\s+/g,' ').trim()}function r(v){return M[n(v)]||null}function z(){[].slice.call(document.querySelectorAll('[data-sentry-source-file="sticky-cta.tsx"],[data-clicklabel="page:sticky"]')).forEach(function(e){for(var p=e,i=0;p&&p!==document.body&&i<10;p=p.parentElement,i++){var s=getComputedStyle(p),sc=s.position!='static'||s.transform!='none'||s.filter!='none'||s.perspective!='none'||s.isolation=='isolate'||s.contain!='none';if(sc)p.style.setProperty('z-index','2147483000','important')}})}function tx(t){var v=t.nodeValue,m=r(v);if(!m||n(v)===m)return!1;t.nodeValue=(v.match(/^\s*/)||[''])[0]+m+(v.match(/\s*$/)||[''])[0];return!0}function at(e){var c=!1;
1972A.forEach(function(a){if(e.hasAttribute&&e.hasAttribute(a)){var v=e.getAttribute(a),m=r(v);if(m&&v!==m)e.setAttribute(a,m),c=!0}});return c}function inn(e){var c=!1,w=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(o){var p=o.parentElement;return p&&!p.closest('script,style,noscript,svg')&&r(o.nodeValue)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},!1),o;while(o=w.nextNode())c=tx(o)||c;return c}function run(){if(!ok()||!document.body)return;var c=0;[].slice.call(document.querySelectorAll(S)).forEach(function(e){if(at(e))c++;if(inn(e))c++});z();c&&l('Updated CTA copy:',c)}var q=!1;function sch(){if(q)return;q=!0;requestAnimationFrame(function(){q=!1;run()})}function h(m){var o=history[m];typeof o=='function'&&(history[m]=function(){var v=o.apply(this,arguments);sch();setTimeout(sch,100);setTimeout(sch,500);return v})}function init(){if(!ok())return;sch();new MutationObserver(sch).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:A});h('pushState');h('replaceState');['popstate','pageshow','load','scroll','resize'].forEach(function(e){addEventListener(e,sch,{passive:!0})});setInterval(sch,1000)}document.readyState==='loading'?document.addEventListener('DOMContentLoaded',init):init()})(); 1973}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "6443344836952064", "endOfRange": 5000}, {"entityId": "5544690844434432", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5317444930109440"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6002700922388480"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5323778054422528", "name": null, "commitId": "5764279368941568", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "4696042524901376"], "audienceName": null, "changes": null, "id": "6323428001579008", "integrationSettings": null, "variations": [{"id": "5201145799376896", "name": null, "actions": [{"viewId": "5839637382430720", "changes": []}]}, {"id": "5836626945900544", "name": null, "actions": [{"viewId": "5839637382430720", "changes": [{"id": "6afb4d9ef1c44d8c97942031c07c93c8", "type": "redirect", "dependencies": [], "dest": "https://www.ef.de/cc/discover/study-and-work-abroad/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "5201145799376896", "endOfRange": 5000}, {"entityId": "5836626945900544", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5323778054422528"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5839637382430720"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5336623569698816", "name": null, "commitId": "5393265195745280", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "4642787031777280"], "audienceName": null, "changes": null, "id": "5892528562503680", "integrationSettings": null, "variations": [{"id": "5930897921277952", "name": null, "actions": [{"viewId": "4773673616277504", "changes": []}]}, {"id": "6622519726178304", "name": null, "actions": [{"viewId": "4773673616277504", "changes": [{"id": "9ed54e0d68b742a492a2f3b166df4d85", "type": "redirect", "dependencies": [], "dest": "https://www.ef.de/cc/discover/cultural-immersion-abroad/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "5930897921277952", "endOfRange": 5000}, {"entityId": "6622519726178304", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5336623569698816"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4773673616277504"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5412541287890944", "name": null, "commitId": "5558305532149760", "groupId": null, "holdback": 10000, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "4848600379817984"], "audienceName": null, "changes": null, "id": "4585336064442368", "integrationSettings": null, "variations": [{"id": "6538441194733568", "name": null, "actions": [{"viewId": "4755352437129216", "changes": []}]}, {"id": "4586591428018176", "name": null, "actions": [{"viewId": "4755352437129216", "changes": [{"id": "b4c678734a1e4015977ba04d1b2afdda", "type": "redirect", "depen
1973dencies": [], "dest": "https://www.ef.com.co/cc/test/language-abroad_all_generic_ilc_x_dest/", "preserveParameters": true, "allowAdditionalRedirect": false, "isOpalManaged": false}]}]}], "weightDistributions": [{"entityId": "6538441194733568", "endOfRange": 5000}, {"entityId": "4586591428018176", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5412541287890944"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4755352437129216"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5427965756964864", "name": null, "commitId": "5151883380129792", "groupId": null, "holdback": 10000, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5912819078529024"], "audienceName": null, "changes": null, "id": "5183361832976384", "integrationSettings": null, "variations": [{"id": "5492025227739136", "name": null, "actions": [{"viewId": "6629809216815104", "changes": []}]}, {"id": "6555975197392896", "name": null, "actions": [{"viewId": "6629809216815104", "changes": [{"id": "e68b7402c7c9418a850927e043d5f639", "type": "redirect", "dependencies": [], "dest": "https://www.ef.fr/cc/test/language-abroad_all_generic_ilc_x_dest/", "preserveParameters": true, "allowAdditionalRedirect": false, "isOpalManaged": false}]}]}], "weightDistributions": [{"entityId": "5492025227739136", "endOfRange": 5000}, {"entityId": "6555975197392896", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5427965756964864"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6629809216815104"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5454536958017536", "name": null, "commitId": "5527185967022080", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6456374318596096", "integrationSettings": null, "variations": [{"id": "5124370557829120", "name": null, "actions": [{"viewId": "6597111806951424", "changes": []}]}, {"id": "6433649998954496", "name": null, "actions": [{"viewId": "6597111806951424", "changes": [{"id": "a4fb657256c34eb1a598c66636f44ac4", "type": "custom_code", "value": function($){// inject last spots 1974var EXPERIMENT_ID = "optly-faplatserkvar"; 1975var MAX_TRIPS = 6; 1976var BUTTON_TEXT = "Udforsk vores rejser"; 1977var LAST_SPOTS_HEADER = "FÃ¥ pladser tilbage"; 1978var JUNO_MARKET_CODE = "dkc"; 1979console.log("LTONB: Experiment script started version DKC.20260722.1"); 1980 1981function normalizeLtPath(path) { 1982 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 1983 if (match) return match[1] + "/"; 1984 return path; 1985} 1986 1987function fetchLastSpots() { 1988 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 1989 .then(function (response) { 1990 if (!response.ok) { 1991 throw new Error("Network response was not ok"); 1992 } 1993 return response.json(); 1994 }) 1995 .then(function (data) { 1996 var items = Array.isArray(data) 1997 ? data 1998 : Array.isArray(data && data.items) 1999 ? data.items 2000 : Array.isArray(data && data.trips) 2001 ? data.trips 2002 : null; 2003 2004 if (!items) { 2005 throw new Error("Expected trips in response payload"); 2006 } 2007 2008 var today = new Date(); 2009 today.setHours(0, 0, 0, 0); 2010 var availableTrips = items 2011 .map(function (trip) { 2012 var availableDeparture = (trip.availabilities || []) 2013 .filter(function (availability) { 2014 var startDate = new Date(availability.startDate + "T00:00:00"); 2015 return availability.availableSpots >= 1 && startDate >= today; 2016 }) 2017 .sort(function (a, b) { 2018 return a.availableSpots - b.availableSpots || a.price - b.price; 2019 })[0]; 2020 2021 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 2022 }) 2023 .filter(Boolean); 2024 2025 availableTrips.sort(function (a, b) { 2026 return a.availableSpots - b.availableSpots || a.price - b.price; 2027 }); 2028 2029 return availableTrips.slice(0, MAX_TRIPS); 2030 }) 2031 .catch(function (error) { 2032 console.error("There was a problem with the fetch operation:", error); 2033 return []; 2034 }); 2035} 2036 2037function escapeHtml(value) { 2038 return String(value) 2039 .replace(/&/g, "&") 2040 .replace(/</g, "<") 2041 .replace(/>/g, ">") 2042 .replace(/"/g, """) 2043 .replace(/'/g, "'"); 2044} 2045 2046function formatCurrency(amount, currency, locale) { 2047 if (typeof amount !== "number" || !currency) return ""; 2048 try { 2049 return new Intl.NumberFormat(locale, { 2050 style: "currency", 2051 currency: currency, 2052 currencyDisplay: "symbol", 2053 minimumFractionDigits: 0, 2054 maximumFractionDigits: 2 2055 }).format(amount); 2056 } catch (error) { 2057 console.warn("Could not format currency", error); 2058 return String(amount); 2059 } 2060} 2061 2062function getLocale() { 2063 return document.documentElement.lang || navigator.language || "sv-SE"; 2064} 2065 2066function renderTripCard(trip, locale) { 2067 var title = escapeHtml(trip && trip.title ? trip.title : ""); 2068 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 2069 var image = 2070 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 2071 var currency = trip && trip.currency ? trip.currency : ""; 2072 var originalAmount = 2073 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 2074 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 2075 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 2076 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 2077 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 2078 2079 return ( 2080 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 2081 href + 2082 '">' + 2083 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 2084 '<div class="flex w-full items-center">' + 2085 (image 2086 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 2087 title + 2088 '" src="' + 2089 image + 2090 '" width="100%" height="100%"></div>' 2091 : "") + 2092 '<div class="flex w-full items-center justify-between px-2">' + 2093 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 2094 title + 2095 "</span></p>" + 2096 '<div class="flex shrink-0 items-center gap-1">' + 2097 (originalAmount > discountedAmount 2098 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 2099 originalPrice + 2100 "</span></p>" 2101 : "") + 2102 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 2103 discountedPrice + 2104 "</span></p>" + 2105 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
2105' + 2106 "</div>" + 2107 "</div>" + 2108 "</div>" + 2109 "</div>" + 2110 "</a>" 2111 ); 2112} 2113 2114function onElementVisible(selector, callback) { 2115 var seen = new WeakMap(); 2116 2117 function isVisible(el) { 2118 var style = getComputedStyle(el); 2119 return ( 2120 style.display !== "none" && 2121 style.visibility !== "hidden" && 2122 style.opacity !== "0" && 2123 el.offsetParent !== null 2124 ); 2125 } 2126 2127 function check() { 2128 document.querySelectorAll(selector).forEach((el) => { 2129 var visible = isVisible(el); 2130 var prev = seen.get(el); 2131 2132 // Trigger only when it becomes visible (false â true) 2133 if (visible && !prev) { 2134 console.log("LTONB: Element became visible for selector '" + selector + "'"); 2135 callback(el); 2136 } 2137 2138 seen.set(el, visible); 2139 }); 2140 } 2141 2142 // Initial check 2143 check(); 2144 2145 var observer = new MutationObserver(check); 2146 2147 observer.observe(document.body, { 2148 childList: true, 2149 subtree: true, 2150 attributes: true, 2151 attributeFilter: ["style", "class", "hidden"] 2152 }); 2153 2154 return observer; // so you can disconnect() later if needed 2155} 2156 2157function replaceHTML(target, trips) { 2158 if (document.getElementById(EXPERIMENT_ID)) return; 2159 if (!trips || !trips.length) { 2160 console.warn("LTONB: No trips returned for replacement"); 2161 return; 2162 } 2163 if (!target) { 2164 console.warn("LTONB: Target element not available for replacement"); 2165 return; 2166 } 2167 2168 var locale = getLocale(); 2169 var cardsHtml = trips 2170 .map(function (trip) { 2171 return renderTripCard(trip, locale); 2172 }) 2173 .join(""); 2174 2175 var wrapper = document.createElement("div"); 2176 wrapper.id = EXPERIMENT_ID; 2177 2178 wrapper.innerHTML = ` 2179 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 2180 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 2181 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 2182 ${cardsHtml} 2183 </div> 2184 </div> 2185 </section> 2186 `; 2187 2188 target.replaceWith(wrapper); 2189} 2190 2191function replaceText(node, newText) { 2192 if (node.nodeType === Node.TEXT_NODE) { 2193 node.textContent = newText; 2194 } else { 2195 node.childNodes.forEach((child) => replaceText(child, newText)); 2196 } 2197} 2198 2199function updateHero() { 2200 // hide original hero 2201 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 2202 if (hero) { 2203 hero.style.setProperty("display", "none", "important"); 2204 } else { 2205 console.warn("LTONB: Original hero element not found"); 2206 } 2207 2208 // show test hero 2209 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 2210 if (testHero) { 2211 testHero.style.setProperty("display", "block", "important"); 2212 testHero.style.setProperty("visibility", "visible", "important"); 2213 testHero.style.setProperty("opacity", "1", "important"); 2214 testHero.removeAttribute("hidden"); 2215 testHero.classList.remove("hidden"); 2216 } else { 2217 console.warn("LTONB: Test hero element not found"); 2218 } 2219} 2220 2221function updateHeroButton() { 2222 var testHeroOffersButton = document.querySelector( 2223 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 2224 ); 2225 if (testHeroOffersButton) { 2226 replaceText(testHeroOffersButton, BUTTON_TEXT); 2227 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 2228 } else { 2229 console.warn("LTONB: Offers button in test hero not found"); 2230 } 2231} 2232 2233function updatePromotionsCarousel(target, trips) { 2234 var element = document.querySelector(target); 2235 var headerElement = document.querySelector( 2236 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 2237 ); 2238 if (headerElement && element) { 2239 replaceText(headerElement, LAST_SPOTS_HEADER); 2240 replaceHTML(element, trips); 2241 } 2242} 2243 2244onElementVisible('[data-cy="promotions-carousel-container"]', function () { 2245 fetchLastSpots().then(function (trips) { 2246 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 2247 }); 2248}); 2249 2250onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 2251 updateHeroButton(); 2252}); 2253 2254onElementVisible('#hero, .hero, [data-component="hero"]', function () { 2255 updateHero(); 2256}); 2257}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5124370557829120", "endOfRange": 1000}, {"entityId": "6433649998954496", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5454536958017536"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6597111806951424"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}
2257, {"changes": null, "id": "5457773668859904", "name": null, "commitId": "6553628551413760", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6186470470320128", "integrationSettings": null, "variations": [{"id": "6622111066750976", "name": null, "actions": [{"viewId": "5760119519051776", "changes": [{"id": "7f8f89dda44d4216a8ce92ad24c4c7ea", "type": "custom_code", "value": function($){(function () { 2258 var chatbotId = "7YOPwAW_tphaVZIDiWy52"; 2259 2260 /* ===== Disable floating messages BEFORE SDK loads ===== */ 2261 window.chatbaseConfig = { showFloatingInitialMessages: false }; 2262 2263 /* ================= Helpers (ES5) ================= */ 2264 function chatbaseReady() { 2265 try { 2266 return typeof window.chatbase === "function" && 2267 window.chatbase("getState") !== "uninitialized"; 2268 } catch (_e) { return false; } 2269 } 2270 2271 /* --- URL param helpers (ES5, robust decoding) --- */ 2272 function getQueryParam(name) { 2273 try { 2274 var qs = window.location && window.location.search ? window.location.search : ""; 2275 if (!qs || qs.length < 2) return ""; 2276 var query = qs.substring(1); 2277 var parts = query.split("&"); 2278 var i, kv, k, v; 2279 for (i = 0; i < parts.length; i++) { 2280 kv = parts[i].split("="); 2281 if (!kv || kv.length === 0) continue; 2282 k = kv[0] ? decodeURIComponent(kv[0].replace(/\+/g, " ")) : ""; 2283 if (k !== name) continue; 2284 v = kv.length > 1 ? kv.slice(1).join("=") : ""; 2285 v = v ? decodeURIComponent(v.replace(/\+/g, " ")) : ""; 2286 return v || ""; 2287 } 2288 } catch (_e) {} 2289 return ""; 2290 } 2291 2292 function deriveCountryCodeFromDestination(dest) { 2293 // destination expected like "US-NYC". Take first 2 chars. 2294 if (!dest || dest.length < 2) return ""; 2295 return String(dest).substring(0, 2).toLowerCase(); 2296 } 2297 2298 /* Optimizely end user id from Local Storage (robust scan) */ 2299 function getOptimizelyEndUserId() { 2300 try { 2301 var direct = localStorage.getItem("profile.visitorId"); 2302 if (direct) { 2303 try { 2304 var pd = JSON.parse(direct); 2305 if (pd && typeof pd === "object") { 2306 if (pd.endUserId) return String(pd.endUserId); 2307 if (pd.value) return String(pd.value); 2308 if (pd.id) return String(pd.id); 2309 } 2310 } catch (_ignore) {} 2311 return String(direct); 2312 } 2313 var i, k, v, obj; 2314 for (i = 0; i < localStorage.length; i++) { 2315 k = localStorage.key(i); 2316 if (k && k.indexOf("$visitor_profile") !== -1) { 2317 v = localStorage.getItem(k); 2318 if (!v) continue; 2319 try { obj = JSON.parse(v); } catch (_e) { obj = null; } 2320 if (obj) { 2321 if (obj.profile && obj.profile.visitorId) return String(obj.profile.visitorId); 2322 if (obj.visitorId) return String(obj.visitorId); 2323 } 2324 } 2325 } 2326 } catch (_e) {} 2327 return ""; 2328 } 2329 2330 /* ---- UTM -> EF Partners (sourceCode + eTag) ---- */ 2331 function extractUtmFromDl(dl) { 2332 var utm = { source: "(direct)", medium: "(none)", content: "noref" }; 2333 try { 2334 if (dl && dl.channel && dl.channel.utm && dl.channel.utm[0]) { 2335 var u = dl.channel.utm[0]; 2336 if (u.source) utm.source = String(u.source); 2337 if (u.medium) utm.medium = String(u.medium); 2338 if (u.content) utm.content = String(u.content); 2339 } 2340 } catch (_e) {} 2341 return utm; 2342 } 2343 2344 function bestGuessDL() { 2345 if (window.dl) return window.dl; 2346 if (window.dataLayer && window.dataLayer.length) { 2347 var i; 2348 for (i = window.dataLayer.length - 1; i >= 0; i--) { 2349 var it = window.dataLayer[i]; 2350 if (it && it.channel && it.channel.utm) return it; 2351 } 2352 } 2353 return null; 2354 } 2355 2356 function fetchEfPartnersSourceCode(utm, cb) { 2357 var url = "https://www.ef.fr/utm2efpartners/getefpartners/"; 2358 var xhr = new XMLHttpRequest(); 2359 xhr.open("POST", url, true); 2360 xhr.setRequestHeader("Content-Type", "application/json"); 2361 xhr.onreadystatechange = function () { 2362 if (xhr.readyState !== 4) return; 2363 if (xhr.status >= 200 && xhr.status < 300) { 2364 var data; 2365 try { data = JSON.parse(xhr.responseText); } catch (e) { return cb(e); } 2366 if (data && data.status === "Success" && data.result) { 2367 return cb(null, { 2368 sourceCode: data.result.sourceCode || "", 2369 eTag: data.result.eTag || "" 2370 }); 2371 } 2372 return cb(new Error((data && data.errorMessage) || "No partner match")); 2373 } 2374 cb(new Error("HTTP " + xhr.status)); 2375 }; 2376 try { 2377 xhr.send(JSON.stringify({ 2378 source: utm.source, 2379 medium: utm.medium, 2380 content: utm.content 2381 })); 2382 } catch (err) { cb(err); } 2383 } 2384 2385 /* =============== ONE-TIME IDENTIFY COORDINATOR =============== */ 2386 var meta = { 2387 destinationCode: "",
2388 productCode: "ils", 2389 courseCode: "", 2390 countryCode: "", 2391 duration: "", 2392 bookingFor: "", 2393 optimizelyEndUserId: "", 2394 sourceCode: "", 2395 eTag: "", 2396 accommodationType: "", 2397 residenceCode: "", 2398 roomType: "" 2399 }; 2400 2401 var gotPartners = false; 2402 var sentOnce = false; 2403 2404 function populateMetaFromUrl() { 2405 // destinationCode from URL param destination 2406 var dest = getQueryParam("destination"); 2407 meta.destinationCode = dest || ""; 2408 2409 // courseCode from URL param course 2410 meta.courseCode = getQueryParam("course") || ""; 2411 2412 // duration from URL param duration 2413 meta.duration = getQueryParam("duration") || ""; 2414 2415 // bookingFor from URL param bookingFor 2416 meta.bookingFor = getQueryParam("bookingFor") || ""; 2417 2418 // countryCode derived from destinationCode (first 2 letters lowercased) 2419 meta.countryCode = deriveCountryCodeFromDestination(meta.destinationCode); 2420 } 2421 2422 /* ---- EF Booking (window.__efBooking) -> user_metadata ---- */ 2423 function normalizeEfBooking(obj) { 2424 var b = (obj && typeof obj === "object") ? obj : {}; 2425 return { 2426 accommodationType: b.accommodationType ? String(b.accommodationType) : "", 2427 residenceCode: b.residenceCode ? String(b.residenceCode) : "", 2428 roomType: b.roomType ? String(b.roomType) : "" 2429 }; 2430 } 2431 2432 function efBookingSignature(b) { 2433 return (b.accommodationType || "") + "|" + (b.residenceCode || "") + "|" + (b.roomType || ""); 2434 } 2435 2436 function applyEfBookingToMeta(b) { 2437 meta.accommodationType = b.accommodationType || ""; 2438 meta.residenceCode = b.residenceCode || ""; 2439 meta.roomType = b.roomType || ""; 2440 } 2441 2442 var lastEfBookingSig = ""; 2443 2444 function sendUserMetadataUpdate(reason) { 2445 if (!chatbaseReady()) return; 2446 2447 // If initial identify has not happened yet, keep the existing gating behavior. 2448 if (!sentOnce) { 2449 maybeSendOnce(reason || "efBooking-pre"); 2450 return; 2451 } 2452 2453 try { 2454 window.chatbase("identify", { user_metadata: meta }); 2455 console.log("ð¦ [update] user_metadata updated:", reason, meta); 2456 } catch (e) { 2457 console.warn("â identify update failed:", e); 2458 } 2459 } 2460 2461 function readEfBookingAndMaybeUpdate(reason) { 2462 var b = normalizeEfBooking(window.__efBooking); 2463 var sig = efBookingSignature(b); 2464 if (sig === lastEfBookingSig) return; 2465 2466 lastEfBookingSig = sig; 2467 applyEfBookingToMeta(b); 2468 sendUserMetadataUpdate(reason || "efBooking-change"); 2469 } 2470 2471 function startEfBookingWatch() {
2472 // Initial sync (so first identify includes booking info when available). 2473 readEfBookingAndMaybeUpdate("efBooking-initial"); 2474 2475 // Capture re-assignments: window.__efBooking = {...} 2476 try { 2477 var current = window.__efBooking; 2478 Object.defineProperty(window, "__efBooking", { 2479 configurable: true, 2480 enumerable: true, 2481 get: function () { return current; }, 2482 set: function (v) { 2483 current = v; 2484 readEfBookingAndMaybeUpdate("efBooking-setter"); 2485 } 2486 }); 2487 } catch (_e) {} 2488 2489 // Capture in-place mutations: window.__efBooking.roomType = "single" 2490 setInterval(function () { 2491 readEfBookingAndMaybeUpdate("efBooking-poll"); 2492 }, 500); 2493 } 2494 2495 function maybeSendOnce(tag) { 2496 if (sentOnce) return; 2497 if (!chatbaseReady()) return; 2498 2499 // Same gating behavior as today: wait for partners AND require Optimizely end user id 2500 if (!gotPartners || !meta.optimizelyEndUserId) return; 2501 2502 try { 2503 window.chatbase("identify", { user_metadata: meta }); 2504 sentOnce = true; 2505 console.log("ð¦ [one-shot] user_metadata sent:", meta); 2506 } catch (e) { 2507 console.warn("â identify failed:", e); 2508 } 2509 } 2510 2511 /* ===== Place custom button & relay to native bubble ===== */ 2512 function insertCustomChatButton() { 2513 var stickyParent = document.querySelector('[data-clicksubregion="sticky"]'); 2514 if (!stickyParent || !stickyParent.firstElementChild) return; 2515 2516 var buttonGroup = stickyParent.firstElementChild; 2517 var anchors = buttonGroup.getElementsByTagName("a"); 2518 if (!anchors.length) return; 2519 2520 var firstAnchor = anchors[0]; 2521 if (!firstAnchor) return; 2522 2523 var existingBtn = document.getElementById("custom-chatbase-button"); 2524 if (existingBtn) { 2525 if (firstAnchor.nextSibling !== existingBtn) { 2526 buttonGroup.insertBefore(existingBtn, firstAnchor.nextSibling); 2527 } 2528 return; 2529 } 2530 2531 var customBtn = document.createElement("button"); 2532 customBtn.setAttribute("aria-label", "chatbase-custom-button"); 2533 customBtn.setAttribute("id", "custom-chatbase-button"); 2534 customBtn.setAttribute("type", "button"); 2535 customBtn.className = "md:order-4"; 2536 customBtn.style.cssText = 2537 "background: transparent; border: none; cursor: pointer; display: flex;" + 2538 "align-items: center; justify-content: center; width: 48px; height: 48px;" + 2539 "padding: 0px; margin-left: 10px;"; 2540 2541 var img = document.createElement("img"); 2542 img.src = "https://storage.googleapis.com/analytics_tactical/digital_factory/ori-chat-button.svg"; 2543 img.alt = "Chat"; 2544 img.width = 48; 2545 img.height = 48; 2546 customBtn.appendChild(img); 2547 2548 buttonGroup.insertBefore(customBtn, firstAnchor.nextSibling); 2549 2550 // Toggle Chatbase via native bubble 2551 customBtn.addEventListener("click", function () { 2552 var realChatBtn = document.getElementById("chatbase-bubble-button"); 2553 if (realChatBtn && typeof realChatBtn.click === "function") { 2554 realChatBtn.click(); 2555 } else { 2556 console.warn("â ï¸ Chatbase bubble not found"); 2557 } 2558 }); 2559 } 2560 2561 /* ===== Load Chatbase ===== */ 2562 var script = document.createElement("script"); 2563 script.src = "https://www.chatbase.co/embed.min.js"; 2564 script.defer = true; 2565 script.setAttribute("chatbotId", chatbotId); 2566 script.setAttribute("domain", "www.chatbase.co"); 2567 2568 script.onload = function () { 2569 // Hide native bubble 2570 var style = document.createElement("style"); 2571 style.innerHTML = "#chatbase-bubble-button { " + 2572 "position: absolute !important;" + 2573 "width: 1px !important;" + 2574 "height: 1px !important;" + 2575 "opacity: 0 !important;" + 2576 "pointer-events: none !important;" + 2577 "overflow: hidden !important;" + 2578 "z-index: -1 !important;" + 2579 "}"; 2580 document.head.appendChild(style); 2581 2582 // Keep custom button placed (handles re-renders) 2583 setInterval(insertCustomChatButton, 1000); 2584 2585 /* ------- Collect ALL metadata, then send ONCE ------- */ 2586 2587 // URL params (sync) 2588 populateMetaFromUrl(); 2589 2590 // Optimizely (sync) 2591 meta.optimizelyEndUserId = getOptimizelyEndUserId(); 2592 2593 // EF booking object (accommodation selection) 2594 startEfBookingWatch(); 2595 2596 // EF Partners (async request) 2597 var utm = extractUtmFromDl(bestGuessDL()); 2598 fetchEfPartnersSourceCode(utm, function (err, result) { 2599 if (err) { 2600 console.warn("EF Partners lookup failed:", err && err.message ? err.message : err); 2601 } else { 2602 meta.sourceCode = result.sourceCode || ""; 2603 meta.eTag = result.eTag || ""; 2604 } 2605 gotPartners = true; // proceed either way 2606 maybeSendOnce("partners"); 2607 }); 2608 2609 // As a last resort, attempt send after a hard cap if still not sent 2610 setTimeout(function () { maybeSendOnce("hard-cap"); }, 8000); 2611 2612 /* ----- SPA navigation: keep UI behavior but DO NOT re-identify ----- */ 2613 (function patchHistoryForSpaEvents() { 2614 var pushState = history.pushState; 2615 var replaceState = history.replaceState; 2616 2617 history.pushState = function () { 2618 var ret = pushState.apply(history, arguments); 2619 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 2620 return ret; 2621 }; 2622 history.replaceState = function () { 2623 var ret = replaceState.apply(history, arguments); 2624 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 2625 return ret; 2626 }; 2627 window.addEventListener("popstate", function () { 2628 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 2629 }); 2630 2631 window.addEventListener("spa:navigation", function () { 2632 setTimeout(function () { 2633 insertCustomChatButton(); 2634 2635 // We intentionally DO NOT re-identify on SPA navigation. 2636 // If your routing changes URL params and you want the bot to reflect that, 2637 // you would need a decision on whether to allow re-identify updates. 2638 // Keeping behavior identical to current script. 2639 }, 150); 2640 }); 2641 })(); 2642 }; 2643 2644 if (document.readyState === "complete") { 2645 document.body.appendChild(script); 2646 } else { 2647 window.addEventListener("load", function () { 2648 document.body.appendChild(script); 2649 }); 2650 } 2651})(); 2652}, "dependencies": []}, {"id": "63e8f76e67a44db09f696c5aea956678", "type": "append", "selector": "head", "value": "<style>button[data-cy=\"gudl-chat-button\"] {\n width: 0 !important;\n height: 0 !important;\n color: transparent !important;\n background: transparent !important;\n border: none !important;\n pointer-events: none !important;\n}\n\nbutton[data-cy=\"gudl-chat-button\"] {\n visibility: hidden !important;\n}\n\n#chatbase-bubble-button {\n width: 1px !important;\n height: 1px !important;\n opacity: 0 !important;\n pointer-events: none !important;\n overflow: hidden !important;\n position: absolute !important;\n z-index: -1 !important;\n}</style>
2652", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5457773668859904"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5760119519051776"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "6186470470320128", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "5496075857952768", "name": null, "commitId": "4669184007733248", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6323794556485632"], "audienceName": null, "changes": null, "id": "5997001735667712", "integrationSettings": null, "variations": [{"id": "4664449930362880", "name": null, "actions": []}, {"id": "5841487009677312", "name": null, "actions": [{"viewId": "5918968421023744", "changes": [{"id": "F1CC7F22-F8DD-498C-AAA1-EA69EFB572B1", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": false, "preserveParameters": false, "dest": function redirectFn() { 2653document.cookie = "multipg_visit=true; Path=/; SameSite=Lax; Secure"; 2654return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search; 2655} 2656}]}]}], "weightDistributions": [{"entityId": "4664449930362880", "endOfRange": 5000}, {"entityId": "5841487009677312", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5496075857952768"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5918968421023744"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5617096879505408", "name": null, "commitId": "5323475064193024", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5418539467669504", "integrationSettings": null, "variations": [{"id": "5325762536931328", "name": null, "actions": [{"viewId": "5981489421090816", "changes": []}]}, {"id": "6451662443773952", "name": null, "actions": [{"viewId": "5981489421090816", "changes": [{"id": "a8e42d70c3534d0bb8b217e8070fa100", "type": "custom_code", "value": function($){(function(){'use strict';var N='fr-ils-cta-copy-update',D=!1,S='a.ef-button,button.ef-button,[role="button"].ef-button,[data-cy="cta"],[component="cta"]',A=['aria-label','title','value','data-label','data-title','data-cta-label'],M={'Brochure gratuite':"J'obtiens ma brochure gratuite",'Free brochure':"J'obtiens ma brochure gratuite",'Free catalog':"J'obtiens ma brochure gratuite",'Devis gratuit':"J'obtiens mon devis",'Free quote':"J'obtiens mon devis",'Price quote':"J'obtiens mon devis",'Rencontrez un conseiller':'Je réserve ma consultation','Meet with an advisor':'Je réserve ma consultation','Meet with a consultant':'Je réserve ma consultation'};function ok(){return/(^|\.)ef\.fr$/i.test(location.hostname)&&/^\/ils(?:\/|$)/i.test(location.pathname)}function l(){D&&console&&console.log.apply(console,[N].concat([].slice.call(arguments)))}function n(v){return String(v||'').replace(/\s+/g,' ').trim()}function r(v){return M[n(v)]||null}function z(){[].slice.call(document.querySelectorAll('[data-sentry-source-file="sticky-cta.tsx"],[data-clicklabel="page:sticky"]')).forEach(function(e){for(var p=e,i=0;p&&p!==document.body&&i<10;p=p.parentElement,i++){var s=getComputedStyle(p),sc=s.position!='static'||s.transform!='none'||s.filter!='none'||s.perspective!='none'||s.isolation=='isolate'||s.contain!='none';if(sc)p.style.setProperty('z-index','2147483000','important')}})}function tx(t){var v=t.nodeValue,m=r(v);if(!m||n(v)===m)return!1;t.nodeValue=(v.match(/^\s*/)||[''])[0]+m+(v.match(/\s*$/)||[''])[0];return!0}function at(e){var c=!1;A.forEach(function(a){if(e.hasAttribute&&e.hasAttribute(a)){var v=e.getAttribute(a),m=r(v);if(m&&v!==m)e.setAttribute(a,m),c=!0}});return c}function inn(e){var c=!1,w=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(o){var p=o.parentElement;return p&&!p.closest('script,style,noscript,svg')&&r(o.nodeValue)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},!1),o;while(o=w.nextNode())c=tx(o)||c;return c}function run(){if(!ok()||!document.body)return;var c=0;
2656[].slice.call(document.querySelectorAll(S)).forEach(function(e){if(at(e))c++;if(inn(e))c++});z();c&&l('Updated CTA copy:',c)}var q=!1;function sch(){if(q)return;q=!0;requestAnimationFrame(function(){q=!1;run()})}function h(m){var o=history[m];typeof o=='function'&&(history[m]=function(){var v=o.apply(this,arguments);sch();setTimeout(sch,100);setTimeout(sch,500);return v})}function init(){if(!ok())return;sch();new MutationObserver(sch).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:A});h('pushState');h('replaceState');['popstate','pageshow','load','scroll','resize'].forEach(function(e){addEventListener(e,sch,{passive:!0})});setInterval(sch,1000)}document.readyState==='loading'?document.addEventListener('DOMContentLoaded',init):init()})(); 2657}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5325762536931328", "endOfRange": 5000}, {"entityId": "6451662443773952", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5617096879505408"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5981489421090816"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5651795763003392", "name": null, "commitId": "5876657054023680", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5913644618219520", "integrationSettings": null, "variations": [{"id": "5084313746669568", "name": null, "actions": [{"viewId": "6445792458702848", "changes": []}]}, {"id": "4906077704159232", "name": null, "actions": [{"viewId": "6445792458702848", "changes": [{"id": "4ca98cd300cf4731861ef62aab8ed14e", "type": "custom_code", "value": function($){// inject last spots 2658var EXPERIMENT_ID = "optly-faplatserkvar"; 2659var MAX_TRIPS = 6; 2660var BUTTON_TEXT = "Scopri i miei viaggi"; 2661var LAST_SPOTS_HEADER = "Ultimi posti rimasti"; 2662var JUNO_MARKET_CODE = "itm"; 2663console.log("LTONB: Experiment script started version ITM.20260722.1"); 2664 2665function normalizeLtPath(path) { 2666 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 2667 if (match) return match[1] + "/"; 2668 return path; 2669} 2670 2671function fetchLastSpots() { 2672 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 2673 .then(function (response) { 2674 if (!response.ok) { 2675 throw new Error("Network response was not ok"); 2676 } 2677 return response.json(); 2678 }) 2679 .then(function (data) { 2680 var items = Array.isArray(data) 2681 ? data 2682 : Array.isArray(data && data.items) 2683 ? data.items 2684 : Array.isArray(data && data.trips) 2685 ? data.trips 2686 : null; 2687 2688 if (!items) { 2689 throw new Error("Expected trips in response payload"); 2690 } 2691 2692 var today = new Date(); 2693 today.setHours(0, 0, 0, 0); 2694 var availableTrips = items 2695 .map(function (trip) { 2696 var availableDeparture = (trip.availabilities || []) 2697 .filter(function (availability) { 2698 var startDate = new Date(availability.startDate + "T00:00:00"); 2699 return availability.availableSpots >= 1 && startDate >= today; 2700 }) 2701 .sort(function (a, b) { 2702 return a.availableSpots - b.availableSpots || a.price - b.price; 2703 })[0]; 2704 2705 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 2706 }) 2707 .filter(Boolean); 2708 2709 availableTrips.sort(function (a, b) { 2710 return a.availableSpots - b.availableSpots || a.price - b.price; 2711 }); 2712 2713 return availableTrips.slice(0, MAX_TRIPS); 2714 }) 2715 .catch(function (error) { 2716 console.error("There was a problem with the fetch operation:", error); 2717 return []; 2718 }); 2719} 2720 2721function escapeHtml(value) { 2722 return String(value) 2723 .replace(/&/g, "&") 2724 .replace(/</g, "<") 2725 .replace(/>/g, ">") 2726 .replace(/"/g, """) 2727 .replace(/'/g, "'"); 2728} 2729 2730function formatCurrency(amount, currency, locale) { 2731 if (typeof amount !== "number" || !currency) return ""; 2732 try { 2733 return new Intl.NumberFormat(locale, { 2734 style: "currency", 2735 currency: currency, 2736 currencyDisplay: "symbol", 2737 minimumFractionDigits: 0, 2738 maximumFractionDigits: 2 2739 }).format(amount); 2740 } catch (error) { 2741 console.warn("Could not format currency", error); 2742 return String(amount); 2743 } 2744} 2745 2746function getLocale() { 2747 return document.documentElement.lang || navigator.language || "sv-SE"; 2748} 2749 2750function renderTripCard(trip, locale) { 2751 var title = escapeHtml(trip && trip.title ? trip.title : ""); 2752 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 2753 var image = 2754 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 2755 var currency = trip && trip.currency ? trip.currency : ""; 2756 var originalAmount = 2757 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 2758 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 2759 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 2760 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 2761 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 2762 2763 return ( 2764 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 2765 href + 2766 '">' + 2767 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 2768 '<div class="flex w-full items-center">' + 2769 (image 2770 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 2771 title + 2772 '" src="' + 2773 image + 2774 '" width="100%" height="100%"></div>' 2775 : "") + 2776 '<div class="flex w-full items-center justify-between px-2">' + 2777 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 2778 title + 2779 "</span></p>" + 2780 '<div class="flex shrink-0 items-center gap-1">' + 2781 (originalAmount > discountedAmount 2782 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 2783 originalPrice + 2784 "</span></p>" 2785 : "") + 2786 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 2787 discountedPrice + 2788 "</span></p>" + 2789 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
2789' + 2790 "</div>" + 2791 "</div>" + 2792 "</div>" + 2793 "</div>" + 2794 "</a>" 2795 ); 2796} 2797 2798function onElementVisible(selector, callback) { 2799 var seen = new WeakMap(); 2800 2801 function isVisible(el) { 2802 var style = getComputedStyle(el); 2803 return ( 2804 style.display !== "none" && 2805 style.visibility !== "hidden" && 2806 style.opacity !== "0" && 2807 el.offsetParent !== null 2808 ); 2809 } 2810 2811 function check() { 2812 document.querySelectorAll(selector).forEach((el) => { 2813 var visible = isVisible(el); 2814 var prev = seen.get(el); 2815 2816 // Trigger only when it becomes visible (false â true) 2817 if (visible && !prev) { 2818 console.log("LTONB: Element became visible for selector '" + selector + "'"); 2819 callback(el); 2820 } 2821 2822 seen.set(el, visible); 2823 }); 2824 } 2825 2826 // Initial check 2827 check(); 2828 2829 var observer = new MutationObserver(check); 2830 2831 observer.observe(document.body, { 2832 childList: true, 2833 subtree: true, 2834 attributes: true, 2835 attributeFilter: ["style", "class", "hidden"] 2836 }); 2837 2838 return observer; // so you can disconnect() later if needed 2839} 2840 2841function replaceHTML(target, trips) { 2842 if (document.getElementById(EXPERIMENT_ID)) return; 2843 if (!trips || !trips.length) { 2844 console.warn("LTONB: No trips returned for replacement"); 2845 return; 2846 } 2847 if (!target) { 2848 console.warn("LTONB: Target element not available for replacement"); 2849 return; 2850 } 2851 2852 var locale = getLocale(); 2853 var cardsHtml = trips 2854 .map(function (trip) { 2855 return renderTripCard(trip, locale); 2856 }) 2857 .join(""); 2858 2859 var wrapper = document.createElement("div"); 2860 wrapper.id = EXPERIMENT_ID; 2861 2862 wrapper.innerHTML = ` 2863 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 2864 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 2865 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 2866 ${cardsHtml} 2867 </div> 2868 </div> 2869 </section> 2870 `; 2871 2872 target.replaceWith(wrapper); 2873} 2874 2875function replaceText(node, newText) { 2876 if (node.nodeType === Node.TEXT_NODE) { 2877 node.textContent = newText; 2878 } else { 2879 node.childNodes.forEach((child) => replaceText(child, newText)); 2880 } 2881} 2882 2883function updateHero() { 2884 // hide original hero 2885 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 2886 if (hero) { 2887 hero.style.setProperty("display", "none", "important"); 2888 } else { 2889 console.warn("LTONB: Original hero element not found"); 2890 } 2891 2892 // show test hero 2893 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 2894 if (testHero) { 2895 testHero.style.setProperty("display", "block", "important"); 2896 testHero.style.setProperty("visibility", "visible", "important"); 2897 testHero.style.setProperty("opacity", "1", "important"); 2898 testHero.removeAttribute("hidden"); 2899 testHero.classList.remove("hidden"); 2900 } else { 2901 console.warn("LTONB: Test hero element not found"); 2902 } 2903} 2904 2905function updateHeroButton() { 2906 var testHeroOffersButton = document.querySelector( 2907 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 2908 ); 2909 if (testHeroOffersButton) { 2910 replaceText(testHeroOffersButton, BUTTON_TEXT); 2911 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 2912 } else { 2913 console.warn("LTONB: Offers button in test hero not found"); 2914 } 2915} 2916 2917function updatePromotionsCarousel(target, trips) { 2918 var element = document.querySelector(target); 2919 var headerElement = document.querySelector( 2920 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 2921 ); 2922 if (headerElement && element) { 2923 replaceText(headerElement, LAST_SPOTS_HEADER); 2924 replaceHTML(element, trips); 2925 } 2926} 2927 2928onElementVisible('[data-cy="promotions-carousel-container"]', function () { 2929 fetchLastSpots().then(function (trips) { 2930 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 2931 }); 2932}); 2933 2934onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 2935 updateHeroButton(); 2936}); 2937 2938onElementVisible('#hero, .hero, [data-component="hero"]', function () { 2939 updateHero(); 2940}); 2941}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5084313746669568", "endOfRange": 1000}, {"entityId": "4906077704159232", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5651795763003392"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6445792458702848"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5654264563892224", "name": null, "commitId": "5561113390088192", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5862893271384064", "integrationSettings": null, "variations": [{"id": "5281911887626240", "name": null, "actions": [{"viewId": "4736993364541440", "changes": []}]}
2941, {"id": "6407811794468864", "name": null, "actions": [{"viewId": "4736993364541440", "changes": [{"id": "dc43f15ed4c944109ce09108e835b3c8", "type": "custom_code", "value": function($){// inject last spots 2942var EXPERIMENT_ID = "optly-faplatserkvar"; 2943var MAX_TRIPS = 6; 2944var BUTTON_TEXT = "Utforsk våre reiser"; 2945var LAST_SPOTS_HEADER = "Få plasser igjen"; 2946var JUNO_MARKET_CODE = "noo"; 2947console.log("LTONB: Experiment script started version NOO.20260722.1"); 2948 2949function normalizeLtPath(path) { 2950 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 2951 if (match) return match[1] + "/"; 2952 return path; 2953} 2954 2955function fetchLastSpots() { 2956 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 2957 .then(function (response) { 2958 if (!response.ok) { 2959 throw new Error("Network response was not ok"); 2960 } 2961 return response.json(); 2962 }) 2963 .then(function (data) { 2964 var items = Array.isArray(data) 2965 ? data 2966 : Array.isArray(data && data.items) 2967 ? data.items 2968 : Array.isArray(data && data.trips) 2969 ? data.trips 2970 : null; 2971 2972 if (!items) { 2973 throw new Error("Expected trips in response payload"); 2974 } 2975 2976 var today = new Date(); 2977 today.setHours(0, 0, 0, 0); 2978 var availableTrips = items 2979 .map(function (trip) { 2980 var availableDeparture = (trip.availabilities || []) 2981 .filter(function (availability) { 2982 var startDate = new Date(availability.startDate + "T00:00:00"); 2983 return availability.availableSpots >= 1 && startDate >= today; 2984 }) 2985 .sort(function (a, b) { 2986 return a.availableSpots - b.availableSpots || a.price - b.price; 2987 })[0]; 2988 2989 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 2990 }) 2991 .filter(Boolean); 2992 2993 availableTrips.sort(function (a, b) { 2994 return a.availableSpots - b.availableSpots || a.price - b.price; 2995 }); 2996 2997 return availableTrips.slice(0, MAX_TRIPS); 2998 }) 2999 .catch(function (error) { 3000 console.error("There was a problem with the fetch operation:", error); 3001 return []; 3002 }); 3003} 3004 3005function escapeHtml(value) { 3006 return String(value) 3007 .replace(/&/g, "&") 3008 .replace(/</g, "<") 3009 .replace(/>/g, ">") 3010 .replace(/"/g, """) 3011 .replace(/'/g, "'"); 3012} 3013 3014function formatCurrency(amount, currency, locale) { 3015 if (typeof amount !== "number" || !currency) return ""; 3016 try { 3017 return new Intl.NumberFormat(locale, { 3018 style: "currency", 3019 currency: currency, 3020 currencyDisplay: "symbol", 3021 minimumFractionDigits: 0, 3022 maximumFractionDigits: 2 3023 }).format(amount); 3024 } catch (error) { 3025 console.warn("Could not format currency", error); 3026 return String(amount); 3027 } 3028} 3029 3030function getLocale() { 3031 return document.documentElement.lang || navigator.language || "sv-SE"; 3032} 3033 3034function renderTripCard(trip, locale) { 3035 var title = escapeHtml(trip && trip.title ? trip.title : ""); 3036 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 3037 var image = 3038 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 3039 var currency = trip && trip.currency ? trip.currency : ""; 3040 var originalAmount = 3041 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 3042 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 3043 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 3044 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 3045 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 3046 3047 return ( 3048 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 3049 href + 3050 '">' + 3051 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 3052 '<div class="flex w-full items-center">' + 3053 (image 3054 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 3055 title + 3056 '" src="' + 3057 image + 3058 '" width="100%" height="100%"></div>' 3059 : "") + 3060 '<div class="flex w-full items-center justify-between px-2">' + 3061 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 3062 title + 3063 "</span></p>" + 3064 '<div class="flex shrink-0 items-center gap-1">' + 3065 (originalAmount > discountedAmount 3066 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 3067 originalPrice + 3068 "</span></p>" 3069 : "") + 3070 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 3071 discountedPrice + 3072 "</span></p>" + 3073 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
3073' + 3074 "</div>" + 3075 "</div>" + 3076 "</div>" + 3077 "</div>" + 3078 "</a>" 3079 ); 3080} 3081 3082function onElementVisible(selector, callback) { 3083 var seen = new WeakMap(); 3084 3085 function isVisible(el) { 3086 var style = getComputedStyle(el); 3087 return ( 3088 style.display !== "none" && 3089 style.visibility !== "hidden" && 3090 style.opacity !== "0" && 3091 el.offsetParent !== null 3092 ); 3093 } 3094 3095 function check() { 3096 document.querySelectorAll(selector).forEach((el) => { 3097 var visible = isVisible(el); 3098 var prev = seen.get(el); 3099 3100 // Trigger only when it becomes visible (false â true) 3101 if (visible && !prev) { 3102 console.log("LTONB: Element became visible for selector '" + selector + "'"); 3103 callback(el); 3104 } 3105 3106 seen.set(el, visible); 3107 }); 3108 } 3109 3110 // Initial check 3111 check(); 3112 3113 var observer = new MutationObserver(check); 3114 3115 observer.observe(document.body, { 3116 childList: true, 3117 subtree: true, 3118 attributes: true, 3119 attributeFilter: ["style", "class", "hidden"] 3120 }); 3121 3122 return observer; // so you can disconnect() later if needed 3123} 3124 3125function replaceHTML(target, trips) { 3126 if (document.getElementById(EXPERIMENT_ID)) return; 3127 if (!trips || !trips.length) { 3128 console.warn("LTONB: No trips returned for replacement"); 3129 return; 3130 } 3131 if (!target) { 3132 console.warn("LTONB: Target element not available for replacement"); 3133 return; 3134 } 3135 3136 var locale = getLocale(); 3137 var cardsHtml = trips 3138 .map(function (trip) { 3139 return renderTripCard(trip, locale); 3140 }) 3141 .join(""); 3142 3143 var wrapper = document.createElement("div"); 3144 wrapper.id = EXPERIMENT_ID; 3145 3146 wrapper.innerHTML = ` 3147 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 3148 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 3149 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 3150 ${cardsHtml} 3151 </div> 3152 </div> 3153 </section> 3154 `; 3155 3156 target.replaceWith(wrapper); 3157} 3158 3159function replaceText(node, newText) { 3160 if (node.nodeType === Node.TEXT_NODE) { 3161 node.textContent = newText; 3162 } else { 3163 node.childNodes.forEach((child) => replaceText(child, newText)); 3164 } 3165} 3166 3167function updateHero() { 3168 // hide original hero 3169 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 3170 if (hero) { 3171 hero.style.setProperty("display", "none", "important"); 3172 } else { 3173 console.warn("LTONB: Original hero element not found"); 3174 } 3175 3176 // show test hero 3177 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 3178 if (testHero) { 3179 testHero.style.setProperty("display", "block", "important"); 3180 testHero.style.setProperty("visibility", "visible", "important"); 3181 testHero.style.setProperty("opacity", "1", "important"); 3182 testHero.removeAttribute("hidden"); 3183 testHero.classList.remove("hidden"); 3184 } else { 3185 console.warn("LTONB: Test hero element not found"); 3186 } 3187} 3188 3189function updateHeroButton() { 3190 var testHeroOffersButton = document.querySelector( 3191 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 3192 ); 3193 if (testHeroOffersButton) { 3194 replaceText(testHeroOffersButton, BUTTON_TEXT); 3195 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 3196 } else { 3197 console.warn("LTONB: Offers button in test hero not found"); 3198 } 3199} 3200 3201function updatePromotionsCarousel(target, trips) { 3202 var element = document.querySelector(target); 3203 var headerElement = document.querySelector( 3204 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 3205 ); 3206 if (headerElement && element) { 3207 replaceText(headerElement, LAST_SPOTS_HEADER); 3208 replaceHTML(element, trips); 3209 } 3210} 3211 3212onElementVisible('[data-cy="promotions-carousel-container"]', function () { 3213 fetchLastSpots().then(function (trips) { 3214 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 3215 }); 3216}); 3217 3218onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 3219 updateHeroButton(); 3220}); 3221 3222onElementVisible('#hero, .hero, [data-component="hero"]', function () { 3223 updateHero(); 3224}); 3225}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5281911887626240", "endOfRange": 1000}, {"entityId": "6407811794468864", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5654264563892224"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4736993364541440"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5680852139507712", "name": null, "commitId": "5639724746932224", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5362792295825408", "integrationSettings": null, "variations": [{"id": "4797
3225505880195072", "name": null, "actions": [{"viewId": "5305197119930368", "changes": [{"id": "11ea3d3012884d7ebba098b59a78a14b", "type": "custom_code", "value": function($){(function () { 3226 var chatbotId = "uHXV8y9ba5f8HX9EfVdFD"; 3227 3228 /* ===== Disable floating messages BEFORE SDK loads ===== */ 3229 window.chatbaseConfig = { showFloatingInitialMessages: false }; 3230 3231 /* ================= Helpers (ES5) ================= */ 3232 function chatbaseReady() { 3233 try { 3234 return typeof window.chatbase === "function" && 3235 window.chatbase("getState") !== "uninitialized"; 3236 } catch (_e) { return false; } 3237 } 3238 3239 /* --- URL param helpers (ES5, robust decoding) --- */ 3240 function getQueryParam(name) { 3241 try { 3242 var qs = window.location && window.location.search ? window.location.search : ""; 3243 if (!qs || qs.length < 2) return ""; 3244 var query = qs.substring(1); 3245 var parts = query.split("&"); 3246 var i, kv, k, v; 3247 for (i = 0; i < parts.length; i++) { 3248 kv = parts[i].split("="); 3249 if (!kv || kv.length === 0) continue; 3250 k = kv[0] ? decodeURIComponent(kv[0].replace(/\+/g, " ")) : ""; 3251 if (k !== name) continue; 3252 v = kv.length > 1 ? kv.slice(1).join("=") : ""; 3253 v = v ? decodeURIComponent(v.replace(/\+/g, " ")) : ""; 3254 return v || ""; 3255 } 3256 } catch (_e) {} 3257 return ""; 3258 } 3259 3260 function deriveCountryCodeFromDestination(dest) { 3261 // destination expected like "US-NYC". Take first 2 chars. 3262 if (!dest || dest.length < 2) return ""; 3263 return String(dest).substring(0, 2).toLowerCase(); 3264 } 3265 3266 /* Optimizely end user id from Local Storage (robust scan) */ 3267 function getOptimizelyEndUserId() { 3268 try { 3269 var direct = localStorage.getItem("profile.visitorId"); 3270 if (direct) { 3271 try { 3272 var pd = JSON.parse(direct); 3273 if (pd && typeof pd === "object") { 3274 if (pd.endUserId) return String(pd.endUserId); 3275 if (pd.value) return String(pd.value); 3276 if (pd.id) return String(pd.id); 3277 } 3278 } catch (_ignore) {} 3279 return String(direct); 3280 } 3281 var i, k, v, obj; 3282 for (i = 0; i < localStorage.length; i++) { 3283 k = localStorage.key(i); 3284 if (k && k.indexOf("$visitor_profile") !== -1) { 3285 v = localStorage.getItem(k); 3286 if (!v) continue; 3287 try { obj = JSON.parse(v); } catch (_e) { obj = null; } 3288 if (obj) { 3289 if (obj.profile && obj.profile.visitorId) return String(obj.profile.visitorId); 3290 if (obj.visitorId) return String(obj.visitorId); 3291 } 3292 } 3293 } 3294 } catch (_e) {} 3295 return ""; 3296 } 3297 3298 /* ---- UTM -> EF Partners (sourceCode + eTag) ---- */ 3299 function extractUtmFromDl(dl) { 3300 var utm = { source: "(direct)", medium: "(none)", content: "noref" }; 3301 try { 3302 if (dl && dl.channel && dl.channel.utm && dl.channel.utm[0]) { 3303 var u = dl.channel.utm[0]; 3304 if (u.source) utm.source = String(u.source); 3305 if (u.medium) utm.medium = String(u.medium); 3306 if (u.content) utm.content = String(u.content); 3307 } 3308 } catch (_e) {} 3309 return utm; 3310 } 3311 3312 function bestGuessDL() { 3313 if (window.dl) return window.dl; 3314 if (window.dataLayer && window.dataLayer.length) { 3315 var i; 3316 for (i = window.dataLayer.length - 1; i >= 0; i--) { 3317 var it = window.dataLayer[i]; 3318 if (it && it.channel && it.channel.utm) return it; 3319 } 3320 } 3321 return null; 3322 } 3323 3324 function fetchEfPartnersSourceCode(utm, cb) { 3325 var url = "https://www.ef.fr/utm2efpartners/getefpartners/"; 3326 var xhr = new XMLHttpRequest(); 3327 xhr.open("POST", url, true); 3328 xhr.setRequestHeader("Content-Type", "application/json"); 3329 xhr.onreadystatechange = function () { 3330 if (xhr.readyState !== 4) return; 3331 if (xhr.status >= 200 && xhr.status < 300) { 3332 var data; 3333 try { data = JSON.parse(xhr.responseText); } catch (e) { return cb(e); } 3334 if (data && data.status === "Success" && data.result) { 3335 return cb(null, { 3336 sourceCode: data.result.sourceCode || "", 3337 eTag: data.result.eTag || "" 3338 }); 3339 } 3340 return cb(new Error((data && data.errorMessage) || "No partner match")); 3341 } 3342 cb(new Error("HTTP " + xhr.status)); 3343 }; 3344 try { 3345 xhr.send(JSON.stringify({ 3346 source: utm.source, 3347 medium: utm.medium, 3348 content: utm.content 3349 })); 3350 } catch (err) { cb(err); } 3351 } 3352 3353 /* =============== ONE-TIME IDENTIFY COORDINATOR =============== */ 3354 var meta = { 3355 destinationCode: "",
3356 productCode: "ils", 3357 courseCode: "", 3358 countryCode: "", 3359 duration: "", 3360 bookingFor: "", 3361 optimizelyEndUserId: "", 3362 sourceCode: "", 3363 eTag: "", 3364 accommodationType: "", 3365 residenceCode: "", 3366 roomType: "", 3367 packageCode: "" 3368 }; 3369 3370 var gotPartners = false; 3371 var sentOnce = false; 3372 3373 function populateMetaFromUrl() { 3374 // destinationCode from URL param destination 3375 var dest = getQueryParam("destination"); 3376 meta.destinationCode = dest || ""; 3377 3378 // courseCode from URL param course 3379 meta.courseCode = getQueryParam("course") || ""; 3380 3381 // duration from URL param duration 3382 meta.duration = getQueryParam("duration") || ""; 3383 3384 // bookingFor from URL param bookingFor 3385 meta.bookingFor = getQueryParam("bookingFor") || ""; 3386 3387 // countryCode derived from destinationCode (first 2 letters lowercased) 3388 meta.countryCode = deriveCountryCodeFromDestination(meta.destinationCode); 3389 3390 // packageCode from URL param packageCode (e.g. ILS_LAN_ROM_I_200) 3391 meta.packageCode = getQueryParam("packageCode") || ""; 3392 } 3393 3394 /* ---- EF Booking (window.__efBooking) -> user_metadata ---- */ 3395 function normalizeEfBooking(obj) { 3396 var b = (obj && typeof obj === "object") ? obj : {}; 3397 return { 3398 accommodationType: b.accommodationType ? String(b.accommodationType) : "", 3399 residenceCode: b.residenceCode ? String(b.residenceCode) : "", 3400 roomType: b.roomType ? String(b.roomType) : "" 3401 }; 3402 } 3403 3404 function efBookingSignature(b) { 3405 return (b.accommodationType || "") + "|" + (b.residenceCode || "") + "|" + (b.roomType || ""); 3406 } 3407 3408 function applyEfBookingToMeta(b) { 3409 meta.accommodationType = b.accommodationType || ""; 3410 meta.residenceCode = b.residenceCode || ""; 3411 meta.roomType = b.roomType || ""; 3412 } 3413 3414 var lastEfBookingSig = ""; 3415 3416 function sendUserMetadataUpdate(reason) { 3417 if (!chatbaseReady()) return; 3418 3419 // If initial identify has not happened yet, keep the existing gating behavior. 3420 if (!sentOnce) { 3421 maybeSendOnce(reason || "efBooking-pre"); 3422 return; 3423 } 3424 3425 try { 3426 window.chatbase("identify", { user_metadata: meta }); 3427 console.log("ð¦ [update] user_metadata updated:", reason, meta); 3428 } catch (e) { 3429 console.warn("â identify update failed:", e); 3430 } 3431 } 3432 3433 function readEfBookingAndMaybeUpdate(reason) { 3434 var b = normalizeEfBooking(window.__efBooking); 3435 var sig = efBookingSignature(b); 3436 if (sig === lastEfBookingSig) return; 3437 3438 lastEfBookingSig = sig; 3439 applyEfBookingToMeta(b); 3440 sendUserMetadataUpdate(reason || "efBooking-change"); 3441 } 3442 3443 function startEfBookingWatch() {
3444 // Initial sync (so first identify includes booking info when available). 3445 readEfBookingAndMaybeUpdate("efBooking-initial"); 3446 3447 // Capture re-assignments: window.__efBooking = {...} 3448 try { 3449 var current = window.__efBooking; 3450 Object.defineProperty(window, "__efBooking", { 3451 configurable: true, 3452 enumerable: true, 3453 get: function () { return current; }, 3454 set: function (v) { 3455 current = v; 3456 readEfBookingAndMaybeUpdate("efBooking-setter"); 3457 } 3458 }); 3459 } catch (_e) {} 3460 3461 // Capture in-place mutations: window.__efBooking.roomType = "single" 3462 setInterval(function () { 3463 readEfBookingAndMaybeUpdate("efBooking-poll"); 3464 }, 500); 3465 } 3466 3467 function maybeSendOnce(tag) { 3468 if (sentOnce) return; 3469 if (!chatbaseReady()) return; 3470 3471 // Same gating behavior as today: wait for partners AND require Optimizely end user id 3472 if (!gotPartners || !meta.optimizelyEndUserId) return; 3473 3474 try { 3475 window.chatbase("identify", { user_metadata: meta }); 3476 sentOnce = true; 3477 console.log("ð¦ [one-shot] user_metadata sent:", meta); 3478 } catch (e) { 3479 console.warn("â identify failed:", e); 3480 } 3481 } 3482 3483 /* ===== Place custom button & relay to native bubble ===== */ 3484 function insertCustomChatButton() { 3485 var stickyParent = document.querySelector('[data-clicksubregion="sticky"]'); 3486 if (!stickyParent || !stickyParent.firstElementChild) return; 3487 3488 var buttonGroup = stickyParent.firstElementChild; 3489 var anchors = buttonGroup.getElementsByTagName("a"); 3490 if (!anchors.length) return; 3491 3492 var firstAnchor = anchors[0]; 3493 if (!firstAnchor) return; 3494 3495 var existingBtn = document.getElementById("custom-chatbase-button"); 3496 if (existingBtn) { 3497 if (firstAnchor.nextSibling !== existingBtn) { 3498 buttonGroup.insertBefore(existingBtn, firstAnchor.nextSibling); 3499 } 3500 return; 3501 } 3502 3503 var customBtn = document.createElement("button"); 3504 customBtn.setAttribute("aria-label", "chatbase-custom-button"); 3505 customBtn.setAttribute("id", "custom-chatbase-button"); 3506 customBtn.setAttribute("type", "button"); 3507 customBtn.className = "md:order-4"; 3508 customBtn.style.cssText = 3509 "background: transparent; border: none; cursor: pointer; display: flex;" + 3510 "align-items: center; justify-content: center; width: 48px; height: 48px;" + 3511 "padding: 0px; margin-left: 10px;"; 3512 3513 var img = document.createElement("img"); 3514 img.src = "https://storage.googleapis.com/analytics_tactical/digital_factory/ori-chat-button.svg"; 3515 img.alt = "Chat"; 3516 img.width = 48; 3517 img.height = 48; 3518 customBtn.appendChild(img); 3519 3520 buttonGroup.insertBefore(customBtn, firstAnchor.nextSibling); 3521 3522 // Toggle Chatbase via native bubble 3523 customBtn.addEventListener("click", function () { 3524 var realChatBtn = document.getElementById("chatbase-bubble-button"); 3525 if (realChatBtn && typeof realChatBtn.click === "function") { 3526 realChatBtn.click(); 3527 } else { 3528 console.warn("â ï¸ Chatbase bubble not found"); 3529 } 3530 }); 3531 } 3532 3533 /* ===== Load Chatbase ===== */ 3534 var script = document.createElement("script"); 3535 script.src = "https://www.chatbase.co/embed.min.js"; 3536 script.defer = true; 3537 script.setAttribute("chatbotId", chatbotId); 3538 script.setAttribute("domain", "www.chatbase.co"); 3539 3540 script.onload = function () { 3541 // Hide native bubble 3542 var style = document.createElement("style"); 3543 style.innerHTML = "#chatbase-bubble-button { " + 3544 "position: absolute !important;" + 3545 "width: 1px !important;" + 3546 "height: 1px !important;" + 3547 "opacity: 0 !important;" + 3548 "pointer-events: none !important;" + 3549 "overflow: hidden !important;" + 3550 "z-index: -1 !important;" + 3551 "}"; 3552 document.head.appendChild(style); 3553 3554 // Keep custom button placed (handles re-renders) 3555 setInterval(insertCustomChatButton, 1000); 3556 3557 /* ------- Collect ALL metadata, then send ONCE ------- */ 3558 3559 // URL params (sync) 3560 populateMetaFromUrl(); 3561 3562 // Optimizely (sync) 3563 meta.optimizelyEndUserId = getOptimizelyEndUserId(); 3564 3565 // EF booking object (accommodation selection) 3566 startEfBookingWatch(); 3567 3568 // EF Partners (async request) 3569 var utm = extractUtmFromDl(bestGuessDL()); 3570 fetchEfPartnersSourceCode(utm, function (err, result) { 3571 if (err) { 3572 console.warn("EF Partners lookup failed:", err && err.message ? err.message : err); 3573 } else { 3574 meta.sourceCode = result.sourceCode || ""; 3575 meta.eTag = result.eTag || ""; 3576 } 3577 gotPartners = true; // proceed either way 3578 maybeSendOnce("partners"); 3579 }); 3580 3581 // As a last resort, attempt send after a hard cap if still not sent 3582 setTimeout(function () { maybeSendOnce("hard-cap"); }, 8000); 3583 3584 /* ----- SPA navigation: keep UI behavior but DO NOT re-identify ----- */ 3585 (function patchHistoryForSpaEvents() { 3586 var pushState = history.pushState; 3587 var replaceState = history.replaceState; 3588 3589 history.pushState = function () { 3590 var ret = pushState.apply(history, arguments); 3591 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 3592 return ret; 3593 }; 3594 history.replaceState = function () { 3595 var ret = replaceState.apply(history, arguments); 3596 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 3597 return ret; 3598 }; 3599 window.addEventListener("popstate", function () { 3600 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 3601 }); 3602 3603 window.addEventListener("spa:navigation", function () { 3604 setTimeout(function () { 3605 insertCustomChatButton(); 3606 3607 // We intentionally DO NOT re-identify on SPA navigation. 3608 // If your routing changes URL params and you want the bot to reflect that, 3609 // you would need a decision on whether to allow re-identify updates. 3610 // Keeping behavior identical to current script. 3611 }, 150); 3612 }); 3613 })(); 3614 }; 3615 3616 if (document.readyState === "complete") { 3617 document.body.appendChild(script); 3618 } else { 3619 window.addEventListener("load", function () { 3620 document.body.appendChild(script); 3621 }); 3622 } 3623})(); 3624}, "dependencies": []}, {"id": "b2facf09cbee4eaf905a755bb4af440e", "type": "append", "selector": "head", "value": "<style>button[data-cy=\"gudl-chat-button\"] {\n width: 0 !important;\n height: 0 !important;\n color: transparent !important;\n background: transparent !important;\n border: none !important;\n pointer-events: none !important;\n}\n\nbutton[data-cy=\"gudl-chat-button\"] {\n visibility: hidden !important;\n}\n\n#chatbase-bubble-button {\n width: 1px !important;\n height: 1px !important;\n opacity: 0 !important;\n pointer-events: none !important;\n overflow: hidden !important;\n position: absolute !important;\n z-index: -1 !important;\n}</style>
3624", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5680852139507712"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5305197119930368"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5362792295825408", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "5708021439922176", "name": null, "commitId": "5587790809792512", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6032390322126848", "integrationSettings": null, "variations": [{"id": "5930983795458048", "name": null, "actions": [{"viewId": "4678826815389696", "changes": [{"id": "8E629181-E17D-47E2-A24F-28846DF6A031", "type": "custom_code", "value": function($){(() => { 3625 // ============================ 3626 // Robust ID Calendar (JP-structure, BlueConic-safe) 3627 // ============================ 3628 3629 // ---- CONFIG ---- 3630 const GRIDITEM_SELECTOR = "#mycal [component='GridItem' i]"; 3631 const GRIDITEM_INDEX_PREFERRED = 2; // 0-based (3rd) 3632 const MOUNT_FALLBACK_ID = "ef-id-calendar-mount"; 3633 3634 // ---- INIT GUARD (per-node) ---- 3635 const INIT_ATTR = "data-calendar-initialized"; 3636 3637 // ---- INDONESIA TIME HELPERS (default to WIB / UTC+7) ---- 3638 const ID_OFFSET_MINUTES = 7 * 60; // UTC+7 (Jakarta) 3639 function getNowID() { 3640 const localNow = new Date(); 3641 return new Date(localNow.getTime() + (localNow.getTimezoneOffset() + ID_OFFSET_MINUTES) * 60000); 3642 } 3643 function getIndonesiaLocalDateString(date) { 3644 const y = date.getFullYear(); 3645 const m = String(date.getMonth() + 1).padStart(2, "0"); 3646 const d = String(date.getDate()).padStart(2, "0"); 3647 return `${y}-${m}-${d}`; 3648 } 3649 3650 // ---- FIND OR CREATE TARGET ---- 3651 function resolveTarget() { 3652 const mycal = document.querySelector("#mycal"); 3653 if (!mycal) return null; 3654 3655 const nodes = mycal.querySelectorAll(GRIDITEM_SELECTOR); 3656 if (nodes.length > GRIDITEM_INDEX_PREFERRED) return nodes[GRIDITEM_INDEX_PREFERRED]; 3657 if (nodes.length > 0) return nodes[nodes.length - 1]; 3658 3659 let mount = mycal.querySelector("#" + MOUNT_FALLBACK_ID); 3660 if (!mount) { 3661 mount = document.createElement("div"); 3662 mount.id = MOUNT_FALLBACK_ID; 3663 mount.style.width = "100%"; 3664 mycal.appendChild(mount); 3665 } 3666 return mount; 3667 } 3668 3669 // ---- MAIN (idempotent per target node) ---- 3670 function createCalendar(targetDiv) { 3671 if (!targetDiv || targetDiv.getAttribute(INIT_ATTR) === "true") return; 3672 targetDiv.setAttribute(INIT_ATTR, "true"); 3673 3674 const calendarState = { 3675 startDate: getNowID(), 3676 endDate: new Date(2026, 5, 30), // 30 Jun 2026 (months 0â11) 3677 currentDayStart: getNowID(), 3678 selectedSlot: null, 3679 }; 3680 3681 function renderCalendar() { 3682 const weekDays = getCurrentWeek(calendarState.currentDayStart); 3683 const timeslots = generateTimeSlots("09:00", "18:00", 60); // 09:00â18:00 hourly 3684 const availabilityData = generateAvailabilityData(weekDays, timeslots); 3685 const currentYear = weekDays[0].getFullYear(); 3686 3687 let calendarHtml = ` 3688 <div class="calendar-navigation"> 3689 <button id="prevWeek" class="calendar-btn" ${isBeforeStart(weekDays[0]) ? "disabled" : ""}>â¹ Minggu Sebelumnya</button> 3690 <span class="calendar-title">${currentYear} - ${formatDate(weekDays[0])} - ${formatDate(weekDays[6])}</span> 3691 <button id="nextWeek" class="calendar-btn" ${isAfterEnd(weekDays[6]) ? "disabled" : ""}>Minggu Berikutnya âº</button> 3692 </div> 3693 <table class="timeslot-calendar"> 3694 <thead> 3695 <tr> 3696 <th>Waktu</th> 3697 ${weekDays.map(date => ` 3698 <th> 3699 ${formatDate(date)}<br> 3700 <span class="indonesian-day">${getIndonesianWeekday(date)}</span> 3701 </th> 3702 `).join("")} 3703 </tr> 3704 </thead> 3705 <tbody> 3706 ${timeslots.map(slot => ` 3707 <tr> 3708 <td>${slot}</td> 3709 ${weekDays.map(date => { 3710 const dateString = getIndonesiaLocalDateString(date); 3711 const availability = availabilityData[dateString][slot]; 3712 return ` 3713 <td class="timeslot ${availability.isAvailable ? "" : "unavailable"}" 3714 data-date="${dateString}" 3715 data-time="${slot}" 3716 ${availability.isAvailable ? `data-available-seats="${availability.seats}"` : ""}> 3717 ${availability.isAvailable ? `Sisa kuota ${availability.seats}` : "Ã"} 3718 </td>`; 3719 }).join("")} 3720 </tr>`).join("")} 3721 </tbody> 3722 </table> 3723 `; 3724 3725 targetDiv.innerHTML = calendarHtml; 3726 const live = targetDiv.querySelectorAll(".timeslot:not(.unavailable)"); 3727 live.forEach(cell =>
3727 cell.addEventListener("click", handleSlotClick)); 3728 const prev = targetDiv.querySelector("#prevWeek"); 3729 const next = targetDiv.querySelector("#nextWeek"); 3730 if (prev) prev.onclick = () => navigateWeek(-1); 3731 if (next) next.onclick = () => navigateWeek(1); 3732 } 3733 3734 function getCurrentWeek(currentDayStart) { 3735 const week = []; 3736 const base = stripTime(new Date(currentDayStart)); 3737 for (let i = 0; i < 7; i++) { 3738 const d = new Date(base); 3739 d.setDate(base.getDate() + i); 3740 week.push(d); 3741 } 3742 return week; 3743 } 3744 3745 function generateTimeSlots(start, end, interval) { 3746 const slots = []; 3747 let [h, m] = start.split(":").map(Number); 3748 const [eh, em] = end.split(":").map(Number); 3749 while (h < eh || (h === eh && m < em)) { 3750 slots.push(`${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`); 3751 m += interval; 3752 if (m >= 60) { m -= 60; h++; } 3753 } 3754 return slots; 3755 } 3756 3757 function generateAvailabilityData(dates, timeslots) { 3758 const data = {}; 3759 const idNow = getNowID(); 3760 const nowDateString = getIndonesiaLocalDateString(idNow); 3761 3762 // No specific blocked holiday dates were provided for ID. 3763 // Policy per request: Open MonâSat 09:00â18:00; Sundays fully closed. 3764 3765 dates.forEach(date => { 3766 const dateString = getIndonesiaLocalDateString(date); 3767 data[dateString] = {}; 3768 3769 const isToday = (dateString === nowDateString); 3770 const dow = date.getDay(); // 0=Sun ... 6=Sat 3771 3772 // 1) Sundays: all slots unavailable 3773 if (dow === 0) { 3774 timeslots.forEach(slot => data[dateString][slot] = { isAvailable: false, seats: 0 }); 3775 return; 3776 } 3777 3778 // 2) For MonâSat generate availability; optionally randomize a few closures 3779 const unavailableSlots = new Set(); 3780 const targetCount = Math.min(2, timeslots.length); // keep most open; close a couple randomly 3781 while (unavailableSlots.size < targetCount) { 3782 unavailableSlots.add(timeslots[Math.floor(Math.random() * timeslots.length)]); 3783 } 3784 3785 timeslots.forEach(slot => { 3786 const [sh, sm] = slot.split(":").map(Number); 3787 const slotDT = new Date(date); 3788 slotDT.setHours(sh, sm, 0, 0); 3789 3790 const isAvailable = (!isToday || slotDT > idNow) && !unavailableSlots.has(slot); 3791 data[dateString][slot] = { isAvailable, seats: isAvailable ? getRandomInt(1, 8) : 0 }; 3792 }); 3793 }); 3794 3795 return data; 3796 } 3797 3798 function getRandomInt(min, max) { 3799 return Math.floor(Math.random() * (max - min) + min); 3800 } 3801 3802 function formatDate(date) {
3803 const month = date.getMonth() + 1; 3804 const day = date.getDate(); 3805 return `${month}/${day}`; 3806 } 3807 3808 function getIndonesianWeekday(date) { 3809 const weekdays = ["(Minggu)", "(Senin)", "(Selasa)", "(Rabu)", "(Kamis)", "(Jumat)", "(Sabtu)"]; 3810 return weekdays[date.getDay()]; 3811 } 3812 3813 function stripTime(d) { 3814 const x = new Date(d); 3815 x.setHours(0,0,0,0); 3816 return x; 3817 } 3818 3819 function isBeforeStart(date) { 3820 return stripTime(date) <= stripTime(calendarState.startDate); 3821 } 3822 3823 function isAfterEnd(date) { 3824 return stripTime(date) >= stripTime(calendarState.endDate); 3825 } 3826 3827 function navigateWeek(offset) { 3828 calendarState.currentDayStart.setDate(calendarState.currentDayStart.getDate() + offset * 7); 3829 renderCalendar(); 3830 } 3831 3832 function handleSlotClick(event) { 3833 if (calendarState.selectedSlot) { 3834 calendarState.selectedSlot.classList.remove("selected"); 3835 } 3836 event.currentTarget.classList.add("selected"); 3837 calendarState.selectedSlot = event.currentTarget; 3838 3839 const selectedDate = event.currentTarget.getAttribute("data-date"); 3840 const selectedTime = event.currentTarget.getAttribute("data-time"); 3841 const availableSeats = event.currentTarget.getAttribute("data-available-seats"); 3842 console.log(`Selected slot: ${selectedDate} at ${selectedTime}, available seats: ${availableSeats}`); 3843 3844 const formattedDateTimeISO = `${selectedDate}T${selectedTime}:00`; 3845 3846 let testData = JSON.parse(sessionStorage.getItem("test-forms-additional-data")) || {}; 3847 testData.testConsultationDateTime = formattedDateTimeISO; 3848 sessionStorage.setItem("test-forms-additional-data", JSON.stringify(testData)); 3849 3850 const formattedDateTimeDisplay = `${selectedDate.replace(/-/g, "/")} ${selectedTime}`; 3851 3852 const richtextDiv = document.querySelector("#form-section .richtext"); 3853 if (richtextDiv && richtextDiv.children[1]) { 3854 let currentContent = richtextDiv.children[1].innerHTML; 3855 const isMobile = window.innerWidth <= 767; 3856 3857 if (isMobile) { 3858 if (!currentContent.includes("<br>")) { 3859 currentContent = currentContent.replace("[date]", `<br>${formattedDateTimeDisplay}`); 3860 } else { 3861 currentContent = currentContent.replace(/\[date\]|\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}/, formattedDateTimeDisplay); 3862 } 3863 } else { 3864 currentContent = currentContent 3865 .replace(/\[date\]|\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}/, formattedDateTimeDisplay) 3866 .replace(/<br>/g, ""); 3867 } 3868 3869 richtextDiv.children[1].innerHTML = currentContent; 3870 } 3871 3872 const formSection = document.getElementById("form-section"); 3873 if (formSection) { 3874 formSection.classList.remove("hidden", "!hidden", "sm:!hidden", "md:!hidden", "lg:!hidden", "xl:!hidden"); 3875 formSection.scrollIntoView({ behavior: "smooth", block: "start" }); 3876 } 3877 } 3878 3879 renderCalendar(); 3880 } 3881 3882 // ============================ 3883 // BOOTSTRAP (robust for BlueConic) 3884 // ============================ 3885 3886 function tryInitOnce() { 3887 const target = resolveTarget(); 3888 if (target) createCalendar(target); 3889 } 3890 3891 if (document.readyState === "loading") { 3892 document.addEventListener("DOMContentLoaded", tryInitOnce); 3893 } else { 3894 tryInitOnce(); 3895 } 3896 3897 const obs = new MutationObserver(() => tryInitOnce()); 3898 obs.observe(document.documentElement || document.body, { childList: true, subtree: true }); 3899 3900 let attempts = 0; 3901 const maxAttempts = 120; 3902 const poll = setInterval(() => { 3903 tryInitOnce(); 3904 attempts++; 3905 if (attempts >= maxAttempts) clearInterval(poll); 3906 }, 500); 3907})(); 3908}, "dependencies": []}, {"id": "1EEA5124-C8D9-4B6F-8898-AC3762466D40", "type": "append", "selector": "head", "value": "<style>#mycal {\n color: #333;\n margin: 0 auto;\n width: 100%;\n border-radius: 8px;\n background-color: #fff;\n }\n \n .timeslot-calendar {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n height: fit-content;\n }\n \n .timeslot-calendar th,\n .timeslot-calendar td {\n padding: 10px;\n text-align: center;\n border: 1px solid #e0e0e0;\n }\n \n .timeslot-calendar th {\n background-color: #003C64;\n color: #fff;\n font-weight: normal;\n }\n \n .timeslot-calendar .timeslot {\n cursor: pointer;\n transition: background-color 0.3s;\n }\n \n .timeslot-calendar .timeslot:hover {\n background-color: #e
39080f3ff;\n }\n \n .timeslot-calendar .selected {\n background-color: #0073e6;\n color: #fff;\n }\n\n .calendar-navigation {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n font-family: Arial, sans-serif;\n }\n .calendar-title {\n font-size: 16px;\n font-weight: bold;\n }\n .calendar-btn {\n background: #0073e6;\n border: none;\n color: #fff;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background 0.3s;\n }\n .calendar-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n }\n .calendar-btn:hover:not(:disabled) {\n background: #005bb5;\n }\n .japanese-day {\n font-size: 12px;\n color: #555;\n }\n .japanese-day {\n font-size: 12px;\n color: #FFF;\n }\n .timeslot.unavailable {\n background-color: #d3d3d3;\n color: #888;\n pointer-events: none;\n }\n .timeslot.selected {\n background-color: #0073e6;\n color: #FFF;\n }\n \n /* Mobile specific styles */\n @media (max-width: 767px) {\n .timeslot-calendar th,\n .timeslot-calendar td {\n font-size: 10px;\n } }</style>", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5708021439922176"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["4678826815389696"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "6032390322126848", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "5770119444430848", "name": null, "commitId": "5157386726408192", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "27831550777"], "audienceName": null, "changes": null, "id": "6590275393421312", "integrationSettings": null, "variations": [{"id": "4895504786522112", "name": null, "actions": [{"viewId": "4732588422594560", "changes": []}]}, {"id": "6394811767324672", "name": null, "actions": [{"viewId": "4732588422594560", "changes": [{"id": "d49bbc0fa4a14bfe8a488c8e106666e4", "src": "/actions/9ae7ab04d803e959bdcaa5ff0c99c71294d3a3c9457ea0278ba66d640650611d.js", "dependencies": [], "type": "custom_code"}, {"id": "B1C1CC6D-C46F-4C94-8F64-2FE3C461931D", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.pe/cc/test/brochure-advisorcall/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "4895504786522112", "endOfRange": 5000}, {"entityId": "6394811767324672", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5770119444430848"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4732588422594560"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5813454624260096", "name": null, "commitId": "4786792168161280", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5543413186035712", "integrationSettings": null, "variations": [{"id": "5250504670838784", "name": null, "actions": [{"viewId": "6387838116167680", "changes": [{"id": "7bc5e14f93d4467e951d0f541e25541d", "type": "custom_code", "value": function($){(function () { 3909 var chatbotId = "NwkDcCiXTH63g6rr8-qNU"; 3910 3911 /* ===== Disable floating messages BEFORE SDK loads ===== */ 3912 window.chatbaseConfig = { showFloatingInitialMessages: false }; 3913 3914 /* ================= Helpers (ES5) ================= */ 3915 function chatbaseReady() { 3916 try { 3917 return typeof window.chatbase === "function" && 3918 window.chatbase("getState") !== "uninitialized"; 3919 } catch (_e) { return false; } 3920 } 3921 3922 /* --- URL param helpers (ES5, robust decoding) --- */ 3923 function getQueryParam(name) { 3924 try { 3925 var qs = window.location && window.location.search ? window.location.search : ""; 3926 if (!qs || qs.length < 2) return ""; 3927 var query = qs.substring(1); 3928 var parts = query.split("&"); 3929 var i, kv, k, v; 3930 for (i = 0; i < parts.length; i++) { 3931 kv = parts[i].split("="); 3932 if (!kv || kv.length === 0) continue; 3933 k = kv[0] ? decodeURIComponent(kv[0].replace(/\+/g, " ")) : ""; 3934 if (k !== name) continue; 3935 v = kv.length > 1 ? kv.slice(1).join("=") : ""; 3936 v = v ? decodeURIComponent(v.replace(/\+/g, " ")) : ""; 3937 return v || ""; 3938 } 3939 } catch (_e) {} 3940 return ""; 3941 } 3942 3943 function deriveCountryCodeFromDestination(dest) { 3944 // destination expected like "US-NYC". Take first 2 chars. 3945 if (!dest || dest.length < 2) return ""; 3946 return String(dest).substring(0, 2).toLowerCase(); 3947 } 3948 3949 /* Optimizely end user id from Local Storage (robust scan) */ 3950 function getOptimizelyEndUserId() { 3951 try { 3952 var direct = localStorage.getItem("profile.visitorId"); 3953 if (direct) { 3954 try { 3955 var pd = JSON.parse(direct); 3956 if (pd && typeof pd === "object") { 3957 if (pd.endUserId) return String(pd.endUserId); 3958 if (pd.value) return String(pd.value); 3959 if (pd.id) return String(pd.id); 3960 } 3961 } catch (_ignore) {} 3962 return String(direct); 3963 } 3964 var i, k, v, obj; 3965 for (i = 0; i < localStorage.length; i++) { 3966 k = localStorage.key(i); 3967 if (k && k.indexOf("$visitor_profile") !== -1) { 3968 v = localStorage.getItem(k); 3969 if (!v) continue; 3970 try { obj = JSON.parse(v); } catch (_e) { obj = null; } 3971 if (obj) { 3972 if (obj.profile && obj.profile.visitorId) return String(obj.profile.visitorId); 3973 if (obj.visitorId) return String(obj.visitorId); 3974 } 3975 } 3976 } 3977 } catch (_e) {} 3978 return ""; 3979 } 3980 3981 /* ---- UTM -> EF Partners (sourceCode + eTag) ---- */ 3982 function extractUtmFromDl(dl) { 3983 var utm = { source: "(direct)", medium: "(none)", content: "noref" }; 3984 try { 3985 if (dl && dl.channel && dl.channel.utm && dl.channel.utm[0]) { 3986 var u = dl.channel.utm[0]; 3987 if (u.source) utm.source = String(u.source);
3988 if (u.medium) utm.medium = String(u.medium); 3989 if (u.content) utm.content = String(u.content); 3990 } 3991 } catch (_e) {} 3992 return utm; 3993 } 3994 3995 function bestGuessDL() { 3996 if (window.dl) return window.dl; 3997 if (window.dataLayer && window.dataLayer.length) { 3998 var i; 3999 for (i = window.dataLayer.length - 1; i >= 0; i--) { 4000 var it = window.dataLayer[i]; 4001 if (it && it.channel && it.channel.utm) return it; 4002 } 4003 } 4004 return null; 4005 } 4006 4007 function fetchEfPartnersSourceCode(utm, cb) { 4008 var url = "https://www.ef.fr/utm2efpartners/getefpartners/"; 4009 var xhr = new XMLHttpRequest(); 4010 xhr.open("POST", url, true); 4011 xhr.setRequestHeader("Content-Type", "application/json"); 4012 xhr.onreadystatechange = function () { 4013 if (xhr.readyState !== 4) return; 4014 if (xhr.status >= 200 && xhr.status < 300) { 4015 var data; 4016 try { data = JSON.parse(xhr.responseText); } catch (e) { return cb(e); } 4017 if (data && data.status === "Success" && data.result) { 4018 return cb(null, { 4019 sourceCode: data.result.sourceCode || "", 4020 eTag: data.result.eTag || "" 4021 }); 4022 } 4023 return cb(new Error((data && data.errorMessage) || "No partner match")); 4024 } 4025 cb(new Error("HTTP " + xhr.status)); 4026 }; 4027 try { 4028 xhr.send(JSON.stringify({ 4029 source: utm.source, 4030 medium: utm.medium, 4031 content: utm.content 4032 })); 4033 } catch (err) { cb(err); } 4034 } 4035 4036 /* =============== ONE-TIME IDENTIFY COORDINATOR =============== */ 4037 var meta = { 4038 destinationCode: "", 4039 productCode: "ils", 4040 courseCode: "", 4041 countryCode: "", 4042 duration: "", 4043 bookingFor: "", 4044 optimizelyEndUserId: "", 4045 sourceCode: "", 4046 eTag: "", 4047 accommodationType: "", 4048 residenceCode: "", 4049 roomType: "" 4050 }; 4051 4052 var gotPartners = false; 4053 var sentOnce = false; 4054 4055 function populateMetaFromUrl() { 4056 // destinationCode from URL param destination 4057 var dest = getQueryParam("destination"); 4058 meta.destinationCode = dest || ""; 4059 4060 // courseCode from URL param course 4061 meta.courseCode = getQueryParam("course") || ""; 4062 4063 // duration from URL param duration 4064 meta.duration = getQueryParam("duration") || ""; 4065 4066 // bookingFor from URL param bookingFor 4067 meta.bookingFor = getQueryParam("bookingFor") || ""; 4068 4069 // countryCode derived from destinationCode (first 2 letters lowercased) 4070 meta.countryCode = deriveCountryCodeFromDestination(meta.destinationCode); 4071 } 4072 4073 /* ---- EF Booking (window.__efBooking) -> user_metadata ---- */ 4074 function normalizeEfBooking(obj) { 4075 var b = (obj && typeof obj === "object") ? obj : {}; 4076 return { 4077 accommodationType: b.accommodationType ? String(b.accommodationType) : "", 4078 residenceCode: b.residenceCode ? String(b.residenceCode) : "", 4079 roomType: b.roomType ? String(b.roomType) : "" 4080 }; 4081 } 4082 4083 function efBookingSignature(b) { 4084 return (b.accommodationType || "") + "|" + (b.residenceCode || "") + "|" + (b.roomType || ""); 4085 } 4086 4087 function applyEfBookingToMeta(b) { 4088 meta.accommodationType = b.accommodationType || ""; 4089 meta.residenceCode = b.residenceCode || ""; 4090 meta.roomType = b.roomType || ""; 4091 } 4092 4093 var lastEfBookingSig = ""; 4094 4095 function sendUserMetadataUpdate(reason) { 4096 if (!chatbaseReady()) return; 4097 4098 // If initial identify has not happened yet, keep the existing gating behavior. 4099 if (!sentOnce) { 4100 maybeSendOnce(reason || "efBooking-pre"); 4101 return; 4102 } 4103 4104 try { 4105 window.chatbase("identify", { user_metadata: meta }); 4106 console.log("ð¦ [update] user_metadata updated:", reason, meta); 4107 } catch (e) { 4108 console.warn("â identify update failed:", e); 4109 } 4110 } 4111 4112 function readEfBookingAndMaybeUpdate(reason) { 4113 var b = normalizeEfBooking(window.__efBooking); 4114 var sig = efBookingSignature(b); 4115 if (sig === lastEfBookingSig) return; 4116 4117 lastEfBookingSig = sig; 4118 applyEfBookingToMeta(b); 4119 sendUserMetadataUpdate(reason || "efBooking-change"); 4120 } 4121 4122 function startEfBookingWatch() {
4123 // Initial sync (so first identify includes booking info when available). 4124 readEfBookingAndMaybeUpdate("efBooking-initial"); 4125 4126 // Capture re-assignments: window.__efBooking = {...} 4127 try { 4128 var current = window.__efBooking; 4129 Object.defineProperty(window, "__efBooking", { 4130 configurable: true, 4131 enumerable: true, 4132 get: function () { return current; }, 4133 set: function (v) { 4134 current = v; 4135 readEfBookingAndMaybeUpdate("efBooking-setter"); 4136 } 4137 }); 4138 } catch (_e) {} 4139 4140 // Capture in-place mutations: window.__efBooking.roomType = "single" 4141 setInterval(function () { 4142 readEfBookingAndMaybeUpdate("efBooking-poll"); 4143 }, 500); 4144 } 4145 4146 function maybeSendOnce(tag) { 4147 if (sentOnce) return; 4148 if (!chatbaseReady()) return; 4149 4150 // Same gating behavior as today: wait for partners AND require Optimizely end user id 4151 if (!gotPartners || !meta.optimizelyEndUserId) return; 4152 4153 try { 4154 window.chatbase("identify", { user_metadata: meta }); 4155 sentOnce = true; 4156 console.log("ð¦ [one-shot] user_metadata sent:", meta); 4157 } catch (e) { 4158 console.warn("â identify failed:", e); 4159 } 4160 } 4161 4162 /* ===== Place custom button & relay to native bubble ===== */ 4163 function insertCustomChatButton() { 4164 var stickyParent = document.querySelector('[data-clicksubregion="sticky"]'); 4165 if (!stickyParent || !stickyParent.firstElementChild) return; 4166 4167 var buttonGroup = stickyParent.firstElementChild; 4168 var anchors = buttonGroup.getElementsByTagName("a"); 4169 if (!anchors.length) return; 4170 4171 var firstAnchor = anchors[0]; 4172 if (!firstAnchor) return; 4173 4174 var existingBtn = document.getElementById("custom-chatbase-button"); 4175 if (existingBtn) { 4176 if (firstAnchor.nextSibling !== existingBtn) { 4177 buttonGroup.insertBefore(existingBtn, firstAnchor.nextSibling); 4178 } 4179 return; 4180 } 4181 4182 var customBtn = document.createElement("button"); 4183 customBtn.setAttribute("aria-label", "chatbase-custom-button"); 4184 customBtn.setAttribute("id", "custom-chatbase-button"); 4185 customBtn.setAttribute("type", "button"); 4186 customBtn.className = "md:order-4"; 4187 customBtn.style.cssText = 4188 "background: transparent; border: none; cursor: pointer; display: flex;" + 4189 "align-items: center; justify-content: center; width: 48px; height: 48px;" + 4190 "padding: 0px; margin-left: 10px;"; 4191 4192 var img = document.createElement("img"); 4193 img.src = "https://storage.googleapis.com/analytics_tactical/digital_factory/ori-chat-button.svg"; 4194 img.alt = "Chat"; 4195 img.width = 48; 4196 img.height = 48; 4197 customBtn.appendChild(img); 4198 4199 buttonGroup.insertBefore(customBtn, firstAnchor.nextSibling); 4200 4201 // Toggle Chatbase via native bubble 4202 customBtn.addEventListener("click", function () { 4203 var realChatBtn = document.getElementById("chatbase-bubble-button"); 4204 if (realChatBtn && typeof realChatBtn.click === "function") { 4205 realChatBtn.click(); 4206 } else { 4207 console.warn("â ï¸ Chatbase bubble not found"); 4208 } 4209 }); 4210 } 4211 4212 /* ===== Load Chatbase ===== */ 4213 var script = document.createElement("script"); 4214 script.src = "https://www.chatbase.co/embed.min.js"; 4215 script.defer = true; 4216 script.setAttribute("chatbotId", chatbotId); 4217 script.setAttribute("domain", "www.chatbase.co"); 4218 4219 script.onload = function () { 4220 // Hide native bubble 4221 var style = document.createElement("style"); 4222 style.innerHTML = "#chatbase-bubble-button { " + 4223 "position: absolute !important;" + 4224 "width: 1px !important;" + 4225 "height: 1px !important;" + 4226 "opacity: 0 !important;" + 4227 "pointer-events: none !important;" + 4228 "overflow: hidden !important;" + 4229 "z-index: -1 !important;" + 4230 "}"; 4231 document.head.appendChild(style); 4232 4233 // Keep custom button placed (handles re-renders) 4234 setInterval(insertCustomChatButton, 1000); 4235 4236 /* ------- Collect ALL metadata, then send ONCE ------- */ 4237 4238 // URL params (sync) 4239 populateMetaFromUrl(); 4240 4241 // Optimizely (sync) 4242 meta.optimizelyEndUserId = getOptimizelyEndUserId(); 4243 4244 // EF booking object (accommodation selection) 4245 startEfBookingWatch(); 4246 4247 // EF Partners (async request) 4248 var utm = extractUtmFromDl(bestGuessDL()); 4249 fetchEfPartnersSourceCode(utm, function (err, result) { 4250 if (err) { 4251 console.warn("EF Partners lookup failed:", err && err.message ? err.message : err); 4252 } else { 4253 meta.sourceCode = result.sourceCode || ""; 4254 meta.eTag = result.eTag || ""; 4255 } 4256 gotPartners = true; // proceed either way 4257 maybeSendOnce("partners"); 4258 }); 4259 4260 // As a last resort, attempt send after a hard cap if still not sent 4261 setTimeout(function () { maybeSendOnce("hard-cap"); }, 8000); 4262 4263 /* ----- SPA navigation: keep UI behavior but DO NOT re-identify ----- */ 4264 (function patchHistoryForSpaEvents() { 4265 var pushState = history.pushState; 4266 var replaceState = history.replaceState; 4267 4268 history.pushState = function () { 4269 var ret = pushState.apply(history, arguments); 4270 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 4271 return ret; 4272 }; 4273 history.replaceState = function () { 4274 var ret = replaceState.apply(history, arguments); 4275 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 4276 return ret; 4277 }; 4278 window.addEventListener("popstate", function () { 4279 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 4280 }); 4281 4282 window.addEventListener("spa:navigation", function () { 4283 setTimeout(function () { 4284 insertCustomChatButton(); 4285 4286 // We intentionally DO NOT re-identify on SPA navigation. 4287 // If your routing changes URL params and you want the bot to reflect that, 4288 // you would need a decision on whether to allow re-identify updates. 4289 // Keeping behavior identical to current script. 4290 }, 150); 4291 }); 4292 })(); 4293 }; 4294 4295 if (document.readyState === "complete") { 4296 document.body.appendChild(script); 4297 } else { 4298 window.addEventListener("load", function () { 4299 document.body.appendChild(script); 4300 }); 4301 } 4302})(); 4303}, "dependencies": []}, {"id": "3c0208b9898b4898830c794dae2a9947", "type": "append", "selector": "head", "value": "<style>button[data-cy=\"gudl-chat-button\"] {\n width: 0 !important;\n height: 0 !important;\n color: transparent !important;\n background: transparent !important;\n border: none !important;\n pointer-events: none !important;\n}\n\nbutton[data-cy=\"gudl-chat-button\"] {\n visibility: hidden !important;\n}\n\n#chatbase-bubble-button {\n width: 1px !important;\n height: 1px !important;\n opacity: 0 !important;\n pointer-events: none !important;\n overflow: hidden !important;\n position: absolute !important;\n z-index: -1 !important;\n}</style>
4303", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5813454624260096"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["6387838116167680"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5543413186035712", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "5822604756385792", "name": null, "commitId": "6433786521452544", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5167278579253248", "integrationSettings": null, "variations": [{"id": "4891531276976128", "name": null, "actions": [{"viewId": "4918093837762560", "changes": []}]}, {"id": "5779948013617152", "name": null, "actions": [{"viewId": "4918093837762560", "changes": [{"id": "51f56405dff542de9bd6ad43b245b823", "type": "custom_code", "value": function($){(function () { 4304 'use strict'; 4305 4306 var EXPERIMENT_NAME = 'fr-aya-cta-copy-update'; 4307 var DEBUG = false; 4308 4309 var CTA_SELECTOR = [ 4310 'a.ef-button', 4311 'button.ef-button', 4312 '[role="button"].ef-button', 4313 '[data-cy="cta"]', 4314 '[component="cta"]' 4315 ].join(','); 4316 4317 var ATTRIBUTE_NAMES = [ 4318 'aria-label', 4319 'title', 4320 'value', 4321 'data-label', 4322 'data-title', 4323 'data-cta-label' 4324 ]; 4325 4326 var COPY_MAP = { 4327 'Brochure gratuite': "J'obtiens ma brochure gratuite", 4328 'Free brochure': "J'obtiens ma brochure gratuite", 4329 4330 'Devis gratuit': "J'obtiens mon devis", 4331 'Free quote': "J'obtiens mon devis", 4332 4333 'Rencontrez un conseiller': 'Je réserve ma consultation', 4334 'Meet with an advisor': 'Je réserve ma consultation' 4335 }; 4336 4337 function isEligiblePage() { 4338 return /(^|\.)ef\.fr$/i.test(window.location.hostname) && 4339 /^\/aya(?:\/|$)/i.test(window.location.pathname); 4340 } 4341 4342 function log() { 4343 if (!DEBUG || !window.console) return; 4344 4345 var args = Array.prototype.slice.call(arguments); 4346 args.unshift('[' + EXPERIMENT_NAME + ']'); 4347 window.console.log.apply(window.console, args); 4348 } 4349 4350 function normalize(value) { 4351 return String(value || '').replace(/\s+/g, ' ').trim(); 4352 } 4353 4354 function getReplacement(value) { 4355 return COPY_MAP[normalize(value)] || null; 4356 } 4357 4358 function replaceTextNode(textNode) { 4359 var currentValue = textNode.nodeValue; 4360 var replacement = getReplacement(currentValue); 4361 4362 if (!replacement || normalize(currentValue) === replacement) return false; 4363 4364 var leadingWhitespace = (currentValue.match(/^\s*/) || [''])[0]; 4365 var trailingWhitespace = (currentValue.match(/\s*$/) || [''])[0]; 4366 4367 textNode.nodeValue = leadingWhitespace + replacement + trailingWhitespace; 4368 return true; 4369 } 4370 4371 function updateAttributes(element) { 4372 var changed = false; 4373 4374 for (var i = 0; i < ATTRIBUTE_NAMES.length; i += 1) { 4375 var attr = ATTRIBUTE_NAMES[i]; 4376 4377 if (!element.hasAttribute || !element.hasAttribute(attr)) continue; 4378 4379 var currentValue = element.getAttribute(attr); 4380 var replacement = getReplacement(currentValue); 4381 4382 if (replacement && currentValue !== replacement) { 4383 element.setAttribute(attr, replacement); 4384 changed = true; 4385 } 4386 } 4387 4388 return changed; 4389 } 4390 4391 function updateTextInside(element) { 4392 var changed = false; 4393 4394 var walker = document.createTreeWalker( 4395 element, 4396 NodeFilter.SHOW_TEXT, 4397 { 4398 acceptNode: function (node) { 4399 var parent = node.parentElement; 4400 4401 if (!parent) return NodeFilter.FILTER_REJECT; 4402 if (parent.closest('script, style, noscript, svg')) { 4403 return NodeFilter.FILTER_REJECT; 4404 } 4405 4406 return getReplacement(node.nodeValue) 4407 ? NodeFilter.FILTER_ACCEPT 4408 : NodeFilter.FILTER_REJECT; 4409 } 4410 }, 4411 false 4412 ); 4413 4414 var node; 4415 4416 while ((node = walker.nextNode())) { 4417 changed = replaceTextNode(node) || changed; 4418 } 4419 4420 return changed; 4421 } 4422 4423 function updateCtas() { 4424 if (!isEligiblePage() || !document.body) return; 4425 4426 var ctas = Array.prototype.slice.call( 4427 document.querySelectorAll(CTA_SELECTOR) 4428 ); 4429 4430 var changeCount = 0; 4431 4432 for (var i = 0; i < ctas.length; i += 1) { 4433 var cta = ctas[i]; 4434 4435 if (updateAttributes(cta)) changeCount += 1; 4436 if (updateTextInside(cta)) changeCount += 1; 4437 } 4438 4439 if (changeCount) { 4440 log('Updated CTA copy:', changeCount); 4441 } 4442 } 4443 4444 var scheduled = false;
4445 4446 function scheduleUpdate() { 4447 if (scheduled) return; 4448 4449 scheduled = true; 4450 4451 window.requestAnimationFrame(function () { 4452 scheduled = false; 4453 updateCtas(); 4454 }); 4455 } 4456 4457 function hookHistoryMethod(methodName) { 4458 var originalMethod = window.history[methodName]; 4459 4460 if (typeof originalMethod !== 'function') return; 4461 4462 window.history[methodName] = function () { 4463 var result = originalMethod.apply(this, arguments); 4464 4465 scheduleUpdate(); 4466 window.setTimeout(scheduleUpdate, 100); 4467 window.setTimeout(scheduleUpdate, 500); 4468 4469 return result; 4470 }; 4471 } 4472 4473 function init() { 4474 if (!isEligiblePage()) return; 4475 4476 scheduleUpdate(); 4477 4478 var observer = new MutationObserver(scheduleUpdate); 4479 4480 observer.observe(document.documentElement, { 4481 childList: true, 4482 subtree: true, 4483 characterData: true, 4484 attributes: true, 4485 attributeFilter: ATTRIBUTE_NAMES 4486 }); 4487 4488 hookHistoryMethod('pushState'); 4489 hookHistoryMethod('replaceState'); 4490 4491 window.addEventListener('popstate', scheduleUpdate); 4492 window.addEventListener('pageshow', scheduleUpdate); 4493 window.addEventListener('load', scheduleUpdate); 4494 4495 window.setInterval(scheduleUpdate, 1000); 4496 } 4497 4498 if (document.readyState === 'loading') { 4499 document.addEventListener('DOMContentLoaded', init); 4500 } else { 4501 init(); 4502 } 4503})(); 4504}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "4891531276976128", "endOfRange": 5000}, {"entityId": "5779948013617152", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5822604756385792"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4918093837762560"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "5871182147223552", "name": null, "commitId": "5672033103642624", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "4508353188069376", "integrationSettings": null, "variations": [{"id": "4825479077691392", "name": null, "actions": [{"viewId": "6104597043871744", "changes": [{"id": "505FCE4E-D218-4341-82BD-8745DF1FF627", "src": "/actions/afda0fc2d4f0a411fa31c7a4731d8a37de5fd7c93d80d8e510bd19d367aa6d3a.js", "dependencies": [], "type": "custom_code"}, {"id": "9D8A57F3-9A54-4CC7-A0D2-17995D55986B", "type": "append", "selector": "head", "value": "<style>#mycal {\n color: #333;\n margin: 0 auto;\n width: 100%;\n border-radius: 8px;\n background-color: #fff;\n }\n \n .timeslot-calendar {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n height: fit-content;\n }\n \n .timeslot-calendar th,\n .timeslot-calendar td {\n padding: 10px;\n text-align: center;\n border: 1px solid #e0e0e0;\n }\n \n .timeslot-calendar th {\n background-color: #003C64;\n color: #fff;\n font-weight: normal;\n }\n \n .timeslot-calendar .timeslot {\n cursor: pointer;\n transition: background-color 0.3s;\n }\n \n .timeslot-calendar .timeslot:hover {\n background-color: #e0f3ff;\n }\n \n .timeslot-calendar .selected {\n background-color: #0073e6;\n color: #fff;\n }\n\n .calendar-navigation {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n font-family: Arial, sans-serif;\n }\n .calendar-title {\n font-size: 16px;\n font-weight: bold;\n }\n .calendar-btn {\n background: #0073e6;\n border: none;\n color: #fff;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background 0.3s;\n }\n .calendar-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n }\n .calendar-btn:hover:not(:disabled) {\n background: #005bb5;\n }\n .japanese-day {\n font-size: 12px;\n color: #555;\n }\n .japanese-day {\n font-size: 12px;\n color: #FFF;\n }\n .timeslot.unavailable {\n background-color: #d3d3d3;\n color: #888;\n pointer-events: none;\n }\n .timeslot.selected {\n background-color: #0073e6;\n color: #FFF;\n }\n \n /* Mobile specific styles */\n @media (max-width: 767px) {\n .timeslot-calendar th,\n .timeslot-calendar td {\n font-size: 10px;\n } }</style>
4504", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "5871182147223552"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["6104597043871744"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "4508353188069376", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6011921965514752", "name": null, "commitId": "6686437989416960", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6323794556485632"], "audienceName": null, "changes": null, "id": "4868551406780416", "integrationSettings": null, "variations": [{"id": "4539814878380032", "name": null, "actions": []}, {"id": "6741993122955264", "name": null, "actions": [{"viewId": "6193389249495040", "changes": [{"id": "661b8cfc010442f9852d01a20efcdd2e", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": false, "preserveParameters": false, "dest": function redirectFn() { 4505document.cookie = "multipg_visit=true; Path=/; SameSite=Lax; Secure"; 4506return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search + window.location.hash; 4507} 4508}]}]}], "weightDistributions": [{"entityId": "4539814878380032", "endOfRange": 5000}, {"entityId": "6741993122955264", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6011921965514752"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6193389249495040"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6035470677704704", "name": null, "commitId": "5818861082116096", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5114261865758720", "integrationSettings": null, "variations": [{"id": "5753021481615360", "name": null, "actions": []}, {"id": "5275049872064512", "name": null, "actions": [{"viewId": "6261811897434112", "changes": [{"id": "fc8c679de4c54a22b0dcfd6f3aae3132", "type": "custom_code", "value": function($){(function () { 4509 window.optimizely = window.optimizely || []; 4510 optimizely.push({ type: "custom", eventName: "domChange", tags: {} }); 4511 4512 const PLAN_TRIP_COPY = "Zaplanuj swojÄ podróż"; 4513 const PRICE_COPY = "Oferta cenowa"; 4514 const BROCHURE_COPY = "Darmowy katalog"; 4515 const CONSULTATION_COPY = "Zarezerwuj konsultacjÄ"; 4516 4517 const BASE_PATH = "/ils"; 4518 const HOW_TO_BOOK_URL = "/ils/ab/how-to-book-online-booking/"; 4519 const PRICE_QUOTATION_URL = "/ils/price-quotation/"; 4520 const BROCHURE_URL = "/ils/brochure/"; 4521 const BOOK_NOW_URL = "/ils/book-now/"; 4522 const BOOK_NOW_V2_URL = "/ils/book-now-v2/"; 4523 const ONLINE_BOOKING_URL = "/ils/online-booking/"; 4524 4525 const STICKY_PLAN_TRIP_URL = "https://www.ef.pl/ils/ab/how-to-book-online-booking/"; 4526 const STICKY_PRICE_URL = "https://www.ef.pl/ils/price-quotation/"; 4527 const STICKY_BROCHURE_URL = "https://www.ef.pl/ils/brochure/"; 4528 const STICKY_CONSULTATION_URL = "https://www.ef.pl/ils/consultation-v2/"; 4529 4530 const MOBILE_HERO_HEIGHT = "35vh"; 4531 const MOBILE_MAX_WIDTH = 1024; 4532 4533 function isStickyExcludedPage() { 4534 return ( 4535 /^\/ils\/(ab\/how-to-book-online-booking|price-quotation|brochure)\/?$/.test( 4536 window.location.pathname 4537 ) || 4538 window.location.pathname.includes("/ils/online-booking/") 4539 ); 4540 } 4541 4542 function isCustomStickyBarItem(el) { 4543 return el.closest("#custom-sticky-action-bar") !== null; 4544 } 4545 4546 function isEfModalOpen() { 4547 return !!document.querySelector( 4548 '.ef-modal-overlay[data-state="open"], [role="dialog"][data-state="open"], [test-id="step-layout"][data-state="open"]' 4549 ); 4550 } 4551 4552 function updateCustomStickyVisibility() { 4553 const bar = document.getElementById("custom-sticky-action-bar"); 4554 if (!bar) return; 4555 4556 if (isEfModalOpen() || isStickyExcludedPage()) { 4557 bar.style.setProperty("display", "none", "important"); 4558 } else { 4559 bar.style.setProperty("display", "flex", "important"); 4560 } 4561 } 4562 4563 function isWhatsNextCta(el) { 4564 return ( 4565 el.closest('[data-sentry-source-file="whats-next.tsx"]') !== null || 4566 el.getAttribute("data-clicklabel") === "page:whats-next" 4567 ); 4568 } 4569 4570 function resizeMobileHeroImages() { 4571 const shouldResize = window.innerWidth <= MOBILE_MAX_WIDTH; 4572 4573 const selectors = [ 4574 '[data-cy="hero-image"]', 4575 '[data-cy="destination-hero"]', 4576 ".destination-hero", 4577 '#hero [data-sentry-component="HeroImage"]' 4578 ]; 4579 4580 const overlaySelectors = [ 4581 '[data-cy="destination-hero"] > .absolute', 4582 ".destination-hero > .absolute" 4583 ]; 4584
4585 document.querySelectorAll(selectors.join(",")).forEach((el) => { 4586 if (shouldResize) { 4587 el.style.setProperty("height", MOBILE_HERO_HEIGHT, "important"); 4588 el.style.setProperty("max-height", MOBILE_HERO_HEIGHT, "important"); 4589 el.style.setProperty("min-height", "0", "important"); 4590 } else { 4591 el.style.removeProperty("height"); 4592 el.style.removeProperty("max-height"); 4593 el.style.removeProperty("min-height"); 4594 } 4595 }); 4596 4597 document.querySelectorAll(overlaySelectors.join(",")).forEach((el) => { 4598 if (shouldResize) { 4599 el.style.setProperty("height", MOBILE_HERO_HEIGHT, "important"); 4600 el.style.setProperty("max-height", MOBILE_HERO_HEIGHT, "important"); 4601 } else { 4602 el.style.removeProperty("height"); 4603 el.style.removeProperty("max-height"); 4604 } 4605 }); 4606 } 4607 4608 function removeDestinationHeroInfoBox() { 4609 if (!/\/ils\/destinations\//.test(window.location.pathname)) return; 4610 4611 document.querySelectorAll('[data-cy="hero-info-box"]').forEach((box) => { 4612 const wrapper = box.parentElement; 4613 4614 if (wrapper) { 4615 wrapper.style.setProperty("display", "none", "important"); 4616 wrapper.setAttribute("hidden", "true"); 4617 wrapper.setAttribute("aria-hidden", "true"); 4618 } 4619 4620 box.style.setProperty("display", "none", "important"); 4621 box.setAttribute("hidden", "true"); 4622 box.setAttribute("aria-hidden", "true"); 4623 }); 4624 } 4625 4626 function addCustomStickyActionBar() { 4627 if (isStickyExcludedPage()) { 4628 const existingBar = document.getElementById("custom-sticky-action-bar"); 4629 if (existingBar) existingBar.remove(); 4630 return; 4631 } 4632 4633 document 4634 .querySelectorAll( 4635 '[data-sentry-source-file="sticky-cta.tsx"], [data-cy="sticky-action-bar"]' 4636 ) 4637 .forEach((el) => el.style.setProperty("display", "none", "important")); 4638 4639 const existingBar = document.getElementById("custom-sticky-action-bar"); 4640 4641 if (existingBar) { 4642 updateCustomStickyVisibility(); 4643 4644 const planTrip = existingBar.querySelector('[data-custom-sticky="plan-trip"]'); 4645 const price = existingBar.querySelector('[data-custom-sticky="price"]'); 4646 const brochure = existingBar.querySelector('[data-custom-sticky="brochure"]'); 4647 const consultation = existingBar.querySelector('[data-custom-sticky="consultation"]'); 4648 4649 if (planTrip) { 4650 planTrip.href = STICKY_PLAN_TRIP_URL; 4651 planTrip.textContent = PLAN_TRIP_COPY; 4652 } 4653 4654 if (price) { 4655 price.href = STICKY_PRICE_URL; 4656 price.textContent = PRICE_COPY; 4657 } 4658 4659 if (brochure) { 4660 brochure.href = STICKY_BROCHURE_URL; 4661 brochure.textContent = BROCHURE_COPY; 4662 } 4663 4664 if (consultation) { 4665 consultation.href = STICKY_CONSULTATION_URL; 4666 consultation.textContent = CONSULTATION_COPY; 4667 } 4668 4669 return; 4670 } 4671 4672 if (isEfModalOpen()) return; 4673 4674 const dotsSvg = ` 4675 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 256 256"> 4676 <path d="M112,60a16,16,0,1,1,16,16A16,16,0,0,1,112,60Zm16,52a16,16,0,1,0,16,16A16,16,0,0,0,128,112Zm0,68a16,16,0,1,0,16,16A16,16,0,0,0,128,180Z"></path> 4677 </svg> 4678 `; 4679 4680 const closeSvg = ` 4681 <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 256 256"> 4682 <path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"></path> 4683 </svg> 4684 `; 4685 4686 const bar = document.createElement("div"); 4687 bar.id = "custom-sticky-action-bar"; 4688 bar.style.cssText = ` 4689 position: fixed; 4690 left: 0; 4691 right: 0; 4692 bottom: 0; 4693 z-index: 10000; 4694 display: flex; 4695 justify-content: flex-end; 4696 width: 100%; 4697 padding: 16px; 4698 box-sizing: border-box; 4699 background: linear-gradient(to bottom, transparent, white 88%); 4700 `; 4701 4702 bar.innerHTML = ` 4703 <div style="display:flex; flex-direction:column; align-items:flex-end; gap:8px;"> 4704 <div id="custom-extra-actions" style="display:none; flex-direction:column; align-items:flex-end; gap:8px;"> 4705 <a data-custom-sticky="brochure" href="${STICKY_BROCHURE_URL}" style="border-radius:9999px;padding:10px 22px;background:white;color:#0075e1;font:EF Circular VF, Helvetica, Open Sans, Gill Sans MT, Gill Sans, Corbel, Arial, sans-serif;text-decoration:none;border:1px solid #0075e1;">${BROCHURE_COPY}</a> 4706 <a data-custom-sticky="price" href="${STICKY_PRICE_URL}
4706" style="border-radius:9999px;padding:10px 22px;background:white;color:#0075e1;font:EF Circular VF, Helvetica, Open Sans, Gill Sans MT, Gill Sans, Corbel, Arial, sans-serif;text-decoration:none;border:1px solid #0075e1;">${PRICE_COPY}</a> 4707 <a data-custom-sticky="consultation" href="${STICKY_CONSULTATION_URL}" style="border-radius:9999px;padding:10px 22px;background:white;color:#0075e1;font:EF Circular VF, Helvetica, Open Sans, Gill Sans MT, Gill Sans, Corbel, Arial, sans-serif;text-decoration:none;border:1px solid #0075e1;">${CONSULTATION_COPY}</a> 4708 </div> 4709 4710 <div style="display:flex; align-items:center; gap:8px;"> 4711 <a data-custom-sticky="plan-trip" href="${STICKY_PLAN_TRIP_URL}" style="border-radius:9999px;padding:12px 24px;background:#0075e1;color:white;font:EF Circular VF, Helvetica, Open Sans, Gill Sans MT, Gill Sans, Corbel, Arial, sans-serif;text-decoration:none;">${PLAN_TRIP_COPY}</a> 4712 4713 <button id="custom-toggle-actions" type="button" aria-label="WiÄcej opcji" style=" 4714 width:48px; 4715 height:48px; 4716 border-radius:9999px; 4717 border:1px solid #0075e1; 4718 background:white; 4719 color:#0075e1; 4720 display:flex; 4721 align-items:center; 4722 justify-content:center; 4723 cursor:pointer; 4724 padding:0; 4725 ">${dotsSvg}</button> 4726 </div> 4727 </div> 4728 `; 4729 4730 document.body.appendChild(bar); 4731 updateCustomStickyVisibility(); 4732 4733 let open = false; 4734 const extra = bar.querySelector("#custom-extra-actions"); 4735 const toggle = bar.querySelector("#custom-toggle-actions"); 4736 4737 toggle.addEventListener("click", () => { 4738 open = !open; 4739 extra.style.display = open ? "flex" : "none"; 4740 toggle.innerHTML = open ? closeSvg : dotsSvg; 4741 toggle.setAttribute("aria-label", open ? "Zamknij opcje" : "WiÄcej opcji"); 4742 }); 4743 } 4744 4745 function isPriceTable(button) { 4746 return button.closest('[data-cy="course-price-list-item"]') !== null; 4747 } 4748 4749 function isNavMenuItem(el) { 4750 return ( 4751 el.closest("nav") !== null || 4752 el.closest(".ef-desktop-menu") !== null || 4753 el.getAttribute("role") === "menuitem" 4754 ); 4755 } 4756 4757 function setButtonText(btn, text) { 4758 const span = 4759 btn.querySelector("span span") || 4760 btn.querySelector('span[aria-hidden="true"]') || 4761 btn.querySelector(".text-ui-label span") || 4762 btn.querySelector(".text-ui-label-small span"); 4763 4764 if (span) span.textContent = text; 4765 btn.setAttribute("aria-label", text); 4766 } 4767 4768 function restoreNavMenuLinks() { 4769 document.querySelectorAll('nav a, a[role="menuitem"], .ef-desktop-menu a').forEach((a) => { 4770 const label = (a.getAttribute("aria-label") || a.textContent || "").trim(); 4771 4772 if (/darmowy katalog|katalog|broszura|gratis brochure|free brochure/i.test(label)) { 4773 a.href = BROCHURE_URL; 4774 a.dataset.originalHref = BROCHURE_URL; 4775 a.removeAttribute("data-ef-cta-fixed"); 4776 return; 4777 } 4778 4779 if (/oferta cenowa|wycena|price quotation|price quote|pricing/i.test(label)) { 4780 a.href = PRICE_QUOTATION_URL; 4781 a.dataset.originalHref = PRICE_QUOTATION_URL; 4782 a.removeAttribute("data-ef-cta-fixed"); 4783 return; 4784 } 4785 }); 4786 } 4787 4788 function unhideSections() { 4789 const sectionIds = [ 4790 "online-booking-page", 4791 "hero-online-booking", 4792 "online-booking-home-page", 4793 "online-booking-destination-overview", 4794 "online-booking-modal" 4795 ]; 4796 4797 sectionIds.forEach((id) => { 4798 const el = document.getElementById(id); 4799 if (el) { 4800 el.style.display = ""; 4801 el.hidden = false; 4802 el.classList.remove("hidden", "d-none", "visually-hidden"); 4803 el.removeAttribute("aria-hidden"); 4804 } 4805 }); 4806 } 4807 4808 function hideRecommendedForYou() { 4809 const el = document.getElementById("recommendedforyou"); 4810 if (el) { 4811 el.style.display = "none"; 4812 el.setAttribute("hidden", "true"); 4813 el.classList.add("hidden", "d-none", "visually-hidden"); 4814 el.setAttribute("aria-hidden", "true"); 4815 } 4816 } 4817 4818 function hideHeroPersistentIfIls() { 4819 if (!/^\/ils\/?$/.test(window.location.pathname)) return; 4820 4821 function applyHide(el) { 4822 if (!el) return; 4823 el.style.setProperty("display", "none", "important"); 4824 el.setAttribute("hidden", "true"); 4825 el.setAttribute("aria-hidden", "true"); 4826 el.classList.add("hidden", "d-none", "visually-hidden"); 4827 } 4828 4829 const el = document.getElementById("hero"); 4830 if (el) applyHide(el); 4831 4832 const obs = new MutationObserver(() => { 4833 const el = document.getElementById("hero"); 4834 if (el) applyHide(el); 4835 }); 4836 4837 obs.observe(document.documentElement, { childList: true, subtree: true }); 4838 4839 setInterval(() => { 4840 const el = document.getElementById("hero"); 4841 if (el) applyHide(el); 4842 }, 500); 4843 } 4844 4845 function updateNavBoekNuLinks() { 4846 document.querySelectorAll("a").forEach((a) => {
4847 if (isCustomStickyBarItem(a)) return; 4848 if (isNavMenuItem(a)) return; 4849 if (isWhatsNextCta(a)) return; 4850 4851 const bookingSpan = Array.from(a.querySelectorAll("span")).find((s) => 4852 /boek nu|book now|zarezerwuj|zapisz siÄ|aplikuj/i.test(s.textContent.trim()) 4853 ); 4854 4855 if ( 4856 bookingSpan && 4857 a.href && 4858 ( 4859 a.href.includes(BOOK_NOW_URL) || 4860 a.href.includes(BOOK_NOW_V2_URL) || 4861 a.href.includes(ONLINE_BOOKING_URL) 4862 ) 4863 ) { 4864 if (a.href !== HOW_TO_BOOK_URL && a.dataset.efCtaFixed !== "true") { 4865 a.href = HOW_TO_BOOK_URL; 4866 a.dataset.efCtaFixed = "true"; 4867 } 4868 } 4869 }); 4870 } 4871 4872 function updateCtaBookNowToOnlineBooking() { 4873 document.querySelectorAll('a.ef-button[data-cy="cta"], a[data-cy="cta"]').forEach((a) => { 4874 if (isCustomStickyBarItem(a)) return; 4875 if (isNavMenuItem(a)) return; 4876 if (isWhatsNextCta(a)) return; 4877 4878 if ( 4879 a.href && 4880 ( 4881 a.href.includes(BOOK_NOW_V2_URL) || 4882 a.href.includes(BOOK_NOW_URL) 4883 ) 4884 ) { 4885 if (a.href !== HOW_TO_BOOK_URL && a.dataset.efCtaFixed !== "true") { 4886 a.href = HOW_TO_BOOK_URL; 4887 a.dataset.efCtaFixed = "true"; 4888 } 4889 } 4890 }); 4891 } 4892 4893 function getSelectedWeeks() { 4894 const inputs = document.querySelectorAll( 4895 'input[name*="duration"], input[id*="duration"], input[data-duration], select[name*="duration"]' 4896 ); 4897 4898 for (const i of inputs) { 4899 const val = i.value || i.getAttribute("value") || i.dataset.duration; 4900 if (val && /^\d+$/.test(val)) return val; 4901 } 4902 4903 const dataEl = document.querySelector("[data-duration], [data-weeks], [data-week]"); 4904 if (dataEl) { 4905 const val = 4906 dataEl.dataset.duration || 4907 dataEl.dataset.weeks || 4908 dataEl.dataset.week || 4909 dataEl.getAttribute("data-duration"); 4910 4911 if (val && /^\d+$/.test(val)) return val; 4912 } 4913 4914 const sel = document.querySelector( 4915 '[aria-pressed="true"], [aria-selected="true"], .week.selected, .week.active, .is-selected, .is-active, .selected' 4916 ); 4917 4918 if (sel) { 4919 const m = (sel.textContent || "").match(/\d+/); 4920 if (m) return m[0]; 4921 } 4922 4923 const buttons = document.querySelectorAll( 4924 '[data-cy*="week"], .ef-week, .week, .weeks button, .week-selector button, .ef-week-selector button, .weeks-selector button' 4925 ); 4926 4927 for (const b of buttons) { 4928 if ( 4929 b.getAttribute("aria-pressed") === "true" || 4930 b.getAttribute("aria-selected") === "true" || 4931 b.classList.contains("selected") || 4932 b.classList.contains("active") || 4933 b.classList.contains("is-selected") 4934 ) { 4935 const mm = (b.textContent || "").match(/\d+/); 4936 if (mm) return mm[0]; 4937 } 4938 } 4939 4940 return null; 4941 } 4942 4943 function setDurationInAnchor(anchor, weeks) { 4944 if (!weeks) return; 4945 if (isCustomStickyBarItem(anchor)) return; 4946 if (isNavMenuItem(anchor)) return; 4947 if (isWhatsNextCta(anchor)) return; 4948 4949 try { 4950 const u = new URL(anchor.href, location.origin); 4951 4952 if ( 4953 u.pathname.startsWith(HOW_TO_BOOK_URL) || 4954 u.pathname.startsWith(ONLINE_BOOKING_URL) || 4955 u.pathname.startsWith(BOOK_NOW_V2_URL) || 4956 u.pathname.startsWith(BOOK_NOW_URL) 4957 ) { 4958 if ( 4959 anchor.href !== u.origin + HOW_TO_BOOK_URL && 4960 anchor.dataset.efCtaFixed !== "true" 4961 ) { 4962 anchor.href = u.origin + HOW_TO_BOOK_URL; 4963 anchor.dataset.efCtaFixed = "true"; 4964 } 4965 } else if (u.pathname.startsWith(PRICE_QUOTATION_URL)) { 4966 u.searchParams.set("duration", weeks); 4967 anchor.href = u.href; 4968 } 4969 } catch (err) { 4970 if (anchor.href.indexOf(PRICE_QUOTATION_URL) !== -1) { 4971 if (anchor.href.match(/duration=\d+/)) { 4972 anchor.href = anchor.href.replace(/duration=\d+/, "duration=" + weeks); 4973 } else if (anchor.href.indexOf("?") === -1) { 4974 anchor.href = anchor.href + "?duration=" + weeks; 4975 } else { 4976 anchor.href = anchor.href + "&duration=" + weeks; 4977 } 4978 } 4979 } 4980 } 4981 4982 function updateAllDurations(weeks) { 4983 if (!weeks) return; 4984 4985 const anchors = document.querySelectorAll( 4986 `a[href*="${HOW_TO_BOOK_URL}"], a[href*="${BOOK_NOW_V2_URL}"], a[href*="${BOOK_NOW_URL}"], a[href*="${PRICE_QUOTATION_URL}"], a[href*="${BROCHURE_URL}"], a[data-cy="cta"]` 4987 ); 4988
4989 anchors.forEach((a) => { 4990 if (isCustomStickyBarItem(a)) return; 4991 if (isNavMenuItem(a)) return; 4992 if (isWhatsNextCta(a)) return; 4993 4994 if (!a.dataset.originalHref) a.dataset.originalHref = a.href; 4995 setDurationInAnchor(a, weeks); 4996 }); 4997 } 4998 4999 function step1_convertPriceToBook() { 5000 const priceButtons = document.querySelectorAll(`a[href*="${PRICE_QUOTATION_URL}"]`); 5001 5002 priceButtons.forEach((btn) => { 5003 if (isCustomStickyBarItem(btn)) return; 5004 if (isWhatsNextCta(btn)) return; 5005 if (isPriceTable(btn)) return; 5006 if (isNavMenuItem(btn)) return; 5007 if (!btn.dataset.originalHref) btn.dataset.originalHref = btn.href; 5008 if (btn.closest("#double-cta")) return; 5009 if (btn.closest(".ef-call-to-action-container")) return; 5010 if (btn.closest('[data-cy="button-group"]')) return; 5011 5012 const newHref = (btn.dataset.originalHref || btn.href) 5013 .replace(PRICE_QUOTATION_URL, HOW_TO_BOOK_URL); 5014 5015 if (btn.href !== newHref && btn.dataset.efCtaFixed !== "true") { 5016 btn.href = newHref; 5017 btn.dataset.efCtaFixed = "true"; 5018 } 5019 5020 setButtonText(btn, PLAN_TRIP_COPY); 5021 }); 5022 } 5023 5024 function step2_convertBrochureToPrice() { 5025 const brochureButtons = document.querySelectorAll(`a[href*="${BROCHURE_URL}"]`); 5026 5027 brochureButtons.forEach((btn) => { 5028 if (isCustomStickyBarItem(btn)) return; 5029 if (isWhatsNextCta(btn)) return; 5030 if (isNavMenuItem(btn)) return; 5031 if (!btn.dataset.originalHref) btn.dataset.originalHref = btn.href; 5032 if (btn.closest("#double-cta")) return; 5033 if (btn.closest(".ef-call-to-action-container")) return; 5034 if (btn.closest('[data-cy="button-group"]')) return; 5035 5036 btn.href = PRICE_QUOTATION_URL; 5037 5038 if (!isPriceTable(btn)) setButtonText(btn, PRICE_COPY); 5039 }); 5040 } 5041 5042 function fixHeaderCtas() { 5043 document.querySelectorAll(".ef-call-to-action-container").forEach((container) => { 5044 if (container.closest(".ef-desktop-menu")) return; 5045 5046 const outlinedBtn = 5047 container.querySelector("a.ef-button-outlined") || 5048 container.querySelector("a.ef-button-secondary"); 5049 5050 const filledBtn = 5051 container.querySelector("a.ef-button-filled") || 5052 container.querySelector("a.ef-button-primary"); 5053 5054 if (outlinedBtn) { 5055 outlinedBtn.href = PRICE_QUOTATION_URL; 5056 outlinedBtn.dataset.originalHref = PRICE_QUOTATION_URL; 5057 outlinedBtn.removeAttribute("data-ef-cta-fixed"); 5058 outlinedBtn.removeAttribute("target"); 5059 setButtonText(outlinedBtn, PRICE_COPY); 5060 } 5061 5062 if (filledBtn) { 5063 filledBtn.href = HOW_TO_BOOK_URL; 5064 filledBtn.dataset.originalHref = HOW_TO_BOOK_URL; 5065 filledBtn.dataset.efCtaFixed = "true"; 5066 filledBtn.removeAttribute("target"); 5067 setButtonText(filledBtn, PLAN_TRIP_COPY); 5068 } 5069 }); 5070 } 5071 5072 function fixDestinationWhatsIncludedCtas() { 5073 if (!/\/ils\/destinations\//.test(window.location.pathname)) return; 5074 5075 document 5076 .querySelectorAll('.ef-button-group[data-cy="button-group"]') 5077 .forEach((group) => { 5078 if (group.querySelector('a[data-clicklabel="page:whats-next"]')) return; 5079 5080 const whatsIncludedButtons = group.querySelectorAll( 5081 'a[data-cy="cta"][data-clicklabel="page:whats-included"]' 5082 ); 5083 5084 if (!whatsIncludedButtons.length) return; 5085 5086 const primaryBtn = group.querySelector( 5087 'a.ef-button-filled[data-clicklabel="page:whats-included"]' 5088 ); 5089 5090 const secondaryBtn = group.querySelector( 5091 'a.ef-button-outlined[data-clicklabel="page:whats-included"]' 5092 ); 5093 5094 if (primaryBtn) { 5095 primaryBtn.href = HOW_TO_BOOK_URL; 5096 primaryBtn.dataset.originalHref = HOW_TO_BOOK_URL; 5097 primaryBtn.dataset.efCtaFixed = "true"; 5098 primaryBtn.removeAttribute("target"); 5099 setButtonText(primaryBtn, PLAN_TRIP_COPY); 5100 } 5101 5102 if (secondaryBtn) { 5103 secondaryBtn.href = PRICE_QUOTATION_URL; 5104 secondaryBtn.dataset.originalHref = PRICE_QUOTATION_URL; 5105 secondaryBtn.removeAttribute("data-ef-cta-fixed"); 5106 secondaryBtn.removeAttribute("target"); 5107 setButtonText(secondaryBtn, PRICE_COPY); 5108 } 5109 }); 5110 } 5111 5112 function doubleCtaSpecificAdjustments() { 5113 const doubleCtaSection = document.getElementById("double-cta"); 5114 if (!doubleCtaSection) return; 5115 5116 const buttonGroup = doubleCtaSection.querySelector('div.ef-button-group[data-cy="button-group"]'); 5117 if (!buttonGroup) return; 5118 5119 const priceQuotationButton = 5120 buttonGroup.querySelector("a.ef-button-secondary") || 5121 buttonGroup.querySelector("a.ef-button-outlined"); 5122 5123 const planTripButton = 5124 buttonGroup.querySelector("a.ef-button-primary") || 5125 buttonGroup.querySelector("a.ef-button-filled"); 5126 5127 if (!priceQuotationButton || !planTripButton) return; 5128 5129 if (buttonGroup.children[0] !== priceQuotationButton) { 5130 buttonGroup.insertBefore(priceQuotationButton, buttonGroup.firstChild); 5131 } 5132 5133 if (buttonGroup.children[1] !== planTripButton) { 5134 buttonGroup.insertBefore(planTripButton, priceQuotationButton.nextSibling); 5135 } 5136 5137 setButtonText(priceQuotationButton, PRICE_COPY); 5138 priceQuotationButton.href = PRICE_QUOTATION_URL; 5139 priceQuotationButton.target = ""; 5140 priceQuotationButton.dataset.originalHref = PRICE_QUOTATION_URL; 5141 priceQuotationButton.removeAttribute("data-ef-cta-fixed"); 5142 5143 setButtonText(planTripButton, PLAN_TRIP_COPY); 5144 planTripButton.href = HOW_TO_BOOK_URL; 5145 planTripButton.removeAttribute("target"); 5146 planTripButton.dataset.originalHref = HOW_TO_BOOK_URL; 5147 planTripButton.dataset.efCtaFixed = "true"; 5148 } 5149 5150 function hideOldMenuItems() { 5151 document.querySelectorAll(".ef-menu-trigger, .ef-nav-folder-button").forEach((elem) => { 5152 if ( 5153 elem.textContent && 5154 (/hoe je kunt boeken|boek nu|jak zarezerwowaÄ|zarezerwuj/i).test(elem.textContent) 5155 ) { 5156 if (elem.closest("li")) elem.closest("li").style.display = "none"; 5157 } 5158 }); 5159 5160 document.querySelectorAll(`a[href="${BASE_PATH}/how-to-book/"], a[href="${BOOK_NOW_URL}"]`).forEach((a) => { 5161 if (a.closest("li")) a.closest("li").style.display = "none"; 5162 }); 5163 } 5164 5165 function addDirectMenuLink() { 5166 const navUl = document.querySelector("nav.ef-nav-list ul.lg\\:flex"); 5167 if (!navUl) return; 5168 5169 if (navUl.querySelector(`a[href="${HOW_TO_BOOK_URL}"]`)) return; 5170 5171 const newLi = document.createElement("li"); 5172 newLi.className = "ef-nav-item list-none"; 5173 5174 const newA = document.createElement("a"); 5175 newA.className = 'ef-nav-item-link group/nav-link rounded-xxs text-header-nav-on-surface group flex h-full cursor-pointer items-center outline-0 pr-m group-data-[variant="extended"]/root:pb-xxs rtl:pl-m group-first/nav-link:rtl:pl-m group-first/nav-link:pl-0 group-last/nav-link:pr-0 rtl:pr-0 group-last/nav-link:rtl:pl-0'; 5176 newA.href = HOW_TO_BOOK_URL; 5177 newA.tabIndex = 0; 5178 newA.dataset.active = "false"; 5179 newA.setAttribute("data-clicklabel", "global-header:site-menu"); 5180 5181 const outerSpan = document.createElement("span"); 5182 outerSpan.className = 5183 'ef-link-content group-has-[[data-active=true]]/nav-menu-trigger:[.ef-nav-folder-button_&]:after:bg-header-primary after:-bottom-xs after:animate-link-underline group-data-[active=true]/nav-link:after:bg-header-primary relative after:absolute after:left-0 after:right-0 after:hidden after:h-[3px] after:bg-current after:content-[\'\'] group-hover:after:block ef-nav-item-content gap-xxs text-ui-label-small text-header-nav-on-surface group-data-[active=true]/nav-link:text-ui-label-small-bold group-has-[[data-active=true]]/nav-menu-trigger:text-ui-label-small-bold flex items-center'; 5184 5185 const innerSpan = document.createElement("span"); 5186 innerSpan.className = "line-clamp-2 select-none text-left"; 5187 innerSpan.textContent = PLAN_TRIP_COPY; 5188 5189 outerSpan.appendChild(innerSpan); 5190 newA.appendChild(outerSpan); 5191 newLi.appendChild(newA); 5192 5193 const moreDropdown = Array.from(navUl.children).find((li) => 5194 li.textContent && (/meer|wiÄcej/i).test(li.textContent) 5195 ); 5196 5197 if (moreDropdown) { 5198 navUl.insertBefore(newLi, moreDropdown); 5199 } else { 5200 navUl.appendChild(newLi); 5201 } 5202 } 5203 5204 function persist() { 5205 hideOldMenuItems(); 5206 addDirectMenuLink(); 5207 restoreNavMenuLinks(); 5208 resizeMobileHeroImages(); 5209 removeDestinationHeroInfoBox(); 5210 addCustomStickyActionBar(); 5211 updateCustomStickyVisibility(); 5212 fixHeaderCtas(); 5213 fixDestinationWhatsIncludedCtas(); 5214 } 5215 5216 persist(); 5217 5218 const nav = document.querySelector("nav.ef-nav-list"); 5219 if (nav) { 5220 const observerNav = new MutationObserver(persist); 5221 observerNav.observe(nav, { childList: true, subtree: true }); 5222 } 5223 5224 var observer; 5225 5226 function runUpdatesWithoutFlicker() { 5227 if (observer) observer.disconnect(); 5228 5229 restoreNavMenuLinks(); 5230 5231 step1_convertPriceToBook(); 5232 step2_convertBrochureToPrice(); 5233 doubleCtaSpecificAdjustments(); 5234 updateNavBoekNuLinks(); 5235 updateCtaBookNowToOnlineBooking(); 5236 fixHeaderCtas(); 5237 fixDestinationWhatsIncludedCtas(); 5238 5239 const weeks = getSelectedWeeks(); 5240 if (weeks) updateAllDurations(weeks); 5241 5242 doubleCtaSpecificAdjustments(); 5243 fixHeaderCtas(); 5244 fixDestinationWhatsIncludedCtas(); 5245 5246 unhideSections(); 5247 hideRecommendedForYou(); 5248 hideHeroPersistentIfIls(); 5249 5250 resizeMobileHeroImages(); 5251 removeDestinationHeroInfoBox(); 5252 addCustomStickyActionBar(); 5253 updateCustomStickyVisibility(); 5254 5255 persist(); 5256 restoreNavMenuLinks(); 5257 doubleCtaSpecificAdjustments(); 5258 fixHeaderCtas(); 5259 fixDestinationWhatsIncludedCtas(); 5260 updateCustomStickyVisibility(); 5261 5262 if (observer) observer.observe(document.documentElement, { childList: true, subtree: true }); 5263 } 5264 5265 function attachWeekSelectionListeners() { 5266 document.addEventListener( 5267 "click", 5268 function () { 5269 setTimeout(() => { 5270 const w = getSelectedWeeks(); 5271 if (w) updateAllDurations(w); 5272 doubleCtaSpecificAdjustments(); 5273 fixHeaderCtas(); 5274 fixDestinationWhatsIncludedCtas(); 5275 addCustomStickyActionBar(); 5276 updateCustomStickyVisibility(); 5277 }, 40); 5278 }, 5279 true 5280 ); 5281 } 5282 5283 function debounce(fn, ms) { 5284 let t; 5285 return function () { 5286 clearTimeout(t); 5287 t = setTimeout(fn, ms); 5288 }; 5289 } 5290 5291 const debouncedRun = debounce(() => { 5292 runUpdatesWithoutFlicker(); 5293 attachWeekSelectionListeners(); 5294 updateCustomStickyVisibility(); 5295 }, 200); 5296 5297 observer = new MutationObserver(debouncedRun); 5298 observer.observe(document.documentElement, { childList: true, subtree: true }); 5299 5300 window.addEventListener("resize", resizeMobileHeroImages); 5301 5302 runUpdatesWithoutFlicker(); 5303 attachWeekSelectionListeners(); 5304 5305 setInterval(() => { 5306 if (observer) observer.disconnect(); 5307 runUpdatesWithoutFlicker(); 5308 updateCustomStickyVisibility(); 5309 if (observer) observer.observe(document.documentElement, { childList: true, subtree: true }); 5310 }, 2000); 5311})(); 5312}, "dependencies": []}, {"css": {}, "dependencies": [], "attributes": {"hide": true}, "type": "attribute", "id": "6ae3970612c54226bdfb649b7995be9b", "selector": "[data-cy='hero-info-box']"}]}]}], "weightDistributions": [{"entityId": "5753021481615360", "endOfRange": 5000}, {"entityId": "5275049872064512", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6035470677704704"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6261811897434112"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6064103093960704", "name": null, "commitId": "4852834896707584", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5395959593566208", "integrationSettings": null, "variations": [{"id": "5110514456461312", "name": null, "actions": [{"viewId": "4833009640144896", "changes": []}]}, {"id": "4513651441270784", "name": null, "actions": [{"viewId": "4833009640144896", "changes": [{"id": "250ce40da0ff4ab7bb3bf1b95373817e", "type": "custom_code", "value": function($){// inject last spots 5313var EXPERIMENT_ID = "optly-faplatserkvar"; 5314var MAX_TRIPS = 6; 5315var BUTTON_TEXT = "Entdecke unsere Gruppenreisen"; 5316var LAST_SPOTS_HEADER = "Limitierte Plätze verfügbar"; 5317var JUNO_MARKET_CODE = "atv"; 5318console.log("LTONB: Experiment script started version ATV.20260722.1"); 5319 5320function normalizeLtPath(path) { 5321 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 5322 if (match) return match[1] + "/"; 5323 return path; 5324} 5325 5326function fetchLastSpots() { 5327 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 5328 .then(function (response) { 5329 if (!response.ok) { 5330 throw new Error("Network response was not ok"); 5331 } 5332 return response.json(); 5333 }) 5334 .then(function (data) { 5335 var items = Array.isArray(data) 5336 ? data 5337 : Array.isArray(data && data.items) 5338 ? data.items 5339 : Array.isArray(data && data.trips) 5340 ? data.trips 5341 : null; 5342 5343 if (!items) { 5344 throw new Error("Expected trips in response payload"); 5345 } 5346 5347 var today = new Date(); 5348 today.setHours(0, 0, 0, 0); 5349 var availableTrips = items 5350 .map(function (trip) { 5351 var availableDeparture = (trip.availabilities || []) 5352 .filter(function (availability) { 5353 var startDate = new Date(availability.startDate + "T00:00:00"); 5354 return availability.availableSpots >= 1 && startDate >= today; 5355 }) 5356 .sort(function (a, b) { 5357 return a.availableSpots - b.availableSpots || a.price - b.price; 5358 })[0]; 5359 5360 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 5361 }) 5362 .filter(Boolean); 5363 5364 availableTrips.sort(function (a, b) { 5365 return a.availableSpots - b.availableSpots || a.price - b.price; 5366 }); 5367 5368 return availableTrips.slice(0, MAX_TRIPS); 5369 }) 5370 .catch(function (error) { 5371 console.error("There was a problem with the fetch operation:", error); 5372 return []; 5373 }); 5374} 5375 5376function escapeHtml(value) { 5377 return String(value) 5378 .replace(/&/g, "&") 5379 .replace(/</g, "<") 5380 .replace(/>/g, ">") 5381 .replace(/"/g, """) 5382 .replace(/'/g, "'"); 5383} 5384 5385function formatCurrency(amount, currency, locale) { 5386 if (typeof amount !== "number" || !currency) return ""; 5387 try { 5388 return new Intl.NumberFormat(locale, { 5389 style: "currency", 5390 currency: currency, 5391 currencyDisplay: "symbol", 5392 minimumFractionDigits: 0, 5393 maximumFractionDigits: 2 5394 }).format(amount); 5395 } catch (error) { 5396 console.warn("Could not format currency", error); 5397 return String(amount); 5398 } 5399} 5400 5401function getLocale() { 5402 return document.documentElement.lang || navigator.language || "sv-SE"; 5403} 5404 5405function renderTripCard(trip, locale) { 5406 var title = escapeHtml(trip && trip.title ? trip.title : ""); 5407 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 5408 var image = 5409 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 5410 var currency = trip && trip.currency ? trip.currency : ""; 5411 var originalAmount = 5412 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 5413 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 5414 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 5415 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 5416 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 5417 5418 return ( 5419 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 5420 href + 5421 '">' + 5422 '<div class="ef-card-body z-10 flex h-full w-
5422full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 5423 '<div class="flex w-full items-center">' + 5424 (image 5425 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 5426 title + 5427 '" src="' + 5428 image + 5429 '" width="100%" height="100%"></div>' 5430 : "") + 5431 '<div class="flex w-full items-center justify-between px-2">' + 5432 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 5433 title + 5434 "</span></p>" + 5435 '<div class="flex shrink-0 items-center gap-1">' + 5436 (originalAmount > discountedAmount 5437 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 5438 originalPrice + 5439 "</span></p>" 5440 : "") + 5441 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 5442 discountedPrice + 5443 "</span></p>" + 5444 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>' + 5445 "</div>" + 5446 "</div>" + 5447 "</div>" + 5448 "</div>" + 5449 "</a>" 5450 ); 5451} 5452 5453function onElementVisible(selector, callback) { 5454 var seen = new WeakMap(); 5455 5456 function isVisible(el) { 5457 var style = getComputedStyle(el); 5458 return ( 5459 style.display !== "none" && 5460 style.visibility !== "hidden" && 5461 style.opacity !== "0" && 5462 el.offsetParent !== null 5463 ); 5464 } 5465 5466 function check() { 5467 document.querySelectorAll(selector).forEach((el) => { 5468 var visible = isVisible(el); 5469 var prev = seen.get(el); 5470 5471 // Trigger only when it becomes visible (false â true) 5472 if (visible && !prev) { 5473 console.log("LTONB: Element became visible for selector '" + selector + "'"); 5474 callback(el); 5475 } 5476 5477 seen.set(el, visible); 5478 }); 5479 } 5480 5481 // Initial check 5482 check(); 5483 5484 var observer = new MutationObserver(check); 5485 5486 observer.observe(document.body, { 5487 childList: true, 5488 subtree: true, 5489 attributes: true, 5490 attributeFilter: ["style", "class", "hidden"] 5491 }); 5492 5493 return observer; // so you can disconnect() later if needed 5494} 5495 5496function replaceHTML(target, trips) { 5497 if (document.getElementById(EXPERIMENT_ID)) return; 5498 if (!trips || !trips.length) { 5499 console.warn("LTONB: No trips returned for replacement"); 5500 return; 5501 } 5502 if (!target) { 5503 console.warn("LTONB: Target element not available for replacement"); 5504 return; 5505 } 5506 5507 var locale = getLocale(); 5508 var cardsHtml = trips 5509 .map(function (trip) { 5510 return renderTripCard(trip, locale); 5511 }) 5512 .join(""); 5513 5514 var wrapper = document.createElement("div"); 5515 wrapper.id = EXPERIMENT_ID; 5516 5517 wrapper.innerHTML = ` 5518 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 5519 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 5520 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 5521 ${cardsHtml} 5522 </div> 5523 </div> 5524 </section> 5525 `; 5526 5527 target.replaceWith(wrapper); 5528} 5529 5530function replaceText(node, newText) { 5531 if (node.nodeType === Node.TEXT_NODE) { 5532 node.textContent = newText; 5533 } else { 5534 node.childNodes.forEach((child) => replaceText(child, newText)); 5535 } 5536} 5537 5538function updateHero() { 5539 // hide original hero 5540 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 5541 if (hero) { 5542 hero.style.setProperty("display", "none", "important"); 5543 } else { 5544 console.warn("LTONB: Original hero element not found"); 5545 } 5546 5547 // show test hero 5548 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 5549 if (testHero) { 5550 testHero.style.setProperty("display", "block", "important"); 5551 testHero.style.setProperty("visibility", "visible", "important"); 5552 testHero.style.setProperty("opacity", "1", "important"); 5553 testHero.removeAttribute("hidden"); 5554 testHero.classList.remove("hidden"); 5555 } else { 5556 console.warn("LTONB: Test hero element not found"); 5557 } 5558} 5559 5560function updateHeroButton() { 5561 var testHeroOffersButton = document.querySelector( 5562 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 5563 ); 5564 if (testHeroOffersButton) { 5565 replaceText(testHeroOffersButton, BUTTON_TEXT); 5566 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 5567 } else { 5568 console.warn("LTONB: Offers button in test hero not found"); 5569 } 5570} 5571 5572function updatePromotionsCarousel(target, trips) { 5573 var element = document.querySelector(target); 5574 var headerElement = document.querySelector( 5575 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 5576 ); 5577 if (headerElement && element) { 5578 replaceText(headerElement, LAST_SPOTS_HEADER); 5579 replaceHTML(element, trips); 5580 } 5581} 5582 5583onElementVisible('[data-cy="promotions-carousel-container"]', function () { 5584 fetchLastSpots().then(function (trips) { 5585 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 5586 }); 5587}); 5588 5589onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 5590 updateHeroButton(); 5591}); 5592 5593onElementVisible('#hero, .hero, [data-component="hero"]', function () { 5594 updateHero(); 5595}); 5596}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5110514456461312", "endOfRange": 1000}, {"entityId": "4513651441270784", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6064103093960704"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4833009640144896"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6158055140753408", "name": null, "commitId": "6067374422491136", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6373700566515712", "integrationSettings": null, "variations": [{"id": "5751831228317696", "name": null, "actions": [{"viewId": "4800556504449024", "changes": [{"id": "5b7f3beb5776413095285f87856429b2", "type": "redirect", "depen
5596dencies": [], "dest": "https://www.ef.com.cn/homepage/", "preserveParameters": true, "allowAdditionalRedirect": true}]}]}, {"id": "5029318475120640", "name": null, "actions": [{"viewId": "4800556504449024", "changes": [{"id": "04ec5505f9944d66aeca9f3cc85736a2", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.cn/new/", "preserveParameters": true, "allowAdditionalRedirect": true}]}]}, {"id": "5188881274896384", "name": null, "actions": [{"viewId": "4800556504449024", "changes": [{"id": "2b5150428b3a462d9c670d47e455f2c8", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.cn/home-v2/", "preserveParameters": true, "allowAdditionalRedirect": true}]}]}], "weightDistributions": [{"entityId": "5751831228317696", "endOfRange": 3334}, {"entityId": "5029318475120640", "endOfRange": 6667}, {"entityId": "5188881274896384", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6158055140753408"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4800556504449024"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6228379129610240", "name": null, "commitId": "4893896203829248", "groupId": null, "holdback": 1000, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6139402137632768"], "audienceName": null, "changes": null, "id": "4955712002981888", "integrationSettings": null, "variations": [{"id": "4821004246056960", "name": null, "actions": [{"viewId": "5627891564675072", "changes": [{"id": "cc78c7e4cde1487795530289587a4ad1", "type": "custom_code", "value": function($){// 1) Market configuration (merged + expanded) 5597const marketConfig = { 5598 ar: { 5599 text: 'Reservá una cita personalizada', 5600 url: 'https://www.ef.com.ar/aya/consultation/', 5601 }, 5602 at: { 5603 text: 'Einen Beratungstermin buchen', 5604 url: 'https://www.ef.at/aya/consultation/', 5605 }, 5606 au: { 5607 text: 'Book a consultation', 5608 url: 'https://www.ef-australia.com.au/aya/consultation/', 5609 }, 5610 be: { 5611 text: 'Prendre rendez-vous', 5612 url: 'https://www.ef.be/fr/aya/consultation/', 5613 }, 5614 br: { 5615 text: 'Marque uma consulta', 5616 url: 'https://www.ef.com.br/aya/consultation/', 5617 }, 5618 bx: { 5619 text: 'Boek een consultatie', 5620 url: 'https://www.ef.be/nl/aya/consultation/', 5621 }, 5622 ca: { 5623 text: 'Book a consultation', 5624 url: 'https://www.ef.com/ca/aya/consultation/', 5625 }, 5626 ch: { 5627 text: 'Réservez une consultation', 5628 url: 'https://www.efswiss.ch/fr/aya/consultation/', 5629 }, 5630 cl: { 5631 text: 'Reserva una asesorÃa', 5632 url: 'https://www.ef.com/cl/aya/consultation/', 5633 }, 5634 cn: { text: 'é¢çº¦å¨è¯¢', url: 'https://www.ef.com.cn/aya/consultation/' }, 5635 co: { 5636 text: 'Reserva una asesorÃa', 5637 url: 'https://www.ef.com.co/aya/consultation/', 5638 }, 5639 cs: { 5640 text: 'Buche einen Beratungstermin', 5641 url: 'https://www.efswiss.ch/de/aya/consultation/', 5642 }, 5643 ct: { 5644 text: 'Prenota una consulenza', 5645 url: 'https://www.efswiss.ch/it/aya/consultation/', 5646 }, 5647 cz: { 5648 text: 'Objednejte se na schůzku', 5649 url: 'https://www.ef-czech.cz/aya/consultation/', 5650 }, 5651 de: { 5652 text: 'Buche einen Beratungstermin', 5653 url: 'https://www.ef.de/aya/consultation/', 5654 }, 5655 dk: { 5656 text: 'Book en konsultation', 5657 url: 'https://www.ef-danmark.dk/aya/consultation/', 5658 }, 5659 do: { 5660 text: 'Book a consultation', 5661 url: 'https://www.ef.do/aya/consultation/', 5662 }, 5663 dx: { text: 'Ø§ØØ¬Ø² استشارة', url: 'https://www.ef.dz/ar/aya/consultation/' }, 5664 dz: { 5665 text: 'Réservez une consultation', 5666 url: 'https://www.ef.dz/fr/aya/consultation/', 5667 }, 5668 ec: { 5669 text: 'Reserva una consulta', 5670 url: 'https://www.ef.com.ec/aya/consultation/', 5671 }, 5672 es: { 5673 text: 'Agenda una llamada/cita', 5674 url: 'https://www.ef.com.es/aya/consultation/', 5675 }, 5676 fc: { 5677 text: 'Réservez une consultation', 5678 url: 'https://www.ef.com/cafr/aya/consultation/', 5679 }, 5680 fi: { 5681 text: 'Varaa konsultaatio', 5682 url: 'https://www.ef.fi/aya/consultation/', 5683 }, 5684 fr: { 5685 text: 'Rencontrez un conseiller', 5686 url: 'https://www.ef.fr/aya/consultation/', 5687 }, 5688 gb: { 5689 text: 'Book a consultation', 5690 url: 'https://www.ef.co.uk/aya/consultation/', 5691 }, 5692 hk: { text: 'é ç´è«®è©¢', url: 'https://www.ef.com.hk/aya/consultation/' }, 5693 hu: { 5694 text: 'Foglalj konzultációt', 5695 url: 'https://www.ef.co.hu/aya/consultation/', 5696 }, 5697 id: { 5698 text: 'Daftar konsultasi', 5699 url: 'https://www.ef.co.id/aya/consultation/', 5700 }, 5701 it: { 5702 text: 'Incontra un consulente', 5703 url: 'https://www.ef-italia.it/aya/consultation/', 5704 }, 5705 jp: { 5706 text: 'ã«ã¦ã³ã»ãªã³ã°äºç´', 5707 url: 'https://www.efjapan.co.jp/aya/consultation/', 5708 }, 5709 kr: {
5710 text: '1:1 컨ì¤í ìì½í기', 5711 url: 'https://www.ef.co.kr/aya/consultation/', 5712 }, 5713 kz: { 5714 text: 'ÐабÑониÑÑйÑе конÑÑлÑÑаÑиÑ', 5715 url: 'https://www.ef.com/kz/aya/consultation/', 5716 }, 5717 lu: { 5718 text: 'Prendre rendez-vous', 5719 url: 'https://www.ef.lu/fr/aya/consultation/', 5720 }, 5721 lv: { 5722 text: 'RezervÄjiet konsultÄciju', 5723 url: 'https://www.ef.lv/aya/consultation/', 5724 }, 5725 mx: { 5726 text: 'Solicita una reunión informativa', 5727 url: 'https://www.ef.com.mx/aya/consultation/', 5728 }, 5729 nl: { text: 'Boek een consult', url: 'https://www.ef.nl/aya/consultation/' }, 5730 no: { 5731 text: 'Bestill gratis veiledning', 5732 url: 'https://www.ef.no/aya/consultation/', 5733 }, 5734 pa: { 5735 text: 'Reserva una consulta', 5736 url: 'https://www.ef.com.pa/aya/consultation/', 5737 }, 5738 pe: { 5739 text: 'Reserve una consulta', 5740 url: 'https://www.ef.com.pe/aya/consultation/', 5741 }, 5742 pl: { 5743 text: 'Zarezerwuj konsultacjÄ', 5744 url: 'https://www.ef.pl/aya/consultation/', 5745 }, 5746 pt: { 5747 text: 'Marcar uma reunião', 5748 url: 'https://www.ef.edu.pt/aya/consultation/', 5749 }, 5750 ro: { 5751 text: 'RezervÄ o consultaÈie', 5752 url: 'https://www.ef.ro/aya/consultation/', 5753 }, 5754 sa: { text: 'Ø§ØØ¬Ø² استشارة', url: 'https://www.ef.com/sa/aya/consultation/' }, 5755 se: { 5756 text: 'Boka en konsultation', 5757 url: 'https://www.ef.se/aya/consultation/', 5758 }, 5759 si: { 5760 text: 'NaroÄite se na posvet', 5761 url: 'https://www.ef.si/aya/consultation/', 5762 }, 5763 sk: { 5764 text: 'Dohodnite si konzultáciu', 5765 url: 'https://www.ef-slovakia.sk/aya/consultation/', 5766 }, 5767 sx: { 5768 text: 'Book a consultation', 5769 url: 'https://www.ef.com/saen/aya/consultation/', 5770 }, 5771 th: { text: 'à¸à¸à¸à¸à¸´à¸§à¸à¸£à¸¶à¸à¸©à¸²', url: 'https://www.ef.co.th/aya/consultation/' }, 5772 tn: { 5773 text: 'Réservez une consultation', 5774 url: 'https://www.ef.tn/fr/aya/consultation/', 5775 }, 5776 tr: { 5777 text: 'DanıÅmanlık randevusu alın', 5778 url: 'https://www.ef.com.tr/aya/consultation/', 5779 }, 5780 tw: { text: 'é ç´è«®è©¢', url: 'https://www.ef.com.tw/aya/consultation/' }, 5781 tx: { text: 'Ø§ØØ¬Ø² استشارة', url: 'https://www.ef.tn/ar/aya/consultation/' }, 5782 us: { 5783 text: 'Book a consultation', 5784 url: 'https://www.ef.edu/aya/consultation/', 5785 }, 5786 ve: { 5787 text: 'Reserve una consulta', 5788 url: 'https://www.ef.com/ve/aya/consultation/', 5789 }, 5790 vn: { 5791 text: 'Äặt lá»ch tư vấn', 5792 url: 'https://www.ef.com.vn/aya/consultation/', 5793 }, 5794 wc: { 5795 text: 'Rencontrez un conseiller', 5796 url: 'https://www.ef.com/wwfr/aya/consultation/', 5797 }, 5798 we: { 5799 text: 'Book a consultation', 5800 url: 'https://www.ef.com/wwen/aya/consultation/', 5801 }, 5802 wl: { 5803 text: 'Reserve una consulta', 5804 url: 'https://www.ef.com/wwes/aya/consultation/', 5805 }, 5806 wm: { 5807 text: 'Ø§ØØ¬Ø² استشارة', 5808 url: 'https://www.ef.com/wwar/aya/consultation/', 5809 }, 5810 wp: { 5811 text: 'Marque uma consulta', 5812 url: 'https://www.ef.com/wwpt/aya/consultation/', 5813 }, 5814 wr: { 5815 text: 'ÐапиÑаÑÑÑÑ Ð½Ð° конÑÑлÑÑаÑиÑ', 5816 url: 'https://www.ef.com/wwru/aya/consultation/', 5817 }, 5818}; 5819// 2 Update brochure button with market-specific config 5820function updateBrochureButton() { 5821 const market = window.dl.page.market_code; 5822 const config = marketConfig[market]; 5823 if (!config) { 5824 return; 5825 } 5826 const brochureBtn = document.querySelector( 5827 'a[href*="/aya/brochure/"][data-clicklabel="page:sticky"]' 5828 ); 5829 if (brochureBtn) { 5830 brochureBtn.href = config.url; 5831 const span = brochureBtn.querySelector('span span'); 5832 if (span) { 5833 span.textContent = config.text; 5834 } 5835 } else { 5836 // Retry if button hasn't loaded yet 5837 setTimeout(updateBrochureButton, 500); 5838 } 5839} 5840// 3) Run the update 5841updateBrochureButton(); 5842}, "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6228379129610240"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5627891564675072"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "4955712002981888", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6237585094213632", "name": null, "commitId": "6310520819548160", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "27831550777"], "audienceName": null, "changes": null, "id": "4652794982957056", "integrationSettings": null, "variations": [{"id": "6276085650817024", "name": null, "actions": [{"viewId": "5127185455906816", "changes": []}]}
5842, {"id": "6228839399948288", "name": null, "actions": [{"viewId": "5127185455906816", "changes": [{"id": "3f1150906a9f408c9d5005d10b3edc68", "src": "/actions/0440f1cfd4a5dd1d3cab79dd45dde641206a15fc3d8d35d1a78971ad0f77e709.js", "dependencies": [], "type": "custom_code"}, {"id": "d51665b63cc94c138f1c113ca13a2810", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.pe/cc/test/brochure-advisorcall/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "6276085650817024", "endOfRange": 5000}, {"entityId": "6228839399948288", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6237585094213632"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5127185455906816"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6248870355664896", "name": null, "commitId": "5127821452902400", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5430552921112576", "integrationSettings": null, "variations": [{"id": "4917567932858368", "name": null, "actions": [{"viewId": "6481704425095168", "changes": []}]}, {"id": "4564935229833216", "name": null, "actions": [{"viewId": "6481704425095168", "changes": [{"id": "18aae58ada3e4d94bf3857d9d0a2aa24", "type": "custom_code", "value": function($){// inject last spots 5843var EXPERIMENT_ID = "optly-faplatserkvar"; 5844var MAX_TRIPS = 6; 5845var BUTTON_TEXT = "Découvrez nos séjours";
5846var LAST_SPOTS_HEADER = "Dernières places disponibles"; 5847var JUNO_MARKET_CODE = "frp"; 5848console.log("LTONB: Experiment script started version FRP.20260722.1"); 5849 5850function normalizeLtPath(path) { 5851 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 5852 if (match) return match[1] + "/"; 5853 return path; 5854} 5855 5856function fetchLastSpots() { 5857 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 5858 .then(function (response) { 5859 if (!response.ok) { 5860 throw new Error("Network response was not ok"); 5861 } 5862 return response.json(); 5863 }) 5864 .then(function (data) { 5865 var items = Array.isArray(data) 5866 ? data 5867 : Array.isArray(data && data.items) 5868 ? data.items 5869 : Array.isArray(data && data.trips) 5870 ? data.trips 5871 : null; 5872 5873 if (!items) { 5874 throw new Error("Expected trips in response payload"); 5875 } 5876 5877 var today = new Date(); 5878 today.setHours(0, 0, 0, 0); 5879 var availableTrips = items 5880 .map(function (trip) { 5881 var availableDeparture = (trip.availabilities || []) 5882 .filter(function (availability) { 5883 var startDate = new Date(availability.startDate + "T00:00:00"); 5884 return availability.availableSpots >= 1 && startDate >= today; 5885 }) 5886 .sort(function (a, b) { 5887 return a.availableSpots - b.availableSpots || a.price - b.price; 5888 })[0]; 5889 5890 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 5891 }) 5892 .filter(Boolean); 5893 5894 availableTrips.sort(function (a, b) { 5895 return a.availableSpots - b.availableSpots || a.price - b.price; 5896 }); 5897 5898 return availableTrips.slice(0, MAX_TRIPS); 5899 }) 5900 .catch(function (error) { 5901 console.error("There was a problem with the fetch operation:", error); 5902 return []; 5903 }); 5904} 5905 5906function escapeHtml(value) { 5907 return String(value) 5908 .replace(/&/g, "&") 5909 .replace(/</g, "<") 5910 .replace(/>/g, ">") 5911 .replace(/"/g, """) 5912 .replace(/'/g, "'"); 5913} 5914 5915function formatCurrency(amount, currency, locale) { 5916 if (typeof amount !== "number" || !currency) return ""; 5917 try { 5918 return new Intl.NumberFormat(locale, { 5919 style: "currency", 5920 currency: currency, 5921 currencyDisplay: "symbol", 5922 minimumFractionDigits: 0, 5923 maximumFractionDigits: 2 5924 }).format(amount); 5925 } catch (error) { 5926 console.warn("Could not format currency", error); 5927 return String(amount); 5928 } 5929} 5930 5931function getLocale() { 5932 return document.documentElement.lang || navigator.language || "sv-SE"; 5933} 5934 5935function renderTripCard(trip, locale) { 5936 var title = escapeHtml(trip && trip.title ? trip.title : ""); 5937 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 5938 var image = 5939 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 5940 var currency = trip && trip.currency ? trip.currency : ""; 5941 var originalAmount = 5942 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 5943 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 5944 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 5945 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 5946 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 5947 5948 return ( 5949 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 5950 href + 5951 '">' + 5952 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 5953 '<div class="flex w-full items-center">' + 5954 (image 5955 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 5956 title + 5957 '" src="' + 5958 image + 5959 '" width="100%" height="100%"></div>' 5960 : "") + 5961 '<div class="flex w-full items-center justify-between px-2">' + 5962 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 5963 title + 5964 "</span></p>" + 5965 '<div class="flex shrink-0 items-center gap-1">' + 5966 (originalAmount > discountedAmount 5967 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 5968 originalPrice + 5969 "</span></p>" 5970 : "") + 5971 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 5972 discountedPrice + 5973 "</span></p>" + 5974 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
5974' + 5975 "</div>" + 5976 "</div>" + 5977 "</div>" + 5978 "</div>" + 5979 "</a>" 5980 ); 5981} 5982 5983function onElementVisible(selector, callback) { 5984 var seen = new WeakMap(); 5985 5986 function isVisible(el) { 5987 var style = getComputedStyle(el); 5988 return ( 5989 style.display !== "none" && 5990 style.visibility !== "hidden" && 5991 style.opacity !== "0" && 5992 el.offsetParent !== null 5993 ); 5994 } 5995 5996 function check() { 5997 document.querySelectorAll(selector).forEach((el) => { 5998 var visible = isVisible(el); 5999 var prev = seen.get(el); 6000 6001 // Trigger only when it becomes visible (false â true) 6002 if (visible && !prev) { 6003 console.log("LTONB: Element became visible for selector '" + selector + "'"); 6004 callback(el); 6005 } 6006 6007 seen.set(el, visible); 6008 }); 6009 } 6010 6011 // Initial check 6012 check(); 6013 6014 var observer = new MutationObserver(check); 6015 6016 observer.observe(document.body, { 6017 childList: true, 6018 subtree: true, 6019 attributes: true, 6020 attributeFilter: ["style", "class", "hidden"] 6021 }); 6022 6023 return observer; // so you can disconnect() later if needed 6024} 6025 6026function replaceHTML(target, trips) { 6027 if (document.getElementById(EXPERIMENT_ID)) return; 6028 if (!trips || !trips.length) { 6029 console.warn("LTONB: No trips returned for replacement"); 6030 return; 6031 } 6032 if (!target) { 6033 console.warn("LTONB: Target element not available for replacement"); 6034 return; 6035 } 6036 6037 var locale = getLocale(); 6038 var cardsHtml = trips 6039 .map(function (trip) { 6040 return renderTripCard(trip, locale); 6041 }) 6042 .join(""); 6043 6044 var wrapper = document.createElement("div"); 6045 wrapper.id = EXPERIMENT_ID; 6046 6047 wrapper.innerHTML = ` 6048 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 6049 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 6050 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 6051 ${cardsHtml} 6052 </div> 6053 </div> 6054 </section> 6055 `; 6056 6057 target.replaceWith(wrapper); 6058} 6059 6060function replaceText(node, newText) { 6061 if (node.nodeType === Node.TEXT_NODE) { 6062 node.textContent = newText; 6063 } else { 6064 node.childNodes.forEach((child) => replaceText(child, newText)); 6065 } 6066} 6067 6068function updateHero() { 6069 // hide original hero 6070 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 6071 if (hero) { 6072 hero.style.setProperty("display", "none", "important"); 6073 } else { 6074 console.warn("LTONB: Original hero element not found"); 6075 } 6076 6077 // show test hero 6078 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 6079 if (testHero) { 6080 testHero.style.setProperty("display", "block", "important"); 6081 testHero.style.setProperty("visibility", "visible", "important"); 6082 testHero.style.setProperty("opacity", "1", "important"); 6083 testHero.removeAttribute("hidden"); 6084 testHero.classList.remove("hidden"); 6085 } else { 6086 console.warn("LTONB: Test hero element not found"); 6087 } 6088} 6089 6090function updateHeroButton() { 6091 var testHeroOffersButton = document.querySelector( 6092 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 6093 ); 6094 if (testHeroOffersButton) { 6095 replaceText(testHeroOffersButton, BUTTON_TEXT); 6096 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 6097 } else { 6098 console.warn("LTONB: Offers button in test hero not found"); 6099 } 6100} 6101 6102function updatePromotionsCarousel(target, trips) { 6103 var element = document.querySelector(target); 6104 var headerElement = document.querySelector( 6105 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 6106 ); 6107 if (headerElement && element) { 6108 replaceText(headerElement, LAST_SPOTS_HEADER); 6109 replaceHTML(element, trips); 6110 } 6111} 6112 6113onElementVisible('[data-cy="promotions-carousel-container"]', function () { 6114 fetchLastSpots().then(function (trips) { 6115 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 6116 }); 6117}); 6118 6119onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 6120 updateHeroButton(); 6121}); 6122 6123onElementVisible('#hero, .hero, [data-component="hero"]', function () { 6124 updateHero(); 6125}); 6126}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "4917567932858368", "endOfRange": 1000}, {"entityId": "4564935229833216", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6248870355664896"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6481704425095168"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6261634830696448", "name": null, "commitId": "5088006703415296", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5449439335153664"], "audienceName": null, "changes": null, "id": "6480207796764672", "integrationSettings": null, "variations": [{"id": "5532395695243264", "name": null, "actions": [{"viewId": "6095345648664576", "changes": []}]}, {"id": "5724449452851200", "name": null, "actions": [{"viewId": "6095345648664576", "changes": [{"id": "3294d0f845a3486f9cca04e2c1d2a4cc", "src": "/actions/7a58dbbd0159a68d39b1eb639e3d4273fc0035c9d09744f07badf178b3d287e7.js", "depen
6126dencies": [], "type": "custom_code"}]}]}], "weightDistributions": [{"entityId": "5724449452851200", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6261634830696448"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6095345648664576"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6276180324646912", "name": null, "commitId": "4998721474134016", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5449439335153664"], "audienceName": null, "changes": null, "id": "5723510062972928", "integrationSettings": null, "variations": [{"id": "5664525129613312", "name": null, "actions": [{"viewId": "4778410824695808", "changes": []}]}, {"id": "5994212986978304", "name": null, "actions": [{"viewId": "4778410824695808", "changes": [{"id": "e8548055e0fc44f0a9fc31a4e1ed7289", "src": "/actions/e4930824513d0ae80c86cc28c18e4dee4015802be4fc878d87552d8d35cc16b1.js", "dependencies": [], "type": "custom_code"}]}]}], "weightDistributions": [{"entityId": "5994212986978304", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6276180324646912"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4778410824695808"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6290234504118272", "name": null, "commitId": "5573989114839040", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "4929966821867520", "integrationSettings": null, "variations": [{"id": "6723663762817024", "name": null, "actions": []}, {"id": "6742149755043840", "name": null, "actions": [{"viewId": "6039432975876096", "changes": [{"id": "062aab3b37294c5b9145a5ed4d83c05a", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": true, "dest": "https://www.ef.com.es/cp/brochure/v2/", "preserveParameters": true}]}]}], "weightDistributions": [{"entityId": "6723663762817024", "endOfRange": 5000}, {"entityId": "6742149755043840", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6290234504118272"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6039432975876096"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6292442805174272", "name": null, "commitId": "6007614784405504", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5449439335153664"], "audienceName": null, "changes": null, "id": "6624377876250624", "integrationSettings": null, "variations": [{"id": "6751040555450368", "name": null, "actions": []}, {"id": "6392629426913280", "name": null, "actions": [{"viewId": "4632664437686272", "changes": [{"id": "E6165199-9F67-42EF-B9A8-090D1AF0EDB2", "type": "custom_code", "value": function($){(() => { 6127 let O = location.origin; 6128 let P = location.pathname; 6129 6130 let N = P.toLowerCase().replace(/\/+$/, "") + "/"; 6131 6132 let E = /^(?:\/ils\/ils-25\/|\/ils\/|\/ils-jr\/|\/ils-sr\/|\/ils-hs\/|\/illj\/|\/aya\/|\/upa\/)$/.test(N); 6133 6134 if (E) { 6135 location.replace(O + "/multi/" + location.search + location.hash); 6136 return; 6137 } 6138 6139 window.__efHeaderExpObs && window.__efHeaderExpObs.disconnect(); 6140 6141 function getCookie(name) { 6142 let match = document.cookie.match( 6143 "(?:^|;\\s*)" + name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&") + "=([^;]*)" 6144 ); 6145 return match ? decodeURIComponent(match[1]) : ""; 6146 } 6147 6148 let efdomain = getCookie("efdomain"); 6149 let MENU = /www\.ef\.com\/cl|www\.ef\.com\.es/.test(efdomain) ? "Menú" : "Menu"; 6150
6151 let P0 = P.split("/").filter(Boolean)[0] || "ils"; 6152 let B = P0; 6153 6154 let u = O + "/multi/"; 6155 6156 let h = "#cefcom-globalheader"; 6157 let p = '.ef-product-logo[data-clicklabel="global-header:site-header"]'; 6158 let m = 6159 '.ef-backpack-header .ef-menu-button[data-clicklabel="global-header:site-header"]'; 6160 let c = "ef-header-exp-css"; 6161 let q = 0; 6162 6163 let css = 6164 '#topbar-header a[data-info="open"][data-clicklabel="global-header:topbar"],' + 6165 '#topbar-header a[aria-label="Menü"][data-clicklabel="global-header:topbar"]{' + 6166 "display:none!important;" + 6167 "visibility:hidden!important;" + 6168 "opacity:0!important;" + 6169 "pointer-events:none!important" + 6170 "}" + 6171 "#cefcom-globalheader .ef-header-exp-mobile-menu{" + 6172 "width:69px!important;" + 6173 "min-width:69px!important;" + 6174 "height:32px!important;" + 6175 "min-height:32px!important;" + 6176 "max-height:32px!important;" + 6177 "aspect-ratio:auto!important;" + 6178 "padding:0!important;" + 6179 "border-radius:var(--item-radius,6px)!important;" + 6180 "background:#191919!important;" + 6181 "color:#fff!important;" + 6182 'font-family:"EF Circular",Arial,sans-serif!important;' + 6183 "font-weight:450!important;" + 6184 "font-size:14px!important;" + 6185 "line-height:20px!important;" + 6186 "text-align:center!important" + 6187 "}" + 6188 "#cefcom-globalheader .ef-header-exp-mobile-menu .ef-button-bg{" + 6189 "background:#191919!important;" + 6190 "border-radius:inherit!important" + 6191 "}" + 6192 "#cefcom-globalheader .ef-header-exp-mobile-menu svg," + 6193 "#cefcom-globalheader .ef-header-exp-mobile-menu .ef-animated-chevron{" + 6194 "display:none!important" + 6195 "}" + 6196 "#cefcom-globalheader .ef-header-exp-mobile-menu .pointer-events-none{" + 6197 "gap:0!important" + 6198 "}" + 6199 "#cefcom-globalheader .ef-header-exp-menu-text{" + 6200 "display:inline-flex!important;" + 6201 "align-items:center!important;" + 6202 "justify-content:center!important;" + 6203 "width:37px!important;" + 6204 "height:20px!important;" + 6205 "color:#fff!important;" + 6206 'font-family:"EF Circular",Arial,sans-serif!important;' + 6207 "font-weight:450!important;" + 6208 "font-size:14px!important;" + 6209 "line-height:20px!important;" + 6210 "text-align:center!important" + 6211 "}"; 6212 6213 function x() { 6214 let r = document.querySelector(h); 6215 if (!r) return; 6216 6217 r.querySelectorAll( 6218 '#topbar-header a[data-info="open"][data-clicklabel="global-header:topbar"],' + 6219 '#topbar-header a[aria-label="Menü"][data-clicklabel="global-header:topbar"]' 6220 ).forEach((e) => { 6221 let t = e.closest("div.absolute") || e.parentElement || e; 6222 t && t.remove(); 6223 }); 6224 6225 r.querySelectorAll( 6226 '#topbar-header a[data-info="ef-logo"][data-clicklabel="global-header:topbar"]' 6227 ).forEach((e) => { 6228 e.href = u; 6229 e.setAttribute("href", u); 6230 }); 6231 6232 r.querySelectorAll(p).forEach((e) => { 6233 e.removeAttribute("href"); 6234 e.setAttribute("aria-disabled", "true"); 6235 e.setAttribute("tabindex", "-1"); 6236 e.style.cursor = "default"; 6237 }); 6238 6239 r.querySelectorAll(m).forEach((e) => { 6240 e.classList.add("ef-header-exp-mobile-menu"); 6241 e.setAttribute("aria-label", MENU); 6242 6243 let t = e.querySelector(".pointer-events-none"); 6244 if (t) { 6245 let label = t.querySelector(".ef-header-exp-menu-text"); 6246 if (label) { 6247 label.textContent = MENU; 6248 } else { 6249 t.insertAdjacentHTML( 6250 "beforeend", 6251 '<span class="ef-header-exp-menu-text">' + MENU + "</span>" 6252 ); 6253 } 6254 } 6255 }); 6256 6257 r.querySelectorAll( 6258 'button.ef-nav-menu-item[role="menuitem"][aria-label="Book now"],' + 6259 'button.ef-nav-menu-item[role="menuitem"][aria-label="Réservez maintenant"],' + 6260 'button.ef-nav-menu-item[role="menuitem"][aria-label="Boek nu"],' + 6261 'button.ef-nav-menu-item[role="menuitem"][aria-label="Åimdi rezervasyon yap"],' + 6262 'button.ef-nav-menu-item[role="menuitem"][aria-label="Rezervasyon yap"]' 6263 ).forEach((e) => { 6264 let t = e.closest("li"); 6265 t && t.remove(); 6266 }); 6267 6268 r.querySelectorAll( 6269 'a.ef-nav-menu-item[role="menuitem"][aria-label="Preview"],' + 6270 'a.ef-nav-menu-item[role="menuitem"][aria-label="Overview"],' + 6271 'a.ef-nav-menu-item[role="menuitem"][aria-label="Aperçu"],' + 6272 'a.ef-nav-menu-item[href="/' + 6273 B + 6274 '/"][role="menuitem"],' + 6275 'a.ef-nav-menu-item[href="/ils/"][role="menuitem"]' 6276 ).forEach((e) => { 6277 e.href = u; 6278 e.setAttribute("href", u); 6279 }); 6280 } 6281 6282 let S = document.getElementById(c); 6283 S 6284 ? (S.textContent = css) 6285 : ((S = document.createElement("style")), 6286 (S.id = c), 6287 (S.textContent = css), 6288 document.head.appendChild(S)); 6289 6290 window.__efHeaderExpBound || 6291 (document.addEventListener( 6292 "click", 6293 (e) => { 6294 let t = e.target.closest && e.target.closest(p); 6295 t && (e.preventDefault(), e.stopImmediatePropagation()); 6296 }, 6297 true 6298 ), 6299 document.addEventListener( 6300 "keydown", 6301 (e) => { 6302 let t = e.target.closest && e.target.closest(p); 6303 t && 6304 ("Enter" === e.key || " " === e.key) && 6305 (e.preventDefault(), e.stopImmediatePropagation()); 6306 }, 6307 true 6308 ), 6309 (window.__efHeaderExpBound = 1)); 6310 6311 x(); 6312 6313 window.__efHeaderExpObs = new MutationObserver(() => { 6314 q || 6315 ((q = 1), 6316 requestAnimationFrame(() => { 6317 q = 0; 6318 x(); 6319 })); 6320 }); 6321 6322 window.__efHeaderExpObs.observe(document.documentElement, { 6323 childList: true, 6324 subtree: true, 6325 attributes: true, 6326 attributeFilter: ["href", "class", "style", "aria-label"], 6327 }); 6328})(); 6329}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "6392629426913280", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6292442805174272"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4632664437686272"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6349878264070144", "name": null, "commitId": "6466514199511040", "groupId": null, "holdback": null, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5628343287021568", "integrationSettings": null, "variations": [{"id": "5240283328151552", "name": null, "actions": [{"viewId": "4570414458863616", "changes": [{"id": "62d107e2b54e4f21accbc83c98242626", "src": "/actions/b49c6f8ddfdb3ee447276c31fb4a31341b7fd6b41d7da01005ae9290ccc6e2d9.js", "depen
6329dencies": [], "type": "custom_code"}, {"id": "b3e22f7530154f98a42ca988820e95fa", "type": "append", "selector": "head", "value": "<style>#mycal {\n color: #333;\n margin: 0 auto;\n width: 100%;\n border-radius: 8px;\n background-color: #fff;\n }\n \n .timeslot-calendar {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n height: fit-content;\n }\n \n .timeslot-calendar th,\n .timeslot-calendar td {\n padding: 10px;\n text-align: center;\n border: 1px solid #e0e0e0;\n }\n \n .timeslot-calendar th {\n background-color: #003C64;\n color: #fff;\n font-weight: normal;\n }\n \n .timeslot-calendar .timeslot {\n cursor: pointer;\n transition: background-color 0.3s;\n }\n \n .timeslot-calendar .timeslot:hover {\n background-color: #e0f3ff;\n }\n \n .timeslot-calendar .selected {\n background-color: #0073e6;\n color: #fff;\n }\n\n .calendar-navigation {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n font-family: Arial, sans-serif;\n }\n .calendar-title {\n font-size: 16px;\n font-weight: bold;\n }\n .calendar-btn {\n background: #0073e6;\n border: none;\n color: #fff;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background 0.3s;\n }\n .calendar-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n }\n .calendar-btn:hover:not(:disabled) {\n background: #005bb5;\n }\n .japanese-day {\n font-size: 12px;\n color: #555;\n }\n .japanese-day {\n font-size: 12px;\n color: #FFF;\n }\n .timeslot.unavailable {\n background-color: #d3d3d3;\n color: #888;\n pointer-events: none;\n }\n .timeslot.selected {\n background-color: #0073e6;\n color: #FFF;\n }\n \n /* Mobile specific styles */\n @media (max-width: 767px) {\n .timeslot-calendar th,\n .timeslot-calendar td {\n font-size: 10px;\n } }</style>", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6349878264070144"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["4570414458863616"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5628343287021568", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6417166736556032", "name": null, "commitId": "5202743661428736", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5254956370886656", "integrationSettings": null, "variations": [{"id": "5240453883232256", "name": null, "actions": []}, {"id": "4910189957087232", "name": null, "actions": [{"viewId": "6215790758723584", "changes": [{"id": "F4AD1904-28AA-4D3B-9857-03926EF2CBFF", "type": "custom_code", "value": function($){(function destinationTripsWidget() { 6330 "use strict"; 6331 6332 var WIDGET_ID = "lt-destination-trips"; 6333 var DEFAULT_LOCALE = "en-gb"; 6334 var TRIP_BASE_URL = "/trips"; 6335 var DESTINATION_URL = ""; 6336 6337 var hostnameToJunoMarket = { 6338 "ef.se": "ses", 6339 "ef.dk": "dkc", 6340 "ef.no": "noo", 6341 "ef.fi": "fih", 6342 "ef.de": "deb", 6343 "ef.fr": "frp", 6344 "ef-italia.it": "itm", 6345 "ef.com.es": "esb", 6346 "ef.at": "atv", 6347 "ef.pl": "plw", 6348 localhost: "ses", 6349 }; 6350 6351 var hostnameToEfcomMarket = { 6352 "ef.se": "se", 6353 "ef.dk": "dk", 6354 "ef.no": "no", 6355 "ef.fi": "fi", 6356 "ef.de": "de", 6357 "ef.fr": "fr", 6358 "ef-italia.it": "it", 6359 "ef.com.es": "es", 6360 "ef.at": "at", 6361 "ef.pl": "pl", 6362 localhost: "se", 6363 }; 6364 6365 var hostnameToLocale = { 6366 "ef.se": "sv-se", 6367 "ef.dk": "da-dk", 6368 "ef.no": "no-no", 6369 "ef.fi": "fi-fi", 6370 "ef.de": "de-de", 6371 "ef.fr": "fr-fr", 6372 "ef-italia.it": "it-it", 6373 "ef.com.es": "es-es", 6374 "ef.at": "de-at", 6375 "ef.pl": "pl-pl", 6376 localhost: "sv-se", 6377 }; 6378 6379 var labels = { 6380 "en-gb": { 6381 fewSpotsLeft: "Few spots left", 6382 learnMore: "Learn more", 6383 departing: "Departing", 6384 age: "Age", 6385 reserveNow: "Reserve now", 6386 numWeeks: "{numWeeks} weeks", 6387 seeAllPackages: "See all packages", 6388 popularPackages: "Popular packages", 6389 }, 6390 "sv-se": { 6391 fewSpotsLeft: "FÃ¥ platser kvar", 6392 learnMore: "Läs mer", 6393 departing: "Avresa", 6394 age: "à lder", 6395 reserveNow: "Boka nu", 6396 numWeeks: "{numWeeks} veckor", 6397 seeAllPackages: "Se alla paket", 6398 popularPackages: "Populära paket", 6399 }, 6400 "da-dk": { 6401 fewSpotsLeft: "FÃ¥ pladser tilbage", 6402 learnMore: "Læs mere", 6403 departing: "Afrejse", 6404 age: "Alder", 6405 reserveNow: "Reserver nu", 6406 numWeeks: "{numWeeks} uger", 6407 seeAllPackages: "Se alle pakker", 6408 popularPackages: "Populære pakker", 6409 }, 6410 "no-no": { 6411 fewSpotsLeft: "FÃ¥ plasser igjen", 6412 learnMore: "Les mer", 6413 departing: "Avreise", 6414 age: "Alder", 6415 reserveNow: "Reserver nÃ¥", 6416 numWeeks: "{numWeeks} uker", 6417 seeAllPackages: "Se alle pakker", 6418 popularPackages: "Populære pakker", 6419 }, 6420 "fi-fi": { 6421 fewSpotsLeft: "Vain muutama paikka jäljellä", 6422 learnMore: "Lue lisää", 6423 departing: "Lähtö", 6424 age: "Ikä", 6425 reserveNow: "Varaa nyt", 6426 numWeeks: "{numWeeks} viikkoa", 6427 seeAllPackages: "Katso kaikki paketit", 6428 popularPackages: "Suositut paketit", 6429 }, 6430 "de-de": { 6431 fewSpotsLeft: "Wenige Plätze übrig", 6432 learnMore: "Mehr erfahren", 6433 departing: "Startdatum", 6434 age: "Alter", 6435 reserveNow: "Jetzt reservieren", 6436 numWeeks: "{numWeeks} Wochen", 6437 seeAllPackages: "Alle Angebote ansehen", 6438 popularPackages: "Beliebte Pakete", 6439 }, 6440 "fr-fr": { 6441 fewSpotsLeft: "Plus que quelques places", 6442 learnMore: "En savoir plus", 6443 departing: "Départ", 6444 age: "Ãge", 6445 reserveNow: "Réservez maintenant", 6446 numWeeks: "{numWeeks} semaines", 6447 seeAllPackages: "Voir tous les séjours",
6448 popularPackages: "Nos coups de cÅurs", 6449 }, 6450 "it-it": { 6451 fewSpotsLeft: "Ultimi posti rimasti", 6452 learnMore: "Scopri di più", 6453 departing: "Partenza", 6454 age: "Età ", 6455 reserveNow: "Prenota ora", 6456 numWeeks: "{numWeeks} settimane", 6457 seeAllPackages: "Vedi tutti i pacchetti", 6458 popularPackages: "Pacchetti popolari", 6459 }, 6460 "es-es": { 6461 fewSpotsLeft: "Quedan pocas plazas", 6462 learnMore: "Leer más", 6463 departing: "Salida", 6464 age: "Edad", 6465 reserveNow: "Reserva ahora", 6466 numWeeks: "{numWeeks} semanas", 6467 seeAllPackages: "Ver todos los paquetes", 6468 popularPackages: "Paquetes populares", 6469 }, 6470 "de-at": { 6471 fewSpotsLeft: "Wenige Plätze übrig", 6472 learnMore: "Mehr erfahren", 6473 departing: "Startdatum", 6474 age: "Alter", 6475 reserveNow: "Jetzt reservieren", 6476 numWeeks: "{numWeeks} Wochen", 6477 seeAllPackages: "Alle Angebote ansehen", 6478 popularPackages: "Beliebte Pakete", 6479 }, 6480 "pl-pl": { 6481 fewSpotsLeft: "ZostaÅo kilka miejsc", 6482 learnMore: "Dowiedz siÄ wiÄcej", 6483 departing: "Wyjazd", 6484 age: "Wiek", 6485 reserveNow: "Zarezerwuj teraz", 6486 numWeeks: "{numWeeks} tygodni", 6487 seeAllPackages: "Zobacz wszystkie pakiety", 6488 popularPackages: "Popularne pakiety", 6489 }, 6490 }; 6491 6492 function getSegmentByPathname() { 6493 var pathSegments = window.location.pathname.toLowerCase().split("/").filter(Boolean); 6494 return pathSegments.length > 0 ? pathSegments[0] : "lt-sr"; 6495 } 6496 6497 function getMarketByHostname() { 6498 var hostname = window.location.hostname.toLowerCase(); 6499 var matchedHostname = Object.keys(hostnameToJunoMarket).find(function (domain) { 6500 return hostname === domain || hostname.endsWith("." + domain); 6501 }); 6502 6503 if (!matchedHostname) { 6504 throw new Error("No market configured for hostname: " + hostname); 6505 } 6506 6507 return hostnameToJunoMarket[matchedHostname]; 6508 } 6509 6510 function getEfcomMarketByHostname() { 6511 var hostname = window.location.hostname.toLowerCase(); 6512 var matchedHostname = Object.keys(hostnameToEfcomMarket).find(function (domain) { 6513 return hostname === domain || hostname.endsWith("." + domain); 6514 }); 6515 6516 if (!matchedHostname) { 6517 throw new Error("No EF.com market configured for hostname: " + hostname); 6518 } 6519 6520 return hostnameToEfcomMarket[matchedHostname]; 6521 } 6522 6523 /** 6524 * Fetches trips with their availabilities and selects the lowest priced one. 6525 * 6526 * @returns {Promise<Array<Object>>} 6527 */ 6528 function getTrips() { 6529 var market = getMarketByHostname(); 6530 var efcomMarket = getEfcomMarketByHostname(); 6531 var segment = getSegmentByPathname(); 6532 var martechUrl = 6533 "https://api.martech.eflangtech.com/content/product-sites/models/" + 6534 efcomMarket + 6535 "/" + 6536 segment + 6537 "/destinations"; 6538 var url = "https://api.products.lt.eflangtech.com/markets/" + market + "/trips"; 6539 var cleanPathname = window.location.pathname 6540 .replace(/^\/(?:lt-sr|lt-jr)\/?/, "") 6541 .replace(/^\/+|\/+$/g, ""); 6542 console.log("cleanPathname:", cleanPathname); 6543 6544 return fetch(martechUrl) 6545 .then(function (response) { 6546 if (!response.ok) { 6547 throw new Error("Destinations request failed with status " + response.status); 6548 } 6549 6550 return response.json(); 6551 }) 6552 .then(function (martechData) { 6553 var destinationSlugs = martechData.items.reduce(function (result, item) { 6554 var cleanDestinationSlug = item.content.destinationPageSlug 6555 .replace(/^\//, "") 6556 .replace(/\/$/, ""); 6557 6558 result[cleanDestinationSlug] = item.content.code.toLowerCase(); 6559 return result; 6560 }, {}); 6561 var currentDestinationCode = destinationSlugs[cleanPathname] || ""; 6562 DESTINATION_URL = 6563 "/" + 6564 encodeURIComponent(segment) + 6565 "/trips/all?destinations=" + 6566 encodeURIComponent(currentDestinationCode); 6567 6568 return fetch(url, { 6569 headers: { 6570 "ef-flow-id": crypto.randomUUID(), 6571 }, 6572 }) 6573 .then(function (response) { 6574 if (!response.ok) { 6575 throw new Error("Trips request failed with status " + response.status); 6576 } 6577 6578 return response.json(); 6579 }) 6580 .then(function (data) { 6581 var returnTrips = data.items 6582 .filter(function (trip) { 6583 return trip.destinationCode === currentDestinationCode; 6584 }) 6585 .map(function (trip) { 6586 var lowestPriceAvailability = (trip.availabilities || []) 6587 .filter(function (availability) { 6588 return availability.price > 0; 6589 }) 6590 .reduce(function (lowest, availability) { 6591 return !lowest || availability.price < lowest.price ? availability : lowest; 6592 }, null); 6593 6594 return lowestPriceAvailability 6595 ? Object.assign({}, trip, lowestPriceAvailability) 6596 : null; 6597 }) 6598 .filter(Boolean); 6599 6600 returnTrips.sort(function (left, right) { 6601 var leftIsSoldOut = left.availableSpots < 1; 6602 var rightIsSoldOut = right.availableSpots < 1; 6603 6604 if (leftIsSoldOut !== rightIsSoldOut) { 6605 return leftIsSoldOut ? 1 : -1; 6606 } 6607 6608 return left.price - right.price; 6609 }); 6610 6611 return Array.isArray(returnTrips) ? returnTrips : []; 6612 }); 6613 }); 6614 } 6615 6616 function getLocale() { 6617 var hostname = window.location.hostname.toLowerCase(); 6618 var matchedHostname = Object.keys(hostnameToLocale).find(function (domain) { 6619 return hostname === domain || hostname.endsWith("." + domain); 6620 }); 6621 6622 return matchedHostname ? hostnameToLocale[matchedHostname] : DEFAULT_LOCALE; 6623 } 6624 6625 function escapeHtml(value) { 6626 return String(value) 6627 .replace(/&/g, "&") 6628 .replace(/</g, "<") 6629 .replace(/>/g, ">") 6630 .replace(/"/g, """) 6631 .replace(/'/g, "'"); 6632 } 6633 6634 function formatDate(value, locale) { 6635 return new Intl.DateTimeFormat(locale, { 6636 day: "2-digit", 6637 month: "short", 6638 year: "numeric", 6639 timeZone: "UTC", 6640 }).format(new Date(value + "T00:00:00Z")); 6641 } 6642 6643 function formatPrice(trip, locale) { 6644 return new Intl.NumberFormat(locale, { 6645 style: "currency", 6646 currency: trip.currency, 6647 maximumFractionDigits: 0, 6648 useGrouping: true, 6649 }).format(trip.price); 6650 } 6651 6652 function getDurationInWeeks(duration) { 6653 var weeksMatch = /^P(\d+)W$/.exec(duration || ""); 6654 var daysMatch = /^P(\d+)D$/.exec(duration || ""); 6655 6656 if (weeksMatch) { 6657 return Number(weeksMatch[1]); 6658 } 6659 6660 return daysMatch ? Math.max(1, Math.round(Number(daysMatch[1]) / 7)) : 1; 6661 } 6662 6663 function createTripCard(trip, locale, localeLabels) { 6664 var tripUrl = 6665 "/" + 6666 encodeURIComponent(getSegmentByPathname()) + 6667 TRIP_BASE_URL + 6668 "/" + 6669 encodeURIComponent(trip.slug); 6670 var image = trip.images && trip.images[0] ? trip.images[0] : ""; 6671 var fewSpotsLeft = trip.availableSpots > 0 && trip.availableSpots <= 4; 6672 var weeks = getDurationInWeeks(trip.duration); 6673 6674 return ( 6675 '<article class="ltdp-card">' + 6676 '<a class="ltdp-card__image-wrap" href="' + 6677 escapeHtml(tripUrl) + 6678 '" aria-label="' + 6679 escapeHtml(localeLabels.learnMore + ": " + trip.title) + 6680 '">' + 6681 '<img class="ltdp-card__image" src="' + 6682 escapeHtml(image) + 6683 '" alt="' + 6684 escapeHtml(trip.title) + 6685 '" loading="lazy">' + 6686 (fewSpotsLeft 6687 ? '<span class="ltdp-card__availability">' + 6688 escapeHtml(localeLabels.fewSpotsLeft) + 6689 "</span>" 6690 : "") + 6691 "</a>" + 6692 '<div class="ltdp-card__body">' + 6693 '<h3 class="ltdp-card__title" title="' + 6694 escapeHtml(trip.title) + 6695 '">' + 6696 escapeHtml(trip.title) + 6697 "</h3>" + 6698 '<p class="ltdp-card__meta"><span>' + 6699 escapeHtml(localeLabels.departing) + 6700 " " + 6701 escapeHtml(formatDate(trip.startDate, locale)) + 6702 '</span><span class="ltdp-card__age">' + 6703 escapeHtml(localeLabels.age) + 6704 " " + 6705 escapeHtml(trip.ages.min + "-" + trip.ages.max) + 6706 "</span></p>" + 6707 '<p class="ltdp-card__price"><strong>' + 6708 escapeHtml(formatPrice(trip, locale)) + 6709 "</strong><span>/ " + 6710 escapeHtml(localeLabels.numWeeks.replace("{numWeeks}", weeks)) + 6711 "</span></p>" + 6712 '<div class="ltdp-card__actions">' + 6713 '<a class="ltdp-card__learn" href="' + 6714 escapeHtml(tripUrl) + 6715 '">' + 6716 escapeHtml(localeLabels.learnMore) + 6717 "</a>" + 6718 '<a class="ltdp-card__book" href="' + 6719 escapeHtml(tripUrl) + 6720 '">' + 6721 escapeHtml(localeLabels.reserveNow) + 6722 "</a>" + 6723 "</div>" + 6724 "</div>" + 6725 "</article>" 6726 ); 6727 } 6728 6729 function getStyles() { 6730 return ( 6731 "<style>" + 6732 "#" + 6733 WIDGET_ID + 6734 "{--ltdp-blue:#006bd6;--ltdp-pink:#da2381;
6734--ltdp-text:#191919;box-sizing:border-box;color:var(--ltdp-text);font-family:'EF Circular','Arial',sans-serif;margin:0 auto;max-width:1200px;padding:88px 0 72px}" + 6735 "#" + 6736 WIDGET_ID + 6737 " *{box-sizing:border-box}" + 6738 ".ltdp-header{align-items:center;display:flex;justify-content:space-between;margin-bottom:24px}" + 6739 ".ltdp-heading{font-size:32px;line-height:40px;margin:0;font-weight:700}" + 6740 ".ltdp-all{color:var(--ltdp-blue);font-size:18px;line-height:24px;text-decoration:none}" + 6741 ".ltdp-all:hover,.ltdp-card a:hover{text-decoration:underline}" + 6742 ".ltdp-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px}" + 6743 ".ltdp-card{min-width:0}" + 6744 ".ltdp-card__image-wrap{aspect-ratio:282/344;border-radius:8px;display:block;overflow:hidden;position:relative}" + 6745 ".ltdp-card__image{display:block;height:100%;object-fit:cover;width:100%}" + 6746 ".ltdp-card__availability{background:var(--ltdp-pink);border-radius:4px;color:#fff;font-size:12px;left:8px;line-height:16px;padding:2px 8px;position:absolute;top:8px}" + 6747 ".ltdp-card__body{padding-top:8px}" + 6748 ".ltdp-card__title{font-size:18px;font-weight:700;line-height:24px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}" + 6749 ".ltdp-card__meta{display:flex;font-size:14px;gap:12px;line-height:20px;margin:0}" + 6750 ".ltdp-card__meta span+span:before{content:'·';margin-right:12px}" + 6751 ".ltdp-card__price{align-items:baseline;display:flex;gap:4px;line-height:24px;margin:8px 0 0}" + 6752 ".ltdp-card__price strong{font-size:18px}" + 6753 ".ltdp-card__price span{color:rgba(25,25,25,.65);font-size:14px}" + 6754 ".ltdp-card__actions{align-items:center;display:flex;gap:16px;margin-top:16px}" + 6755 ".ltdp-card__learn{background:var(--ltdp-blue);border-radius:9999px;color:#fff;font-size:14px;line-height:20px;padding:6px 16px;text-decoration:none}" + 6756 ".ltdp-card__book{color:var(--ltdp-blue);font-size:14px;line-height:20px;text-decoration:none}" + 6757 "@media(max-width:767px){" + 6758 "#" + 6759 WIDGET_ID + 6760 "{padding:40px 16px 72px}" + 6761 ".ltdp-header{align-items:flex-end;margin-bottom:24px}" + 6762 ".ltdp-heading{font-size:22px;line-height:24px;max-width:190px}" + 6763 ".ltdp-all{font-size:14px;line-height:20px}" + 6764 ".ltdp-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}" + 6765 ".ltdp-card__image-wrap{aspect-ratio:1/1}" + 6766 ".ltdp-card__body{padding-top:4px}" + 6767 ".ltdp-card__title{font-size:14px;line-height:20px}" + 6768 ".ltdp-card__meta{font-size:12px;line-height:16px}" + 6769 ".ltdp-card__age{display:none}" + 6770 ".ltdp-card__price{line-height:20px;margin-top:0;white-space:nowrap}" + 6771 ".ltdp-card__price strong{font-size:14px}" + 6772 ".ltdp-card__price span{font-size:12px}" + 6773 ".ltdp-card__actions{margin-top:0}" + 6774 ".ltdp-card__learn{background:none;border-radius:0;color:var(--ltdp-blue);font-size:14px;font-weight:700;line-height:20px;padding:4px 0}" + 6775 ".ltdp-card__book{display:none}" + 6776 "}" + 6777 "@media(min-width:768px) and (max-width:1231px){" + 6778 "#" + 6779 WIDGET_ID + 6780 "{padding-left:16px;padding-right:16px}" + 6781 "}" + 6782 "</style>" 6783 ); 6784 } 6785 6786 function render(trips) { 6787 var locale = getLocale(); 6788 var localeLabels = labels[locale] || labels[DEFAULT_LOCALE]; 6789 var root = document.getElementById(WIDGET_ID); 6790 var campusGallery = document.getElementById("campus-gallery"); 6791 6792 if (!trips.length) { 6793 if (root) { 6794 root.remove(); 6795 } 6796 return; 6797 } 6798 6799 if (!campusGallery || !campusGallery.parentNode) { 6800 return; 6801 } 6802 6803 if (!root) { 6804 root = document.createElement("section"); 6805 root.id = WIDGET_ID; 6806 root.setAttribute("aria-labelledby", WIDGET_ID + "-heading"); 6807 } 6808 6809 campusGallery.parentNode.insertBefore(root, campusGallery); 6810 6811 root.innerHTML = 6812 getStyles() + 6813 '<header class="ltdp-header">' + 6814 '<h2 class="ltdp-heading" id="' + 6815 WIDGET_ID + 6816 '-heading">' + 6817 escapeHtml(localeLabels.popularPackages) + 6818 "</h2>" + 6819 '<a class="ltdp-all" href="' + 6820 escapeHtml(DESTINATION_URL) + 6821 '">' + 6822 escapeHtml(localeLabels.seeAllPackages) + 6823 "</a>" + 6824 "</header>" +
6825 '<div class="ltdp-grid">' + 6826 trips 6827 .slice(0, 4) 6828 .map(function (trip) { 6829 return createTripCard(trip, locale, localeLabels); 6830 }) 6831 .join("") + 6832 "</div>"; 6833 } 6834 6835 function init() { 6836 getTrips() 6837 .then(render) 6838 .catch(function (error) { 6839 console.error("Could not render destination trips.", error); 6840 }); 6841 } 6842 6843 if (document.readyState === "loading") { 6844 document.addEventListener("DOMContentLoaded", init, { once: true }); 6845 } else { 6846 init(); 6847 } 6848})(); 6849}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "5240453883232256", "endOfRange": 5000}, {"entityId": "4910189957087232", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6417166736556032"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6215790758723584"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6441735962755072", "name": null, "commitId": "6269047581442048", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6010579496730624"], "audienceName": null, "changes": null, "id": "6099145480470528", "integrationSettings": null, "variations": [{"id": "5316454195658752", "name": null, "actions": [{"viewId": "5471539760463872", "changes": []}]}, {"id": "5258159711846400", "name": null, "actions": [{"viewId": "5471539760463872", "changes": [{"id": "b84a6915398d487eb113a34d4baa4cd3", "type": "redirect", "dependencies": [], "dest": "https://www.ef.fr/cc/discover/study-and-work-abroad/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "5316454195658752", "endOfRange": 5000}, {"entityId": "5258159711846400", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6441735962755072"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5471539760463872"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6463665780555776", "name": null, "commitId": "4980886326738944", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6034915368632320", "integrationSettings": null, "variations": [{"id": "6315114320625664", "name": null, "actions": [{"viewId": "6081672060338176", "changes": []}]}, {"id": "4583900261908480", "name": null, "actions": [{"viewId": "6081672060338176", "changes": [{"id": "81e5a9e8f9764885a90a5850df90c03c", "type": "custom_code", "value": function($){// inject last spots 6850var EXPERIMENT_ID = "optly-faplatserkvar"; 6851var MAX_TRIPS = 6; 6852var BUTTON_TEXT = "Tutustu matkoihimme"; 6853var LAST_SPOTS_HEADER = "Vain muutama paikka jäljellä"; 6854var JUNO_MARKET_CODE = "fih"; 6855console.log("LTONB: Experiment script started version FIH.20260720.2"); 6856 6857function normalizeLtPath(path) { 6858 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 6859 if (match) return match[1] + "/"; 6860 return path; 6861} 6862 6863function fetchLastSpots() { 6864 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 6865 .then(function (response) { 6866 if (!response.ok) { 6867 throw new Error("Network response was not ok"); 6868 } 6869 return response.json(); 6870 }) 6871 .then(function (data) { 6872 var items = Array.isArray(data) 6873 ? data 6874 : Array.isArray(data && data.items) 6875 ? data.items 6876 : Array.isArray(data && data.trips) 6877 ? data.trips 6878 : null; 6879 6880 if (!items) { 6881 throw new Error("Expected trips in response payload"); 6882 } 6883 6884 var today = new Date(); 6885 today.setHours(0, 0, 0, 0); 6886 var availableTrips = items 6887 .map(function (trip) { 6888 var availableDeparture = (trip.availabilities || []) 6889 .filter(function (availability) { 6890 var startDate = new Date(availability.startDate + "T00:00:00"); 6891 return availability.availableSpots >= 1 && startDate >= today; 6892 }) 6893 .sort(function (a, b) { 6894 return a.availableSpots - b.availableSpots || a.price - b.price; 6895 })[0]; 6896 6897 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 6898 }) 6899 .filter(Boolean); 6900 6901 availableTrips.sort(function (a, b) { 6902 return a.availableSpots - b.availableSpots || a.price - b.price; 6903 }); 6904 6905 return availableTrips.slice(0, MAX_TRIPS); 6906 }) 6907 .catch(function (error) { 6908 console.error("There was a problem with the fetch operation:", error); 6909 return []; 6910 }); 6911} 6912 6913function escapeHtml(value) { 6914 return String(value) 6915 .replace(/&/g, "&") 6916 .replace(/</g, "<") 6917 .replace(/>/g, ">") 6918 .replace(/"/g, """) 6919 .replace(/'/g, "'"); 6920} 6921 6922function formatCurrency(amount, currency, locale) { 6923 if (typeof amount !== "number" || !currency) return ""; 6924 try { 6925 return new Intl.NumberFormat(locale, { 6926 style: "currency", 6927 currency: currency, 6928 currencyDisplay: "symbol", 6929 minimumFractionDigits: 0, 6930 maximumFractionDigits: 2 6931 }).format(amount); 6932 } catch (error) { 6933 console.warn("Could not format currency", error); 6934 return String(amount); 6935 } 6936} 6937 6938function getLocale() { 6939 return document.documentElement.lang || navigator.language || "sv-SE"; 6940} 6941 6942function renderTripCard(trip, locale) { 6943 var title = escapeHtml(trip && trip.title ? trip.title : ""); 6944 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 6945 var image = 6946 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 6947 var currency = trip && trip.currency ? trip.currency : ""; 6948 var originalAmount = 6949 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 6950 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 6951 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 6952 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 6953 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 6954 6955 return ( 6956 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 6957 href + 6958 '">' + 6959 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 6960 '<div class="flex w-full items-center">' + 6961 (image 6962 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 6963 title + 6964 '" src="' + 6965 image + 6966 '" width="100%" height="100%"></div>' 6967 : "") + 6968 '<div class="flex w-full items-center justify-between px-2">' + 6969 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 6970 title + 6971 "</span></p>" + 6972 '<div class="flex shrink-0 items-center gap-1">' + 6973 (originalAmount > discountedAmount 6974 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 6975 originalPrice + 6976 "</span></p>" 6977 : "") + 6978 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 6979 discountedPrice + 6980 "</span></p>" + 6981 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
6981' + 6982 "</div>" + 6983 "</div>" + 6984 "</div>" + 6985 "</div>" + 6986 "</a>" 6987 ); 6988} 6989 6990function onElementVisible(selector, callback) { 6991 var seen = new WeakMap(); 6992 6993 function isVisible(el) { 6994 var style = getComputedStyle(el); 6995 return ( 6996 style.display !== "none" && 6997 style.visibility !== "hidden" && 6998 style.opacity !== "0" && 6999 el.offsetParent !== null 7000 ); 7001 } 7002 7003 function check() { 7004 document.querySelectorAll(selector).forEach((el) => { 7005 var visible = isVisible(el); 7006 var prev = seen.get(el); 7007 7008 // Trigger only when it becomes visible (false â true) 7009 if (visible && !prev) { 7010 console.log("LTONB: Element became visible for selector '" + selector + "'"); 7011 callback(el); 7012 } 7013 7014 seen.set(el, visible); 7015 }); 7016 } 7017 7018 // Initial check 7019 check(); 7020 7021 var observer = new MutationObserver(check); 7022 7023 observer.observe(document.body, { 7024 childList: true, 7025 subtree: true, 7026 attributes: true, 7027 attributeFilter: ["style", "class", "hidden"] 7028 }); 7029 7030 return observer; // so you can disconnect() later if needed 7031} 7032 7033function replaceHTML(target, trips) { 7034 if (document.getElementById(EXPERIMENT_ID)) return; 7035 if (!trips || !trips.length) { 7036 console.warn("LTONB: No trips returned for replacement"); 7037 return; 7038 } 7039 if (!target) { 7040 console.warn("LTONB: Target element not available for replacement"); 7041 return; 7042 } 7043 7044 var locale = getLocale(); 7045 var cardsHtml = trips 7046 .map(function (trip) { 7047 return renderTripCard(trip, locale); 7048 }) 7049 .join(""); 7050 7051 var wrapper = document.createElement("div"); 7052 wrapper.id = EXPERIMENT_ID; 7053 7054 wrapper.innerHTML = ` 7055 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 7056 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 7057 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 7058 ${cardsHtml} 7059 </div> 7060 </div> 7061 </section> 7062 `; 7063 7064 target.replaceWith(wrapper); 7065} 7066 7067function replaceText(node, newText) { 7068 if (node.nodeType === Node.TEXT_NODE) { 7069 node.textContent = newText; 7070 } else { 7071 node.childNodes.forEach((child) => replaceText(child, newText)); 7072 } 7073} 7074 7075function updateHero() { 7076 // hide original hero 7077 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 7078 if (hero) { 7079 hero.style.setProperty("display", "none", "important"); 7080 } else { 7081 console.warn("LTONB: Original hero element not found"); 7082 } 7083 7084 // show test hero 7085 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 7086 if (testHero) { 7087 testHero.style.setProperty("display", "block", "important"); 7088 testHero.style.setProperty("visibility", "visible", "important"); 7089 testHero.style.setProperty("opacity", "1", "important"); 7090 testHero.removeAttribute("hidden"); 7091 testHero.classList.remove("hidden"); 7092 } else { 7093 console.warn("LTONB: Test hero element not found"); 7094 } 7095} 7096 7097function updateHeroButton() { 7098 var testHeroOffersButton = document.querySelector( 7099 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 7100 ); 7101 if (testHeroOffersButton) { 7102 replaceText(testHeroOffersButton, BUTTON_TEXT); 7103 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 7104 } else { 7105 console.warn("LTONB: Offers button in test hero not found"); 7106 } 7107} 7108 7109function updatePromotionsCarousel(target, trips) { 7110 var element = document.querySelector(target); 7111 var headerElement = document.querySelector( 7112 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 7113 ); 7114 if (headerElement && element) { 7115 replaceText(headerElement, LAST_SPOTS_HEADER); 7116 replaceHTML(element, trips); 7117 } 7118} 7119 7120onElementVisible('[data-cy="promotions-carousel-container"]', function () { 7121 fetchLastSpots().then(function (trips) { 7122 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 7123 }); 7124}); 7125 7126onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 7127 updateHeroButton(); 7128}); 7129 7130onElementVisible('#hero, .hero, [data-component="hero"]', function () { 7131 updateHero(); 7132}); 7133}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "6315114320625664", "endOfRange": 1000}, {"entityId": "4583900261908480", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6463665780555776"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6081672060338176"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6514039975575552", "name": null, "commitId": "5042239464800256", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "4808890982858752", "integrationSettings": null, "variations": [{"id": "6241820049408000", "name": null, "actions": [{"viewId": "5117830362824704", "changes": []}]}, {"id": "5126371542827008", "name": null, "actions": [{"viewId": "5117830362824704", "changes": [{"id": "3D6FD886-ADED-4342-BCD9-873708D4D2B2", "type": "custom_code", "value": function($){// inject last spots 7134var EXPERIMENT_ID = "optly-faplatserkvar"; 7135var MAX_TRIPS = 6; 7136var BUTTON_TEXT = "Utforska vÃ¥ra resor"; 7137var LAST_SPOTS_HEADER = "FÃ¥ platser kvar"; 7138var JUNO_MARKET_CODE = "ses"; 7139console.log("LTONB: Experiment script started version SES.20260722.1"); 7140 7141function normalizeLtPath(path) { 7142 var match = path.match(/^(.+?\/lt-(sr|jr))(?:\/.*)?$/); 7143 if (match) return match[1] + "/"; 7144 return path; 7145} 7146 7147function fetchLastSpots() { 7148 return fetch("https://api.products.lt.eflangtech.com/markets/" + JUNO_MARKET_CODE + "/trips") 7149 .then(function (response) { 7150 if (!response.ok) { 7151 throw new Error("Network response was not ok"); 7152 } 7153 return response.json(); 7154 }) 7155 .then(function (data) { 7156 var items = Array.isArray(data) 7157 ? data 7158 : Array.isArray(data && data.items) 7159 ? data.items 7160 : Array.isArray(data && data.trips) 7161 ? data.trips 7162 : null; 7163 7164 if (!items) { 7165 throw new Error("Expected trips in response payload"); 7166 } 7167 7168 var today = new Date(); 7169 today.setHours(0, 0, 0, 0); 7170 var availableTrips = items 7171 .map(function (trip) { 7172 var availableDeparture = (trip.availabilities || []) 7173 .filter(function (availability) { 7174 var startDate = new Date(availability.startDate + "T00:00:00"); 7175 return availability.availableSpots >= 1 && startDate >= today; 7176 }) 7177 .sort(function (a, b) { 7178 return a.availableSpots - b.availableSpots || a.price - b.price; 7179 })[0]; 7180 7181 return availableDeparture ? Object.assign({}, trip, availableDeparture) : null; 7182 }) 7183 .filter(Boolean); 7184 7185 availableTrips.sort(function (a, b) { 7186 return a.availableSpots - b.availableSpots || a.price - b.price; 7187 }); 7188 7189 return availableTrips.slice(0, MAX_TRIPS); 7190 }) 7191 .catch(function (error) { 7192 console.error("There was a problem with the fetch operation:", error); 7193 return []; 7194 }); 7195} 7196 7197function escapeHtml(value) { 7198 return String(value) 7199 .replace(/&/g, "&") 7200 .replace(/</g, "<") 7201 .replace(/>/g, ">") 7202 .replace(/"/g, """) 7203 .replace(/'/g, "'"); 7204} 7205 7206function formatCurrency(amount, currency, locale) { 7207 if (typeof amount !== "number" || !currency) return ""; 7208 try { 7209 return new Intl.NumberFormat(locale, { 7210 style: "currency", 7211 currency: currency, 7212 currencyDisplay: "symbol", 7213 minimumFractionDigits: 0, 7214 maximumFractionDigits: 2 7215 }).format(amount); 7216 } catch (error) { 7217 console.warn("Could not format currency", error); 7218 return String(amount); 7219 } 7220} 7221 7222function getLocale() { 7223 return document.documentElement.lang || navigator.language || "sv-SE"; 7224} 7225 7226function renderTripCard(trip, locale) { 7227 var title = escapeHtml(trip && trip.title ? trip.title : ""); 7228 var slug = trip && trip.slug ? encodeURIComponent(trip.slug) : ""; 7229 var image = 7230 trip && Array.isArray(trip.images) && trip.images[0] ? escapeHtml(trip.images[0]) : ""; 7231 var currency = trip && trip.currency ? trip.currency : ""; 7232 var originalAmount = 7233 trip && typeof trip.originalPrice === "number" ? trip.originalPrice : trip.price; 7234 var discountedAmount = trip && typeof trip.price === "number" ? trip.price : trip.originalPrice; 7235 var originalPrice = escapeHtml(formatCurrency(originalAmount, currency, locale)); 7236 var discountedPrice = escapeHtml(formatCurrency(discountedAmount, currency, locale)); 7237 var href = normalizeLtPath(window.location.pathname) + "trips/" + slug + "/"; 7238 7239 return ( 7240 '<a class="ef-card border-box group flex w-full flex-col transition-shadow duration-system-medium ease-system-easing-expressive has-[.ef-card-banner]:-mt-l has-[.ef-card-banner]:pt-l rounded-sm [--card-border-radius:xs] relative cursor-pointer overflow-hidden shadow-dark-m-15 not-has-media:hover:shadow-dark-l-15 bg-[var(--color-system-background,transparent)] can-hover:hover:shadow-dark-l-30" href="' + 7241 href + 7242 '">' + 7243 '<div class="ef-card-body z-10 flex h-full w-full flex-1 flex-col items-start gap-xs peer-[]:flex-none p-0">' + 7244 '<div class="flex w-full items-center">' + 7245 (image 7246 ? '<div class="ef-image-container relative block max-w-full overflow-hidden h-16 w-14 shrink-0 object-cover rounded-l-xs"><img data-slot="Image" loading="lazy" class="ef-image absolute inset-0 h-full w-full" alt="' + 7247 title + 7248 '" src="' + 7249 image + 7250 '" width="100%" height="100%"></div>' 7251 : "") + 7252 '<div class="flex w-full items-center justify-between px-2">' + 7253 '<p class="ef-text isolate text-start text-small-print pr-2 text-[#191919]"><span>' + 7254 title + 7255 "</span></p>" + 7256 '<div class="flex shrink-0 items-center gap-1">' + 7257 (originalAmount > discountedAmount 7258 ? '<p class="ef-text isolate text-start text-small-print text-[#8C8C8C] line-through"><span>' + 7259 originalPrice + 7260 "</span></p>" 7261 : "") + 7262 '<p class="ef-text isolate text-system-text text-start text-ui-label-bold"><span>' + 7263 discountedPrice + 7264 "</span></p>" + 7265 '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor" viewBox="0 0 256 256"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"></path></svg>
7265' + 7266 "</div>" + 7267 "</div>" + 7268 "</div>" + 7269 "</div>" + 7270 "</a>" 7271 ); 7272} 7273 7274function onElementVisible(selector, callback) { 7275 var seen = new WeakMap(); 7276 7277 function isVisible(el) { 7278 var style = getComputedStyle(el); 7279 return ( 7280 style.display !== "none" && 7281 style.visibility !== "hidden" && 7282 style.opacity !== "0" && 7283 el.offsetParent !== null 7284 ); 7285 } 7286 7287 function check() { 7288 document.querySelectorAll(selector).forEach((el) => { 7289 var visible = isVisible(el); 7290 var prev = seen.get(el); 7291 7292 // Trigger only when it becomes visible (false â true) 7293 if (visible && !prev) { 7294 console.log("LTONB: Element became visible for selector '" + selector + "'"); 7295 callback(el); 7296 } 7297 7298 seen.set(el, visible); 7299 }); 7300 } 7301 7302 // Initial check 7303 check(); 7304 7305 var observer = new MutationObserver(check); 7306 7307 observer.observe(document.body, { 7308 childList: true, 7309 subtree: true, 7310 attributes: true, 7311 attributeFilter: ["style", "class", "hidden"] 7312 }); 7313 7314 return observer; // so you can disconnect() later if needed 7315} 7316 7317function replaceHTML(target, trips) { 7318 if (document.getElementById(EXPERIMENT_ID)) return; 7319 if (!trips || !trips.length) { 7320 console.warn("LTONB: No trips returned for replacement"); 7321 return; 7322 } 7323 if (!target) { 7324 console.warn("LTONB: Target element not available for replacement"); 7325 return; 7326 } 7327 7328 var locale = getLocale(); 7329 var cardsHtml = trips 7330 .map(function (trip) { 7331 return renderTripCard(trip, locale); 7332 }) 7333 .join(""); 7334 7335 var wrapper = document.createElement("div"); 7336 wrapper.id = EXPERIMENT_ID; 7337 7338 wrapper.innerHTML = ` 7339 <section class="ef-section z-0 flex flex-col overflow-visible relative lg:max-w-[1440px]"> 7340 <div class="py-8 lg:py-0 grid col-span-4 lg:grid-cols-12"> 7341 <div class="grid grid-cols-1 md:grid-cols-2 gap-4 col-span-4 lg:col-span-12 lg:px-0 px-6"> 7342 ${cardsHtml} 7343 </div> 7344 </div> 7345 </section> 7346 `; 7347 7348 target.replaceWith(wrapper); 7349} 7350 7351function replaceText(node, newText) { 7352 if (node.nodeType === Node.TEXT_NODE) { 7353 node.textContent = newText; 7354 } else { 7355 node.childNodes.forEach((child) => replaceText(child, newText)); 7356 } 7357} 7358 7359function updateHero() { 7360 // hide original hero 7361 var hero = document.querySelector('#hero, .hero, [data-component="hero"]'); 7362 if (hero) { 7363 hero.style.setProperty("display", "none", "important"); 7364 } else { 7365 console.warn("LTONB: Original hero element not found"); 7366 } 7367 7368 // show test hero 7369 var testHero = document.querySelector('#test-hero, .test-hero, [data-component="test-hero"]'); 7370 if (testHero) { 7371 testHero.style.setProperty("display", "block", "important"); 7372 testHero.style.setProperty("visibility", "visible", "important"); 7373 testHero.style.setProperty("opacity", "1", "important"); 7374 testHero.removeAttribute("hidden"); 7375 testHero.classList.remove("hidden"); 7376 } else { 7377 console.warn("LTONB: Test hero element not found"); 7378 } 7379} 7380 7381function updateHeroButton() { 7382 var testHeroOffersButton = document.querySelector( 7383 '#test-hero a, .test-hero a, [data-component="test-hero"] a' 7384 ); 7385 if (testHeroOffersButton) { 7386 replaceText(testHeroOffersButton, BUTTON_TEXT); 7387 testHeroOffersButton.setAttribute("href", normalizeLtPath(window.location.pathname) + "trips/"); 7388 } else { 7389 console.warn("LTONB: Offers button in test hero not found"); 7390 } 7391} 7392 7393function updatePromotionsCarousel(target, trips) { 7394 var element = document.querySelector(target); 7395 var headerElement = document.querySelector( 7396 '[data-clicksubregion="promotions-grid"] > [data-cy="container"] > [data-cy="container"] > [data-cy="grid-item"] > [data-cy="section-title"] > div > [data-sentry-element="SectionTitle"] > [data-cy="section-title-title"] > span' 7397 ); 7398 if (headerElement && element) { 7399 replaceText(headerElement, LAST_SPOTS_HEADER); 7400 replaceHTML(element, trips); 7401 } 7402} 7403 7404onElementVisible('[data-cy="promotions-carousel-container"]', function () { 7405 fetchLastSpots().then(function (trips) { 7406 updatePromotionsCarousel('[data-cy="promotions-carousel-container"]', trips); 7407 }); 7408}); 7409 7410onElementVisible('#test-hero a, .test-hero a, [data-component="test-hero"] a', function () { 7411 updateHeroButton(); 7412}); 7413 7414onElementVisible('#hero, .hero, [data-component="hero"]', function () { 7415 updateHero(); 7416}); 7417}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "6241820049408000", "endOfRange": 1000}, {"entityId": "5126371542827008", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6514039975575552"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5117830362824704"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6528439507746816", "name": null, "commitId": "5919447169368064", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5623271811448832", "integrationSettings": null, "variations": [{"id": "5974903787094016", "name": null, "actions": [{"viewId": "4543444689879040", "changes": [{"id": "A8E2A6D1-8F76-4DCA-A986-51DD6774FA2B", "src": "/actions/d8615e9860c1950512803efd97d2ac3df7bedb66a67f6320561067aacd1defe0.js", "depen
7417dencies": [], "type": "custom_css"}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6528439507746816"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["4543444689879040"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5623271811448832", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6534560339460096", "name": null, "commitId": "5411414429401088", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "27831550777"], "audienceName": null, "changes": null, "id": "4576986125828096", "integrationSettings": null, "variations": [{"id": "6226320804282368", "name": null, "actions": [{"viewId": "4727973278908416", "changes": []}]}, {"id": "6093621816983552", "name": null, "actions": [{"viewId": "4727973278908416", "changes": [{"id": "f8688df1fa27407888328fc1a05f283b", "src": "/actions/521f6e5cdce4e6b3fb711dbb9d80eb2177aa4213e1b137d9ca2f152f544ec84d.js", "dependencies": [], "type": "custom_code"}, {"id": "7412ee29058c42359656b4006bba3b77", "type": "redirect", "dependencies": [], "dest": "https://www.ef.fr/cc/test/brochure-advisorcall/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "6226320804282368", "endOfRange": 5000}, {"entityId": "6093621816983552", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6534560339460096"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4727973278908416"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6577501657366528", "name": null, "commitId": "4874652418310144", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5595932046131200", "integrationSettings": null, "variations": [{"id": "6456064141426688", "name": null, "actions": [{"viewId": "6713069213057024", "changes": [{"id": "8163b510a97049f68ef2687bed237eb2", "type": "custom_code", "value": function($){(function () { 7418 var chatbotId = "JvlDkhPBZQztIHUwmStAm"; 7419 7420 /* ===== Disable floating messages BEFORE SDK loads ===== */ 7421 window.chatbaseConfig = { showFloatingInitialMessages: false }; 7422 7423 /* ================= Helpers (ES5) ================= */ 7424 function chatbaseReady() { 7425 try { 7426 return typeof window.chatbase === "function" && 7427 window.chatbase("getState") !== "uninitialized"; 7428 } catch (_e) { return false; } 7429 } 7430 7431 /* --- URL param helpers (ES5, robust decoding) --- */ 7432 function getQueryParam(name) { 7433 try { 7434 var qs = window.location && window.location.search ? window.location.search : ""; 7435 if (!qs || qs.length < 2) return ""; 7436 var query = qs.substring(1); 7437 var parts = query.split("&"); 7438 var i, kv, k, v; 7439 for (i = 0; i < parts.length; i++) { 7440 kv = parts[i].split("="); 7441 if (!kv || kv.length === 0) continue; 7442 k = kv[0] ? decodeURIComponent(kv[0].replace(/\+/g, " ")) : ""; 7443 if (k !== name) continue; 7444 v = kv.length > 1 ? kv.slice(1).join("=") : ""; 7445 v = v ? decodeURIComponent(v.replace(/\+/g, " ")) : ""; 7446 return v || ""; 7447 } 7448 } catch (_e) {} 7449 return ""; 7450 } 7451 7452 function deriveCountryCodeFromDestination(dest) { 7453 // destination expected like "US-NYC". Take first 2 chars. 7454 if (!dest || dest.length < 2) return ""; 7455 return String(dest).substring(0, 2).toLowerCase(); 7456 } 7457 7458 /* Optimizely end user id from Local Storage (robust scan) */ 7459 function getOptimizelyEndUserId() { 7460 try { 7461 var direct = localStorage.getItem("profile.visitorId"); 7462 if (direct) { 7463 try { 7464 var pd = JSON.parse(direct); 7465 if (pd && typeof pd === "object") { 7466 if (pd.endUserId) return String(pd.endUserId); 7467 if (pd.value) return String(pd.value); 7468 if (pd.id) return String(pd.id); 7469 } 7470 } catch (_ignore) {} 7471 return String(direct); 7472 } 7473 var i, k, v, obj; 7474 for (i = 0; i < localStorage.length; i++) { 7475 k = localStorage.key(i); 7476 if (k && k.indexOf("$visitor_profile") !== -1) { 7477 v = localStorage.getItem(k); 7478 if (!v) continue; 7479 try { obj = JSON.parse(v); } catch (_e) { obj = null; } 7480 if (obj) { 7481 if (obj.profile && obj.profile.visitorId) return String(obj.profile.visitorId); 7482 if (obj.visitorId) return String(obj.visitorId); 7483 } 7484 } 7485 } 7486 } catch (_e) {} 7487 return ""; 7488 } 7489 7490 /* ---- UTM -> EF Partners (sourceCode + eTag) ---- */ 7491 function extractUtmFromDl(dl) { 7492 var utm = { source: "(direct)", medium: "(none)", content: "noref" }; 7493 try { 7494 if (dl && dl.channel && dl.channel.utm && dl.channel.utm[0]) { 7495 var u = dl.channel.utm[0]; 7496 if (u.source) utm.source = String(u.source);
7497 if (u.medium) utm.medium = String(u.medium); 7498 if (u.content) utm.content = String(u.content); 7499 } 7500 } catch (_e) {} 7501 return utm; 7502 } 7503 7504 function bestGuessDL() { 7505 if (window.dl) return window.dl; 7506 if (window.dataLayer && window.dataLayer.length) { 7507 var i; 7508 for (i = window.dataLayer.length - 1; i >= 0; i--) { 7509 var it = window.dataLayer[i]; 7510 if (it && it.channel && it.channel.utm) return it; 7511 } 7512 } 7513 return null; 7514 } 7515 7516 function fetchEfPartnersSourceCode(utm, cb) { 7517 var url = "https://www.ef.fr/utm2efpartners/getefpartners/"; 7518 var xhr = new XMLHttpRequest(); 7519 xhr.open("POST", url, true); 7520 xhr.setRequestHeader("Content-Type", "application/json"); 7521 xhr.onreadystatechange = function () { 7522 if (xhr.readyState !== 4) return; 7523 if (xhr.status >= 200 && xhr.status < 300) { 7524 var data; 7525 try { data = JSON.parse(xhr.responseText); } catch (e) { return cb(e); } 7526 if (data && data.status === "Success" && data.result) { 7527 return cb(null, { 7528 sourceCode: data.result.sourceCode || "", 7529 eTag: data.result.eTag || "" 7530 }); 7531 } 7532 return cb(new Error((data && data.errorMessage) || "No partner match")); 7533 } 7534 cb(new Error("HTTP " + xhr.status)); 7535 }; 7536 try { 7537 xhr.send(JSON.stringify({ 7538 source: utm.source, 7539 medium: utm.medium, 7540 content: utm.content 7541 })); 7542 } catch (err) { cb(err); } 7543 } 7544 7545 /* =============== ONE-TIME IDENTIFY COORDINATOR =============== */ 7546 var meta = { 7547 destinationCode: "", 7548 productCode: "ils", 7549 courseCode: "", 7550 countryCode: "", 7551 duration: "", 7552 bookingFor: "", 7553 optimizelyEndUserId: "", 7554 sourceCode: "", 7555 eTag: "", 7556 accommodationType: "", 7557 residenceCode: "", 7558 roomType: "" 7559 }; 7560 7561 var gotPartners = false; 7562 var sentOnce = false; 7563 7564 function populateMetaFromUrl() { 7565 // destinationCode from URL param destination 7566 var dest = getQueryParam("destination"); 7567 meta.destinationCode = dest || ""; 7568 7569 // courseCode from URL param course 7570 meta.courseCode = getQueryParam("course") || ""; 7571 7572 // duration from URL param duration 7573 meta.duration = getQueryParam("duration") || ""; 7574 7575 // bookingFor from URL param bookingFor 7576 meta.bookingFor = getQueryParam("bookingFor") || ""; 7577 7578 // countryCode derived from destinationCode (first 2 letters lowercased) 7579 meta.countryCode = deriveCountryCodeFromDestination(meta.destinationCode); 7580 } 7581 7582 /* ---- EF Booking (window.__efBooking) -> user_metadata ---- */ 7583 function normalizeEfBooking(obj) { 7584 var b = (obj && typeof obj === "object") ? obj : {}; 7585 return { 7586 accommodationType: b.accommodationType ? String(b.accommodationType) : "", 7587 residenceCode: b.residenceCode ? String(b.residenceCode) : "", 7588 roomType: b.roomType ? String(b.roomType) : "" 7589 }; 7590 } 7591 7592 function efBookingSignature(b) { 7593 return (b.accommodationType || "") + "|" + (b.residenceCode || "") + "|" + (b.roomType || ""); 7594 } 7595 7596 function applyEfBookingToMeta(b) { 7597 meta.accommodationType = b.accommodationType || ""; 7598 meta.residenceCode = b.residenceCode || ""; 7599 meta.roomType = b.roomType || ""; 7600 } 7601 7602 var lastEfBookingSig = ""; 7603 7604 function sendUserMetadataUpdate(reason) { 7605 if (!chatbaseReady()) return; 7606 7607 // If initial identify has not happened yet, keep the existing gating behavior. 7608 if (!sentOnce) { 7609 maybeSendOnce(reason || "efBooking-pre"); 7610 return; 7611 } 7612 7613 try { 7614 window.chatbase("identify", { user_metadata: meta }); 7615 console.log("ð¦ [update] user_metadata updated:", reason, meta); 7616 } catch (e) { 7617 console.warn("â identify update failed:", e); 7618 } 7619 } 7620 7621 function readEfBookingAndMaybeUpdate(reason) { 7622 var b = normalizeEfBooking(window.__efBooking); 7623 var sig = efBookingSignature(b); 7624 if (sig === lastEfBookingSig) return; 7625 7626 lastEfBookingSig = sig; 7627 applyEfBookingToMeta(b); 7628 sendUserMetadataUpdate(reason || "efBooking-change"); 7629 } 7630 7631 function startEfBookingWatch() {
7632 // Initial sync (so first identify includes booking info when available). 7633 readEfBookingAndMaybeUpdate("efBooking-initial"); 7634 7635 // Capture re-assignments: window.__efBooking = {...} 7636 try { 7637 var current = window.__efBooking; 7638 Object.defineProperty(window, "__efBooking", { 7639 configurable: true, 7640 enumerable: true, 7641 get: function () { return current; }, 7642 set: function (v) { 7643 current = v; 7644 readEfBookingAndMaybeUpdate("efBooking-setter"); 7645 } 7646 }); 7647 } catch (_e) {} 7648 7649 // Capture in-place mutations: window.__efBooking.roomType = "single" 7650 setInterval(function () { 7651 readEfBookingAndMaybeUpdate("efBooking-poll"); 7652 }, 500); 7653 } 7654 7655 function maybeSendOnce(tag) { 7656 if (sentOnce) return; 7657 if (!chatbaseReady()) return; 7658 7659 // Same gating behavior as today: wait for partners AND require Optimizely end user id 7660 if (!gotPartners || !meta.optimizelyEndUserId) return; 7661 7662 try { 7663 window.chatbase("identify", { user_metadata: meta }); 7664 sentOnce = true; 7665 console.log("ð¦ [one-shot] user_metadata sent:", meta); 7666 } catch (e) { 7667 console.warn("â identify failed:", e); 7668 } 7669 } 7670 7671 /* ===== Place custom button & relay to native bubble ===== */ 7672 function insertCustomChatButton() { 7673 var stickyParent = document.querySelector('[data-clicksubregion="sticky"]'); 7674 if (!stickyParent || !stickyParent.firstElementChild) return; 7675 7676 var buttonGroup = stickyParent.firstElementChild; 7677 var anchors = buttonGroup.getElementsByTagName("a"); 7678 if (!anchors.length) return; 7679 7680 var firstAnchor = anchors[0]; 7681 if (!firstAnchor) return; 7682 7683 var existingBtn = document.getElementById("custom-chatbase-button"); 7684 if (existingBtn) { 7685 if (firstAnchor.nextSibling !== existingBtn) { 7686 buttonGroup.insertBefore(existingBtn, firstAnchor.nextSibling); 7687 } 7688 return; 7689 } 7690 7691 var customBtn = document.createElement("button"); 7692 customBtn.setAttribute("aria-label", "chatbase-custom-button"); 7693 customBtn.setAttribute("id", "custom-chatbase-button"); 7694 customBtn.setAttribute("type", "button"); 7695 customBtn.className = "md:order-4"; 7696 customBtn.style.cssText = 7697 "background: transparent; border: none; cursor: pointer; display: flex;" + 7698 "align-items: center; justify-content: center; width: 48px; height: 48px;" + 7699 "padding: 0px; margin-left: 10px;"; 7700 7701 var img = document.createElement("img"); 7702 img.src = "https://storage.googleapis.com/analytics_tactical/digital_factory/ori-chat-button.svg"; 7703 img.alt = "Chat"; 7704 img.width = 48; 7705 img.height = 48; 7706 customBtn.appendChild(img); 7707 7708 buttonGroup.insertBefore(customBtn, firstAnchor.nextSibling); 7709 7710 // Toggle Chatbase via native bubble 7711 customBtn.addEventListener("click", function () { 7712 var realChatBtn = document.getElementById("chatbase-bubble-button"); 7713 if (realChatBtn && typeof realChatBtn.click === "function") { 7714 realChatBtn.click(); 7715 } else { 7716 console.warn("â ï¸ Chatbase bubble not found"); 7717 } 7718 }); 7719 } 7720 7721 /* ===== Load Chatbase ===== */ 7722 var script = document.createElement("script"); 7723 script.src = "https://www.chatbase.co/embed.min.js"; 7724 script.defer = true; 7725 script.setAttribute("chatbotId", chatbotId); 7726 script.setAttribute("domain", "www.chatbase.co"); 7727 7728 script.onload = function () { 7729 // Hide native bubble 7730 var style = document.createElement("style"); 7731 style.innerHTML = "#chatbase-bubble-button { " + 7732 "position: absolute !important;" + 7733 "width: 1px !important;" + 7734 "height: 1px !important;" + 7735 "opacity: 0 !important;" + 7736 "pointer-events: none !important;" + 7737 "overflow: hidden !important;" + 7738 "z-index: -1 !important;" + 7739 "}"; 7740 document.head.appendChild(style); 7741 7742 // Keep custom button placed (handles re-renders) 7743 setInterval(insertCustomChatButton, 1000); 7744 7745 /* ------- Collect ALL metadata, then send ONCE ------- */ 7746 7747 // URL params (sync) 7748 populateMetaFromUrl(); 7749 7750 // Optimizely (sync) 7751 meta.optimizelyEndUserId = getOptimizelyEndUserId(); 7752 7753 // EF booking object (accommodation selection) 7754 startEfBookingWatch(); 7755 7756 // EF Partners (async request) 7757 var utm = extractUtmFromDl(bestGuessDL()); 7758 fetchEfPartnersSourceCode(utm, function (err, result) { 7759 if (err) { 7760 console.warn("EF Partners lookup failed:", err && err.message ? err.message : err); 7761 } else { 7762 meta.sourceCode = result.sourceCode || ""; 7763 meta.eTag = result.eTag || ""; 7764 } 7765 gotPartners = true; // proceed either way 7766 maybeSendOnce("partners"); 7767 }); 7768 7769 // As a last resort, attempt send after a hard cap if still not sent 7770 setTimeout(function () { maybeSendOnce("hard-cap"); }, 8000); 7771 7772 /* ----- SPA navigation: keep UI behavior but DO NOT re-identify ----- */ 7773 (function patchHistoryForSpaEvents() { 7774 var pushState = history.pushState; 7775 var replaceState = history.replaceState; 7776 7777 history.pushState = function () { 7778 var ret = pushState.apply(history, arguments); 7779 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 7780 return ret; 7781 }; 7782 history.replaceState = function () { 7783 var ret = replaceState.apply(history, arguments); 7784 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 7785 return ret; 7786 }; 7787 window.addEventListener("popstate", function () { 7788 try { window.dispatchEvent(new Event("spa:navigation")); } catch (_e) {} 7789 }); 7790 7791 window.addEventListener("spa:navigation", function () { 7792 setTimeout(function () { 7793 insertCustomChatButton(); 7794 7795 // We intentionally DO NOT re-identify on SPA navigation. 7796 // If your routing changes URL params and you want the bot to reflect that, 7797 // you would need a decision on whether to allow re-identify updates. 7798 // Keeping behavior identical to current script. 7799 }, 150); 7800 }); 7801 })(); 7802 }; 7803 7804 if (document.readyState === "complete") { 7805 document.body.appendChild(script); 7806 } else { 7807 window.addEventListener("load", function () { 7808 document.body.appendChild(script); 7809 }); 7810 } 7811})(); 7812}, "dependencies": []}, {"id": "98ec9091b904443e895e60546315749c", "type": "append", "selector": "head", "value": "<style>button[data-cy=\"gudl-chat-button\"] {\n width: 0 !important;\n height: 0 !important;\n color: transparent !important;\n background: transparent !important;\n border: none !important;\n pointer-events: none !important;\n}\n\nbutton[data-cy=\"gudl-chat-button\"] {\n visibility: hidden !important;\n}\n\n#chatbase-bubble-button {\n width: 1px !important;\n height: 1px !important;\n opacity: 0 !important;\n pointer-events: none !important;\n overflow: hidden !important;\n position: absolute !important;\n z-index: -1 !important;\n}</style>
7812", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6577501657366528"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["6713069213057024"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5595932046131200", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6579113383690240", "name": null, "commitId": "5443560336523264", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "4851055238840320"], "audienceName": null, "changes": null, "id": "6630747144978432", "integrationSettings": null, "variations": [{"id": "5699609106841600", "name": null, "actions": [{"viewId": "6016163430268928", "changes": []}]}, {"id": "5614953718087680", "name": null, "actions": [{"viewId": "6016163430268928", "changes": [{"id": "725ec435518d420687dd4af767a536ae", "type": "redirect", "dependencies": [], "dest": "https://www.efjapan.co.jp/cc/test-cons-bo/language-abroad/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "5699609106841600", "endOfRange": 5000}, {"entityId": "5614953718087680", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6579113383690240"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6016163430268928"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6582327562731520", "name": null, "commitId": "5584066427224064", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5274513779195904", "integrationSettings": null, "variations": [{"id": "4827805498736640", "name": null, "actions": [{"viewId": "4562403229171712", "changes": []}]}, {"id": "5666231131308032", "name": null, "actions": [{"viewId": "4562403229171712", "changes": [{"isOpalManaged": false, "dependencies": [], "allowAdditionalRedirect": false, "preserveParameters": false, "type": "redirect", "id": "638D7F74-F76B-45FA-9ECC-8B4692C5066D", "dest": function redirectFn() { 7813document.cookie="multipg_visit=true; max-age=86400; path=/"; 7814return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search; 7815} 7816}]}]}], "weightDistributions": [{"entityId": "5666231131308032", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6582327562731520"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4562403229171712"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6594645094825984", "name": null, "commitId": "5295855440232448", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "6053006165147648", "integrationSettings": null, "variations": [{"id": "5674585119522816", "name": null, "actions": [{"viewId": "4854401051918336", "changes": [{"id": "93473FBE-C1C2-443D-B65A-C7A391926D17", "src": "/actions/3ee60206479f1bb18da838a59dd44376599168e6eecc234198b86b5389debaf1.js", "dependencies": [], "type": "custom_code"}, {"id": "47838A02-BDFE-47AB-AFFF-94A01F9C89CC", "type": "append", "selector": "head", "value": "<style>#mycal {\n color: #333;\n margin: 0 auto;\n width: 100%;\n border-radius: 8px;\n background-color: #fff;\n }\n \n .timeslot-calendar {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n height: fit-content;\n }\n \n .timeslot-calendar th,\n .timeslot-calendar td {\n padding: 10px;\n text-align: center;\n border: 1px solid #e0e0e0;\n }\n \n .timeslot-calendar th {\n background-color: #003C64;\n color: #fff;\n font-weight: normal;\n }\n \n .timeslot-calendar .timeslot {\n cursor: pointer;\n transition: background-color 0.3s;\n }\n \n .timeslot-calendar .timeslot:hover {\n background-color: #e
78160f3ff;\n }\n \n .timeslot-calendar .selected {\n background-color: #0073e6;\n color: #fff;\n }\n\n .calendar-navigation {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n font-family: Arial, sans-serif;\n }\n .calendar-title {\n font-size: 16px;\n font-weight: bold;\n }\n .calendar-btn {\n background: #0073e6;\n border: none;\n color: #fff;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background 0.3s;\n }\n .calendar-btn:disabled {\n background: #ccc;\n cursor: not-allowed;\n }\n .calendar-btn:hover:not(:disabled) {\n background: #005bb5;\n }\n .japanese-day {\n font-size: 12px;\n color: #555;\n }\n .japanese-day {\n font-size: 12px;\n color: #FFF;\n }\n .timeslot.unavailable {\n background-color: #d3d3d3;\n color: #888;\n pointer-events: none;\n }\n .timeslot.selected {\n background-color: #0073e6;\n color: #FFF;\n }\n \n /* Mobile specific styles */\n @media (max-width: 767px) {\n .timeslot-calendar th,\n .timeslot-calendar td {\n font-size: 10px;\n } }</style>", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6594645094825984"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["4854401051918336"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "6053006165147648", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6622491636924416", "name": null, "commitId": "4970181936545792", "groupId": null, "holdback": 1000, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "4869964859965440"], "audienceName": null, "changes": null, "id": "5629874061180928", "integrationSettings": null, "variations": [{"id": "5466647452975104", "name": null, "actions": [{"viewId": "5902152606941184", "changes": [{"id": "18f58771123146e9814fb8cf40526bde", "type": "custom_code", "value": function($){// 1) Market configuration (merged + expanded) 7817const marketConfig = { 7818 ar: { 7819 text: 'Reservá una cita personalizada', 7820 url: 'https://www.ef.com.ar/ils/consultation/', 7821 }, 7822 at: { 7823 text: 'Einen Beratungstermin buchen', 7824 url: 'https://www.ef.at/ils/consultation/', 7825 }, 7826 au: { 7827 text: 'Book a consultation', 7828 url: 'https://www.ef-australia.com.au/ils/consultation/', 7829 }, 7830 be: { 7831 text: 'Prendre rendez-vous', 7832 url: 'https://www.ef.be/fr/ils/consultation/', 7833 }, 7834 br: { 7835 text: 'Marque uma consulta', 7836 url: 'https://www.ef.com.br/ils/consultation/', 7837 }, 7838 bx: { 7839 text: 'Boek een consultatie', 7840 url: 'https://www.ef.be/nl/ils/consultation/', 7841 }, 7842 ca: { 7843 text: 'Book a consultation', 7844 url: 'https://www.ef.com/ca/ils/consultation/', 7845 }, 7846 ch: { 7847 text: 'Réservez une consultation', 7848 url: 'https://www.efswiss.ch/fr/ils/consultation/', 7849 }, 7850 cl: { 7851 text: 'Reserva una asesorÃa', 7852 url: 'https://www.ef.com/cl/ils/consultation/', 7853 }, 7854 cn: { text: 'é¢çº¦å¨è¯¢', url: 'https://www.ef.com.cn/ils/consultation/' }, 7855 co: { 7856 text: 'Reserva una asesorÃa', 7857 url: 'https://www.ef.com.co/ils/consultation/', 7858 }, 7859 cs: { 7860 text: 'Buche einen Beratungstermin', 7861 url: 'https://www.efswiss.ch/de/ils/consultation/', 7862 }, 7863 ct: { 7864 text: 'Prenota una consulenza', 7865 url: 'https://www.efswiss.ch/it/ils/consultation/', 7866 }, 7867 cz: { 7868 text: 'Objednejte se na schůzku', 7869 url: 'https://www.ef-czech.cz/ils/consultation/', 7870 }, 7871 de: { 7872 text: 'Buche einen Beratungstermin', 7873 url: 'https://www.ef.de/ils/consultation/', 7874 }, 7875 dk: { 7876 text: 'Book en konsultation', 7877 url: 'https://www.ef-danmark.dk/ils/consultation/', 7878 }, 7879 do: { 7880 text: 'Book a consultation', 7881 url: 'https://www.ef.do/ils/consultation/', 7882 }, 7883 dx: { text: 'Ø§ØØ¬Ø² استشارة', url: 'https://www.ef.dz/ar/ils/consultation/' }, 7884 dz: { 7885 text: 'Réservez une consultation', 7886 url: 'https://www.ef.dz/fr/ils/consultation/', 7887 }, 7888 ec: {
7889 text: 'Reserva una consulta', 7890 url: 'https://www.ef.com.ec/ils/consultation/', 7891 }, 7892 es: { 7893 text: 'Agenda una llamada/cita', 7894 url: 'https://www.ef.com.es/ils/consultation/', 7895 }, 7896 fc: { 7897 text: 'Réservez une consultation', 7898 url: 'https://www.ef.com/cafr/ils/consultation/', 7899 }, 7900 fi: { 7901 text: 'Varaa konsultaatio', 7902 url: 'https://www.ef.fi/ils/consultation/', 7903 }, 7904 fr: { 7905 text: 'Rencontrez un conseiller', 7906 url: 'https://www.ef.fr/ils/consultation/', 7907 }, 7908 gb: { 7909 text: 'Book a consultation', 7910 url: 'https://www.ef.co.uk/ils/consultation/', 7911 }, 7912 hk: { text: 'é ç´è«®è©¢', url: 'https://www.ef.com.hk/ils/consultation/' }, 7913 hu: { 7914 text: 'Foglalj konzultációt', 7915 url: 'https://www.ef.co.hu/ils/consultation/', 7916 }, 7917 id: { 7918 text: 'Daftar konsultasi', 7919 url: 'https://www.ef.co.id/ils/consultation/', 7920 }, 7921 it: { 7922 text: 'Incontra un consulente', 7923 url: 'https://www.ef-italia.it/ils/consultation/', 7924 }, 7925 jp: { 7926 text: 'ã«ã¦ã³ã»ãªã³ã°äºç´', 7927 url: 'https://www.efjapan.co.jp/ils/consultation/', 7928 }, 7929 kr: { 7930 text: '1:1 컨ì¤í ìì½í기', 7931 url: 'https://www.ef.co.kr/ils/consultation/', 7932 }, 7933 kz: { 7934 text: 'ÐабÑониÑÑйÑе конÑÑлÑÑаÑиÑ', 7935 url: 'https://www.ef.com/kz/ils/consultation/', 7936 }, 7937 lu: { 7938 text: 'Prendre rendez-vous', 7939 url: 'https://www.ef.lu/fr/ils/consultation/', 7940 }, 7941 lv: { 7942 text: 'RezervÄjiet konsultÄciju', 7943 url: 'https://www.ef.lv/ils/consultation/', 7944 }, 7945 mx: { 7946 text: 'Solicita una reunión informativa', 7947 url: 'https://www.ef.com.mx/ils/consultation/', 7948 }, 7949 nl: { text: 'Boek een consult', url: 'https://www.ef.nl/ils/consultation/' }, 7950 no: { 7951 text: 'Bestill gratis veiledning', 7952 url: 'https://www.ef.no/ils/consultation/', 7953 }, 7954 pa: { 7955 text: 'Reserva una consulta', 7956 url: 'https://www.ef.com.pa/ils/consultation/', 7957 }, 7958 pe: { 7959 text: 'Reserve una consulta', 7960 url: 'https://www.ef.com.pe/ils/consultation/', 7961 }, 7962 pl: { 7963 text: 'Zarezerwuj konsultacjÄ', 7964 url: 'https://www.ef.pl/ils/consultation/', 7965 }, 7966 pt: { 7967 text: 'Marcar uma reunião', 7968 url: 'https://www.ef.edu.pt/ils/consultation/', 7969 }, 7970 ro: { 7971 text: 'RezervÄ o consultaÈie', 7972 url: 'https://www.ef.ro/ils/consultation/', 7973 }, 7974 sa: { text: 'Ø§ØØ¬Ø² استشارة', url: 'https://www.ef.com/sa/ils/consultation/' }, 7975 se: { 7976 text: 'Boka en konsultation', 7977 url: 'https://www.ef.se/ils/consultation/', 7978 }, 7979 si: { 7980 text: 'NaroÄite se na posvet', 7981 url: 'https://www.ef.si/ils/consultation/', 7982 }, 7983 sk: { 7984 text: 'Dohodnite si konzultáciu', 7985 url: 'https://www.ef-slovakia.sk/ils/consultation/', 7986 }, 7987 sx: { 7988 text: 'Book a consultation', 7989 url: 'https://www.ef.com/saen/ils/consultation/', 7990 }, 7991 th: { text: 'à¸à¸à¸à¸à¸´à¸§à¸à¸£à¸¶à¸à¸©à¸²', url: 'https://www.ef.co.th/ils/consultation/' }, 7992 tn: { 7993 text: 'Réservez une consultation', 7994 url: 'https://www.ef.tn/fr/ils/consultation/', 7995 }, 7996 tr: { 7997 text: 'DanıÅmanlık randevusu alın', 7998 url: 'https://www.ef.com.tr/ils/consultation/', 7999 }, 8000 tw: { text: 'é ç´è«®è©¢', url: 'https://www.ef.com.tw/ils/consultation/' }, 8001 tx: { text: 'Ø§ØØ¬Ø² استشارة', url: 'https://www.ef.tn/ar/ils/consultation/' }, 8002 us: { 8003 text: 'Book a consultation', 8004 url: 'https://www.ef.edu/ils/consultation/', 8005 }, 8006 ve: { 8007 text: 'Reserve una consulta', 8008 url: 'https://www.ef.com/ve/ils/consultation/', 8009 }, 8010 vn: { 8011 text: 'Äặt lá»ch tư vấn', 8012 url: 'https://www.ef.com.vn/ils/consultation/', 8013 }, 8014 wc: { 8015 text: 'Rencontrez un conseiller', 8016 url: 'https://www.ef.com/wwfr/ils/consultation/', 8017 }, 8018 we: { 8019 text: 'Book a consultation', 8020 url: 'https://www.ef.com/wwen/ils/consultation/', 8021 }, 8022 wl: { 8023 text: 'Reserve una consulta', 8024 url: 'https://www.ef.com/wwes/ils/consultation/', 8025 }, 8026 wm: { 8027 text: 'Ø§ØØ¬Ø² استشارة', 8028 url: 'https://www.ef.com/wwar/ils/consultation/', 8029 }, 8030 wp: { 8031 text: 'Marque uma consulta', 8032 url: 'https://www.ef.com/wwpt/ils/consultation/', 8033 }, 8034 wr: { 8035 text: 'ÐапиÑаÑÑÑÑ Ð½Ð° конÑÑлÑÑаÑиÑ', 8036 url: 'https://www.ef.com/wwru/ils/consultation/', 8037 }, 8038}; 8039 8040// 2 Update brochure button with market-specific config 8041function updateBrochureButton() { 8042 const market = window.dl.page.market_code;
8043 const config = marketConfig[market]; 8044 if (!config) { 8045 return; 8046 } 8047 8048 const brochureBtn = document.querySelector( 8049 'a[href*="/ils/brochure/"][data-clicklabel="page:sticky"]' 8050 ); 8051 8052 if (brochureBtn) { 8053 brochureBtn.href = config.url; 8054 8055 const span = brochureBtn.querySelector('span span'); 8056 if (span) { 8057 span.textContent = config.text; 8058 } 8059 } else { 8060 // Retry if button hasn't loaded yet 8061 setTimeout(updateBrochureButton, 500); 8062 } 8063} 8064 8065// 3) Run the update 8066updateBrochureButton(); 8067}, "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6622491636924416"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5902152606941184"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5629874061180928", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6648905562062848", "name": null, "commitId": "6654978645819392", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "4706673015652352", "integrationSettings": null, "variations": [{"id": "4608211980910592", "name": null, "actions": []}, {"id": "4990036771340288", "name": null, "actions": [{"viewId": "4727098688929792", "changes": [{"id": "c5eb37470aa84ec6b06b1eb94df67b67", "type": "redirect", "dependencies": [], "isOpalManaged": false, "allowAdditionalRedirect": true, "dest": "https://www.ef-italia.it/cp/brochure/v2/", "preserveParameters": true}]}]}], "weightDistributions": [{"entityId": "4608211980910592", "endOfRange": 5000}, {"entityId": "4990036771340288", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6648905562062848"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4727098688929792"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6650595969335296", "name": null, "commitId": "5583749614665728", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5010472043282432", "integrationSettings": null, "variations": [{"id": "6251628873908224", "name": null, "actions": [{"viewId": "5140772224237568", "changes": [{"id": "64BA7979-39A2-4022-8C3C-2DAD54A3F2CA", "src": "/actions/62ed0759608147e523701c70ac544605cedbfa088d91167ab8c6884a63811957.js", "dependencies": [], "type": "custom_code"}, {"id": "169355CE-2093-4FBB-A71B-0C49DCB80215", "type": "append", "selector": "head", "value": "<style>#mycal {\n color: #333;\n margin: 0 auto;\n width: 100%;\n border-radius: 8px;\n background-color: #fff;\n }\n \n .timeslot-calendar {\n width: 100%;\n border-collapse: collapse;\n table-layout: fixed;\n height: fit-content;\n }\n \n .timeslot-calendar th,\n .timeslot-calendar td {\n padding: 10px;\n text-align: center;\n border: 1px solid #e0e0e0;\n }\n \n .timeslot-calendar th {\n background-color: #003C64;\n color: #fff;\n font-weight: normal;\n }\n \n .timeslot-calendar .timeslot {\n cursor: pointer;\n transition: background-color 0.3s;\n }\n \n .timeslot-calendar .timeslot:hover {\n background-color: #e0f3ff;\n }\n \n .timeslot-calendar .selected {\n background-color: #0073e6;\n color: #fff;\n }\n\n .calendar-navigation {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 10px;\n font-family: Arial, sans-serif;\n }\n .calendar-title {\n font-size: 16px;\n font-weight: bold;\n }\n .calendar-btn {\n background: #0073e6;\n border: none;\n color: #fff;\n padding: 8px 16px;\n border-radius: 4px;\n cursor: pointer;\n font-size: 14px;\n transition: background 0.3s;\n }\n .calendar-btn:disabled {\n background: #ccc;
8067\n cursor: not-allowed;\n }\n .calendar-btn:hover:not(:disabled) {\n background: #005bb5;\n }\n .japanese-day {\n font-size: 12px;\n color: #555;\n }\n .japanese-day {\n font-size: 12px;\n color: #FFF;\n }\n .timeslot.unavailable {\n background-color: #d3d3d3;\n color: #888;\n pointer-events: none;\n }\n .timeslot.selected {\n background-color: #0073e6;\n color: #FFF;\n }\n \n /* Mobile specific styles */\n @media (max-width: 767px) {\n .timeslot-calendar th,\n .timeslot-calendar td {\n font-size: 10px;\n } }</style>", "dependencies": []}]}]}], "weightDistributions": null, "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6650595969335296"}, "deployed": false}], "policy": "equal_priority", "viewIds": ["5140772224237568"], "weightDistributions": null, "decisionMetadata": {"experimentPriorities": [[{"entityId": "5010472043282432", "endOfRange": null}]], "experimentWeights": null, "offerConsistency": null}, "concluded": false}, {"changes": null, "id": "6669486005157888", "name": null, "commitId": "6075251637878784", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "5706477027983360", "integrationSettings": null, "variations": [{"id": "4802864495722496", "name": null, "actions": [{"viewId": "5982368278773760", "changes": []}]}, {"id": "5863080528183296", "name": null, "actions": [{"viewId": "5982368278773760", "changes": [{"id": "9f07aa7f13274be9a9d585e352342a21", "type": "custom_code", "value": function($){(function(){'use strict';var N='it-ils-cta-copy-update',D=!1,S='a.ef-button,button.ef-button,[role="button"].ef-button,[data-cy="cta"],[component="cta"]',A=['aria-label','title','value','data-label','data-title','data-cta-label'],M={'Catalogo gratis':'Richiedi un catalogo gratuito','Catalogo gratuito':'Richiedi un catalogo gratuito','Free catalog':'Richiedi un catalogo gratuito','Free brochure':'Richiedi un catalogo gratuito','Preventivo gratis':'Richiedi un preventivo gratis','Preventivo gratuito':'Richiedi un preventivo gratis','Free quote':'Richiedi un preventivo gratis','Incontra un consulente':'Prenota una consulenza','Meet with a consultant':'Prenota una consulenza','Meet with an advisor':'Prenota una consulenza'};function ok(){return/(^|\.)ef-italia\.it$/i.test(location.hostname)&&/^\/ils(?:\/|$)/i.test(location.pathname)}function l(){D&&console&&console.log.apply(console,[N].concat([].slice.call(arguments)))}function n(v){return String(v||'').replace(/\s+/g,' ').trim()}function r(v){return M[n(v)]||null}function z(){[].slice.call(document.querySelectorAll('[data-sentry-source-file="sticky-cta.tsx"],[data-clicklabel="page:sticky"]')).forEach(function(e){for(var p=e,i=0;p&&p!==document.body&&i<10;p=p.parentElement,i++){var s=getComputedStyle(p),sc=s.position!='static'||s.transform!='none'||s.filter!='none'||s.perspective!='none'||s.isolation=='isolate'||s.contain!='none';if(sc)p.style.setProperty('z-index','2147483000','important')}})}function tx(t){var v=t.nodeValue,m=r(v);if(!m||n(v)===m)return!1;t.nodeValue=(v.match(/^\s*/)||[''])[0]+m+(v.match(/\s*$/)||[''])[0];return!0}function at(e){var c=!1;A.forEach(function(a){if(e.hasAttribute&&e.hasAttribute(a)){var v=e.getAttribute(a),m=r(v);if(m&&v!==m)e.setAttribute(a,m),c=!0}});return c}function inn(e){var c=!1,w=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:function(o){var p=o.parentElement;return p&&!p.closest('script,style,noscript,svg')&&r(o.nodeValue)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}},!1),o;while(o=w.nextNode())c=tx(o)||c;return c}function run(){if(!ok()||!document.body)return;var c=0;[].slice.call(document.querySelectorAll(S)).forEach(function(e){if(at(e))c++;if(inn(e))c++});z();c&&l('Updated CTA copy:',c)}var q=!1;function sch(){if(q)return;q=!0;requestAnimationFrame(function(){q=!1;run()})}function h(m){var o=history[m];typeof o=='function'&&(history[m]=function(){var v=o.apply(this,arguments);sch();setTimeout(sch,100);setTimeout(sch,500);return v})}
8067function init(){if(!ok())return;sch();new MutationObserver(sch).observe(document.documentElement,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:A});h('pushState');h('replaceState');['popstate','pageshow','load','scroll','resize'].forEach(function(e){addEventListener(e,sch,{passive:!0})});setInterval(sch,1000)}document.readyState==='loading'?document.addEventListener('DOMContentLoaded',init):init()})(); 8068}, "dependencies": []}]}]}], "weightDistributions": [{"entityId": "4802864495722496", "endOfRange": 5000}, {"entityId": "5863080528183296", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6669486005157888"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["5982368278773760"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6697671000326144", "name": null, "commitId": "6299708222603264", "groupId": null, "holdback": 10000, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5371537784569856"], "audienceName": null, "changes": null, "id": "6582531449946112", "integrationSettings": null, "variations": [{"id": "5516859131297792", "name": null, "actions": [{"viewId": "4768059634745344", "changes": []}]}, {"id": "6157308816785408", "name": null, "actions": [{"viewId": "4768059634745344", "changes": [{"id": "4DAC57F8-026D-44DB-A567-1382948FB84E", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com/cl/cc/test/language-abroad_all_generic_ilc_x_dest/", "preserveParameters": true, "allowAdditionalRedirect": false}]}]}], "weightDistributions": [{"entityId": "5516859131297792", "endOfRange": 5000}, {"entityId": "6157308816785408", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6697671000326144"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4768059634745344"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6727512556830720", "name": null, "commitId": "6047857738776576", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "6323794556485632"], "audienceName": null, "changes": null, "id": "4791802169917440", "integrationSettings": null, "variations": [{"id": "5917702076760064", "name": null, "actions": [{"viewId": "4967295506710528", "changes": []}]}, {"id": "4528489301278720", "name": null, "actions": [{"viewId": "4967295506710528", "changes": [{"isOpalManaged": false, "dependencies": [], "allowAdditionalRedirect": false, "preserveParameters": false, "type": "redirect", "id": "99ff13d34f2740aa809e50b205a2ea4d", "dest": function redirectFn() { 8069document.cookie="multipg_visit=true; path=/"; 8070return window.location.pathname.replace(/^.*$/, "") + "/multi/" + window.location.search; 8071} 8072}]}]}], "weightDistributions": [{"entityId": "5917702076760064", "endOfRange": 5000}, {"entityId": "4528489301278720", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6727512556830720"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["4967295506710528"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6730964286570496", "name": null, "commitId": "4896869092950016", "groupId": null, "holdback": 10000, "activation": {}, "integrationSettings": {}, "integrationStringVersion": 2, "experiments": [{"audienceIds": ["and", "5019894740156416"], "audienceName": null, "changes": null, "id": "5793950926110720", "integrationSettings": null, "variations": [{"id": "4741522709544960", "name": null, "actions": [{"viewId": "6648698541703168", "changes": []}]}, {"id": "6356900879532032", "name": null, "actions": [{"viewId": "6648698541703168", "changes": [{"id": "fe92e0b0fd2c49cfa09a986b0ac599aa", "type": "redirect", "dependencies": [], "dest": "https://www.ef.com.br/cc/test/language-abroad_all_generic_ilc_x_dest/", "preserveParameters": true, "allowAdditionalRedirect": false, "isOpalManaged": false}]}]}], "weightDistributions": [{"entityId": "4741522709544960", "endOfRange": 5000}, {"entityId": "6356900879532032", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6730964286570496"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6648698541703168"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}, {"changes": null, "id": "6749186471755776", "name": null, "commitId": "5454170130481152", "groupId": null, "holdback": 0, "activation": {}, "integrationSettings": {"google_analytics_4": {}, "5915512750735360": {}}, "integrationStringVersion": 2, "experiments": [{"audienceIds": null, "audienceName": null, "changes": null, "id": "4642895636987904", "integrationSettings": null, "variations": [{"id": "4914250731225088", "name": null, "actions": []}, {"id": "4676951841964032", "name": null, "actions": [{"viewId": "6325704910962688", "changes": [{"id": "ea3cb96a6f104a84b21540e9ae1a31a6", "type": "redirect", "depen
8072dencies": [], "isOpalManaged": false, "allowAdditionalRedirect": true, "dest": "https://www.ef.de/cp/brochure/v2/", "preserveParameters": true}]}]}], "weightDistributions": [{"entityId": "4914250731225088", "endOfRange": 5000}, {"entityId": "4676951841964032", "endOfRange": 10000}], "name": null, "bucketingStrategy": null, "experimentMetadata": {"allocationPolicy": "manual", "layerId": "6749186471755776"}, "deployed": false}], "policy": "single_experiment", "viewIds": ["6325704910962688"], "weightDistributions": null, "decisionMetadata": null, "concluded": false}], "groups": [], "audiences": [{"id": "26158870391", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "S-WK-A"}]], ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]]]}, {"id": "27831550777", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "fb"}], ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "ig"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]]]}, {"id": "4642787031777280", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "substring", "name": "utm_campaign", "type": "query", "value": "S-YR-A"}, {"match": "substring", "name": "utm_campaign", "type": "query", "value": "PMAX_LeadGen_YR"}]]]}, {"id": "4696042524901376", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "S-WS-A"}]]]}, {"id": "4848600379817984", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "S-EF-brand_courses"}]]]}, {"id": "4851055238840320", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "substring", "name": "utm_campaign", "type": "query", "value": "S-EDU"}, {"match": "exact", "name": "utm_campaign", "type": "query", "value": "PMAX_LeadGen_SA"}]]]}, {"id": "4869964859965440", "name": null, "conditions": ["and", ["or", ["or", {"match": null, "name": "event", "type": "behavior", "value": "{\"version\":\"0.1\",\"source\":\"events\",\"action\":{\"type\":\"custom\",\"value\":\"form_success-ILS-b\"},\"time\":{\"type\":\"last_days\",\"days\":90},\"count\":{\"comparator\":\"gte\",\"value\":1}}"}]]]}, {"id": "5019894740156416", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "S-XC-Agency"}]]]}, {"id": "5303473009328128", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "PMAX_LeadGen_LAN"}]]]}, {"id": "5371537784569856", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "S-EF-brand_combi"}]]]}, {"id": "5400001354924032", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "substring", "name": "utm_campaign", "type": "query", "value": "S-LT"}]]]}, {"id": "5449439335153664", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "multipg_visit", "type": "cookies", "value": "true"}]]]}, {"id": "5690635756240896", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "S-EDU-ERA"}]]]}, {"id": "5912819078529024", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "exact", "name": "utm_campaign", "type": "query", "value": "S-LT-ATTeenager"}]]]}, {"id": "6010579496730624", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "substring", "name": "utm_campaign", "type": "query", "value": "S-WK"}, {"match": "substring", "name": "utm_campaign", "type": "query", "value": "PMAX_LeadGen_WK"}, {"match": "substring", "name": "utm_campaign", "type": "query", "value": "S-INT-A"}]]]}, {"id": "6139402137632768", "name": null, "conditions": ["and", ["or", ["or", {"match": null, "name": "event", "type": "behavior", "value": "{\"version\":\"0.1\",\"source\":\"events\",\"action\":{\"type\":\"custom\",\"value\":\"form_success-LY-b\"},\"time\":{\"type\":\"last_days\",\"days\":90},\"count\":{\"comparator\":\"gte\",\"value\":1}}"}]]]}, {"id": "6323794556485632", "name": null, "conditions": ["and", ["or", ["not", ["or", {"match": "exact", "name": "funnel_visit", "type": "cookies", "value": "true"}]]]]}
8072, {"id": "6496950323773440", "name": null, "conditions": ["and", ["or", ["or", {"match": "exact", "name": "utm_source", "type": "query", "value": "google"}, {"match": "exact", "name": "utm_source", "type": "query", "value": "naver"}]], ["or", ["or", {"match": "exact", "name": "utm_medium", "type": "query", "value": "cpc"}]], ["or", ["or", {"match": "substring", "name": "utm_campaign", "type": "query", "value": "S-LAN"}, {"match": "exact", "name": "utm_campaign", "type": "query", "value": "LAN"}]]]}], "listTargetingKeys": [], "visitorAttributes": [], "visitorIdLocator": null, "integrationSettings": [{"id": "google_analytics_4", "global_is_use_gtm": "on"}], "views": [{"id": "27944420663", "category": "other", "apiName": "24099230963_cc_exit_rate", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "/cc/"}, {"match": "substring", "type": "url", "value": "/ccr/"}, {"match": "simple", "type": "url", "value": "/ccstatic/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "28106820049", "category": "other", "apiName": "24099230963_cc_bounce_rate", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "/cc/"}, {"match": "substring", "type": "url", "value": "/ccr/"}, {"match": "substring", "type": "url", "value": "/ccstatic/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4543444689879040", "category": "other", "apiName": "24099230963_url_targeting_for_chatbase_for_martin", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.fr/"}, {"match": "substring", "type": "url", "value": "https://www.ef.com.br/"}, {"match": "substring", "type": "url", "value": "https://www.ef.de/"}, {"match": "substring", "type": "url", "value": "https://www.ef.com.es/"}, {"match": "substring", "type": "url", "value": "https://www.ef-italia.it/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4551290429112320", "category": "other", "apiName": "24099230963_homepage_or_new_regex", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "/(?:|homepage|new|new/home-v2-1|new/home-v2-2|new/home-v2-3)(?:/)?(?=\\?|$)"}, {"match": "exact", "type": "url", "value": "/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4552820240678912", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ilcm_steve_vision_no_boo_5", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/(?:www|qa)\\.ef\\.com\\.es\\/(?:ils\\/ils-25|ils|ils-jr|ils-sr|ils-hs|illj|aya|upa)\\/(?:\\?[^\\s#]*)?(?:#\\S*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4555696107159552", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_it_aya_prod_cta_copy_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef-italia.it/aya/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4560791515430912", "category": "other", "apiName": "24099230963_multi_product_pages", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^[^\\s?#]*\\/(?:ils|ils-jr|ils-sr|ils-hs|illj|aya|upa)\\/(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4562403229171712", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_steve_us_ilcm_v1_1", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/qa\\.ef\\.edu\\/(?:ils|illj|aya)\\/(?:\\/|$).*"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4570414458863616", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_jp_cc_calendar_2", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/ils/"}, {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/aya/"}, {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/ils-sr/"}, {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/ils-jr/"}, {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/upa/"}, {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/ils-hs/"}, {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/illj/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4595025122689024", "category": "other", "apiName": "24099230963_url_targeting_for_c
8072opy_of_cc_se_ps_consolidation_v_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef-italia.it/lt-sr/brochure/"}, {"match": "substring", "type": "url", "value": "https://www.ef-italia.it/lt-jr/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4601302586490880", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ilcm_steve_vision_no_boo_3", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/(?:www|qa)\\.ef\\.com\\/cl\\/(?:ils\\/ils-25|ils|ils-jr|ils-sr|ils-hs|illj|aya|upa)\\/(?:\\?[^\\s#]*)?(?:#\\S*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4630904943935488", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_redirect_steve_tr_ilcm_v1", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/www\\.ef\\.com\\.tr\\/(?:ils|ils-jr|ils-sr|ils-hs|illj|aya|upa)\\/(\\?[^\\s#]*)?(#\\S*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4632664437686272", "category": "other", "apiName": "24099230963_url_targeting_for_ilcm_steve_vision_no_booking_scrip", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/(?:(?:www|qa)\\.ef\\.com\\.(?:br|es)\\/|(?:www|qa)\\.ef\\.com\\/cl\\/)(?:ils|ils-jr|ils-sr|ils-hs|illj|aya|upa)(?:\\/[^\\s?#]*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4678826815389696", "category": "other", "apiName": "24099230963_url_targeting_for_id_cc_calendar", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.co.id/cc/consultation/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4724819816611840", "category": "other", "apiName": "lt_productsite_onlinebooking_esb", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.com.es/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4727098688929792", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cef_qq_it_new_form_v12_1", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef-italia.it/cp/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4727973278908416", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_call_me_it_social_brochu_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.fr/cc/brochure/"}, {"match": "substring", "type": "url", "value": "/cc/test/brochure-advisorcall/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4732588422594560", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_call_me_mx_social_brochu_2", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.com.pe/cc/brochure/"}, {"match": "substring", "type": "url", "value": "/cc/test/brochure-advisorcall/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4736993364541440", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_lt_productsite_onlineboo_3", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.no/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4750292753842176", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_tw_ps_bo_consolidation_", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.co.kr/cc/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4755352437129216", "category": "other", "apiName": "24099230963_url_targeting_for_c
8072opy_of_destfiltering_br_search", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com.co/cc/language-abroad_all_generic_ilc_x/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4768059634745344", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_call_me_mx_social_brochu_1", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com/cl/cc/language-abroad_all_generic_ilc_x/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4773673616277504", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_de_ps_consolidation_v2_", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.de/cc/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4778410824695808", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_steve_us_ilcm_v1_2", "name": null, "staticConditions": ["or", ["or", {"match": "substring", "type": "url", "value": "qa.ef.edu/ils"}, {"match": "substring", "type": "url", "value": "qa.ef.edu/aya"}, {"match": "substring", "type": "url", "value": "qa.ef.edu/illj"}, {"match": "simple", "type": "url", "value": "qa.ef.edu/multi"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4800556504449024", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cef_hp_cn_newdesign_v15", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com.cn/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4830370986721280", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_destfiltering_fr_cc_sear_2", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef-italia.it/cc/study-abroad_all_generic_ilc_x/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4833009640144896", "category": "other", "apiName": "lt_productsite_onlinebooking_atv", "n
8072ame": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.at/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4854401051918336", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_tw_cc_calendar_1", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "https://www.ef.com.hk/cc/"}, {"match": "regex", "type": "url", "value": "https://www.ef.com.hk/local-campaign/"}, {"match": "regex", "type": "url", "value": "https://www.ef.com.hk/cc/sem/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4918093837762560", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_fr_aya_prod_cta_copy_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.fr/aya/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4936724309082112", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_language_abroad_it_ps_ccr_", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef-italia.it/cc/erasmus/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4967295506710528", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_redirect_steve_nl_ilcm_v_1", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/www\\.ef\\.nl\\/(?:ils|ils-jr|ils-sr|ils-hs|illj|aya)\\/(\\?[^\\s#]*)?(#\\S*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "4970790798491648", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_script_steve_us_ilcm_v1", "name": null, "staticConditions": ["or", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/www\\.ef\\.nl\\/(?:ils|ils-jr|ils-sr|ils-hs|illj|aya)\\/.*(\\?[^\\s#]*)?(#\\S*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5117830362824704", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_de_br_auto_complete_v2", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.se/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5127185455906816", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_call_me_mx_social_brochu_4", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef-italia.it/cc/brochure/"}, {"match": "substring", "type": "url", "value": "/cc/test/brochure-advisorcall/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5140772224237568", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_kr_cc_calendar", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "https://www.ef.com.vn/cc/"}, {"match": "regex", "type": "url", "value": "https://www.ef.com.vn/local-campaign/"}, {"match": "regex", "type": "url", "value": "https://www.ef.com.vn/cc/sem/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5180453729075200", "category": "other", "apiName": "24099230963_url_targeting_for_jp_cc_calendar", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "https://www.efjapan.co.jp/local-campaign/"}, {"match": "regex", "type": "url", "value": "https://www.efjapan.co.jp/cc/sem/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5182927091269632", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_call_me_pe_social_brochure", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.com.mx/cc/brochure/"}, {"match": "substring", "type": "url", "value": "/cc/test/brochure-advisorcall/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5214616813305856", "category": "other", "apiName": "24099230963_url_targeting_for_c
8072opy_of_pad_cc_new_design_paid_soc", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.edu.pt/cc/destinations/ireland/dublin"}, {"match": "simple", "type": "url", "value": "https://www.ef.com.br/cc/destinations/malta"}, {"match": "simple", "type": "url", "value": "https://www.ef.nl/cc/destinations/korea/seoul"}, {"match": "simple", "type": "url", "value": "https://www.ef.de/cc/destinations/japan/tokyo"}, {"match": "simple", "type": "url", "value": "https://www.ef.de/cc/destinations/korea/seoul"}, {"match": "simple", "type": "url", "value": "https://www.ef.com.tr/cc/destinations/malta"}, {"match": "simple", "type": "url", "value": "https://www.ef.com.mx/cc/destinations/united-states/new-york"}, {"match": "simple", "type": "url", "value": "https://www.ef.fr/cc/destinations/united-states/miami-beach"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5236246948085760", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_destfiltering_br_cc_search", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com.tr/cc/language-abroad_all_generic_ilc_x/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5305197119930368", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ps_prod_chatbase_tr_online", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.edu/ils/online-booking/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5333480760934400", "category": "other", "apiName": "24099230963_url_targeting_for_ilcm_steve_package_script", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "www.ef.edu/ils/"}, {"match": "substring", "type": "url", "value": "www.ef.edu/ils/ils-25/"}, {"match": "substring", "type": "url", "value": "www.ef.edu/illj/"}, {"match": "substring", "type": "url", "value": "www.ef.edu/aya/upa-lp/"}, {"match": "substring", "type": "url", "value": "www.ef.edu/aya/"}, {"match": "simple", "type": "url", "value": "www.ef.edu/multi/packages/"}, {"match": "simple", "type": "url", "value": "www.ef.edu/multi/results/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5471539760463872", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_fr_ps_consolidation_v2_", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.fr/cc/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5562566835961856", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_jp_cc_calendar", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "https://www.ef.com.tw/cc/consultation/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5627891564675072", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ilcmstickyctasilspersonali", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https?:\\/\\/(?:[a-z0-9-]+\\.)*(?:ef\\.com(?:\\.(?:ar|br|cl|co|ec|es|mx|pa|pe|vn|cn|hk|tw|tr))?|ef\\.co\\.(?:uk|kr|id|th|hu)|ef\\.(?:at|be|de|do|fi|fr|lu|lv|nl|no|pl|ro|se|si)|ef\\.dz|ef\\.tn|efswiss\\.ch|ef-italia\\.it|efjapan\\.co\\.jp|ef-australia\\.com\\.au|ef-danmark\\.dk|ef-czech\\.cz|ef-slovakia\\.sk|ef\\.edu(?:\\.pt)?)(?::\\d+)?(?:\\/[^?#]*)?\\/aya(?:\\/|$|[?#])"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5695199484051456", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ps_prod_chatbase_us_online", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://qa.ef.edu/ils/online-booking/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5705322503864320", "category": "other", "apiName": "24099230963_url_targeting_for_c
8072opy_of_cef_qq_tr_new_form_v12", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com.tr/cp/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5746245583503360", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_lt_productsite_onlineboo_4", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.pl/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5754659011297280", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cef_qq_fr_new_form_v12_1", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.fr/cp/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5760119519051776", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ps_prod_chatbase_pl_online", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.com.tr/ils/online-booking/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5787331129507840", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_de_aya_prod_cta_copy_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.de/aya/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5839637382430720", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_fr_ps_consolidation_v_3", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.de/cc/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5847807953731584", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_tr_ps_consolidation_v2_", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.se/cc/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5886332073934848", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ps_fr_chatbasevsori", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://qa.ef.com.tw/ils/"}, {"match": "substring", "type": "url", "value": "https://qa.ef.com.tw/lt-jr/"}, {"match": "substring", "type": "url", "value": "https://qa.ef.com.tw/lt-sr/"}, {"match": "substring", "type": "url", "value": "https://qa.ef.com.tw/lt-ind/"}, {"match": "substring", "type": "url", "value": "https://qa.ef.com.tw/ils/"}, {"match": "substring", "type": "url", "value": "https://qa.ef.com.tw/aya/"}, {"match": "substring", "type": "url", "value": "https://qa.ef.com.tw/upa/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5902152606941184", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ilcmstickyctasilsfr", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https?:\\/\\/(?:[a-z0-9-]+\\.)*(?:ef\\.com(?:\\.(?:ar|br|cl|co|ec|es|mx|pa|pe|vn|cn|hk|tw|tr))?|ef\\.co\\.(?:uk|kr|id|th|hu)|ef\\.(?:at|be|de|do|fi|fr|lu|lv|nl|no|pl|ro|se|si)|ef\\.dz|ef\\.tn|efswiss\\.ch|ef-italia\\.it|efjapan\\.co\\.jp|ef-australia\\.com\\.au|ef-danmark\\.dk|ef-czech\\.cz|ef-slovakia\\.sk|ef\\.edu(?:\\.pt)?)(?::\\d+)?(?:\\/[^?#]*)?\\/ils(?:\\/|$|[?#])"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5906294184345600", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_lt_productsite_onlinebooki", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.de/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5918968421023744", "category": "other", "apiName": "24099230963_url_targeting_for_ilcm_steve_vision_no_booking_br_il", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/(?:www|qa)\\.ef\\.com\\.br\\/(?:ils|ils-jr|ils-sr|ils-hs|illj|aya|upa|ils\\/ils-25)\\/(?:\\?[^\\s#]*)?(?:#\\S*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5942710849241088", "category": "other", "apiName": "24099230963_url_targeting_for_c
8072opy_of_cef_qq_ec_new_form_v12_1", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com.ec/cp/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5981489421090816", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_fr_aya_prod_cta_copy_v2", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.fr/ils/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "5982368278773760", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_it_aya_prod_cta_copy_v2", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef-italia.it/ils/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6002700922388480", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_de_aya_prod_cta_copy_v2", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.de/ils/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6016163430268928", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_it_ps_consolidation_v_3", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.efjapan.co.jp/cc/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6037997299171328", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_de_br_auto_complete_v_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.de/cc/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6039432975876096", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cef_qq_es_new_form_v12_1", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com.es/cp/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6081672060338176", "category": "other", "apiName": "lt_productsite_onlinebooking_fih", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.fi/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6095345648664576", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_script_steve_nl_ilcm_v1", "name": null, "staticConditions": ["or", ["or", {"match": "regex", "type": "url", "value": "^https:\\/\\/www\\.ef\\.com\\.tr\\/(?:ils|ils-jr|ils-sr|ils-hs|illj|aya|upa)\\/.*(\\?[^\\s#]*)?(#\\S*)?$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6104597043871744", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_hk_cc_calendar", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "https://www.ef.co.kr/cc/"}, {"match": "regex", "type": "url", "value": "https://www.ef.co.kr/local-campaign/"}, {"match": "regex", "type": "url", "value": "https://www.ef.co.kr/cc/sem/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6193389249495040", "category": "other", "apiName": "24099230963_url_targeting_for_ilcm_steve_package_us_campaign", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^(https\\:\\/\\/www.ef.edu\\/local\\-campaign\\/us\\/ef\\-language\\-abroad\\-overview\\/\\?(.*)utm\\_source\\=(fb|ig)\\&.*)$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6215790758723584", "category": "other", "apiName": "24099230963_url_targeting_for_lt_productsite_packagesondestinati", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "/lt-sr/destinations/[^/]+/[^/]+/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6261811897434112", "category": "other", "apiName": "24099230963_url_targeting_for_c
8072opy_of_ilcmonlinebookingilstr_ite", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "https://www.ef.pl/ils/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6325704910962688", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cef_qq_de_new_form_v13", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.de/cp/brochure/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6387838116167680", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ps_prod_chatbase_pl_onli_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.nl/ils/online-booking/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6445792458702848", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_lt_productsite_onlineboo_1", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef-italia.it/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6481704425095168", "category": "other", "apiName": "lt_productsite_onlinebooking_frp", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef.fr/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6493935695036416", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ps_tw_chatbasevsori", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.efjapan.co.jp/cc/gpt/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6564821913567232", "category": "other", "apiName": "24099230963_url_targeting_for_ilcm_steve_package_us_redirect", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "www.ef.edu/ils/"}, {"match": "simple", "type": "url", "value": "www.ef.edu/ils/ils-25/"}, {"match": "simple", "type": "url", "value": "www.ef.edu/illj/"}, {"match": "simple", "type": "url", "value": "www.ef.edu/aya/upa-lp/"}, {"match": "simple", "type": "url", "value": "www.ef.edu/aya/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6579911039647744", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_cc_jp_ps_consolidation_sed", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.com.tw/cc/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6597111806951424", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_lt_productsite_onlineboo_2", "name": null, "staticConditions": ["and", ["or", {"match": "regex", "type": "url", "value": "^https://www.ef-danmark.dk/lt-(sr|jr)/$"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6629809216815104", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_destfiltering_tr_cc_search", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.fr/cc/language-abroad_all_generic_ilc_x/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6648698541703168", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_destfiltering_cl_search", "name": null, "staticConditions": ["and", ["or", {"match": "simple", "type": "url", "value": "https://www.ef.com.br/cc/language-abroad_all_generic_ilc_x/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}, {"id": "6713069213057024", "category": "other", "apiName": "24099230963_url_targeting_for_copy_of_ps_prod_chatbase_it_1", "name": null, "staticConditions": ["and", ["or", {"match": "substring", "type": "url", "value": "https://www.ef.pl/ils/online-booking/"}]], "deactivationEnabled": false, "undoOnDeactivation": false, "tags": []}], "events": [{"id": "24985501321", "viewId": null, "name": null, "category": "other", "apiName": "form_success-b", "eventType": "custom", "eventFilter": null}, {"id": "25005530597", "viewId": null, "name": null, "category": "other", "apiName": "form_success-cp-b", "eventType": "custom", "eventFilter": null}, {"id": "25140340279", "viewId": null, "name": null, "category": "other", "apiName": "form_success-ILS-b", "eventType": "custom", "eventFilter": null}, {"id": "25149250481", "viewId": null, "name": null, "category": "other", "apiName": "form_success", "eventType": "custom", "eventFilter": null}, {"id": "25153600235", "viewId": null, "name": null, "category": "other", "apiName": "form_success-ILSY-b", "eventType": "custom", "eventFilter": null}, {"id": "25155260316", "viewId": null, "name": null, "category": "other", "apiName": "form_success-LY-b", "eventType": "custom", "eventFilter": null}, {"id": "25487520179", "viewId": null, "name": null, "category": "other", "apiName": "form_view", "eventType": "custom", "eventFilter": null}, {"id": "25488840069", "viewId": null, "name": null, "category": "other", "apiName": "form_start", "eventType": "custom", "eventFilter": null}, {"id": "25670000428", "viewId": null, "name": null, "category": "other", "apiName": "form_success-ILS-pq", "eventType": "custom", "eventFilter": null}, {"id": "25688950523", "viewId": null, "name": null, "category": "other", "apiName": "form_success-ILS", "eventType": "custom", "eventFilter": null}, {"id": "25704940384", "viewId": null, "name": null, "category": "other", "apiName": "form_start-ILS", "eventType": "custom", "eventFilter": null}, {"id": "26504380316", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-pg-corp", "eventType": "custom", "eventFilter": null}, {"id": "26570910315", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-pg-uni", "eventType": "custom", "eventFilter": null}, {"id": "26576640485", "viewId": null, "name": null, "category": "other", "apiName": "age-filter-pg-corp", "eventType": "custom", "eventFilter": null}, {"id": "26584700539", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-hp-high", "eventType": "custom", "eventFilter": null}, {"id": "26589740307", "viewId": null, "name": null, "category": "other", "apiName": "age-filter-pg-high", "eventType": "custom", "eventFilter": null}, {"id": "26596250415", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-hp-corp", "eventType": "custom", "eventFilter": null}, {"id": "26599560401", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-hp-uni", "eventType": "custom", "eventFilter": null}, {"id": "26600770240", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-hp-mid", "eventType": "custom", "eventFilter": null}, {"id": "26601470460", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-hp-clear", "eventType": "custom", "eventFilter": null}, {"id": "26604580281", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-pg-high", "eventType": "custom", "eventFilter": null}, {"id": "26605060283", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-pg-mid", "eventType": "custom", "eventFilter": null}, {"id": "26607140436", "viewId": null, "name": null, "category": "other", "apiName": "age-filter-pg-clear", "eventType": "custom", "eventFilter": null}, {"id": "26608110254", "viewId": null, "name": null, "category": "other", "apiName": "age-filter-pg-prof", "eventType": "custom", "eventFilter": null}, {"id": "26610960392", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-hp-prof", "eventType": "custom", "eventFilter": null}, {"id": "26620660098", "viewId": null, "name": null, "category": "other", "apiName": "age-filter-pg-uni", "eventType": "custom", "eventFilter": null}, {"id": "26640730056", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-pg-prof", "eventType": "custom", "eventFilter": null}, {"id": "26645580101", "viewId": null, "name": null, "category": "other", "apiName": "age-filter-pg-mid", "eventType": "custom", "eventFilter": null}, {"id": "26655820012", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-pg-clear", "eventType": "custom", "eventFilter": null}, {"id": "27266840467", "viewId": null, "name": null, "category": "other", "apiName": "form_success-BC", "eventType": "custom", "eventFilter": null}, {"id": "27274500493", "viewId": null, "name": null, "category": "other", "apiName": "form_success-LY", "eventType": "custom", "eventFilter": null}, {"id": "27284130737", "viewId": null, "name": null, "category": "other", "apiName": "form_success-ILSY", "eventType": "custom", "eventFilter": null}, {"id": "27381030075", "viewId": null, "name": null, "category": "other", "apiName": "form_success-HSY", "eventType": "custom", "eventFilter": null}, {"id": "27449880552", "viewId": null, "name": null, "category": "other", "apiName": "form_success-gocampaign-test", "eventType": "custom", "eventFilter": null}, {"id": "28372200536", "viewId": null, "name": null, "category": "other", "apiName": "form_success-ct", "eventType": "custom", "eventFilter": null}, {"id": "28863200033", "viewId": null, "name": null, "category": "other", "apiName": "form_success-LY-pq", "eventType": "custom", "eventFilter": null}, {"id": "29833860647", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-pg-sen", "eventType": "custom", "eventFilter": null}, {"id": "29856410440", "viewId": null, "name": null, "category": "other", "apiName": "chatbot-ori-success", "eventType": "custom", "eventFilter": null}, {"id": "29859170451", "viewId": null, "name": null, "category": "other", "apiName": "age-tile-hp-sen", "eventType": "custom", "eventFilter": null}, {"id": "29876930967", "viewId": null, "name": null, "category": "other", "apiName": "chatbot-ori-open", "eventType": "custom", "eventFilter": null}, {"id": "29880540100", "viewId": null, "name": null, "category": "other", "apiName": "age-filter-pg-sen", "eventType": "custom", "eventFilter": null}, {"id": "29914340694", "viewId": null, "name": null, "category": "other", "apiName": "age-group-mid", "eventType": "custom", "eventFilter": null}, {"id": "29929490920", "viewId": null, "name": null, "category": "other", "apiName": "age-group-sen", "eventType": "custom", "eventFilter": null}, {"id": "29937380718", "viewId": null, "name": null, "category": "other", "apiName": "age-group-corp", "eventType": "custom", "eventFilter": null}, {"id": "29942680596", "viewId": null, "name": null, "category": "other", "apiName": "age-group-prof", "eventType": "custom", "eventFilter": null}, {"id": "29957001046", "viewId": null, "name": null, "category": "other", "apiName": "age-group-uni", "eventType": "custom", "eventFilter": null}, {"id": "29971141072", "viewId": null, "name": null, "category": "other", "apiName": "age-group-all_user-defined", "eventType": "custom", "eventFilter": null}, {"id": "30003480215", "viewId": null, "name": null, "category": "other", "apiName": "age-group-high", "eventType": "custom", "eventFilter": null}, {"id": "4543371230838784", "viewId": null, "name": null, "category": "other", "apiName": "booking_opp", "eventType": "custom", "eventFilter": null}, {"id": "4623845361975296", "viewId": null, "name": null, "category": "other", "apiName": "crm_lead", "eventType": "custom", "eventFilter": null}, {"id": "4883531134926848", "viewId": null, "name": null, "category": "other", "apiName": "item_interacted", "eventType": "custom", "eventFilter": null}, {"id": "4900600316428288", "viewId": null, "name": null, "category": "other", "apiName": "form_success-lt-ind-b", "eventType": "custom", "eventFilter": null}, {"id": "5128730557808640", "viewId": null, "name": null, "category": "other", "apiName": "form_success-lt-sr-b", "eventType": "custom", "eventFilter": null}, {"id": "5383578591166464", "viewId": null, "name": null, "category": "other", "apiName": "component_view", "eventType": "custom", "eventFilter": null}, {"id": "5477395464454144", "viewId": null, "name": null, "category": "other", "apiName": "cc-open-funnel", "eventType": "custom", "eventFilter": null}, {"id": "6057737365225472", "viewId": null, "name": null, "category": "other", "apiName": "advisor-call-no-selected", "eventType": "custom", "eventFilter": null}, {"id": "6123360321536000", "viewId": null, "name": null, "category": "other", "apiName": "cc_call_me_clicked", "eventType": "custom", "eventFilter": null}, {"id": "6273799427981312", "viewId": null, "name": null, "category": "other", "apiName": "crm_opps", "eventType": "custom", "eventFilter": null}, {"id": "6633518770946048", "viewId": null, "name": null, "category": "other", "apiName": "cc-submit-funnel", "eventType": "custom", "eventFilter": null}, {"id": "6677826422702080", "viewId": null, "name": null, "category": "other", "apiName": "advisor-call-yes-selected", "eventType": "custom", "eventFilter": null}, {"id": "6720979255164928", "viewId": null, "name": null, "category": "other", "apiName": "form_success-lt-jr-b", "eventType": "custom", "eventFilter": null}], "dimensions": [{"id": "6550644169900032", "name": null, "apiName": "projectId", "segmentId": null}, {"id": "6627329745616896", "name": null, "apiName": "market", "segmentId": null}], "projectJS": function(){var opt_load_configs = {"/ils/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","EC","ES","FI","FR","GB","HK","ID","IT","JP","KR","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/aya/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","EC","ES","FI","FR","GB","HK","ID","IT","JP","KR","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/lt-sr/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","ES","FI","FR","GB","HK","ID","IT","JP","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/lt-jr/":["AR","AT","BE","BR","BX","CH","CL","CN","CO","CS","CT","DE","DK","ES","FI","FR","GB","HK","ID","IT","JP","MX","NL","NO","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/lt-ind/":["DE","FR","IT","JP","SE"],"/illj/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","ES","FI","FR","GB","HK","ID","IT","JP","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/upa/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","ES","FI","FR","GB","HK","ID","IT","JP","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/":["AR","CL","CN","DE","ES","FR","ID","JP","TW"],"/pg/":["CN","DE","FR","ID","IT","JP","TR","TW"],"/cc/":["AR","AT","AU","BE","BR","BX","CA","CH","CL","CN","CO","CS","CT","CZ","DE","DK","DO","DX","DZ","EC","ES","FC","FI","FR","GB","HK","HU","ID","IT","JP","KR","KZ","LU","LV","MX","NL","NO","PA","PE","PL","PT","RO","SA","SE","SI","SK","SX","TH","TN","TR","TW","TX","US","VE","VN","WC","WE","WL","WM","WP","WR","WW"],"/ils-sr/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","ES","FI","FR","GB","HK","ID","IT","JP","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/ils-jr/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","ES","FI","FR","GB","HK","ID","IT","JP","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/ilsd/":["BE","BX","CH","CS","CT","DK","FI","HK","PA","PE","PT","RO","SK","SX"],"/lt/":["BE","BX","CH","CS","CT","DK","FI","HK","PA","PE","PT","RO","SK","SX"],"/ils-hs/":["BE","BR","BX","CH","CL","CO","CS","CT","DE","DK","ES","FI","FR","GB","HK","ID","IT","JP","MX","NL","PA","PE","PL","PT","RO","SE","SK","SX","TR","TW","US","VN"],"/blog/language/40-questions-to-make-you-a-virtual-pub-quiz-master/":["GB","US"],"/blog/language/questions-virtual-pub-quiz/":["GB","US"],"/cp/brochure/":["DE","EC","ES","FR","IT","JP","TR"],"/multi/":["BR","CL","ES","NL","TR","US"],"/local-campaign/us/ef-language-abroad-overview/":["US"]}; 8073 8074/**Do Not Edit Below This**/ 8075var checkIfStringStartsWith = function(str, substrs) { 8076 return substrs.filter(function(substr){ return str.startsWith(substr); }); 8077}; 8078 8079var optimizely_getCookie = function(name) { 8080 var match = document.cookie.match(new RegExp('(?:^|; )' + name + '=([^;]*)')); 8081 return match ? decodeURIComponent(match[1]) : un
8081defined; 8082}; 8083 8084var longest_str_in_array = function(arra) { 8085 var max_str = arra[0].length, ans = arra[0]; 8086 for (var i = 1; i < arra.length; i++) { 8087 var l = arra[i].length; 8088 if (l > max_str) { ans = arra[i]; max_str = l; } 8089 } 8090 return ans; 8091}; 8092 8093(function normalizeConfigKeys(){ 8094 var cleaned = {}; 8095 Object.keys(opt_load_configs).forEach(function(k){ 8096 cleaned[k.trim()] = opt_load_configs[k]; 8097 }); 8098 opt_load_configs = cleaned; 8099})(); 8100 8101var path = location.pathname; 8102var opt_market_code = (optimizely_getCookie('mc') || '').toLocaleUpperCase(); 8103var ef_cwa_domain_raw = optimizely_getCookie('efdomain'); 8104 8105var normalizeEfDomain = function(v){ 8106 if (!v) return null; 8107 v = v.trim(); 8108 v = v.replace(/^https?:\/\//i, ''); 8109 v = v.replace(/\/+$/,''); 8110 return v; 8111}; 8112var ef_cwa_domain = normalizeEfDomain(ef_cwa_domain_raw); 8113 8114var opt_load_keys_wo_home = Object.keys(opt_load_configs); 8115var rootIndex = opt_load_keys_wo_home.indexOf('/'); 8116if (rootIndex !== -1) opt_load_keys_wo_home.splice(rootIndex, 1); 8117 8118if (ef_cwa_domain) { 8119 var combined = location.hostname + path; 8120 if (combined.toLowerCase().startsWith(ef_cwa_domain.toLowerCase())) { 8121 var remainder = combined.slice(ef_cwa_domain.length); 8122 remainder = remainder.replace(/^\/+/, ''); 8123 path = '/' + remainder; 8124 } 8125} 8126 8127var shouldDisable = 8128 ( 8129 (path === '/' && opt_load_configs['/'].indexOf(opt_market_code) === -1) || 8130 ( 8131 path !== '/' && 8132 ( 8133 checkIfStringStartsWith(path, opt_load_keys_wo_home).length === 0 || 8134 ( 8135 checkIfStringStartsWith(path, opt_load_keys_wo_home).length > 0 && 8136 opt_load_configs[ 8137 longest_str_in_array(checkIfStringStartsWith(path, opt_load_keys_wo_home)) 8138 ].indexOf(opt_market_code) === -1 8139 ) 8140 ) 8141 ) 8142 ) && 8143 optimizely_getCookie('optimizelyEndUserId') === undefined && 8144 !location.hostname.endsWith('vercel.app') && 8145 location.hostname !== 'ctqa.ef.com'; 8146 8147 8148 var getCookie = function(name) { 8149 var match = document.cookie.match(name+'=([^;]*)'); 8150 return match ? match[1] : undefined; 8151 }; 8152window.optimizely = window.optimizely || []; 8153if (shouldDisable) { 8154 window.optimizely.push({ type: "disable" }); 8155 console.log('%c Optimizely Web is disabled on the Page - Visit Optimizely Project Settings Javascript Section to Include the Page', 'color:red;font-weight:bold;'); 8156}else{ 8157 window.optimizely.push({"type": "holdEvents"}); 8158 window.optimizely.push({ 8159 "type": "user", 8160 "attributes": { 8161 "market": getCookie('mc') 8162 } 8163 }); 8164} 8165 8166// Wait until it's possible to get data 8167window.optimizely.push({ 8168 type: 'addListener', 8169 filter: { 8170 type: 'lifecycle', 8171 name: 'initialized' 8172 }, 8173 handler: () => { 8174 // Get project ID 8175 const { projectId } = window.optimizely.get('data'); 8176 // Push as user attribute 8177 window.optimizely.push({ 8178 type: 'user', 8179 attributes: { projectId } 8180 }); 8181 } 8182}); 8183}, "plugins": [function(PluginManager) { 8184 8185 PluginManager.registerAnalyticsTracker('5915512750735360', { 8186 preRedirectPolicy: 'PERSIST_BEFORE_REDIRECT', 8187 postRedirectPolicy: 'TRACK_IMMEDIATELY', 8188 nonRedirectPolicy: 'TRACK_IMMEDIATELY', 8189 trackLayerDecision: function(decisionData) { 8190 var extension = decisionData.integrationSettings && decisionData.integrationSettings['5915512750735360']; 8191 if (!extension) { 8192 return; 8193 } 8194 var campaign = { 8195 id: decisionData.layerId, 8196 name: decisionData.layerName, 8197 policy: decisionData.layerPolicy, 8198 integrationStringVersion: decisionData.integrationStringVersion, 8199 }; 8200 var campaignId = campaign.id; 8201 var experimentId = decisionData.experimentId; 8202 var variationId = decisionData.variationId; 8203 var isHoldback = decisionData.isLayerHoldback; 8204 extension.$fieldDefaults = []; 8205 (function(widg) { 8206 var i = 0; 8207 var field; 8208 for (; i < widg.$fieldDefaults.length; ++i) { 8209 field = widg.$fieldDefaults[i]; 8210 if (!widg.hasOwnProperty(field.name)) { 8211 widg[field.name] = field.default_value; 8212 } 8213 } 8214 })(extension); 8215 var state = window['optimizely'].get('state'); 8216var campaignObject = state.getDecisionObject({'campaignId':campaignId}); 8217 8218if(campaignObject !== null){ 8219 var utils = window["optimizely"].get("utils"); 8220 utils.waitUntil(function() { 8221 return typeof(clarity) === 'function'; 8222 }).then(function() { 8223 console.log('clarity is finally a function. Sending now.'); 8224 clarity("set", "Optimizely", campaignObject.experiment +' - ' + campaignObject.variation); 8225 }); 8226} 8227 8228 }, 8229 serializeSettings: JSON.stringify, 8230 deserializeSettings: JSON.parse, 8231 }); 8232 8233PluginManager.registerAnalyticsTracker('6250951055507456', { 8234 preRedirectPolicy: 'PERSIST_BEFORE_REDIRECT', 8235 postRedirectPolicy: 'TRACK_IMMEDIATELY', 8236 nonRedirectPolicy: 'TRACK_IMMEDIATELY', 8237 trackLayerDecision: function(decisionData) { 8238 var extension = decisionData.integrationSettings && decisionData.integrationSettings['6250951055507456']; 8239 if (!extension) { 8240 return; 8241 } 8242 var campaign = { 8243 id: decisionData.layerId, 8244 name: decisionData.layerName, 8245 policy: decisionData.layerPolicy, 8246 integrationStringVersion: decisionData.integrationStringVersion, 8247 }; 8248 var campaignId = campaign.id; 8249 var experimentId = decisionData.experimentId; 8250 var variationId = decisionData.variationId; 8251 var isHoldback = decisionData.isLayerHoldback; 8252 extension.$fieldDefaults = [{"name":"javascript_trigger","default_value":""},{"name":"heatmaps","default_value":"true"},{"name":"recordings","default_value":"true"},{"name":"mask_long_numbers","default_value":"true"}]; 8253 (function(widg) { 8254 var i = 0; 8255 var field; 8256 for (; i < widg.$fieldDefaults.length; ++i) { 8257 field = widg.$fieldDefaults[i]; 8258 if (!widg.hasOwnProperty(field.name)) { 8259 widg[field.name] = field.default_value; 8260 } 8261 } 8262 })(extension); 8263 // We define the HotJar object if this has not been done already 8264window.hj=window.hj||function(){(hj.q=hj.q||[]).push(arguments)}; 8265 8266// We get the decision in a string 8267let decisionString = window.optimizely.get('state').getDecisionString({ 8268 campaignId: campaignId, 8269 shouldCleanString:true, 8270 maxLength:50 8271}); 8272 8273if (extension.mask_long_numbers === 'true') { 8274 // Mask any sequences of 9 or more digits to avoid PII filter from Hotjar 8275 const maskIdRegex = /(\d{3})\d{3,}(\d{3})/g; 8276 variationId = variationId.replaceAll(maskIdRegex, '$1...$2'); 8277 decisionString = decisionString.replaceAll(maskIdRegex, '$1...$2'); 8278} 8279 8280if (extension.heatmaps === 'true') { 8281 // If the visitor is in the holdback 8282 if (isHoldback === true) { 8283 // We trigger the heatmap 8284 hj('trigger', `${extension.javascript_trigger}_holdback`); 8285 } else { 8286 // We trigger the heatmap 8287 hj('trigger', `${extension.javascript_trigger}_${variationId}`); 8288 } 8289} 8290 8291if (extension.recordings === 'true') { 8292 // We tag recordings with experiment info 8293 hj('tagRecording', [decisionString]); 8294} 8295 }, 8296 serializeSettings: JSON.stringify, 8297 deserializeSettings: JSON.parse, 8298 }); 8299 8300} 8301], "interestGroups": [], "tagGroups": []},l=__webpack_require__(376),d="initializeOptimizelyPreview";if(l.initGlobalStore(f),u.populateDirectiveData(),r.clientHasAlreadyInitialized())e.warn("Main / Disabling because Optimizely has already initialized on this page load. Are there multiple snippets on the page?");else if(r.shouldBailForDesktopApp())e.log("Main / Disabling because of desktop app.");else if(r.conflictInObservingChanges())e.log("Main / Disabling: Observe Changes Indefinitely is on, but browser does not support it.");else{if(r.shouldLoadInnie())a.registerFunction("getProjectId",(function(){return f.projectId})),a.registerFunction("getAccountId",(function(){return f.accountId})),c.addScriptAsync("https://app.optimizely.com/js/innie.js"),e.log("Main / Disabling in favor of the editor client.");else if(r.shouldLoadEmbeddedEditor())e.log("Main / Loading embedded editor"),s.loadEmbeddedEditor("https://app.optimizely.com/dist/visual-editor/main.js");else if(r.shouldLoadPreview()){(r.isSlave()?window.optimizely:window.optimizely=window.optimizely||[]).push({type:"load",data:f}),e.log("Main / Disabling in favor of the preview client."),__webpack_require__(843).setupPreviewGlobal(),__webpack_require__(843).pushToPreviewGlobal({type:"pushPreviewData",name:"liveCommitData",data:f}),r.isSlave()||(a.registerFunction("getProjectId",(function(){return f.projectId})),c.addScriptSync("https://cdn.optimizely.com/js/preview2/24099230963.js"))}else if(r.shouldBootstrapDataForPreview()){a.registerFunction(d,(function(n){t(),a.unregisterFunction(d)}));var v=r.isSlave()?PROJECT_ID_FOR_SLAVE_PREVIEW:a.getFunction("getProjectId")();p=r.getProjectToken(),g=v,m=r.getPreviewLayerIds(),o="/dist/preview_data.js?token=__TOKEN__&preview_layer_ids=__PREVIEW_LAYER_IDS__".replace("__TOKEN__",p).replace("__PROJECT_ID__",g).replace("__PREVIEW_LAYER_IDS__",m.join(",")).replace("__GET_ONLY_PREVIEW_LAYERS__",!0);var h=r.getForceVariationIds();h&&h.length>0&&(o+="&optimizely_x="+h.join(",")),c.addScriptSync(o),__webpack_require__(843).setupPreviewGlobal(),c.addScriptAsync("/dist/js/preview_ui.js")}else r.shouldBootstrapDataForEditor()?(a.registerFunction(d,(function(n){t(),a.unregisterFunction(d)})),c.addScriptAsync(window.optimizely_editor_data_endpoint)):r.shouldInitialize()&&t();var p,g,m;n.timeEnd("block");var b=n.now();n.setMark("optimizelyFinished",b,b)}}try{main()}catch(t){try{__webpack_require__(8813).handleError(t)}catch(t){console.log(t)}}})();
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.