!function(){
const au = '/6581/web/postbid/bottom_right/news_info/country_home';
const parts = String(au).split('/');
const slot = parts[4] || '';
const platform = parts[2] || '';
const page = parts[6] || '';
const country = window?.adInfo?.country?.toLowerCase() || undefined;
const node = document.currentScript.parentNode;
const smallBannerPages = ['tropical'];
const isONE = window?.tagEngineDataLayer?.isSPA || false;
let filled = false;
function injectRemoveAdsPill(adEl, onClick = () => {}) {
if (!adEl || !adEl.parentNode) return;
// avoid duplicates
if (adEl.nextElementSibling?.classList?.contains('aw-ads-pill')) return;
let version = 3;
let bg = 'var(--button-background)', clr = 'var(--foreground)', bdr = '6px', sun = '#f05514';
if (version === 2){
bg = '#f05514', clr = '#fff', bdr = '6px', sun = '#fff';
}
if (!document.getElementById('aw-ads-pill-css')) {
const css = document.createElement('style');
css.id = 'aw-ads-pill-css';
css.textContent = `
.aw-ads-pill{display:inline-flex;align-items:center;gap:6px;background:${bg};color:${clr};border:0;border-radius:${bdr};padding:6px 8px;margin-top:16px;cursor:pointer;font-size: .75em;-webkit-tap-highlight-color:transparent;}
.aw-ads-pill svg{display:block;}`;
document.head.appendChild(css);
}
let iconSvg = ``;
if (version === 3){
iconSvg = `
`;
}
const pill = document.createElement('button');
pill.type = 'button';
pill.className = 'aw-ads-pill';
pill.innerHTML = `${iconSvg}Remove Ads`;
pill.addEventListener('click', (e) => {
e.preventDefault();
e.stopPropagation();
onClick();
});
adEl.appendChild(pill);
}
function cleanLanguageCode(langCode) {
if (typeof langCode !== "string") return "";
return langCode.trim().slice(0, 2).toLowerCase();
}
const lang = cleanLanguageCode(window?.adInfo?.lang) || "en";
function removeBeforeAdContent(){
if (document.querySelector("#adNoBefore")){
return;
}
const css = '.adNoBefore.ad::before{content:"";border:0;padding:0}';
const docHead = document.head || document.getElementsByTagName("head")[0];
const customStyles = document.createElement("style");
customStyles.id = "adNoBefore";
customStyles.type = "text/css";
if (customStyles.styleSheet) {
customStyles.styleSheet.cssText = css;
} else {
customStyles.appendChild(document.createTextNode(css));
}
docHead.appendChild(customStyles);
}
function cleanSlot(node,nodeToRemove){
const removeNodes = node.querySelectorAll(nodeToRemove);
removeNodes.forEach(rNode => {
rNode.remove();
});
}
function setupUnfilledMonitoring({ node, ins, size }) {
let done = false;
const timeoutMs = 4000;
let mod_DT = false, mod_AWNow = false;
const markUnfilled = (reason) => {
if (done) return;
done = true;
if (country === 'us' && platform === 'android' && size === '300x250') {
if (!loadDT_ONE(node)){
PremiumPlusUpsell(node, size);
//loadAmazon(node);
}
} else if (isONE && size === '300x250' && country === 'us' ){
PremiumPlusUpsell(node, size);
//loadAmazon(node);
} else if (isONE){
PremiumPlusUpsell(node, size);
} else if (slot === "adhesion" && platform === "mweb"){
try{
window.adsOnPage.get("adhesion").isEmpty = true;
window.adhesionController.close();
} catch (e){}
}
cleanup();
};
const markFilled = (reason) => {
if (done) return;
done = true;
if (size === "300x250"){
injectRemoveAdsPill(node, () => {
const ref = node.id || "";
const frm = ref.split("-")[0] || "";
window.location.href = '/account/upsell?promo=removeAdsPill_' + encodeURIComponent(ref) + '&referrer=' + encodeURIComponent(frm);
});
}
cleanup();
};
let attrObserver, swapObserver, ro, childObs;
const watchIns = (el) => {
attrObserver = new MutationObserver(() => {
const s = el.getAttribute('data-ad-status');
if (s === 'unfilled') markUnfilled('attr');
if (s === 'filled') markFilled('attr');
});
try {
attrObserver.observe(el, { attributes: true, attributeFilter: ['data-ad-status'] });
} catch {}
const now = el.getAttribute('data-ad-status');
if (now === 'unfilled') return markUnfilled('initial');
if (now === 'filled') return markFilled('initial');
const hookIframe = () => {
const iframe = el.querySelector('iframe');
if (!iframe) return;
iframe.addEventListener('load', () => {
const s = el.getAttribute('data-ad-status');
if (s === 'unfilled') markUnfilled('iframe-load');
else if (s === 'filled') markFilled('iframe-load');
}, { once: true });
};
childObs = new MutationObserver(hookIframe);
try { childObs.observe(el, { childList: true, subtree: true }); } catch {}
hookIframe();
};
swapObserver = new MutationObserver(() => {
const latestIns = node.querySelector('ins.adsbygoogle');
if (latestIns) watchIns(latestIns);
});
try { swapObserver.observe(node, { childList: true, subtree: true }); } catch {}
const to = setTimeout(() => markUnfilled('timeout'), timeoutMs);
function cleanup() {
try { attrObserver && attrObserver.disconnect(); } catch {}
try { childObs && childObs.disconnect(); } catch {}
try { swapObserver && swapObserver.disconnect(); } catch {}
try { ro && ro.disconnect(); } catch {}
clearTimeout(to);
}
const initialIns = ins || node.querySelector('ins.adsbygoogle');
if (initialIns) watchIns(initialIns);
}
function PremiumPlusUpsell(node, size){
let ref = node.id || "";
const frm = ref.split("-")[0] || ""; //get the page so we can send the user back
ref = "postbidAppUpsell_"+ref;
let sz = "rect";
if (size === '320x50'){
sz = "banner";
}
const premiumPlusUpsellVariants = {
"en": {
"upsell.variant5.content": "Ad-free browsing and perks",
"upsell.variant1.content": "Cleaner pages and more features",
"upsell.variant2.header": "Go ad-free with Premium+",
"upsell.variant4.button": "Try Premium+",
"upsell.variant1.header": "Unlock an ad-free experience",
"upsell.variant2.content": "Faster pages, extra tools",
"upsell.variant3.content": "Deeper insights, extra features",
"upsell.variant4.header": "Cleaner, quicker forecast",
"upsell.variant5.button": "Explore Premium+",
"upsell.variant1.button": "Explore Premium+",
"upsell.variant2.button": "Upgrade now",
"upsell.variant3.header": "See more, skip ads",
"upsell.variant5.header": "Upgrade for uninterrupted weather",
"upsell.variant3.button": "Get Premium+",
"upsell.variant4.content": "Zero ads, more focus"
},
"es": {
"upsell.variant5.content": "Navegación sin publicidad y ventajas",
"upsell.variant1.content": "Páginas más limpias y más funciones",
"upsell.variant2.header": "Vaya sin publicidad con Premium+",
"upsell.variant4.button": "Pruebe Premium+",
"upsell.variant1.header": "Desbloquea una experiencia sin publicidad",
"upsell.variant2.content": "Páginas más rápidas, herramientas adicionales",
"upsell.variant3.content": "Información más profunda, funciones adicionales",
"upsell.variant4.header": "Pronóstico más limpio y rápido",
"upsell.variant5.button": "Explorar Premium+",
"upsell.variant1.button": "Explorar Premium+",
"upsell.variant2.button": "Actualizar ahora",
"upsell.variant3.header": "Ver más, omitir anuncios",
"upsell.variant5.header": "Actualización para condiciones climáticas ininterrumpidas",
"upsell.variant3.button": "Obtén Premium+",
"upsell.variant4.content": "Cero anuncios, más enfoque"
},
"fr": {
"upsell.variant5.content": "Navigation et avantages sans publicité",
"upsell.variant1.content": "Des pages plus propres et plus de fonctionnalités",
"upsell.variant2.header": "Passez sans publicité avec Premium+",
"upsell.variant4.button": "Essayez Premium+",
"upsell.variant1.header": "Profitez d’une expérience sans publicité",
"upsell.variant2.content": "Des pages plus rapides, des outils supplémentaires",
"upsell.variant3.content": "Des informations plus approfondies, des fonctionnalités supplémentaires",
"upsell.variant4.header": "Prévisions plus propres et plus rapides",
"upsell.variant5.button": "Explorer Premium+",
"upsell.variant1.button": "Explorer Premium+",
"upsell.variant2.button": "Mettre à niveau maintenant",
"upsell.variant3.header": "Voir plus, ignorer les annonces",
"upsell.variant5.header": "Mise à niveau pour des conditions météorologiques ininterrompues",
"upsell.variant3.button": "Obtenir Premium+",
"upsell.variant4.content": "Zéro publicité, plus de concentration"
}
};
function getRandomPremiumPlusVariant(lang = "en") {
const code = String(lang || "en").toLowerCase();
const normalized = premiumPlusUpsellVariants[code] ? code : "en";
const dict = premiumPlusUpsellVariants[normalized] || {};
const byId = {};
for (const [key, value] of Object.entries(dict)) {
const m = key.match(/^upsell\.variant(\d+)\.(header|content|button)$/);
if (!m) continue;
const id = Number(m[1]);
byId[id] = byId[id] || { header: "", content: "", button: "" };
byId[id][m[2]] = value;
}
// Only keep complete variants and sort by id for stable indexing
const variants = Object.entries(byId)
.map(([id, v]) => ({ id: Number(id), ...v }))
.filter(v => v.header && v.content && v.button)
.sort((a, b) => a.id - b.id);
if (variants.length === 0) {
// Nothing usable for this lang (or even "en")
return { lang: normalized, index: -1, variant: null };
}
const idx = Math.floor(Math.random() * variants.length);
const v = variants[idx];
return {
lang: normalized,// "en" or "es"
index: idx,// 0..variants.length-1 (stable order by id)
variant: {// { header, content, button }
header: v.header,
content: v.content,
button: v.button
}
};
}
let pick = getRandomPremiumPlusVariant(lang);
if (!pick.variant) pick = getRandomPremiumPlusVariant("en");
if (!pick.variant) return; // nothing to render safely
ref += `_en${pick.index}`;
ref = ref.toLowerCase();
let imp = "https://securepubads.g.doubleclick.net/gampad/adx?iu=/6581/DFPTrackingPixel/"+platform+"/postbid_upsell/impressions/"+ref+"&sz=1x1&m=text/javascript&c="+Math.random()+"&t=campaign%3D"+ref;
try{
window.pPlusUpsell(node, sz, {
header: pick.variant.header,
content: pick.variant.content,
button: pick.variant.button,
href: '/account/upsell?promo=' + encodeURIComponent(ref) + '&referrer=' + encodeURIComponent(frm)
});
//call impressions tracker
const t = new Image();
t.src = imp;
const upcard = node.querySelector(".upcard");
if (upcard){
upcard.addEventListener('click', function(){
const t = new Image();
t.src = imp.replace("impressions","clicks");
}, { passive: true });
}
} catch (e){}
}
async function loadAmazon(node) {
if (!node) {
return;
}
const ADUNIT = au;
const CLICK_MACRO = "https://adclick.g.doubleclick.net/pcs/click?xai=AKAOjstb86p7zQNQMgK69w_yMYMp6OstBDLCm3sRbHIBfluN7JD5_9Nk7B5BsvDbsvALcf0c0gkC6i-cRwP3fjQGn9Sri5468HlAnadl43Y9bKvb-UlI6ec3unWVWfvyrpS5McuzdxrmmAnVmvc0DFmLY7KDCxemZxLq_fFphxuff8_tvXEWol9rJn3KokP_bfRfZiYJ-BsN2QJyasvjxtoWXheXogOPnvHfk9rFjrYnHU3asnZg-pqhMal8uaM0eOlog-eKvEzADLcjXfMKGL70UMM-Bwr9tO3MsiVcvu3aWHVeFKeOEig7WN903IXRd8dbra3K_M1WgCTmKimkd3EQs1wHRBHdlkKmbOL_vIPSbnAMK5jcvh5na92wHe9cqKct4c48bY9HzJCD9-l4qrc4bjkBGWsJgJTJjEVnfzExG6HbfHUFDAU77iZwl6c&sai=AMfl-YSjTxsn4Z49_s0hD7INqbX9_2Y-IEQDturCFK9OwGj7-yk19PPmY7Pz4O1RwZEs8W1U8sCC_2Rn0N7t6kmTF-VQEG_OMAjETSET7TCorGzFVlTmBjem5T-TV4bLJELF-V2d4E1_KVOXXY-dQy8wFhl_3kbI_b546yBw_OmfiqseBCxcRqEFiH8b-thRtTlnWoKQr-mhctuq84Hc_luixaJ1_Q&sig=Cg0ArKJSzMFxfBYsBQqwEAE&fbs_aeid=%5Bgw_fbsaeid%5D&urlfix=1&adurl=";
function getRandomJsonFileURL() {
const defaultEndPoint = "LimitedTimeDeal";
const endPoints = {
IAB1: ["LimitedTimeDeal_ToysAndGames"], //Arts & Entertainment
IAB2: [
"LimitedTimeDeal_Automotive"
], //Auto
IAB3: [
"LimitedTimeDeal_Computers",
"LimitedTimeDeal_Electronics",
"LimitedTimeDeal_OfficeProducts",
], //Business
IAB4: ["LimitedTimeDeal_OfficeProducts"], //Careers
IAB5: ["LimitedTimeDeal_OfficeProducts"], //Education
IAB6: ["LimitedTimeDeal_HomeAndKitchen"], //Family & Parenting
IAB7: [
"LimitedTimeDeal_HealthPersonalCare",
"LimitedTimeDeal_ExerciseEquipment",
"LimitedTimeDeal_SportsAndOutdoors",
], //Health & Fitness
IAB8: ["LimitedTimeDeal_HomeAndKitchen"], //Food & Drink
IAB9: [
"LimitedTimeDeal_ToysAndGames",
"LimitedTimeDeal_MobileAndAccessories",
], //Hobbies
IAB10: [
"LimitedTimeDeal_GardenAndOutdoor",
"LimitedTimeDeal_HomeAndKitchen",
"LimitedTimeDeal_ToolsAndHomeImprovement",
"LimitedTimeDeal_Appliances",
], //Home & Garden
IAB11: [], //Law Govt
IAB12: [], //News
IAB13: [
"LimitedTimeDeal_Computers",
"LimitedTimeDeal_Electronics",
"LimitedTimeDeal_MobileAndAccessories",
], //Personal Finance
IAB14: [], //Society
IAB15: [], //Science
IAB16: ["LimitedTimeDeal_PetSupplies"], //Pets
IAB17: [
"LimitedTimeDeal_ExerciseEquipment",
"LimitedTimeDeal_SportsAndOutdoors"
], //Sports
IAB18: [
"LimitedTimeDeal_HealthPersonalCare",
"LimitedTimeDeal_LuxuryBeauty",
"LimitedTimeDeal_Jewelry",
], //Style & Fashion
IAB19: [
"LimitedTimeDeal_Computers",
"LimitedTimeDeal_Electronics",
"LimitedTimeDeal_MobileAndAccessories",
], //Tech & Computing
IAB20: [
"LimitedTimeDeal_Luggage"
], //Travel
IAB21: [], //Real Estate
IAB22: [
"LimitedTimeDeal_HomeAndKitchen",
"LimitedTimeDeal_Electronics",
"LimitedTimeDeal_Jewelry",
], //Shopping
};
// Safely get segments
const data = window.gamera?.getPrebidSegments?.();
const segments = data?.user?.data?.[0]?.segment || [];
// Determine the first segment ID that has endpoints defined
let selectedEndpoints = [];
for (const seg of segments) {
const matches = endPoints[seg.id];
if (matches && matches.length > 0) {
selectedEndpoints = matches;
break; // stop after finding the first match (priority order)
}
}
// Pick a random endpoint or fall back to default
const chosenEndPoint =
selectedEndpoints.length > 0
? selectedEndpoints[Math.floor(Math.random() * selectedEndpoints.length)]
: defaultEndPoint;
// Construct and return the final URL
return `https://www.accuweather.com/adops/amazon/${chosenEndPoint}.json`;
}
function pickRandomItemWithSavings(items) {
const eligible = items.filter(item =>
asArray(_get(item, "Offers.Listings")).some(listing =>
_get(listing, "Price.Savings") != null
)
);
if (eligible.length) {
return eligible[Math.floor(Math.random() * eligible.length)];
}
// fallback: no items with Savings found
return items[Math.floor(Math.random() * items.length)];
}
const _get = (o, p) => p.split(".").reduce((a, k) => (a && a[k] != null ? a[k] : undefined), o);
const has = (v) => v !== undefined && v !== null && v !== "";
const pick = (o, paths) => {
for (const p of paths) {
const v = p.includes(".") ? _get(o, p) : o ? o[p] : undefined;
if (has(v)) return v;
}
};
const asArray = (v) => (Array.isArray(v) ? v : v ? [v] : []);
const buildGetClickUrl = ((adunit) => {
const parts = (adunit || "").split("/");
const platform = parts[2] || "";
const position = parts[4] || "";
const page = (parts[6] || "").replaceAll("-v", "").replaceAll("-p", "");
const tP = ["web", "mweb", "ios", "android"],
tPos = ["top", "top_right", "middle"],
tPg = ["country_home", "local_home", "hourly", "daily", "extended", "news", "radar", "month", "current"];
return (url) => {
let code = "accuweathe075-20";
if (!tP.includes(platform)) code = "accuweathe075-20";
else if (!tPos.includes(position)) code = `aw-${platform}-default-20`;
else if (!tPg.includes(page)) code = `aw-${platform}-${position}-default-20`;
else code = `aw-${platform}-${position}-${page}-20`;
return (url || "").replaceAll("accuweathe075-20", code);
};
})(ADUNIT);
if (!document.getElementById("amazon-ad-css")) {
const css = `
.house-ad{padding:0;display:block;background:none;text-align: left;}
.awNativeAdWrapper .awNativeCard{position:relative;width:100%;min-width:300px;min-height:250px;height:auto;display:flex;flex-direction:column;border-radius:6px;overflow:hidden;font-family:solis,system-ui,-apple-system,Segoe UI,Roboto,Arial;margin:0 auto;box-shadow:0 2px 8px rgba(0,0,0,.12)}
.awNativeAdWrapper .topHeadline{padding:8px 16px;font-size:13px;text-transform:uppercase;background:#000;color:#fff}
.awNativeAdWrapper .awNativeCard a.mainBanner{position:relative;display:block;text-decoration:none;color:inherit;background-repeat:no-repeat;background-position:left center;background-size:contain;background-color:#fff;flex:1 1 auto;min-height:240px}
.awNativeAdWrapper .awNativeCard .priceBlock{position:absolute;top:10px;right:10px;text-align:right;z-index:2}
.awNativeAdWrapper .limitedButton{background:#ce0539;padding:6px 10px;font-size:12px;color:#fff;border-radius:6px;font-weight:700;text-transform:uppercase;display:inline-block;margin-bottom:6px}
.awNativeAdWrapper .priceArea{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin-bottom:2px}
.awNativeAdWrapper .discountPercent{color:#ce0539;font-size:20px;font-weight:700;line-height:1}
.awNativeAdWrapper .price{color:#000;background:rgba(255,255,255,.92);padding:2px 6px;border-radius:4px;font-size:18px;font-weight:700;line-height:1}
.awNativeAdWrapper .price sup{vertical-align:text-top;font-size:10px}
.awNativeAdWrapper .listPrice{display:block;color:#333;font-size:11px;background:rgba(255,255,255,.85);padding:1px 6px;border-radius:4px}
.awNativeAdWrapper .awNativeCard .bottomPart{position:absolute;left:0;right:0;bottom:0;padding:10px;background:rgba(0,0,0,0.7);color:#fff;z-index:1}
.awNativeAdWrapper .headline{font-size:15px;font-weight:500;line-height:1.3;text-shadow:0 1px 3px rgba(0,0,0,.6);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}
.awNativeAdWrapper .awNativeCard .cardCta{display:flex;align-items:center;justify-content:center;width:100%;background:#f05514;color:#fff;font-weight:700;font-size:13px;padding:10px 14px;text-decoration:none;gap:8px}`;
const style = document.createElement("style");
style.id = "amazon-ad-css";
style.textContent = css;
document.head.appendChild(style);
}
const findItemsArray = (x) => {
const direct = _get(x, "Items");
if (Array.isArray(direct) && direct.length) return direct;
for (const p of ["ItemsResult.Items", "items", "deals", "products", "results"]) {
const arr = _get(x, p);
if (Array.isArray(arr) && arr.length) return arr;
}
return [];
};
const itemToHtml = (item) => {
const detail = _get(item, "DetailPageURL") || "#";
const clickUrl = buildGetClickUrl(detail);
const lightning = buildGetClickUrl(
"https://www.amazon.com/deals?bubble-id=deals-collection-lightning-deals&tag=accuweathe075-20"
);
const img = pick(item, ["Images.Primary.Large.URL", "Images.Primary.Medium.URL"]) || "";
const listing = asArray(_get(item, "Offers.Listings"))[0] || {};
const price = listing.Price || {};
const display = price.DisplayAmount || "", amt = price.Amount;
const pHtml = display ? `