//Creative template: Webs - 3x3 - Video Player
window.supportsAds = true;

!function(){try{document.getElementsByClassName("right-rail")[0].classList.remove("left-align-children")}catch(e){}}();

//motorola userid3p override
!function(){try{window.adInfo&&window.adInfo.partner&&"motorolawidget"==window.adInfo.partner&&(window.adInfo.userid3p="active")}catch(a){}}();

/*================
 Move top slot on mWeb
==================*/
!function(){try{var e,t,n,a=serverAdsOnPageLite.top.adUnitCode;if(t=document.getElementById("top"),-1!=a.indexOf("country_home")&&-1!=a.indexOf("mweb")&&((e=document.getElementsByClassName("nearby-locations")[0]).parentNode.insertBefore(t,e),t.style.padding="16px 0px 16px 0px",t.style.background="white",n=document.getElementsByClassName("zone-centerWell1")[0],e.parentNode.insertBefore(n,e)),-1!=a.indexOf("local_home")&&-1!=a.indexOf("mweb")&&(e=document.getElementsByClassName("cur-con-weather-card")[0]).parentNode.insertBefore(t,e),-1!=a.indexOf("local_home")&&-1!=a.indexOf("/web")){e=document.getElementsByClassName("sunrise-sunset")[0];var o=document.getElementById("native");e.parentNode.insertBefore(o,e)}}catch(r){}}();

/*================
GAMERA
=================*/
(function() {
	if (window.gameraFromPage){return;}	
  let aw_user='',aw_session='',aw_page='',country='',aw_gam_code='',aw_partner='',aw_wx_seg='';
	try{
		if (window.raine && window.raine.pageview){
			aw_user = window.raine.pageview.user.id;
			aw_session = window.raine.pageview.session.id;
			aw_page = window.raine.pageview.page.group;
			aw_gam_code = window.raine.pageview.ads.code;
			country = window.raine.pageview.user.country.toLowerCase();
		}
		if (window.adInfo){
			aw_partner = window.adInfo.partner || 'accuweather';
			aw_wx_seg = window.adInfo.wx_seg || '';
		}
	} catch (e){}
	
	if (country != 'us' || '' == 'true'){
		return;
	}
	window.gamera = window.gamera || {};
	window.gamera.cmd = window.gamera.cmd || [];
	window.gamera.cmd.push(function() {
		window.gamera.addDimensions({
			"aw_site":aw_gam_code.split('/')[2],
			"aw_wxGeo":aw_gam_code.split('/')[3],
			"aw_page":aw_page,
			"aw_partner":aw_partner,
			"aw_wx_seg":aw_wx_seg
	    });
      try{
		  let ucpm = window?.gamera?.getOnPageSegments()?.filter((cpm) => /^user_cpm/.test(cpm)).join(",") || undefined;
		  if (ucpm){
			  ucpm = (Math.round(parseFloat(ucpm.split("_").pop()) * 20) / 20).toFixed(2);
			  window.adInfo.ucpm = ucpm;
		  }
	  } catch (e){}
	  try{
		  window.adInfo.cohort =  window?.gamera?.getOnPageSegments()?.filter((cpm) => !/^user_cpm/.test(cpm)).join(",") || window.adInfo.cohort || undefined;
		  window.adInfo.iabatax = window?.gamera?.getPrebidSegments()?.user?.data[0]?.segment?.map(a => a.id).join(',') || window.adInfo.iabatax || undefined; 
	  } catch (e){}
	  try{
		  gamera._getAdPlacements().forEach(placement => {
		    if (serverAdsOnPageLite.hasOwnProperty(placement.divId)) {
		      serverAdsOnPageLite[placement.divId].universalPlacementId = placement.universalPlacementId ?? undefined;
		    }
		  });
	  } catch (e){}	
	});
	const s = document.createElement("script");
	const el = document.getElementsByTagName("script")[0];
	s.setAttribute('id', '__gamera__');
	s.setAttribute('async', 'true');
	s.src = 'https://metrics.rapidedge.io/gamera.js?domain=accuweather.com&ltv=1&tpcs=1';
	el.parentNode.insertBefore(s, el);		
})();

/*================
CONTENT Key-VALUES
=================*/
!function(){if(window.adInfo){var n="/6581/web/us/video_player/news_info/radar";window.adInfo.content=window.adInfo.content||"",window.adInfo.from=window.adInfo.from||"";var e=function(n,e){""!=window.adInfo[e]&&(window.adInfo[e]+=","),window.adInfo[e]+=n};try{let t=new Proxy(new URLSearchParams(window.location.search),{get:(n,e)=>n.get(e)});-1!=n.indexOf("allergies")&&t.name&&e(t.name,"content"),t.from&&e(t.from,"from")}catch(o){}try{let a=window.location.href;-1!=n.indexOf("content_landing")&&(-1!=a.indexOf("/business")&&e("business","content"),-1!=a.indexOf("/climate")&&e("climate","content"),-1!=a.indexOf("/health-wellness")&&e("health-wellness","content"),-1!=a.indexOf("/space-news")&&e("space-news","content"),-1!=a.indexOf("/leisure-recreation")&&e("leisure-recreation","content"),-1!=a.indexOf("/sports")&&e("sports","content"),-1!=a.indexOf("/travel")&&e("travel","content"))}catch(c){}}}();



/*********
Longitude 
**********/
!function(){window.AWNowLivePlayerPoster="https://www.awxcdn.com/adc/AW-Now.jpg";let e="/6581/web/us/video_player/news_info/radar",t=e.split("/"),a=document.getElementById("connatix"),r=!1,i=!1;try{if(!["us","ca","de","gb","es","it","fr","eur"].includes(t[3])||-1==window.adInfo.lang.indexOf("en")){a&&a.remove();return}}catch(l){}if(void 0===a||null==a){if((a=document.createElement("div")).id="connatix",a.setAttribute("class","content-module"),"alerts"==t[6]&&"us"==t[3])document.getElementsByClassName("page-content")[0].appendChild(a);else if("minutecast"==t[6]&&"us"==t[3])i=document.getElementsByClassName("base-map-cta")[0];else{if("wintercast"!=t[6]||"us"!=t[3])return;i=document.getElementById("house-ad-1")}}switch(t[6]){case"country_home":break;case"video_wall":a.remove();return;case"local_home":i=document.getElementsByClassName("daily-list")[0];break;case"radar":case"daily":i="mweb"==t[2]?document.getElementById("middle"):document.getElementById("native");break;case"hourly":let o=document.getElementsByClassName("hour");o.length>3&&(i=o[3]),t[2];break;case"extended":let n=document.getElementsByClassName("daily-wrapper");n.length>5&&(i=n[2]),"web"==t[2]&&(r=!0);break;case"minutecast":"web"==t[2]&&(i=document.getElementById("native")),t[2];break;case"air_quality":i=document.getElementById("native"),t[2]}try{i&&i.parentNode.insertBefore(a,i)}catch(p){}window.watchAWNowLive=function(){if(document.getElementById("live_fallback")&&document.getElementById("live_fallback").children.length>0){window.startLiveFallbackPlayer();return}window.interruptStartLive()},window.floatAWVideoPlayer=function(e,t){t&&(window.floatAWVideoPlayerStop=!0);let a=document.getElementsByClassName("video-player-wrapper")[0];if(e&&!window.floatAWVideoPlayerStop){try{document.getElementById("connatix").style.minHeight=getComputedStyle(a).height}catch(r){}a.classList.add("float")}else a.classList.remove("float")};let s=document.createElement("div");s.setAttribute("class","video-player-wrapper"),s.innerHTML='<h2 class="video-title">AccuWeather NOW<div onclick="floatAWVideoPlayer(false,true)" id="closeVideoFloat" class="close-button"><svg class="close-icon" xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><g fill-rule="evenodd" transform="translate(-1 -1)"><rect width="2" height="24" x="9" y="-2" rx="1" transform="rotate(45 10 10)"></rect><rect width="2" height="24" x="9" y="-2" rx="1" transform="rotate(-45 10 10)"></rect></g></svg></div></h2><div id="lngtd_outstream"></div><div class="cta-container"><div class="thumb-info-wrapper"><div onclick="watchAWNowLive()" class="icon-play"></div><div class="thumb-info"><div class="thumb-title">Watch Live</div></div><div class="customMute"></div></div></div>';let d="#lngtd_outstream{background-image: url(https://www.awxcdn.com/adc/AW-Now.jpg);background-size: 100%;background-repeat: no-repeat;width:100%;aspect-ratio:16/9}.video-player-wrapper,.video-title{color:hsla(0,0%,100%,.6);font-size:.75rem;background-color:#fff}.video-player-wrapper .cta-container h3,.video-title{font-weight:700;text-transform:uppercase;color:rgba(0,0,0,.6)}.video-player-wrapper{border-radius:6px}.video-player-wrapper .video-title{letter-spacing:.5px;padding:20px 0 12px 20px;border-radius: 6px 6px 0 0}.video-player-wrapper .cta-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:12px;padding:20px}.video-player-wrapper .cta-container .thumb-info-wrapper{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;cursor:pointer}.video-player-wrapper .cta-container .thumb-info-wrapper .icon-play{-ms-flex-negative:0;background:url(https://www.awxcdn.com/adc-assets/images/components/content/video-player/play_dark_circle.svg) 50%/cover no-repeat;flex-shrink:0;height:40px;margin-right:12px;width:40px}.video-player-wrapper .cta-container .thumb-info-wrapper .thumb-info .thumb-title{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;font-size:16px;line-height:20px;overflow:hidden;text-overflow:ellipsis;white-space:normal;color:rgba(0,0,0,.6)}.video-player-wrapper #lngtd_live_player,.video-player-wrapper #lngtd_player{border-radius:0}.weather-warning .video-player-wrapper{margin-top:16px}.weather-warning .video-player-wrapper .video-title,.weather-warning .video-player-wrapper .cta-container{padding-left:0}.weather-warning .video-player-wrapper #lngtd_live_player,.weather-warning .video-player-wrapper #lngtd_player,.weather-warning .video-player-wrapper #lngtd_outstream{border-radius:6px}.video-player-wrapper .close-button{align-items: center;background: rgba(0, 0, 0, .5);border-radius: 50%;cursor: pointer;display: none;height: 32px;justify-content: center;position: absolute;right: 7px;top: 7px;width: 32px;z-index: 6;}.video-player-wrapper .close-button>svg{fill: #fff;height: 12px;width: 12px;}.video-player-wrapper.float{position:fixed;width:400px;bottom:10px;right:15px;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);z-index: 10;}.video-player-wrapper.float .close-button{display:flex;}.video-player-wrapper .customMute{ margin-left:auto;font-size: 2em;cursor: pointer;margin-right: 0;color: rgba(0, 0, 0, 0.35);}.video-player-wrapper .customMute{display:none;}.video-player-wrapper:has(#live_fallback) .customMute{display:flex;}.video-player-wrapper #lngtd_player,.video-player-wrapper #lngtd_outstream,.video-player-wrapper #lngtd_live_player{min-height:auto;width:100%;height:100%;aspect-ratio: 16 / 9;}lngtd-outstream{min-height: auto !important}",c=document.head||document.getElementsByTagName("head")[0],g=document.createElement("style");g.type="text/css";let w=document.createElement("script");-1!=e.indexOf("mweb")?w.src="https://lngtd.com/accuweather_mweb_os.js":w.src="https://lngtd.com/accuweather_web_os.js",w.setAttribute("async","true");try{g.styleSheet?g.styleSheet.cssText=d:g.appendChild(document.createTextNode(d)),c.appendChild(g),c.appendChild(w),a.appendChild(s),a.style.minHeight="auto"}catch(m){}try{1e3>parseInt(adInfo.viewport.split("x")[0])&&(r=!1)}catch(y){}if(r){let h=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting?window.floatAWVideoPlayer(!1,!1):window.floatAWVideoPlayer(!0,!1)})}),v=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(h.observe(document.getElementById("connatix")),v.unobserve(document.getElementById("connatix")))})});v.observe(document.getElementById("connatix"))}window.AWNowLivePlayerPoster&&document.getElementById("lngtd_outstream")&&(document.getElementById("lngtd_outstream").style.backgroundImage="url("+window.AWNowLivePlayerPoster+")")}();

/****
 Mute Controller
****/

document.addEventListener("livePlayerReady", function(){
	window.AWNowLivePlayer = videojs('lngtd_live_player');
	const CM = document.querySelector(".video-player-wrapper .customMute");
	if (window.AWNowLivePlayer.muted()){
		CM.classList.remove("vjs-icon-volume-high");
		CM.classList.add("vjs-icon-volume-mute");
	} else {
		CM.classList.add("vjs-icon-volume-high");
		CM.classList.remove("vjs-icon-volume-mute");
	}
	CM.onclick = function(){
		if (window.AWNowLivePlayer.muted()){
			window.AWNowLivePlayer.muted(false);
			try{
				window.AWNowLivePlayer.ima.getAdsManager().setVolume(1);
			} catch (e){}
			
		} else {
			window.AWNowLivePlayer.muted(true);
			try{
				window.AWNowLivePlayer.ima.getAdsManager().setVolume(0);
			} catch (e){}
		}
	}
	window.AWNowLivePlayer.on('volumechange',  evt => { 
		const CM = document.querySelector(".video-player-wrapper .customMute");
		if (window.AWNowLivePlayer.muted()){
			CM.classList.remove("vjs-icon-volume-high");
			CM.classList.add("vjs-icon-volume-mute");
		} else {
			CM.classList.add("vjs-icon-volume-high");
			CM.classList.remove("vjs-icon-volume-mute");
		}
	});
});

/*********
Google Multiplex 
**********/
 !function(){let e="/6581/web/us/video_player/news_info/radar";if(-1!=e.indexOf("/us/"))return;let t=parseInt("0"),a=!1,l=!1,n="9224325968",s=parseInt("0"),i="width:970px;margin:0 auto 20px auto;",o="width:930px;height:450px",r="background-color: #fff;color: rgba(0, 0, 0, .6);font-size: .75rem;font-weight: 700;letter-spacing: .5px;margin-bottom: 1px;padding: 20px 20px 12px;text-transform:uppercase;";-1!=e.indexOf("/mweb/")?(l=!0,n="3311122915",o="display:block;",i="margin:0 auto 20px auto;",r="background-color: #fff;color: rgba(0, 0, 0, 1);font-size: 1.375rem;font-weight: 700;letter-spacing: .5px;padding: 20px 20px 12px;"):(-1!=e.indexOf("/ios/")||-1!=e.indexOf("/android/"))&&(a=!0,n=-1!=e.indexOf("/android/")?"7100865123":"1443647090",o="display:block;",i="",r="background-color: #fff;color: rgba(0, 0, 0, 1);font-size: 1.375rem;font-weight: 700;letter-spacing: .5px;padding: 20px 20px 12px;");let d=document.createElement("script");d.src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5771594739411148",d.setAttribute("crossorigin","anonymous"),d.async=!0;let p=document.createElement("ins");p.setAttribute("class","adsbygoogle"),p.setAttribute("style",o),(l||a)&&p.setAttribute("data-ad-format","autorelaxed"),p.setAttribute("data-ad-client","ca-pub-5771594739411148"),p.setAttribute("data-ad-slot",n);let c=document.createElement("div");c.setAttribute("style","display:block;background:#fff;padding:10px 20px"),c.appendChild(d),c.appendChild(p);let g=document.createElement("h2");g.setAttribute("style",r),g.innerHTML="Around The Web";let $=document.createElement("div");a?$.setAttribute("class","full-mobile-width multiplex"):$.setAttribute("class","content-module glacier-ad ad multiplex"),$.setAttribute("style",i),$.appendChild(g),$.appendChild(c);let u=document.head||document.getElementsByTagName("head")[0],b=e=>{let t=document.createElement("style");return t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e)),u.appendChild(t)};function m(){b('.multiplex{display:block} .multiplex:has(ins[data-ad-status="unfilled"]){display:none}'),console.log("multiplex loaded");try{if(a)document.getElementsByClassName("zone-centerWell2")[0].appendChild($);else if(l){let e=document.getElementsByClassName("page-content")[0];e.appendChild(document.getElementById("bottom")),e.appendChild($)}else{let t=document.getElementsByClassName("breadcrumbs");t.length>1?t[1].parentNode.insertBefore($,t[1]):t[0].parentNode.insertBefore($,t[0])}(adsbygoogle=window.adsbygoogle||[]).push({})}catch(n){}}"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||(s=!1);let x=document.getElementById("bottom");if(x||(x=document.getElementsByClassName("zone-centerWell2")[0]),s)new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(m(),t.unobserve(e.target))})},{rootMargin:"0px 0px 500px 0px"}).observe(x);else if(t)try{window.googletag.cmd.push(()=>{let e=t=>{window.googletag.pubads().removeEventListener("slotRenderEnded",e),m()};window.googletag.pubads().addEventListener("slotRenderEnded",e)})}catch(f){m()}else m()}();


/***
	LinkedIn Games
	***/
	!function(){
		
		const au = '/6581/web/us/video_player/news_info/radar';
		/*if (window.location.hash.indexOf('linkedin') == -1){
			return;
		}*/
		
		if (au.indexOf('/web/us/video_player/news_info/country_home') == -1 ){
			return;
		}
  
  	if (adInfo.userid3p != "active"){
     return;
    }
		
		window.addEventListener('message',function(event){
			if (event.origin === 'https://www.linkedin.com'){
				if (event.data.message === 'openSignInPopUpWindow'){
					const linkedInLoginUrl = event.data.loginUrl ?? 'https://www.linkedin.com/uas/login';
					window.open(linkedInLoginUrl,'width=100,height=600');
				} 
				if (event.data.message === 'loginSuccess'){
					document.getElementById("linkedInGames").src = document.getElementById("linkedInGames").src;
				} 
			}
		});
		
const html = `<div class="indices-newsfeed full-mobile-width ">
	<div class="spaced-content indices-newsfeed__title">
		<span>Today's Puzzle Games</span>
	</div>
	<div class="indices-body">
		<div class="indices-touts">
			<a class="story" style="min-height:auto;cursor:pointer;" onclick="playLinkedInGame('pinpoint')">
				<img style="width:100%" src="https://media.licdn.com/media/AAYABATzAAwAAQAAAAAAAMGGxbkBCr8GSryswNRYzmSZLA.png" />
			</a>
			<a class="story" style="min-height:auto;cursor:pointer;" onclick="playLinkedInGame('crossclimb')">
				<img style="width:100%" src="https://media.licdn.com/media/AAYABATzAAwAAQAAAAAAANgViDOAk1VzRd-srvrVW30Tcw.png" />
			</a>
			<a class="story" onclick="playLinkedInGame('queens')" style="min-height:auto;cursor:pointer;">
				<img style="width:100%"src="https://media.licdn.com/media/AAYABATzAAwAAQAAAAAAANk-eD3hWMd6SPucqE5e8ila1A.png" />
			</a>
		</div>
	</div>
	<div class="indices-body" id="linkedInGamesContainer">
			<iframe sandbox="allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox allow-storage-access-by-user-activation" style="margin:0;padding:0;border:none;width:100%;height:0" id="linkedInGames"></iframe>	
	</div>
</div>`;
		
window.playLinkedInGame = function(game) {
	document.getElementById('linkedInGames').src="https://www.linkedin.com/games/view/"+game+"?parentCode=accuweather";
	document.getElementById('linkedInGames').style.height="683px";
}
		
		const awAdSlot = document.getElementsByClassName('zone-centerWell1');
		const div = document.createElement("div");
		div.innerHTML = html;
		if (awAdSlot.length){
			awAdSlot[0].appendChild(div);
		}
	}();      
      

//TripleLift Native Width Fix
!function(){try{window.googletag.cmd.push(()=>{let e=t=>{"native"==t.slot.getSlotElementId()&&(window.googletag.pubads().removeEventListener("slotRenderEnded",e),setTimeout(function(){if(document.getElementsByClassName("accuweather_d_weather_native_pbjs").length){let e=document.getElementsByClassName("native")[0];e.getElementsByTagName("div")[0].style.width="100%",e.getElementsByTagName("iframe")[0].style.width=e.clientWidth+"px"}},300))};window.googletag.pubads().addEventListener("slotRenderEnded",e)})}catch(e){}}();
      
//remove criteo fast bid
try{localStorage.removeItem('criteo_fast_bid');localStorage.removeItem('criteo_fast_bid_expires');} catch (e){}
      
//Tracker
(function(){try { if ('No' == 'Yes'){ const t=new Image();t.src='https://securepubads.g.doubleclick.net/pcs/view?xai=AKAOjstQgTPedIH3sI_eTxLvdtvizKZSXEa_YOFWYZh_CPe_ryTwzSyZze4ekRX35CrkQc8HdZufY4E48XE89rKYlNUNgWEhnCsPJwIPlHOaOB9oAt6FjOpha9T969nZwMw6slHFg5Jn8Mi22aVVa-7kbHP-hO7PdBCUMigVww_Kh9ZxHHxiDt0ONTgBWnIIFsf5FmjaRoDx2jehPA6al47svOxBbyuCJcuSJmxQ9VUYlnxKhDPyjGS4PSknMy0peHBvXzWz0Rr_oqLLiE5O-TQKh63fqCwcfe5Qgq8bzoG24sPV_7RTplQKd4G5jdQX5A0YPkNWUDkpelyRs0btNIUKZUsOoyCn1JweHSqX0L5xiLl9tDQc6R4NV06cS1fErjoapOxWioTd_vk4DdRucOdVWQL38hLt4uoBWzI3RP4PuSSfDw&sai=AMfl-YSrdYcZTZe00ztl3iMKRATNaAddfbq0XoNyNJocXGMYbXW7dt8mrAAAj8g0ILdL1ucuvRIN2EjRo3KvrX5F0sBE6vUxgoRQK-ac-k8qwhcPyo1u87XrfqJYuL0&sig=Cg0ArKJSzKJ1VTINrd4vEAE&uach_m=%5BUACH%5D&urlfix=1&adurl=';}} catch (e){}})();