function e(e,n,r,t,i,o,a){try{var u=e[o](a),c=u.value}catch(e){return void r(e)}u.done?n(c):Promise.resolve(c).then(t,i)}function n(n){return function(){var r=this,t=arguments;return new Promise((function(i,o){var a=n.apply(r,t);function u(n){e(a,i,o,u,c,"next",n)}function c(n){e(a,i,o,u,c,"throw",n)}u(void 0)}))}}function r(e,n,r){return(n=function(e){var n=function(e,n){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,n||"default");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(e)}(e,"string");return"symbol"==typeof n?n:n+""}(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function t(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function i(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(n){r(e,n,i[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(i,n))}))}return e}var o;function a(e){return function(e){return document.querySelector('script[data-mrf-script="'.concat(e,'"]'))}(e)||function(e){var n=document.createElement("script");return n.setAttribute("type","application/json"),n.dataset.mrfScript=e,document.head.appendChild(n)}(e)}function u(e){return e&&"object"==typeof e}function c(e,n){return u(e)&&u(n)?(Object.keys(n).forEach((r=>{var t=e[r],i=n[r];Array.isArray(t)&&Array.isArray(i)?e[r]=t.concat(i):u(t)&&u(i)?e[r]=c(Object.assign({},t),i):e[r]=i})),e):n}function f(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return n.reduce(((e,n)=>c(e,n)),{})}function l(e,n,r,t,i,o,a){try{var u=e[o](a),c=u.value}catch(e){return void r(e)}u.done?n(c):Promise.resolve(c).then(t,i)}function s(e){return function(){var n=this,r=arguments;return new Promise((function(t,i){var o=e.apply(n,r);function a(e){l(o,t,i,a,u,"next",e)}function u(e){l(o,t,i,a,u,"throw",e)}a(void 0)}))}}function d(){var e,n;return window.marfeel=null!==(e=window.marfeel)&&void 0!==e?e:{},window.marfeel.cmd=null!==(n=window.marfeel.cmd)&&void 0!==n?n:[],window.marfeel.cmd}!function(e){e.HEADLINE_AB="HeadlineAB"}(o||(o={}));var p="marfeel-sdk-store";function y(e){return e.update=Date.now(),n=p,r=btoa(JSON.stringify(e)),new Promise((e=>{d().push(["consent",t=>{try{if(t.getConsent("cookies"))return window.localStorage.setItem(n,r),e(!0)}catch(e){}return e(!1)}])}));var n,r}function v(){return m.apply(this,arguments)}function m(){return(m=s((function*(){var e,n,r=yield(e=p,new Promise((n=>{d().push(["consent",r=>{try{if(r.getConsent("cookies"))return n(window.localStorage.getItem(e))}catch(e){}return n(null)}])})));return r?JSON.parse(atob(r)):(y(n={creation:Date.now(),update:Date.now(),entries:{}}),n)}))).apply(this,arguments)}function h(e){return w.apply(this,arguments)}function w(){return(w=s((function*(e){return(yield v()).entries[e]}))).apply(this,arguments)}function g(){return(g=s((function*(e,n){var r=yield v();return r.entries[e]=n,y(r)}))).apply(this,arguments)}var b="croupier-experimentation-entry",O={percent:function(){var e=n((function*(e){var n=Math.random();for(var r of e)if((n-=r.strategy.value)<=0)return r;return e[e.length-1]}));return function(n){return e.apply(this,arguments)}}()},P=function(){var e=n((function*(e,n){if(Array.isArray(n)&&0!==n.length){var r=(yield h(b))||{};if(r[e])return n.find((n=>n.id===r[e]));if(!n.some((e=>!e.strategy))){var t=n[0].strategy,o=O[t.type],a=yield o(n);return yield function(e,n){return g.apply(this,arguments)}(b,i(i({},(yield h(b))||{}),{},{[e]:a.id})),a}}}));return function(n,r){return e.apply(this,arguments)}}(),j=(e,n)=>{window.marfeel=window.marfeel||{},window.marfeel.cmd=window.marfeel.cmd||[],window.marfeel.cmd.push(["synchronizer",r=>{r.resolve(e,n)}])},S="mrfhud",E=e=>window.location.search.includes(e),A=function(){var e=n((function*(){if(E("activate-overlay")||E(S)||(e=S,window.location.hash.includes(e)))return!0;var e,n,r,t=null===(n=window.__mrfCompass)||void 0===n?void 0:n.accountId;return void 0!==t&&(r="".concat("mrfHudStorage","-").concat(t),!!window.localStorage.getItem(r))}));return function(){return e.apply(this,arguments)}}(),D=function(){var e=n((function*(e){return"FINISHED"===e.status&&e.winner?e.variants.find((n=>n.id===e.winner)):P(e.id||"",e.variants)}));return function(n){return e.apply(this,arguments)}}(),I=function(){var e=n((function*(e){var r,t=yield Promise.all(e.map(function(){var e=n((function*(e){var n=yield D(e);return n?f({id:n.id,status:e.status,applyChangesOnFinish:!!e.applyChangesOnFinish},e.detail,n.detail||{}):{}}));return function(n){return e.apply(this,arguments)}}())),i=new Set,o={headlines:t.reduce(((e,n)=>{if(t=n,0!==Object.keys(t).length){var r=n.recirculationModule.editorialId;i.has(r)||e.push(n),i.add(r)}var t;return e}),[])};0===o.headlines.length||(yield A())?j("headline",!1):(r=o,a("experimentation-headlineab").innerHTML=JSON.stringify(r))}));return function(n){return e.apply(this,arguments)}}(),x={[o.HEADLINE_AB]:I},N=function(){var e=n((function*(e){var n,r=e.reduce(((e,n)=>i(i({},e),{},{[n.experimentType]:[...e[n.experimentType]||[],n]})),{});n=e.length>0,j("experimentation",n),yield Promise.all(Object.values(o).map((e=>(e=>x[e])(e)(r[e]||[]))))}));return function(n){return e.apply(this,arguments)}}();!function(){try{N([])}catch(e){j("experimentationFailed")}}();