‘);e.insertAdjacentHTML(n,o)}return document.getElementById(t)},n.prototype._repeatDynamicAds=function(t){for(var n=[],i=t.lazy?e(this.locationMaxLazySequence.get(t.location),0):0,o=t.max,a=t.lazyMax,l=0===i&&t.lazy?o+a:Math.min(Math.max(i-t.sequence+1,0),o+a),s=Math.max(o,l),c=0;c=o;n.push(r(r({},t),{sequence:u,lazy:d}))}return n},n.prototype._locationEnabled=function(e){var t=this._clsOptions.enabledLocations.includes(e.location),n=this._clsOptions.disableAds&&this._clsOptions.disableAds.all||document.body.classList.contains(“adthrive-disable-all”),i=!document.body.classList.contains(“adthrive-disable-content”)&&!this._clsOptions.disableAds.reasons.has(“content_plugin”);return t&&!n&&i},n}(),ae=function(e){function t(t,n){var i=e.call(this,t,”ClsVideoInsertion”)||this;return i._videoConfig=t,i._clsOptions=n,i._IN_POST_SELECTOR=”.adthrive-video-player”,i._WRAPPER_BAR_HEIGHT=36,i._playersAddedFromPlugin=[],i}return o(t,e),t.prototype.init=function(){this._initializePlayers()},t.prototype._wrapJWPlayerWithCLS=function(e,t,n){if(void 0===n&&(n=0),e.parentNode){var i=e.offsetWidth*(9/16),o=this._createGenericCLSWrapper(i,t,n);return e.parentNode.insertBefore(o,e),o.appendChild(e),o}return null},t.prototype._createGenericCLSWrapper=function(e,t,n){var i=document.createElement(“div”);return i.id=”cls-video-container-“.concat(t),i.className=”adthrive”,i.style.minHeight=””.concat(e+n,”px”),i},t.prototype._getTitleHeight=function(e){e.innerText=”Title”,e.style.visibility=”hidden”,document.body.appendChild(e);var t=window.getComputedStyle(e),n=parseInt(t.height,10),i=parseInt(t.marginTop,10),o=parseInt(t.marginBottom,10);return document.body.removeChild(e),Math.min(n+o+i,50)},t.prototype._initializePlayers=function(){var e=document.querySelectorAll(this._IN_POST_SELECTOR);e.length&&this._initializeRelatedPlayers(e),this._shouldRunAutoplayPlayers()&&this._determineAutoplayPlayers()},t.prototype._createStationaryRelatedPlayer=function(e,t){var n=”mobile”===this._device?[400,225]:[640,360],i=y.Video_In_Post_ClicktoPlay_SoundOn;if(t&&e.mediaId){var o=this._wrapJWPlayerWithCLS(t,e.mediaId);this._playersAddedFromPlugin.push(e.mediaId),o&&this._clsOptions.setInjectedVideoSlots({playerId:e.playerId,playerName:i,playerSize:n,element:o,type:”stationaryRelated”})}},t.prototype._createStickyRelatedPlayer=function(e,t){var n=”mobile”===this._device?[400,225]:[640,360],i=y.Video_Individual_Autoplay_SOff;if(this._stickyRelatedOnPage=!0,this._videoConfig.mobileStickyPlayerOnPage=”mobile”===this._device,t&&e.position&&e.mediaId){var o=document.createElement(“div”);t.insertAdjacentElement(e.position,o);var r=document.createElement(“h3″);r.style.margin=”10px 0″;var a=this._getTitleHeight(r),l=this._wrapJWPlayerWithCLS(o,e.mediaId,this._WRAPPER_BAR_HEIGHT+a);this._playersAddedFromPlugin.push(e.mediaId),l&&this._clsOptions.setInjectedVideoSlots({playlistId:e.playlistId,playerId:e.playerId,playerSize:n,playerName:i,element:o,type:”stickyRelated”})}},t.prototype._createPlaylistPlayer=function(e,t){var n=e.playlistId,i=”mobile”===this._device?y.Video_Coll_SOff_Smartphone:y.Video_Collapse_Autoplay_SoundOff,o=”mobile”===this._device?[400,225]:[640,360];this._videoConfig.mobileStickyPlayerOnPage=!0;var r=document.createElement(“div”);t.insertAdjacentElement(e.position,r);var a=this._wrapJWPlayerWithCLS(r,n,this._WRAPPER_BAR_HEIGHT);this._playersAddedFromPlugin.push(“playlist-“.concat(n)),a&&this._clsOptions.setInjectedVideoSlots({playlistId:e.playlistId,playerId:e.playerId,playerSize:o,playerName:i,element:r,type:”stickyPlaylist”})},t.prototype._isVideoAllowedOnPage=function(){var e=this._clsOptions.disableAds;if(e&&e.video){var t=””;e.reasons.has(“video_tag”)?t=”video tag”:e.reasons.has(“video_plugin”)?t=”video plugin”:e.reasons.has(“video_page”)&&(t=”command queue”);var n=t?”ClsVideoInsertionMigrated”:”ClsVideoInsertion”;return I.error(n,”isVideoAllowedOnPage”,new Error(“DBP: Disabled by publisher via “.concat(t||”other”))),!1}return!this._clsOptions.videoDisabledFromPlugin},t}(function(e){function t(t,n){var i=e.call(this)||this;i._videoConfig=t,i._component=n,i._stickyRelatedOnPage=!1,i._contextualMediaIds=[];var o,r=i._videoConfig.players||[];i._device=(void 0===o&&(o=navigator.userAgent),/Windows NT|Macintosh/i.test(o)?”desktop”:”mobile”),i._potentialPlayerMap=i._setPotentialPlayerMap();var a=r.filter((function(e){return”stationaryRelated”===e.type&&e.enabled}));return i._potentialPlayerMap.stationaryRelated=a,i}return o(t,e),t.prototype._setPotentialPlayerMap=function(){var e=this,t=this._videoConfig.players,n={stickyRelated:[],stickyPlaylist:[],stationaryRelated:[]};return t&&t.length?t.filter((function(t){var n;return null===(n=t.devices)||void 0===n?void 0:n.includes(e._device)})).reduce((function(t,n){return t[n.type]||(I.event(e._component,”constructor”,”Unknown Video Player Type detected”,n.type),t[n.type]=[]),n.enabled&&t[n.type].push(n),t}),n):n},t.prototype._checkPlayerSelectorOnPage=function(e){var t=this,n=this._potentialPlayerMap[e].map((function(e){return{player:e,playerElement:t._getPlacementElement(e)}}));return n.length?n[0]:{player:null,playerElement:null}},t.prototype._getOverrideElement=function(e,t,n){if(e&&t){var i=document.createElement(“div”);t.insertAdjacentElement(e.position,i),n=i}else{var o=this._checkPlayerSelectorOnPage(“stickyPlaylist”),r=o.player,a=o.playerElement;if(r&&a){i=document.createElement(“div”);a.insertAdjacentElement(r.position,i),n=i}}return n},t.prototype._shouldOverrideElement=function(e){var t=e.getAttribute(“override-embed”);return”true”===t||”false”===t?”true”===t:!!this._videoConfig.contextualSettings&&this._videoConfig.contextualSettings.overrideEmbedLocation},t.prototype._getPlacementElement=function(e){var t=M(e.pageSelector),n=x(e.elementSelector);return t.valid?e.pageSelector&&!t.elements.length?(I.event(“VideoUtils”,”getPlacementElement”,new Error(“PSNF: “.concat(e.pageSelector,” does not exist on the page”))),null):n.valid?n.elements.length>e.skip?n.elements[e.skip]:(I.event(“VideoUtils”,”getPlacementElement”,new Error(“ESNF: “.concat(e.elementSelector,” does not exist on the page”))),null):(I.error(“VideoUtils”,”getPlacementElement”,new Error(“”.concat(e.elementSelector,” is not a valid selector”))),null):(I.error(“VideoUtils”,”getPlacementElement”,new Error(“”.concat(e.pageSelector,” is not a valid selector”))),null)},t.prototype._getEmbeddedPlayerType=function(e){var t=e.getAttribute(“data-player-type”);return t&&”default”!==t||(t=this._videoConfig.contextualSettings?this._videoConfig.contextualSettings.defaultPlayerType:”static”),this._stickyRelatedOnPage&&(t=”static”),t},t.prototype._getUnusedMediaId=function(e){var t=e.getAttribute(“data-video-id”);return!(!t||this._contextualMediaIds.includes(t))&&(this._contextualMediaIds.push(t),t)},t.prototype._createRelatedPlayer=function(e,t,n){“collapse”===t?this._createCollapsePlayer(e,n):”static”===t&&this._createStaticPlayer(e,n)},t.prototype._createCollapsePlayer=function(e,t){var n=this._checkPlayerSelectorOnPage(“stickyRelated”),i=n.player,o=n.playerElement,a=i||this._potentialPlayerMap.stationaryRelated[0];a&&a.playerId?(this._shouldOverrideElement(t)&&(t=this._getOverrideElement(i,o,t)),t=document.querySelector(“#cls-video-container-“.concat(e,” > div”))||t,this._createStickyRelatedPlayer(r(r({},a),{mediaId:e}),t)):I.error(this._component,”_createCollapsePlayer”,”No video player found”)},t.prototype._createStaticPlayer=function(e,t){if(this._potentialPlayerMap.stationaryRelated.length&&this._potentialPlayerMap.stationaryRelated[0].playerId){var n=this._potentialPlayerMap.stationaryRelated[0];this._createStationaryRelatedPlayer(r(r({},n),{mediaId:e}),t)}else I.error(this._component,”_createStaticPlayer”,”No video player found”)},t.prototype._shouldRunAutoplayPlayers=function(){return!(!this._isVideoAllowedOnPage()||!this._potentialPlayerMap.stickyRelated.length&&!this._potentialPlayerMap.stickyPlaylist.length)},t.prototype._determineAutoplayPlayers=function(){var e=this._component,t=”VideoManagerComponent”===e,n=this._config;if(this._stickyRelatedOnPage)I.event(e,”stickyRelatedOnPage”,t&&{device:n&&n.context.device,isDesktop:this._device}||{});else{var i=this._checkPlayerSelectorOnPage(“stickyPlaylist”),o=i.player,r=i.playerElement;o&&o.playerId&&o.playlistId&&r?this._createPlaylistPlayer(o,r):I.event(e,”noStickyPlaylist”,t&&{vendor:”none”,device:n&&n.context.device,isDesktop:this._device}||{})}},t.prototype._initializeRelatedPlayers=function(e){for(var t=0;t