How Much Should I Spend on Clothes? (+ 9 Tips


How Much Should I Spend on Clothing? Here’s the Budget to Use0;var e=t?r.nitroScrollPos:0;function l(){if(r!==null){if(typeof r===”object”){r.nitroScrollPos=window.pageYOffset}}else{r={nitroScrollPos:window.pageYOffset}}history.replaceState(r,””)}window.addEventListener(“scroll”,function(){if(o!==null)clearTimeout(o);o=setTimeout(l,200)},{passive:true});return{isScrolled:function(){return t},getScrollPos:function(){return e}}}();]]>)?$/gm,”$1″)],{type:”text/javascript”}))}catch(e){var n=”data:text/javascript;base64,”+btoa(t.replace(/^(?:)?$/gm,”$1″))}return n};var U=function(){NPh.documentReadyState=”interactive”;document.triggerNitroEvent(“readystatechange”);document.triggerNitroEvent(“DOMContentLoaded”);if(window.pageYOffset||window.pageXOffset){window.dispatchEvent(new Event(“scroll”))}P=true;h(function(){if(b==0){h(_)}h(F)})};var _=function(){if(!P||R)return;R=true;w.disconnect();Q();NPh.documentReadyState=”complete”;document.triggerNitroEvent(“readystatechange”);window.triggerNitroEvent(“load”,document);window.triggerNitroEvent(“pageshow”,document);if(window.pageYOffset||window.pageXOffset||location.hash){let e=typeof history.scrollRestoration!==”undefined”&&history.scrollRestoration==”auto”;if(e&&typeof NPSH!==”undefined”&&NPSH.getScrollPos()>0){window.scrollTo(0,NPSH.getScrollPos())}else if(location.hash){try{let e=document.querySelector(location.hash);if(e){e.scrollIntoView()}}catch(e){}}}var e=null;if(u==1){e=V}else{e=ee}h(e)};var h=function(e){setTimeout(e,0)};var Y=function(e){if(e.type==”touchend”||e.type==”click”){t=e}};var F=function(){if(t){setTimeout(function(r){return function(){var e=function(e,t,n){var r=new Event(e,{bubbles:true,cancelable:true});if(e==”click”){r.clientX=t;r.clientY=n}else{r.touches=[{clientX:t,clientY:n}]}return r};var t;if(r.type==”touchend”){var n=r.changedTouches[0];t=document.elementFromPoint(n.clientX,n.clientY);t.dispatchEvent(e(“touchstart”),n.clientX,n.clientY);t.dispatchEvent(e(“touchend”),n.clientX,n.clientY);t.dispatchEvent(e(“click”),n.clientX,n.clientY)}else if(r.type==”click”){t=document.elementFromPoint(r.clientX,r.clientY);t.dispatchEvent(e(“click”),r.clientX,r.clientY)}}}(t),150);t=null}};var G=function(e){if(e.tagName==”SCRIPT”&&!e.hasAttribute(“data-nitro-for-id”)&&!e.hasAttribute(“nitro-document-write”)||e.tagName==”IMG”&&(e.hasAttribute(“src”)||e.hasAttribute(“srcset”))||e.tagName==”IFRAME”&&e.hasAttribute(“src”)||e.tagName==”LINK”&&e.hasAttribute(“href”)&&e.hasAttribute(“rel”)&&e.getAttribute(“rel”)==”stylesheet”){var t=””;switch(e.tagName){case”LINK”:t=e.href;break;case”IMG”:if(i.indexOf(e)>-1)return;t=e.srcset||e.src;break;default:t=e.src;break}var n=e.getAttribute(“type”);if(!t&&e.tagName!==”SCRIPT”)return;if((e.tagName==”IMG”||e.tagName==”LINK”)&&(t.indexOf(“data:”)===0||t.indexOf(“blob:”)===0))return;if(e.tagName==”SCRIPT”&&n&&n!==”text/javascript”&&n!==”application/javascript”){if(n!==”module”||!M)return}if(e.tagName===”SCRIPT”){if(i.indexOf(e)>-1)return;if(e.noModule&&M){return}if(!e.src){if(e.textContent.length>0){e.textContent+=”n;if(document.currentScript.nitroTimeout) {clearTimeout(document.currentScript.nitroTimeout);}; setTimeout(function() { this.dispatchEvent(new Event(‘load’)); }.bind(document.currentScript), 0);”}else{return}}i.push(e)}if(!e.hasOwnProperty(“nitroTimeout”)){b++;e.addEventListener(“load”,o,true);e.addEventListener(“error”,o,true);e.addEventListener(“nitroTimeout”,o,true);e.nitroTimeout=setTimeout(function(){console.log(“Resource timed out”,e);e.dispatchEvent(new Event(“nitroTimeout”))},5e3)}}};var W=function(e){if(e.hasOwnProperty(“nitroTimeout”)&&e.nitroTimeout){clearTimeout(e.nitroTimeout);e.nitroTimeout=null;e.dispatchEvent(new Event(“nitroTimeout”))}};document.documentElement.addEventListener(“load”,function(e){if(e.target.tagName==”SCRIPT”||e.target.tagName==”IMG”){i.push(e.target)}},true);document.documentElement.addEventListener(“error”,function(e){if(e.target.tagName==”SCRIPT”||e.target.tagName==”IMG”){i.push(e.target)}},true);var X=[“appendChild”,”replaceChild”,”insertBefore”,”prepend”,”append”,”before”,”after”,”replaceWith”,”insertAdjacentElement”];var K=function(){X.forEach(function(t){HTMLElement.prototype[“og”+t]=HTMLElement.prototype[t];HTMLElement.prototype[t]=function(…e){if(this.parentNode||this===document.documentElement){switch(t){case”replaceChild”:case”insertBefore”:e.pop();break;case”insertAdjacentElement”:e.shift();break}e.forEach(function(e){if(!e)return;if(e.tagName==”SCRIPT”){G(e)}else{if(e.children&&e.children.length>0){e.querySelectorAll(“script”).forEach(G)}}})}return this[“og”+t].apply(this,arguments)}})};var Q=function(){X.forEach(function(e){HTMLElement.prototype[e]=HTMLElement.prototype[“og”+e]})};var J=async function(){if(g){ie(f);ie(Y);if(v){clearTimeout(v);v=null}}if(p===1){L=true;return}else if(p===0){p=-1}NPh.startedScriptLoading=true;Object.defineProperty(document,”readyState”,{get:function(){return NPh.documentReadyState},set:function(){}});var s=document.documentElement;var l={attributes:true,attributeFilter:[“src”],childList:true,subtree:true};w=new MutationObserver(function(e,t){e.forEach(function(e){if(e.type==”childList”&&e.addedNodes.length>0){e.addedNodes.forEach(function(e){if(!document.documentElement.contains(e))return;if(e.tagName==”IMG”||e.tagName==”IFRAME”||e.tagName==”LINK”){G(e)}})}if(e.type==”childList”&&e.removedNodes.length>0){e.removedNodes.forEach(function(e){if(e.tagName==”IFRAME”||e.tagName==”LINK”){W(e)}})}if(e.type==”attributes”){var t=e.target;if(!document.documentElement.contains(t))return;if(t.tagName==”IFRAME”||t.tagName==”LINK”||t.tagName==”IMG”||t.tagName==”SCRIPT”){G(t)}}})});w.observe(s,l);K();await Promise.all(T);var e=m.shift();var t=null;var n=false;while(e){var r;var i=JSON.parse(atob(e.meta));var o=i.delay;if(e.type==”inline”){var a=document.getElementById(e.id);if(a){a.remove()}else{e=m.shift();continue}r=D(a);if(r===false){e=m.shift();continue}}else{r=e.src}if(!n&&e.type!=”inline”&&(typeof i.attributes.async!=”undefined”||typeof i.attributes.defer!=”undefined”)){if(t===null){t=e}else if(t===e){n=true}if(!n){m.push(e);e=m.shift();continue}}var c=document.createElement(“script”);c.src=r;c.setAttribute(“data-nitro-for-id”,e.id);for(var u in i.attributes){try{if(i.attributes[u]===false){c.setAttribute(u,””)}else{c.setAttribute(u,i.attributes[u])}}catch(e){console.log(“Error while setting script attribute”,c,e)}}c.async=false;if(o){setTimeout(function(e,t){var n=document.querySelector(“[data-nitro-marker-id='”+t+”‘]”);if(n){n.after(e)}else{document.head.appendChild(e)}}.bind(null,c,e.id),o)}else{c.addEventListener(“load”,H);c.addEventListener(“error”,H);if(!c.noModule||!M){N++}var d=document.querySelector(“[data-nitro-marker-id='”+e.id+”‘]”);if(d){h(function(e,t){return function(){e.after(t)}}(d,c))}else{h(function(e){return function(){document.head.appendChild(e)}}(c))}}e=m.shift()}};var $=function(){var e=document.getElementById(“nitro-deferred-styles”);var t=document.createElement(“div”);t.innerHTML=e.textContent;return t};var V=async function(e){isPreload=e&&e.type==”NitroPreload”;if(!isPreload){p=-1;n=false;if(g){ie(f);ie(Y);if(v){clearTimeout(v);v=null}}}if(r===false){var t=$();let e=t.querySelectorAll(‘style,link[rel=”stylesheet”]’);r=e.length;if(r){let e=document.getElementById(“nitro-deferred-styles-marker”);e.replaceWith.apply(e,t.childNodes)}else if(isPreload){h(te)}else{ne()}}else if(r===0&&!isPreload){ne()}};var z=function(){var e=$();var t=e.childNodes;var n;var r=[];for(var i=0;i p”,”skip”:0,”classNames”:[],”position”:”afterend”,”every”:1,”enabled”:true},”adSizes”:[[120,240],[250,250],[300,250],[320,50],[320,100],[336,280],[468,60],[728,90],[970,90],[1,1],[300,300],[552,334],[300,50],[728,250],[970,250],[1,2]],”priority”:199,”autosize”:true},{“targeting”:[{“value”:[“Content”],”key”:”location”}],”devices”:[“phone”],”name”:”Content”,”sticky”:false,”location”:”Content”,”dynamic”:{“pageSelector”:”body.single, body.page:not(.home)”,”min”:0,”spacing”:0.85,”max”:9,”lazy”:true,”lazyMax”:11,”elementSelector”:”.entry-content > p”,”skip”:0,”classNames”:[],”position”:”afterend”,”every”:1,”enabled”:true},”adSizes”:[[120,240],[250,250],[300,250],[320,50],[320,100],[336,280],[468,60],[728,90],[970,90],[1,1],[300,300],[552,334],[300,50],[728,250],[970,250],[1,2]],”priority”:199,”autosize”:true},{“targeting”:[{“value”:[“Footer”],”key”:”location”},{“value”:true,”key”:”sticky”}],”devices”:[“tablet”,”phone”,”desktop”],”name”:”Footer”,”sticky”:true,”location”:”Footer”,”dynamic”:{“pageSelector”:null,”min”:0,”spacing”:0,”max”:1,”lazy”:false,”elementSelector”:”body”,”skip”:0,”classNames”:[],”position”:”beforeend”,”every”:1,”enabled”:true},”adSizes”:[[320,50],[320,100],[728,90],[970,90],[468,60],[1,1],[300,50]],”priority”:-1,”autosize”:true}],”videoPlayers”:{“contextual”:{“autoplayCollapsibleEnabled”:false,”overrideEmbedLocation”:false,”defaultPlayerType”:”static”},”videoEmbed”:”wordpress”,”footerSelector”:””,”players”:[{“pageSelector”:””,”devices”:[“mobile”],”mobileLocation”:”top-right”,”description”:””,”elementSelector”:””,”skip”:0,”id”:4065462,”position”:”afterend”,”title”:”Sticky related player – mobile”,”type”:”stickyRelated”,”enabled”:true,”playerId”:”T5KRJjJM”},{“devices”:[“desktop”,”mobile”],”description”:””,”id”:4065460,”title”:”Stationary related player – desktop and mobile”,”type”:”stationaryRelated”,”enabled”:true,”playerId”:”T5KRJjJM”},{“pageSelector”:””,”devices”:[“desktop”],”description”:””,”elementSelector”:””,”skip”:0,”id”:4065461,”position”:”afterend”,”title”:”Sticky related player – desktop”,”type”:”stickyRelated”,”enabled”:true,”playerId”:”T5KRJjJM”},{“playlistId”:”0hpDtxlI”,”pageSelector”:””,”devices”:[“desktop”],”description”:””,”skip”:0,”title”:””,”type”:”stickyPlaylist”,”enabled”:false,”footerSelector”:””,”elementSelector”:””,”id”:4065463,”position”:”afterend”,”saveVideoCloseState”:false,”shuffle”:true,”playerId”:”i5FQDq5d”},{“playlistId”:”0hpDtxlI”,”pageSelector”:””,”devices”:[“mobile”],”mobileLocation”:”top-right”,”description”:””,”skip”:0,”title”:””,”type”:”stickyPlaylist”,”enabled”:false,”footerSelector”:””,”elementSelector”:””,”id”:4065464,”position”:”afterend”,”saveVideoCloseState”:false,”shuffle”:true,”playerId”:”i5FQDq5d”},{“playlistId”:”0hpDtxlI”,”pageSelector”:””,”devices”:[“desktop”],”description”:””,”elementSelector”:””,”skip”:0,”id”:4065465,”position”:”afterend”,”title”:””,”type”:”sekindo”,”enabled”:false},{“playlistId”:”0hpDtxlI”,”pageSelector”:””,”devices”:[“mobile”],”description”:””,”elementSelector”:””,”skip”:0,”id”:4065466,”position”:”afterend”,”title”:””,”type”:”sekindo”,”enabled”:false}]},”adDensityLayout”:{“mobile”:{“adDensity”:0.28,”onePerViewport”:false},”pageOverrides”:[],”desktop”:{“adDensity”:0.28,”onePerViewport”:false}}};]]> Please ensure Javascript is enabled for purposes of website accessibility 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i[“return”])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } var urlMatch = function (patterns) { var url = window.location.href; return patterns.some(function (pattern) { var re = new RegExp(pattern, 'i'); return re.test(url); }); }; var getClsGlobal = function () { return window.adthriveCLS; }; var LightLogger = (function () { function LightLogger() { } LightLogger.prototype.info = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread([console.info, className, methodName], args)); }; LightLogger.prototype.warn = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread([console.warn, className, methodName], args)); }; LightLogger.prototype.error = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread([console.error, className, methodName], args)); this.sendErrorLogToCommandQueue.apply(this, __spread([className, methodName], args)); }; LightLogger.prototype.event = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.info(className, methodName); }; LightLogger.prototype.sendErrorLogToCommandQueue = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } window.adthrive = window.adthrive || {}; window.adthrive.cmd = window.adthrive.cmd || []; window.adthrive.cmd.push((function () { if (window.adthrive.logError !== undefined && typeof window.adthrive.logError === 'function') { window.adthrive.logError(className, methodName, args); } }).bind(className, methodName, args)); }; LightLogger.prototype.call = function (logFunction, className, methodName) { var args = []; for (var _i = 3; _i 0 && typeof args[0] === 'string') { message.push(args.shift()); } params.push.apply(params, __spread(args)); try { Function.prototype.apply.call(logFunction, console, __spread([message.join('')], params)); } catch (err) { console.error(err); return; } }; return LightLogger; }()); var logger = new LightLogger(); var ClsDisableAds = (function () { function ClsDisableAds(adthrive) { this.adthrive = adthrive; this.all = false; this.content = false; this.recipe = false; this.video = false; this.locations = new Set(); this.reasons = new Set(); if (this.urlHasEmail(window.location.href) || this.urlHasEmail(window.document.referrer)) { this.all = true; this.reasons.add('all_email'); } try { this.checkCommandQueue(); if (document.querySelector('.tag-novideo') !== null) { this.video = true; this.locations.add('Video'); this.reasons.add('video_tag'); } } catch (error) { logger.error('ClsDisableAds', 'checkCommandQueue', error); } } ClsDisableAds.prototype.checkCommandQueue = function () { var _this = this; if (this.adthrive && this.adthrive.cmd) { this.adthrive.cmd.forEach(function (c) { var cmdString = c.toString(); var disableAdsCmd = _this.extractAPICall(cmdString, 'disableAds'); if (disableAdsCmd) { _this.disableAllAds(_this.extractPatterns(disableAdsCmd)); } var disableContentAdsCmd = _this.extractAPICall(cmdString, 'disableContentAds'); if (disableContentAdsCmd) { _this.disableContentAds(_this.extractPatterns(disableContentAdsCmd)); } var disablePlaylistPlayersCmd = _this.extractAPICall(cmdString, 'disablePlaylistPlayers'); if (disablePlaylistPlayersCmd) { _this.disablePlaylistPlayers(_this.extractPatterns(disablePlaylistPlayersCmd)); } }); } }; ClsDisableAds.prototype.extractPatterns = function (apiCall) { var patterns = apiCall.match(/'(.*?)'/g); if (patterns !== null) { return patterns.map(function (pattern) { return pattern.replace(/'/g, ''); }); } }; ClsDisableAds.prototype.extractAPICall = function (cmdString, apiCall) { var rgxp = new RegExp(apiCall + '\((.*?)\)', 'g'); var matches = cmdString.match(rgxp); if (matches !== null) { return matches[0]; } return false; }; ClsDisableAds.prototype.disableAllAds = function (patterns) { if (!patterns || urlMatch(patterns)) { this.all = true; this.reasons.add('all_page'); } }; ClsDisableAds.prototype.disableContentAds = function (patterns) { if (!patterns || urlMatch(patterns)) { this.content = true; this.recipe = true; this.locations.add('Content'); this.locations.add('Recipe'); this.reasons.add('content_plugin'); } }; ClsDisableAds.prototype.disablePlaylistPlayers = function (patterns) { if (!patterns || urlMatch(patterns)) { this.video = true; this.locations.add('Video'); this.reasons.add('video_page'); } }; ClsDisableAds.prototype.urlHasEmail = function (url) { if (!url) { return false; } var hasAnEmail = /([A-Z0-9._%+-]+(@|%(25)*40)[A-Z0-9.-]+.[A-Z]{2,})/i; return hasAnEmail.exec(url) !== null; }; return ClsDisableAds; }()); var clsGlobal = getClsGlobal(); if (clsGlobal) { clsGlobal.disableAds = new ClsDisableAds(window.adthrive); } exports.ClsDisableAds = ClsDisableAds; Object.defineProperty(exports, '__esModule', { value: true }); return exports; })({}); ]]>-1){r.splice(t,1);i.disconnect();s()}e.contentWindow.location.replace(e.getAttribute(“nitro-og-src”))}function o(){if(!i){i=new MutationObserver(function(e,a){e.forEach(n=>{if(n.type==”attributes”&&n.attributeName==”src”){let t=n.target;let i=t.getAttribute(“nitro-og-src”);let r=t.src;if(r!=i){a.disconnect();let e=r.replace(n.oldValue,””);if(r.indexOf(“data:”)===0&&[“?”,”&”].indexOf(e.substr(0,1))>-1){if(i.indexOf(“?”)>-1){t.setAttribute(“nitro-og-src”,i+”&”+e.substr(1))}else{t.setAttribute(“nitro-og-src”,i+”?”+e.substr(1))}}t.src=n.oldValue;s()}}})})}return i}function l(e){o().observe(e,t)}function s(){r.forEach(l)}function c(){window.removeEventListener(“scroll”,c);window.nitro_lazySizesConfig.expand=300}window.addEventListener(“scroll”,c,{passive:true});window.addEventListener(“NitroStylesLoaded”,function(){a=true});window.addEventListener(“load”,function(){e=true});window.addEventListener(“message”,function(e){if(e.data.action&&e.data.action===”playBtnClicked”){var t=document.getElementsByTagName(“iframe”);for(var i=0;i{if(t.getAttribute(“nitro-og-src”).indexOf(“vimeo”)>-1){t.realGetAttribute=t.getAttribute;Object.defineProperty(t,”src”,{value:t.getAttribute(“nitro-og-src”),writable:false});Object.defineProperty(t,”getAttribute”,{value:function(e){if(e==”src”){return t.realGetAttribute(“nitro-og-src”)}else{return t.realGetAttribute(e)}},writable:false})}r.push(t)});s()})})();]]>d.left&&Gd.top-1&&F500&&e.clientWidth>500?500:370:d.expand,c._defEx=r,s=r*d.expFactor,t=d.hFac,J=null,O2&&o>2&&!b.hidden?(O=s,Q=0):O=o>1&&Q>1&&P<6?r:N),q!==m&&(y=innerWidth+m*t,D=innerHeight+m,n=-1*m,q=m),h=u[f].getBoundingClientRect(),(I=h.bottom)>=n&&(F=h.top)=n*t&&(G=h.left)9)break}else!k&&l&&!j&&P<4&&Q<4&&o>2&&(g[0]||d.preloadAfterLoad)&&(g[0]||!p&&(I||H||G||F||”auto”!=u[f][i](d.sizesAttr)))&&(j=g[0]||u[f]);j&&!k&&aa(j)}},V=B(U),W=function(a){var b=a.target;if(b._lazyCache)return void delete b._lazyCache;R(a),s(b,d.loadedClass),t(b,d.loadingClass),u(b,Y),v(b,”lazyloaded”)},X=A(W),Y=function(a){X({target:a.target})},Z=function(a,b){try{a.contentWindow.location.replace(b)}catch(c){a.src=b}},$=function(a){var b,c=a[i](d.srcsetAttr);(b=d.customMedia[a[i](“data-media”)||a[i](“media”)])&&a.setAttribute(“media”,b),c&&a.setAttribute(“srcset”,c)},_=A(function(a,b,c,e,f){var g,h,j,l,o,p;(o=v(a,”lazybeforeunveil”,b)).defaultPrevented||(e&&(c?s(a,d.autosizesClass):a.setAttribute(“sizes”,e)),h=a[i](d.srcsetAttr),g=a[i](d.srcAttr),f&&(j=a.parentNode,l=j&&n.test(j.nodeName||””)),p=b.firesLoad||”src”in a&&(h||g||l),o={target:a},s(a,d.loadingClass),p&&(clearTimeout(m),m=k(R,2500),u(a,Y,!0)),l&&q.call(j.getElementsByTagName(“source”),$),h?a.setAttribute(“srcset”,h):g&&!l&&(L.test(a.nodeName)?Z(a,g):a.src=g),f&&(h||l)&&w(a,{src:g})),a._lazyRace&&delete a._lazyRace,t(a,d.lazyClass),z(function(){var b=a.complete&&a.naturalWidth>1;p&&!b||(b&&s(a,”ls-is-cached”),W(o),a._lazyCache=!0,k(function(){“_lazyCache”in a&&delete a._lazyCache},9)),”lazy”==a.loading&&P–},!0)}),aa=function(a){if(!a._lazyRace){var b,c=K.test(a.nodeName),e=c&&(a[i](d.sizesAttr)||a[i](“sizes”)),f=”auto”==e;(!f&&l||!c||!a[i](“src”)&&!a.srcset||a.complete||r(a,d.errorClass)||!r(a,d.lazyClass))&&(b=v(a,”lazyunveilread”).detail,f&&E.updateElem(a,!0,a.offsetWidth),a._lazyRace=!0,P++,_(a,b,f,e,c))}},ba=C(function(){d.loadMode=3,V()}),ca=function(){3==d.loadMode&&(d.loadMode=2),ba()},da=function(){if(!l){if(f.now()-p<999)return void k(da,999);l=!0,d.loadMode=3,V(),j("scroll",ca,!0)}};return{_:function(){p=f.now(),c.elements=b.getElementsByClassName(d.lazyClass),g=b.getElementsByClassName(d.lazyClass+" "+d.preloadClass),j("scroll",V,!0),j("resize",V,!0),a.MutationObserver?new MutationObserver(V).observe(e,{childList:!0,subtree:!0,attributes:!0}):(e[h]("DOMNodeInserted",V,!0),e[h]("DOMAttrModified",V,!0),setInterval(V,999)),j("hashchange",V,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach(function(a){b[h](a,V,!0)}),/d$|^c/.test(b.readyState)?da():(j("load",da),b[h]("DOMContentLoaded",V),k(da,2e4)),c.elements.length?(U(),z._lsFlush()):V()},checkElems:V,unveil:aa,_aLSL:ca}}(),E=function(){var a,c=A(function(a,b,c,d){var e,f,g;if(a._lazysizesWidth=d,d+="px",a.setAttribute("sizes",d),n.test(b.nodeName||""))for(e=b.getElementsByTagName("source"),f=0,g=e.length;f-1){a.logOther(“Prefetch skipped: URL is already prefetched.”,e);return}if(o.length>15){a.logOther(“Prefetch skipped: Maximum prefetches threshold reached.”);return}if(!n&&!L()){a.logOther(“Prefetch skipped: on cooldown”,e);return}if(E()){a.logOther(“Prefetch skipped: limited connection”,e);return}const r=document.createElement(“link”);r.rel=”prefetch”;r.type=”text/html”;r.href=e;document.head.appendChild(r);o.push(e);h=performance.now();a.logPrefetch(e,t);return true};function v(t){let e=document.querySelector(“body”);while(t!=e){if(t.closest(“nav”)!==null||t.nodeName==”NAV”){t=t.parentElement;a.logOther(“Skipping LCP container level: Inside a element.”,t);continue}let e=Array.from(t.querySelectorAll(“a”));a.logOther(“filtering links…”,e);e=e.filter(e=>{if(e.closest(“nav”)!==null){a.logOther(“Skipping link: Inside a element.”,t);return false}return c(e)});if(e.length>0)return[e,t];t=t.parentElement}return[[],null]}let P=function(){if(r==null){a.logLcpEvent(“IDLE_CALLBACK_CALLED_WITHOUT_LCP_ELEMENT”);_++;if(_>2){window.cancelIdleCallback(l);a.logLcpEvent(“IDLE_CALLBACK_CANCELLED”)}return}let e=[];[e,O]=v(r);if(e.length==0){window.cancelIdleCallback(l);a.logLcpEvent(“IDLE_CALLBACK_CANCELLED”);return}if(e.length>0){u(e[0].href,”LCP_PREFETCH”,!k);k=true}T.observe(O,{subtree:true,childList:true,attributes:true});a.logLcpEvent(“MUTATION_OBSERVER_REGISTERED”);window.cancelIdleCallback(l);a.logLcpEvent(“IDLE_CALLBACK_CANCELLED”)};function C(e){a.logLcpEvent(“MUTATION_RESCAN_TRIGGERED”,e);let t=v(O)[0];if(t.length>0){u(t[0].href,”LCP_PREFETCH”)}}let o=[];let r=null;let O=null;let l=0;let _=0;const T=new MutationObserver(w);let b=0;let k=false;let f=JSON.parse(atob(“WyIuKj9cXD9hZGRcXC10b1xcLWNhcnRcXD0uKj8iLCIuKj8mYWRkXFwtdG9cXC1jYXJ0XFw9Lio/IiwiLio/ZG93bmxvYWQuKj8iLCIuKj9cXC5leGUiLCIuKj9cXC56aXAiLCIuKj9cXC5yYXIiLCIuKj9cXC5kZWIiLCIuKj9cXC5ycG0iLCIuKj9cXC5wa2ciLCIuKj9cXC5kbWciLCIuKj9cXC5wZGYiLCIuKj9cXC5tc2kiLCIuKj9cXC5tcDMiLCIuKj9cXC5kb2MiLCIuKj9cXC5kb2N4IiwiLio/XFwucHB0IiwiLio/XFwueGxzIiwiLio/XFwueGxzeCIsIi4qP1xcLm9kdCIsIi4qP1xcLnR4dCJd”));if(Object.prototype.toString.call(f)===”[object Object]”){a.logOther(“EXCLUDES_AS_OBJECT”,f);let e=[];for(const i in f){e.push(f[i])}f=e}f=f.map(e=>new RegExp(e));let s=null;if(navigator.connection){navigator.connection.onchange=function(e,t){s=null;a.logOther(“Connection changed”,{effectiveType:navigator.connection.effectiveType,rtt:navigator.connection.rtt,downlink:navigator.connection.downlink,saveData:navigator.connection.saveData})}}if(PerformanceObserver.supportedEntryTypes.includes(“largest-contentful-paint”)){let e=new PerformanceObserver(e=>{a.logLcpEvent(“LCP_DETECTED”,e.getEntries().at(-1).element);r=e.getEntries().at(-1).element});let t=function(e){l=window.requestIdleCallback(P);window.removeEventListener(“load”,t)};e.observe({type:”largest-contentful-paint”,buffered:true});window.addEventListener(“load”,t)}else{a.logLcpEvent(“PerformanceObserver does not support LCP events in this browser.”)}g()})();]]>=0&&(r||n)&&(t.delta=t.value-(i||0),(t.delta||void 0===i)&&(i=t.value,e(t)))}},s=-1,m=function(){return”hidden”===document.visibilityState?0:1/0},d=function(){u((function(e){var t=e.timeStamp;s=t}),!0)},v=function(){return s<0&&(s=m(),d(),c((function(){setTimeout((function(){s=m(),d()}),0)}))),{get firstHiddenTime(){return s}}},p=function(e,t){var n,i=v(),r=a("FCP"),u=function(e){"first-contentful-paint"===e.name&&(m&&m.disconnect(),e.startTime=0&&n1e12?new Date:performance.now())-e.timeStamp;”pointerdown”==e.type?function(e,t){var n=function(){h(e,t),r()},i=function(){r()},r=function(){removeEventListener(“pointerup”,n,y),removeEventListener(“pointercancel”,i,y)};addEventListener(“pointerup”,n,y),addEventListener(“pointercancel”,i,y)}(t,e):h(t,e)}},S=function(e){[“mousedown”,”keydown”,”touchstart”,”pointerdown”].forEach((function(t){return e(t,L,y)}))},w={};e.getCLS=function(e,t){l||(p((function(e){g=e.value})),l=!0);var n,i=function(t){g>-1&&e(t)},r=a(“CLS”,0),s=0,m=[],d=function(e){if(!e.hadRecentInput){var t=m[0],i=m[m.length-1];s&&e.startTime-i.startTime<1e3&&e.startTime-t.startTime<5e3?(s+=e.value,m.push(e)):(s=e.value,m=[e]),s>r.value&&(r.value=s,r.entries=m,n())}},v=o(“layout-shift”,d);v&&(n=f(i,r,t),u((function(){v.takeRecords().map(d),n(!0)})),c((function(){s=0,g=-1,r=a(“CLS”,0),n=f(i,r,t)})))},e.getFCP=p,e.getFID=function(e,i){var s,m=v(),d=a(“FID”),p=function(e){e.startTimeperformance.now())return;n.entries=[t],e(n)}catch(e){}},”complete”===document.readyState?setTimeout(t,0):addEventListener(“load”,(function(){return setTimeout(t,0)}))},Object.defineProperty(e,”__esModule”,{value:!0})})); var nitroTelemetry=function(){let e=!!window.IS_NITROPACK;let c=performance.getEntriesByType(“navigation”)[0];let d=c.responseStart-c.requestStart<=5;let t=true;let a=false;let n=null;let l=null;let o=null;let i=y();let w="https://to.getnitropack.com/";let g="HtuADnHfHniglxchyQWjRlmHutLypVYQ";let p=typeof NPRL!="undefined";let v=p?"loadNitro":"load";let r;let u;let f;function y(){return"NPTelemetry:"+btoa(Date.now())+"_"+b()+(e?"_o":"_u")+(d?"_pre":"_dow")}function S(){return document.visibilityState==="visible"}function h(){t=true;i=y();r=null;u={crux:null};m()}function m(){f={sessionEntry:null,unknown:0,afterStyles:0,afterPageLoad:0,afterScroll:0,total:0}}function L(){let n=performance.getEntriesByType("navigation");let l={};for(let t in n){let e=n[t];l.ttfb=e.responseStart-e.requestStart}return l}function b(){if(navigator.connection){return navigator.connection.effectiveType}else{return"u"}}function E(){let e=i+":pageview";k(e,{pv:1})}function k(e,t){t.url=window.location.href.replace(window.location.hash,"");if(window.localStorage){localStorage.setItem(e,JSON.stringify(t))}else{P([t])}}function s(e){if(!window.localStorage)return;let n=null;let l={};let t=0;let o;let i;let r;do{n=localStorage.key(t);if(n&&n.indexOf("NPTelemetry:")===0){r=n.split(":")[1];o=JSON.parse(localStorage.getItem(n));if(!l[r])l[r]={};let t=l[r];for(let e in o){i=o[e];if(i!==null){if(e=="url"){t[e]=i}else if(D(i)){if(!t[e])t[e]=0;t[e]+=i}else if(N(i)){if(!t[e])t[e]={};if(!t[e][i])t[e][i]=0;t[e][i]++}}}localStorage.removeItem(n)}else{t++}}while(n!==null);if(Object.keys(l).length){P(l)}a=false}function D(e){return!isNaN(parseFloat(e))&&isFinite(e)}function N(e){return typeof e==="string"||e instanceof String}function P(e){let t=new FormData;t.append("key",g);if(Object.keys(e).length){t.append("props",JSON.stringify(e));navigator.sendBeacon&&navigator.sendBeacon(w,t)||fetch(w,{body:t,method:"POST",keepalive:true})}}function I(e){if(e===s){if(a){return}else{a=true}}if(window.requestIdleCallback){requestIdleCallback(e,{timeout:1e3})}else{setTimeout(e,1e3)}}function O(){let e=i+":cwv";let t={};if(u.crux){t["lcp:crux"]=Math.round(u.crux)}if(f.total!==null){let e=1e3;t["cls:total"]=Math.round(f.total*e);if(f.afterStyles){t["cls:afterStylesDelta"]=Math.round(f.afterStyles*e)}if(f.afterPageLoad){t["cls:afterPageLoadDelta"]=Math.round(f.afterPageLoad*e)}if(f.afterScroll){t["cls:afterScrollDelta"]=Math.round(f.afterScroll*e)}if(f.unknown){t["cls:unknownDelta"]=Math.round(f.unknown*e)}}else{t["cls:total"]=0}if(r){t["fid"]=Math.round(r)}if(Object.keys(t).length){k(e,t)}}function T(){n=Date.now();window.removeEventListener("NitroStylesLoaded",T,true)}function M(){l=Date.now();window.removeEventListener(v,M,true)}function _(){o=Date.now()}function x(e){return n&&Date.now()-n0){for(let e=0;e-1)return;for(let r=0;r 3 && r && Object.defineProperty(target, key, r), r; } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator[“throw”](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), “throw”: verb(1), “return”: verb(2) }, typeof Symbol === “function” && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError(“Generator is already executing.”); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y[“return”] : op[0] ? y[“throw”] || ((t = y[“return”]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length – 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label = o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read$1(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i[“return”])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread$1() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read$1(arguments[i])); return ar; } var Operation = (function () { function Operation() { } return Operation; }()); var BernoulliTrial = (function (_super) { __extends$1(BernoulliTrial, _super); function BernoulliTrial(_probability) { var _this = _super.call(this) || this; _this._probability = _probability; return _this; } BernoulliTrial.prototype.get = function () { if (this._probability 1) { throw new Error('Invalid probability'); } return Math.random() = desktop) { return 'desktop'; } if (width >= tablet) { return ‘tablet’; } return ‘phone’; }; var elementInnerWidth = function (element) { var width = element.clientWidth; if (getComputedStyle) { var cs = getComputedStyle(element, null); width -= parseFloat(cs.paddingLeft || ‘0’) + parseFloat(cs.paddingRight || ‘0’); } return width; }; var elementOffset = function (element) { var height = element.offsetHeight; var width = element.offsetWidth; var boundingClientRectangle = element.getBoundingClientRect(); var bodyEl = document.body; var docEl = document.documentElement; var scrollTop = window.pageYOffset || docEl.scrollTop || bodyEl.scrollTop; var scrollLeft = window.pageXOffset || docEl.scrollLeft || bodyEl.scrollLeft; var clientTop = docEl.clientTop || bodyEl.clientTop || 0; var clientLeft = docEl.clientLeft || bodyEl.clientLeft || 0; var top = Math.round(boundingClientRectangle.top + scrollTop – clientTop); var left = Math.round(boundingClientRectangle.left + scrollLeft – clientLeft); return { top: top, left: left, bottom: top + height, right: left + width, width: width, height: height, }; }; var getClsGlobal = function () { return window.adthriveCLS; }; var isDesktop = function () { return /Windows NT|Macintosh/i.test(navigator.userAgent); }; var validCssSelector = function (selector) { try { return { valid: true, elements: document.querySelectorAll(selector) }; } catch (err) { return __assign({ valid: false }, err); } }; var allowablePageSelector = function (selector) { if (selector === ”) { return { valid: true }; } return validCssSelector(selector); }; var ClsOptions = (function () { function ClsOptions() { this._clsGlobalData = getClsGlobal(); } Object.defineProperty(ClsOptions.prototype, “enabled”, { get: function () { return this._clsGlobalData && this._clsGlobalData.siteAds; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “siteAds”, { get: function () { return this._clsGlobalData.siteAds; }, set: function (data) { this._clsGlobalData.siteAds = data; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “disableAds”, { get: function () { return this._clsGlobalData.disableAds; }, set: function (data) { this._clsGlobalData.disableAds = data; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “enabledLocations”, { get: function () { return this._clsGlobalData.enabledLocations; }, set: function (data) { this._clsGlobalData.enabledLocations = data; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “injectedFromPlugin”, { get: function () { return this._clsGlobalData.injectedFromPlugin; }, set: function (status) { this._clsGlobalData.injectedFromPlugin = status; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “injectedFromSiteAds”, { get: function () { return this._clsGlobalData.injectedFromSiteAds; }, set: function (status) { this._clsGlobalData.injectedFromSiteAds = status; }, enumerable: false, configurable: true }); ClsOptions.prototype.setInjectedSlots = function (slot) { this._clsGlobalData.injectedSlots.push(slot); }; Object.defineProperty(ClsOptions.prototype, “injectedSlots”, { get: function () { return this._clsGlobalData.injectedSlots; }, enumerable: false, configurable: true }); ClsOptions.prototype.setInjectedScripts = function (script) { this._clsGlobalData.injectedScripts = this._clsGlobalData.injectedScripts || []; this._clsGlobalData.injectedScripts.push(script); }; Object.defineProperty(ClsOptions.prototype, “getInjectedScripts”, { get: function () { return this._clsGlobalData.injectedScripts; }, enumerable: false, configurable: true }); ClsOptions.prototype.setExperiment = function (key, val) { this._clsGlobalData.experiments = this._clsGlobalData.experiments || []; this._clsGlobalData.experiments[key] = val; }; ClsOptions.prototype.getExperiment = function (key) { return this._clsGlobalData.experiments && this._clsGlobalData.experiments[key]; }; Object.defineProperty(ClsOptions.prototype, “branch”, { get: function () { return this._clsGlobalData.branch; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “bucket”, { get: function () { return this._clsGlobalData.bucket; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “videoDisabledFromPlugin”, { get: function () { return this._clsGlobalData.videoDisabledFromPlugin; }, set: function (status) { this._clsGlobalData.videoDisabledFromPlugin = status; }, enumerable: false, configurable: true }); Object.defineProperty(ClsOptions.prototype, “targetDensityLog”, { get: function () { return this._clsGlobalData.targetDensityLog; }, set: function (data) { this._clsGlobalData.targetDensityLog = data; }, enumerable: false, configurable: true }); return ClsOptions; }()); var PluginExperiment = (function () { function PluginExperiment() { this._clsOptions = new ClsOptions(); } PluginExperiment.prototype.setExperimentKey = function () { this._clsOptions.setExperiment(this.key, this.result); }; return PluginExperiment; }()); var LightLogger = (function () { function LightLogger() { } LightLogger.prototype.info = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.info, className, methodName], args)); }; LightLogger.prototype.warn = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.warn, className, methodName], args)); }; LightLogger.prototype.error = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.error, className, methodName], args)); this.sendErrorLogToCommandQueue.apply(this, __spread$1([className, methodName], args)); }; LightLogger.prototype.event = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.info(className, methodName); }; LightLogger.prototype.sendErrorLogToCommandQueue = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } window.adthrive = window.adthrive || {}; window.adthrive.cmd = window.adthrive.cmd || []; window.adthrive.cmd.push((function () { if (window.adthrive.logError !== undefined && typeof window.adthrive.logError === 'function') { window.adthrive.logError(className, methodName, args); } }).bind(className, methodName, args)); }; LightLogger.prototype.call = function (logFunction, className, methodName) { var args = []; for (var _i = 3; _i 0 && typeof args[0] === 'string') { message.push(args.shift()); } params.push.apply(params, __spread$1(args)); try { Function.prototype.apply.call(logFunction, console, __spread$1([message.join('')], params)); } catch (err) { console.error(err); return; } }; return LightLogger; }()); var logger$1 = new LightLogger(); var TargetDensityExperiment = (function (_super) { __extends$1(TargetDensityExperiment, _super); function TargetDensityExperiment() { var _this = _super.call(this) || this; _this._result = false; _this._choices = [{ choice: true }, { choice: false }]; _this.key = 'adsp7'; logger$1.info('CLSTargetDensityExperiment', 'result siteAds.adDensityLayout', _this._clsOptions, _this._clsOptions.siteAds, _this._clsOptions.siteAds.adDensityLayout); var adthriveCLSSiteAds = _this._clsOptions.siteAds; var adDensityEnabled = defaultTo(adthriveCLSSiteAds.adDensityEnabled, true); if (adthriveCLSSiteAds.adDensityLayout && adDensityEnabled) { logger$1.info('CLSTargetDensityExperiment', '_result', 'Setting Experiment Value'); _this._result = _this.run(); _this.setExperimentKey(); } logger$1.info('CLSTargetDensityExperiment ', 'result', _this._result); return _this; } Object.defineProperty(TargetDensityExperiment.prototype, "result", { get: function () { return this._result; }, enumerable: false, configurable: true }); TargetDensityExperiment.prototype.run = function () { return new BernoulliTrial(1).get(); }; return TargetDensityExperiment; }(PluginExperiment)); var VideoUtils = (function () { function VideoUtils() { } VideoUtils.getScrollTop = function () { return (window.pageYOffset || document.documentElement.scrollTop) - (document.documentElement.clientTop || 0); }; VideoUtils.shufflePlaylist = function (playlist) { var currentIndex = playlist.length; var tempValue; var randomIndex; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * playlist.length); currentIndex -= 1; tempValue = playlist[currentIndex]; playlist[currentIndex] = playlist[randomIndex]; playlist[randomIndex] = tempValue; } return playlist; }; VideoUtils.playerInView = function (playerElement) { var boundingRect = playerElement.getBoundingClientRect(); return window.innerHeight > boundingRect.top + boundingRect.height / 2; }; VideoUtils.createQueryString = function (params) { return Object.keys(params) .map(function (key) { return key + “=” + params[key]; }) .join(‘&’); }; VideoUtils.createEncodedQueryString = function (params) { return Object.keys(params) .map(function (key) { return key + “=” + encodeURIComponent(params[key]); }) .join(‘&’); }; VideoUtils.setMobileLocation = function (mobileLocation) { mobileLocation = mobileLocation || ‘bottom-right’; if (mobileLocation === ‘top-left’) { mobileLocation = “adthrive-collapse-top-left” ; } else if (mobileLocation === ‘top-right’) { mobileLocation = “adthrive-collapse-top-right” ; } else if (mobileLocation === ‘bottom-left’) { mobileLocation = “adthrive-collapse-bottom-left” ; } else if (mobileLocation === ‘bottom-right’) { mobileLocation = “adthrive-collapse-bottom-right” ; } return mobileLocation; }; return VideoUtils; }()); var VideoAdOptions = (function () { function VideoAdOptions(_clsOptions) { this._clsOptions = _clsOptions; this.removeVideoTitleWrapper = defaultTo(this._clsOptions.siteAds.adOptions.removeVideoTitleWrapper, false); var videoPlayers = this._clsOptions.siteAds.videoPlayers; this.footerSelector = defaultTo(videoPlayers && videoPlayers.footerSelector, ”); this.players = defaultTo(videoPlayers && videoPlayers.players.map(function (player) { player.mobileLocation = VideoUtils.setMobileLocation(player.mobileLocation); return player; }), []); this.contextualSettings = videoPlayers && videoPlayers.contextual; } return VideoAdOptions; }()); var Video = (function () { function Video(clsOptions) { this.mobileStickyPlayerOnPage = false; this.playlistPlayerAdded = false; this.contextualPlayerAdded = false; this.sekindoPlayerAdded = false; this.footerSelector = ”; this.removeVideoTitleWrapper = false; this.videoAdOptions = new VideoAdOptions(clsOptions); this.players = this.videoAdOptions.players; this.contextualSettings = this.videoAdOptions.contextualSettings; this.removeVideoTitleWrapper = this.videoAdOptions.removeVideoTitleWrapper; this.footerSelector = this.videoAdOptions.footerSelector; } return Video; }()); var Config = (function () { function Config(clsOptions) { this.clsOptions = clsOptions; this.enabledLocations = [‘Below_Post’, ‘Content’, ‘Recipe’, ‘Sidebar’]; } return Config; }()); var commonjsGlobal = typeof globalThis !== ‘undefined’ ? globalThis : typeof window !== ‘undefined’ ? window : typeof global !== ‘undefined’ ? global : typeof self !== ‘undefined’ ? self : {}; var Reflect$1; (function (Reflect) { (function (factory) { var root = typeof commonjsGlobal === “object” ? commonjsGlobal : typeof self === “object” ? self : typeof this === “object” ? this : Function(“return this;”)(); var exporter = makeExporter(Reflect); if (typeof root.Reflect === “undefined”) { root.Reflect = Reflect; } else { exporter = makeExporter(root.Reflect, exporter); } factory(exporter); function makeExporter(target, previous) { return function (key, value) { if (typeof target[key] !== “function”) { Object.defineProperty(target, key, { configurable: true, writable: true, value: value }); } if (previous) previous(key, value); }; } })(function (exporter) { var hasOwn = Object.prototype.hasOwnProperty; var supportsSymbol = typeof Symbol === “function”; var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== “undefined” ? Symbol.toPrimitive : “@@toPrimitive”; var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== “undefined” ? Symbol.iterator : “@@iterator”; var supportsCreate = typeof Object.create === “function”; var supportsProto = { __proto__: [] } instanceof Array; var downLevel = !supportsCreate && !supportsProto; var HashMap = { create: supportsCreate ? function () { return MakeDictionary(Object.create(null)); } : supportsProto ? function () { return MakeDictionary({ __proto__: null }); } : function () { return MakeDictionary({}); }, has: downLevel ? function (map, key) { return hasOwn.call(map, key); } : function (map, key) { return key in map; }, get: downLevel ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; } : function (map, key) { return map[key]; }, }; var functionPrototype = Object.getPrototypeOf(Function); var usePolyfill = typeof process === “object” && process.env && process.env[“REFLECT_METADATA_USE_MAP_POLYFILL”] === “true”; var _Map = !usePolyfill && typeof Map === “function” && typeof Map.prototype.entries === “function” ? Map : CreateMapPolyfill(); var _Set = !usePolyfill && typeof Set === “function” && typeof Set.prototype.entries === “function” ? Set : CreateSetPolyfill(); var _WeakMap = !usePolyfill && typeof WeakMap === “function” ? WeakMap : CreateWeakMapPolyfill(); var Metadata = new _WeakMap(); function decorate(decorators, target, propertyKey, attributes) { if (!IsUndefined(propertyKey)) { if (!IsArray(decorators)) throw new TypeError(); if (!IsObject(target)) throw new TypeError(); if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes)) throw new TypeError(); if (IsNull(attributes)) attributes = undefined; propertyKey = ToPropertyKey(propertyKey); return DecorateProperty(decorators, target, propertyKey, attributes); } else { if (!IsArray(decorators)) throw new TypeError(); if (!IsConstructor(target)) throw new TypeError(); return DecorateConstructor(decorators, target); } } exporter(“decorate”, decorate); function metadata(metadataKey, metadataValue) { function decorator(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey)) throw new TypeError(); OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); } return decorator; } exporter(“metadata”, metadata); function defineMetadata(metadataKey, metadataValue, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey); } exporter(“defineMetadata”, defineMetadata); function hasMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryHasMetadata(metadataKey, target, propertyKey); } exporter(“hasMetadata”, hasMetadata); function hasOwnMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey); } exporter(“hasOwnMetadata”, hasOwnMetadata); function getMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryGetMetadata(metadataKey, target, propertyKey); } exporter(“getMetadata”, getMetadata); function getOwnMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey); } exporter(“getOwnMetadata”, getOwnMetadata); function getMetadataKeys(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryMetadataKeys(target, propertyKey); } exporter(“getMetadataKeys”, getMetadataKeys); function getOwnMetadataKeys(target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); return OrdinaryOwnMetadataKeys(target, propertyKey); } exporter(“getOwnMetadataKeys”, getOwnMetadataKeys); function deleteMetadata(metadataKey, target, propertyKey) { if (!IsObject(target)) throw new TypeError(); if (!IsUndefined(propertyKey)) propertyKey = ToPropertyKey(propertyKey); var metadataMap = GetOrCreateMetadataMap(target, propertyKey, false); if (IsUndefined(metadataMap)) return false; if (!metadataMap.delete(metadataKey)) return false; if (metadataMap.size > 0) return true; var targetMetadata = Metadata.get(target); targetMetadata.delete(propertyKey); if (targetMetadata.size > 0) return true; Metadata.delete(target); return true; } exporter(“deleteMetadata”, deleteMetadata); function DecorateConstructor(decorators, target) { for (var i = decorators.length – 1; i >= 0; –i) { var decorator = decorators[i]; var decorated = decorator(target); if (!IsUndefined(decorated) && !IsNull(decorated)) { if (!IsConstructor(decorated)) throw new TypeError(); target = decorated; } } return target; } function DecorateProperty(decorators, target, propertyKey, descriptor) { for (var i = decorators.length – 1; i >= 0; –i) { var decorator = decorators[i]; var decorated = decorator(target, propertyKey, descriptor); if (!IsUndefined(decorated) && !IsNull(decorated)) { if (!IsObject(decorated)) throw new TypeError(); descriptor = decorated; } } return descriptor; } function GetOrCreateMetadataMap(O, P, Create) { var targetMetadata = Metadata.get(O); if (IsUndefined(targetMetadata)) { if (!Create) return undefined; targetMetadata = new _Map(); Metadata.set(O, targetMetadata); } var metadataMap = targetMetadata.get(P); if (IsUndefined(metadataMap)) { if (!Create) return undefined; metadataMap = new _Map(); targetMetadata.set(P, metadataMap); } return metadataMap; } function OrdinaryHasMetadata(MetadataKey, O, P) { var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); if (hasOwn) return true; var parent = OrdinaryGetPrototypeOf(O); if (!IsNull(parent)) return OrdinaryHasMetadata(MetadataKey, parent, P); return false; } function OrdinaryHasOwnMetadata(MetadataKey, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, false); if (IsUndefined(metadataMap)) return false; return ToBoolean(metadataMap.has(MetadataKey)); } function OrdinaryGetMetadata(MetadataKey, O, P) { var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P); if (hasOwn) return OrdinaryGetOwnMetadata(MetadataKey, O, P); var parent = OrdinaryGetPrototypeOf(O); if (!IsNull(parent)) return OrdinaryGetMetadata(MetadataKey, parent, P); return undefined; } function OrdinaryGetOwnMetadata(MetadataKey, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, false); if (IsUndefined(metadataMap)) return undefined; return metadataMap.get(MetadataKey); } function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) { var metadataMap = GetOrCreateMetadataMap(O, P, true); metadataMap.set(MetadataKey, MetadataValue); } function OrdinaryMetadataKeys(O, P) { var ownKeys = OrdinaryOwnMetadataKeys(O, P); var parent = OrdinaryGetPrototypeOf(O); if (parent === null) return ownKeys; var parentKeys = OrdinaryMetadataKeys(parent, P); if (parentKeys.length <= 0) return ownKeys; if (ownKeys.length <= 0) return parentKeys; var set = new _Set(); var keys = []; for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) { var key = ownKeys_1[_i]; var hasKey = set.has(key); if (!hasKey) { set.add(key); keys.push(key); } } for (var _a = 0, parentKeys_1 = parentKeys; _a = 0 && index = this._keys.length) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } else { this._index++; } return { value: result, done: false }; } return { value: undefined, done: true }; }; MapIterator.prototype.throw = function (error) { if (this._index >= 0) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } throw error; }; MapIterator.prototype.return = function (value) { if (this._index >= 0) { this._index = -1; this._keys = arraySentinel; this._values = arraySentinel; } return { value: value, done: true }; }; return MapIterator; }()); return (function () { function Map() { this._keys = []; this._values = []; this._cacheKey = cacheSentinel; this._cacheIndex = -2; } Object.defineProperty(Map.prototype, “size”, { get: function () { return this._keys.length; }, enumerable: true, configurable: true }); Map.prototype.has = function (key) { return this._find(key, false) >= 0; }; Map.prototype.get = function (key) { var index = this._find(key, false); return index >= 0 ? this._values[index] : undefined; }; Map.prototype.set = function (key, value) { var index = this._find(key, true); this._values[index] = value; return this; }; Map.prototype.delete = function (key) { var index = this._find(key, false); if (index >= 0) { var size = this._keys.length; for (var i = index + 1; i < size; i++) { this._keys[i - 1] = this._keys[i]; this._values[i - 1] = this._values[i]; } this._keys.length--; this._values.length--; if (key === this._cacheKey) { this._cacheKey = cacheSentinel; this._cacheIndex = -2; } return true; } return false; }; Map.prototype.clear = function () { this._keys.length = 0; this._values.length = 0; this._cacheKey = cacheSentinel; this._cacheIndex = -2; }; Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); }; Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); }; Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); }; Map.prototype["@@iterator"] = function () { return this.entries(); }; Map.prototype[iteratorSymbol] = function () { return this.entries(); }; Map.prototype._find = function (key, insert) { if (this._cacheKey !== key) { this._cacheIndex = this._keys.indexOf(this._cacheKey = key); } if (this._cacheIndex < 0 && insert) { this._cacheIndex = this._keys.length; this._keys.push(key); this._values.push(undefined); } return this._cacheIndex; }; return Map; }()); function getKey(key, _) { return key; } function getValue(_, value) { return value; } function getEntry(key, value) { return [key, value]; } } function CreateSetPolyfill() { return (function () { function Set() { this._map = new _Map(); } Object.defineProperty(Set.prototype, "size", { get: function () { return this._map.size; }, enumerable: true, configurable: true }); Set.prototype.has = function (value) { return this._map.has(value); }; Set.prototype.add = function (value) { return this._map.set(value, value), this; }; Set.prototype.delete = function (value) { return this._map.delete(value); }; Set.prototype.clear = function () { this._map.clear(); }; Set.prototype.keys = function () { return this._map.keys(); }; Set.prototype.values = function () { return this._map.values(); }; Set.prototype.entries = function () { return this._map.entries(); }; Set.prototype["@@iterator"] = function () { return this.keys(); }; Set.prototype[iteratorSymbol] = function () { return this.keys(); }; return Set; }()); } function CreateWeakMapPolyfill() { var UUID_SIZE = 16; var keys = HashMap.create(); var rootKey = CreateUniqueKey(); return (function () { function WeakMap() { this._key = CreateUniqueKey(); } WeakMap.prototype.has = function (target) { var table = GetOrCreateWeakMapTable(target, false); return table !== undefined ? HashMap.has(table, this._key) : false; }; WeakMap.prototype.get = function (target) { var table = GetOrCreateWeakMapTable(target, false); return table !== undefined ? HashMap.get(table, this._key) : undefined; }; WeakMap.prototype.set = function (target, value) { var table = GetOrCreateWeakMapTable(target, true); table[this._key] = value; return this; }; WeakMap.prototype.delete = function (target) { var table = GetOrCreateWeakMapTable(target, false); return table !== undefined ? delete table[this._key] : false; }; WeakMap.prototype.clear = function () { this._key = CreateUniqueKey(); }; return WeakMap; }()); function CreateUniqueKey() { var key; do key = "@@WeakMap@@" + CreateUUID(); while (HashMap.has(keys, key)); keys[key] = true; return key; } function GetOrCreateWeakMapTable(target, create) { if (!hasOwn.call(target, rootKey)) { if (!create) return undefined; Object.defineProperty(target, rootKey, { value: HashMap.create() }); } return target[rootKey]; } function FillRandomBytes(buffer, size) { for (var i = 0; i < size; ++i) buffer[i] = Math.random() * 0xff | 0; return buffer; } function GenRandomBytes(size) { if (typeof Uint8Array === "function") { if (typeof crypto !== "undefined") return crypto.getRandomValues(new Uint8Array(size)); if (typeof msCrypto !== "undefined") return msCrypto.getRandomValues(new Uint8Array(size)); return FillRandomBytes(new Uint8Array(size), size); } return FillRandomBytes(new Array(size), size); } function CreateUUID() { var data = GenRandomBytes(UUID_SIZE); data[6] = data[6] & 0x4f | 0x40; data[8] = data[8] & 0xbf | 0x80; var result = ""; for (var offset = 0; offset < UUID_SIZE; ++offset) { var byte = data[offset]; if (offset === 4 || offset === 6 || offset === 8) result += "-"; if (byte = o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i[“return”])) m.call(i); } finally { if (e) throw e.error; } } return ar; } function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } var INJECTION_TOKEN_METADATA_KEY = "injectionTokens"; function getParamInfo(target) { var params = Reflect.getMetadata("design:paramtypes", target) || []; var injectionTokens = Reflect.getOwnMetadata(INJECTION_TOKEN_METADATA_KEY, target) || {}; Object.keys(injectionTokens).forEach(function (key) { params[+key] = injectionTokens[key]; }); return params; } function isClassProvider(provider) { return !!provider.useClass; } function isFactoryProvider(provider) { return !!provider.useFactory; } var DelayedConstructor = (function () { function DelayedConstructor(wrap) { this.wrap = wrap; this.reflectMethods = [ "get", "getPrototypeOf", "setPrototypeOf", "getOwnPropertyDescriptor", "defineProperty", "has", "set", "deleteProperty", "apply", "construct" ]; } DelayedConstructor.prototype.createProxy = function (createObject) { var _this = this; var target = {}; var init = false; var value; var delayedObject = function () { if (!init) { value = createObject(_this.wrap()); init = true; } return value; }; return new Proxy(target, this.createHandler(delayedObject)); }; DelayedConstructor.prototype.createHandler = function (delayedObject) { var handler = {}; var install = function (name) { handler[name] = function () { var args = []; for (var _i = 0; _i 0; }; RegistryBase.prototype.clear = function () { this._registryMap.clear(); }; RegistryBase.prototype.ensure = function (key) { if (!this._registryMap.has(key)) { this._registryMap.set(key, []); } }; return RegistryBase; }()); var Registry = (function (_super) { __extends(Registry, _super); function Registry() { return _super !== null && _super.apply(this, arguments) || this; } return Registry; }(RegistryBase)); var ResolutionContext = (function () { function ResolutionContext() { this.scopedResolutions = new Map(); } return ResolutionContext; }()); function formatDependency(params, idx) { if (params === null) { return "at position #" + idx; } var argName = params.split(",")[idx].trim(); return """ + argName + "" at position #" + idx; } function composeErrorMessage(msg, e, indent) { if (indent === void 0) { indent = " "; } return __spread([msg], e.message.split("n").map(function (l) { return indent + l; })).join("n"); } function formatErrorCtor(ctor, paramIdx, error) { var _a = __read(ctor.toString().match(/constructor(([w, ]+))/) || [], 2), _b = _a[1], params = _b === void 0 ? null : _b; var dep = formatDependency(params, paramIdx); return composeErrorMessage("Cannot inject the dependency " + dep + " of "" + ctor.name + "" constructor. Reason:", error); } var PreResolutionInterceptors = (function (_super) { __extends(PreResolutionInterceptors, _super); function PreResolutionInterceptors() { return _super !== null && _super.apply(this, arguments) || this; } return PreResolutionInterceptors; }(RegistryBase)); var PostResolutionInterceptors = (function (_super) { __extends(PostResolutionInterceptors, _super); function PostResolutionInterceptors() { return _super !== null && _super.apply(this, arguments) || this; } return PostResolutionInterceptors; }(RegistryBase)); var Interceptors = (function () { function Interceptors() { this.preResolution = new PreResolutionInterceptors(); this.postResolution = new PostResolutionInterceptors(); } return Interceptors; }()); var typeInfo = new Map(); var InternalDependencyContainer = (function () { function InternalDependencyContainer(parent) { this.parent = parent; this._registry = new Registry(); this.interceptors = new Interceptors(); } InternalDependencyContainer.prototype.register = function (token, providerOrConstructor, options) { if (options === void 0) { options = { lifecycle: Lifecycle$1.Transient }; } var provider; if (!isProvider(providerOrConstructor)) { provider = { useClass: providerOrConstructor }; } else { provider = providerOrConstructor; } if (isTokenProvider(provider)) { var path = [token]; var tokenProvider = provider; while (tokenProvider != null) { var currentToken = tokenProvider.useToken; if (path.includes(currentToken)) { throw new Error("Token registration cycle detected! " + __spread(path, [currentToken]).join(" -> “)); } path.push(currentToken); var registration = this._registry.get(currentToken); if (registration && isTokenProvider(registration.provider)) { tokenProvider = registration.provider; } else { tokenProvider = null; } } } if (options.lifecycle === Lifecycle$1.Singleton || options.lifecycle == Lifecycle$1.ContainerScoped || options.lifecycle == Lifecycle$1.ResolutionScoped) { if (isValueProvider(provider) || isFactoryProvider(provider)) { throw new Error(“Cannot use lifecycle “” + Lifecycle$1[options.lifecycle] + “” with ValueProviders or FactoryProviders”); } } this._registry.set(token, { provider: provider, options: options }); return this; }; InternalDependencyContainer.prototype.registerType = function (from, to) { if (isNormalToken(to)) { return this.register(from, { useToken: to }); } return this.register(from, { useClass: to }); }; InternalDependencyContainer.prototype.registerInstance = function (token, instance) { return this.register(token, { useValue: instance }); }; InternalDependencyContainer.prototype.registerSingleton = function (from, to) { if (isNormalToken(from)) { if (isNormalToken(to)) { return this.register(from, { useToken: to }, { lifecycle: Lifecycle$1.Singleton }); } else if (to) { return this.register(from, { useClass: to }, { lifecycle: Lifecycle$1.Singleton }); } throw new Error(‘Cannot register a type name as a singleton without a “to” token’); } var useClass = from; if (to && !isNormalToken(to)) { useClass = to; } return this.register(from, { useClass: useClass }, { lifecycle: Lifecycle$1.Singleton }); }; InternalDependencyContainer.prototype.resolve = function (token, context) { if (context === void 0) { context = new ResolutionContext(); } var registration = this.getRegistration(token); if (!registration && isNormalToken(token)) { throw new Error(“Attempted to resolve unregistered dependency token: “” + token.toString() + “””); } this.executePreResolutionInterceptor(token, “Single”); if (registration) { var result = this.resolveRegistration(registration, context); this.executePostResolutionInterceptor(token, result, “Single”); return result; } if (isConstructorToken(token)) { var result = this.construct(token, context); this.executePostResolutionInterceptor(token, result, “Single”); return result; } throw new Error(“Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.”); }; InternalDependencyContainer.prototype.executePreResolutionInterceptor = function (token, resolutionType) { var e_1, _a; if (this.interceptors.preResolution.has(token)) { var remainingInterceptors = []; try { for (var _b = __values(this.interceptors.preResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) { var interceptor = _c.value; if (interceptor.options.frequency != “Once”) { remainingInterceptors.push(interceptor); } interceptor.callback(token, resolutionType); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_1) throw e_1.error; } } this.interceptors.preResolution.setAll(token, remainingInterceptors); } }; InternalDependencyContainer.prototype.executePostResolutionInterceptor = function (token, result, resolutionType) { var e_2, _a; if (this.interceptors.postResolution.has(token)) { var remainingInterceptors = []; try { for (var _b = __values(this.interceptors.postResolution.getAll(token)), _c = _b.next(); !_c.done; _c = _b.next()) { var interceptor = _c.value; if (interceptor.options.frequency != “Once”) { remainingInterceptors.push(interceptor); } interceptor.callback(token, result, resolutionType); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_2) throw e_2.error; } } this.interceptors.postResolution.setAll(token, remainingInterceptors); } }; InternalDependencyContainer.prototype.resolveRegistration = function (registration, context) { if (registration.options.lifecycle === Lifecycle$1.ResolutionScoped && context.scopedResolutions.has(registration)) { return context.scopedResolutions.get(registration); } var isSingleton = registration.options.lifecycle === Lifecycle$1.Singleton; var isContainerScoped = registration.options.lifecycle === Lifecycle$1.ContainerScoped; var returnInstance = isSingleton || isContainerScoped; var resolved; if (isValueProvider(registration.provider)) { resolved = registration.provider.useValue; } else if (isTokenProvider(registration.provider)) { resolved = returnInstance ? registration.instance || (registration.instance = this.resolve(registration.provider.useToken, context)) : this.resolve(registration.provider.useToken, context); } else if (isClassProvider(registration.provider)) { resolved = returnInstance ? registration.instance || (registration.instance = this.construct(registration.provider.useClass, context)) : this.construct(registration.provider.useClass, context); } else if (isFactoryProvider(registration.provider)) { resolved = registration.provider.useFactory(this); } else { resolved = this.construct(registration.provider, context); } if (registration.options.lifecycle === Lifecycle$1.ResolutionScoped) { context.scopedResolutions.set(registration, resolved); } return resolved; }; InternalDependencyContainer.prototype.resolveAll = function (token, context) { var _this = this; if (context === void 0) { context = new ResolutionContext(); } var registrations = this.getAllRegistrations(token); if (!registrations && isNormalToken(token)) { throw new Error(“Attempted to resolve unregistered dependency token: “” + token.toString() + “””); } this.executePreResolutionInterceptor(token, “All”); if (registrations) { var result_1 = registrations.map(function (item) { return _this.resolveRegistration(item, context); }); this.executePostResolutionInterceptor(token, result_1, “All”); return result_1; } var result = [this.construct(token, context)]; this.executePostResolutionInterceptor(token, result, “All”); return result; }; InternalDependencyContainer.prototype.isRegistered = function (token, recursive) { if (recursive === void 0) { recursive = false; } return (this._registry.has(token) || (recursive && (this.parent || false) && this.parent.isRegistered(token, true))); }; InternalDependencyContainer.prototype.reset = function () { this._registry.clear(); this.interceptors.preResolution.clear(); this.interceptors.postResolution.clear(); }; InternalDependencyContainer.prototype.clearInstances = function () { var e_3, _a; try { for (var _b = __values(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { var _d = __read(_c.value, 2), token = _d[0], registrations = _d[1]; this._registry.setAll(token, registrations .filter(function (registration) { return !isValueProvider(registration.provider); }) .map(function (registration) { registration.instance = undefined; return registration; })); } } catch (e_3_1) { e_3 = { error: e_3_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_3) throw e_3.error; } } }; InternalDependencyContainer.prototype.createChildContainer = function () { var e_4, _a; var childContainer = new InternalDependencyContainer(this); try { for (var _b = __values(this._registry.entries()), _c = _b.next(); !_c.done; _c = _b.next()) { var _d = __read(_c.value, 2), token = _d[0], registrations = _d[1]; if (registrations.some(function (_a) { var options = _a.options; return options.lifecycle === Lifecycle$1.ContainerScoped; })) { childContainer._registry.setAll(token, registrations.map(function (registration) { if (registration.options.lifecycle === Lifecycle$1.ContainerScoped) { return { provider: registration.provider, options: registration.options }; } return registration; })); } } } catch (e_4_1) { e_4 = { error: e_4_1 }; } finally { try { if (_c && !_c.done && (_a = _b.return)) _a.call(_b); } finally { if (e_4) throw e_4.error; } } return childContainer; }; InternalDependencyContainer.prototype.beforeResolution = function (token, callback, options) { if (options === void 0) { options = { frequency: “Always” }; } this.interceptors.preResolution.set(token, { callback: callback, options: options }); }; InternalDependencyContainer.prototype.afterResolution = function (token, callback, options) { if (options === void 0) { options = { frequency: “Always” }; } this.interceptors.postResolution.set(token, { callback: callback, options: options }); }; InternalDependencyContainer.prototype.getRegistration = function (token) { if (this.isRegistered(token)) { return this._registry.get(token); } if (this.parent) { return this.parent.getRegistration(token); } return null; }; InternalDependencyContainer.prototype.getAllRegistrations = function (token) { if (this.isRegistered(token)) { return this._registry.getAll(token); } if (this.parent) { return this.parent.getAllRegistrations(token); } return null; }; InternalDependencyContainer.prototype.construct = function (ctor, context) { var _this = this; if (ctor instanceof DelayedConstructor) { return ctor.createProxy(function (target) { return _this.resolve(target, context); }); } var paramInfo = typeInfo.get(ctor); if (!paramInfo || paramInfo.length === 0) { if (ctor.length === 0) { return new ctor(); } else { throw new Error(“TypeInfo not known for “” + ctor.name + “””); } } var params = paramInfo.map(this.resolveParams(context, ctor)); return new (ctor.bind.apply(ctor, __spread([void 0], params)))(); }; InternalDependencyContainer.prototype.resolveParams = function (context, ctor) { var _this = this; return function (param, idx) { var _a, _b, _c; try { if (isTokenDescriptor(param)) { if (isTransformDescriptor(param)) { return param.multiple ? (_a = _this.resolve(param.transform)).transform.apply(_a, __spread([_this.resolveAll(param.token)], param.transformArgs)) : (_b = _this.resolve(param.transform)).transform.apply(_b, __spread([_this.resolve(param.token, context)], param.transformArgs)); } else { return param.multiple ? _this.resolveAll(param.token) : _this.resolve(param.token, context); } } else if (isTransformDescriptor(param)) { return (_c = _this.resolve(param.transform, context)).transform.apply(_c, __spread([_this.resolve(param.token, context)], param.transformArgs)); } return _this.resolve(param, context); } catch (e) { throw new Error(formatErrorCtor(ctor, idx, e)); } }; }; return InternalDependencyContainer; }()); new InternalDependencyContainer(); function injectable() { return function (target) { typeInfo.set(target, getParamInfo(target)); }; } if (typeof Reflect === “undefined” || !Reflect.getMetadata) { throw new Error(“tsyringe requires a reflect polyfill. Please add ‘import “reflect-metadata”‘ to the top of your entry point.”); } var Emitter = (function () { function Emitter() { this._listeners = new Set(); this._emitted = 0; } Emitter.prototype.on = function (listener) { var _this = this; this._listeners.add(listener); return function () { _this.off(listener); }; }; Emitter.prototype.off = function (listener) { this._listeners.delete(listener); }; Emitter.prototype.once = function () { var _this = this; return new Promise(function (resolve) { var off = _this.on(function () { var args = []; for (var _i = 0; _i < arguments.length; _i++) { args[_i] = arguments[_i]; } off(); return resolve(args); }); }); }; Emitter.prototype.emit = function (value) { return __awaiter(this, void 0, void 0, function () { var _this = this; return __generator(this, function (_a) { return [2 , Promise.all(__spread$1(this._listeners).map(function (listener) { return listener(value); })).then(function (result) { _this._emitted++; return result; })]; }); }); }; Emitter.prototype.clear = function () { this._listeners.clear(); }; Object.defineProperty(Emitter.prototype, "count", { get: function () { return this._listeners.size; }, enumerable: false, configurable: true }); Object.defineProperty(Emitter.prototype, "emitted", { get: function () { return this._emitted; }, enumerable: false, configurable: true }); return Emitter; }()); var Logger = (function () { function Logger() { this.sending = new Emitter(); this.logQueue = []; this.supressedEventLogNames = new Map([['SlotRenderEnded', 'adImpression']]); this.disableLogging = false; this.queueLogs = false; } Logger.prototype.init = function (adthrive) { this.logFilter = adthrive.loggerFilters || []; this.siteId = adthrive.siteAds.siteId; this.siteName = adthrive.siteAds.siteName; this.bucket = adthrive.bucket; this.branch = adthrive.branch; this.deployment = adthrive.deployment; this.debug = adthrive.debug; }; Logger.prototype.log = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.log, className, methodName], args)); }; Logger.prototype.info = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.info, className, methodName], args)); }; Logger.prototype.warn = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.warn, className, methodName], args)); }; Logger.prototype.error = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.error, className, methodName], args)); this.makeRequest.apply(this, __spread$1(['send', 'error', className, methodName], args)).catch(function (err) { console.error(err); }); }; Logger.prototype.event = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } var shouldLog = this.debug || !this.supressedEventLogNames.has(className) || this.supressedEventLogNames.get(className) !== methodName; if (shouldLog) { this.call.apply(this, __spread$1([console.log, className, methodName], args)); } this.makeRequest.apply(this, __spread$1(['send', 'event', className, methodName], args)).catch(function (err) { console.error(err); }); }; Logger.prototype.fetchEvent = function (className, methodName) { var args = []; for (var _i = 2; _i < arguments.length; _i++) { args[_i - 2] = arguments[_i]; } this.call.apply(this, __spread$1([console.log, className, methodName], args)); this.makeRequest.apply(this, __spread$1(['fetch', 'event', className, methodName], args)).catch(function (err) { console.error(err); }); }; Logger.prototype.call = function (logFunction, className, methodName) { var args = []; for (var _i = 3; _i -1) { return; } var message = ["%c" + className + "::" + methodName + " "]; var params = ['color: #999; font-weight: bold;']; if (args.length > 0 && typeof args[0] === ‘string’) { message.push(args.shift()); } params.push.apply(params, __spread$1(args)); try { Function.prototype.apply.call(logFunction, console, __spread$1([message.join(”)], params)); } catch (err) { console.error(err); return; } }; Logger.prototype.buildRequestUrl = function (type, className, methodName, args) { var baseUrl = “https://logger.adthrive.com/” + type; var message = [className + “::” + methodName + ” “]; if (args.length > 0 && typeof args[0] === ‘string’) { message.push(args.shift()); } var body = args.map(function (arg) { if (arg && arg.error) { arg = arg.error; } if (arg instanceof Error) { arg = { name: arg.name, message: arg.message, stack: arg.stack, }; } return arg; }); if (this.data) { body.push(this.data); } var payload = [ “siteId=” + encodeURIComponent(this.siteId || ”), “siteName=” + encodeURIComponent(this.siteName || ”), “bucket=” + encodeURIComponent(this.bucket || ”), “branch=” + encodeURIComponent(this.branch || ”), “deployment=” + encodeURIComponent(this.deployment || ”), “message=” + encodeURIComponent(message.join(”).trim()), “pageurl=” + encodeURIComponent(window.location.origin + window.location.pathname), “body=” + encodeURIComponent(JSON.stringify(body)), ]; return baseUrl + “?” + payload.join(‘&’); }; Logger.prototype.clearLogQueue = function (sendLogs) { var _this = this; this.info(‘Logger’, ‘gdprEnforcement’, ‘clearLogQueue’, sendLogs); if (sendLogs) { this.logQueue.forEach(function (log) { if (log.action === ‘send’) { _this.sendRequest.apply(_this, __spread$1([log.type, log.className, log.methodName], log.args)).catch(function () { }); } if (log.action === ‘fetch’) { _this.fetchRequest.apply(_this, __spread$1([log.type, log.className, log.methodName], log.args)).catch(function () { }); } }); } this.logQueue = []; this.queueLogs = false; }; Logger.prototype.makeRequest = function (action, type, className, methodName) { var args = []; for (var _i = 4; _i < arguments.length; _i++) { args[_i - 4] = arguments[_i]; } return __awaiter(this, void 0, void 0, function () { var log; return __generator(this, function (_a) { if (this.disableLogging) { this.info('Logger', 'gdprEnforcement', 'logging disabled'); return [2 , Promise.resolve(false)]; } if (this.queueLogs) { log = { action: action, type: type, className: className, methodName: methodName, args: args }; this.logQueue.push(log); this.info('Logger', 'gdprEnforcement', 'log queued'); return [2 , Promise.resolve(true)]; } if (action === 'send') { return [2 , this.sendRequest.apply(this, __spread$1([type, className, methodName], args))]; } else { return [2 , this.fetchRequest.apply(this, __spread$1([type, className, methodName], args))]; } }); }); }; Logger.prototype.sendRequest = function (type, className, methodName) { var args = []; for (var _i = 3; _i maxCloudFrontUrlSize) { return [2 , this.sendRequest(type, className, methodName, 'Error query too large').catch(function (err) { console.error(err); })]; } return [2 , new Promise(function (resolve, reject) { var request = new XMLHttpRequest(); request.open('get', requestUrl); request.addEventListener('load', function () { if (request.status !== 200) { return reject(new Error("Logger send request failed " + request.status)); } return resolve(request.responseText); }); request.addEventListener('error', function () { return reject(new Error('Logger send request failed')); }); request.send(); })]; }); }); }; Logger.prototype.fetchRequest = function (type, className, methodName) { var args = []; for (var _i = 3; _i < arguments.length; _i++) { args[_i - 3] = arguments[_i]; } return __awaiter(this, void 0, void 0, function () { var requestUrl; return __generator(this, function (_a) { this.sending.emit().catch(function () { }); requestUrl = this.buildRequestUrl(type, className, methodName, args); return [2 , fetch(requestUrl, { method: 'GET', keepalive: true, referrerPolicy: 'no-referrer-when-downgrade' })]; }); }); }; Logger = __decorate([ injectable() ], Logger); return Logger; }()); var logger = new Logger(); var addBodyClass = function (device) { var body = document.body; var className = "adthrive-device-" + device; if (!body.classList.contains(className)) { try { body.classList.add(className); } catch (err) { logger.error('BodyDeviceClassComponent', 'init', { message: err.message }); var support = 'classList' in document.createElement('_'); logger.error('BodyDeviceClassComponent', 'init.support', { support: support }); } } }; var DensityDevice; (function (DensityDevice) { DensityDevice["Desktop"] = "desktop"; DensityDevice["Mobile"] = "mobile"; })(DensityDevice || (DensityDevice = {})); var RemoveLargeSizeExperiment = (function (_super) { __extends$1(RemoveLargeSizeExperiment, _super); function RemoveLargeSizeExperiment() { var _this = _super.call(this) || this; _this._result = false; _this._choices = [{ choice: true }, { choice: false }]; _this.key = 'smhd100'; _this._result = _this.run(); _this.setExperimentKey(); logger$1.info('CLSRemoveLargeSizeExperiment', 'result', _this._result); return _this; } Object.defineProperty(RemoveLargeSizeExperiment.prototype, "result", { get: function () { return this._result; }, enumerable: false, configurable: true }); RemoveLargeSizeExperiment.prototype.run = function () { return new BernoulliTrial(0.1).get(); }; return RemoveLargeSizeExperiment; }(PluginExperiment)); var supportedSizes = [ [728, 90], [300, 250], [300, 600], [320, 50], [970, 250], [160, 600], [300, 1050], [336, 280], [970, 90], [300, 50], [320, 100], [468, 60], [250, 250], [120, 240], [1, 1], [300, 300], [552, 334], [300, 420], [728, 250], [320, 300], [300, 390], ]; var adUnitAuctionPriorityMap = new Map([ ['Footer', 1], ['Header', 2], ['Sidebar', 3], ['Content', 4], ['Recipe', 5], ['Sidebar_sticky', 6], ['Below Post', 7], ]); var getDynamicAds = function (device, adUnits) { var removeLargeSizeExperiment = new RemoveLargeSizeExperiment(); return adUnits .filter(function (adUnit) { return adUnit.dynamic !== undefined && adUnit.dynamic.enabled; }) .map(function (adUnit) { var location = adUnit.location.replace(/s+/g, '_'); return { auctionPriority: adUnitAuctionPriorityMap.get(location) || 8, location: location, sequence: defaultTo(adUnit.sequence, 1), sizes: onlySupportedAdSizes(adUnit.adSizes).filter(function (size) { return excludeTallSizeFromHeaderFooter(adUnit.location, size, device, removeLargeSizeExperiment); }), devices: adUnit.devices, pageSelector: defaultTo(adUnit.dynamic.pageSelector, '').trim(), elementSelector: defaultTo(adUnit.dynamic.elementSelector, '').trim(), position: defaultTo(adUnit.dynamic.position, 'beforebegin'), min: Math.floor(defaultTo(adUnit.dynamic.min, 0)), max: Math.floor(defaultTo(adUnit.dynamic.max, 0)), spacing: defaultTo(adUnit.dynamic.spacing, 0), skip: Math.floor(defaultTo(adUnit.dynamic.skip, 0)), every: Math.max(Math.floor(defaultTo(adUnit.dynamic.every, 1)), 1), classNames: adUnit.dynamic.classNames || [], sticky: adUnit.location === 'Footer' ? true : adUnit.sticky, stickyOverlapSelector: defaultTo(adUnit.stickyOverlapSelector, '').trim(), autosize: adUnit.autosize, special: defaultTo(adUnit.targeting, []) .filter(function (targeting) { return targeting.key === 'special'; }) .reduce(function (values, targeting) { return values.concat.apply(values, __spread$1(targeting.value)); }, []), lazy: defaultTo(adUnit.dynamic.lazy, false), lazyMax: defaultTo(adUnit.dynamic.lazyMax, 2), lazyMaxDefaulted: adUnit.dynamic.lazyMax === 0 ? false : !adUnit.dynamic.lazyMax, }; }); }; var filterAdUnitSizes = function (dynamicAd, element) { var width = elementInnerWidth(element); var stickySidebar = dynamicAd.sticky && dynamicAd.location === 'Sidebar'; return dynamicAd.sizes.filter(function (size) { var autosize = dynamicAd.autosize ? size[0] <= width || size[0] <= 320 : true; var stickyFit = stickySidebar ? size[1] 100 && removeLargeSizeExperiment.result)); }; var slotMinHeight = '250px'; var ClsDynamicAdsInjector = (function () { function ClsDynamicAdsInjector(_clsOptions, targetDensityExperiment) { this._clsOptions = _clsOptions; this.targetDensityExperiment = targetDensityExperiment; this._totalContentInserted = 0; this._recipeCount = 0; this._mainContentHeight = 0; this._mainContentDiv = null; this._firstContentDiv = null; this._totalAvailableElements = 0; this._minDivHeight = 250; this._densityDevice = DensityDevice.Desktop; this._pubLog = { onePerViewport: false, targetDensity: 0, targetDensityUnits: 0, combinedMax: 0 }; this._densityMax = 0.99; this._infPageEndOffset = 0; this.locationMaxLazySequence = new Map([ ['Recipe', 5], ['Below_Post', 1], ]); this.locationToMinHeight = { Below_Post: slotMinHeight, Content: slotMinHeight, Recipe: slotMinHeight, Sidebar: slotMinHeight, }; var _a = this._clsOptions.siteAds.breakpoints, tablet = _a.tablet, desktop = _a.desktop; this._device = deviceByBreakpoint(tablet, desktop); this._config = new Config(_clsOptions); this._clsOptions.enabledLocations = this._config.enabledLocations; } ClsDynamicAdsInjector.prototype.start = function () { var _this = this; try { addBodyClass(this._device); var dynamicAds = getDynamicAds(this._device, this._clsOptions.siteAds.adUnits) .filter(function (dynamicAd) { return _this._locationEnabled(dynamicAd); }) .filter(function (dynamicAd) { return forDevice(dynamicAd, _this._device); }) .filter(function (dynamicAd) { return forPage(dynamicAd); }); var dynamicSlots = this.inject(dynamicAds); dynamicSlots.forEach(function (slot) { return _this._clsOptions.setInjectedSlots(slot); }); } catch (error) { logger$1.error('ClsDynamicAdsInjector', 'start', error); } }; ClsDynamicAdsInjector.prototype.inject = function (dynamicAds, target) { if (target === void 0) { target = document; } var targetDensityEnabled = this.targetDensityExperiment.result; var nonDensitySlots = dynamicAds.filter(function (dynamicAd) { return (targetDensityEnabled ? dynamicAd.location !== 'Content' : dynamicAd); }); var densitySlots = dynamicAds.filter(function (dynamicAd) { return (targetDensityEnabled ? dynamicAd.location === 'Content' : null); }); return __spread$1((nonDensitySlots.length ? this._injectNonDensitySlots(nonDensitySlots, target) : []), (densitySlots.length ? this._injectDensitySlots(densitySlots, target) : [])); }; ClsDynamicAdsInjector.prototype._injectNonDensitySlots = function (dynamicAds, target) { var e_1, _a; var _this = this; if (target === void 0) { target = document; } var slots = []; var insertedElements = []; try { for (var dynamicAds_1 = __values$1(dynamicAds), dynamicAds_1_1 = dynamicAds_1.next(); !dynamicAds_1_1.done; dynamicAds_1_1 = dynamicAds_1.next()) { var dynamicAd = dynamicAds_1_1.value; var spacing = 0; var nextAfter = 0; var totalAds = 0; if (dynamicAd.spacing > 0) { spacing = window.innerHeight * dynamicAd.spacing; nextAfter = spacing; } var repeatedDynamicAds = this._repeatDynamicAds(dynamicAd); var elements = this.getElements(dynamicAd.elementSelector, target); logger$1.info(‘ClsDynamicAdsInjector’, ‘injectNonDensitySlots’, dynamicAd.location + ” – Found ” + elements.length + ” elements for selector ” + dynamicAd.pageSelector + ” ” + dynamicAd.elementSelector, dynamicAd); if (dynamicAd.skip > 0) { logger$1.info(‘ClsDynamicAdsInjector’, ‘injectNonDensitySlots’, ‘Skipping %d element(s)’, dynamicAd.skip); } for (var elementIndex = dynamicAd.skip; elementIndex repeatedDynamicAds.length) { logger$1.info(‘ClsDynamicAdsInjector’, ‘injectNonDensitySlots’, ‘Max ads displayed %d’, totalAds); break; } var element = elements[elementIndex]; if (spacing > 0) { var bottom = elementOffset(element).bottom; if (bottom %d)’, bottom, nextAfter); nextAfter = bottom + spacing; } var min = elementIndex 1) { logger$1.info(‘ClsDynamicAdsInjector’, ‘injectNonDensitySlots’, ‘Attempting to add %d extra to satisfy the minimum’, min – 1); spacing = 0; } var _loop_1 = function () { var repeatedDynamicAd = repeatedDynamicAds[totalAds]; var name_1 = repeatedDynamicAd.location + “_” + repeatedDynamicAd.sequence; if (slots.some(function (slot) { return slot.name === name_1; })) { totalAds += 1; logger$1.warn(‘ClsDynamicAdsInjector’, ‘injectNonDensitySlots’, “Skipping duplicate slot ” + name_1); return “continue”; } var dynamicElementId = this_1.getDynamicElementId(repeatedDynamicAd); var locationClassName = “adthrive-” + dynamicAd.location.replace(‘_’, ‘-‘).toLowerCase(); var locationSequenceClassName = locationClassName + “-” + dynamicAd.sequence; var classNames = __spread$1([locationClassName, locationSequenceClassName], dynamicAd.classNames); var dynamicElement = this_1.addAd(element, dynamicElementId, dynamicAd.position, classNames); if (dynamicElement) { var sizes = filterAdUnitSizes(repeatedDynamicAd, dynamicElement); if (sizes.length) { var slotDataObj = { clsDynamicAd: dynamicAd, dynamicAd: repeatedDynamicAd, element: dynamicElement, sizes: sizes, name: name_1, infinite: target !== document, }; slots.push(slotDataObj); insertedElements.push({ location: repeatedDynamicAd.location, element: dynamicElement }); if (dynamicAd.location === ‘Recipe’) { ++this_1._recipeCount; } totalAds += 1; } else { logger$1.info(‘ClsDynamicAdsInjector’, ‘injectNonDensitySlots’, “Skipped ad unit ” + repeatedDynamicAd.location + “_” + repeatedDynamicAd.sequence + “. It does not fit in the element.”); } element = dynamicElement; } }; var this_1 = this; for (; min > 0; min–) { _loop_1(); } } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (dynamicAds_1_1 && !dynamicAds_1_1.done && (_a = dynamicAds_1.return)) _a.call(dynamicAds_1); } finally { if (e_1) throw e_1.error; } } insertedElements.forEach(function (_a) { var location = _a.location, element = _a.element; element.style.minHeight = _this.locationToMinHeight[location]; }); return slots; }; ClsDynamicAdsInjector.prototype._shouldTargetAllElgibile = function (density) { return density === this._densityMax; }; ClsDynamicAdsInjector.prototype._injectDensitySlots = function (dynamicAds, target) { var e_2, _a; var _this = this; if (target === void 0) { target = document; } try { this._calculateMainContentHeightAndAllElements(dynamicAds); } catch (e) { logger$1.warn(‘ClsDynamicAdsInjector’, ‘injectDensitySlots’, e); return []; } this._densityDevice = this._device === ‘desktop’ ? DensityDevice.Desktop : DensityDevice.Mobile; var slots = []; var _b = this._getDensitySettings(), targetDensity = _b.adDensity, onePerViewport = _b.onePerViewport; var targetAll = this._shouldTargetAllElgibile(targetDensity); var targetDensityUnits = this._getTargetDensityUnits(targetDensity); var combinedMax = this._getCombinedMax(dynamicAds); var numberOfUnits = Math.min.apply(Math, __spread$1([this._totalAvailableElements, targetDensityUnits], (combinedMax > 0 ? [combinedMax] : []))); this._pubLog = { onePerViewport: onePerViewport, targetDensity: targetDensity, targetDensityUnits: targetDensityUnits, combinedMax: combinedMax }; if (!numberOfUnits) { logger$1.warn(‘ClsDynamicAdsInjector’, ‘injectDensitySlots’, ‘No Content Units To Inject’, __assign(__assign({}, this._pubLog), { mainContentDiv: this._mainContentDiv, mainContentHeight: this._mainContentHeight, totalAvailableElements: this._totalAvailableElements })); return []; } var contentInsertedThisPage = 0; var insertNext = 0; var _loop_2 = function (dynamicAd) { var elements = this_2.getElements(dynamicAd.elementSelector, target); var insertEvery = this_2._getInsertEvery(numberOfUnits, onePerViewport); this_2._logDensityInfo(elements, dynamicAd.elementSelector, insertEvery); var dynamicInsertion = function (element) { var _a; var slot = null; var adElement = null; (_a = _this._attemptInsertion({ dynamicAd: dynamicAd, element: element, insertNext: insertNext, onePerViewport: onePerViewport, contentInsertedThisPage: contentInsertedThisPage, target: target, insertEvery: insertEvery, targetAll: targetAll, }), insertNext = _a.insertNext, slot = _a.slot, adElement = _a.adElement); if (slot && adElement) { slots.push(slot); ++contentInsertedThisPage; adElement.style.minHeight = _this.locationToMinHeight[dynamicAd.location]; } }; if (dynamicAd.skip > 0) { logger$1.info(‘ClsDynamicAdsInjector’, ‘_injectDensitySlots’, ‘Skipping %d element(s)’, dynamicAd.skip); } for (var t = dynamicAd.skip; t = this_2._mainContentHeight && this_2._totalAvailableElements > 1) { continue; } else if (contentInsertedThisPage < combinedMax && contentInsertedThisPage = Number of Units to Inject, breaking'); break; } } }; var this_2 = this; try { for (var dynamicAds_2 = __values$1(dynamicAds), dynamicAds_2_1 = dynamicAds_2.next(); !dynamicAds_2_1.done; dynamicAds_2_1 = dynamicAds_2.next()) { var dynamicAd = dynamicAds_2_1.value; _loop_2(dynamicAd); } } catch (e_2_1) { e_2 = { error: e_2_1 }; } finally { try { if (dynamicAds_2_1 && !dynamicAds_2_1.done && (_a = dynamicAds_2.return)) _a.call(dynamicAds_2); } finally { if (e_2) throw e_2.error; } } logger$1.info('ClsDynamicAdsInjector', '_injectDensitySlots', 'Ad Density: contentInsertedThisPage', contentInsertedThisPage); return slots; }; ClsDynamicAdsInjector.prototype._getInsertEvery = function (numberOfUnits, onePerViewport) { var trimContentFraction = 0.43; var insert = (this._mainContentHeight * trimContentFraction) / numberOfUnits; return onePerViewport && window.innerHeight > insert ? window.innerHeight : insert; }; ClsDynamicAdsInjector.prototype._getDensitySettings = function () { var densitySettings = this._clsOptions.siteAds.adDensityLayout; var overrides = this._determineOverrides(densitySettings.pageOverrides); return overrides.length ? overrides[0] : densitySettings[this._densityDevice]; }; ClsDynamicAdsInjector.prototype._determineOverrides = function (pageOverrides) { var _this = this; return pageOverrides .filter(function (pageOverride) { var selector = allowablePageSelector(pageOverride.pageSelector); return pageOverride.pageSelector === ” || (selector.elements && selector.elements.length); }) .map(function (pageOverride) { return pageOverride[_this._densityDevice]; }); }; ClsDynamicAdsInjector.prototype._getTargetDensityUnits = function (targetDensity) { return Math.floor((targetDensity * this._mainContentHeight) / (1 – targetDensity) / this._minDivHeight) – this._recipeCount; }; ClsDynamicAdsInjector.prototype._getCombinedMax = function (dynamicAds) { return defaultTo(dynamicAds .filter(function (dynamicAd) { var el; try { el = document.querySelector(dynamicAd.elementSelector); } catch (err) { logger$1.info(‘ClsDynamicAdsInjector’, ‘_getCombinedMax’, ‘Invalid Query Selector: ‘, dynamicAd.elementSelector); } return el; }) .map(function (dynamicAd) { return dynamicAd.max + (dynamicAd.lazyMaxDefaulted ? 0 : dynamicAd.lazyMax); }) .sort(function (a, b) { return b – a; })[0], 0); }; ClsDynamicAdsInjector.prototype._logDensityInfo = function (elements, elementSelector, insertEvery) { var _a = this._pubLog, onePerViewport = _a.onePerViewport, targetDensity = _a.targetDensity, targetDensityUnits = _a.targetDensityUnits, combinedMax = _a.combinedMax; logger$1.info(‘ClsDynamicAdsInjector’, ‘_logDensityInfo’, ‘Ad Density: Top Level Report’, “nOnePerViewport: ” + onePerViewport, “nTarget Density: ” + targetDensity, “nMain Content Height ” + this._mainContentHeight + “px”, “nRecipe Units: ” + this._recipeCount, “nAvailable Elements based on Selectors: ” + elements.length, “nNumber of Units to Hit Density: ” + targetDensityUnits, “nNumber of pixels between each ad (relevant for onePerViewport setting): ” + insertEvery + “px”, “nCombined max calculated from Admin Dash: ” + combinedMax, ‘nElement Selector: ‘, elementSelector, ‘nActual elements we are working with: ‘, elements); if (this._totalAvailableElements = Math.max(dynamicAd.min, dynamicAd.max) }); (_b = this._addContentAd(element, dynamicAd, newDynamicAd, target, insertEvery), slot = _b.insertedSlot, insertNext = _b.insertNext, adElement = _b.adElement); } return { insertNext: insertNext, slot: slot, adElement: adElement }; }; ClsDynamicAdsInjector.prototype._isElementSpacedCorrectly = function (element, insertNext, onePerViewport, dynamicAd, targetAll, insertEvery) { var shouldInsertAtTop = dynamicAd.position === ‘beforebegin’ || dynamicAd.position === ‘afterbegin’; var isFarEnoughFromPreviousInjection = targetAll || this._isElementFarEnough(onePerViewport, element, insertNext, shouldInsertAtTop, insertEvery); var isNotInSameRowAsNextElement = this._isElementNotInRow(element, shouldInsertAtTop); var isElementSpacedCorrectly = isFarEnoughFromPreviousInjection && isNotInSameRowAsNextElement; if (isElementSpacedCorrectly) { this._lastElement = element; this._lastAdPosition = dynamicAd.position === ‘beforebegin’ || dynamicAd.position === ‘afterbegin’ ? ‘top’ : ‘bottom’; } logger$1.info(‘ClsDynamicAdsInjector’, ‘_isElementSpacedCorrectly’, ‘Ad Density: _isElementSpacedCorrectly’, element, isElementSpacedCorrectly); return isElementSpacedCorrectly; }; ClsDynamicAdsInjector.prototype._getMinimumSpacingByLastInjection = function (insertEvery) { return this._lastAdPosition && this._lastAdPosition === ‘bottom’ && insertEvery insertNext && (lastOffset === 0 || elementEdge – lastOffset >= insertEvery + spacing); if (!onePerViewport && !isFarEnough) { logger$1.info(‘ClsDynamicAdsInjector’, ‘_isElementFarEnough’, “Ad Density: The onePerViewport setting is false, and the element edge at ” + elementEdge + “px is less than our next minimum insertion point located at ” + insertNext + “.”, element); } return isFarEnough; }; ClsDynamicAdsInjector.prototype._isElementNotInRow = function (element, shouldInsertAtTop) { var prevSibling = element.previousElementSibling; var nextSibling = element.nextElementSibling; var sibling = shouldInsertAtTop ? (!prevSibling && nextSibling) || (prevSibling && element.tagName !== prevSibling.tagName) ? nextSibling : prevSibling : nextSibling; return sibling && element.getBoundingClientRect().height === 0 ? true : sibling ? element.getBoundingClientRect().top !== sibling.getBoundingClientRect().top : true; }; ClsDynamicAdsInjector.prototype._calculateMainContentHeightAndAllElements = function (dynamicAds) { var _a = this._setMainContentAndElements(dynamicAds), mainContentDiv = _a.mainContentDiv, firstContentDiv = _a.firstContentDiv; this._mainContentDiv = mainContentDiv; this._firstContentDiv = firstContentDiv; var commentElem = this._mainContentDiv.querySelector(‘div #comments, section .comments’); this._mainContentHeight = commentElem ? this._mainContentDiv.offsetHeight – commentElem.offsetHeight : this._mainContentDiv.offsetHeight; }; ClsDynamicAdsInjector.prototype._setMainContentAndElements = function (dynamicAds) { var potentialMainContentElements = this._getPotentialElements(dynamicAds); if (potentialMainContentElements.length === 0) { throw Error(‘No Main Content Elements Found’); } var mainContentDiv = Array.from(potentialMainContentElements).reduce(function (previous, current) { return (current.offsetHeight > previous.offsetHeight ? current : previous); }) || document.body; var firstContentDiv = Array.from(potentialMainContentElements).reduce(function (previous, current) { return elementOffset(current).top < elementOffset(previous).top ? current : previous; }); return { mainContentDiv: mainContentDiv, firstContentDiv: firstContentDiv }; }; ClsDynamicAdsInjector.prototype._getPotentialElements = function (dynamicAds) { var _this = this; var article = this._attemptArticleLookup(); var potentialMainContentElements = article ? [article] : []; dynamicAds.forEach(function (dynamicAd) { return _this._getSelectors(dynamicAd.elementSelector).forEach(function (selector) { var els = document.querySelectorAll(selector); for (var k = 0; k previous.offsetHeight ? current : previous); }); var oneAndAHalfViewports = 1.5; if (content && content.offsetHeight > window.innerHeight * oneAndAHalfViewports) { logger$1.info(‘ClsDynamicAdsInjector’, ‘_attemptArticleLookup’, ‘mainContent’, content.offsetHeight, content); return content; } return null; }; ClsDynamicAdsInjector.prototype._getSelectors = function (elementSelector) { return elementSelector.indexOf(‘,’) > -1 ? elementSelector.split(‘,’) : [elementSelector]; }; ClsDynamicAdsInjector.prototype._addContentAd = function (element, dynamicAd, newDynamicAd, target, insertEvery) { if (target === void 0) { target = document; } var insertedSlot = null; var locationClassName = “adthrive-” + dynamicAd.location.replace(‘_’, ‘-‘).toLowerCase(); var locationSequenceClassName = locationClassName + “-” + dynamicAd.sequence; var adElement = this.addAd(element, this.getDynamicElementId(newDynamicAd), newDynamicAd.position, __spread$1([ locationClassName, locationSequenceClassName ], dynamicAd.classNames)); var insertNext = this._getNextInsertPosition(newDynamicAd.position, adElement, insertEvery); if (adElement) { var sizes = filterAdUnitSizes(newDynamicAd, adElement); if (sizes.length) { var name_2 = newDynamicAd.location + “_” + newDynamicAd.sequence; insertedSlot = { clsDynamicAd: dynamicAd, dynamicAd: newDynamicAd, element: adElement, sizes: sizes, name: name_2, infinite: target !== document, }; ++this._totalContentInserted; } else { logger$1.info(‘ClsDynamicAdsInjector’, ‘_addContentAd’, ‘Skipped ad unit….. It does not fit in the element.’); } } return { insertedSlot: insertedSlot, insertNext: insertNext, adElement: adElement }; }; ClsDynamicAdsInjector.prototype._getNextInsertPosition = function (position, element, insertEvery) { var rect = element.getBoundingClientRect(); var pageHeight = window.pageYOffset; var pos = (position === ‘beforebegin’ || position === ‘afterbegin’ ? rect.top : rect.bottom) + pageHeight; return pos + insertEvery + this._minDivHeight; }; ClsDynamicAdsInjector.prototype.getDynamicElementId = function (dynamicAd) { var gamPrefix = ‘AdThrive’; return gamPrefix + “_” + dynamicAd.location + “_” + dynamicAd.sequence + “_” + this._device; }; ClsDynamicAdsInjector.prototype.getElements = function (selector, target) { if (target === void 0) { target = document; } return target.querySelectorAll(selector); }; ClsDynamicAdsInjector.prototype.addAd = function (element, id, position, classNames) { if (classNames === void 0) { classNames = []; } if (!document.getElementById(id)) { var tag = “”; element.insertAdjacentHTML(position, tag); } return document.getElementById(id); }; ClsDynamicAdsInjector.prototype._repeatDynamicAds = function (dynamicAd) { var repeatedDynamicAds = []; var maxLazySequence = dynamicAd.lazy ? defaultTo(this.locationMaxLazySequence.get(dynamicAd.location), 0) : 0; var initialMax = Math.max(dynamicAd.min, dynamicAd.max); var lazyMax = maxLazySequence === 0 && dynamicAd.lazy ? initialMax + dynamicAd.lazyMax : Math.min(Math.max(maxLazySequence – dynamicAd.sequence + 1, 0), initialMax + dynamicAd.lazyMax); var max = Math.max(initialMax, lazyMax); for (var dynamicSequence = 0; dynamicSequence = initialMax; repeatedDynamicAds.push(__assign(__assign({}, dynamicAd), { sequence: sequence, lazy: lazy })); } return repeatedDynamicAds; }; ClsDynamicAdsInjector.prototype._locationEnabled = function (dynamicAdUnit) { var clsEnabledLocation = this._clsOptions.enabledLocations.indexOf(dynamicAdUnit.location) !== -1; var allLocationsDisabled = (this._clsOptions.disableAds && this._clsOptions.disableAds.all) || document.body.classList.contains(‘adthrive-disable-all’); var contentEnabled = !document.body.classList.contains(‘adthrive-disable-content’) && !this._clsOptions.disableAds.reasons.has(‘content_plugin’); return clsEnabledLocation && !allLocationsDisabled && contentEnabled; }; return ClsDynamicAdsInjector; }()); var VideoAdUnit; (function (VideoAdUnit) { VideoAdUnit[“Video_Collapse_Autoplay_SoundOff”] = “Video_Collapse_Autoplay_SoundOff”; VideoAdUnit[“Video_Individual_Autoplay_SOff”] = “Video_Individual_Autoplay_SOff”; VideoAdUnit[“Video_Coll_SOff_Smartphone”] = “Video_Coll_SOff_Smartphone”; VideoAdUnit[“Video_In_Post_ClicktoPlay_SoundOn”] = “Video_In-Post_ClicktoPlay_SoundOn”; })(VideoAdUnit || (VideoAdUnit = {})); var PinterestReplacedPlayer; (function (PinterestReplacedPlayer) { PinterestReplacedPlayer[“StickySekindo”] = “stickySekindo”; PinterestReplacedPlayer[“StaticSekindo”] = “staticSekindo”; PinterestReplacedPlayer[“None”] = “none”; })(PinterestReplacedPlayer || (PinterestReplacedPlayer = {})); var SekindoHoldoutExperiment = (function (_super) { __extends$1(SekindoHoldoutExperiment, _super); function SekindoHoldoutExperiment() { var _this = _super.call(this) || this; _this.key = ‘sekho’; _this._result = false; _this._choices = [{ choice: true }, { choice: false }]; _this._result = _this.run(); _this.setExperimentKey(); logger$1.info(‘ClsSekindoHoldoutExperiment’, ‘result’, _this._result); return _this; } Object.defineProperty(SekindoHoldoutExperiment.prototype, “result”, { get: function () { return this._result; }, enumerable: false, configurable: true }); SekindoHoldoutExperiment.prototype.run = function () { return new BernoulliTrial(0.05).get(); }; return SekindoHoldoutExperiment; }(PluginExperiment)); var Component = (function () { function Component() { } Object.defineProperty(Component.prototype, “enabled”, { get: function () { return true; }, enumerable: false, configurable: true }); return Component; }()); var VideoBase = (function (_super) { __extends$1(VideoBase, _super); function VideoBase(_videoConfig, sekindoHoldoutExperimentResult, _component) { var _this = _super.call(this) || this; _this._videoConfig = _videoConfig; _this._component = _component; _this._stickyRelatedOnPage = false; _this._contextualMediaIds = []; var players = _this._videoConfig.players || []; _this._device = isDesktop() ? ‘desktop’ : ‘mobile’; _this._potentialPlayerMap = _this._setPotentialPlayerMap(sekindoHoldoutExperimentResult); var stationaryRelated = players.filter(function (player) { return player.type === “stationaryRelated” && player.enabled; }); _this._potentialPlayerMap.stationaryRelated = stationaryRelated; return _this; } VideoBase.prototype._setPotentialPlayerMap = function (sekindoHoldoutExperimentResult) { var _this = this; var players = this._videoConfig.players; var defaultMap = { stickyRelated: [], stickyPlaylist: [], sekindo: [], stationaryRelated: [], }; return players && players.length ? players .filter(function (player) { var _a; return ((_a = player.devices) === null || _a === void 0 ? void 0 : _a.indexOf(_this._device)) > -1; }) .reduce(function (accumulator, player) { if (!accumulator[player.type]) { logger.event(_this._component, ‘constructor’, ‘Unknown Video Player Type detected’, player.type); accumulator[player.type] = []; } if (player.enabled) { if (!sekindoHoldoutExperimentResult || player.type !== “sekindo” ) { accumulator[player.type].push(player); } } return accumulator; }, defaultMap) : defaultMap; }; VideoBase.prototype._checkPlayerSelectorOnPage = function (playerType) { var _this = this; var players = this._potentialPlayerMap[playerType].map(function (player) { return { player: player, playerElement: _this._getPlacementElement(player), }; }); if (!players.length) { return { player: null, playerElement: null }; } return players[0]; }; VideoBase.prototype._getOverrideElement = function (player, playerElement, publisherPageElement) { if (player && playerElement) { var div = document.createElement(‘div’); playerElement.insertAdjacentElement(player.position, div); publisherPageElement = div; logger.info(this._component, ‘_initializeRelatedPlayers’, ‘Changing injection element’, publisherPageElement); } else { var _a = this._checkPlayerSelectorOnPage(“stickyPlaylist” ), stickyPlaylistPlayer = _a.player, stickyPlaylistElement = _a.playerElement; if (stickyPlaylistPlayer && stickyPlaylistElement) { var div = document.createElement(‘div’); stickyPlaylistElement.insertAdjacentElement(stickyPlaylistPlayer.position, div); publisherPageElement = div; logger.info(this._component, ‘_initializeRelatedPlayers’, ‘Changing injection element’, publisherPageElement); } } return publisherPageElement; }; VideoBase.prototype._shouldOverrideElement = function (element) { var overrideEmbed = element.getAttribute(‘override-embed’); if (overrideEmbed === ‘true’ || overrideEmbed === ‘false’) { return overrideEmbed === ‘true’; } return this._videoConfig.contextualSettings ? this._videoConfig.contextualSettings.overrideEmbedLocation : false; }; VideoBase.prototype._getPlacementElement = function (settings) { var pageSelectorEl = allowablePageSelector(settings.pageSelector); var elementSelectorEl = validCssSelector(settings.elementSelector); if (!pageSelectorEl.valid) { logger.error(‘VideoUtils’, ‘getPlacementElement’, new Error(settings.pageSelector + ” is not a valid selector”)); return null; } if (settings.pageSelector && !pageSelectorEl.elements.length) { logger.error(‘VideoUtils’, ‘getPlacementElement’, new Error(“PSNF: ” + settings.pageSelector + ” does not exist on the page”)); return null; } if (!elementSelectorEl.valid) { logger.error(‘VideoUtils’, ‘getPlacementElement’, new Error(settings.elementSelector + ” is not a valid selector”)); return null; } if (elementSelectorEl.elements.length > settings.skip) { return elementSelectorEl.elements[settings.skip]; } else { logger.error(‘VideoUtils’, ‘getPlacementElement’, new Error(“ESNF: ” + settings.elementSelector + ” does not exist on the page”)); return null; } }; VideoBase.prototype._getEmbeddedPlayerType = function (element) { var embeddedPlayerType = element.getAttribute(‘data-player-type’); if (!embeddedPlayerType || embeddedPlayerType === ‘default’) { embeddedPlayerType = this._videoConfig.contextualSettings ? this._videoConfig.contextualSettings.defaultPlayerType : ‘static’; } if (this._stickyRelatedOnPage) { embeddedPlayerType = ‘static’; } return embeddedPlayerType; }; VideoBase.prototype._getUnusedMediaId = function (publisherPageElement) { var mediaId = publisherPageElement.getAttribute(‘data-video-id’); if (mediaId && this._contextualMediaIds.indexOf(mediaId) === -1) { this._contextualMediaIds.push(mediaId); return mediaId; } else { logger.info(this._component, ‘_getUnusedMediaId’, ‘No Unique MediaId’); return false; } }; VideoBase.prototype._createRelatedPlayer = function (mediaId, embeddedPlayerType, publisherPageElement) { if (embeddedPlayerType === ‘collapse’) { this._createCollapsePlayer(mediaId, publisherPageElement); } else if (embeddedPlayerType === ‘static’) { this._createStaticPlayer(mediaId, publisherPageElement); } }; VideoBase.prototype._createCollapsePlayer = function (mediaId, publisherPageElement) { var _a = this._checkPlayerSelectorOnPage(“stickyRelated” ), stickyRelatedPlayer = _a.player, stickyRelatedElement = _a.playerElement; var player = stickyRelatedPlayer ? stickyRelatedPlayer : this._potentialPlayerMap[“stationaryRelated” ][0]; if (player && player.playerId) { var shouldOverrideElement = this._shouldOverrideElement(publisherPageElement); if (shouldOverrideElement) { publisherPageElement = this._getOverrideElement(stickyRelatedPlayer, stickyRelatedElement, publisherPageElement); } publisherPageElement = document.querySelector(“#cls-video-container-” + mediaId + ” > div”) || publisherPageElement; this._createStickyRelatedPlayer(__assign(__assign({}, player), { mediaId: mediaId }), publisherPageElement); } else { logger.error(this._component, ‘_createCollapsePlayer’, ‘No video player found’); } }; VideoBase.prototype._createStaticPlayer = function (mediaId, publisherPageElement) { if (this._potentialPlayerMap[“stationaryRelated” ].length && this._potentialPlayerMap[“stationaryRelated” ][0].playerId) { var player = this._potentialPlayerMap[“stationaryRelated” ][0]; this._createStationaryRelatedPlayer(__assign(__assign({}, player), { mediaId: mediaId }), publisherPageElement); } else { logger.error(this._component, ‘_createStaticPlayer’, ‘No video player found’); } }; VideoBase.prototype._shouldRunAutoplayPlayers = function () { if (this._isVideoAllowedOnPage()) { if (this._potentialPlayerMap[“stickyRelated” ].length || this._potentialPlayerMap[“stickyPlaylist” ].length || this._potentialPlayerMap[“sekindo” ].length) { return true; } } return false; }; VideoBase.prototype._determineAutoplayPlayers = function () { var componentName = this._component; var isVideoManagerComponent = componentName === ‘VideoManagerComponent’; var config = this._config; if (this._stickyRelatedOnPage) { logger.event(componentName, ‘stickyRelatedOnPage’, (isVideoManagerComponent && { device: config && config.context.device, isDesktop: this._device, }) || {}); return; } var _a = this._checkPlayerSelectorOnPage(“stickyPlaylist” ), stickyPlaylistPlayer = _a.player, stickyPlaylistElement = _a.playerElement; var _b = this._checkPlayerSelectorOnPage(“sekindo” ), sekindoPlayer = _b.player, sekindoElement = _b.playerElement; if (stickyPlaylistPlayer && stickyPlaylistPlayer.playerId && stickyPlaylistPlayer.playlistId && stickyPlaylistElement) { this._createPlaylistPlayer(stickyPlaylistPlayer, stickyPlaylistElement); } else if (sekindoPlayer && sekindoPlayer.playlistId && sekindoElement) { this._createSekindoPlayer(sekindoPlayer, sekindoElement); } else { logger.event(componentName, ‘noStickyPlaylistOrSekindo’, (isVideoManagerComponent && { vendor: ‘none’, device: config && config.context.device, isDesktop: this._device, }) || {}); } }; VideoBase.prototype._initializeRelatedPlayers = function (publisherPageElements) { for (var t = 0; t Adding Stationary Related Player Container”); this._wrapJWPlayerWithCLS(element, player.mediaId); this._playersAddedFromPlugin.push(player.mediaId); } }; ClsVideoInsertion.prototype._createStickyRelatedPlayer = function (player, element) { this._device === ‘mobile’ ? [400, 225] : [640, 360]; VideoAdUnit.Video_Individual_Autoplay_SOff; this._stickyRelatedOnPage = true; this._videoConfig.mobileStickyPlayerOnPage = this._device === ‘mobile’; if (element && player.position && player.mediaId) { logger$1.info(‘ClsVideoInsertion’, ‘_createStickyRelatedPlayer’, “Video > Adding Sticky Related OnPage Player Container”); var playerContainer = document.createElement(‘div’); element.insertAdjacentElement(player.position, playerContainer); var title = document.createElement(‘h3′); title.style.margin = ’10px 0’; var titleHeight = this._getTitleHeight(title); this._wrapJWPlayerWithCLS(playerContainer, player.mediaId, this._WRAPPER_BAR_HEIGHT + titleHeight); this._playersAddedFromPlugin.push(player.mediaId); } }; ClsVideoInsertion.prototype._createSekindoPlayer = function (player, element) { var playlistId = player.playlistId; __assign(__assign({}, player), { classNames: [] }); var playerSize = this._device === ‘mobile’ ? { width: 340, height: 260 } : { width: 320, height: 250 }; logger$1.info(‘ClsVideoInsertion’, ‘_createSekindoPlayer’, “Video > Adding Sekindo Player Container”); var clsWrapper = this._createSekindoCLSWrapper(playerSize.height, playlistId); element.insertAdjacentElement(player.position, clsWrapper); this._playersAddedFromPlugin.push(playlistId); }; ClsVideoInsertion.prototype._createPlaylistPlayer = function (player, element) { var playlistId = player.playlistId; this._videoConfig.mobileStickyPlayerOnPage = true; var playerContainer = document.createElement(‘div’); element.insertAdjacentElement(player.position, playerContainer); logger$1.info(‘ClsVideoInsertion’, ‘_createPlaylistPlayer’, “Video > Adding Playlist Player Container”); this._wrapJWPlayerWithCLS(playerContainer, playlistId, this._WRAPPER_BAR_HEIGHT); this._playersAddedFromPlugin.push(“playlist-” + playlistId); }; ClsVideoInsertion.prototype._isVideoAllowedOnPage = function () { var disableAds = this._clsOptions.disableAds; if (disableAds && disableAds.video) { logger$1.info(‘ClsVideoInsertionMigrated’, ‘isVideoAllowedOnPage’, ‘Video > Non in post players are disabled on page’); var disableAdsReason = ”; if (disableAds.reasons.has(‘video_tag’)) { disableAdsReason = ‘video tag’; } else if (disableAds.reasons.has(‘video_plugin’)) { disableAdsReason = ‘video plugin’; } else if (disableAds.reasons.has(‘video_page’)) { disableAdsReason = ‘command queue’; } var loggedClassName = disableAdsReason ? ‘ClsVideoInsertionMigrated’ : ‘ClsVideoInsertion’; logger$1.error(loggedClassName, ‘isVideoAllowedOnPage’, new Error(“DBP: Disabled by publisher via ” + (disableAdsReason || ‘other’))); return false; } if (this._clsOptions.videoDisabledFromPlugin) { return false; } return true; }; return ClsVideoInsertion; }(VideoBase)); (function () { var clsOptions = new ClsOptions(); if (!clsOptions || !clsOptions.enabled) { return; } new ClsDynamicAdsInjector(clsOptions, new TargetDensityExperiment()).start(); new ClsVideoInsertion(new Video(clsOptions), clsOptions).init(); })(); })(); ]]>

Source

By fashonana

Fashonana is a fashion blog for the fashionable woman of this era.

Leave a comment

Your email address will not be published.

×

Check Out Your Free Gifts

free gifts on fashonana.com

Skip to content