(() => { var bundles = [['mutations', () => { var define = true; !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.obBundle=e():(t.obBundle=t.obBundle||{},t.obBundle.dresscode=e())}(self,()=>(()=>{"use strict";var i={d:(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},t={};i.r(t),i.d(t,{DressCode:()=>c,factory:()=>e});function a(){for(var t=[],e=0;e ")}function u(t){if(t)return t.id||(t.attribs?t.attribs.id:void 0)}function m(t){if(t)return t.className||(t.attribs?t.attribs.class:void 0)}function p(t,e){var n;if(void 0===e&&(e=window),!t)return[];var i=[];try{i=Array.from(null==(n=e.document)?void 0:n.querySelectorAll(t))}catch(n){o("ERROR: in querySelectorAll ".concat(n.message," ").concat(t," trying with sanitized selector")),i=Array.from(null==(e=e.document)?void 0:e.querySelectorAll(t.replace(/[^a-zA-Z0-9-_:.#\s()]/g,"")))}return o("last selector used ".concat(t," results ").concat(i.length)),i}function f(t){try{var e=new URL(t).hostname,n=e.split(".").reverse();return 2<=n.length?n[1]+"."+n[0]:e}catch(e){return console.error("Invalid URL:",t),""}}function w(s){var c,t,l,d,e,n=document.createElement("style");function i(){window.clearTimeout(t),t=setTimeout(function(){d=null},2e3)}document.head.appendChild(n),n.innerHTML="@keyframes heartfade {\n 0% {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n }\n }\n .heart {\n z-index: 999;\n animation: heartfade 6s linear;\n position: absolute;\n }",c=document.createElement("DIV"),document.body.prepend(c),l=[],d=null,document.onmousedown=function(t){d=t,i()},document.onmouseup=function(t){i()},document.onmousemove=function(t){d=t,i()},document.ontouchstart=function(t){d=t.touches[0],i()},document.ontouchend=function(t){i()},document.ontouchmove=function(t){d=t.touches[0],i()},e=Date.now(),setInterval(function(){var t=Date.now(),i=t-e;e=t,l.forEach(function(t,e){var n=t.heart,t=t.heartEl;n.time-=i,0s[0]&&e[1] "),i=e.split(" > ");if(0===n.length||0===i.length)return 1;for(var a=Math.max(n.length,i.length);n.length=i)return this.log("(sticky)Randomly selected variation idx ".concat(o," random: ").concat(i,", i: ").concat(o),t[o]),o;throw new Error("weightedRandomSelection: should never get here")},l.prototype.getPinnedMutationAndVariation=function(){var t=null==(t=new URL(this._window.location.href).searchParams.get("ob-var"))?void 0:t.trim();if(t){t=parseInt(t);if(!isNaN(t))return t}},l.prototype.setImageSource=function(n,i){var t=new Image;t.src=i,t.onload=function(){var t,e;"img"===n.tagName.toLowerCase()?(t=n.parentElement,e=[],t&&"picture"===t.tagName.toLowerCase()&&(e=Array.from(t.querySelectorAll("source"))),n.style.transition="opacity 0.5s ease-in-out",n.style.opacity=0,setTimeout(function(){n.src=i,e.forEach(function(t){return t.srcset=i}),n.srcset&&(n.srcset=i),n.style.opacity=1},500)):"div"===n.tagName.toLowerCase()&&(n.style.transition="opacity 0.5s ease-in-out",n.style.opacity=0,setTimeout(function(){n.style.setProperty("background-image","url(".concat(i,")"),"important"),n.style.opacity=1},500))},t.onerror=function(){console.error("Failed to load image: ".concat(i))}},l.prototype.setCssAttributes=function(t,m,p){return g(this,void 0,void 0,function(){var e,n,i,a,o,r,s,c,l,d,u,h;return N(this,function(t){if(!(m instanceof window.Element))return[2,!1];if(p){if(e=p.attributes,n=p.css,e)for(i=0,a=Object.entries(e);ia||i.top>o)&&(t.contains(e(i.left+(i.right-i.left)/2,i.top))||t.contains(e(i.left,i.top))||t.contains(e(i.right,i.top))||t.contains(e(i.right,i.bottom))||t.contains(e(i.left,i.bottom)))},l.prototype.doMutate=function(y,v){var b;return g(this,void 0,void 0,function(){var h,m,p,f,g;return N(this,function(t){switch(t.label){case 0:return t.trys.push([0,9,,10]),(h=this.similarityCalculator.extractWithSimilarity([],y.domTrail,y.cssSelectors,{name:y.name,id:"".concat(y.id)}))?(m=h.el,p=(null==(b=null==(b=v.cssAttributes.attributes)?void 0:b.textContent)?void 0:b.trim().toLocaleLowerCase())||"",f=function(){var t=p.match(/^(.+):(.+)$/);if(t){t[0];var e=t[1],t=t[2];if(C.includes(e)&&T.includes(t))return[e,t]}return[]}(),g=f[0],f=f[1],g&&"flow"===f?(w(g),[3,8]):[3,1]):[2,{status:"NOT_FOUND"}];case 1:return"soccer ball"!=p?[3,2]:(I(m,p),[3,8]);case 2:return["valentines heart","slot machine"].includes(p)?(this.log("adding ".concat(p," icon")),I(m,p),[3,8]):[3,3];case 3:return"pumpkins fall"!=p&&"pumpkins flow"!==p?[3,4]:(w("pumpkin"),[3,8]);case 4:if("xmas snow"!==p)return[3,5];else{this.log("XMS XMS XMS - adding a xmas snow");{function e(){if(r)for(var t=window.innerWidth,e=window.innerHeight,n=(o.width=t*s,o.height=e*s,o.style.width="".concat(t,"px"),o.style.height="".concat(e,"px"),r.scale(s,s),c.length=0,Math.floor(t*e/2e3)),i=0;io.height+this.size},d.prototype.reset=function(){this.x=Math.random()*o.width,this.y=-this.size},d.prototype.update=function(){this.windAngle+=this.windSpeed,this.wind=.5*Math.cos(this.windAngle),this.x+=this.wind,this.y+=this.velocity,this.isOutsideCanvas()&&this.reset()},d.prototype.draw=function(){r&&(r.beginPath(),r.arc(this.x,this.y,this.size,0,2*Math.PI),r.fillStyle=this.fill,r.shadowColor="rgba(0, 0, 0, 0.3)",r.shadowBlur=2,r.fill(),r.closePath())},d);function d(){this.x=Math.random()*o.width,this.y=Math.random()*o.height,this.size=2*Math.random()+1,this.velocity=.35*this.size;var t=Math.min(this.size/3+.3,1);this.fill="rgba(255, 255, 255, ".concat(t,")"),this.windSpeed=.1*(Math.random()-.5),this.windAngle=Math.random()*Math.PI*2,this.wind=0}window.addEventListener("resize",e),e();function u(){r&&(requestAnimationFrame(u),r.clearRect(0,0,o.width,o.height),c.forEach(function(t){t.update(),t.draw()}))}u()}return[3,8]}case 5:return[4,this.resolveCssAttributes(y,m,v.cssAttributes)];case 6:return f=t.sent(),[4,this.setCssAttributes(y,m,f)];case 7:if(!t.sent())return[2,{domEl:m,status:"ERROR"}];t.label=8;case 8:return this.boundElements.push(m),[2,{status:"APPLIED",method:h.method,domEl:m}];case 9:return g=t.sent(),this.log("error while trying to mutate",g),[2,{status:"ERROR"}];case 10:return[2]}})})},l.prototype.resolveCssAttributes=function(i,a,o){var r;return g(this,void 0,void 0,function(){var e,n;return N(this,function(t){switch(t.label){case 0:return"ac-image"!==i.name?[3,4]:(e=this.getMacroParam("ad_id"))?[4,fetch("https://my.outbrain.com/mtGetImageExternalUrlFromAdID/handler?adId=".concat(e,"&width=").concat(a.offsetWidth,"&height=").concat(a.offsetHeight))]:[2,o];case 1:return(e=t.sent()).ok?[4,e.json()]:[3,3];case 2:n=t.sent().cachedImageUrl,null!=(r=o.attributes)&&r.src?o.attributes.src=n:null!=(r=o.css)&&r.backgroundImage&&(o.css.backgroundImage=n),t.label=3;case 3:case 4:return[2,o]}})})},l.prototype.loadVariationIdFromStorage=function(t){var e=this._window.document.cookie;if(e){e=e.split(";").find(function(t){return t.trim().startsWith("dicbo_id")});if(e){e=e.split("=")[1];if(e){e=decodeURIComponent(e);try{var n=JSON.parse(e);if(null!=n.variations){var i=n.variations;if(this.log("we have vars in cookies",JSON.stringify(i)),null!=i&&0!=i.length){var a=i.split(",").filter(function(t){return!isNaN(parseInt(t))}).map(function(t){return parseInt(t)});if(0==a.length)this.log("could not find any variation id in cookies [".concat(a,"]"));else{var o,r=t.map(function(t){return t.variations.map(function(t){return t.id})}).flat(),s=a.filter(function(t){return r.includes(t)});if(this.log("we have ".concat(s.length," relevant variations in cookies"),s),0!=s.length)return o=s[Math.floor(Math.random()*s.length)],this.log("we picked variationId ".concat(o," from cookies")),o}}}}catch(t){}}}}},l.prototype.getMutationAndVariationFromStorage=function(t){var e,n=this.loadVariationIdFromStorage(t);if(null!=n)return e=t.findIndex(function(t){return-1!=t.variations.findIndex(function(t){return t.id==n})}),t=t[e].variations.findIndex(function(t){return t.id==n}),this.log("found variation id ".concat(t," part of ").concat(e," in cookies, will use it")),{mIdx:e,vIdx:t};this.log("could not find variation id in cookies, will randomize")},l.prototype.selectAndMutate=function(s){return g(this,void 0,void 0,function(){var e,n,i,a,o,r;return N(this,function(t){switch(t.label){case 0:if(i=this.getPinnedMutationAndVariation())for(a=0;a").map(function(t){return t.trim()}),i=/#([\w-]+)/,(a=n.filter(function(t){return i.test(t)})).length)?(n=n[n.length-1],a=a.join(" ").trim()+" "+n,p(a,t._window)):[]},function(t,e,n){if(null==n||!n.length)return[];n[0],n[1];var n=n[2].split(">").map(function(t){return t.trim()}),i=n.pop(),a=n.filter(function(t){return t.match(/.\w+$/)});if(!a.length)return[];for(var o=[],r=!0;!o.length&&a.length;)r||a.shift(),o=p(a.join(" ").trim()+" "+i,t._window),r=!1;return o},function(t,e,n){if(null==n||!n.length)return[];for(var i=n[0],a=i.replace(/:nth-of-type\(\d+\)/gi,""),o=[];i!==a&&o.length<3;)i=i.replace(/:nth-of-type\(\d+\)/,""),o=p(i,t._window);return o}],this.locationHref=t}return t})()),"undefined"!=typeof obBundle&&(new obBundle.dresscode.DressCode).execute([{id:99,name:"ClickHere 1",finalUrl:"https://www.iqair.com/us/newsroom/8-hidden-holiday-air-quality-challenges-and-how-to-handle-them",status:2,modificationDate:"2023-11-23T19:31:36.000Z",creationDate:"2023-11-22T21:00:00.000Z",winnerVariationId:null,completionDate:null,campaignId:null,variations:[{id:438,mutationId:99,content:"CLICK HERE",cssAttributes:{attributes:{textContent:"CLICK HERE"}},type:0,allocation:25,status:1,modificationDate:"2024-08-08T12:07:25.000Z",creationDate:"2023-11-22T21:00:00.000Z"},{id:439,mutationId:99,content:"Clean air now !",cssAttributes:{attributes:{textContent:"Clean air now !"}},type:1,allocation:20,status:1,modificationDate:"2024-08-08T12:07:25.000Z",creationDate:"2023-11-22T21:00:00.000Z"},{id:440,mutationId:99,content:"Purify your home",cssAttributes:{attributes:{textContent:"Purify your home"}},type:1,allocation:20,status:1,modificationDate:"2024-08-08T12:07:25.000Z",creationDate:"2023-11-22T21:00:00.000Z"},{id:441,mutationId:99,content:"Clean air this holiday season",cssAttributes:{attributes:{textContent:"Clean air this holiday season"}},type:1,allocation:20,status:1,modificationDate:"2024-08-08T12:07:25.000Z",creationDate:"2023-11-22T21:00:00.000Z"}],cssSelectors:["html > body > app-root > app-portal-container > div#content-wrapper > app-hd-article > div > div > headless-article-component > div > div:nth-of-type(2) > div:nth-of-type(1) > div:nth-of-type(3) > div#fca-content-container > div > div#featured-content-areas-15456 > div > div > a","html > body.page-node-type-blog-article > app-root > app-portal-container > div.content-wrapper > app-hd-article > div.iqair-page > div.main > headless-article-component > div.container > div.article-content-outer > div.article-content > div.article-body > div > div.fca-mobile-image-wrapper > div.fca-wrapper > div.fca-content > div.go-to-link > a.btn","html > body.page-node-type-blog-article.path-node > app-root > app-portal-container > div.content-wrapper > app-hd-article > div.iqair-page.kat-hdp > div.main.main-render-area > headless-article-component > div.container.iqair-article > div.article-content-outer > div.article-content > div.article-body > div > div.fca-mobile-image-wrapper > div.fca-wrapper > div.fca-content.position-middle-left > div.go-to-link > a.btn.fca-button","html > body.page-node-type-blog-article.path-node.page-node-type-paragraph-test-1 > app-root > app-portal-container > div.content-wrapper > app-hd-article > div.iqair-page.kat-hdp > div.main.main-render-area > headless-article-component > div.container.iqair-article > div.article-content-outer > div.article-content > div.article-body > div > div.fca-mobile-image-wrapper > div.fca-wrapper > div.fca-content.position-middle-left.color-blue > div.go-to-link > a.btn.fca-button.blue"],domTrail:[{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9541,elementCssClasses:"btn fca-button blue",elementAttributeNames:"href:https://www.iqair.com/us/lp/give-the-gift-of-clean-air-gift-guide;target:_blank;class:btn fca-button blue;",tagName:"A",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9542,elementCssClasses:"go-to-link",elementAttributeNames:"class:go-to-link;",tagName:"DIV",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9543,elementCssClasses:"fca-content position-middle-left color-blue text-align- width-60",elementAttributeNames:"class:fca-content position-middle-left color-blue text-align- width-60;",tagName:"DIV",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9544,elementCssClasses:"fca-wrapper",elementAttributeNames:"style:margin-top: 0px;id:featured-content-areas-15456;class:fca-wrapper;",tagName:"DIV",elementId:"featured-content-areas-15456",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9545,elementCssClasses:"fca-mobile-image-wrapper",elementAttributeNames:'class:fca-mobile-image-wrapper;style:background:url("https://cms.iqair.com/sites/default/files/2022-10/Holiday-Purifiers_FCA_Mob.jpg") 100% 100%; background-size: 100% 100%;;',tagName:"DIV",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9546,elementCssClasses:"",elementAttributeNames:'style:background-image:url("https://cms.iqair.com/sites/default/files/2022-10/Holiday-Purifiers_FCA_Desk.jpg"); background-size: cover; background-position: 100% 80%; background-repeat: no-repeat; position: relative; width: 100%; margin-bottom: 16px;;id:fca-content-container;',tagName:"DIV",elementId:"fca-content-container",elementNthChild:1,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9547,elementCssClasses:"article-body",elementAttributeNames:"class:article-body;",tagName:"DIV",elementId:"",elementNthChild:3,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9548,elementCssClasses:"article-content",elementAttributeNames:"class:article-content;",tagName:"DIV",elementId:"",elementNthChild:1,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9549,elementCssClasses:"article-content-outer",elementAttributeNames:"class:article-content-outer;",tagName:"DIV",elementId:"",elementNthChild:2,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9550,elementCssClasses:"container iqair-article",elementAttributeNames:"class:container iqair-article;",tagName:"DIV",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9551,elementCssClasses:"",elementAttributeNames:"",tagName:"HEADLESS-ARTICLE-COMPONENT",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9552,elementCssClasses:"main main-render-area",elementAttributeNames:"_ngcontent-airvisual-web-c194:;class:main main-render-area;",tagName:"DIV",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9553,elementCssClasses:"iqair-page kat-hdp",elementAttributeNames:"_ngcontent-airvisual-web-c194:;class:iqair-page kat-hdp;",tagName:"DIV",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9554,elementCssClasses:"",elementAttributeNames:"_nghost-airvisual-web-c194:;",tagName:"APP-HD-ARTICLE",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9555,elementCssClasses:"content-wrapper",elementAttributeNames:"_ngcontent-airvisual-web-c35:;id:content-wrapper;class:content-wrapper;style:padding-top: 68px;;",tagName:"DIV",elementId:"content-wrapper",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9556,elementCssClasses:"",elementAttributeNames:"_nghost-airvisual-web-c35:;",tagName:"APP-PORTAL-CONTAINER",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9557,elementCssClasses:"",elementAttributeNames:"_nghost-sc106:;ng-version:11.2.14;_nghost-airvisual-web-c81:;",tagName:"APP-ROOT",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9558,elementCssClasses:"page-node-type-blog-article path-node page-node-type-paragraph-test-1 INDlangdirLTR INDpositionLeft INDDesktop INDChrome INDhasDragTooltip lang-en-us",elementAttributeNames:"class:page-node-type-blog-article path-node page-node-type-paragraph-test-1 INDlangdirLTR INDpositionLeft INDDesktop INDChrome INDhasDragTooltip lang-en-us;data-ind-ratio:200;data-indlangdirltr:INDlangdirLTR;data-indpositionleft:INDpositionLeft;data-inddesktop:INDDesktop;data-indchrome:INDChrome;dat",tagName:"BODY",elementId:"",elementNthChild:0,type:1},{entityId:99,creationDate:"Wed Nov 22 2023 15:59:59 GMT-0500 (Eastern Standard Time)",domTrailId:9559,elementCssClasses:"",elementAttributeNames:"lang:en-us;",tagName:"HTML",elementId:"",elementNthChild:0,type:1}]}]); }]]; for (var i = 0; i < bundles.length; i++) { var bundle = bundles[i]; bundle[1].call(window, bundle[2]); } })()