<head prefix=»og: https://ogp.me/ns# article: https://ogp.me/ns/article#»><script type=»application/ld+json»><![CDATA[{»@context»:»https://schema.org»,»@id»:»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»,»@type»:»NewsArticle»,»articleSection»:»News»,»author»:{»@type»:»Person»,»description»:»George is a News Reporter who joined GB News from Stoke-on-TrentLive in November 2023. He has substantial experience in digital journalism, having previously worked for Sky News, British Forces Broadcasting Service and The Burton Mail. He is passionate about local news, live music and international politics. Contact: george.bunn@gbnews.uk»,»identifier»:»https://www.gbnews.com/authors/george-bunn»,»image»:{»@type»:»ImageObject»,»height»:512,»url»:»https://www.gbnews.com/media-library/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy82MTYzMDY4Mi9vcmlnaW4uanBnIiwiZXhwaXJlc19hdCI6MTgwNzMyMzQxOH0.88t9GjQk6KyTz4Rqw2foQ7lRNZhwZXMBbz3zri9D6QE/image.jpg?width=210″,»width»:512},»name»:»George Bunn»,»url»:»https://www.gbnews.com/authors/george-bunn»},»dateModified»:»2026-04-18T17:42:56Z»,»datePublished»:»2026-04-18T17:40:34Z»,»description»:»Parents at a Derbyshire secondary school have expressed fury over claims their children were informed that British attire would be prohibited during a special cultural celebration event.Anthony Meakin, whose daughter attends Noel-Baker Academy in Alvaston, said he was outraged after learning of the ...»,»headline»:»Derbyshire news: Parents fuming after children told they would be sent home on ‘Culture Day’ for wearing British costumes – but school hits back»,»image»:{»@type»:»ImageObject»,»height»:600,»url»:»https://www.gbnews.com/media-library/noel-baker-academy.png?id=65570751&width=1200&height=600&coordinates=0%2C184%2C0%2C184″,»width»:1200},»inLanguage»:»en-GB»,»keywords»:[»News»,»SGG»,»East Midlands»,»Across the UK»],»mainEntityOfPage»:{»@id»:»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»,»@type»:»WebPage»},»publisher»:{»@type»:»NewsMediaOrganization»,»logo»:{»@type»:»ImageObject»,»url»:»https://www.gbnews.com/media-library/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMzEwMDg4MS9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTc5NzY2ODQ5OX0.yPkj1VxfBk72KU9hNSQwXmOcRlz79vywCKtwhL4rbwA/image.png?width=210″},»name»:»GB News»,»sameAs»:[»https://www.facebook.com/GBNewsOnline»,»https://x.com/GBNEWS»,»https://www.instagram.com/gbnews/»,»https://www.linkedin.com/company/gb-news/»,»https://www.youtube.com/channel/UC0vn8ISa4LKMunLbzaXLnOQ»,»https://www.tiktok.com/@gbnews»,»https://bsky.app/profile/gbnewsonline.bsky.social»,»https://www.threads.net/@gbnews»]},»thumbnailUrl»:»https://www.gbnews.com/media-library/noel-baker-academy.png?id=65570751&width=1200&height=600&coordinates=0%2C184%2C0%2C184″,»url»:»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»}]]></script><script type=»application/ld+json»><![CDATA[{»@context»:»https://schema.org»,»@type»:»VideoObject»,»contentUrl»:»https://www.gbnews.com/res/scraper/embed/?video_url=https%3A%2F%2Fmm-v2.simplestream.com%2Fiframe%2Fplayer.php%3Fkey%3D3Li3Nt2Qs8Ct3Xq9Fi5Uy0Mb2Bj0Qs%26player%3DGB003%26uvid%3D53285822%26type%3Dvod%26viously_id%3D»,»description»:»Noel-Baker Academy in Alvaston has strongly denied the claims»,»embedUrl»:»https://www.gbnews.com/res/scraper/embed/?video_url=https%3A%2F%2Fmm-v2.simplestream.com%2Fiframe%2Fplayer.php%3Fkey%3D3Li3Nt2Qs8Ct3Xq9Fi5Uy0Mb2Bj0Qs%26player%3DGB003%26uvid%3D53285822%26type%3Dvod%26viously_id%3D»,»keywords»:[»News»,»SGG»,»East Midlands»,»Across the UK»],»name»:»Derbyshire news: Parents fuming after children told they would be sent home on ‘Culture Day’ for wearing British costumes – but school hits back»,»publisher»:{»@type»:»Organization»,»logo»:{»@type»:»ImageObject»,»url»:»https://www.gbnews.com/media-library/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMzEwMDg4MS9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTc5NzY2ODQ5OX0.yPkj1VxfBk72KU9hNSQwXmOcRlz79vywCKtwhL4rbwA/image.png?width=210″},»name»:»GB News»,»sameAs»:[»https://www.facebook.com/GBNewsOnline»,»https://x.com/GBNEWS»,»https://www.instagram.com/gbnews/»,»https://www.linkedin.com/company/gb-news/»,»https://www.youtube.com/channel/UC0vn8ISa4LKMunLbzaXLnOQ»,»https://www.tiktok.com/@gbnews»,»https://bsky.app/profile/gbnewsonline.bsky.social»,»https://www.threads.net/@gbnews»]},»thumbnailUrl»:[»https://www.gbnews.com/media-library/noel-baker-academy.png?id=65570751&width=980″],»uploadDate»:»2026-04-18T17:40:34Z»,»url»:»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»}]]></script><meta charset=»utf-8″/><link rel=»preload» as=»font» href=»https://fonts.gstatic.com/s/montserrat/v25/JTUSjIg1_i6t8kCHKm459WlhyyTh89Y.woff2″ type=»font/woff2″ crossorigin=»»/><meta name=»robots» content=»max-image-preview:large»/><link rel=»preload» imagesrcset=»https://www.gbnews.com/media-library/uniforms-create-sameness-commentator-weighs-in-on-restrictive-school-dress-after-gb-news-report-gb-news.jpg?id=65570750&;width=1245&;height=700&;quality=85&;coordinates=0%2C0%2C1%2C0 3x, https://www.gbnews.com/media-library/uniforms-create-sameness-commentator-weighs-in-on-restrictive-school-dress-after-gb-news-report-gb-news.jpg?id=65570750&;width=1245&;height=700&;quality=85&;coordinates=0%2C0%2C1%2C0 2x, https://www.gbnews.com/media-library/uniforms-create-sameness-commentator-weighs-in-on-restrictive-school-dress-after-gb-news-report-gb-news.jpg?id=65570750&;width=1245&;height=700&;quality=85&;coordinates=0%2C0%2C1%2C0 1x» as=»image» fetchpriority=»high»/><link rel=»canonical» href=»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»/><meta property=»fb:app_id» content=»3642″/><meta name=»twitter:site» content=»@GBNews»/><meta name=»twitter:site:id» content=»1339166129110065152″/><meta property=»og:type» content=»article»/><meta property=»article:section» content=»News»/><meta property=»og:url» content=»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»/><meta property=»og:site_name» content=»GB News»/><meta property=»og:image» content=»https://www.gbnews.com/media-library/noel-baker-academy.png?id=65570751&;width=1200&;height=600&;coordinates=0%2C302%2C0%2C66″/><meta property=»og:image:width» content=»1200″/><meta property=»og:image:height» content=»600″/><meta property=»og:title» content=»Derbyshire news: Parents fuming after children told they would be banned from wearing British costumes on ‘Culture Day’ – but school hits back»/><meta property=»og:description» content=»Noel-Baker Academy in Alvaston has strongly denied the claims»/><meta name=»description» content=»Parents at a Derbyshire secondary school have expressed fury over claims their children were informed that British attire would be prohibited during a special cultural celebration event»/><meta name=»referrer» content=»always»/><meta name=»twitter:card» content=»summary_large_image»/><meta name=»twitter:image» content=»https://www.gbnews.com/media-library/noel-baker-academy.png?id=65570751&;width=1200&;height=600&;coordinates=0%2C302%2C0%2C66″/><link rel=»preconnect» href=»https://assets.rebelmouse.io/» crossorigin=»anonymous»/><link rel=»preconnect» href=»https://user-stats.rbl.ms/» crossorigin=»anonymous»/><link rel=»preconnect» href=»https://pages-stats.rbl.ms/» crossorigin=»anonymous»/><!–link rel=»preload» href=»https://static.rbl.ms/static/fonts/fontawesome/fontawesome-mini.woff» as=»font» type=»font/woff2″ crossorigin–><script class=»rm-i-script»><![CDATA[window.REBELMOUSE_BOOTSTRAP_DATA = {»isUserLoggedIn»: false, «site»: {»id»: 25354495, «isCommunitySite»: false}, «runner»: {»id»: 25354495}, «post»: {»id»: 2676762030, «sections»: [0, 584086272, 2262988002, 588563272, 586304622, 2260688433, 590311187, 586304181, 586311833, 588563322], «shareUrl»: «https%3A%2F%2Fwww.gbnews.com%2Fnews%2Fderbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home», «status»: 0, «tags»: []}, «path»: «/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home», «pathParams»: {»sections»: «news/», «slug»: «derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home»}, «resourceId»: «pp_2676762030″, «fbId»: «3642», «fbAppVersion»: «v2.5″, «clientGaId»: «», «messageBusUri»: «wss://messages.rebelmouse.io», «section»: {»id»: null}, «tag»: {»slug»: null, «isSection»: false}, «fullBootstrapUrl»: «/res/bootstrap/data.js?site_id=25354495\u0026resource_id=pp_2676762030\u0026path_params=%7B%22sections%22%3A%22news%2F%22%2C%22slug%22%3A%22derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home%22%7D\u0026override_device=desktop\u0026post_id=2676762030″, «whitelabel_menu»: {}, «useRiver»: true, «engine»: {»recaptchaSiteKey»: null, «lazyLoadShortcodeImages»: true, «backButtonGoToPage»: true, «changeParticleUrlScroll»: false, «countKeepReadingAsPageview»: true, «defaultVideoPlayer»: «», «theoPlayerLibraryLocation»: «», «trackPageViewOnParticleUrlScroll»: false, «webVitalsSampleRate»: 100, «overrideDevicePixelRatio»: null, «image_quality_level»: 85, «sendEventsToCurrentDomain»: false, «enableLoggedOutUserTracking»: false, «useSmartLinks2″: true, «enableRunnerCss»: true}};
 ]]></script><script class=»rm-i-script»><![CDATA[window.REBELMOUSE_BASE_ASSETS_URL = «https://www.gbnews.com/static/dist/social-ux/»;
 window.REBELMOUSE_BASE_SSL_DOMAIN = «https://www.gbnews.com»;
 window.REBELMOUSE_TASKS_QUEUE = [];
 window.REBELMOUSE_LOW_TASKS_QUEUE = [];
 window.REBELMOUSE_LOWEST_TASKS_QUEUE = [];
 window.REBELMOUSE_ACTIVE_TASKS_QUEUE = [];
 window.REBELMOUSE_STDLIB = {};
 window.RM_OVERRIDES = {};
 window.RM_AD_LOADER = [];
 ]]></script><script src=»https://www.gbnews.com/static/dist/social-ux/main.e904fda0cc1755b4dd4c.bundle.mjs» class=»rm-i-script» type=»module» async=»async» data-js-app=»true» data-src-host=»https://www.gbnews.com» data-src-file=»main.mjs»/><script src=»https://www.gbnews.com/static/dist/social-ux/main.667462a920874f59f5f4.bundle.js» class=»rm-i-script» nomodule=»nomodule» defer=»defer» data-js-app=»true» data-src-host=»https://www.gbnews.com» data-src-file=»main.js»/><script src=»https://www.gbnews.com/static/dist/social-ux/runtime.a0845c2239181f89813b.bundle.mjs» class=»rm-i-script» type=»module» async=»async» data-js-app=»true» data-src-host=»https://www.gbnews.com» data-src-file=»runtime.mjs»/><script src=»https://www.gbnews.com/static/dist/social-ux/runtime.38cb9714fb6f2dc3afb0.bundle.js» class=»rm-i-script» nomodule=»nomodule» defer=»defer» data-js-app=»true» data-src-host=»https://www.gbnews.com» data-src-file=»runtime.js»/><!– we collected enough need to fix it first before turn in back on–><!–script src=»//cdn.ravenjs.com/3.16.0/raven.min.js» crossorigin=»anonymous»></script–><!–script type=»text/javascript»>
 Raven.config(’https://6b64f5cc8af542cbb920e0238864390a@sentry.io/147999’).install();
 </script–><link rel=»manifest» href=»/manifest.json»/><meta name=»theme-color» content=»#647187″/><script class=»rm-i-script»><![CDATA[
 if (’serviceWorker’ in navigator) {
 window.addEventListener(’load’, function() {
 navigator.serviceWorker.register(’/sw.js’).then(function(registration) {
 console.log(’ServiceWorker registration successful with scope: ‘, registration.scope);
 }, function(err) {
 console.log(’ServiceWorker registration failed: ‘, err);
 });
 });
 } else {
 console.log(’ServiceWorker not enabled’);
 }
 ]]></script><script class=»rm-i-script»><![CDATA[
 // fallback error prone google tag setup
 var googletag = googletag || {};
 googletag.cmd = googletag.cmd || [];
 ]]></script><meta http-equiv=»X-UA-Compatible» content=»IE=edge»/><link rel=»alternate» type=»application/rss+xml» title=»GB News» href=»/feeds/news.rss»/><meta name=»viewport» content=»width=device-width,initial-scale=1,minimum-scale=1.0″/><!– TODO: move the default value from here –><title>Derbyshire news: Parents fuming after children told they would be sent home on ‘Culture Day’ for wearing British costumes – but school hits back</title><script class=»rm-i-script»><![CDATA[
 window.REBELMOUSE_LOW_TASKS_QUEUE.push(function() {
 if(window.REBELMOUSE_BOOTSTRAP_DATA.engine.enableRunnerCss){
 window.REBELMOUSE_STDLIB.loadExternalStylesheet(»/static/css-build/roar/runner/social-ux-non-critical.css?v=rmxassets9f85b614d0482c26a5f33e04e87319ff», function(){
 document.body.classList.add(»rm-non-critical-loaded»);
 });
 }
 });
 ]]></script><script class=»rm-i-script»><![CDATA[
 var __RUNNER_PUBLIC__ = {
 root: ‘#runner-root’,
 events: {
 PAGE_VIEW: ‘page_view.url_change.listicle_switch_page’,
 URL_CHANGE_PAGE_VIEW: ‘page_view.url_change’,
 LISTICLE_CHANGE_PAGE_VIEW: ‘page_view.listicle_switch_page’
 }
 }
 ]]></script><script class=»rm-i-script»><![CDATA[
 window.__rebelmouseJsBaseUrl = «/static/js-build/»;
 
 window.__rebelmousePrimaryColor = «#000F55″;
 
 ]]></script><link rel=»apple-touch-icon» href=»https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMjYyMTMwMy9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTgxNDg2NzYyOX0.IYprghyeE3T3jw0kNaO7OI15smHQyaNF8bdZyegluY8/img.png?width=192&;height=192″ sizes=»192×192″/><link rel=»icon» type=»image/png» href=»https://assets.rebelmouse.io/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMjYyMTMwMy9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTgxNDg2NzYyOX0.IYprghyeE3T3jw0kNaO7OI15smHQyaNF8bdZyegluY8/img.png?width=48&;height=48″ sizes=»48×48″/><script type=»application/json» data-abtest-name=»socialux» data-abtest-value=»1″/><meta property=»article:published_time» content=»2026-04-18T17:40:34+00:00″/><meta property=»article:modified_time» content=»2026-04-18T17:42:56+00:00″/><script type=»application/json» data-abtest-name=»empty» data-abtest-value=»css»/><script type=»application/json» data-abtest-name=»schema» data-abtest-value=»2028″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»16″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4690″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4591″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4645-2″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4655″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4617″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4615″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4600″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»vod-inder»/><script type=»application/json» data-abtest-name=»primis» data-abtest-value=»dedicated»/><script type=»application/json» data-abtest-name=»ce» data-abtest-value=»2″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4238″/><script type=»application/json» data-abtest-name=»test» data-abtest-value=»1″/><script><![CDATA[

]]></script><meta name=»apple-itunes-app» content=»app-id=1566365113, app-argument=gbnews://articles/2676762030″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4709″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4645″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4605-2″/><script type=»application/json» data-abtest-name=»GBN» data-abtest-value=»2117″/><script type=»application/json» data-abtest-name=»GBN» data-abtest-value=»2116″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4605″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4689″/><script type=»application/json» data-abtest-name=»FA» data-abtest-value=»709″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4645-1″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4627″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»anchoring»/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4606″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»cmps»/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»48″/><script><![CDATA[
 «use strict»;function _typeof(t){return(_typeof=»function»==typeof Symbol&&»symbol»==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&»function»==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?»symbol»:typeof t})(t)}!function(){var t=function(){var t,e,o=[],n=window,r=n;for(;r;){try{if(r.frames.__tcfapiLocator){t=r;break}}catch(t){}if(r===n.top)break;r=r.parent}t||(!function t(){var e=n.document,o=!!n.frames.__tcfapiLocator;if(!o)if(e.body){var r=e.createElement(»iframe»);r.style.cssText=»display:none»,r.name=»__tcfapiLocator»,e.body.appendChild(r)}else setTimeout(t,5);return!o}(),n.__tcfapi=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return o;»setGdprApplies»===n[0]?n.length>3&&2===parseInt(n[1],10)&&»boolean»==typeof n[3]&&(e=n[3],»function»==typeof n[2]&&n[2](»set»,!0)):»ping»===n[0]?»function»==typeof n[2]&&n[2]({gdprApplies:e,cmpLoaded:!1,cmpStatus:»stub»}):o.push(n)},n.addEventListener(»message»,(function(t){var e=»string»==typeof t.data,o={};if(e)try{o=JSON.parse(t.data)}catch(t){}else o=t.data;var n=»object»===_typeof(o)&&null!==o?o.__tcfapiCall:null;n&&window.__tcfapi(n.command,n.version,(function(o,r){var a={__tcfapiReturn:{returnValue:o,success:r,callId:n.callId}};t&&t.source&&t.source.postMessage&&t.source.postMessage(e?JSON.stringify(a):a,»*»)}),n.parameter)}),!1))};»undefined»!=typeof module?module.exports=t:t()}();
]]></script><script><![CDATA[
window._consentCallbacks = window._consentCallbacks || [];
window._consentReady = false;

window.runWhenConsentIsReady = function(callback) {
 if (window._consentReady && window._sp_?.consentUUID) {
 // console.log(’[runWhenConsentIsReady] Executing immediately – consent already ready’);
 callback(window._sp_.consentUUID, window._sp_.euconsent);
 return;
 }

 window._consentCallbacks.push(callback);
 // console.log(’[runWhenConsentIsReady] Callback queued. Total:’, window._consentCallbacks.length);
 
 // Add persistent event listener for consent changes
 if (typeof __tcfapi !== ‘undefined’ && !window._consentListenerAdded) {
 window._consentListenerAdded = true;
 
 __tcfapi(’addEventListener’, 2, function(tcData, success) {
 if (success && (tcData.eventStatus === ‘tcloaded’ || tcData.eventStatus === ‘useractioncomplete’)) {
 // console.log(’[runWhenConsentIsReady] TCF consent event received:’, tcData.eventStatus);
 
 if (!window._consentReady) {
 window._consentReady = true;
 
 if (window._sp_) {
 window._sp_.consentUUID = tcData.tcString;
 window._sp_.euconsent = tcData;
 }
 
 const callbacks = window._consentCallbacks.slice();
 window._consentCallbacks = [];
 
 callbacks.forEach(function(cb, index) {
 try {
 // console.log(’[runWhenConsentIsReady] Executing callback’, index + 1);
 cb(tcData.tcString, tcData);
 } catch (error) {
 console.error(’[runWhenConsentIsReady] Error in callback’, index + 1, error);
 }
 });
 }
 }
 });
 }
 
 // Also check immediately in case consent is already available
 setTimeout(function() {
 if (typeof __tcfapi !== ‘undefined’ && !window._consentReady) {
 __tcfapi(’getTCData’, 2, function(tcData, success) {
 if (success && (tcData.eventStatus === ‘tcloaded’ || tcData.eventStatus === ‘useractioncomplete’)) {
 // console.log(’[runWhenConsentIsReady] TCF data already available, executing all callbacks now’);
 window._consentReady = true;
 
 if (window._sp_) {
 window._sp_.consentUUID = tcData.tcString;
 window._sp_.euconsent = tcData;
 }
 
 const callbacks = window._consentCallbacks.slice();
 window._consentCallbacks = [];
 
 callbacks.forEach(function(cb, index) {
 try {
 // console.log(’[runWhenConsentIsReady] Executing callback’, index + 1);
 cb(tcData.tcString, tcData);
 } catch (error) {
 console.error(’[runWhenConsentIsReady] Error in callback’, index + 1, error);
 }
 });
 }
 });
 }
 }, 50);
};

// Helper function to execute callbacks
function executeConsentCallbacks(consentUUID, euconsent) {
 if (!window._consentReady) {
 window._consentReady = true;
 
 const callbacks = window._consentCallbacks.slice();
 window._consentCallbacks = [];
 
 callbacks.forEach(function(cb, index) {
 try {
 // console.log(’[executeConsentCallbacks] Executing callback’, index + 1);
 cb(consentUUID, euconsent);
 } catch (error) {
 console.error(’[executeConsentCallbacks] Error in callback’, index + 1, error);
 }
 });
 }
}

if (window.navigator.brave != undefined) { 
 if (window.navigator.brave.isBrave.name == «isBrave») { 
 // console.log(»THIS IS THE BRAVE BROWSER»);
 } 
} else {
 // console.log(»sp_subscribed_status:», document.cookie.split(’; ‘).find(row => row.startsWith(’sp_subscribed_status=’))?.split(’=’)[1] || «false»);

 window._sp_queue = [];
 window._sp_ = {
 config: {
 accountId: 1836,
 baseEndpoint: ‘https://cdn.privacy-mgmt.com’,
 gdpr: { },
 targetingParams:{ 
 subscribed: document.cookie.split(’; ‘).find(row => row.startsWith(’sp_subscribed_status=’))?.split(’=’)[1] || «false» 
 },
 events: {
 onMessageReady: function() {
 // console.log(’[event] onMessageReady’, arguments);
 },
 onMessageReceiveData: function() {
 // console.log(’[event] onMessageReceiveData’, arguments);
 },
 onSPPMObjectReady: function() {
 // console.log(’[event] onSPPMObjectReady’, arguments);
 },
 onSPReady: function() {
 // console.log(’[event] onSPReady’, arguments);
 },
 onError: function() {
 // console.log(’[event] onError’, arguments);
 },
 onMessageChoiceSelect: function() {
 // console.log(’[event] onMessageChoiceSelect’, arguments);
 },
 onConsentReady: function(consentUUID, euconsent) {
 // console.log(’[event] onConsentReady’, arguments);
 // Execute queued callbacks when consent is ready
 executeConsentCallbacks(consentUUID, euconsent);
 },
 onPrivacyManagerAction: function() {
 // console.log(’[event] onPrivacyManagerAction’, arguments);
 },
 onPMCancel: function() {
 // console.log(’[event] onPMCancel’, arguments);
 }
 }
 }
 }

 let script;
 script = document.createElement(»script»);
 script.src=»https://cdn.privacy-mgmt.com/unified/wrapperMessagingWithoutDetection.js»
 script.async = true;
 document.head.appendChild(script);
}
 
]]></script><!– <script src=»https://cdn.privacy-mgmt.com/unified/wrapperMessagingWithoutDetection.js» async></script> –><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4380″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4619″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4589″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4445″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4120-merge»/><script><![CDATA[
 window.dataLayer = window.dataLayer || [];
 window.gbnConfig = {
 «dataLayer»: {
 «cd30″: «default»,
 «cd35″: «mv_test_5″,
 «cd36″: 1
 }
 }
 // 1. Update OB_ContextKeyValue
 window.OB_ContextKeyValue = window.gbnConfig.dataLayer.cd30;

 function injectOBScript() {
 const ob_script = document.createElement(’script’);
 ob_script.innerHTML = «window.OB_ContextKeyValue='» + window.gbnConfig.dataLayer.cd30 + «‘»;
 document.body.appendChild(ob_script);
 }

 if (document.readyState === ‘loading’) {
 document.addEventListener(’DOMContentLoaded’, injectOBScript);
 } else {
 injectOBScript();
 }


 // 2. Update testVariant
 window.testVariant = window.gbnConfig.dataLayer.cd30;


 function getUserStatusCookieValue(name) {
 const cookies = document.cookie.split(’; ‘);
 for (const cookie of cookies) {
 const [key, value] = cookie.split(’=’);
 if (key === name) {
 return decodeURIComponent(value);
 }
 }
 return null;
 }

 
 window.userStatus = getUserStatusCookieValue(’access_status_gbn’);
 
]]></script><script type=»application/json» data-abtest-name=»test» data-abtest-value=»14″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»sponsored»/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4673″/><script type=»application/json» data-abtest-name=»GBN» data-abtest-value=»1814″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4417″/><link rel=»manifest» href=»/manifest.json»/><script type=»application/json» data-abtest-name=»ce» data-abtest-value=»1″/><script type=»application/json» data-abtest-name=»gbn» data-abtest-value=»2079″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4342″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4254″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»2380″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»3569-rep»/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4715″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4662″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4620″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4538″/><script type=»application/json» data-abtest-name=»gbn» data-abtest-value=»2046″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»2853″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»7″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4475″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4577″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4426″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4342-old»/><script type=»application/json» data-abtest-name=»v» data-abtest-value=»milosalert»/><script><![CDATA[
 window.dataLayer = window.dataLayer || [];var contentType = «article»;contentType = «article»;let displayMode = ‘ ‘;
 
if (window.matchMedia(’(display-mode: standalone)’).matches) {
 displayMode = ‘pwa’;
} else {
 displayMode = ‘web’;
}
 
console.log(’display mode – ‘, `»${displayMode}»`);window.dataLayer.push({
 «cd1″: «06»,
 «cd2″: «06»,
 «cd9″: «news»,
 «cd10″: «article»,
 «cd11″: displayMode, 
 «cd12″: «2676762030»,
 «cd13″: «parents fuming after children told they would be banned from wearing british costumes on ‘culture day’ – but school hits back»,
 «cd14″: «george bunn»,
 «cd15″: «2026-04-18″,
 «cd16″: «18:40″,
 «cd17″: «2026-04-18″,
 «cd18″: «news|sgg|article|east midlands|homepage top20|content type|don’t miss – articles|across the uk»,
 «cd19″: document.referrer.split(»/»)[2]||»not set»,
 «cd23″: «not set»,
 «cd30″: window.gbnConfig.dataLayer.cd30,
 «cd31″: userStatus === null ? «» : userStatus,
 ‘cd35’: window.gbnConfig.dataLayer.cd35,
 ‘cd36’: window.gbnConfig.dataLayer.cd36,
 ‘cd37’: «post discovery layout»,
 ‘cd40’: false
})
]]></script><!– User Code –><!– Google Tag Manager –><script><![CDATA[


 //MOVED TO delayedCmpScript shared element




 // window.runWhenConsentIsReady(() => {
 // console.log(’Consent is ready, loading GTM Primary...’);
 // (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({’gtm.start’:
 // new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
 // j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:»;j.async=true;j.src=
 // ‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
 // })(window,document,’script’,’dataLayer’,’GTM-MFGM96D7’);

 // console.log(’Consent is ready, injecting GTM Primary iframe’);

 // const iframe = document.createElement(’iframe’);
 // iframe.src = «https://www.googletagmanager.com/ns.html?id=GTM-MFGM96D7″;
 // iframe.height = «0»;
 // iframe.width = «0»;
 // iframe.style.display = «none»;
 // iframe.style.visibility = «hidden»;
 // document.body.appendChild(iframe);


 // });
]]></script><!– End Google Tag Manager –><!– Google Tag Manager (noscript) –><noscript><!– <iframe
 src=»https://www.googletagmanager.com/ns.html?id=GTM-MFGM96D7″
 height=»0″
 width=»0″
 style=»display:none;visibility:hidden»></iframe> –></noscript><!– End Google Tag Manager (noscript) –><!– End User Code –><link rel=»preload» href=»https://www.gbnews.com/media-library/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbWFnZSI6Imh0dHBzOi8vYXNzZXRzLnJibC5tcy8zMzAyMTkwOS9vcmlnaW4ucG5nIiwiZXhwaXJlc19hdCI6MTY3Njk2OTY2Mn0.Zvn26EqsfixGMQPCZnuayrrW9mG_7kGjNuXRc3mRrBk/image.png?width=284&;height=102″ as=»image»/><!—–post——-><link href=»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home» hreflang=»en» rel=»alternate»/><link href=»https://www.gbnews.com/news/derbyshire-news-parents-fuming-children-wearing-british-costumes-sent-home» hreflang=»x-default» rel=»alternate»/><!————><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4384″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»3771-fix»/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4108″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»13″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4198″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»3877″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»3569″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»2456″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4591-old»/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4182″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»4645-old»/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»9″/><script type=»application/json» data-abtest-name=»dp» data-abtest-value=»telegraph»/><script type=»application/json» data-abtest-name=»short» data-abtest-value=»trend»/><script class=»rm-i-script»><![CDATA[
 
 (function() {
 var cookie = ‘rebelmouse_abtests=’;
 cookie += ‘; Max-Age=0’;
 document.cookie = cookie + ‘; Path=/; SameSite=None; Secure’;
})();
 
 ]]></script><!–[if IE]>
 <script type=»text/javascript» src=»/static/js-build/libs/html5shiv/html5shiv.js»></script>
 <![endif]–></head><body class=»logged-out-user section-news» id=»WPAuto_Base_ReadabilityBody»><p/><p/><p/><div class=»all-content-wrapper»><div class=»main v-sep»><script><![CDATA[

 // GBN Wrapper
 const loadAds = () => {

 // Teal
 const jBids = document.createElement(’script’);
 jBids.src = ‘https://j.bids.ws/gbnews/gam’;
 jBids.async = true;
 document.head.appendChild(jBids);
 
 // console.log(’Consent is ready, loading Teal...’);

 }
 const loadGTM = () => {
 //GTM Primary
 // console.log(’Consent is ready, loading GTM Primary...’);
 (function (w, d, s, l, i) {
 w[l] = w[l] || []; w[l].push({
 ‘gtm.start’:
 new Date().getTime(), event: ‘gtm.js’
 }); var f = d.getElementsByTagName(s)[0],
 j = d.createElement(s), dl = l != ‘dataLayer’ ? ‘&l=’ + l : »; j.async = true; j.src =
 ‘https://www.googletagmanager.com/gtm.js?id=’ + i + dl; f.parentNode.insertBefore(j, f);
 })(window, document, ‘script’, ‘dataLayer’, ‘GTM-MFGM96D7’);

 // console.log(’Consent is ready, injecting GTM Primary iframe’);

 const iframe = document.createElement(’iframe’);
 iframe.src = «https://www.googletagmanager.com/ns.html?id=GTM-MFGM96D7″;
 iframe.height = «0»;
 iframe.width = «0»;
 iframe.style.display = «none»;
 iframe.style.visibility = «hidden»;
 document.body.appendChild(iframe);

 //GTM Secondary
 // console.log(’Consent is ready, loading GTM Secondary...’);
 (function (w, d, s, l, i) {
 w[l] = w[l] || []; w[l].push({
 ‘gtm.start’:
 new Date().getTime(), event: ‘gtm.js’
 }); var f = d.getElementsByTagName(s)[0],
 j = d.createElement(s), dl = l != ‘dataLayer’ ? ‘&l=’ + l : »; j.async = true; j.src =
 ‘https://www.googletagmanager.com/gtm.js?id=’ + i + dl; f.parentNode.insertBefore(j, f);
 })(window, document, ‘script’, ‘dataLayer’, ‘GTM-PCG4W7Z’);

 // console.log(’Consent is ready, injecting GTM secondary iframe’);

 const iframeSec = document.createElement(’iframe’);
 iframeSec.src = «https://www.googletagmanager.com/ns.html?id=GTM-PCG4W7Z»;
 iframeSec.height = «0»;
 iframeSec.width = «0»;
 iframeSec.style.display = «none»;
 iframeSec.style.visibility = «hidden»;
 document.body.appendChild(iframeSec);
 }
 const loadCxense = () => {
 // CXENSE
 // console.log(’Consent is ready, loading Cxense...’);
 var cX = cX || {}; cX.callQueue = cX.callQueue || [];
 cX.callQueue.push([’invoke’, function() {
 cX.getUserSegmentIds({persistedQueryId:’66b7f784a39745589e36e7fbc9d213f800d309f3’, callback: function(response) {
 window.cXsegmentIds = response;
 }});
 }]);

 (function(d,s,e,t){e=d.createElement(s);e.type=’text/java’+s;e.async=’async’;
 e.src=’http’+(’https:’===location.protocol?’s://s’:’://’)+’cdn.cxense.com/cx.js’;
 t=d.getElementsByTagName(s)[0];t.parentNode.insertBefore(e,t);})(document,’script’);
 tp.push([»setCxenseSiteId», «5858448894304938394»]);
 }
 const loadWunderkind = () => {
 
 let accessStatusFromWindowObj14 = window.userStatus;
 if (accessStatusFromWindowObj14 != ‘member’) {
 console.log(»user is not a member»);
 (function(d) { var e = d.createElement(’script’); e.src = d.location.protocol + ‘//tag.wknd.ai/7129/i.js’; e.async = true; d.getElementsByTagName(»head»)[0].appendChild(e); }(document));
 console.log(»wunderkind loaded»);
 } else {
 console.log(»user is a member, don’t load wunderkind»)
 }
 
 }
 const loadTaboola = () => {
 // A *global* property for queuing *all* Taboola commands on this page:
 window._taboola = window._taboola || [];

 // Fill in the page type, as provided by Taboola:
 _taboola.push({ article: ‘auto’ });

 !(function (e, f, u, i) {
 if (!document.getElementById(i)) {
 e.async = 1;
 e.src = u;
 e.id = i;
 f.parentNode.insertBefore(e, f);
 }
 // Fill in your Publisher ID (an alphabetic string, as provided by Taboola):
 })(
 document.createElement(’script’),
 document.getElementsByTagName(’script’)[0],
 ‘//cdn.taboola.com/libtrc/gbnews-website/loader.js’,
 ‘tb_loader_script’,
 );

 if (window.performance && typeof window.performance.mark == ‘function’) {
 window.performance.mark(’tbl_ic’);
 }
 };

 const loadLiveramp = () => {
 console.log(»loadLiveramp function has been called»);

 // Create preload link
 const preload = document.createElement(»link»);
 preload.rel = «preload»;
 preload.href = «https://launchpad.privacymanager.io/latest/launchpad.bundle.js»;
 preload.as = «script»;
 document.head.appendChild(preload);

 // Create script tag
 const script = document.createElement(»script»);
 script.src = «https://launchpad-wrapper.privacymanager.io/d2917174-06d1-4538-afd7-ffac883147d8/launchpad-liveramp.js»;
 script.async = true;
 script.defer = true;

 document.head.appendChild(script);
 };

 const requestPushwooshNotificationPopup = () => {
 var Pushwoosh = window.Pushwoosh || [];

 function requestNotificationPermission() {
 Pushwoosh.push([’init’, {
 serviceWorkerUrl: ‘https://www.gbnews.com/sw.js’,
 logLevel: ‘error’,
 applicationCode: ‘AB023-DEB30’,
 safariWebsitePushID: ‘web.com.gbnews’,
 defaultNotificationTitle: ‘GB News’,
 defaultNotificationImage: ‘https://assets.rbl.ms/34215656/origin.jpg’,
 autoSubscribe: false,
 subscribeWidget: {
 enable: false,
 },
 subscribePopup: {
 enable: true,
 text: ‘<b>GB News<p>Get free breaking news alerts?’,
 askLaterButtonText: ‘Maybe later’,
 confirmSubscriptionButtonText: ‘Sign up now!’,
 iconUrl: ‘https://assets.rbl.ms/34215656/origin.jpg’,
 delay: 2,
 retryOffset: 604800,
 overlay: true,
 position: ‘top’,
 bgColor: ‘#fff’,
 borderColor: ‘#0032aa’,
 boxShadow: ‘0 3px 6px rgba(0,0,0,0.16)’,
 textColor: ‘#0032AA’,
 textSize: ‘inherit’,
 fontFamily: ‘inherit’,
 subscribeBtnBgColor: ‘#0032aa’,
 subscribeBtnTextColor: ‘#fff’,
 askLaterBtnBgColor: ‘#fff’,
 askLaterBtnTextColor: ‘#0032aa’,
 theme: ‘material’,
 iconAlt: «gbn image»,
 },
 userId: ‘user_id’,
 tags: {
 ‘Name’: ‘John Smith’
 }
 }]);

 // Analytics
 Pushwoosh.push(function(api) {
 api.setTags({
 ‘Piano Visitor ID’: pa.getVisitorId(),
 });
 });
 }
 requestNotificationPermission();
 };


 
 window.runWhenConsentIsReady(() => {

 __tcfapi(’getTCData’, 2, function (tcData, success) {
 if (success) {
 if (window.location.href.includes(»/app-term-«)) {
 return;
 }
 
 const notNeeded = tcData.gdprApplies === false;
 const hasConsentData = tcData?.purpose?.consents && Object.keys(tcData.purpose.consents).length > 0;
 const hasAcceptedConsents = hasConsentData && Object.values(tcData.purpose.consents).some(consent => consent === true);


 if (notNeeded || hasAcceptedConsents) {
 // console.log(»Consent not required OR user accepted some consents – loading scripts»);
 
 loadAds();

 loadGTM();

 loadWunderkind();

 loadCxense();

 loadTaboola();

 loadLiveramp();

 requestPushwooshNotificationPopup();
 

 } else if (hasConsentData && !hasAcceptedConsents) {
 // console.log(»User has rejected all consents – NOT loading tracking scripts»);
 } else if (hasAcceptedConsents) {
 
 loadAds();
 loadGTM();
 loadWunderkind();
 loadCxense();
 loadTaboola();
 loadLiveramp();
 requestPushwooshNotificationPopup();
 
 } else if (notNeeded) {
 loadAds();
 loadTaboola();
 loadGTM();
 loadLiveramp();
 requestPushwooshNotificationPopup();
 setTimeout(() => {
 
 loadWunderkind();
 loadCxense();
 }, 2000)

 } else {
 // console.log(»No consent data available yet – waiting for user interaction»);
 }
 } else {
 // console.log(’Failed to get TC data’);
 }
 });
});
]]></script><!– User Code –><p/><!– End User Code –><script><![CDATA[
 


 window.addEventListener(’primisPlayerInit’, function (e) {
 console.log(»event», e)
 
 window.article_id = «2676762030»
 if (e.detail.playerApiId == «GB_News_Primis»)
 {
 window.primisPlayer = e.detail;
 primisPlayer.addEventListener(’videoStart’, function (val){
 window.video_title = val.title || «Unknown Video»;
 window.video_duration = val.duration || 0;
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoStart»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });
 primisPlayer.addEventListener(’videoEnd’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoEnd»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });
 
 primisPlayer.addEventListener(’videoSkip’, function(){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoSkip»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });

 primisPlayer.addEventListener(’videoClickthrough’, function(){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoClickthrough»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });

 primisPlayer.addEventListener(’videoPause’, function(){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoPause»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });
 primisPlayer.addEventListener(’videoAutoSkipped’, function(){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoAutoSkipped»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });
 primisPlayer.addEventListener(’videoClickSeekForward’, function(){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoClickSeekForward»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });
 primisPlayer.addEventListener(’videoClickSeekBack’, function(){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoClickSeekBack»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 }
 })
 });

 // ads
 primisPlayer.addEventListener(’adStarted’, function (val){
 window.ad_details = val;
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «videoAdStarted»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adCompleted’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adCompleted»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adFirstQuartile’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adFirstQuartile»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adMidQuartile’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adMidQuartile»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adThirdQuartile’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adThirdQuartile»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adClickthrough’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adClickthrough»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adPause’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adPause»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adPlay’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adPlay»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });
 primisPlayer.addEventListener(’adSkip’, function (){
 dataLayer.push({
 «event»: «primis_player»,
 «data»: {
 «event»: «adSkip»,
 «article_id»: article_id,
 «video_title»: video_title,
 «video_duration»: video_duration,
 «ad_details»: ad_details
 }
 })
 });

 }
 
 });
]]></script><span class=»viewport-css-anchor»/><!– User Code –><p/><!– End User Code –><script><![CDATA[
 
 let accessStatusFromWindowObj11 = window.userStatus;
 

 if (accessStatusFromWindowObj11 !== ‘member’) {
 const adSlotHtmlSkyLeft = `<div class=»sticky-wrapper»><div class=»stiky_sky left»><ad-slot position=»sky_left_top» no-watermark justify=»right»>]]></script></div></div>`;
 const adSlotHtmlSkyRight = `<div class=»sticky-wrapper»><div class=»stiky_sky right»><ad-slot position=»sky_right_top» no-watermark=»» justify=»left»/></div></div>`;
 const targetParentSky = document.querySelector(’.sky–ad__container’);
 if (targetParentSky) {
 targetParentSky.insertAdjacentHTML(’beforeend’, adSlotHtmlSkyLeft);
 targetParentSky.insertAdjacentHTML(’beforeend’, adSlotHtmlSkyRight);
 
 }
 } else {
 // console.log(»Inder 3 – skys not showing because user is member»);
 }

 <div class=»sticky-banner-wrapper» id=»sTop_Bar_0_0_26_0_0_0_0_19_1_3″><script><![CDATA[

 

 // 
 if (window.userStatus === ‘member’) {
 const style = document.createElement(’style’);
 style.textContent = `
 .sticky-banner-wrapper {
 min-height: 0;
 display: none;
 }
 .sticky-banner-wrapper::before { display: none; }
 `;
 document.head.appendChild(style);
 } else {
 document.addEventListener(’DOMContentLoaded’, function() {
 const targetParentBillboard = document.querySelector(’.sticky-banner-wrapper’);
 if (targetParentBillboard) {
 const adBillboard = `<div class=»ad–billboard»><ad-slot position=»billboard» align=»center»>]]></script></div>`;
 targetParentBillboard.insertAdjacentHTML(’beforeend’, adBillboard);
 }
 });
 }

 

<p/><div class=»topbar» id=»sElement_Topbar_HTML_0_0_8_0_0_2_1_0″><div class=»site-logo» id=»sElement_Topbar_HTML_0_0_8_0_0_2_1_0_0″><a href=»/?ico=header_logo_button»><img src=»https://assets.rbl.ms/61228189/origin.png» title=»GBN Britain’s News Channel» alt=»logo»/></a></div><div class=»topbar–right» id=»sElement_Topbar_HTML_0_0_8_0_0_2_1_0_1″><!– User Code –><link rel=»preconnect» href=»https://fonts.googleapis.com»/><link rel=»preconnect» href=»https://fonts.gstatic.com» crossorigin=»crossorigin»/><link href=»https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&;display=swap» rel=»stylesheet»/><a id=»support» class=»subscribe-link» href=»/support?ico=header_support_button»>Support</a><!– End User Code –><div class=»login-link-wrapper» aria-label=»login-link-wrapper» id=»sElement_Topbar_HTML_0_0_8_0_0_2_1_0_1_2″><!– User Code –><div class=»loyalty-wrapper»><a class=»loyalty-button» aria-label=»points» href=»#» id=»loyalty-button»/></div><!– End User Code –><!– User Code –><a class=»piano-login-link disabled» aria-label=»My Account» href=»/my-account» id=»login-link-text»>Login</a><!– End User Code –><!– User Code –><a class=»login-link piano-login-link» aria-label=»My Account» href=»/my-account» id=»accountToggleLink»/><!– Menu dropdown –><p/><!– End User Code –></div></div></div><div class=»navbar» id=»sElement_Topbar_HTML_0_0_8_0_0_3″><div class=»nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0″><!– User Code –><div class=»sticky-left sticky-left-click»><p/><a class=»nav–item live–channel__active watch-live-button live-cta__button» href=»/watch/live?ico=header_live_button» title=»Watch Live Now»><img class=»watch-live-icon» src=»https://www.gbnews.com/media-library/logo.png?id=61109318″ alt=»live-player-icon»/></a><p/></div><!– End User Code –><!– User Code –><!– <a
 class=»nav–item home–channel__active watch-live-button live-cta__button»
 href=»/watch/live?ico=header_live_button»
 title=»Watch Live Now»>
 <img class=»watch-live-icon» src=»https://assets.rbl.ms/61079499/origin.png» alt=»live-player-icon» />
</a> –><!– End User Code –><div class=»nav–item home–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_7″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_7_0″><a class=»color-inherit» href=»/» target=»» aria-label=»Home»>Home</a></div><div class=»secondary–nav regular–secondary__nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_7_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_7_1_0″><a class=»list__item» href=»https://gbnews.shop/» target=»_blank» rel=»Shop» aria-label=»Shop»>GBN Shop</a><a class=»list__item» href=»/watch/live#comments» target=»_self» rel=»YourSay» aria-label=»YourSay»>YourSay</a><a class=»list__item» href=»/youdecide» target=»_self» rel=»YouDecide» aria-label=»YouDecide»>YouDecide</a><a class=»list__item» href=»/support» target=»_self» rel=»Support Us» aria-label=»Support Us»>Support Us</a><a class=»list__item» href=»/alerts» target=»_self» rel=»News Alerts» aria-label=»News Alerts»>News Alerts</a><a class=»list__item» href=»/latest» target=»_self» aria-label=»Latest»>Latest</a><a class=»list__item» href=»/puzzles/» target=»_self» aria-label=»Puzzles»>Puzzles</a><a class=»list__item» href=»/terms/competition-terms/» target=»_self» aria-label=»Win»>Win</a><a class=»list__item» href=»/shows/gb-news-live-show-join-our-live-studio-audience» target=»_self» aria-label=»Tickets»>Tickets</a></div></div></div><div class=»nav–item news–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_8″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_8_0″><a class=»color-inherit» href=»/news/» target=»» aria-label=»News»>News</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_8_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_8_1_0″><a class=»list__item» href=»/news/uk/» target=»_self» aria-label=»UK News»>UK News</a><a class=»list__item» href=»/news/us/» target=»_self» aria-label=»US News»>US News</a><a class=»list__item» href=»/news/world/» target=»_self» aria-label=»World News»>World News</a><a class=»list__item» href=»/weather/» target=»_self» aria-label=»Weather»>Weather</a><a class=»list__item» href=»/news/migrant-crisis/» target=»_self» aria-label=»Migrant Crisis»>Migrant Crisis</a><a class=»list__item» href=»/news/cancel-culture/» target=»_self» aria-label=»Migrant Crisis»>Cancel Culture</a><a class=»list__item» href=»/news/best-of-britain/» target=»_self» aria-label=»best-of-britain»>Best of Britain</a><a class=»list__item» href=»/news/crime/» target=»_self» aria-label=»Crime»>Crime</a><a class=»list__item» href=»/science/» target=»_self» aria-label=»Science»>Science</a></div></div></div><div class=»nav–item politics–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_9″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_9_0″><a class=»color-inherit» href=»/politics/» target=»» aria-label=»Politics»>Politics</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_9_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_9_1_0″><a class=»list__item» href=»/politics/uk/» target=»_self» aria-label=»UK Politics»>UK Politics</a><a class=»list__item» href=»/politics/uk/kemi-badenoch/» target=»_self» aria-label=»Kemi Badenoch»>Kemi Badenoch</a><a class=»list__item» href=»/politics/uk/keir-starmer/» target=»_self» aria-label=»Keir Starmer»>Keir Starmer</a><a class=»list__item» href=»/politics/uk/conservative-party/» target=»_self» aria-label=»Conservatives»>Conservatives</a><a class=»list__item» href=»/politics/uk/labour-party/» target=»_self» aria-label=»Labour»>Labour</a><a class=»list__item» href=»/politics/uk/snp/» target=»_self» aria-label=»SNP»>SNP</a><a class=»list__item» href=»/politics/uk/reform-uk/» target=»_self» aria-label=»Reform UK»>Reform UK</a><a class=»list__item» href=»/politics/uk/liberal-democrats/» target=»_self» aria-label=»Lib Dems»>Lib Dems</a><a class=»list__item» href=»/politics/us/» target=»_self» aria-label=»US Politics»>US Politics</a></div></div></div><div class=»nav–item opinion–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_10″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_10_0″><a class=»color-inherit» href=»/opinion/» target=»» aria-label=»Opinion»>Opinion</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_10_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_10_1_0″><a class=»list__item» href=»/presenters/nigel-farage/?opinion» target=»_self» aria-label=»Nigel Farage»>Nigel Farage</a><a class=»list__item» href=»/presenters/jacob-rees-mogg/?opinion» target=»_self» aria-label=»Jacob Rees-Mogg»>Jacob Rees-Mogg</a><a class=»list__item» href=»/presenters/patrick-christys/?opinion» target=»_self» aria-label=»Patrick Christys»>Patrick Christys</a><a class=»list__item» href=»/presenters/beverley-turner/?opinion» target=»_self» aria-label=»Bev Turner»>Bev Turner</a><a class=»list__item» href=»/presenters/michelle-dewberry/?opinion» target=»_self» aria-label=»Michelle Dewberry»>Michelle Dewberry</a><a class=»list__item» href=»/presenters/neil-oliver/?opinion» target=»_self» aria-label=»Neil Oliver»>Neil Oliver</a><a class=»list__item» href=»/presenters/nana-akua/?opinion» target=»_self» aria-label=»Nana Akua»>Nana Akua</a><a class=»list__item» href=»/presenters/stephen-dixon/?opinion» target=»_self» aria-label=»Stephen Dixon»>Stephen Dixon</a><a class=»list__item» href=»/presenters/tom-harwood/?opinion» target=»_self» aria-label=»Tom Harwood»>Tom Harwood</a></div></div></div><div class=»nav–item membership–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_11″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_11_0″><a class=»color-inherit» href=»/membership/» target=»» aria-label=»Membership»>Membership</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_11_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_11_1_0″><a class=»list__item» href=»/watch/originals/» target=»_self» aria-label=»GB News Uncut»>Originals</a><a class=»list__item» href=»/membership/polls/» target=»_self» aria-label=»Polls»>Polls</a><a class=»list__item» href=»/puzzles/» target=»_self» aria-label=»Puzzles»>Puzzles</a><a class=»list__item» href=»/membership/rewards/» target=»_self» aria-label=»Rewards»>Rewards</a><a class=»list__item» href=»/membership/events/» target=»_self» aria-label=»Events»>Events</a><a class=»list__item» href=»/membership/guides/» target=»_self» aria-label=»Guides»>Guides</a></div></div></div><div class=»nav–item advent–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_12″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_12_0″><a class=»color-inherit» href=»/reflections» target=»» aria-label=»reflections»>Reflections</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_12_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_12_1_0_1_0″><a class=»list__item» href=»https://gbnews.shop/» target=»_blank» rel=»Shop» aria-label=»Shop»>GBN Shop</a><a class=»list__item» href=»/watch/live#comments» target=»_self» rel=»Your Say» aria-label=»Your Say»>Your Say</a><a class=»list__item» href=»/support» target=»_self» rel=»Support Us» aria-label=»Support Us»>Support Us</a><a class=»list__item» href=»/alerts» target=»_self» rel=»News Alerts» aria-label=»News Alerts»>News Alerts</a><a class=»list__item» href=»/latest» target=»_self» aria-label=»Latest»>Latest</a><a class=»list__item» href=»/puzzles/» target=»_self» aria-label=»Puzzles»>Puzzles</a><a class=»list__item» href=»/terms/competition-terms/» target=»_self» aria-label=»Win»>Win</a></div></div></div><div class=»nav–item royal–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_13″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_13_0″><a class=»color-inherit» href=»/royal/» target=»» aria-label=»Royal»>Royal</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_13_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_13_1_0″><a class=»list__item» href=»/royal/king-charles/» target=»_self» aria-label=»King Charles»>King Charles</a><a class=»list__item» href=»/royal/meghan-markle/» target=»_self» aria-label=»Meghan Markle»>Meghan Markle</a><a class=»list__item» href=»/royal/prince-harry/» target=»_self» aria-label=»Prince Harry»>Prince Harry</a><a class=»list__item» href=»/royal/kate-middleton/» target=»_self» aria-label=»Princess of Wales»>Princess of Wales</a><a class=»list__item» href=»/royal/prince-william/» target=»_self» aria-label=»Prince William»>Prince William</a><a class=»list__item» href=»/royal/prince-andrew/» target=»_self» aria-label=»Andrew»>Andrew</a><a class=»list__item» href=»/royal/princess-eugenie/» target=»_self» aria-label=»Princess Eugenie»>Princess Eugenie</a></div></div></div><div class=»nav–item money–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_14″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_14_0″><a class=»color-inherit» href=»/money/» target=»» aria-label=»Money»>Money</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_14_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_14_1_0″><a class=»list__item» href=»/politics/uk/rachel-reeves/» target=»_self» rel=»» aria-label=»Rachel Reeves»>Rachel Reeves</a><a class=»list__item» href=»/money/savings/» target=»_self» aria-label=»Savings»>Savings</a><a class=»list__item» href=»/money/pensions/» target=»_self» aria-label=»Pensions»>Pensions</a><a class=»list__item» href=»/money/tax/» target=»_self» aria-label=»Tax»>Tax</a><a class=»list__item» href=»/money/cost-of-living/» target=»_self» aria-label=»Cost of Living»>Cost of Living</a><a class=»list__item» href=»/money/energy-bills/» target=»_self» aria-label=»Energy Bills»>Energy Bills</a><a class=»list__item» href=»/money/bank-branch-closures/» target=»_self» aria-label=»Bank Closures»>Bank Closures</a><a class=»list__item» href=»/money/bank-of-england/» target=»_self» aria-label=»Bank of England»>Bank of England</a><a class=»list__item» href=»/money/economy/» target=»_self» aria-label=»Economy»>Economy</a><a class=»list__item» href=»/money/inflation/» target=»_self» aria-label=»Inflation»>Inflation</a></div></div></div><div class=»nav–item travel–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_15″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_15_0″><a class=»color-inherit» href=»/travel/» target=»» aria-label=»Travel»>Travel</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_15_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_15_1_0″><a class=»list__item» href=»/travel/staycation/» target=»_self» aria-label=»staycation»>Staycation</a><a class=»list__item» href=»/travel/deals/» target=»_self» aria-label=»deals»>Deals</a><a class=»list__item» href=»/travel/cruise/» target=»_self» aria-label=»cruise»>Cruise</a><a class=»list__item» href=»/travel/eurostar/» target=»_self» aria-label=»eurostar»>Eurostar</a></div></div></div><div class=»nav–item celebrity–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_16″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_16_0″><a class=»color-inherit» href=»/celebrity/» target=»» aria-label=»Celebrity»>Celebrity</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_16_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_16_1_0″><a class=»list__item» href=»/celebrity/music/» target=»_self» aria-label=»Music»>Music</a><a class=»list__item» href=»/celebrity/film/» target=»_self» aria-label=»Film»>Film</a><a class=»list__item» href=»/celebrity/tv/» target=»_self» aria-label=»TV»>TV</a><a class=»list__item» href=»/celebrity/bbc/» target=»_self» aria-label=»BBC»>BBC</a><a class=»list__item» href=»/celebrity/itv/» target=»_self» aria-label=»ITV»>ITV</a><a class=»list__item» href=»/celebrity/channel-4/» target=»_self» aria-label=»Channel 4″>Channel 4</a><a class=»list__item» href=»/celebrity/channel-5/» target=»_self» aria-label=»Channel 5″>Channel 5</a><a class=»list__item» href=»/celebrity/james-bond/» target=»_self» aria-label=»James Bond»>James Bond</a><a class=»list__item» href=»/celebrity/im-a-celebrity-get-me-out-of-here/» target=»_self» rel=»» aria-label=»I’m A Celeb!»>I’m A Celeb!</a><a class=»list__item» href=»/celebrity/strictly-come-dancing/» target=»_self» aria-label=»Strictly Come Dancing»>Strictly Come Dancing</a></div></div></div><div class=»nav–item sport–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_17″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_17_0″><a class=»color-inherit» href=»/sport/» target=»» aria-label=»Sport»>Sport</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_17_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_17_1_0″><a class=»list__item» href=»/sport/football/» target=»_self» aria-label=»Football»>Football</a><a class=»list__item» href=»/sport/football/world-cup/» target=»_self» aria-label=»Olympics»>World Cup</a><a class=»list__item» href=»/sport/f1/» target=»_self» aria-label=»F1″>Â Â F1Â Â </a><a class=»list__item» href=»/sport/tennis/» target=»_self» aria-label=»Tennis»>Tennis</a><a class=»list__item» href=»/sport/cricket/» target=»_self» aria-label=»Cricket»>Cricket</a><a class=»list__item» href=»/sport/boxing/» target=»_self» aria-label=»Boxing»>Boxing</a><a class=»list__item» href=»/sport/rugby/» target=»_self» aria-label=»Rugby»>Rugby</a><a class=»list__item» href=»/sport/golf/» target=»_self» aria-label=»Golf»>Golf</a><a class=»list__item» href=»/sport/darts/» target=»_self» aria-label=»Darts»>Darts</a><a class=»list__item» href=»/sport/snooker/» target=»_self» aria-label=»Snooker»>Snooker</a><a class=»list__item» href=»/sport/nfl/» target=»_self» aria-label=»NFL»>NFL</a><a class=»list__item» href=»/sport/other-sport/» target=»_self» aria-label=»Other Sport»>Other Sport</a></div></div></div><div class=»nav–item lifestyle–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_18″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_18_0″><a class=»color-inherit» href=»/lifestyle/» target=»» aria-label=»Lifestyle»>Lifestyle</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_18_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_18_1_0″><a class=»list__item» href=»/health/» target=»_self» aria-label=»Health»>Health</a><a class=»list__item» href=»/lifestyle/food/» target=»_self» aria-label=»Food»>Food</a><a class=»list__item» href=»/lifestyle/gardening/» target=»_self» aria-label=»Gardening»>Gardening</a><a class=»list__item» href=»/lifestyle/cars/» target=»_self» aria-label=»Cars»>Cars</a><a class=»list__item» href=»/lifestyle/diet/» target=»_self» aria-label=»Diet»>Diet</a><a class=»list__item» href=»/lifestyle/property/» target=»_self» aria-label=»Property»>Property</a></div></div></div><div class=»nav–item tech–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_19″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_19_0″><a class=»color-inherit» href=»/tech/» target=»» aria-label=»Tech»>Tech</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_19_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_19_1_0″><a class=»list__item» href=»/tech/deals/ » target=»_self» aria-label=»Deals»>Deals</a><a class=»list__item» href=»/tech/reviews/» target=»_self» aria-label=»Reviews «>Reviews</a><a class=»list__item» href=»/tech/google/» target=»_self» aria-label=»Google»>Google</a><a class=»list__item» href=»/tech/apple/» target=»_self» aria-label=»Apple»>Apple</a><a class=»list__item» href=»/tech/samsung/» target=»_self» aria-label=»Samsung»>Samsung</a><a class=»list__item» href=»/tech/microsoft/» target=»_self» aria-label=»Miscosoft»>Microsoft </a><a class=»list__item» href=»/tech/vpn/» target=»_self» aria-label=»VPN»>VPN</a><a class=»list__item» href=»/tech/streaming/» target=»_self» aria-label=»Streaming»>Streaming</a><a class=»list__item» href=»/tech/ai/» target=»_self» aria-label=»AI»>AI</a><a class=»list__item» href=»/tech/privacy/» target=»_self» aria-label=»Privacy «>Privacy </a></div></div></div><div class=»nav–item privacy–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_20″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_20_0″><a class=»color-inherit» href=»/tech/privacy/» target=»» aria-label=»Privacy»>Privacy</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_20_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_20_1_0″><a class=»list__item» href=»/tech/deals/ » target=»_self» aria-label=»Deals»>Deals</a><a class=»list__item» href=»/tech/reviews/» target=»_self» aria-label=»Reviews «>Reviews</a><a class=»list__item» href=»/tech/google/» target=»_self» aria-label=»Google»>Google</a><a class=»list__item» href=»/tech/apple/» target=»_self» aria-label=»Apple»>Apple</a><a class=»list__item» href=»/tech/samsung/» target=»_self» aria-label=»Samsung»>Samsung</a><a class=»list__item» href=»/tech/microsoft/» target=»_self» aria-label=»Miscosoft»>Microsoft </a><a class=»list__item» href=»/tech/vpn/» target=»_self» aria-label=»VPN»>VPN</a><a class=»list__item» href=»/tech/streaming/» target=»_self» aria-label=»Streaming»>Streaming</a><a class=»list__item» href=»/tech/ai/» target=»_self» aria-label=»AI»>AI</a><a class=»list__item» href=»/tech/privacy/» target=»_self» aria-label=»Privacy «>Privacy </a></div></div></div><div class=»nav–item america–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_21″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_21_0″><a class=»color-inherit» href=»/us/» target=»_self» aria-label=»America»>America</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_21_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_21_1_0″><a class=»list__item» href=»/news/us/» target=»_self» aria-label=»US News»>US News</a><a class=»list__item» href=»/politics/us/» target=»_self» aria-label=»US Politics»>US Politics</a><a class=»list__item» href=»/politics/us/joe-biden/» target=»_self» aria-label=»Joe Biden»>Joe Biden</a><a class=»list__item» href=»/politics/us/donald-trump/» target=»_self» aria-label=»Donald Trump»>Donald Trump</a><a class=»list__item» href=»/news/us/elon-musk/» target=»_self» aria-label=»Elon Musk»>Elon Musk</a><a class=»list__item» href=»/news/us/new-york/» target=»_self» aria-label=»New york»>New York</a><a class=»list__item» href=»/news/world/justin-trudeau/» target=»_self» aria-label=»Justin Trudeau»>Justin Trudeau</a><a class=»list__item» href=»/celebrity/will-smith/» target=»_self» aria-label=»Will Smith»>Will Smith</a><a class=»list__item» href=»/sport/tennis/» target=»_self» aria-label=»Tennis»>Tennis</a></div></div></div><div class=»nav–item watch–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_22″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_22_0″><a class=»color-inherit» href=»/watch/live» target=»» aria-label=»Watch»>Watch</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_22_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_22_1_0″><a class=»list__item» href=»/watch/live» target=»_self» aria-label=»Live»>Live</a><a class=»list__item» href=»/watch/videos» target=»_self» aria-label=»Videos»>Videos</a><a class=»list__item» href=»/watch/catch-up» target=»_self» aria-label=»Catch Up»>Catch Up</a><a class=»list__item» href=»/watch/schedule» target=»_self» aria-label=»Schedule»>Schedule</a><a class=»list__item» href=»/watch/originals/» target=»_self» aria-label=»originals»>Originals</a><a class=»list__item» href=»/watch/how-to-watch» target=»_self» aria-label=»How to watch»>How to watch</a></div></div></div><div class=»nav–item shows–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_23″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_23_0″><a class=»color-inherit» href=»/shows/» target=»» aria-label=»Shows»>Shows</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_23_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_23_1_0″><a class=»list__item» href=» /watch/catch-up/» target=»_self» aria-label=»Catch Up»>Catch Up</a><a class=»list__item» href=»/shows/farage/» target=»_self» aria-label=»Farage»>Farage</a><a class=»list__item» href=»/shows/dewbs-co/» target=»_self» aria-label=»Dewbs &; Co»>Dewbs &; Co</a><a class=»list__item» href=»/shows/patrick-christys-tonight/» target=»_self» aria-label=»Patrick Christys Tonight»>Patrick Christys Tonight</a><a class=»list__item» href=»/shows/nana-akua/» target=»_self» aria-label=»Nana Akua»>Nana Akua</a><a class=»list__item» href=»/shows/breakfast-with-stephen-and-anne/» target=»_self» aria-label=»Breakfast with Stephen &; Anne»>Breakfast with Stephen and Anne</a><a class=»list__item» href=»/shows/the-camilla-tominey-show/» target=»_self» aria-label=»Camilla Tominey Show»>Camilla Tominey Show</a><a class=»list__item» href=»/shows/sunday-with-michael-portillo/» target=»_self» aria-label=»Sunday with Michael Portillo»>Sunday with Michael Portillo</a><a class=»list__item» href=»/shows/free-speech-nation/» target=»_self» aria-label=»Free Speech Nation»>Free Speech Nation</a></div></div></div><div class=»secondary–nav regular–secondary__nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_24_1_0_0″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_24_1_0_0_0″><a class=»list__item» href=»https://gbnews.shop/» target=»_blank» rel=»Shop» aria-label=»Shop»>GBN Shop</a><a class=»list__item» href=»/watch/live#comments» target=»_self» rel=»YourSay» aria-label=»YourSay»>YourSay</a><a class=»list__item» href=»/youdecide» target=»_self» rel=»YouDecide» aria-label=»YouDecide»>YouDecide</a><a class=»list__item» href=»/support» target=»_self» rel=»Support Us» aria-label=»Support Us»>Support Us</a><a class=»list__item» href=»/alerts» target=»_self» rel=»News Alerts» aria-label=»News Alerts»>News Alerts</a><a class=»list__item» href=»/latest» target=»_self» aria-label=»Latest»>Latest</a><a class=»list__item» href=»/puzzles/» target=»_self» aria-label=»Puzzles»>Puzzles</a><a class=»list__item» href=»/terms/competition-terms/» target=»_self» aria-label=»Win»>Win</a><a class=»list__item» href=»/shows/gb-news-live-show-join-our-live-studio-audience» target=»_self» aria-label=»Tickets»>Tickets</a></div></div><div class=»nav–item presenters–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_25″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_25_0″><a class=»color-inherit» href=»/presenters/» target=»» aria-label=»Presenters»>Presenters</a></div><div class=»secondary–nav» id=»sNavigation_Items_0_0_14_0_0_0_0_0_25_1″><div class=»list» id=»sNavigation_Items_0_0_14_0_0_0_0_0_25_1_0″><a class=»list__item» href=»/presenters/eamonn-holmes/» target=»_self» aria-label=»Eamonn Holmes»>Eamonn Holmes</a><a class=»list__item» href=»/presenters/nigel-farage/» target=»_self» aria-label=»Nigel Farage»>Nigel Farage</a><a class=»list__item» href=»/presenters/michelle-dewberry/» target=»_self» aria-label=»Michelle Dewberry»>Michelle Dewberry</a><a class=»list__item» href=»/presenters/patrick-christys/» target=»_self» aria-label=»Patrick Christys»>Patrick Christys</a><a class=»list__item» href=»/presenters/nana-akua/» target=»_self» aria-label=»Nana Akua»>Nana Akua</a><a class=»list__item» href=»/presenters/stephen-dixon/» target=»_self» aria-label=»Stephen Dixon»>Stephen Dixon</a><a class=»list__item» href=»/presenters/anne-diamond/» target=»_self» aria-label=»Anne Diamond»>Anne Diamond</a><a class=»list__item» href=»/presenters/andrew-pierce/» target=»_self» aria-label=»Andrew Pierce»>Andrew Pierce</a><a class=»list__item» href=»/presenters/beverley-turner/» target=»_self» aria-label=»Beverley Turner»>Beverley Turner</a><a class=»list__item» href=»/presenters/camilla-tominey/» target=»_self» aria-label=»Camilla Tominey»>Camilla Tominey</a><a class=»list__item» href=»/presenters/michael-portillo/» target=»_self» aria-label=»Michael Portillo»>Michael Portillo</a><a class=»list__item» href=»/presenters/gloria-de-piero/» target=»_self» aria-label=»Gloria De Piero»>Gloria De Piero</a><a class=»list__item» href=»/presenters/neil-oliver/» target=»_self» aria-label=»Neil Oliver»>Neil Oliver</a><a class=»list__item» href=»/presenters/tom-harwood/» target=»_self» aria-label=»Tom Harwood»>Tom Harwood</a><a class=»list__item» href=»/presenters/emily-carver/» target=»_self» aria-label=»Emily Carver»>Emily Carver</a><a class=»list__item» href=»/presenters/simon-evans/» target=»_self» aria-label=»Simon Evans»>Simon Evans</a><a class=»list__item» href=»/presenters/olivia-utley/» target=»_self» aria-label=»Olivia Utley»>Olivia Utley</a><a class=»list__item» href=»/presenters/ellie-costello/» target=»_self» aria-label=»Olivia Utley»>Ellie Costello</a><a class=»list__item» href=»/presenters/mark-white/» target=»_self» aria-label=»Mark White»>Mark White</a><a class=»list__item» href=»/presenters/cameron-walker/» target=»_self» aria-label=»Cameron Walker»>Cameron Walker</a></div></div></div><div class=»nav–item shop–channel__active» id=»sNavigation_Items_0_0_14_0_0_0_0_0_26″><div class=»text-element» id=»sNavigation_Items_0_0_14_0_0_0_0_0_26_0″><a class=»color-inherit» href=»https://gbnews.shop/» target=»_blank» aria-label=»Shop»>Shop</a></div></div></div><!– User Code –><div class=»nav–arrows primary–nav__arrow left hidden hide-mobile»><svg xmlns=»http://www.w3.org/2000/svg» width=»20″ height=»20″ viewbox=»0 0 20 20″ fill=»none»><circle cx=»10″ cy=»10″ r=»10″ transform=»rotate(-90 10 10)» fill=»#000F55″ fill-opacity=»0.8″/><path d=»M8.71921 9.98389C9.42955 10.699 10.1005 11.3748 10.7714 12.0506C11.116 12.3972 11.4613 12.7423 11.8052 13.0897C12.0512 13.3374 12.0621 13.5813 11.8402 13.8289C11.6343 14.0585 11.3598 14.0593 11.1182 13.8176C10.3224 13.0217 9.52957 12.2228 8.736 11.4247C8.37827 11.0652 8.01982 10.7065 7.66428 10.3448C7.44745 10.1251 7.44526 9.88648 7.65771 9.67127C8.80536 8.51066 9.95373 7.34929 11.1028 6.18943C11.4073 5.88285 11.7964 5.95685 11.9577 6.35027C12.0242 6.51262 12.0191 6.66893 11.8935 6.80485C11.8431 6.85922 11.7935 6.9151 11.7416 6.96795C10.786 7.93677 9.83035 8.90483 8.87325 9.87213C8.83456 9.9114 8.78418 9.93783 8.71921 9.98464L8.71921 9.98389Z» fill=»white»/></svg></div><div class=»nav–arrows primary–nav__arrow right hidden hide-mobile»><svg xmlns=»http://www.w3.org/2000/svg» width=»20″ height=»20″ viewbox=»0 0 20 20″ fill=»none»><circle cx=»10″ cy=»10″ r=»10″ transform=»rotate(90 10 10)» fill=»#000F55″ fill-opacity=»0.8″/><path d=»M11.2808 10.0161C10.5704 9.30102 9.89953 8.62519 9.22861 7.94936C8.88402 7.60276 8.5387 7.25767 8.19485 6.91032C7.94882 6.66264 7.93787 6.41873 8.15981 6.17106C8.36568 5.9415 8.64018 5.94075 8.88183 6.18238C9.67759 6.97828 10.4704 7.77719 11.264 8.57535C11.6217 8.93478 11.9802 9.29346 12.3357 9.65517C12.5525 9.8749 12.5547 10.1135 12.3423 10.3287C11.1946 11.4893 10.0463 12.6507 8.89716 13.8106C8.59273 14.1171 8.20361 14.0431 8.04227 13.6497C7.97583 13.4874 7.98094 13.3311 8.10651 13.1952C8.15688 13.1408 8.20653 13.0849 8.25836 13.032C9.214 12.0632 10.1696 11.0952 11.1267 10.1279C11.1654 10.0886 11.2158 10.0622 11.2808 10.0154L11.2808 10.0161Z» fill=»white»/></svg></div><!– End User Code –><!– User Code –><div class=»nav–arrows secondary–nav__arrow left hidden hide-mobile»><svg xmlns=»http://www.w3.org/2000/svg» width=»20″ height=»20″ viewbox=»0 0 20 20″ fill=»none»><circle cx=»10″ cy=»10″ r=»10″ transform=»rotate(-90 10 10)» fill=»white»/><path d=»M8.71921 9.98389C9.42955 10.699 10.1005 11.3748 10.7714 12.0506C11.116 12.3972 11.4613 12.7423 11.8052 13.0897C12.0512 13.3374 12.0621 13.5813 11.8402 13.8289C11.6343 14.0585 11.3598 14.0593 11.1182 13.8176C10.3224 13.0217 9.52957 12.2228 8.736 11.4247C8.37827 11.0652 8.01982 10.7065 7.66428 10.3448C7.44745 10.1251 7.44526 9.88648 7.65771 9.67127C8.80536 8.51066 9.95373 7.34929 11.1028 6.18943C11.4073 5.88285 11.7964 5.95685 11.9577 6.35027C12.0242 6.51262 12.0191 6.66893 11.8935 6.80485C11.8431 6.85922 11.7935 6.9151 11.7416 6.96795C10.786 7.93677 9.83035 8.90483 8.87325 9.87213C8.83456 9.9114 8.78418 9.93783 8.71921 9.98464L8.71921 9.98389Z» fill=»#0032AA»/></svg></div><div class=»nav–arrows secondary–nav__arrow right hidden hide-mobile»><svg xmlns=»http://www.w3.org/2000/svg» width=»20″ height=»20″ viewbox=»0 0 20 20″ fill=»none»><circle cx=»10″ cy=»10″ r=»10″ transform=»rotate(90 10 10)» fill=»white»/><path d=»M11.2808 10.0161C10.5704 9.30102 9.89953 8.62519 9.22861 7.94936C8.88402 7.60276 8.5387 7.25767 8.19485 6.91032C7.94882 6.66264 7.93787 6.41873 8.15981 6.17106C8.36568 5.9415 8.64018 5.94075 8.88183 6.18238C9.67759 6.97828 10.4704 7.77719 11.264 8.57535C11.6217 8.93478 11.9802 9.29346 12.3357 9.65517C12.5525 9.8749 12.5547 10.1135 12.3423 10.3287C11.1946 11.4893 10.0463 12.6507 8.89716 13.8106C8.59273 14.1171 8.20361 14.0431 8.04227 13.6497C7.97583 13.4874 7.98094 13.3311 8.10651 13.1952C8.15688 13.1408 8.20653 13.0849 8.25836 13.032C9.214 12.0632 10.1696 11.0952 11.1267 10.1279C11.1654 10.0886 11.2158 10.0622 11.2808 10.0154L11.2808 10.0161Z» fill=»#0032AA»/></svg></div><!– End User Code –></div><span class=»viewport-css-anchor»/><!– User Code –><p><vf-tray/></p><!– End User Code –><div class=»breaking-banner__wrapper show-only-if-post-present hidden» id=»sElement_Breaking_News_Banner_0_0_7_0_0_0″><!– User Code –><button class=»breaking-banner__close-btn» type=»button» aria-label=»close»><svg width=»16″ height=»16″ viewbox=»0 0 16 16″ fill=»none» xmlns=»http://www.w3.org/2000/svg»><path d=»M8.86889 8.00015L15.8175 1.0503C16.0575 0.810263 16.0575 0.420056 15.8175 0.180024C15.5776 -0.0600081 15.1874 -0.0600081 14.9474 0.180024L7.99877 7.12988L1.05011 0.180024C0.810123 -0.0600081 0.419984 -0.0600081 0.179993 0.180024C-0.0599977 0.420056 -0.0599977 0.810263 0.179993 1.0503L7.12865 8.00015L0.179993 14.95C-0.0599977 15.19 -0.0599977 15.5802 0.179993 15.8203C0.300604 15.9409 0.458136 16 0.615669 16C0.773201 16 0.930733 15.9397 1.05134 15.8203L8 8.87042L14.9487 15.8203C15.0693 15.9409 15.2268 16 15.3843 16C15.5419 16 15.6994 15.9397 15.82 15.8203C16.06 15.5802 16.06 15.19 15.82 14.95L8.87135 8.00015H8.86889Z» fill=»white»/></svg></button><!– End User Code –><p/><script><![CDATA[
 
 window.addEventListener(’DOMContentLoaded’, () => {
 // console.log(’loaded’);
 
 let unpublish = document.querySelector(’.breaking-banner__wrapper .unpublish-time’) ? document.querySelector(’.breaking-banner__wrapper .unpublish-time’).textContent : 0;
 let currentTime = parseInt(Date.now()/1000);
	// console.log(unpublish, currentTime, unpublish > currentTime);
 
 
 if (document.querySelector(’.breaking-banner__post’).childNodes.length != 0 && unpublish >= currentTime){
 let hasCookie = getCookie(’hideAlert’),
 original = window.location.href.split(’?’)[0],
 postURL = document.querySelector(».banner__url»).getAttribute(’href’).split(’?’)[0],
 hasSidebar = document.querySelectorAll(’.content–with–sidebar’).length,
 postId = document.querySelector(».breaking-banner__post .widget»).getAttribute(’elid’);
 
 document.querySelector(’.breaking-banner__close-btn’).addEventListener(’click’, ()=>{
 document.querySelector(’.breaking-banner__wrapper’).classList.add(’hidden’);
	 setCookie(’hideAlert’, postId)
 });
 document.querySelector(’.breaking-banner__post .widget__headline-text’).addEventListener(’click’, ()=>{
	 setCookie(’hideAlert’, postId)
 });
 document.querySelector(’.breaking-banner__post .widget__subheadline-text’).addEventListener(’click’, ()=>{
	 setCookie(’hideAlert’, postId);
 }); 
 if (hasSidebar <= 0) {
 document.querySelector(’.breaking-banner__wrapper’).classList.add(’no-sidebar’);
 }
 if (!hasCookie || hasCookie != postId ){
 document.querySelector(’.breaking-banner__wrapper’).classList.remove(’hidden’);
 }
 if (original == postURL){
 document.querySelector(’.breaking-banner__wrapper’).classList.add(’hidden’);
 }
 if (window.location.href.includes(’lab_viewport=embed&lab_content=full’)){
 let originalId = document.querySelector(».main-post__top article»).getAttribute(’elid’),
 bannerId = document.querySelector(».banner__url»).getAttribute(’href’).split(’/’)[3];
 if (originalId == bannerId){
 document.querySelector(’.breaking-banner__wrapper’).classList.add(’hidden’);
 }
 }
}}) 


function getCookie(c_name) {
 if (document.cookie.length > 0) {
 c_start = document.cookie.indexOf(c_name + «=»);
 if (c_start != -1) {
 c_start = c_start + c_name.length + 1;
 c_end = document.cookie.indexOf(»;», c_start);
 if (c_end == -1) {
 c_end = document.cookie.length;
 }
 return unescape(document.cookie.substring(c_start, c_end));
 }
 }
 return «»;
}
 
function setCookie(cname, cvalue) {
 document.cookie = cname + «=» + cvalue + «; path=/»;
}

]]></script></div><meta name=»vf:container_id» content=»2676762030″/><!– User Code –><!– Google Tag Manager –><script><![CDATA[

 //MOVED TO delayedCmpScript shared element



 // window.runWhenConsentIsReady(() => {
 // console.log(’Consent is ready, loading GTM Secondary...’);
 // (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({’gtm.start’:
 // new Date().getTime(),event:’gtm.js’});var f=d.getElementsByTagName(s)[0],
 // j=d.createElement(s),dl=l!=’dataLayer’?’&l=’+l:»;j.async=true;j.src=
 // ‘https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
 // })(window,document,’script’,’dataLayer’,’GTM-PCG4W7Z’);

 // console.log(’Consent is ready, injecting GTM secondary iframe’);

 // const iframe = document.createElement(’iframe’);
 // iframe.src = «https://www.googletagmanager.com/ns.html?id=GTM-PCG4W7Z»;
 // iframe.height = «0»;
 // iframe.width = «0»;
 // iframe.style.display = «none»;
 // iframe.style.visibility = «hidden»;
 // document.body.appendChild(iframe);


 // });
]]></script><!– End Google Tag Manager –><!– Google Tag Manager (noscript) –><!– <noscript>
 <iframe
 src=»https://www.googletagmanager.com/ns.html?id=GTM-PCG4W7Z»
 height=»0″
 width=»0″
 style=»display:none;visibility:hidden»></iframe>
</noscript> –><!– End Google Tag Manager (noscript) –><!– End User Code –><span class=»viewport-css-anchor»/><p/><div class=»credit-caption-wrapper» id=»sPost_Default_0_0_18_0_0_2_0_10″><div class=»mb-2 » id=»sPost_Default_0_0_18_0_0_2_0_10_0″><div class=»posts-custom posts-custom-section section-holder clearfix» data-block=»None» data-format=»posts-custom» data-source=»current_post» data-source-type=»current_post» data-source-unique=»true» data-section-id=»» data-is-reordable=»false» data-using-stickers=»false» data-has-more=»false» data-attr-format=»posts-custom» data-attr-posts_id=»sPost_Default_0_0_18_0_0_2_0_10_0″ data-attr-layout_quality=»1″ data-attr-node_id=»/root/blocks/block[post_default]/abtests/abtest[1]/rm_tabs/rm_wrapper[1]/element_wrapper[1]/current_post-» data-attr-layout_all_headline_tag=»h1″ data-attr-layout_all_subheadline_tag=»h2″ data-attr-layout_remove_image=»true» data-attr-all_element_order=»» data-attr-filters=»» data-attr-section_url=»» data-attr-source=»» data-attr-is_current_post=»true» data-attr-use_smart_keep_reading=»true»><div class=»posts-wrapper clearfix»><div class=»widget post-partial post-section–news» data-category=»News»><article elid=»2676762030″ data-frozen-sections=»[]» class=»clearfix video-article sm-mb-1 quality-HD post-2676762030″ data-category=»News»><div class=»row px10″><div class=»rm-col-center col sm-mb-1″ style=»width:100.0%;»><p/></div></div><script type=»application/json» id=»post-context-2676762030″ class=»post-context post-context-2676762030″><![CDATA[
 {»customDimensions»: {»1″:»George Bunn»,»7″:2676762030,»3″:»»,»2″:»news»,»4″:»04/18/2026″}, «post»: {»id»: 2676762030, «providerId»: 0, «sections»: [0, 584086272, 2262988002, 588563272, 586304622, 2260688433, 590311187, 586304181, 586311833, 588563322], «authors»: [26410785], «tags»: [], «streams»: [{»family(67bf1ec4027babe3b08d4d5e,0)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,588563272)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,584086272)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,2260688433)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,588563322)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,586304622)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,2262988002)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,586311833)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,0)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,590311187)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,586304622)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,586304181)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,588563322)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,588563272)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,586311833)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,586304181)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,2260688433)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,590311187)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(67bf1ec4027babe3b08d4d5e,584086272)»: {»period»: {»window»: «7*1d»}, «events»: {»post-page-view»: 1.0}}}, {»family(68d2d34ab1265c0e0fa22efe,2262988002)»: {»period»: {»window»: «1*1d»}, «events»: {»post-page-view»: 1.0}}}], «split_testing»: {}} }
]]></script></article></div></div></div></div></div><span class=»viewport-css-anchor»/><div class=»content» id=»sPost_Default_0_0_18_0_0_2_0_14″/><div class=»sidebar–column» id=»sPost_Default_0_0_18_0_0_2_0_14_0_1_1_0″/><div class=»» id=»strending_module_0_0_31_0_0_0″><!– User Code –><script><![CDATA[
 insertTrending();

 function insertTrending() {
 const haveTrending = document.querySelector(’.trending-wrapper’)
 if (haveTrending){
 return;
 }
 // let body = document.querySelector(».body»);
 //const video2 = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p, .rebellt-ecommerce p, .gbn-offer-card p)’)[4];
 //let createDiv = insertTrendingDiv();
 // if the team changes it’s mind and wants us to account for empty p tags
 // const allP = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p, .rebellt-ecommerce p)’);
 // const filtered = Array.from(allP).filter(p => p.textContent.trim() !== »);
 //video2.after(createDiv);
 }

 function insertTrendingDiv() {
 let trendingDiv = document.createElement(’div’);
 trendingDiv.classList.add(»trending-wrapper»);
 trendingDiv.innerHTML = `
 <div class=»trending-header»>TRENDING]]></script></div>
 <div class=»tabs»><p style=»display: inline;» class=»WPAuto_Base_Readability-styled»>
 </p><p>Stories</p><p style=»display: inline;» class=»WPAuto_Base_Readability-styled»>
 </p><p>Videos</p><p style=»display: inline;» class=»WPAuto_Base_Readability-styled»>
 </p><p>Your Say</p><p style=»display: inline;» class=»WPAuto_Base_Readability-styled»>
 </p></div>
 <p/>
 <p/>
 <p/>
 `;
 return trendingDiv;
 }
<!– End User Code –><!– User Code –><script><![CDATA[

 var 	embeddontmiss=document.querySelector(’.embed-dontmiss’);
 if(embeddontmiss){
 // let dontMiss = document.querySelector(’.embed-dontmiss__posts’);
 // var dontmissclone = dontMiss.cloneNode(true);
 // dontmissclone.classList.remove(’hidden’);
 // embeddontmiss.appendChild(dontmissclone);
 // const modSlot = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p)’)[12];
 // modSlot.appendChild(embeddontmiss);
 // if(embeddontmiss.querySelectorAll(’.widget’).length < 3 ){
 // embeddontmiss.classList.add(’hidden’);
 // }
 }

 var mostreadElement= document.querySelector(’.embed-mostread’);
 if(mostreadElement){
 let mostRead = document.querySelector(’.embed-mostread__posts’);
 let mostreadclone = mostRead.cloneNode(true);
 mostreadclone.classList.remove(’hidden’);
 // console.log(mostreadElement);
 mostreadElement.appendChild(mostreadclone);

 if(mostreadElement.querySelectorAll(’.widget’).length < 3){
 mostreadElement.classList.add(’hidden’);
 }
 }



 // handle for you
 // const modSlot = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p)’)[6];
 // var embedForYou=document.querySelector(’.embed-latest’);

 // if (embedForYou) {
 // let foryou = document.querySelector(’.embed-foryou__posts’);
 // var foryouclone = foryou.cloneNode(true);
 // foryouclone.classList.remove(’hidden’);
 // console.log(embedForYou);
 // modSlot.appendChild(foryouclone);

 // if(embedForYou.querySelectorAll(’.widget’).length < 3 ){
 // embedForYou.classList.add(’hidden’);
 // }
 // }

 // insert newsletter signup after fourth paragraph/div
 // insertNewsletterAfter(4);

 // function insertNewsletterAfter(n) {
 // for (let i = 0; i < divs.length-2; i++) {
 // if ((i + 1) % n === 0) {
 // const div = insertNewsletterSignup();
 // divs[i].after(div);
 // break;
 // }
 // }
 // }

 // returns newly created div for the newsletters
 // function insertNewsletterSignup() {
 // let newsLetter = document.createElement(’div’);
 // newsLetter.id = «newsletter-signup»;
 // newsLetter.style.marginBottom = «20px»;
 // return newsLetter;
 // }
]]></script><!– End User Code –><script><![CDATA[


window._taboola = window._taboola || [];



let accessStatusFromWindowObj5 = window.userStatus;

// ONLY inject Outbrain if accessStatus is NOT member
if (accessStatusFromWindowObj5 !== ‘member’) {
 // Fill in *your* param values, as provided by Taboola:
 // *Global* command queue for the page
 window._taboola = window._taboola || [];

 console.log(»user is not a member tab stage one»)
 const paragraphs = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p)’);
 if (paragraphs.length > 7) {
 console.log(»2nd para found, tab stage 2″)
 const adPos = paragraphs[7];
 const div = document.createElement(’div’);
 div.innerHTML = `<div id=»taboola-mid-article-thumbnails»>`;
 adPos.after(div);
 console.log(»tab id inserted»)
 _taboola.push({
 mode: ‘alternating-thumbnails-stream-rmp’,
 container: ‘taboola-mid-article-thumbnails’,
 placement: ‘Mid Article Thumbnails’,
 target_type: ‘mix’,
 });
 }
 // _taboola.push({flush: true});
 }
 console.log(»show ads»)
 
 _taboola.push({ flush: true });




]]></script><p/><!– User Code –><p id=»widgetLoaded» style=»width:0px;height:0px;»/><script><![CDATA[
 (function (d, s, b) { var mElmt, primisElmt = d.createElement(’script’); primisElmt.setAttribute(’type’, ‘text/javascript’); primisElmt.setAttribute(’async’,’async’); primisElmt.setAttribute(’src’, s); var elmtInterval = setInterval(function() { mElmt = d.getElementById(b); if (mElmt) { mElmt.parentNode.insertBefore(primisElmt, mElmt.nextSibling); mElmt.parentNode.removeChild(mElmt); return clearInterval(elmtInterval); } }, 3500); })(document, ‘https://live.primis.tech/live/liveView.php?s=121157&cbuster=%%CACHEBUSTER%%’, ‘widgetLoaded’);
]]></script><!– End User Code –><script class=»lazy-style» type=»css»><![CDATA[
 
 body.tp-modal-open .pushwoosh-subscribe-widget__bell-button{display:none}h1.vf-client-settings-form-profile-header{display:none!important}.viafoura .vf-flex-container{display:none!important}@media (min-width:1280px){.sticky-banner-wrapper{position:relative}.ad–billboard{position:sticky;top:0;z-index:10;background-color:white}ad-slot[position^=»billboard»]{position:sticky;top:0;z-index:10;display:block;background-color:white}}@media (min-width:767px){.more-from-gbn{position:relative;font-size:24px;font-weight:700;line-height:24px;margin-top:20px;padding:15px 20px;color:#000f55;background-color:#F5F5F5}.more-from-gbn:after{content:»»;position:absolute;bottom:0;max-width:96%;height:1px;background:#000f55;left:16px;right:16px}}@media (max-width:767px){.more-from-gbn{position:relative;font-size:24px;font-weight:700;line-height:24px;margin-top:20px;color:#000f55;background-color:#F5F5F5;padding-top:40px;padding-left:10px;padding-bottom:20px}.more-from-gbn:before{content:»»;position:absolute;height:1px;background:#000f55;max-width:96%;left:10px;margin-bottom:15px;bottom:40px;right:10px}}

 ]]></script><script class=»rm-i-script» id=»user-javascript-medium-normal»><![CDATA[
 window.REBELMOUSE_TASKS_QUEUE.push(function loadFonts(){});

window.REBELMOUSE_TASKS_QUEUE.push(function(){

 
 // 1. Update OB_ContextKeyValue
// window.OB_ContextKeyValue = window.gbnConfig.dataLayer.cd30;
// let ob_script = document.createElement(’script’)
// ob_script.innerHTML = «window.OB_ContextKeyValue=»+window.gbnConfig.dataLayer.cd30;
// document.body.appendChild(ob_script)


// // 2. Update testVariant
// window.testVariant = window.gbnConfig.dataLayer.cd30;



// 3. Update contentType
function getContentType() {
 // Ensure dataLayer exists
 window.dataLayer = window.dataLayer || [];

 // Find the last object in dataLayer that has a cd10 property
 for (let i = window.dataLayer.length – 1; i >= 0; i–) {
 if (window.dataLayer[i].cd10) {
 return window.dataLayer[i].cd10;
 }
 }
 return ‘not set’;
}
window.contentType = getContentType();



// 4. Update contentSection
function getContentSection() {
 // Ensure dataLayer exists
 window.dataLayer = window.dataLayer || [];

 // Find the last object in dataLayer that has a cd9 property
 for (let i = window.dataLayer.length – 1; i >= 0; i–) {
 if (window.dataLayer[i].cd9) {
 return window.dataLayer[i].cd9;
 }
 }
 return ‘not set’;
}
window.contentSection = getContentSection();
 

});

window.REBELMOUSE_TASKS_QUEUE.push(function(){

 
 function getEventDescription(event) {
 switch (event) {
 case «GBN_MEM_005_M»:
 return { description: «GBN Membership £;5 Monthly», price: 5.00 };
 case «GBN_MEM_010_M»:
 return { description: «GBN Membership £;10 Monthly», price: 10.00 };
 case «GBN_MEM_020_M»:
 return { description: «GBN Membership £;20 Monthly», price: 20.00 };
 case «GBN_MEM_054_Y»:
 return { description: «GBN Membership £;54 Yearly», price: 54.00 };;
 case «GBN_MEM_108_Y»:
 return { description: «GBN Membership £;108 Yearly», price: 108.00 };;
 case «GBN_MEM_216_Y»:
 return { description: «GBN Membership £;216 Yearly», price: 216.00 };;
 case «GBN_DON_020_O»:
 return { description: «GBN Donation £;20 – one off», price: 20.00 };;
 case «GBN_DON_050_O»:
 return { description: «GBN Donation £;50 – one off», price: 50.00 };;
 case «GBN_DON_OTHER»:
 return { description: «GBN Donation &ndash; Other (custom amount)», price: 0.00 };;
 case «GBN_GIFT_MEM_005_M»:
 return { description: «Gift Subscription for GBN Membership £;5 Monthly», price: 10.00 };
 case «GBN_GIFT_MEM_010_M»:
 return { description: «Gift Subscription for GBN Membership £;10 Monthly», price: 10.00 };;
 case «GBN_GIFT_MEM_108_Y»:
 return { description: «Gift subscription for GBN Membership £;108 Yearly», price: 108.00 };;
 case «GBN_GIFT_MEM_120_6M»:
 return { description: «Gift subscription for GBN Membership £;120 (6 months)», price: 120.00 };;
 case «GBN_GIFT_MEM_020_M»:
 return { description: «Gift Subscription for GBN Membership £;20 Monthly», price: 20.00 };;
 case «GBN_GIFT_MEM_216_Y»:
 return { description: «Gift subscription for GBN Membership £;216 Yearly», price: 216.00 };;
 case «GBN_GIFT_MEM_030_6M»:
 return { description: «Gift subscription for GBN Membership £;30 (6 months)», price: 30.00 };;
 case «GBN_GIFT_MEM_054_Y»:
 return { description: «Gift subscription for GBN Membership £;54 Yearly», price: 54.00 };;
 case «GBN_GIFT_MEM_060_6M»:
 return { description: «Gift subscription for GBN Membership £;60 (6 months)», price: 60.00 };;
 }
 return «Unknown event.»;
}


window.tp = window.tp || [];
// AddToBasket event
tp.push([»addHandler», «registrationSuccess», function (data) {
 console.log(’registrationSuccess fired’)
 dataLayer.push({
 event: «AddToCart»,
 value: 5.00
 });
}]);

// Show offer event
let showOfferShown = 0;
tp.push([»addHandler», «showOffer», function (data) {
 if (showOfferShown == 0) {
 console.log(’showOffer fired’)
 const page = window.location.pathname;
 if (page === ‘/support’) {
 dataLayer.push({
 event: «fb.event»,
 fb_event_type: «viewContent»,
 fb_content_name: «GB News Membership Options»,
 fb_currency: «GBP»
 });
 } else if (page === ‘/gifting’) {
 dataLayer.push({
 event: «fb.event»,
 fb_event_type: «viewContent»,
 fb_content_name: «GB News Gifting Options»,
 fb_currency: «GBP»
 });
 } else if (page === ‘/donate’) {

 dataLayer.push({
 event: «fb.event»,
 fb_event_type: «viewContent»,
 fb_content_name: «GB News Donation Options»,
 fb_currency: «GBP»
 });
 } else {
 // handle other pages
 }

 showOfferShown = 1;
 }
}]);

//offer button clicks
tp.push([’addHandler’, ‘customEvent’, function(event)
 {
 if (event.experienceActionId.includes(»showOffer»)) {
 console.log(’milos’, event);
 let eventName = event.eventName;
 let eventDescription = getEventDescription(eventName);
 if(eventDescription.description !== «Unknown event.») {
 dataLayer.push({
 event: «fb.event»,
 fb_event_type: «initiateCheckout»,
 fb_content_name: eventDescription.description,
 fb_content_ids: [eventName],
 fb_currency: «GBP»,
 fb_value: eventDescription.price
 });
 }
 }
 }]);

// Checkout event
// tp.push([»addHandler», «startCheckout», function () {
// console.log(’startCheckout fired’)

// dataLayer.push({
// event: «InitiateCheckout»,
// value: 5.00
// });
// }]);

// Purchase event
tp.push([»addHandler», «checkoutComplete», function (conversion) {
 console.log(’checkoutComplete fired’)
 let eventDescription = getEventDescription(conversion.termId);
 dataLayer.push({
 event: «fb.event»,
 fb_event_type: «purchase»,
 fb_content_name: eventDescription.description,
 fb_content_ids: [conversion.termId],
 fb_currency: «GBP»,
 fb_value: conversion.chargeAmount,
 fb_transaction_id: conversion.paymentId
 });
}]);

console.log(»tp handlers registered.»);
 

});

window.REBELMOUSE_TASKS_QUEUE.push(function(){

 
 // console.log(»POST PAGE = TRUE OR PAGE.SECTION AND PAGE.SECTION.URL»)




 console.log(»context.page.section»)
 // 
 // var sectionv2 = «news»
 // console.log(sectionv2)
 // console.log(»»)
 var pri_nav_items=document.querySelectorAll(’.navbar .nav .text-element a’);
 var sec_nav_items=document.querySelectorAll(’.navbar .secondary–nav .list a’);

 

 ///aaa ssss
 
 
 
 console.log(»3″)
	 
 
 
 var sections_list=[’news’];
 var is_pri_act_set = false;
 var is_sec_act_set = false;
 var is_section_page=false;
 

for (var el of pri_nav_items) {
 //console.log(»this is test» + is_pri_act_set);
 //console.log(»this is test» + is_section_page);
 //is_pri_act_set && 
 const domainName = `https://${window.location.host}`;

 if (el.href.replace(domainName,»).toLowerCase().indexOf(sections_list[0].toLowerCase()) != -1) {
 

 is_pri_act_set = true;
 el.closest(’.nav–item’).classList.add(’active’);
 break;
 }
}
if (!is_pri_act_set) {
 
 for (var el of sec_nav_items) {
 
 if (el.href.toLowerCase().indexOf(sections_list[0].toLowerCase()) != -1) {

 is_sec_act_set = true;
 is_pri_act_set = true;
 el.closest(’.nav–item’).classList.add(’active’);
 el.classList.add(’active’);
 break;
 }
 
 var el_href=el.href.replace(window.location.origin,»»);
 var win_href=window.location.pathname;
 if(el_href[el_href.length-1]==»/»){
 el_href=el_href.slice(0,-1);
 }
 if(win_href[win_href.length-1]==»/»){
 win_href=win_href.slice(0,-1);
 }
 	 if (el_href.toLowerCase()==win_href.toLowerCase()) {
 //debugger;
 is_sec_act_set = true;
 is_sec_act_set = true;
 el.closest(’.nav–item’).classList.add(’active’);
 el.classList.add(’active’);
 break;
 }
 }
}
else if (is_pri_act_set && is_section_page){
 
 
 
 sec_nav_items = document.querySelectorAll(’.nav–item.active .secondary–nav .list a’);
 for (var el of sec_nav_items) {
 var el_href=el.href.replace(window.location.origin,»»);
 var win_href=window.location.pathname;
 if(el_href[el_href.length-1]==»/»){
 el_href=el_href.slice(0,-1);
 }
 if(win_href[win_href.length-1]==»/»){
 win_href=win_href.slice(0,-1);
 }
 	 if (el_href.toLowerCase()==win_href.toLowerCase()) {
 is_sec_act_set = true;
 el.closest(’.nav–item’).classList.add(’active’);
 el.classList.add(’active’);
 break;
 }
 }
}


if(is_pri_act_set && is_sec_act_set) return;



var active_channel = document.querySelector(’.navbar .nav–item.active’);
var post_sections=»news,news/sgg,content-type/article,news/uk/east-midlands,editorial/homepage-top20,content-type,editorial/dont-miss-articles,news/uk».split(’,’); 
if (active_channel) {
 var breaker=false
 sec_nav_items = active_channel.querySelectorAll(’.secondary–nav .list a’);
 
 for (el of sec_nav_items) {
 let windowHrf=window.location.href;
 if(el.href.toLowerCase()==windowHrf.split(’?’)[0].toLowerCase()){
 el.classList.add(’active’);
 breaker=true;
 break;
 }
 }
 if (breaker) return;
 
 if (breaker) return;

 // var topic = post_sections.find(a => a.includes(sections_list[0] + «/»));
	
 
 for (el of sec_nav_items) {
 //debugger;
 breaker=false
 var hrf = el.href;
 post_sections.forEach(function(sec_url) {
 if (hrf.toLowerCase().indexOf(sec_url.toLowerCase()) != -1 && sec_url.toLowerCase().includes(post_sections[0].toLowerCase()+»/»)) {
 el.classList.add(’active’);
 breaker=true;
 }
 })
	if (breaker) break;
 }
}
 else {
 for (el of sec_nav_items) {
 let windowHrf=window.location.href;
 if(el.href.toLowerCase()==windowHrf.split(’?’)[0].toLowerCase()){
 el.classList.add(’active’);
 el.closest(’nav–item’)?l.closest(’nav–item’).classList.add(’active’):»»;
 breaker=true;
 break;
 }
 }
 }


 

});

window.REBELMOUSE_TASKS_QUEUE.push(function(){

 
 // // Scroll position for primary navigation
// const isMobile = window.innerWidth <= 768;

// let menuButtonSize = 0;
// const menuButton = document.querySelector(’.navbar .nav .sticky-left-click’);

// if (menuButton) {
// menuButtonSize = menuButton.getBoundingClientRect().width;
// }

// var doc_body = document.body;
// var pri_nav = document.querySelector(’.navbar .nav’);

// // Checking active primary menu item and calculating left scroll for the navigation
// if (isMobile) {
// const activeMenuItem = document.querySelector(’.navbar .nav .nav–item.active’);
// if (activeMenuItem) {
// const activeMenuItemLeftPosition = activeMenuItem.offsetLeft;

// const navigation = document.querySelector(’.navbar .nav’);
// const navigationComputedStyles = window.getComputedStyle(navigation);
// const marginLeft = parseInt(navigationComputedStyles.getPropertyValue(’margin-left’));
 
// pri_nav.scrollLeft = activeMenuItemLeftPosition – marginLeft – menuButtonSize;
// }
// } else if (window.sessionStorage.getItem(»pri_nav_pos»)) {
// pri_nav.scrollLeft = window.sessionStorage.getItem(»pri_nav_pos»);
// }

// // The logic for the secondary menu wasn’t changed
// if (window.sessionStorage.getItem(»sec_nav_pos») && window.sessionStorage.getItem(»sec_nav_wrap»)) {
// var scrolli__item = document.querySelector(’.’+window.sessionStorage.getItem(»sec_nav_wrap»)+’ .list’);
// if (scrolli__item) {
// scrolli__item.scrollLeft = window.sessionStorage.getItem(»sec_nav_pos»);
// }
// }

// var pri_nav_items = pri_nav.querySelectorAll(’a’);
// var sec_nav_items = document.querySelectorAll(’.navbar .secondary–nav a’);

// // Function to restore active navigation states after page reload
// function restoreActiveNavigation() {
// // Restore active primary nav item
// const activePriNavItem = sessionStorage.getItem(’active_pri_nav_item’);
// if (activePriNavItem) {
// const priElement = document.querySelector(`[data-pri-nav-id=»${activePriNavItem}»]`);
// if (priElement) {
// // Remove active class from all primary nav items first
// document.querySelectorAll(’.navbar .nav .nav–item’).forEach(el => {
// el.classList.remove(’active’);
// });
// priElement.classList.add(’active’);
// console.log(’Restored active class to primary nav:’, priElement);
// }
// }
 
// // Restore active secondary nav item
// const activeSecNavItem = sessionStorage.getItem(’active_sec_nav_item’);
// if (activeSecNavItem) {
// const secElement = document.querySelector(`[data-sec-nav-id=»${activeSecNavItem}»]`);
// if (secElement) {
// // Remove active class from all secondary nav items first
// document.querySelectorAll(’.navbar .secondary–nav .list__item’).forEach(el => {
// el.classList.remove(’active’);
// });
// secElement.classList.add(’active’);
// console.log(’Restored active class to secondary nav:’, secElement);
// }
// }
// }

// // Add unique identifiers to navigation items
// function initializeNavigationIds() {
// // Add IDs to primary nav items
// pri_nav_items.forEach(function(item, index) {
// const navItem = item.closest(’.nav–item’);
// if (navItem && !navItem.hasAttribute(’data-pri-nav-id’)) {
// navItem.setAttribute(’data-pri-nav-id’, `pri-nav-${index}`);
// }
// });
 
// // Add IDs to secondary nav items
// sec_nav_items.forEach(function(item, index) {
// if (!item.hasAttribute(’data-sec-nav-id’)) {
// item.setAttribute(’data-sec-nav-id’, `sec-nav-${index}`);
// }
// });
// }

// // Primary navigation click handlers
// pri_nav_items.forEach(function(item) {
// item.onclick = function(event) {
// console.log(’Primary nav clicked:’, event.target);
 
// const navItem = event.target.closest(’.nav–item’);
// if (navItem) {
// // Remove active class from all primary nav items
// document.querySelectorAll(’.navbar .nav .nav–item’).forEach(el => {
// el.classList.remove(’active’);
// });
 
// // Add active class to clicked primary nav item
// navItem.classList.add(’active’);
 
// // Save active primary nav item to sessionStorage
// const priNavId = navItem.getAttribute(’data-pri-nav-id’);
// if (priNavId) {
// sessionStorage.setItem(’active_pri_nav_item’, priNavId);
// console.log(’Saved active primary nav item:’, priNavId);
// }
 
// // Clear secondary nav active state when primary nav changes
// sessionStorage.removeItem(’active_sec_nav_item’);
// document.querySelectorAll(’.navbar .secondary–nav .list__item’).forEach(el => {
// el.classList.remove(’active’);
// });
// }
 
// // Original sessionStorage handling
// sessionStorage.removeItem(»pri_nav_pos»);
// sessionStorage.removeItem(»sec_nav_wrap»);
// sessionStorage.removeItem(»sec_nav_pos»);
// window.sessionStorage.setItem(»pri_nav_pos», pri_nav.scrollLeft);
// }
// });

// // Secondary navigation click handlers (your existing code with modifications)
// sec_nav_items.forEach(function(item) {
// item.onclick = function(event) {
// const target = event.target;

// // Remove active class from all secondary nav items in current menu
// const currentSecondaryNav = target.closest(’.secondary–nav’);
// if (currentSecondaryNav) {
// currentSecondaryNav.querySelectorAll(’.list__item’).forEach(el => {
// el.classList.remove(’active’);
// });
// }

// // Add active class to clicked secondary nav item
// target.classList.add(’active’);

// // Save active secondary nav item to sessionStorage
// const secNavId = target.getAttribute(’data-sec-nav-id’);
// if (secNavId) {
// sessionStorage.setItem(’active_sec_nav_item’, secNavId);
// }

// // Reset primary nav active state (optional, depending on your logic)
// document.querySelectorAll(’.navbar .nav .nav–item’).forEach(el => {
// el.classList.remove(’active’);
// });
// sessionStorage.removeItem(’active_pri_nav_item’);

// // Store scroll positions
// sessionStorage.removeItem(»sec_nav_wrap»);
// sessionStorage.removeItem(»sec_nav_pos»);

// const sec_nav_wrap = target.closest(’.list’);
// if (sec_nav_wrap) {
// sessionStorage.setItem(»sec_nav_pos», sec_nav_wrap.scrollLeft);

// const navItem = sec_nav_wrap.closest(’.nav–item’);
// if (navItem && navItem.classList[1]) {
// sessionStorage.setItem(»sec_nav_wrap», navItem.classList[1]);
// }
// }

// sessionStorage.setItem(»pri_nav_pos», pri_nav.scrollLeft);
// };
// });


// // Hover effects for nav items
// document.querySelectorAll(’.nav–item’).forEach(function(item) {
// var timeout = null;
// var timeout2 = null;

// // Uncomment if you want hover effects
// // item.onmouseover = function() {
// // timeout = setTimeout(function(){
// // item.classList.add(’hover_active’)
// // }, 300);
// // clearTimeout(timeout2);
// // }

// // item.onmouseout = function() {
// // timeout2 = setTimeout(function(){
// // item.classList.remove(’hover_active’)
// // }, 300);
// // clearTimeout(timeout);
// // }
// });

// // Initialize navigation system
// function initializeNavigation() {
// initializeNavigationIds();
// restoreActiveNavigation();
// }

// // Initialize when DOM is ready
// if (document.readyState === ‘loading’) {
// document.addEventListener(’DOMContentLoaded’, initializeNavigation);
// } else {
// initializeNavigation();
// }

// // Opinion section scroll handling
// if (window.location.search==»?opinion») {
// const opinionWidget = document.querySelector(’.opinion-wrapper .widget’);
// if (opinionWidget) {
// if (/constructor/i.test(window.HTMLElement) || (function (p) { return p.toString() === «[object SafariRemoteNotification]»; })(!window[’safari’] || (typeof safari !== ‘undefined’ && window[’safari’].pushNotification))) {
// opinionWidget.scrollIntoView(true);
// } else if(typeof InstallTrigger !== ‘undefined’) {
// opinionWidget.scrollIntoView(true);
// } else {
// opinionWidget.scrollIntoView({
// block: ‘nearest’,
// behavior: ‘smooth’
// });
// }
// }
// }

// // Delay function for mouse interactions
// var delay = function (elem, callback) {
// var timeout = null;

// elem.onmouseover = function() {
// elem.classList.add(’shit’)
// // Set timeout to be a timer which will invoke callback after 1s
// timeout = setTimeout(callback, 1000);
// };

// elem.onmouseout = function() {
// doc_body.classList.remove(’hide-sec_nav’);
// clearTimeout(timeout);
// }
// };
 

});

window.REBELMOUSE_TASKS_QUEUE.push(function(){

 
 // Scroll position for primary navigation

function init() {
 const isMobile = window.innerWidth <= 768; 
 
 let menuButtonSize = 0;
 const menuButton = document.querySelector(».navbar .nav .sticky-left-click»);

 if (menuButton) {
 menuButtonSize = menuButton.getBoundingClientRect().width;
 }

 var pri_nav = document.querySelector(».navbar .nav»);
 var hamb_nav = document.querySelector(».hamburger .nav»);

 // Checking active primary menu item and calculating left scroll for the navigation
 const activeMenuItem = document.querySelector(
 «.navbar .nav .nav–item.active»
 );
 
 if (activeMenuItem) {
 const activeMenuItemLeftPosition = activeMenuItem.offsetLeft;

 const navigation = document.querySelector(».navbar .nav»);
 const navigationComputedStyles = window.getComputedStyle(navigation);
 const marginLeft = parseInt(
 navigationComputedStyles.getPropertyValue(»margin-left»)
 );

 pri_nav.scrollLeft =
 activeMenuItemLeftPosition – marginLeft – menuButtonSize;
 }

 
 if (!isMobile && window.sessionStorage.getItem(»pri_nav_pos»)) {
 pri_nav.scrollLeft = window.sessionStorage.getItem(»pri_nav_pos»);
 }

 // The logic for the secondary menu wasn’t changed
 if (
 window.sessionStorage.getItem(»sec_nav_pos») &&
 window.sessionStorage.getItem(»sec_nav_wrap»)
 ) {
 var scrolli__item = document.querySelector(
 «.» + window.sessionStorage.getItem(»sec_nav_wrap») + » .list»
 );
 if (scrolli__item) {
 scrolli__item.scrollLeft = window.sessionStorage.getItem(»sec_nav_pos»);
 }
 }

 window.pri_nav_items = pri_nav.querySelectorAll(»a»);
 window.sec_nav_items = document.querySelectorAll(».navbar .secondary–nav a»);
 window.hamb_nav_items = hamb_nav.querySelectorAll(»a»);

 // Primary navigation click handlers
 pri_nav_items.forEach(function (item) {
 item.onclick = function (event) {
 console.log(»Primary nav clicked:», event.target);

 const watchLive = event.target?.classList.contains(’watch-live-button’);

 const navItem = event.target.closest(».nav–item»);
 if (navItem) {
 // Remove active class from all primary nav items (both navbar and hamburger)
 document.querySelectorAll(».navbar .nav .nav–item»).forEach((el) => {
 el.classList.remove(»active»);
 });
 document
 .querySelectorAll(».hamburger .nav .nav–item»)
 .forEach((el) => {
 el.classList.remove(»active»);
 });

 // Add active class to clicked primary nav item
 navItem.classList.add(»active»);

 // Find corresponding item in hamburger menu and activate it
 const href = item.getAttribute(»href»);
 const correspondingHamb = Array.from(hamb_nav_items).find(
 (a) => a.getAttribute(»href») === href
 );

 if (correspondingHamb) {
 const corrHambNavItem = correspondingHamb.closest(».nav–item»);
 if (corrHambNavItem) {
 corrHambNavItem.classList.add(»active»);
 }
 }

 // Save active primary nav item to sessionStorage
 const priNavId = navItem.getAttribute(»data-pri-nav-id»);
 if (priNavId) {
 if(watchLive){
 let watchChannelActive = document.querySelector(’.nav–item.watch–channel__active’);
 let activeMenuItemLeftPosition = watchChannelActive.offsetLeft;
 let navigation = document.querySelector(».navbar .nav»);
 let navigationComputedStyles = window.getComputedStyle(navigation);
 let marginLeft = parseInt(navigationComputedStyles.getPropertyValue(»margin-left»));

 let targetScrollPosition = activeMenuItemLeftPosition – marginLeft – menuButtonSize;
 watchLiveLink = document.querySelector(’.navbar .nav–item.watch–channel__active’)
 watchLive_navId = watchLiveLink.getAttribute(»data-pri-nav-id»)
 watchLive_secId = watchLiveLink.querySelector(’[aria-label=»Live»]’).getAttribute(»data-sec-nav-id»)
 sessionStorage.setItem(»active_pri_nav_item», watchLive_navId);
 sessionStorage.setItem(»active_sec_nav_item», watchLive_secId);
 window.sessionStorage.setItem(»pri_nav_pos», targetScrollPosition);
 } else {
 sessionStorage.setItem(»active_pri_nav_item», priNavId);
 console.log(»Saved active primary nav item:», priNavId);
 }
 }

 // Clear secondary nav active state when primary nav changes
 if(!watchLive){
 sessionStorage.removeItem(»active_sec_nav_item»);
 }
 document
 .querySelectorAll(».navbar .secondary–nav .list__item»)
 .forEach((el) => {
 el.classList.remove(»active»);
 });
 
 }

 // Original sessionStorage handling
 sessionStorage.removeItem(»pri_nav_pos»);
 sessionStorage.removeItem(»sec_nav_wrap»);
 sessionStorage.removeItem(»sec_nav_pos»);
 if(!watchLive){
 window.sessionStorage.setItem(»pri_nav_pos», pri_nav.scrollLeft);
 }
 };
 });

 // Secondary navigation click handlers
 sec_nav_items.forEach(function (item) {
 item.onclick = function (event) {
 const target = event.target;

 // Remove active class from all secondary nav list__items
 document
 .querySelectorAll(».navbar .secondary–nav .list__item»)
 .forEach((el) => {
 el.classList.remove(»active»);
 });

 // Add active class to the closest .list__item
 const listItem = target.closest(».list__item»);
 if (listItem) {
 listItem.classList.add(»active»);
 }

 // Save active secondary nav item to sessionStorage
 const secNavId = target.getAttribute(»data-sec-nav-id»);
 if (secNavId) {
 sessionStorage.setItem(»active_sec_nav_item», secNavId);
 }

 // KEEP primary nav active and save it (if it’s a sub-menu)
 const navItem = target.closest(».nav–item»);
 if (navItem) {
 const priNavId = navItem.getAttribute(»data-pri-nav-id»);
 if (priNavId) {
 sessionStorage.setItem(»active_pri_nav_item», priNavId);
 }
 }

 // Store scroll positions
 sessionStorage.removeItem(»sec_nav_wrap»);
 sessionStorage.removeItem(»sec_nav_pos»);

 const sec_nav_wrap = target.closest(».list»);
 if (sec_nav_wrap) {
 sessionStorage.setItem(»sec_nav_pos», sec_nav_wrap.scrollLeft);

 const navItem = sec_nav_wrap.closest(».nav–item»);
 if (navItem && navItem.classList[1]) {
 sessionStorage.setItem(»sec_nav_wrap», navItem.classList[1]);
 }
 }

 sessionStorage.setItem(»pri_nav_pos», pri_nav.scrollLeft);
 };
 });

 // Watch Live button click handler 
 const watchLiveButton = document.querySelector(’.sticky-left .watch-live-button’);
 if (watchLiveButton) {
 watchLiveButton.onclick = function(event) {
 console.log(’Watch Live button clicked:’, event.target);
 
 // Find the nav–item with watch–channel__active active classes
 const watchChannelActive = document.querySelector(’.nav–item.watch–channel__active.active’);
 if (watchChannelActive) {
 // Get the secondary navigation from this element
 const secondaryNav = watchChannelActive.querySelector(’.secondary–nav’);
 if (secondaryNav) {
 // Find the active secondary nav item (Live)
 const activeSecondaryItem = secondaryNav.querySelector(’.list__item.active’);
 if (activeSecondaryItem) {
 const secNavId = activeSecondaryItem.getAttribute(’data-sec-nav-id’);
 if (secNavId) {
 sessionStorage.setItem(’active_sec_nav_item’, secNavId);
 console.log(’Saved active secondary nav item from watch channel:’, secNavId);
 }
 }
 
 // Save the watch channel primary nav as active
 const priNavId = watchChannelActive.getAttribute(’data-pri-nav-id’);
 if (priNavId) {
 sessionStorage.setItem(’active_pri_nav_item’, priNavId);
 console.log(’Saved active primary nav item from watch channel:’, priNavId);
 }
 
 // Store scroll positions for secondary nav
 const secNavList = secondaryNav.querySelector(’.list’);
 if (secNavList) {
 sessionStorage.setItem(»sec_nav_pos», secNavList.scrollLeft);
 
 if (watchChannelActive.classList[1]) {
 sessionStorage.setItem(»sec_nav_wrap», watchChannelActive.classList[1]);
 }
 }
 
 // Store primary nav scroll position
 sessionStorage.setItem(»pri_nav_pos», pri_nav.scrollLeft);
 }
 }
 };
 }

 // Hamburger navigation click handlers
 hamb_nav_items.forEach(function (item) {
 item.onclick = function (event) {
 console.log(»Hamburger nav clicked:», event.target);

 const navItem = event.target.closest(».nav–item»);
 if (navItem) {
 // Remove active class from all primary nav items
 document.querySelectorAll(».navbar .nav .nav–item»).forEach((el) => {
 el.classList.remove(»active»);
 });
 document
 .querySelectorAll(».hamburger .nav .nav–item»)
 .forEach((el) => {
 el.classList.remove(»active»);
 });

 // Add active class to clicked hamburger nav item
 navItem.classList.add(»active»);

 // Find corresponding item in primary nav and activate it
 const href = item.getAttribute(»href»);
 const corresponding = Array.from(
 document.querySelectorAll(».navbar .nav .nav–item a»)
 ).find((a) => a.getAttribute(»href») === href);

 if (corresponding) {
 const corrNavItem = corresponding.closest(».nav–item»);
 if (corrNavItem) {
 corrNavItem.classList.add(»active»);
 }
 }

 // Save active primary nav item to sessionStorage
 const priNavId = navItem.getAttribute(»data-pri-nav-id»);
 if (priNavId) {
 sessionStorage.setItem(»active_pri_nav_item», priNavId);
 console.log(»Saved active primary nav item:», priNavId);
 }

 // Clear secondary nav active state when primary nav changes
 sessionStorage.removeItem(»active_sec_nav_item»);
 document
 .querySelectorAll(».navbar .secondary–nav .list__item»)
 .forEach((el) => {
 el.classList.remove(»active»);
 });
 }

 // Original sessionStorage handling
 sessionStorage.removeItem(»pri_nav_pos»);
 sessionStorage.removeItem(»sec_nav_wrap»);
 sessionStorage.removeItem(»sec_nav_pos»);
 window.sessionStorage.setItem(»pri_nav_pos», pri_nav.scrollLeft);
 };
 });
}


function restoreActiveNavigation() {
 const isMobile = window.innerWidth <= 768;
 

 if (isMobile) {
 console.log(»Mobile detected – skipping sessionStorage restore»);
 return;
 }

 const activePriNavItem = sessionStorage.getItem(»active_pri_nav_item»);
 const activeSecNavItem = sessionStorage.getItem(»active_sec_nav_item»);

 // Always restore primary nav first (if it exists)
 if (activePriNavItem) {
 const priElement = document.querySelector(
 `.navbar [data-pri-nav-id=»${activePriNavItem}»]`
 );
 if (priElement) {
 // Clear all primary nav items
 document
 .querySelectorAll(».navbar .nav .nav–item»)
 .forEach((el) => el.classList.remove(»active»));
 document
 .querySelectorAll(».hamburger .nav .nav–item»)
 .forEach((el) => el.classList.remove(»active»));

 // Set primary nav as active
 priElement.classList.add(»active»);
 console.log(»Restored active class to primary nav:», priElement);

 // Activate corresponding hamburger item
 const priLink = priElement.querySelector(»a»);
 if (priLink) {
 const href = priLink.getAttribute(»href»);
 const correspondingHamb = Array.from(window.hamb_nav_items).find(
 (a) => a.getAttribute(»href») === href
 );

 if (correspondingHamb) {
 const corrHambNavItem = correspondingHamb.closest(».nav–item»);
 if (corrHambNavItem) {
 corrHambNavItem.classList.add(»active»);
 console.log(
 «Restored active class to hamburger nav:»,
 corrHambNavItem
 );
 }
 }
 }
 }
 }

 // Then restore secondary nav (if it exists)
 if (activeSecNavItem) {
 const secElement = document.querySelector(
 `[data-sec-nav-id=»${activeSecNavItem}»]`
 );
 if (secElement) {
 document
 .querySelectorAll(».navbar .secondary–nav .list__item»)
 .forEach((el) => el.classList.remove(»active»));
 const listItem = secElement.closest(».list__item»);
 if (listItem) {
 listItem.classList.add(»active»);
 console.log(»Restored active secondary nav:», listItem);
 }
 }
 }
}

// Add unique identifiers to navigation items
function initializeNavigationIds() {
 // Add IDs to primary nav items
 pri_nav_items.forEach(function (item, index) {
 const navItem = item.closest(».nav–item»);
 if (navItem && !navItem.hasAttribute(»data-pri-nav-id»)) {
 navItem.setAttribute(»data-pri-nav-id», `pri-nav-${index}`);
 }
 });

 // Add IDs to hamburger nav items
 hamb_nav_items.forEach(function (item, index) {
 const navItem = item.closest(».nav–item»);
 if (navItem && !navItem.hasAttribute(»data-pri-nav-id»)) {
 navItem.setAttribute(»data-pri-nav-id», `pri-nav-${index}`);
 }
 });

 // Add IDs to secondary nav items
 sec_nav_items.forEach(function (item, index) {
 if (!item.hasAttribute(»data-sec-nav-id»)) {
 item.setAttribute(»data-sec-nav-id», `sec-nav-${index}`);
 }
 });
}

// Initialize navigation system
function initializeNavigation() {
 init();
 initializeNavigationIds();
 
 

 if(window.location.pathname === «/watch/live»){
 restoreActiveNavigation();
 }
}

// Initialize when DOM is ready
// if (document.readyState === ‘loading’) {
// document.addEventListener(’DOMContentLoaded’, initializeNavigation);
// } else {
// initializeNavigation();
// }

REBELMOUSE_STDLIB.createElementChangeListener(».hamburger», function () {
 initializeNavigation();
});

// Opinion section scroll handling
if (window.location.search == «?opinion») {
 const opinionWidget = document.querySelector(».opinion-wrapper .widget»);
 if (opinionWidget) {
 if (
 /constructor/i.test(window.HTMLElement) ||
 (function (p) {
 return p.toString() === «[object SafariRemoteNotification]»;
 })(
 !window[»safari»] ||
 (typeof safari !== «undefined» && window[»safari»].pushNotification)
 )
 ) {
 opinionWidget.scrollIntoView(true);
 } else if (typeof InstallTrigger !== «undefined») {
 opinionWidget.scrollIntoView(true);
 } else {
 opinionWidget.scrollIntoView({
 block: «nearest»,
 behavior: «smooth»,
 });
 }
 }
}
 

});

window.REBELMOUSE_TASKS_QUEUE.push(function(){

 
 REBELMOUSE_STDLIB.createElementChangeListener(’.show-only-if-post-present’, function (item) {
 if (!item.querySelector(’.widget’)) {
 item.classList.add(’hidden’);
 if(item.nextSibling.classList.contains(’ad–placeholder’)){
 item.nextSibling.remove();
 }
 }
 });

 REBELMOUSE_STDLIB.createElementChangeListener(’.show-only-if-four-post-present’, function (item) {
 if (item.querySelectorAll(’.widget’).length <= 3) {
 item.classList.add(’hidden’);
 }
 })

 REBELMOUSE_STDLIB.createElementChangeListener(’.rebellt-ecommerce–price’, function (item) {
 item.innerHTML = item.innerHTML.replace(/\$/g, ‘£;’);
 })
 

});

window.REBELMOUSE_TASKS_QUEUE.push(function(){

 
 // Piano object
tp = window[’tp’] || [];

const addInfoToTP = () => {
 const preDefinedInfo = document.querySelector(’.js-all-tags’);
 let allTags = `${preDefinedInfo.dataset.tags.replace(/[\[\]’]+/g,»)}`;
 let primarySectionTitle = preDefinedInfo.dataset.contentSection;
 let postAuthor = preDefinedInfo.dataset.author;
 let postType = preDefinedInfo.dataset.contentType;
 let cd1 = preDefinedInfo.dataset.cd1;
 let cd2 = preDefinedInfo.dataset.cd2;
 let cd9 = preDefinedInfo.dataset.cd9;
 let cd11 = window.matchMedia(’(display-mode: standalone)’).matches ? ‘pwa’ : ‘web’;
 // console.log(cd11);
 let cd12 = preDefinedInfo.dataset.cd12;
 let cd13 = preDefinedInfo.dataset.cd13;
 let cd14 = preDefinedInfo.dataset.cd14;
 let cd15 = preDefinedInfo.dataset.cd15;
 let cd16 = preDefinedInfo.dataset.cd16;
 let cd17 = preDefinedInfo.dataset.cd17;
 let cd18 = preDefinedInfo.dataset.cd18;
 let cd19 = document.referrer.split(»/»)[2] || ‘not set’;
 let cd23 = ‘not set’;
 let cd25 = window.navigator.userAgent;

 const getInfo = (string) => string.split(’\’:’)[1].replace(/[&#,+()$~%.'»*?<>{}]/g, »).trim();
 const passDataToTp = (type, data) => tp.push([type, data]);
 const passCustomDataToTp = (name, data) => tp.push([’setCustomVariable’, name, data]);
 
 primarySectionTitle = getInfo(primarySectionTitle);
 passDataToTp(’setContentSection’, primarySectionTitle);

 postAuthor = getInfo(postAuthor);
 passDataToTp(’setContentAuthor’, postAuthor);

 postType = getInfo(postType);
 passCustomDataToTp(’content_type’, postType);

 cd1 = getInfo(cd1);
 passCustomDataToTp(’cd1’, cd1);
 cd2 = getInfo(cd2);
 passCustomDataToTp(’cd2’, cd2);
 cd9 = getInfo(cd9);
 passCustomDataToTp(’cd9’, cd9);
 passCustomDataToTp(’cd11’, cd11);
 cd12 = getInfo(cd12);
 passCustomDataToTp(’cd12’, cd12);
 cd13 = getInfo(cd13);
 passCustomDataToTp(’cd13’, cd13);
 cd14 = getInfo(cd14);
 passCustomDataToTp(’cd14’, cd14);
 cd15 = getInfo(cd15);
 passCustomDataToTp(’cd15’, cd15);
 cd16 = getInfo(cd16);
 passCustomDataToTp(’cd16’, cd16);
 cd17 = getInfo(cd17);
 passCustomDataToTp(’cd17’, cd17);
 cd18 = getInfo(cd18);
 passCustomDataToTp(’cd18’, cd18);
 passCustomDataToTp(’cd19’, cd19);
 passCustomDataToTp(’cd23’, cd23);
 passCustomDataToTp(’cd25’, cd25);

 return allTags.length ? passDataToTp(’setTags’, allTags) : false;
}

addInfoToTP();
 

});

window.REBELMOUSE_LOW_TASKS_QUEUE.push(function(){

 
 // window.gbnCE = window.gbnCE || [];
// window.gbnCE.push([
// ‘init’,
// function (gbnCE) {
// gbnCE.auth.updateHeaderElement();
// },
// ]);
 

});]]></script><script class=»rm-i-script» id=»user-javascript-active» type=»text»><![CDATA[
 window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function bootRpm(){
 const INTERNAL_CLASS_PREFIXES = [»tag-«, «post-section-«, «rm-fl-«];

 function filterOutNoisyClassNames(className) {
 function doesClassNameStartWithPrefix(badPrefix) {
 return className.indexOf(badPrefix) === 0;
 }
 
 return !INTERNAL_CLASS_PREFIXES.some(doesClassNameStartWithPrefix);
 }
 
 function signatureMaker(id, tagName, classList) {
 const cleanClassList = classList.filter(filterOutNoisyClassNames).sort();
 return [id, tagName, cleanClassList];
 }
 
 window.__rpmOptions = window.__rpmOptions || {
 lcpTrackerOptions: {
 signatureMaker: signatureMaker,
 },
 clsTrackerOptions: {
 signatureMaker: signatureMaker,
 },
 };
 
 
 window.REBELMOUSE_STDLIB.loadExternalScript(»https://www.rebelmouse.com/pharos/client/v1/mjs/web.mjs», function(){})
 });

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 const INTERNAL_CLASS_PREFIXES = [»tag-«, «post-section-«, «rm-fl-«];

function filterOutNoisyClassNames(className) {
 function doesClassNameStartWithPrefix(badPrefix) {
 return className.indexOf(badPrefix) === 0;
 }

 return !INTERNAL_CLASS_PREFIXES.some(doesClassNameStartWithPrefix);
}

function signatureMaker(id, tagName, classList) {
 const cleanClassList = classList.filter(filterOutNoisyClassNames).sort();
 return [id, tagName, cleanClassList];
}

window.__rpmOptions = {
 lcpTrackerOptions: {
 signatureMaker: signatureMaker,
 },
};


window.REBELMOUSE_STDLIB.loadExternalScript(»https://www.rebelmouse.com/pharos/client/v1/mjs/web.mjs», function(){})
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 const DEBUGGING = false;
const PA_WAIT_INTERVAL = 100; // time in ms to wait for Piano Analytics
const PA_WAIT_ATTEMPTS = 5; // number of times to try looking for Piano Analytics
// const PLAYER_URL = «https://mm-dev.simplestream.com/ssmp/gbnews.js»;
const PLAYER_URL = «https://mm-dev.simplestream.com/ssmp/gbnewsv2.js»; // testing endpoint!

var pa_attempts = 0;

// Only load player when Piano Analytics is ready
waitForPianoAnalytics();

function waitForPianoAnalytics(){
 debug(’Checking for Piano Analytics...’);
 if (typeof pa !== «undefined» || pa_attempts >= PA_WAIT_ATTEMPTS){
 debug(’Piano Analytics is loaded so loading video player’);
 loadVideoPlayer();
 }
 else{
 debug(’Piano Analytics not yet loaded’);
 pa_attempts++;
 setTimeout(waitForPianoAnalytics, PA_WAIT_INTERVAL);
 }
}

function loadVideoPlayer() {
 debug(’creating listener’);
 window.REBELMOUSE_STDLIB.createElementChangeListener(
 «.simplestream-holder.rm-shortcode .simplestream»,
 function (_element) {
 debug(’loading external JS’);
 window.REBELMOUSE_STDLIB.loadExternalScript(
 PLAYER_URL,
 function () {
 debug(’simplestream staging JS loaded’);
 loadScript();
 function loadScript(){
 let sidebar = document.querySelector(’.sidebar-wrapper’);
 let noSidebar = sidebar ? window.getComputedStyle(sidebar).display === ‘none’ : false;

 if (_element.classList.contains(’sidebar’) && noSidebar){
 debug(’Preventing initialization of hidden sidebar live player’)
 }
 else{
 var getId=’#’+_element.getAttribute(’data-id’);
 debug(’initializing video ‘ + getId);
 window.simplestream.initApp();
 }
 }
 }
 );
 }
 );
}

function debug(message) {
 if (DEBUGGING)
 console.log(’[Video Player]: ‘+message);
}
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 function asyncScriptLoading(src) {
 return new Promise(function (resolve, reject) {
 let s;
 s = document.createElement(’script’);
 s.type = ‘text/javascript’;
 s.async = true;
 s.src = src;
 s.onload = resolve;
 s.onerror = reject;
 document.head.appendChild(s);
 });
}

const src = ‘//cdn.pushwoosh.com/webpush/v3/pushwoosh-web-notifications.js’;

asyncScriptLoading(src);
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 REBELMOUSE_STDLIB.createElementChangeListener(»#pwSubscribePopup.pw-show», function(element){
 console.log(element);
 setTimeout(() => {
 element.classList.add(»delay-display»);
 }, 1000)
})
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 REBELMOUSE_STDLIB.createElementChangeListener(’.carousel–wrapper’, function(carousel){
 carousel_post=carousel.querySelector(’.widget’);
 var scrolling_item=carousel.querySelector(’.posts-wrapper’);
 if(!scrolling_item) return;
// console.log(carousel);

function car_distance_calc(){

 var multiplier=parseInt(scrolling_item.clientWidth/carousel_post.clientWidth);
 if(carousel.classList.contains(’scroll–one’)){
 multiplier=1;
 }
// console.log(multiplier + «—«+scrolling_item.clientWidth+»—» +carousel_post.clientWidth )
return multiplier*(carousel_post.clientWidth+20);
}
let carousel__arrows=carousel.querySelectorAll(’.carousel–arrow’);

var carousel_distance = car_distance_calc();

carousel__arrows.forEach(function(item){
 buttonNextPrevVisiblity(700,item.closest(’.carousel–wrapper’));
 item.onclick=function(){
 scrolling_item.scrollBy({
 left: item.classList.contains(’prev’)? -carousel_distance:carousel_distance,
 behavior: ‘smooth’
 });
 buttonNextPrevVisiblity(700,item.closest(’.carousel–wrapper’));
 }
})
 window.addEventListener(»resize»,debounce(function(e){
 carousel_distance=car_distance_calc();
 carousel__arrow_pos();
}));
function carousel__arrow_pos(){
carousel__arrows.forEach(function(item){
item.style.top=(carousel_post.clientWidth*.5625-53)/2 + ‘px’
})
}
carousel__arrow_pos();

function buttonNextPrevVisiblity(timeOffset,carousel) {
var btn_prev=carousel.querySelector(’.carousel–arrow.prev’);
 var btn_next=carousel.querySelector(’.carousel–arrow.next’);
 

 if(scrolling_item.scrollWidth <= scrolling_item.clientWidth+20){
 btn_next.classList.add(»hidden»);
 btn_prev.classList.add(»hidden»)
 }
 setTimeout(sccc => {
 if (scrolling_item.scrollLeft > 0) {
 btn_prev.classList.remove(»hidden»)
 } else {
 btn_prev.classList.add(»hidden»)
 }
 if (scrolling_item.scrollWidth <= (scrolling_item.clientWidth + scrolling_item.scrollLeft+ 20) ) {
 btn_next.classList.add(»hidden»)
 } else {
 btn_next.classList.remove(»hidden»)
 }
 }, timeOffset)
 }

})
function debounce(func){
 var timer;
 return function(event){
 if(timer) clearTimeout(timer);
 timer = setTimeout(func,250,event);
 };
}
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 const DEBUGGING = false;
const PIANO_SCRIPT = ‘https://experience-eu.piano.io/xbuilder/experience/load?aid=6N1iEZE6pe’;
const PIANO_ENDPOINT = ‘https://buy-eu.piano.io/api/v3’;
const COOKIE = ‘loggedinCookie_sid’;
// const SOURCEPOINT_COOKIE = ‘sp_subscribed_status’;
const OLD_DATE = ‘Thu, 18 Dec 2013 12:00:00 UTC’;

// initialise Piano
tp = window.tp || [];
tp.push([’setUsePianoIdUserProvider’, true]);
tp.push([’setApplePayMerchantId’, ‘https://www.gbnews.com/.well-known/apple-developer-merchantid-domain-association’]);
tp.push([’setPianoIdUrl’, ‘https://auth.gbnews.com’]);
tp.push([’setEndpoint’, PIANO_ENDPOINT]);

// declare login icons
var loginLink = document.querySelector(’.login-link’);
var loginLinkText = document.getElementById(’login-link-text’);

// on initialisation
tp.push([
 ‘init’,
 function () {
 debug(’Piano init...’);

 // handle user logging in and out from Piano
 tp.pianoId.init({
 loggedIn: function (data) {
 setUser(data);
 },
 loggedOut: function () {
 debug(’User is logged out’);
 loggedOut();
 },
 });

 if (!tp.pianoId.isUserValid()) {
 debug(’Not logged into Piano...’);
 attachLoginLink();
 enableLoginLink();

 // 1 Sourcepoint New – remove pre-existing cookies
 // deleteSourcepointCookie();

 window.vfQ.push(() => {
 // Viafoura is loaded and window.vf is available
 // are they logged into Viafoura?
 window.vf.context.get(’user’).then((user) => {
 if (user.email) {
 debug(’Logged out from Viafoura as not logged into Piano’);
 window.vf.session.logout();
 deleteCookie();
 }
 });
 });
 }

 // Viafoura
 // Make vfQ available or use existing one if already loaded
 window.vfQ = window.vfQ || [];
 window.vfQ.push(() => {
 // Viafoura is loaded and window.vf is available
 debug(’Viafoura loaded’);

 window.vf.$prepublish((channel, event, ...args) => {
 if (channel === ‘authentication’ && event === ‘required’) {
 debug(’Viafoura login flow trigger’);
 window.vf.$publish(’tray’, ‘close’);

 if (args[0].method === ‘signup’) {
 // Registration modal
 showRegistrationModal();
 } else {
 // Login modal
 showLoginModal();
 }
 return false;
 } else {
 return { channel, event, args };
 }
 });

 // handle logout from Viafoura
 window.vf.$subscribe(’authentication’, ‘logout’, () => {
 // User logging out
 tp.pianoId.logout();
 debug(’Viafoura logout intercept’);
 });
 });

 // functions

 function loggedIn() {
 debug(’User has logged into Piano’);
 }

 function registered() {
 debug(’User has registered with Piano’);
 }

 function loggedOut() {
 debug(’User has logged out of Piano’);

 // Gamification logout
 window.gbnCE = window.gbnCE || [];
 window.gbnCE.push([’logout’]);
 window.gbnCE.push([’logoutHeader’]);

 window.vfQ.push(() => {
 // Viafoura is loaded and window.vf is available
 // Viafoura logout
 debug(’Logging out of Viafoura’);
 window.vf.session.logout();
 loginLink.href = ‘javascript:void(0)’;
 deleteCookie();
 });

 loginLink.classList.remove(’loggedin’);
 loginLink.innerText = »;

 if (loginLinkText) {
 loginLinkText.textContent = ‘Log in’;
 }

 // attach login link
 attachLoginLink();
 enableLoginLink();
 }

 function showLoginModal() {
 debug(’Login modal’);
 tp.pianoId.show({
 loggedIn: loggedIn,
 loggedOut: loggedOut,
 registrationSuccess: registered,
 stage: ‘web’,
 });
 }

 function showRegistrationModal() {
 debug(’Registration modal’);
 tp.pianoId.show({
 screen: ‘register’,
 loggedIn: loggedIn,
 loggedOut: loggedOut,
 registrationSuccess: registered,
 stage: ‘web’,
 });
 }

 function setUser(data) {
 debug(’Setting up logged in user’);

 // Gamification login
 if (data.token) {
 debug(’Logging into coin economy system’);
 window.gbnCE = window.gbnCE || [];
 window.gbnCE.push([’login’, data.token]);

 // Load profile
 window.gbnCE.push([’profile’]);

 // update header on login
 window.gbnCE.push([
 ‘init’,
 function (gbnCE) {
 gbnCE.auth.updateHeaderElement();
 },
 ]);

 // Now send daily_visit event
 // window.gbnCE.push([’event’, ‘daily_visit’, ‘platform’]);
 }

 if (data.user) {
 var user_id = data.user.uid;
 var user_email = data.user.email;

 if (user_id) {
 // initials in avatar
 setAvatar(data.user);
 addLoginLinkText();

 // call CI passSignalFunction
 setTimeout(() => {
 passSignalDataFtn(user_email);
 }, 2000);

 // detach login link
 detachLoginLink();
 enableLoginLink();

 // set cookie
 setCookie(user_id);

 window.vfQ.push(() => {
 let commentsParent = document.getElementById(’comments’);
 // Viafoura is loaded and window.vf is available
 // manually invoke the login flow
 // rather than waiting for Viafoura to
 // listen for the cookie
 window.vf.session.login
 .cookie(user_id)
 .then(() => {
 debug(’Invoked login to Viafoura’);

 // if vfErrorDiv exists, remove from the page because VF has loaded
 // console.log(»remove the Error Div if it exists on the page»);
 // let errorDiv = document.getElementById(»vfErrorDiv»);
 // if (errorDiv) {
 // errorDiv.remove();
 // }
 })
 .catch((error) => {
 debug(’Failed to log user id ‘ + user_id + ‘ into Viafoura: ‘ + error.message);
 // log them out of Piano
 // tp.pianoId.logout();

 // check and remove vfErrorDiv if it is already there
 // let errorDiv = document.getElementById(»vfErrorDiv»);
 // if (errorDiv) {
 // errorDiv.remove();
 // }

 // create vfErrorDiv in the page
 // console.log(»create the Error DIV»);
 // let vfErrorDiv = document.createElement(»div»);
 // vfErrorDiv.id = «vfErrorDiv»;
 // vfErrorDiv.classList.add(»vfErrorDiv»);
 // vfErrorDiv.textContent = «There is an issue with commenting currently, please try again later.»
 // commentsParent.insertBefore(vfErrorDiv, commentsParent.firstChild);
 });
 });
 }
 }
 }

 function attachLoginLink() {
 debug(’Attach login link’);
 loginLink.addEventListener(’click’, openLoginModal);

 if (loginLinkText) {
 loginLinkText.addEventListener(’click’, openLoginModal);
 }
 }

 function detachLoginLink() {
 debug(’Detach login link’);
 loginLink.removeEventListener(’click’, openLoginModal);
 if (loginLinkText) {
 loginLinkText.removeEventListener(’click’, openLoginModal);
 }
 }

 function openLoginModal(e) {
 debug(’Login link clicked’);
 e.preventDefault();
 showLoginModal();
 }

 window.openLoginModalGlobal = function () {
 debug(’Follow link clicked’);
 showLoginModal();
 };

 function enableLoginLink() {
 // enable the login link
 loginLink.classList.remove(’disabled’);
 if (loginLinkText) {
 loginLinkText.classList.remove(’disabled’);
 }
 }

 function setAvatar(user) {
 debug(’User is logged in so setting initials in icon’);

 // set initials for avatar
 // this assumes we have an email, but we may not have first or last names
 // so then we take the first two letters of their first name
 // or, if no first name, the first two letters of their email
 var init1 = user.firstName ? user.firstName[0] : user.email[0];
 var init2 = user.lastName ? user.lastName[0] : user.firstName ? user.firstName[1] : user.email[1];
 var inits = init1 + init2;
 // loginLink.innerText = inits;

 loginLink.classList.add(’loggedin’);
 debug(’Logged in as ‘ + inits);
 loginLink.href = ‘#’;
 }

 function addLoginLinkText() {
 if (loginLinkText) {
 loginLinkText.textContent = ‘My Account’;
 loginLinkText.href = ‘#’;
 }
 }

 async function passSignalDataFtn(email) {
 // console.log(»hashed email for liveramp called»);
 const EMAIL_VALIDATION_REGEX = /((([^<>()\[\].,;:\s@»]+(\.[^<>()\[\].,;:\s@»]+)*)|(».+»))@(([^<>()[\].,;:\s@»]+\.)+[^<>()[\].,;:\s@»]{2,}))/i;
 if (!email || !EMAIL_VALIDATION_REGEX.test(email)) {
 console.warn(»Invalid email provided, escape»);
 return;
 }
 const normalizedEmail = email.trim().toLowerCase();
 const encoder = new TextEncoder();
 const data = encoder.encode(normalizedEmail);
 const hashBuffer = await crypto.subtle.digest(»SHA-256″, data);
 const sha256 = Array.from(new Uint8Array(hashBuffer))
 .map(b => b.toString(16).padStart(2, «0»))
 .join(»»);
 
 ats.setAdditionalData({
 ‘type’: ‘emailHashes’,
 ‘id’: [`${sha256}`]
 })
 }

 function setCookie(token) {
 // set cookie
 const date = new Date();
 date.setMonth(date.getMonth() + 1);
 const expires = ‘expires=’ + date.toUTCString();
 document.cookie = COOKIE + ‘=’ + token + ‘; ‘ + expires + ‘; path=/;’;
 }

 function deleteCookie() {
 // delete cookie
 document.cookie = COOKIE + ‘=; expires=’ + OLD_DATE + ‘; path=/’;
 }
 },
]);
// end of initialisation (init)

// debugging function
function debug(message) {
 if (DEBUGGING) console.log(’[Login link javascript]: ‘ + message);
}
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 REBELMOUSE_STDLIB.createElementChangeListener(».widget__shares», function(sharesElement){
 let currentUrl = window.location.href;
 console.log(sharesElement);
 let wppShareUrl = «https://web.whatsapp.com://send?text=» + currentUrl;
 let wppBtn = document.createElement(»a»);
 wppBtn.innerHTML = `<i aria-hidden=»true» class=»icons-share whatsapp fa fa-whatsapp»>`
 wppBtn.setAttribute(»href», wppShareUrl);
 wppBtn.setAttribute(»data-track-share», «WhatsApp»);
 wppBtn.setAttribute(»class», «share share-whatsapp-desktop show-buttons»);
 wppBtn.setAttribute(»rel», «noopener noreferrer»);
 wppBtn.setAttribute(»aria-label», «Share on WhatsApp»);

 /* let fbShareUrl = «fb-messenger://share/?link=» + currentUrl;
 let fbBtn = document.createElement(»a»);
 fbBtn.innerHTML = `<i aria-hidden=»true» class=»icons-share messenger fa fa-facebook-messenger»>`
 fbBtn.setAttribute(»href», fbShareUrl);
 fbBtn.setAttribute(»data-track-share», «Facebook Messenger»);
 fbBtn.setAttribute(»class», «share share-facebook-messenger show-buttons»);
 fbBtn.setAttribute(»rel», «noopener noreferrer»);
 fbBtn.setAttribute(»aria-label», «Share on Facebook Messenger»);

 sharesElement.insertBefore(wppBtn, sharesElement.children[2]);
 sharesElement.insertBefore(fbBtn, sharesElement.children[-1]); */
})
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 if (!CSS.supports(’selector(:has(*))’)) {
 REBELMOUSE_STDLIB.createElementChangeListener(».widget», function(post){
 const isMemberPost = Boolean(post.querySelector(’.member-post-label’));

 if (isMemberPost) {
 const label = post.querySelector(’.member-post-label’);
 const postContainer = label.closest(’.widget’);

 return postContainer.classList.add(’member’);
 }

 return false;

 //return isMemberPost ? post.classList.add(’member’) : false;
 })
}
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 window.REBELMOUSE_STDLIB.loadExternalScript(»//scripts.loyaltypoints.gbnews.com/index.js?v=1″, function() {
 
 console.log(»[gbnCE] Script loaded»);
 
 });
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 var comments = document.getElementById(’comments’);
var comments_buttons5 = document.getElementsByClassName(»comments__button»);
var attempts = 0;
var engbar = document.querySelector(’.engbar’);
var comments_loaded = false;
const max_attempts = 15;
const wait_interval = 120;
const engbar_h = 80;
const margin = 35;
const timeout = 2500;
const conversation_starter_active = false;
const debugging = false;

var isUserScrollingUp = false;
var lastScrollY = window.scrollY;
var scrollingActive = false;

// new bit
var scrollUpThreshold = 5;


 
debug(»Hash = «+location.hash)
if (location.hash === «#comments» || location.hash === «#viafoura-conversations-id») {
	debug(»Scrolling to comments due to hash = «+location.hash); 	
	scrollToComments();
}

if (comments_buttons5.length) {
 for(var i = 0; i<comments_buttons5.length; i++) {
 comments_buttons5[i].onclick=function() {
 debug(»Comments link clicked»);
 scrollToComments();
 }
 }
}
 

// function 1
// set scrollingActive to true (indicating scrolling is happening)
// call smoothScroll() to scroll to the comments section
// checks if isUserScrollingUp is true – if yes then aborts and prevents further action happening
function scrollToComments() {
 debug(attempts + ‘ scrollToComments’);

 var offset = (engbar ? engbar.offsetHeight : engbar_h) + margin;

 var OB = document.querySelector(’.OUTBRAIN’);
 var adBlock = false;

 scrollingActive = true;
 smoothScroll(comments, offset).then(() => {
 if (isUserScrollingUp) {
 debug(»Scrolling up detected, canceling scrollToComments»);
 scrollingActive = false;
 return;
 }

 // check for ad blockers
 if (OB) {
 adBlock = window.getComputedStyle(OB)?.display === «none»;
 debug(’ad blocker ‘ + (adBlock ? ‘detected’ : ‘not detected’));
 }

 // if Viafoura not yet inserted into Outbrain try again
 if (!comments_loaded && !comments.closest(’.OUTBRAIN’) && attempts < max_attempts && !adBlock) {
 // wait and then try scrolling again
 debug(»Trying again...»);
 attempts++;
 setTimeout(() => {
 if (!isUserScrollingUp) {
 scrollToComments();
 } else {
 scrollingActive = false;
 }
 }, Math.floor(wait_interval * (attempts + 1)));
 } else {
 // the final attempt
 debug(»The final attempt»);
 smoothScroll(comments, offset).then(() => {
 if (document.querySelector(’.OUTBRAIN .comments-wrapper’) === null) {
 debug(’failed to insert comments into Outbrain’);
 if (document.querySelector(’.comments-wrapper .viafoura’)) {
 document.querySelector(’.comments-wrapper .viafoura’).style.display = «block»;
 }

 if (typeof window.OB_loaded === ‘undefined’ || !window.OB_loaded) {
 debug(’Outbrain did not load’);
 document.querySelector(’.you-may-like__wrapper’).style.display = «none»;
 }
 }
 debug(’Comments should now be in view’);

 // set loaded flag
 comments_loaded = true;
 scrollingActive = false;
 });
 }
 }).catch(err => {
 scrollingActive = false;
 debug(err.message);
 });
}

// function 2
// handling of the scroll to comments action
// promise is resolved when the target is reached
function smoothScroll(elem, offset = 0) {
 debug(»smoothScroll with offset = » + offset);

 const rect = elem.getBoundingClientRect();
 let targetPosition = Math.floor(rect.top + window.pageYOffset – offset);
 window.scrollTo({
 top: targetPosition,
 behavior: ‘smooth’
 });

 let p = new Promise((resolve, reject) => {
 const failed = setTimeout(() => {
 reject(new Error(»Scroll to comments timed out»));
 }, timeout);

 const scrollHandler = () => {
 if (Math.abs(window.pageYOffset – targetPosition) < 10) {
 window.removeEventListener(»scroll», scrollHandler);
 clearTimeout(failed);
 resolve(»Target reached, disabling scroll listener»);
 }

 if (window.scrollY < lastScrollY) {
 isUserScrollingUp = true;
 debug(»Scroll up detected»);
 window.removeEventListener(»scroll», scrollHandler);
 clearTimeout(failed);
 resolve(»User is scrolling up, disabling scroll listener»);
 }
 };

 if (Math.abs(window.pageYOffset – targetPosition) < 10) {
 clearTimeout(failed);
 resolve(»Scrolled to target position»);
 } else {
 window.addEventListener(»scroll», scrollHandler);
 }
 });

 p.then(value => {
 debug(value);
 }).catch(err => {
 debug(err.message);
 });

 return p;
}

// Add a scroll event listener to detect scroll direction
// Detects the scroll direction
// If the user starts to scroll up WHILE the script is running (more than the threshold set), set scrollingActive to false and ABORT scroll action
window.addEventListener(’scroll’, () => {

 // if (window.scrollY < lastScrollY) {
 if (lastScrollY – window.scrollY > scrollUpThreshold) {
 isUserScrollingUp = true;
 if (scrollingActive) {
 debug(»User started scrolling up during scroll, aborting»);
 scrollingActive = false;
 }
 } else {
 isUserScrollingUp = false;
 }
 lastScrollY = window.scrollY;
});


function debug(message) {
 if (debugging)
 console.log(’DEBUG [Scroll to comments]: ‘ + message);
}
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 let shareButton = document.querySelector(’.share__button’);
let copyText = document.querySelector(’.share-copy-link’);
const shareDialog = document.querySelector(’.share-background’);
const url = document.querySelector(’link[rel=canonical]’)
 ? document.querySelector(’link[rel=canonical]’).href
 : document.location.href;
const closeButton = document.querySelector(’.close-button’);
const title = document.title;

// const article = document.querySelector(’article[elid]’);
// const articleId = article ? article.getAttribute(’elid’) : null;

let pageLink = window.location.href;

// initialise Gamification window object
window.gbnCE = window.gbnCE || [];

closeButton.addEventListener(’click’, (event) => {
 shareDialog.classList.remove(’is-open’);
});

shareButton.addEventListener(’click’, (event) => {
 if (navigator.share) {
 navigator
 .share({
 title: title,
 url: url,
 })
 .then(() => {
 // console.log(’Thanks for sharing!’, title);
 // console.log(»article id is – «, articleId);
 window.gbnCE.push([’event’, ‘share’, ‘article’, pageLink]);
 console.log(’gbnCE push’, window.gbnCE);
 })
 .catch(console.error);
 } else {
 shareDialog.classList.add(’is-open’);
 window.gbnCE.push([’event’, ‘share’, ‘article’, articleId]);
 }
});

copyText.addEventListener(’click’, (event) => {
 navigator.clipboard.writeText(window.location.href);
});
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 let lastScrollTop = 0,
 engBar = document.querySelector(’.article-shares-el’);

window.addEventListener(»scroll», function(){ 
 
 let st = window.pageYOffset || document.documentElement.scrollTop; 
 showCommentsBtn()
 if (st > lastScrollTop) {
 if (document.body.scrollTop > 900 || document.documentElement.scrollTop > 900) {
 engBar.style.opacity = 100;
 // z-index was set to 999;
 engBar.style.zIndex = 98; 
 engBar.style.display = «flex»;

 } 
 } 
 // else if (st < lastScrollTop) {
 // showCommentsBtn()
 // if (document.body.scrollTop > 1100 || document.documentElement.scrollTop > 1100) {
 // engBar.style.opacity = 100;
 // engBar.style.zIndex = 999;

 
 // }
 // else{
 // showCommentsBtn()
 // engBar.style.opacity = 0; 
 // engBar.style.zIndex = -1;
 // engBar.style.display = «none»;

 // }
 // }
 lastScrollTop = st <= 0 ? 0 : st; // For Mobile or negative scrolling
}, false);

function showCommentsBtn(){
 if(document.getElementById(’comments’)){
 let commentsElement = document.getElementById(’comments’),
 bounding = commentsElement.getBoundingClientRect(),
 commentsBtn = document.querySelector(’.commentIcon’),
 commentsHeight = commentsElement.offsetHeight;


 if (commentsElement && bounding.top >= -(commentsHeight) && bounding.left >= 0 && bounding.right <= window.innerWidth && bounding.bottom <= window.innerHeight – 230) {
 commentsBtn.style.opacity = 0;
 commentsBtn.style.cursor = ‘default’; 
 commentsBtn.style.pointerEvents = «none»;
 //console.log(’Element is in the viewport!’);
 } else {
 commentsBtn.style.opacity = 100;
 commentsBtn.style.cursor = ‘pointer’; 
 commentsBtn.style.pointerEvents = «auto»;

 //console.log(’Element is NOT in the viewport!’);
 }
 }else{
 document.querySelector(’.commentIcon’).style.display = ‘none’;

 }
}
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 console.log(’=== CONTENT LOCK SCRIPT LOADED ===’);

const article = document.querySelector(’.body-description’);
const rebel1 = null; // force paragraph counting instead of rebelltitem1
let lock;
let ith = 0;
let pCount = 0;

let removedContent = [];
let removedRebel1Content = [];
let removedPuzzle = null;

let contentShouldBeLocked = false;

// Store current offer/term IDs in memory for potential localStorage save
let currentOfferId = null;
let currentTermId = null;

const DEBUGGING = false;

debug(’Content lock script started’);

// Ensure #piano-lock element exists in the DOM
function ensureLockExists() {
 lock = document.querySelector(’#piano-lock’);
 if (!lock) {
 debug(’Creating new #piano-lock element’);
 lock = document.createElement(’div’);
 lock.id = ‘piano-lock’;
 document.body.appendChild(lock);
 } else {
 debug(’#piano-lock already exists’);
 }
 return lock;
}

// Move lock element inside article and make it visible
const addLockStyles = () => {
 if (!lock.parentElement || lock.parentElement !== article) {
 article.appendChild(lock);
 }
 lock.classList.add(’locked’);
 lock.style.display = ‘block’;
};

// Remove article content after 2nd paragraph and show the lock
function hide_article() {
 debug(’hide_article called’);

 if (!article) {
 debug(’ERROR: .body-description not found’);
 return;
 }

 removedContent = [];
 removedRebel1Content = [];
 pCount = 0;
 ith = 0;

 // Find the index of the 2nd paragraph
 for (let i = 0; i < article.children.length; i++) {
 if (article.children[i].tagName == ‘P’) {
 pCount++;
 }
 if (pCount == 2) {
 ith = i;
 break;
 }
 }
 debug(’P count: ‘ + pCount + ‘, ith: ‘ + ith);

 // Move one position past the 2nd paragraph
 ith += 1;

 // Remove all elements after the 2nd paragraph and store them
 for (let i = article.children.length – 1; i >= ith; i–) {
 removedContent.unshift({
 element: article.children[i],
 index: i,
 });
 article.children[i].remove();
 }

 addLockStyles();
 debug(’Content removed from DOM. Items removed: ‘ + removedContent.length);
}

// Restore all removed article content and hide the lock
function show_article() {
 debug(’show_article called’);

 if (!article) return;

 // Remove and hide the lock element
 if (lock && lock.parentElement) {
 lock.remove();
 }
 if (lock) {
 lock.classList.remove(’locked’);
 lock.style.display = ‘none’;
 }

 // Restore article content
 if (removedContent.length > 0) {
 debug(’Restoring article content: ‘ + removedContent.length + ‘ items’);
 removedContent.forEach((item) => {
 article.appendChild(item.element);
 });
 removedContent = [];
 }

 // Restore puzzle container if it was removed
 if (removedPuzzle) {
 removedPuzzle.parent.appendChild(removedPuzzle.element);
 removedPuzzle = null;
 }

 debug(’Content restored to DOM’);
}

// Piano integration
tp = window.tp || [];

ensureLockExists();

tp.push([
 ‘init’,
 function () {
 debug(’Piano initialized’);

 // Set Piano ID to show registration screen by default
 tp.pianoId.init({
 screen: ‘register’,
 });

 // ——————————————————-
 // RESUME CHECKOUT AFTER RELOAD (localStorage fallback)
 // ——————————————————-
 var pendingOfferId = localStorage.getItem(’piano_pending_offerId’);
 var pendingTermId = localStorage.getItem(’piano_pending_termId’);

 if (pendingOfferId && pendingTermId) {
 debug(’Found pending checkout after reload – resuming: ‘ + pendingTermId);

 // Clear localStorage before resuming to avoid infinite loop
 localStorage.removeItem(’piano_pending_offerId’);
 localStorage.removeItem(’piano_pending_termId’);

 // Small delay to allow Piano to fully initialise before resuming checkout
 setTimeout(function () {
 debug(’Calling tp.offer.startCheckout with offerId: ‘ + pendingOfferId + ‘, termId: ‘ + pendingTermId);
 tp.offer.startCheckout({
 offerId: pendingOfferId,
 termId: pendingTermId,
 });
 }, 800);
 }

 // ——————————————————-
 // SHOW OFFER HANDLER
 // ——————————————————-
 tp.push([
 ‘addHandler’,
 ‘showOffer’,
 function (offerParams) {
 debug(’showOffer triggered’);
 debug(’Container selector: ‘ + offerParams.containerSelector);
 debug(’Display mode: ‘ + offerParams.displayMode);

 // Store in memory (NOT localStorage) for potential use later
 // Only saved to localStorage if a reload becomes unavoidable
 currentOfferId = offerParams.offerId || null;
 currentTermId = offerParams.termId || null;
 debug(’Stored in memory – offerId: ‘ + currentOfferId + ‘, termId: ‘ + currentTermId);

 // Only hide article when the inline offer is shown inside #piano-lock
 if (offerParams.containerSelector == ‘#piano-lock’) {
 debug(’Inline offer – hiding article’);
 contentShouldBeLocked = true;
 hide_article();
 }
 },
 ]);

 // ——————————————————-
 // CHECKOUT COMPLETE HANDLER
 // ——————————————————-
 tp.push([
 ‘addHandler’,
 ‘checkoutComplete’,
 function (conversionData) {
 debug(’Checkout complete – showing article’);
 debug(’Conversion data: ‘ + JSON.stringify(conversionData));

 // Clear any pending checkout data
 localStorage.removeItem(’piano_pending_offerId’);
 localStorage.removeItem(’piano_pending_termId’);
 currentOfferId = null;
 currentTermId = null;

 contentShouldBeLocked = false;
 show_article();

 // Delay reload to allow Piano to finalize conversion tracking
 setTimeout(function () {
 location.reload();
 }, 2000);
 },
 ]);

 // ——————————————————-
 // LOGIN SUCCESS HANDLER
 // ——————————————————-
 tp.push([
 ‘addHandler’,
 ‘loginSuccess’,
 function (data) {
 debug(’Login success – source: ‘ + data.source);

 // Login happened inside the offer template (inline or modal) &mdash;
 // do NOT reload, let Piano continue to the checkout/payment step
 if (data.source === ‘OFFER’) {
 debug(’Login during checkout – skipping reload’);
 return;
 }

 // Standalone login &mdash; check access and reload
 tp.api.callApi(’/access/list’, {}, function (accessData) {
 if (typeof accessData.data != ‘undefined’) {
 for (var i in accessData.data) {
 if (accessData.data[i].granted) {
 debug(’User has access – clearing data and reloading’);
 localStorage.removeItem(’piano_pending_offerId’);
 localStorage.removeItem(’piano_pending_termId’);
 currentOfferId = null;
 currentTermId = null;
 contentShouldBeLocked = false;
 tp.offer.close();
 location.reload();
 return;
 }
 }
 }

 // No access after standalone login &mdash;
 // save checkout data to localStorage before reload so it can resume
 if (currentOfferId && currentTermId) {
 debug(’Saving checkout data to localStorage before reload’);
 debug(’offerId: ‘ + currentOfferId + ‘, termId: ‘ + currentTermId);
 localStorage.setItem(’piano_pending_offerId’, currentOfferId);
 localStorage.setItem(’piano_pending_termId’, currentTermId);
 }

 debug(’No access after standalone login – reloading’);
 location.reload();
 });
 },
 ]);

 // ——————————————————-
 // CLOSE HANDLER
 // ——————————————————-
 tp.push([
 ‘addHandler’,
 ‘close’,
 function () {
 debug(’Offer closed’);

 // If content was locked and user closes the modal without purchasing,
 // re-hide the article to ensure content remains locked
 if (contentShouldBeLocked) {
 hide_article();
 }
 },
 ]);
 },
]);

function debug(message) {
 if (DEBUGGING) {
 console.log(’[Content Lock]: ‘ + message);
 }
}
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 let postsToDisplay = [];
let fetchedPosts = [];
const fetchCount = 25;
let preferencesData = [];
let currentPostSections = [];
let currentPostAllSections = [];
let sectionsToManuallyExcludeFromFetch = [];
let followedSectionsSet, currentPostPrimarySection, currentPostPrimarySectionParent ;

const today = new Date();
const newExpiryDate = (daysFromNow = 7) => (new Date().setDate(today.getDate() + daysFromNow) );
const localPreferenceData = JSON.parse(localStorage.hp_data || ‘{}’);
let visitedPostsSections = localPreferenceData.visited_posts_sections || {};
const systemSections = localStorage.all_sections ? JSON.parse(localStorage.all_sections) : null
let allSectionsObj = systemSections?.sections; // using an object not array for efficiency
let allSectionsIdMap = systemSections?.sectionsIdMap; // using an object not array for efficiency
let sectionsToExclude = systemSections?.privateSections || {0:’home’};
let likedPostSectionsObj = {};
window.trackedImpression = false;

const sectionsToRunPersonalizedContent = [
 588563276 //sport
]

const getAllSections = async() => {
 try {
 const req = await fetch(`https://www.gbnews.com/r/kappa/api/v2/reader/get-sections`, {
 method: «GET»,
 credentials: «omit»
 });
 const res = await req.json();
 allSectionsObj = {};
 allSectionsIdMap = {};
 sectionsToExclude = {};
 // encode the section name to match the encoding of the followed topics and update the cache
 res.map(section => {
 section.encodedTitle = section.title?.replace(/\s+/g, »); 
 allSectionsObj[section.encodedTitle] = section; 
 allSectionsIdMap[section.id] = section; 
 if(section.status !== 2){ // not a public section
 sectionsToExclude[section.id] = section.slug;
 }
 return section;
 })
 sectionsToExclude[0] = ‘home’; // manually excude the home section since it’s not returned from the endpoint

 localStorage.all_sections = JSON.stringify({
 sections: allSectionsObj,
 sectionsIdMap: allSectionsIdMap,
 privateSections: sectionsToExclude,
 expiry: newExpiryDate(3)
 });
 return res;
 } catch (error) {
 console.log(error)
 }
}

function manuallyExcludeSections(){
 const sectionsToManuallyExclude = {
 2151427851 : ‘alerts’,
 586688191 : ‘non-content’
 };

 for (const [key, value] of Object.entries(sectionsToManuallyExclude)) {
 sectionsToExclude[key] = value;
 sectionsToManuallyExcludeFromFetch.push(key);
 }
}

function decodeSection(encodedTitle) {
 return allSectionsObj?.[encodedTitle]?.id || ‘section_deprecated’ ;
} 

const getUserPreferenceData = async () => {
 if (!tp || !tp.pianoId) return [];

 return new Promise((resolve, reject) => {
 tp.pianoId.loadExtendedUser({
 formName: ‘hyperpersonalisation_fields’,
 extendedUserLoaded: function (data) {
 try {
 preferencesData = data.custom_field_values || [];
 resolve(preferencesData);
 } catch (parseError) {
 reject(parseError);
 }
 },
 extendedUserLoadFailed: function (err) {
 reject(err);
 }
 });
 });
};


function validateLocalPreferenceData() {
 //this removes visited posts that are over 7 days old from the localstorage to allow them be recommended again
 localPreferenceData.visited_posts = (localPreferenceData.visited_posts || []).filter(post => today < post.expiry);
 //validate the viewed hp posts
 localPreferenceData.viewed_hp_posts = (localPreferenceData.viewed_hp_posts || []).filter(post => today < post.expiry);
 localStorage.hp_data = JSON.stringify(localPreferenceData);
}

function addCurrentPostToVisitedStore(_id, postSections) {
 //check if the post is already there
 const visitedPosts = localPreferenceData.visited_posts || [];
 const existingPost = visitedPosts?.find(post => post.id == _id);
 visitedPostsSections = localPreferenceData.visited_posts_sections || {};

 // check if the post was already visited in this browser in the last 7 days and update accordingly
 if (!existingPost) {
 console.log(’post added locally’, _id);
 visitedPosts.push({ id: _id, expiry: newExpiryDate() });
 } else {
 console.log(’post already exists locally. Expiry time updated’, _id);
 existingPost.expiry = newExpiryDate(); // update the existing post by reference
 }

 //update the section visit count for the current post or for views post sections
 if (currentPostSections.length || postSections) {
 (postSections ? postSections : currentPostSections).map(section => {
 if(sectionsToExclude[section]) return false;

 const scoreToBeAdded = (section === currentPostPrimarySection) ? 2 : 1;
 visitedPostsSections[section] = (visitedPostsSections[section] || 0) + scoreToBeAdded;
 })
 }
// }

 localPreferenceData.visited_posts = visitedPosts;
 localPreferenceData.visited_posts_sections = visitedPostsSections;
 localStorage.hp_data = JSON.stringify(localPreferenceData);
}


function addViewedPersonalizedPostToStore(_id) {
 const viewedPersonalizedPosts = localPreferenceData.viewed_hp_posts || [];
 const viewedHPPost = postsToDisplay.find(post => post.id == _id);
 const existingPost = viewedPersonalizedPosts?.find(post => post.id == viewedHPPost.id);

 if(existingPost){
 existingPost.expiry = newExpiryDate();
 } else {
 viewedPersonalizedPosts.push({ ...viewedHPPost, expiry: newExpiryDate() });
 }

 localPreferenceData.viewed_hp_posts = viewedPersonalizedPosts;
 localStorage.hp_data = JSON.stringify(localPreferenceData);
}

function generateExclusionQuery(){
 const sectionsToFetchSet = new Set([...followedSectionsSet, ...Object.keys(likedPostSectionsObj)]); 
 const sectionsToFetch = [...sectionsToFetchSet].filter(section => !sectionsToExclude[section] ); // exclude private and unlisted sections
 const postsToExclude = localPreferenceData?.visited_posts?.map(post => post.id)?.length ? localPreferenceData?.visited_posts?.map(post => post.id) : [0];

 const query = {
 «$and»: [
 {
 «id»: { «notEqualsAny»:postsToExclude }
 }
 ]
 }

 if(sectionsToManuallyExcludeFromFetch?.length) { 
 sectionsToManuallyExcludeFromFetch.forEach(section => {
 query[»$and»].push({»sections»: { «arrayNotContains»: section }})
 })
 }
 if(sectionsToFetch?.length) {
 query[»$and»].push({»sections»: { «arrayAny»: sectionsToFetch }})
 }
 if(currentPostAllSections?.length) {
 query[»$and»].push({»sections»: { «arrayAny»: currentPostAllSections.filter(section => !sectionsToExclude[section] ) }})
 }
 console.log(’the query’, query);
 return query;
}


async function fetchPosts(){
 const url = ‘https://www.gbnews.com/r/content-delivery-api/api/v2/posts?apiKey=YbEGjDsxUlUlUhOI7P6uzXerJclIlyFRouDptO9VlynjlfqbPmKyBX0YRcU1gl8k&now=’+Date.now();
 // TODO: we need to remove this API key from the frontend
 // What about custom page endpoint where we’ll send a list of ids we want to exclude and in the called SE we use mashup that’s call the CDapi , on the front we’ll get
 
 const excludeQuery = JSON.stringify(generateExclusionQuery());
 const options = {
 method: ‘POST’,
 headers: { ‘content-type’: ‘application/json’ },
 body: `{»uniqueIdentifier»:»root»,»includeFields»:[»id»,»headline»,»sections»,»post_url»,»teaser_image»],»filterQuery»: ${excludeQuery},»sort»: {»created_ts»: -1},»clusterName»:»AllContentTypesWithoutNonContent»,»limit»:${fetchCount},»offset»:0,»useV1″:»true»}`
 };
 try {
 const response = await fetch(url, options);
 const data = await response.json();
 // fliter out visited posts
 const visitedPostsToBeRemoved = new Set((localPreferenceData.visited_posts || []).map(item => JSON.parse(item.id)));
 fetchedPosts = (data?.data || []).filter(post => !visitedPostsToBeRemoved.has(post.id) );
 // console.log(data);
 } catch (error) {
 console.error(error);
 }
}

function assignWeightToPosts() {
 fetchedPosts.forEach(post => {
 post.sections?.map(section => {
 if(sectionsToExclude[section.id]) return;
 // check if in followed sections
 // console.log(’ADDITION POINT 0 FOR’, section.title, post.weight);
 if (followedSectionsSet.has(section.id)) {
 post.weight = (post.weight || 0) + 10;
 // console.log(’ADDITION POINT 1 Followed sections FOR’, section.title, post.weight);

 // track the section metrics
 section.followed_weight = 10;
 }
 // check if in liked sections
 if (likedPostSectionsObj[section.id]) {
 post.weight = (post.weight || 0) + (likedPostSectionsObj[section.id] + 5);
 // console.log(’ADDITION POINT 2 liked post section FOR’, section.title, post.weight);

 // track the section metrics
 section.liked_weight = (likedPostSectionsObj[section.id] + 5);
 }
 // check if in visited sections
 if (localPreferenceData.visited_posts_sections?.[section.id] != undefined) {
 post.weight = (post.weight || 0) + localPreferenceData.visited_posts_sections[section.id] + 1;
 // console.log(’ADDITION POINT 3 visited sections FOR’, section.title, post.weight);

 // track the section metrics
 section.visited_weight = localPreferenceData.visited_posts_sections[section.id] + 1;
 }

 post.trackedSections ? post.trackedSections.push(section) : (post.trackedSections = [section])
 })
 // console.log(’END ADDITION FOR this post ————————>’, post.headline, post.weight);
 })
 // sort the posts based on descending order of weight
 fetchedPosts.sort((a, b) => (b.weight || 0) – (a.weight || 0));
 postsToDisplay = fetchedPosts.slice(0, 3);

 console.log(’the sorted weighted posts –>’, fetchedPosts);
}

function toggleSidebarContentVisibility(show){
 // REBELMOUSE_STDLIB.createElementChangeListener(’.sidebar–column .carousels.shared–posts__module’, function(item){
 // show ? item?.classList?.add(’show-content’) : item?.classList?.remove(’show-content’);
 // })
}
function handleAnalytics(link, analyticKey = «dontmiss») {
 console.log(»handle analytics click fired –> «, analyticKey); 
 try {
 // handle clicks
 link.addEventListener(»click», () => {
 pa.sendEvent(`${analyticKey}.click`, {
 post_headline: link.ariaLabel,
 post_url: link.href,
 });
 });
 } catch (error) {
 console.error(»Piano Analytics error:», error);
 }
}

function handleAnalyticsImpressions(analyticKey = «dontmiss») {
 function waitForPa(callback, maxAttempts = 50) {
 let attempts = 0;

 const checkPa = setInterval(function () {
 attempts++;

 if (typeof pa !== ‘undefined’ && pa.sendEvent) {
 clearInterval(checkPa);
 console.log(’[waitForPa] pa is available after’, attempts * 100, ‘ms’);
 callback();
 } else if (attempts >= maxAttempts) {
 clearInterval(checkPa);
 console.warn(’[waitForPa] pa not available after’, maxAttempts * 100, ‘ms – giving up’);
 }
 }, 100);
 }

 waitForPa(function () {
 console.log(`event ${analyticKey} impression sent`, pa);
 pa.sendEvent(`${analyticKey}.impression`, {});

 });
}

function generatDemoMarkup(){
 if(!postsToDisplay?.length) {
 document.querySelector(’.hp_container_placeholder’)?.classList?.add(’hidden’);
 showDefaultRecirculationUnit();
 return;
 }
 const parentDiv = document.createElement(’div’);
 parentDiv.className = ‘hp_container’;
 parentDiv.classList.add(’embed-foryou_posts’)
 parentDiv.classList.add(’embed-foryou’)

 const h3 = document.createElement(’h3’);
 h3.classList.add(»module-headline__text»);
 h3.classList.add(»h2″)
 h3.textContent = «For You»;
 parentDiv.appendChild(h3);

 const contentDiv = document.createElement(’div’);
 contentDiv.classList.add(’hp_container_posts’);
 contentDiv.setAttribute(’data-attr-source_id’, ‘embed-foryou’);
 let contentHTML = »;

 postsToDisplay.forEach(post => {
 contentHTML += `
 <div class=»hp_content» post-data-id=»${post.id}»>
 <a class=»widget__headline-text custom-post-headline» aria-label=»${post.headline}» href=»${post.post_url}»>
 <img 
 src=»${post.teaser_image?.images?.[’1000×750’] || ‘https://assets.rbl.ms/61228189/origin.png’}» 
 alt=»Image for ${post.headline}» 
 />
 
 <h2 class=»widget__headline h2″ aria-label=»${post.headline}»>
 ${post.headline}
 
 
 `;
 });
 contentDiv.innerHTML = contentHTML;
 parentDiv.appendChild(contentDiv);

 console.log(’Waiting for Personalized content to be added’)
 var 	embeddontmiss=document.querySelector(’.embed-dontmiss’);
 document.querySelector(’.fordont’).innerHTML=»For You»;
 embeddontmiss?.classList?.remove(’embed-dontmiss’);
 embeddontmiss?.classList?.add(’embed-foryou’);
 embeddontmiss?.appendChild(parentDiv);
 
 const modSlot = document.querySelector(’.hp_container_placeholder’);
 if(embeddontmiss != null){
 modSlot?.replaceWith(embeddontmiss);
 
 // handle tracking and analytics
 handleAnalyticsImpressions(’foryou’);
 REBELMOUSE_STDLIB.createElementChangeListener(».hp_content a»,
 function (link) {
 handleAnalytics(link, «foryou»);
 }
 );
 } else {
 modSlot.classList?.add(’hidden’)
 }
 // if(embeddontmiss.querySelectorAll(’.widget’).length < 3 ){
 // embeddontmiss.classList.add(’hidden’);
 // let dontmiss = document.querySelector(’.embed-dontmiss’)
 // dontmiss.appendChild(parentDiv)
 // REBELMOUSE_STDLIB.createElementChangeListener(’.sidebar–column .carousels.shared–posts__module .section-holder’, function(item){
 // const side = item.parentElement;
 // side.innerHTML = »;
 // side.appendChild(parentDiv);
 // toggleSidebarContentVisibility(true);
 // console.log(’Personalized content added to sidebar’)
 // })
 // const sidebar = document.querySelector(’.sidebar–column .carousels.shared–posts__module’);
 // sidebar && (sidebar.innerHTML = »);
 // sidebar?.appendChild(parentDiv);
}

function generatePersonalizationReport(){
 console.group(»%cHYPERPERSONALIZED CONTENT», ‘color: blue; padding: 4px;’);
 console.group(»%cPERSONALIZED CONTENT –> Summary of user data», ‘color: yellow; padding: 4px;’);

 console.groupCollapsed(»Parameters used for filtering the fetch call»);

 console.log(»PERSONALIZED CONTENT –> Sections of the current post –> «, currentPostAllSections?.map(section => `${allSectionsIdMap[section]?.title || ‘Home’}`) );

 // followed sections
 console.log(»PERSONALIZED CONTENT –> List of followed Topics –>», [...followedSectionsSet]?.map(section => `${allSectionsIdMap[section]?.title}`));
 
 // liked sections
 console.log(»PERSONALIZED CONTENT –> List of Liked Topics –> «, Object.keys(likedPostSectionsObj)?.map(section => `${allSectionsIdMap[section]?.title}: ${likedPostSectionsObj[section]}`) );
 
 // Visited sections
 console.log(»PERSONALIZED CONTENT –> List of Visited Topics –> «, Object.keys(visitedPostsSections)?.map(section => `${allSectionsIdMap[section]?.title}: ${visitedPostsSections[section]}`));

 console.groupEnd();

 console.groupCollapsed(»Excluded posts that won’t be fetched»);
 // Visited posts
 console.log(»PERSONALIZED CONTENT –> List of Visited Posts –>», localPreferenceData?.visited_posts?.map(post => post.id) );
 
 // Viewed HP posts
 console.log(»PERSONALIZED CONTENT –> List of Viewed Personalized Posts –>», localPreferenceData?.viewed_hp_posts?.map(post => post.headline) );
 
 console.groupEnd();
 console.groupEnd();

 
 console.group(»%cPERSONALIZED CONTENT –> Summary of personalized posts data», ‘color: green; padding: 4px;’);
 fetchedPosts?.forEach(post => {

 // console.group(`${post .headline} – ${post.weight || 0}`);
 console.groupCollapsed(`${post .headline} – Score: ${post.weight || 0}`);
 
 post.trackedSections?.forEach( section => {
 console.log(`${section.title}: (Followed: ${section.followed_weight || 0}) + (Liked: ${section.liked_weight || 0}) + (visited: ${section.visited_weight || 0}) = ${(section.followed_weight || 0) + (section.liked_weight || 0) + (section.visited_weight || 0)}`)
 });
 console.groupEnd();
 });
 console.groupEnd();

 console.groupEnd();
 console.log(»PERSONALIZED CONTENT END–> «);
}

function addDontMissPlaceholder(){
 const placeholder = `
 <div class=»hp_container embed-foryou_posts embed-foryou «>
 <h3 class=»module-headline__text h2»>For You
 <div class=’plaeholder_spinner’/>&#32;
 
 `
 const placeholderDiv = document.createElement(’div’);
 placeholderDiv.classList.add(’hp_container_placeholder’)
 placeholderDiv.innerHTML = placeholder;
 const modSlot = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p, .trending-item)’)[12];
 console.log(’the plaeholder code’, placeholderDiv);
 console.log(’the plaeholder code 2 ‘, placeholderDiv);
 if(placeholderDiv != null){
 modSlot?.appendChild(placeholderDiv);
 }
}

function showDefaultRecirculationUnit(){
 var embeddontmiss=document.querySelector(’.embed-dontmiss’);
 if(embeddontmiss){
 let dontMiss = document.querySelector(’.embed-dontmiss__posts’);
 var dontmissclone = dontMiss.cloneNode(true);
 dontmissclone.classList.remove(’hidden’);
 embeddontmiss.appendChild(dontmissclone);
 const modSlot = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p, .trending-item)’)[12];
 modSlot.appendChild(embeddontmiss);
 
 if(embeddontmiss.querySelectorAll(’.widget’).length < 3 ){
 embeddontmiss.classList.add(’hidden’);
 }
 }

 // handle tracking and analytics
 handleAnalyticsImpressions(’dontmiss’);
 REBELMOUSE_STDLIB.createElementChangeListener(».embed-dontmiss__posts:not(.hidden) a.widget__headline-text, .embed-dontmiss:not(.hidden) .widget__head > a»,
 function (link) {
 console.log(’The logged out analytics’);
 handleAnalytics(link, ‘dontmiss’);
 }
 );
}

function checkIfPersonalizedContentShouldRun(){
 // check if the hyper personalized content module should run 
 console.log(’the post sections’, JSON.parse(’[0, 584086272, 2262988002, 588563272, 586304622, 2260688433, 590311187, 586304181, 586311833, 588563322]’ || ‘[]’) )
 if(window.tp?.pianoId?.isUserValid()
// && ( ‘True’ && JSON.parse(’[0, 584086272, 2262988002, 588563272, 586304622, 2260688433, 590311187, 586304181, 586311833, 588563322]’ || ‘[]’)?.find(section => sectionsToRunPersonalizedContent.includes(section) ) ) 
 ) {
 return true;
 }
 return false;
}

async function init(){
 if(!checkIfPersonalizedContentShouldRun() ) {
 showDefaultRecirculationUnit();
 return console.log(’milos: user not logged in / Not sports section, loading dont miss’)
 }
 
 addDontMissPlaceholder(); // add a placeholder to that will reserve space for the HP content
 console.log(’milos: user logged in, loading for you’)
 // return toggleSidebarContentVisibility(true); // user not logged in
 
 if(!systemSections || !systemSections.allSectionsIdMap){ 
 await getAllSections();
 } else if(systemSections.expiry < today) localStorage.removeItem(’all_sections’); //refresh the cached section data after 3 days to save API calls
 manuallyExcludeSections();
 console.log(’the manually excluded sections ‘, sectionsToExclude);

 await getUserPreferenceData();
 validateLocalPreferenceData();


 if (’True’ && ‘[0, 584086272, 2262988002, 588563272, 586304622, 2260688433, 590311187, 586304181, 586311833, 588563322]’) {
 currentPostAllSections = JSON.parse(’[0, 584086272, 2262988002, 588563272, 586304622, 2260688433, 590311187, 586304181, 586311833, 588563322]’ || ‘[]’);
 currentPostPrimarySection = !!’588563272’ ? ‘588563272’ : null; // checks the post’s primary section 
 currentPostPrimarySectionParent = currentPostPrimarySection && ‘0’; //check the primary section’s parent section
 currentPostPrimarySection && currentPostSections.push(currentPostPrimarySection)// checks the post’s primary section 
 currentPostPrimarySectionParent && currentPostSections.push(currentPostPrimarySectionParent);

 addCurrentPostToVisitedStore(’2676762030’);
 }


 console.log(’the piano user data –>’, preferencesData);
 // followed sections
 let followedSections = preferencesData?.find(data => data.field_name?.toLowerCase() == ‘follow-topics-and-sections’)?.value;
 followedSections = (followedSections ? JSON.parse(followedSections) : []).map(decodeSection)?.filter(section => section != ‘section_deprecated’);
 followedSectionsSet = new Set(followedSections);

 // Liked sections
 likedPostSectionsObj = JSON.parse(preferencesData?.find(data => data.field_name?.toLowerCase() == ‘liked_posts_topics’)?.value || ‘{}’);

 await fetchPosts();
 assignWeightToPosts();
 // at this point the recentPosts variable is sorted based on weight
 generatDemoMarkup();
 generatePersonalizationReport();

 //If a personalized post is on the page for 2.5 seconds, add it to the visited posts
 const visibilityTimers = new Map();
 const viewedHPPosts = new Set();

 function addViewedHPPostToLocalStore(id){
 if(viewedHPPosts.has(id)) console.log(’this post has already been updated in this session’, id);
 if(!id || viewedHPPosts.has(id)) return;
 let postSections = postsToDisplay.find(post => post.id == +id )?.sections;
 postSections && (postSections = postSections.map(section => section.id));
 console.log(’visibility timer activated –> ‘, id, postSections);
 addCurrentPostToVisitedStore(id, postSections); 
 addViewedPersonalizedPostToStore(id);
 }
 function cancelVisibilityTimer(id){
 // If the element goes out of view before 2.5s, cancel the timer
 if (!id) return;
 console.log(’visibility timer cancelled for –> ‘, id);
 const timer = visibilityTimers.get(id);
 if (timer) {
 clearTimeout(timer);
 visibilityTimers.delete(id);
 }
 }
 
 window.REBELMOUSE_STDLIB.onElementInViewport({
 selector: «.hp_container .hp_content»,
 threshold: 1,
 onBellowViewport: (element) => cancelVisibilityTimer(element?.getAttribute(’post-data-id’)),
	onAboveViewport: (element) => cancelVisibilityTimer(element?.getAttribute(’post-data-id’)), 
 onIntersect: function (entry) {
 const id = entry?.target?.getAttribute(’post-data-id’);
 //skip if timer is already active
 if (!id || visibilityTimers.has(id)) return;

 const timer = setTimeout(() => {
 console.log(’element in view –> ‘, entry.target);
 addViewedHPPostToLocalStore(id);
 viewedHPPosts.add(id); // add the post to the list of processed post to prevent duplication of stats
 visibilityTimers.delete(id); // remove timer after it’s fired
 }, 2500);
 visibilityTimers.set(id, timer);
 }
 });
}

// run the operation when piano is initialized
tp.push([’init’, function() {
 init();
}])
 

});

window.REBELMOUSE_ACTIVE_TASKS_QUEUE.push(function(){

 
 let toTopBtn = document.querySelector(».to-top»);
var content= document.querySelector(».content»);

//toTopBtn.style.right=(window.innerWidth-content.clientWidth)/2-20+»px»;
window.onscroll = function() {scrollFunction()};

function scrollFunction() {
 if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
 toTopBtn.style.display = «block»;
 } else {
 toTopBtn.style.display = «none»;
 }
}

toTopBtn.addEventListener(»click», () => {
 window.scrollTo({top: 0, behavior: ‘smooth’});
});
 

});]]></script><script class=»rm-i-script» id=»user-javascript-components» type=»text»/><script class=»rm-i-script» id=»user-javascript-lowest» type=»text»><![CDATA[

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 async function getToken(timeout = 5000) {
 const controller = new AbortController();
 const { signal } = controller;

 const timeoutId = setTimeout(() => {
 controller.abort(new Error(’Piano token initialization timed out’));
 }, timeout);

 const cleanup = () => {
 clearTimeout(timeoutId);
 };

 const tryGetToken = () => {
 const token = window.tp?.pianoId?.getToken?.();
 return token || null;
 };

 return new Promise((resolve, reject) => {
 if (signal.aborted) {
 cleanup();
 return reject(signal.reason);
 }

 signal.addEventListener(’abort’, () => {
 cleanup();
 reject(signal.reason);
 });

 // 1. Try immediately
 try {
 const immediateToken = tryGetToken();
 if (immediateToken) {
 cleanup();
 return resolve(immediateToken);
 }
 } catch (err) {
 cleanup();
 return reject(err);
 }

 // 2. Wait for tp init
 window.tp = window.tp || [];
 window.tp.push([
 ‘init’,
 function () {
 if (signal.aborted) return;

 try {
 const token = tryGetToken();
 cleanup();

 if (token) {
 resolve(token);
 } else {
 reject(new Error(’Piano token not available’));
 }
 } catch (err) {
 reject(err);
 }
 },
 ]);
 });
}

function checkAccessLevel() {
 tp.api.callApi(’/access/list’, {}, function (response) {
 // console.log(’checkAccessLevel response’, response.data);

 let excludedRids = new Set([’RUK2FBE’, ‘RMXO6VF’, ‘RTEANTC’, ‘RFCEL9J’, ‘R5NMHWH’, ‘RWY51ZC’]);

 let isMember = response.data.some(
 (access) => access.granted === true && access.resource?.rid && !excludedRids.has(access.resource.rid),
 );

 // console.log(’checkAccessLevel – isMember’, isMember);

 if (isMember === true) {
 console.log(’User is a Member’);
 setWindowObj(’member’);
 setCookieMemStatus(’member’);
 updateSubscribeLink(’member’);
 } else {
 console.log(’User is NOT a Member’);
 setWindowObj(’registered’);
 setCookieMemStatus(’registered’);
 updateSubscribeLink(’registered’);
 }
 });
}

function setWindowObj(status) {
 window.userStatus = status;
 // console.log(`userStatus: ${status}`);
}

function setCookieMemStatus(status) {
 const COOKIE = ‘access_status_gbn’;
 document.cookie = COOKIE + `=${status}; path=/; max-age=` + 30 * 24 * 60 * 60 + `;`;
 // console.log(’statusCookie has been set’);
}

function updateSubscribeLink(status) {
 const link = document.querySelector(’a.subscribe-link’);
 if (!link) return;

 if (status === ‘member’) {
 link.textContent = ‘Membership’;
 link.href = ‘https://www.gbnews.com/membership/’;
 link.setAttribute(’data-og-href’, ‘https://www.gbnews.com/membership/’);
 } else {
 link.textContent = ‘Support’;
 link.href = ‘https://www.gbnews.com/support?ico=header_support_button’;
 link.setAttribute(’data-og-href’, ‘https://www.gbnews.com/support?ico=header_support_button’);
 }
}

// Start the logic
(async () => {
 try {
 let token = await getToken(); // If getToken resolves, call checkAccessLevel
 checkAccessLevel();
 } catch (err) {
 // If getToken rejects, handle anonymous user
 console.log(’User is NOT Logged in’);
 setWindowObj(’anonymous’);
 setCookieMemStatus(’anonymous’);
 }
})();
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 function isSamsungBrowser() {
 const userAgent = navigator.userAgent.toLowerCase();
 return userAgent.includes(’samsungbrowser’);
}

if (isSamsungBrowser()) {
 
 document.querySelector(’.engbar-content’).style.display = «none»;
 document.querySelector(’.engbar’).style.paddingTop = «0px»;
 document.querySelector(’.engbar’).style.paddingBottom = «0px»;
 document.querySelector(’#support-banner’).style.fontSize = «10px»;
// console.log(»Samsung Internet browser detected»);
} else {
// console.log(»Not Samsung Internet browser»);
}
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // Wait for element
function waitForElement(selector, callback) {
 const element = document.querySelector(selector);
 if (element) {
 callback(element);
 return;
 }
 
 const observer = new MutationObserver(function() {
 const element = document.querySelector(selector);
 if (element) {
 callback(element);
 observer.disconnect();
 }
 });
 
 observer.observe(document.body, { childList: true, subtree: true });
}

console.log(»MENU INITIALIZATION»);

// Search my account wrapper
waitForElement(’.login-link-wrapper’, function(loginWrapper) {
 console.log(»Found login wrapper:», loginWrapper);
 
 waitForElement(’#myAccountMenu’, function(myAccountMenu) {
 console.log(»Found My Account menu:», myAccountMenu);
 
 const textLink = loginWrapper.querySelector(’#login-link-text’); // Link with text «My Account»
 const avatarLink = loginWrapper.querySelector(’#accountToggleLink’); // Link with avatar
 
 console.log(»Text link:», textLink);
 console.log(»Avatar link:», avatarLink);
 
 const overlay = document.getElementById(’overlay’);
 console.log(»Overlay:», overlay);
 
 // is user logged in ?
 function isUserLoggedIn() {
 return avatarLink && avatarLink.classList.contains(’loggedin’);
 }
 
 // Function to toggle avatar visibility
 function toggleAvatar(show) {
 if (avatarLink) {
 avatarLink.style.visibility = show ? ‘visible’ : ‘hidden’;
 console.log(»Avatar», show ? «shown» : «hidden»);
 }
 }
 
 // Create close button as sibling to avatar link
 function createCloseButton() {
 if (!avatarLink) return null;
 
 // close exists?
 const existingCloseBtn = loginWrapper.querySelector(’.custom-close-button’);
 if (existingCloseBtn) {
 return existingCloseBtn;
 }
 
 const closeButton = document.createElement(’img’);
 closeButton.src = ‘https://assets.rbl.ms/61170200/origin.png’;
 closeButton.alt = ‘Close’;
 closeButton.classList.add(’custom-close-button’);
 closeButton.style.display = ‘none’;

 // Add event to close menu
 closeButton.addEventListener(’click’, function (e) {
 e.stopPropagation();
 hideMenu();
 });

 // Insert close button as sibling after avatar link
 avatarLink.parentNode.insertBefore(closeButton, avatarLink.nextSibling);
 return closeButton;
 }
 
 // Menu functions
 function showMenu() {
 if (!isUserLoggedIn()) {
 console.log(»User not logged in, menu won’t open»);
 return;
 }
 
 myAccountMenu.removeAttribute(’hidden’);
 myAccountMenu.classList.add(’show’);
 
 const closeButton = createCloseButton();
 if (closeButton) {
 closeButton.style.display = ‘block’;
 // Hide avatar when close button is shown
 toggleAvatar(false);
 }
 
 if (overlay) overlay.classList.add(’show’);
 
 console.log(»Menu opened»);
 }

 function hideMenu() {
 myAccountMenu.classList.remove(’show’);
 if (overlay) overlay.classList.remove(’show’);
 
 const closeButton = loginWrapper.querySelector(’.custom-close-button’);
 if (closeButton) {
 closeButton.style.display = ‘none’;
 // Show avatar when close button is hidden
 toggleAvatar(true);
 }
 
 setTimeout(() => {
 myAccountMenu.setAttribute(’hidden’, »);
 }, 200);
 
 console.log(»Menu closed»);
 }

 // Event listener for link with text «My Account»
 if (textLink) {
 textLink.addEventListener(’click’, function(e) {
 e.preventDefault();
 e.stopPropagation();
 
 console.log(»Text link clicked»);
 
 if (!isUserLoggedIn()) {
 console.log(»User not logged in, menu won’t open»);
 return;
 }

 // Toggle menu
 if (myAccountMenu.classList.contains(’show’)) {
 hideMenu();
 } else {
 showMenu();
 }
 });
 }

 // Event listener for avatar
 if (avatarLink) {
 avatarLink.addEventListener(’click’, function(e) {
 e.preventDefault();
 e.stopPropagation();
 
 console.log(»Avatar link clicked»);
 
 if (!isUserLoggedIn()) {
 console.log(»User not logged in, menu won’t open»);
 return;
 }

 // Toggle menu
 if (myAccountMenu.classList.contains(’show’)) {
 hideMenu();
 } else {
 showMenu();
 }
 });
 }

 // Close menu when clicking overlay
 if (overlay) {
 overlay.addEventListener(’click’, hideMenu);
 }

 // Close menu when Piano modal appears
 waitForElement(’.piano-id-modal’, function(pianoModal) {
 console.log(»Piano modal appeared:», pianoModal);
 hideMenu();
 });

 // Close menu on ESC key
 document.addEventListener(’keydown’, function(e) {
 if (e.key === ‘Escape’ && myAccountMenu.classList.contains(’show’)) {
 hideMenu();
 }
 });

 // Prevent menu from closing when clicking inside it
 myAccountMenu.addEventListener(’click’, function(e) {
 e.stopPropagation();
 });

 // Close menu when clicking menu links
 const menuLinks = myAccountMenu.querySelectorAll(’a’);
 menuLinks.forEach(link => {
 link.addEventListener(’click’, function() {
 hideMenu();
 });
 });

 // Logout logic
 const logoutLink = Array.from(menuLinks).find(link => {
 return link.textContent.trim().toLowerCase().includes(’log out’) || 
 link.getAttribute(’aria-label’) === ‘Log Out’;
 });

 if (logoutLink) {
 logoutLink.addEventListener(’click’, function(e) {
 e.preventDefault(); 

 // Log out from Piano
 if (window.tp && tp.pianoId) {
 tp.pianoId.logout();
 } else {
 console.warn(’Piano not ready’);
 }
 
 // Hide menu after logout
 hideMenu();
 });
 }

 // «Notifications» (Viafoura bell) in menu
 const vfBellLink = myAccountMenu.querySelector(’#viafoura-bell-link’);
 if (vfBellLink) {
 vfBellLink.addEventListener(’click’, function(e) {
 e.preventDefault();
 e.stopPropagation();
 console.log(’Kamila clicked!’);
 
 if (window.vf && window.vf.$publish) {
 console.log(’Opening Viafoura tray...’);
 window.vf.$publish(’tray’, ‘open’, ‘args’);
 } else {
 console.warn(’Viafoura is not ready yet.’);
 }
 });
 } else {
 console.warn(’#viafoura-bell-link not found in menu.’);
 }


 // Observer to check the classes changes
 if (avatarLink) {
 const classObserver = new MutationObserver(function(mutations) {
 mutations.forEach(function(mutation) {
 if (mutation.type === ‘attributes’ && mutation.attributeName === ‘class’) {
 const isLoggedIn = avatarLink.classList.contains(’loggedin’);
 console.log(»Login status changed:», isLoggedIn);
 
 if (!isLoggedIn) {
 // hide menu if logged out
 hideMenu();
 
 const closeButton = loginWrapper.querySelector(’.custom-close-button’);
 if (closeButton) {
 closeButton.remove();
 }
 
 // Show avatar when user logs out
 toggleAvatar(true);
 }
 }
 });
 });

 classObserver.observe(avatarLink, { 
 attributes: true, 
 attributeFilter: [’class’] 
 });
 }
 });
});
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 
 var url = decodeURIComponent(decodeURIComponent(document.location.href));
 var params = url.match(new RegExp(’tab’ + ‘=([^&=]+)’));
 var accountTab = params ? params[1] : false;

 setTimeout(function() {
 if (accountTab) {
 var scope = angular.element(»#ng-app»).scope();
 scope.current = accountTab;
 scope.$apply();
 }
 }, 100);

 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 var pri_nav = document.querySelector(’.navbar .nav’).cloneNode(true);
var hamburger = document.createElement(’div’);
const searchNavItem = `<a class=»hamburger search-item nav–item» href=»/search/»>Search`;
const searchForMenu = `
<form method=»get» class=»quick–search__form» action=»/search/»><input
 type=»text»
 required=»»
 placeholder=»Search..»
 value=»»
 name=»q»
 class=»quick–search__form–input»
 onfocus=»if (this.value == ») {this.value = »;}»
 onblur=»if (this.value == ») {this.value = »;}»
 /><button type=»submit» class=»quick–search__form–submit» value=»Search»><svg xmlns=»http://www.w3.org/2000/svg» width=»20″ height=»20″ viewBox=»0 0 40 40″ fill=»none»><path
 d=»M39.7217 38.324L27.2102 25.356C30.0291 22.554 31.5786 18.89 31.5786 15C31.5786 10.994 29.9365 7.226 26.9534 4.394C23.9703 1.562 20.0061 0 15.7893 0C11.5725 0 7.60623 1.56 4.62521 4.394C1.64419 7.228 0 10.994 0 15C0 19.006 1.64209 22.774 4.62521 25.606C7.60834 28.438 11.5725 30 15.7893 30C19.4229 30 22.8671 28.842 25.6587 26.71L38.1701 39.676C38.3785 39.892 38.6606 40 38.9469 40C39.2017 40 39.4564 39.914 39.6585 39.738C40.088 39.364 40.1153 38.732 39.7238 38.326L39.7217 38.324ZM2.10313 15C2.10313 7.832 8.24201 2 15.7872 2C23.3324 2 29.4712 7.832 29.4712 15C29.4712 22.168 23.3324 28 15.7872 28C8.24201 28 2.10313 22.168 2.10313 15Z»
 fill=»#0032AA»
 fill-opacity=»0.8″
 >
`;
hamburger.className = ‘hamburger’;
hamburger.append(pri_nav);
hamburger.querySelector(’.nav’).insertAdjacentHTML(’afterBegin’, searchForMenu);
document.querySelector(’.topbar’).append(hamburger);
document.querySelector(’.menu__toggle’).onclick = function (event) {
 event.stopPropagation(); // Prevent click event from bubbling up to document
 document.body.classList.toggle(’hamburger__open’);
};

var nav__item = document.querySelectorAll(’.hamburger .nav–item’);
nav__item.forEach(function (item) {
 var button = document.createElement(’button’);
 button.className = «sub_nav_toggle»;
 item.append(button);
 button.onclick = function () {
 nav__item.forEach(function (sni) {
 if (item == sni) {
 } else {
 sni.classList.remove(’expand’);
 }
 });
 item.classList.toggle(’expand’);
 };
});

// display the hamburger menu
let toggleMenus = document.querySelectorAll(».menu__toggle»);
let toggleMenu = toggleMenus[1];
let toggleMenu2 = toggleMenus[0]; // to hide the unwanted one in the hamburger menu
toggleMenu.addEventListener(»click», toggleHamburger);
let hideWatchLive = document.querySelector(’.watch-live-button’); //added
let hideVerticalLine = document.querySelector(’.vertical-line’); //added
let lastVerticalLine = document.querySelector(’.sticky-left .vertical-line:last-of-type’);//added




function toggleHamburger(event) {
 event.stopPropagation(); // Prevent click event from bubbling up to document
 console.log(»YES THIS LOGS»);
 document.body.classList.toggle(’hamburger__open’);
 toggleMenu2.style.display = «none»;
 hideWatchLive.style.display =»none»; //added
 hideVerticalLine.style.display =»none»; //added
 lastVerticalLine.style.display =»none»; //added

}

//this is hiding both lines
// function toggleHamburger(event) {
// event.stopPropagation(); // Prevent click event from bubbling up to document
// document.body.classList.toggle(’hamburger__open’);
// toggleMenu2.style.display = «none»;
// hideWatchLive.style.display = «none»;

// if (document.body.classList.contains(’hamburger__open’)) {
 
// hideVerticalLine.forEach(el => {
// el.style.display = «none»;
// });
// } else {
 
// hideVerticalLine.forEach(el => {
// el.style.display = «»;
// });
 
// hideWatchLive.style.display = «»;
// }
// }






// Close hamburger when clicking outside
document.addEventListener(’click’, function (event) {
 // Check if click is outside the hamburger and menu__toggle button
 if (!hamburger.contains(event.target) && !document.querySelector(’.menu__toggle’).contains(event.target)) {
 document.body.classList.remove(’hamburger__open’);
 }
});
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // var pri_nav = document.querySelector(’.navbar .nav’).cloneNode(true);
// var hamburger = document.createElement(’div’);
// const searchNavItem = `<a class=»hamburger search-item nav–item» href=»/search/»>Search`;
// const searchForMenu = `
// <form method=»get» class=»quick–search__form» action=»/search/»><input
// type=»text»
// required=»»
// placeholder=»Search..»
// value=»»
// name=»q»
// class=»quick–search__form–input»
// onfocus=»if (this.value == ») {this.value = »;}»
// onblur=»if (this.value == ») {this.value = »;}»
// /><button type=»submit» class=»quick–search__form–submit» value=»Search»><svg xmlns=»http://www.w3.org/2000/svg» width=»20″ height=»20″ viewBox=»0 0 40 40″ fill=»none»><path
// d=»M39.7217 38.324L27.2102 25.356C30.0291 22.554 31.5786 18.89 31.5786 15C31.5786 10.994 29.9365 7.226 26.9534 4.394C23.9703 1.562 20.0061 0 15.7893 0C11.5725 0 7.60623 1.56 4.62521 4.394C1.64419 7.228 0 10.994 0 15C0 19.006 1.64209 22.774 4.62521 25.606C7.60834 28.438 11.5725 30 15.7893 30C19.4229 30 22.8671 28.842 25.6587 26.71L38.1701 39.676C38.3785 39.892 38.6606 40 38.9469 40C39.2017 40 39.4564 39.914 39.6585 39.738C40.088 39.364 40.1153 38.732 39.7238 38.326L39.7217 38.324ZM2.10313 15C2.10313 7.832 8.24201 2 15.7872 2C23.3324 2 29.4712 7.832 29.4712 15C29.4712 22.168 23.3324 28 15.7872 28C8.24201 28 2.10313 22.168 2.10313 15Z»
// fill=»#0032AA»
// fill-opacity=»0.8″
// >
// `;
// hamburger.className = ‘hamburger’;
// hamburger.append(pri_nav);
// hamburger.querySelector(’.nav’).insertAdjacentHTML(’afterBegin’, searchForMenu);
// document.querySelector(’.topbar’).append(hamburger);





// var nav__item = document.querySelectorAll(’.hamburger .nav–item’);
// nav__item.forEach(function (item) {
// var button = document.createElement(’button’);
// button.className = «sub_nav_toggle»;
// item.append(button);
// button.onclick = function () {
// nav__item.forEach(function (sni) {
// if (item == sni) {
// } else {
// sni.classList.remove(’expand’);
// }
// });
// item.classList.toggle(’expand’);
// };
// });



// function toggleHamburger(event) {
// event.stopPropagation();
 
// const isCurrentlyOpen = document.body.classList.contains(’hamburger__open’);
 
// // Close account menu if it’s open
// const accountMenu = document.getElementById(’myAccountMenu’);
// if (accountMenu) {
// accountMenu.style.display = ‘none’;
// accountMenu.hidden = true;
// }
 
// // Reset account toggle button state
// const accountToggle = document.getElementById(’accountToggleLink’);
// if (accountToggle) {
// accountToggle.classList.remove(’active’);
// accountToggle.setAttribute(’aria-expanded’, ‘false’);
// }
 
// // Toggle hamburger menu
// if (!isCurrentlyOpen) {
// console.log(»Opening hamburger menu»);
// document.body.classList.add(’hamburger__open’);
 
// // Hide elements
// let toggleMenus = document.querySelectorAll(».menu__toggle»);
// let toggleMenu2 = toggleMenus[0];
// let hideWatchLive = document.querySelector(’.watch-live-button’);
// let hideVerticalLine = document.querySelector(’.vertical-line’);
// let lastVerticalLine = document.querySelector(’.sticky-left .vertical-line:last-of-type’);
 
// if (toggleMenu2) toggleMenu2.style.display = «none»;
// if (hideWatchLive) hideWatchLive.style.display = «none»;
// if (hideVerticalLine) hideVerticalLine.style.display = «none»;
// if (lastVerticalLine) lastVerticalLine.style.display = «none»;
// } else {
// console.log(»Closing hamburger menu»);
// document.body.classList.remove(’hamburger__open’);
// }
// }

// // Function for account menu
// function toggleAccountMenu(event) {
// event.preventDefault();
// event.stopPropagation();
 
// const accountMenu = document.getElementById(’myAccountMenu’);
// const isCurrentlyOpen = accountMenu && !accountMenu.hidden && accountMenu.style.display !== ‘none’;
 
// // Close hamburger menu if it’s open
// document.body.classList.remove(’hamburger__open’);
 
// // Close account menu first
// if (accountMenu) {
// accountMenu.style.display = ‘none’;
// accountMenu.hidden = true;
// }
 
// // Reset account toggle button state
// const accountToggle = document.getElementById(’accountToggleLink’);
// if (accountToggle) {
// accountToggle.classList.remove(’active’);
// accountToggle.setAttribute(’aria-expanded’, ‘false’);
// }
 
// // If the account menu wasn’t open, open it
// if (!isCurrentlyOpen && accountMenu) {
// accountMenu.style.display = ‘block’;
// accountMenu.hidden = false;
 
// // Set button state
// if (accountToggle) {
// accountToggle.classList.add(’active’);
// accountToggle.setAttribute(’aria-expanded’, ‘true’);
// }
// }
// }

// // DODAJ tylko jeden event listener dla ka&#380;dego menu:
// document.addEventListener(’DOMContentLoaded’, function() {
// // Hamburger menu – znajd&#378; w&#322;a&#347;ciwy przycisk
// let toggleMenus = document.querySelectorAll(».menu__toggle»);
// let toggleMenu = toggleMenus[1]; // lub [0] – sprawd&#378; któ;ry to w&#322;a&#347;ciwy
 
// if (toggleMenu) {
// // Usu&#324; wszystkie poprzednie event listenery
// toggleMenu.removeEventListener(»click», toggleHamburger);
// toggleMenu.onclick = null;
 
// // Dodaj nowy event listener
// toggleMenu.addEventListener(»click», toggleHamburger);
// }
 
// // Account menu toggle
// const accountToggle = document.getElementById(’accountToggleLink’);
// if (accountToggle) {
// accountToggle.addEventListener(’click’, toggleAccountMenu);
// }
 
// // Zamykanie menu po klikni&#281;ciu poza nimi
// document.addEventListener(’click’, function(event) {
// const accountMenu = document.getElementById(’myAccountMenu’);
// const hamburgerMenu = document.querySelector(’.hamburger’);
// const accountToggle = document.getElementById(’accountToggleLink’);
 
// // Sprawd&#378; wszystkie przyciski hamburger
// let isClickOnHamburgerButton = false;
// document.querySelectorAll(’.menu__toggle’).forEach(btn => {
// if (btn.contains(event.target)) {
// isClickOnHamburgerButton = true;
// }
// });
 
// // Je&#347;li klikni&#281;cie jest poza menu i przyciskami
// if (!accountMenu?.contains(event.target) && 
// !accountToggle?.contains(event.target) &&
// !hamburgerMenu?.contains(event.target) && 
// !isClickOnHamburgerButton) {
 
// // Zamknij oba menu
// document.body.classList.remove(’hamburger__open’);
// if (accountMenu) {
// accountMenu.style.display = ‘none’;
// accountMenu.hidden = true;
// }
// if (accountToggle) {
// accountToggle.classList.remove(’active’);
// accountToggle.setAttribute(’aria-expanded’, ‘false’);
// }
// }
// });
// });




// // Added
// function toggleAccountMenu(event) {
// event.preventDefault();
// event.stopPropagation();
 
// const accountMenu = document.getElementById(’myAccountMenu’);
// const isCurrentlyOpen = accountMenu && !accountMenu.hidden && accountMenu.style.display !== ‘none’;
 
// // Close hamburger menu if it’s open
// document.body.classList.remove(’hamburger__open’);
 
// // Close account menu first
// if (accountMenu) {
// accountMenu.style.display = ‘none’;
// accountMenu.hidden = true;
// }
 
// // Reset account toggle button state
// const accountToggle = document.getElementById(’accountToggleLink’);
// if (accountToggle) {
// accountToggle.classList.remove(’active’);
// accountToggle.setAttribute(’aria-expanded’, ‘false’);
// }
 
// // If the account menu wasn’t open, open it
// if (!isCurrentlyOpen && accountMenu) {
// accountMenu.style.display = ‘block’;
// accountMenu.hidden = false;
 
// // Set button state
// if (accountToggle) {
// accountToggle.classList.add(’active’);
// accountToggle.setAttribute(’aria-expanded’, ‘true’);
// }
// }
// }

// // Event listener for account menu
// document.addEventListener(’DOMContentLoaded’, function() {
// const accountToggle = document.getElementById(’accountToggleLink’);
// if (accountToggle) {
// accountToggle.addEventListener(’click’, toggleAccountMenu);
// }
// });
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // document.addEventListener(’DOMContentLoaded’, function() {
// console.log(’DOM loaded’);
 
// //search element
// const button = document.querySelector(’.live-cta__button’);
 
// if (button) {
// console.log(’Element found’);
// console.log(’Element:’, button);
// console.log(’Class:’, button.className);
 
// button.addEventListener(’click’, function(e) {
// e.preventDefault(); 
 
// console.log(’clicked Watch Live!’);
 
 
// // Toggle class active
// this.classList.toggle(’active’);
 
// console.log(’class after toggle:’, this.className);
// console.log(’class active?’, this.classList.contains(’active’));
// });
// } else {
// console.error(’no button .live-cta__button’);
 
// }
// });
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // PRIMARY NAV
let primary_nav = document.querySelector(’.topbar ~ .navbar .nav’) || document.querySelector(’.topbar-wrapper ~ .navbar .nav’);
let primary_leftArrow = document.querySelector(’.nav–arrows.primary–nav__arrow.left’);
let primary_rightArrow = document.querySelector(’.nav–arrows.primary–nav__arrow.right’);
let primary_navItems = window.innerWidth > 768 ? document.querySelectorAll(’.topbar ~ .navbar .nav .nav–item’) : document.querySelectorAll(’.topbar-wrapper ~ .navbar .nav .nav–item’);

// SECONDARY NAV
let secondary_nav = document.querySelector(’.topbar ~ .navbar .nav .nav–item.active .secondary–nav .list’);
let secondary_leftArrow = document.querySelector(’.nav–arrows.secondary–nav__arrow.left’);
let secondary_rightArrow = document.querySelector(’.nav–arrows.secondary–nav__arrow.right’);
let secondary_navItems = window.innerWidth > 768 ? secondary_nav.querySelectorAll(’.list__item’) : null

function scrollToItem(item, nav, rightArrow, leftArrow) {
 if (item) {
 const navRect = nav.getBoundingClientRect();
 const itemRect = item.getBoundingClientRect();
 
 const scrollLeft = nav.scrollLeft + (itemRect.left – navRect.left);
 const maxScroll = nav.scrollWidth – nav.clientWidth;
 const targetScroll = Math.min(scrollLeft, maxScroll);
 
 nav.scrollTo({
 left: targetScroll,
 behavior: ‘smooth’
 });

 // ONLY DESKTOP
 if (window.innerWidth > 768) {
 if (targetScroll === 0) {
 rightArrow.classList.remove(»hidden»);
 } else {
 leftArrow.classList.remove(»hidden»);
 rightArrow.classList.remove(»hidden»);
 }
 }
 }
}

function scrollToActiveItem() {
 const primary_activeItem = document.querySelector(’.topbar ~ .navbar .nav .nav–item.active’) || document.querySelector(’.topbar-wrapper ~ .navbar .nav .nav–item.active’);
 const secondary_activeItem = window.innerWidth > 768 ? secondary_nav.querySelector(’.list__item.active’) : null;

 if (primary_activeItem) {
 scrollToItem(primary_activeItem, primary_nav, primary_rightArrow, primary_leftArrow);
 }
 if (secondary_activeItem) {
 scrollToItem(secondary_activeItem, secondary_nav, secondary_rightArrow, secondary_leftArrow);
 }
}

function updateArrows(nav, leftArrow, rightArrow) {
 const scrollLeft = nav.scrollLeft;
 const maxScroll = nav.scrollWidth – nav.clientWidth;
 
 // Hide left arrow if at the start (with small threshold)
 if (leftArrow) {
 if (scrollLeft <= 1) {
 leftArrow.classList.add(»hidden»);
 } else {
 leftArrow.classList.remove(»hidden»);
 }
 }
 
 // Hide right arrow if at the end (with small threshold)
 if (rightArrow) {
 if (scrollLeft >= maxScroll – 1) {
 rightArrow.classList.add(»hidden»);
 } else {
 rightArrow.classList.remove(»hidden»);
 }
 }
}

function initScroll() {
 
 if (!primary_nav) return;
 
 // Scroll to active item on load
 scrollToActiveItem();
 
 // Add click listeners to nav items
 primary_navItems.forEach(function(item) {
 item.addEventListener(’click’, function(e) {
 primary_navItems.forEach(function(i) {
 i.classList.remove(’active’);
 });
 item.classList.add(’active’);
 scrollToItem(item);
 });
 });
 
 // Add scroll listener to update arrows | ONLY DESKTOP
 if (window.innerWidth > 768) {
 primary_nav.addEventListener(’scroll’, function() {
 updateArrows(primary_nav, primary_leftArrow, primary_rightArrow)
 });
 secondary_nav.addEventListener(’scroll’, function() {
 updateArrows(secondary_nav, secondary_leftArrow, secondary_rightArrow);
 });
 
 // Add click listeners to arrows
 if (primary_leftArrow) {
 primary_leftArrow.addEventListener(’click’, function() {
 primary_nav.scrollBy({ left: -(primary_nav.clientWidth), behavior: ‘smooth’ });
 });
 }
 
 if (primary_rightArrow) {
 primary_rightArrow.addEventListener(’click’, function() {
 primary_nav.scrollBy({ left: primary_nav.clientWidth, behavior: ‘smooth’ });
 });
 }

 if (secondary_leftArrow) {
 secondary_leftArrow.addEventListener(’click’, function() {
 secondary_nav.scrollBy({ left: -(secondary_nav.clientWidth), behavior: ‘smooth’ });
 });
 }
 
 if (secondary_rightArrow) {
 secondary_rightArrow.addEventListener(’click’, function() {
 secondary_nav.scrollBy({ left: secondary_nav.clientWidth, behavior: ‘smooth’ });
 });
 }

 updateArrows(primary_nav, primary_leftArrow, primary_rightArrow);
 updateArrows(secondary_nav, secondary_leftArrow, secondary_rightArrow);
 
 window.addEventListener(’resize’, function() {
 updateArrows(primary_nav, primary_leftArrow, primary_rightArrow)
 updateArrows(secondary_nav, secondary_leftArrow, secondary_rightArrow)
 });
 } 
}

setTimeout(() => {
 initScroll();
}, 700)

// reset active to HOME when clicking in LOGO
REBELMOUSE_STDLIB.createElementChangeListener(».site-logo a», function(button){
	button.addEventListener(»click», () => {
 sessionStorage.setItem(»active_pri_nav_item», «pri-nav-1″)
 sessionStorage.setItem(»active_sec_nav_item», «pri-nav-1″)
 })
})
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 //MOVED TO delayedCmpScripts shared element!!!

const PIANO_SCRIPT = «https://experience-eu.piano.io/xbuilder/experience/load?aid=6N1iEZE6pe»;

// load Piano script


// console.log(’Consent is ready, loading Piano...’);

 (function(src){var a=document.createElement(»script»);a.type=»text/javascript»;a.async=true;a.src=src;var b=document.getElementsByTagName(»script»)[0];b.parentNode.insertBefore(a,b)})(PIANO_SCRIPT);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // Handles both normal logins AND logins after registration!

// Make tp available or use existing one if already loaded
tp = window.tp || [];

tp.push([
 ‘addHandler’,
 ‘loginSuccess’,
 function (data) {
 console.log(’loginSuccess – callback envoked’, data);
 let userEmail = data.params.email;
 let userUId = data.params.uid;

 // establish the type of login
 let registrationLogin = data.registration; // if false, it is a STANDARD LOGIN

 if (!registrationLogin) {
 // =============== HANDLE NORMAL LOGIN ==================

 // 1. Update membership and consent status in PushWoosh
 tp.api.callApi(’/access/list’, {}, function (data) {
 // console.log(»/access/list «, data);

 // Declare variables
 let userFirstName = data.data[0].user.first_name;
 let userLastName = data.data[0].user.last_name;
 let ridArray = [];
 let resourceName = [];
 let userAccessStatus = »;
 let userIsMember = »;
 let marketingComsValue = null;

 for (const item of data.data) {
 ridArray.push(item.resource.rid);
 resourceName.push(item.resource.name);
 }

 // remove «R5NMHWH» AND «RWY51ZC» from ridArray
 // remove Donate RIDs «RUK2FBE», «RFCEL9J», «RMXO6VF», «RTEANTC» from ridArray
 for (let i = 0; i < ridArray.length; i++) {
 ridArray = ridArray.filter((item) => item !== ‘R5NMHWH’ && item !== ‘RWY51ZC’);
 ridArray = ridArray.filter(
 (item) => item !== ‘RUK2FBE’ && item !== ‘RFCEL9J’ && item !== ‘RMXO6VF’ && item !== ‘RTEANTC’,
 );
 }
 console.log(’ridArray after removing R5NMHWH and RWY51ZC and Donation RIDs ‘, ridArray);

 // remove «Registration» AND «Privacy Plus» from resourceName
 for (let i = 0; i < resourceName.length; i++) {
 resourceName = resourceName.filter(
 (item) => item !== ‘Registration’ && item !== ‘Privacy Plus’ && !item.toLowerCase().includes(’donation’),
 );
 }
 resourceName = resourceName.toString();
 console.log(’resourceName after removing Registration and Privacy Plus and Donation ‘, resourceName);

 // If the ridArray still has an item – user has membership access
 if (ridArray.length > 0) {
 console.log(’User is a member’);
 userAccessStatus = ‘member’;
 userIsMember = ‘true’;
 } else {
 console.log(’User has either churned or never been a member’);
 userAccessStatus = ‘registered’;
 userIsMember = ‘false’;
 }

 tp.pianoId.loadExtendedUser({
 formName: ‘RegistrationFields’,
 extendedUserLoaded: function (data) {
 try {
 console.log(’form data from loginSuccess’, data);
 let customFieldArray = data.custom_field_values;

 for (let item of customFieldArray) {
 if (item.field_name === ‘marketingcoms’) {
 marketingComsValue = item.value;
 break;
 }
 }

 let userPayload = {
 userFirstName: userFirstName,
 userLastName: userLastName,
 userEmail: userEmail,
 userUId: userUId,
 userAccessStatus: userAccessStatus,
 userIsMember: userIsMember,
 userMarketingConsent: marketingComsValue,
 resourceName: resourceName,
 };

 async function pushwooshTagsCB(userPayload) {
 try {
 const response = await fetch(
 `https://www.gbnews.com/r/kappa/api/v2/reader/STAGING_pushwoosh_update_tags?cache=${Date.now()}`,
 {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’,
 },
 credentials: ‘omit’,
 body: JSON.stringify(userPayload),
 },
 );

 if (!response.ok) {
 throw new Error(’loginSuccess – pushwoosh_update_tags request failed’);
 }

 const data = await response.json();
 console.log(data);
 } catch (error) {
 console.error(error);
 }
 }
 // call client backend here
 pushwooshTagsCB(userPayload);
 } catch (parseError) {
 console.log(parseError);
 }
 },
 extendedUserLoadFailed: function (err) {
 console.log(err);
 },
 });
 });
 } else {
 // =============== HANDLE REGISTRATION ==================

 // 1. Give registration term to all users on registrationSuccess
 function addRegisterTerm() {
 let registrationTermId = ‘TMW0NH7F6XUM’;
 tp.api.callApi(’/conversion/registration/create’, { term_id: registrationTermId }, function (conversionData) {
 console.log(’registration term conversion’, conversionData);
 });
 }
 addRegisterTerm();

 // 2. Create user in Pushwoosh and assign to Mailing Lists
 let marketingComsValue = null;
 let MAILING_LISTS = »;

 tp.pianoId.loadExtendedUser({
 formName: ‘RegistrationFields’,
 extendedUserLoaded: function (data) {
 try {
 console.log(’form data from registration’, data);
 let customFieldArray = data.custom_field_values;

 for (let item of customFieldArray) {
 if (item.field_name === ‘marketingcoms’) {
 marketingComsValue = item.value;
 break;
 }
 }

 // 6723 = news / 8457 = for you / 8255 = promotions
 MAILING_LISTS = marketingComsValue == ‘true’ ? ‘[6723, 8457, 8255]’ : ‘[6723, 8457]’;

 let userPayloadForPushwoosh = {
 userEmail: userEmail, // data.email
 userFirstName: data.first_name,
 userLastName: data.last_name,
 userUId: userUId,
 userAccessStatus: ‘registered’,
 userIsMember: ‘false’,
 userMarketingConsent: marketingComsValue,
 isRegistration: ‘true’,
 };
 console.log(userPayloadForPushwoosh);

 let userPayloadForML = {
 email: data.email,
 sqids: MAILING_LISTS,
 };
 console.log(userPayloadForML);

 // A. Create User in Pushwoosh
 async function pushwooshTagsCB(userPayloadForPushwoosh) {
 try {
 const response = await fetch(
 `https://www.gbnews.com/r/kappa/api/v2/reader/STAGING_pushwoosh_update_tags?cache=${Date.now()}`,
 {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’,
 },
 credentials: ‘omit’,
 body: JSON.stringify(userPayloadForPushwoosh),
 },
 );

 if (!response.ok) {
 throw new Error(’pushwoosh_email_reg request failed’);
 }

 const data = await response.json();
 console.log(data);
 } catch (error) {
 console.error(error);
 }
 }
 // call client backend here
 pushwooshTagsCB(userPayloadForPushwoosh);

 // B. Assign user to mailing lists
 async function assignMailingList(userPayloadForML) {
 try {
 const response = await fetch(
 `https://www.gbnews.com/r/kappa/api/v2/reader/piano_assign_user_mailingList?cache=${Date.now()}`,
 {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’,
 },
 credentials: ‘omit’,
 body: JSON.stringify(userPayloadForML),
 },
 );

 if (!response.ok) {
 throw new Error(’piano_assign_user_mailingList request failed’);
 }

 const data = await response.json();
 console.log(data);
 } catch (error) {
 console.error(error);
 }
 }
 // call client backend here
 assignMailingList(userPayloadForML);
 } catch (parseError) {
 console.log(parseError);
 }
 },
 extendedUserLoadFailed: function (err) {
 console.log(err);
 },
 });
 }
 },
]);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // Make tp available or use existing one if already loaded
tp = window.tp || [];

// Hook to execute when register was successful
tp.push([»addHandler», «checkoutComplete», function(data){

// 1. Update user in PushWoosh – create them if they don’t exist
 tp.api.callApi(’/access/list’, {}, function(data) {
 // console.log(»/access/list «, data);

 let userFirstName = data.data[0].user.first_name;
 let userLastName = data.data[0].user.last_name;
 let userId = data.data[0].user.uid;
 let userEmail = data.data[0].user.email;
 let resourceName = [];
 let ridArray = [];
 let userAccessStatus = «»;
 let userIsMember = «»;
 let marketingComsValue = null;
 let MAILING_LISTS = «[8261]»; // members only mailing list id

 for (const item of data.data) {
 ridArray.push(item.resource.rid);
 resourceName.push(item.resource.name);
 }

 // remove «R5NMHWH» AND «RWY51ZC» from ridArray
 // remove Donate RIDs «RUK2FBE», «RFCEL9J», «RMXO6VF», «RTEANTC» from ridArray
 for (let i = 0; i < ridArray.length; i++) {
 ridArray = ridArray.filter(item => item !== «R5NMHWH» && item !== «RWY51ZC»);
 ridArray = ridArray.filter(item => item !== «RUK2FBE» && item !== «RFCEL9J» && item !== «RMXO6VF» && item !== «RTEANTC»);
 }
 console.log(»ridArray after removing R5NMHWH and RWY51ZC and Donation RIDs «, ridArray);

 // remove «Registration» AND «Privacy Plus» AND if rid contains the word «Donation» from resourceName
 for (let i = 0; i < resourceName.length; i++) {
 resourceName = resourceName.filter(item => item !== «Registration» && item !== «Privacy Plus»
 && !item.toLowerCase().includes(»donation»));
 }
 resourceName = resourceName.toString();
 console.log(»resourceName after removing Registration and Privacy Plus and Donation «, resourceName);
 

 // If the ridArray still has an item – user has membership access
 if (ridArray.length > 0) {
 console.log(»User is a member»);
 userAccessStatus = «member»;
 userIsMember = «true»;
 } else {
 console.log(»User has either churned or never been a member»)
 userAccessStatus = «registered»;
 userIsMember = «false»;
 }

 tp.pianoId.loadExtendedUser({
 formName: ‘RegistrationFields’,
 extendedUserLoaded: function (data) {
 try {
 console.log(»form data from checkoutComplete», data);
 let customFieldArray = data.custom_field_values;

 for (let item of customFieldArray) {
 if (item.field_name === «marketingcoms») {
 marketingComsValue = item.value;
 break;
 }
 }

 // A. PW create or update call
 async function pushwooshCheckoutCompleteCB() {
 try {
 const response = await fetch(`https://www.gbnews.com/r/kappa/api/v2/reader/STAGING_pushwoosh_checkoutComplete?cache=${Date.now()}`, {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’
 },
 credentials: «omit»,
 body: JSON.stringify({
 userAccessStatus: userAccessStatus,
 userIsMember: userIsMember,
 userMarketingConsent: marketingComsValue,
 userFirstName: userFirstName,
 userLastName: userLastName,
 userId: userId,
 userEmail: userEmail,
 resourceName: resourceName
 })
 });

 if (!response.ok) {
 throw new Error(’checkoutComplete – pushwooshCheckoutCompleteCB request failed’);
 }

 const data = await response.json();
 console.log(data);
 
 } catch (error) {
 console.error(error);
 }
 } 
 pushwooshCheckoutCompleteCB();


 // B. Assign user to Members Only mailing list IN PIANO
 async function assignMailingList() {
 try {
 const response = await fetch(`https://www.gbnews.com/r/kappa/api/v2/reader/piano_assign_user_mailingList?cache=${Date.now()}`, {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’
 },
 credentials: «omit»,
 body: JSON.stringify({
 email: userEmail,
 sqids: MAILING_LISTS
 })
 });

 if (!response.ok) {
 throw new Error(’piano_assign_user_mailingList request failed’);
 }

 const data = await response.json();
 console.log(data);
 
 } catch (error) {
 console.error(error);
 }
 } 
 // call ONLY if user is a member
 if (userIsMember == «true») {
 assignMailingList();
 }


 // C. Set Members only newsletter Tag in PW
 async function setMembersOnlyNewsletterTag() {
 try {
 const response = await fetch(`https://www.gbnews.com/r/kappa/api/v2/reader/STAGING_pushwoosh_setNewsletter?cache=${Date.now()}`, {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’
 },
 credentials: «omit»,
 body: JSON.stringify({
 userEmail: userEmail,
 newsletter: «members_only»
 })
 });

 if (!response.ok) {
 throw new Error(’piano_assign_user_mailingList request failed’);
 }

 const data = await response.json();
 console.log(data);
 
 } catch (error) {
 console.error(error);
 }
 } 
 // call ONLY if user is a member
 if (userIsMember == «true») {
 setMembersOnlyNewsletterTag();
 }

 } catch (parseError) {
 console.log(parseError);
 }
 },
 extendedUserLoadFailed: function (err) {
 console.log(err);
 }
 });
 });

}]);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // initialise Piano
tp = window.tp || [];

// Hook to execute when register was successful
tp.push([
 ‘addHandler’,
 ‘checkoutComplete’,
 function (data) {
 console.log(’checkoutComplete: ‘, data);

 const uid = data.uid;
 const termId = data.termId;
 const chargeAmount = data.chargeAmount;
 const termConversionId = data.termConversionId;
 const paymentId = data.paymentId;

 // Helper Function
 const callVaultEndpoint = async (uid, action, entity, chargeAmount, termConversionId) => {
 const options = {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’,
 },
 credentials: ‘omit’,
 body: JSON.stringify({
 gbnUserId: uid,
 action,
 entity: entity,
 value: chargeAmount,
 entityId: termConversionId,
 }),
 };

 try {
 const request = await fetch(’https://www.gbnews.com/r/kappa/api/v2/reader/loyaltypoints_ingest’, options);
 const response = await request.json();
 console.log(JSON.stringify(response));
 return response;
 } catch (error) {
 console.log(’loyaltypoints CB error’, error);
 return error;
 }
 };

 // [Donate]
 const donationTerms = [
 ‘TMZVKHCK78F8’,
 ‘TMVATI3WXNBD’,
 ‘TMHHDSINJATO’,
 ‘TMB4RK0P12MI’,
 ‘TMJEJO3K37LC’,
 ‘TMLA2HEB5LSJ’,
 ];
 if (donationTerms.includes(termId)) {
 callVaultEndpoint(uid, ‘donate’, ‘money’, chargeAmount, paymentId);
 }

 // [Membership Terms]
 const membershipTerms = [
 ‘TMTHQ91OZXCH’,
 ‘TMC2ONGWE6AE’,
 ‘TM3LE8FGH5UL’,
 ‘TMEQ9N8GPZOS’,
 ‘TMIY81AFCJHJ’,
 ‘TMZ6PMRF2CX3’,
 ‘TMLTNHI729NI’,
 ‘TMKZ7EP6QFFK’,
 ‘TMJ57K3C8MXX’,
 ‘TMV4JAKD26MZ’,
 ];
 if (membershipTerms.includes(termId)) {
 callVaultEndpoint(uid, ‘purchase’, ‘membership’, chargeAmount, termConversionId);
 }
 },
]);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // Make tp available or use existing one if already loaded
tp = window.tp || [];

tp.push([’addHandler’, ‘customEvent’, function(e) {
 
 // 1. refresh page on ad-blocker Done button
 if (e.customEventName == «offer-close-modal-done») {
 location.reload();
 }
 
 // 2. reload page on «already has access modal» Reload button
 if (e.customEventName == «custom-reload») {
 location.reload();
 }

 // 3. take the user back to Homepage on «non-personalised advertising»
 if (e.customEventName == «return-home») {
 
 // drop browser cookie
 const COOKIE = ‘sp_subscribed_status’;
 document.cookie = COOKIE + ‘=true; path=/;’;
 console.log(»cookie has been set»);

 // rejectAll
 (function() {
 __tcfapi(’postRejectAll’, 2, function (postRejectAllResponse, success) {
 // Custom callback code can be included here
 console.log(»postRejectAllResponse: «, postRejectAllResponse);
 console.log(’postRejectAllResponse was successful: ‘ + success);
 });
 })();
 console.log(»rejectAll from TCF API»);

 // return home
 document.location = «/»;
 }

 // 4. abandon and take user back to Homepage on «non-personalised advertising»
 if (e.customEventName == «abandon-purchase») {
 // return home
 document.location = «/»;
 }

 // 5. navigate user to my-account
 if (e.customEventName == «go-to-my-account») {
 console.log(»go-to-my-account custom event occured»);
 document.location = «/my-account»;
 }

}]);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // Make tp available or use existing one if already loaded
tp = window.tp || [];

tp.push([’addHandler’, ‘customEvent’, function(e) {

 const customEventName = e?.customEventName;
 if (!customEventName) return;

 // Handling Non Newsletter Custom Events
 switch (customEventName) {
 case «piano-google-follow»:
 pa.sendEvent(»goal.completed», { goal_type: customEventName });
 console.log(»Google Follow Goal Set»);
 return;

 case «ios-app-promo»:
 pa.sendEvent(»goal.completed», { goal_type: customEventName });
 console.log(»Download iOS App Goal Set»);
 return;

 case «android-app-promo»:
 pa.sendEvent(»goal.completed», { goal_type: customEventName });
 console.log(»Download Android App Goal Set»);
 return;

 case «desktop-app-promo»:
 pa.sendEvent(»goal.completed», { goal_type: customEventName });
 console.log(»Download Desktop Goal Set»);
 return;
 }

 // Ensure it is a Newsletter Custom Event:
 // Newsletter must end with «newsletter-signup-submit»
 if (!customEventName.endsWith(’newsletter-signup-submit’)) return;

 // Newsletter must match format: «{section}-newsletter-signup-submit»
 if (!/^[a-z]+-newsletter-signup-submit$/.test(customEventName)) return;

 // Section comes from the first part of the Custom Event
 let section = customEventName.split(’-‘)[0];
 if (!section) return;


 // 1. Set goal.completed for newsletter signup
 pa.sendEvent(’goal.completed’, { goal_type: `${section}-newsletter-signup` });
 console.log(`Goal set: ${section}-newsletter-signup`);

 // 2. Is user logged in?
 const isUserLoggedIn = tp.pianoId.getUser();

 // If YES – First assign to correct Mailing List
 const mailing_lists = {
 royal: «[6722]», news: «[6723]», finance: «[6724]»,
 motoring: «[6725]», politics: «[6726]», celebrity: «[6728]»,
 opinion: «[6730]», diet: «[7290]», food: «[7291]»,
 gardening: «[7292]», health: «[7293]», property: «[7294]»,
 tech: «[7295]», travel: «[7296]», sport: «[10761]»
 };

 const sqids = mailing_lists[section];
 let userEmail = «»;
 
 // Logged in users – assign to mailing list
 if (isUserLoggedIn) {
 // Get user email directly from tp
 tp.pianoId.loadExtendedUser({
 formName: »,
 extendedUserLoaded: function(data) {
 userEmail = data.email;
 
 // 3. Assign user to mailing list (logged in users ONLY)
 assignMailingList(userEmail, sqids);

 // 4. setNewsletter in Pushwoosh (for all users)
 setNewsletterTagInPw(userEmail, section);
 }
 });
 } else {
 // Get user email from Newsletter form
 userEmail = e.params.email;

 // 4. setNewsletter in Pushwoosh (for all users)
 setNewsletterTagInPw(userEmail, section);
 }

 
 // HELPER FUNCTIONS
 // Assign user to mailing list 
 async function assignMailingList(userEmail, sqids) {
 try {
 const response = await fetch(
 `https://www.gbnews.com/r/kappa/api/v2/reader/piano_assign_user_mailingList?cache=${Date.now()}`,
 {
 method: ‘POST’,
 headers: { ‘Content-Type’: ‘application/json’ },
 credentials: «omit»,
 body: JSON.stringify({
 email: userEmail,
 sqids: sqids
 })
 }
 );

 if (!response.ok) {
 throw new Error(’piano_assign_user_mailingList request failed’);
 }

 const data = await response.json();
 console.log(»assignMailingList», data);

 } catch (error) {
 console.error(error);
 }
 }

 // update Newsletter tags in Pushwoosh
 async function setNewsletterTagInPw(userEmail, section) {
 try {
 const response = await fetch(
 `https://www.gbnews.com/r/kappa/api/v2/reader/STAGING_pushwoosh_setNewsletter?cache=${Date.now()}`,
 {
 method: ‘POST’,
 headers: { ‘Content-Type’: ‘application/json’ },
 credentials: «omit»,
 body: JSON.stringify({ userEmail, newsletter: section })
 }
 );

 if (!response.ok) {
 throw new Error(’setNewsletterTagInPw request failed’);
 }

 const data = await response.json();
 console.log(»setNewsletterTagInPw», data);

 } catch (error) {
 console.error(error);
 }
 }


}]);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 window.REBELMOUSE_STDLIB.loadExternalScript(»//cdn.viafoura.net/entry/index.js», function() {
 
 const COMMENTS_HEADING = «Have Your Say»;
const FEATURED_COMMENTS = «Member Comments»;
const COMMENTS_TERMS_HTML = ‘By commenting you agree to <a href=»/terms/community-rule-book»>our community rules.’;

// Viafoura
// Make vfQ available or use existing one if already loaded
window.vfQ = window.vfQ || [];
window.vfQ.push(() => {

 // Viafoura is loaded and window.vf is available
 window.vf.$subscribe(’commenting’, ‘loaded’, function(el) {
 
 // change «Comments» to «Have Your Say»
 var headings = el.getElementsByClassName(»vf-comment-header__heading»)
 if (headings.length) {
 headings[0].innerHTML = COMMENTS_HEADING;
 }

 // change «Featured Comments» to «Member Comments» on watch/live
 if (window.location.href.includes(»https://www.gbnews.com/watch/live»)) {
 let featComments = el.getElementsByClassName(»vf-label-text vf-nav-tab-button__text»);
 if (featComments.length) {
 featComments[0].innerHTML = FEATURED_COMMENTS;
 }

 } 
 
 // Add the terms&conditions to the bottom of all commenting widgets
 var forms = el.getElementsByClassName(»vf-post-form»);
 if (forms.length) {
 var form = forms[0];
 let terms = document.createElement(’p’);
 terms.classList.add(’gbn-terms’);
 terms.innerHTML = COMMENTS_TERMS_HTML;
 form.after(terms);
 }
 });
});
 
 });
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // Just here to ensure that the code isn’t loaded on every page.
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 window.addEventListener(’appinstalled’, () => {
 window.dataLayer.push({
 ‘event’: ‘pwa_app_install’,
 });
});

window.addEventListener(’beforeinstallprompt’, (e) => {
 window.dataLayer.push({
 ‘event’: ‘pwa_app_prompt’,
 });
});
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // Prevent scroll position on reload
// more info – https://stackoverflow.com/questions/70188241/history-scrollrestoration-manual-doesnt-prevent-safari-from-restoring-scrol

window.addEventListener(»pageshow», (e) => {
 if (e.persisted) {
 window.scrollTo(0, 0);
 }
});

if (’scrollRestoration’ in history) {
 history.scrollRestoration = ‘manual’;
}
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 const supportBanner = document.getElementById(’support-banner’);
const fixedBanner = supportBanner.cloneNode(true);

fixedBanner.setAttribute(’id’, ‘support-banner-fixed’);

if (document.querySelector(’.main–column, .main .content’)) {
 document.querySelector(’.main–column, .main .content’).appendChild(fixedBanner);
}

window.addEventListener(’scroll’, showBanner);


function showBanner() {
 if (supportBanner && fixedBanner) {
 if (window.scrollY > supportBanner.offsetTop + supportBanner.offsetHeight) {
 if (!fixedBanner.classList.contains(’show-banner’))
 fixedBanner.classList.add(’show-banner’);
 } else {
 if (fixedBanner.classList.contains(’show-banner’))
 fixedBanner.classList.remove(’show-banner’);
 }
 }
}

showBanner();
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 //set variables
tp = window.tp || [];
let articleId = window.dataLayer[0].cd12;

const pageLink = window.location.href;

let uid;
let getCustomFieldResp;
let idArray;
let myResp;
let newArray = [];
let encodedData;
const likeIcon = document.querySelector(’#article-like-button’);
const likeIconImg = document.querySelector(’#article-like-button img’);
let likedPostSections = {};
const currentPostPrimarySection = !!’588563272’
 ? JSON.parse(’588563272’)
 : null; // checks the post’s primary section
const currentPostPrimarySectionParent =
 currentPostPrimarySection && JSON.parse(’0’); //check the primary section’s parent section
const currentPostSections = !!currentPostPrimarySection ? [currentPostPrimarySection] : null;
currentPostPrimarySectionParent && currentPostSections.push(currentPostPrimarySectionParent);

// initialise Gamification window object
window.gbnCE = window.gbnCE || [];
let readEventPushed = false;

// Helper function for Likes
const addPush = (eventType, contentType) => {
 window.gbnCE.push([’event’, eventType, contentType, pageLink]);
 return;
};

const removeLoop = (arr) => {
 for (let i = 0; i < arr.length; i++) {
 if (arr[i] == articleId) {
 arr.splice(arr.indexOf(i), 1);
 }
 }
};

async function getCustomField(id) {
 if (!id) return null;

 return new Promise((resolve) => {
 tp.push([
 ‘init’,
 function () {
 tp.pianoId.loadExtendedUser({
 formName: ‘hyperpersonalisation_fields’,
 extendedUserLoaded: function (data) {
 const resp = data.custom_field_values || [];
 let existingLikedArticles = [];

 for (const item of resp) {
 if (item.field_name === ‘Liked_Posts’) {
 existingLikedArticles = item.value ? JSON.parse(item.value) : [];
 }

 if (item.field_name === ‘Liked_Posts_Topics’) {
 likedPostSections = item.value ? JSON.parse(item.value) : {};
 }
 }

 console.log(’existingLikedArticles’, existingLikedArticles);
 console.log(’existingLikedPostSections’, likedPostSections);
 resolve(existingLikedArticles);
 },
 });
 },
 ]);
 });
}

const updateLikedTopics = (isLiked = true) => {
 // FIX: if the object is empty it will show an ampty object and never return null
 if (!likedPostSections || typeof likedPostSections !== ‘object’) {
 likedPostSections = {};
 }

 console.log(’ updateLikedTopics called:’, {
 isLiked,
 currentPostSections,
 likedPostSections: JSON.stringify(likedPostSections),
 });

 if (!currentPostSections) return {};

 const sectionsToExclude = (localStorage.all_sections && JSON.parse(localStorage.all_sections).privateSections) || {
 0: ‘home’,
 };

 currentPostSections.forEach((id) => {
 // change from .map (because map created a new array) to .forEach
 console.log(’Processing section:’, id, ‘current value:’, likedPostSections[id]);

 if (sectionsToExclude[id]) {
 console.log(’Excluding section:’, id);
 delete likedPostSections[id];
 return;
 }

 const scoreToBeAdded = id === currentPostPrimarySection ? 2 : 1;
 const currentScore = likedPostSections[id] || 0;
 likedPostSections[id] = isLiked ? currentScore + scoreToBeAdded : Math.max(0, currentScore – scoreToBeAdded);

 console.log(’Updated section:’, id, ‘new value:’, likedPostSections[id]);
 });

 // delete sections that have Zero or negative likes
 for (const key in likedPostSections) {
 if (likedPostSections[key] <= 0) {
 delete likedPostSections[key];
 }
 }

 const dataToSave = { Liked_Posts_Topics: JSON.stringify(likedPostSections) };
 console.log(’ Data to save:’, dataToSave);
 return dataToSave;
};

const checkLikes = (resp) => {
 let liked = false;
 try {
 if (resp != undefined) {
 if (typeof resp == ‘string’) {
 resp = resp.split(’,’);
 if (!resp.includes(articleId)) {
 liked = false;
 }

 resp = [...new Set(resp)];
 }
 let tempArr = resp;
 for (let i = 0; i < tempArr.length; i++) {
 if (tempArr[i] == articleId) {
 liked = true;
 return liked;
 }
 }
 }
 } catch (error) {
 console.log(’error: ‘, error);
 }

 return liked;
};

async function updateCustomFieldThankYou(userUID, cleanData) {
 try {
 const response = await fetch(
 `https://www.gbnews.com/r/kappa/api/v2/reader/piano_update_follow_topics_cf?cache=${Date.now()}`,
 {
 method: ‘POST’,
 headers: {
 ‘Content-Type’: ‘application/json’,
 },
 credentials: ‘omit’,
 body: JSON.stringify({
 uid: userUID,
 custom_fields: cleanData,
 }),
 },
 );

 if (!response.ok) {
 const errorData = await response.text();
 console.log(’error’, errorData);
 throw new Error(’updateCustomFieldThankYou request failed’);
 }
 } catch (error) {
 console.error(error);
 }
}

const encodeCustomField = (respArray, isLiked = true) => {
 // ensure array is stringified
 encodedData = { Liked_Posts: JSON.stringify(respArray), ...updateLikedTopics(isLiked) };
 return encodeURIComponent(JSON.stringify(encodedData));
};

tp.push([
 ‘init’,
 function () {
 (async function () {
 if (tp.pianoId.isUserValid()) {
 uid = tp.pianoId.getUser().uid;
 getCustomFieldResp = await getCustomField(uid);
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112480/origin.png’);

 if (checkLikes(getCustomFieldResp)) {
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112481/origin.png’);
 } else {
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112480/origin.png’);
 }

 let articleRm = false;

 const cleanArr = (arr) => {
 for (let i = 0; i < arr.length; i++) {
 if (articleId == arr[i]) {
 arr.splice(arr.indexOf(i), 1);
 articleRm = true;
 }
 }
 };

 likeIcon.addEventListener(’click’, () => {
 // handle logged out user
 if (!tp.pianoId.isUserValid()) {
 tp.pianoId.show({
 screen: ‘login’,
 });
 } else {
 // if resp is an array
 if (Array.isArray(getCustomFieldResp)) {
 getCustomFieldResp = [...new Set(getCustomFieldResp)];

 // remove article ID from custom fields
 cleanArr(getCustomFieldResp);

 // update custom field in piano and update like icon img
 if (articleRm) {
 console.log(’This post was disliked ‘, getCustomFieldResp);
 updateCustomFieldThankYou(uid, encodeCustomField(getCustomFieldResp, false));
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112480/origin.png’);
 articleRm = false;

 // Push Dislike to Gamification
 addPush(’dislike’, ‘article’);
 console.log(’gbnCE push’, window.gbnCE);
 } else {
 console.log(’This post was liked ‘, getCustomFieldResp);
 getCustomFieldResp.push(articleId);
 updateCustomFieldThankYou(uid, encodeCustomField(getCustomFieldResp, true));
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112481/origin.png’);

 // Push Like to Gamification
 addPush(’like’, ‘article’);
 console.log(’gbnCE push’, window.gbnCE);
 }
 // if resp is string or undefined
 } else if (typeof getCustomFieldResp == ‘string’) {
 getCustomFieldResp = getCustomFieldResp.split(’,’);
 getCustomFieldResp = [...new Set(getCustomFieldResp)];

 for (let i = 0; i < getCustomFieldResp.length; i++) {
 if (articleId == getCustomFieldResp[i]) {
 getCustomFieldResp.splice(getCustomFieldResp.indexOf(i), 1);
 articleRm = true;
 }
 }

 cleanArr(getCustomFieldResp);

 if (articleRm) {
 console.log(’This post was disliked 2’, currentPostSections);
 updateCustomFieldThankYou(uid, encodeCustomField(getCustomFieldResp, false));
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112480/origin.png’);

 // Push Dislike to Gamification
 addPush(’dislike’, ‘article’);
 console.log(’gbnCE push’, window.gbnCE);
 } else {
 console.log(’This post was liked 2’, currentPostSections);
 getCustomFieldResp.push(articleId);
 updateCustomFieldThankYou(uid, encodeCustomField(getCustomFieldResp, true));
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112481/origin.png’);

 // Push Like to Gamification
 addPush(’like’, ‘article’);
 console.log(’gbnCE push’, window.gbnCE);
 }
 } else {
 getCustomFieldResp = [];
 getCustomFieldResp.push(articleId);
 updateCustomFieldThankYou(uid, encodeCustomField(getCustomFieldResp, true));
 likeIconImg.setAttribute(’src’, ‘https://assets.rbl.ms/61112481/origin.png’);

 // Push Like to Gamification
 addPush(’like’, ‘article’);
 console.log(’gbnCE push’, window.gbnCE);
 }
 }
 });
 } else {
 likeIcon.addEventListener(’click’, () => {
 tp.pianoId.show({
 screen: ‘login’,
 });
 });
 }
 })();
 },
]);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // // initialise Gamification window object
// window.gbnCE = window.gbnCE || [];
// let readEventPushed = false;

// const article = document.querySelector(’article[elid]’);
// const articleId = article ? article.getAttribute(’elid’) : null;

// window.addEventListener(’scroll’, (e) => {
// if (!readEventPushed) {
// const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
// const windowHeight = window.innerHeight;
// const docHeight = document.documentElement.scrollHeight;
// const scrollPercent = (scrollTop / (docHeight – windowHeight)) * 100;

// if (scrollPercent >= 50) {
// window.gbnCE.push([’event’, ‘read’, ‘article’, articleId]);
// console.log(’gbnCE push’, window.gbnCE);
// readEventPushed = true;
// }
// }
// });
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // initialise Gamification window object
window.gbnCE = window.gbnCE || [];
let readEventPushed = false;

// const article = document.querySelector(’article[elid]’);
// const articleId = article ? article.getAttribute(’elid’) : null;

const pageLink = window.location.href;

const targetEl = document.querySelector(’.posts-custom .all-related-sections’);

if (targetEl) {
 const observer = new IntersectionObserver(
 (entries) => {
 entries.forEach((entry) => {
 if (entry.isIntersecting && !readEventPushed) {
 window.gbnCE.push([’event’, ‘read’, ‘article’, pageLink]);
 console.log(’gbnCE push’, window.gbnCE);

 readEventPushed = true;
 observer.disconnect(); // stop observing after first trigger
 }
 });
 },
 {
 threshold: 0.1, // trigger when ~10% of the element is visible
 },
 );

 observer.observe(targetEl);
}
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 function createAndInsertCommentsIcon(num) {

 const social_wrappers = document.querySelectorAll(».shares-container»);
 const social_wrapper = social_wrappers[num];

 if (document.querySelector(».commentIcon»)) {
 // console.log(»YOU HAVE YOUR COMMENTS ICON SLOT»)
 let commentIcon = document.querySelector(».commentIcon»);
 commentIcon.id = «commentIcon-» + num;

 // Creating comment count span element
 // console.log(»first span element»)
 let spanElement = document.createElement(»span»);
 spanElement.id = «comment-count-» + num;
 commentIcon.appendChild(spanElement);
 // console.log(»span el added»)

 // Create «Comment» span
 let commentSpan = document.createElement(»span»);
 commentSpan.id = «comment-span-» + num;
 commentSpan.innerText = «Comment»;
 commentIcon.appendChild(commentSpan);

 // Create «Comments» (with an S) span
 let commentsSpan = document.createElement(»span»);
 commentsSpan.id = «comments-span-» + num;
 commentsSpan.innerText = «Comments»;
 commentIcon.appendChild(commentsSpan);

 // Appending commentIcon button to social_wrapper
 // console.log(»social wrapper», social_wrapper);
 // console.log(»commentIcon», commentIcon);
 social_wrapper.appendChild(commentIcon);
 } else {
 // console.log(»YOU DO NOT HAVE YOUR COMMENT SSLOT»)
 }


}

createAndInsertCommentsIcon(0);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 let commentsWidget = document.getElementById(’comments’);
let scrollToCommentsIcon = document.querySelectorAll(».commentIcon»);
let youMayLike = document.querySelector(».you-may-like__wrapper»);

let firstClick = true; // flag to track first click

function scrollToElementWithOffset(element, offset = 0, duration = 800) {
 let start = window.scrollY;
 let end = element.getBoundingClientRect().top + start – offset;
 let distance = end – start;
 let startTime = performance.now();

 function animateScroll(currentTime) {
 let elapsed = currentTime – startTime;
 let progress = Math.min(elapsed / duration, 1);
 window.scrollTo(0, start + distance * progress);
 if (progress < 1) requestAnimationFrame(animateScroll);
 }

 requestAnimationFrame(animateScroll);
}

scrollToCommentsIcon.forEach(icon => {
 icon.addEventListener(’click’, () => {
 if (firstClick && youMayLike) {
 // First click and «You may like» exists
 youMayLike.scrollIntoView({ behavior: ‘smooth’ });

 setTimeout(() => {
 scrollToElementWithOffset(commentsWidget, 50, 300);
 }, 4000);

 firstClick = false; // subsequent clicks skip «You may like»
 } else {
 // Directly scroll to comments with offset
 scrollToElementWithOffset(commentsWidget, 50, 300);
 firstClick = false; // ensure firstClick is false even if youMayLike doesn’t exist
 }
 });
});
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 function getCommentCount (value) {
 const roundedTime = 1721838910000;
 
 fetch(`https://www.gbnews.com/r/kappa/api/v2/reader/new_comment_count_PROD?name=${value}&cache=${roundedTime}`, {
 method: ‘GET’,
 credentials: «omit»
 })

 .then(response => {
 if(response.ok) {
 return response.json();
 } else {
 throw new Error(’API request failed’);
 }
 })
 .then(data => {
 // console.log(`comment count is ${data}`); // data is a number

 const isMobile = window.innerWidth <= 768;

 // TOP OF THE PAGE
 let commentsDesktop = document.getElementById(»comment-count-0″);
 let commentSpanDesktop = document.getElementById(»comment-span-0″);
 let commentsSpanDesktop = document.getElementById(»comments-span-0″);
 let nowDesktop = document.getElementById(»now-0″);

 console.log(»your data «, data)
 if (data == 0) {
 // display «Comment» and «Now!» and hide «Comments»
 if (isMobile) {
 commentSpanDesktop.style.display = «none»;
 commentsSpanDesktop.style.display = «none»;
 } else {
 commentSpanDesktop.style.display = «block»;
 commentsSpanDesktop.style.display = «none»;
 }

 nowDesktop.style.display = «block»;
 commentsSpanDesktop.style.display = «none»;

 commentSpanDesktopBottom.style.display = «block»;
 nowDesktopBottom.style.display = «block»;
 commentsSpanDesktopBottom.style.display = «none»;
 }

 if (data == 1) {
 // display «Count» and «Comment» and hide «Comments»
 commentsDesktop.style.display = «block»;
 commentSpanDesktop.style.display = «block»;
 commentsSpanDesktop.style.display = «none»;
 }

 if (data > 1) {
 // display «count» and «Comments»
 commentsDesktop.style.display = «block»;
 commentSpanDesktop.style.display = «none»;
 }

 if (data >= 1 && data < 100) {
 commentsDesktop.style.padding = «0 0 0 0px»;
 }
 if (data >= 100 && data < 1000) {
 commentsDesktop.style.padding = «0 0 0 0px»;
 }

 if (data >= 1000) {
 // Round count to the nearest 100
 data = Math.round(data / 100) * 100;
 data = (data / 1000).toFixed(1) + «K»;
 } 
 
 // update the icon’s with the above
 if (commentsDesktop) {
 commentsDesktop.innerHTML = data;
 commentsDesktop.textContent = data;
 commentsDesktop.value = data;
 }
 
 })
}

// look up Meta element for the container_id
const metaElement = document.querySelector(’meta[name=»vf:container_id»]’);
if (metaElement) {
 const contentValue = metaElement.getAttribute(’content’);
 // call comment_count API
 getCommentCount(contentValue);
 // console.log(getCommentCount);
} else {
 // console.log(’Meta element not found’);
}
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 var embedScript = document.createElement(’script’);
embedScript.src = ‘https://widgets.opinary.com/embed.js’;
if (embedScript) {
 embedScript.onerror = () => {
 const w = document.querySelector(’.opinary-widget-embed’);
 if (!w) {
 return
 }
 const link = document.createElement(’div’);
 link.id = «opinary-link-container»;
 link.classList.add(»opinary-link-container»);
 link.innerHTML = `<img class=»opinary-icon» src=»https://assets.rbl.ms/55730280/origin.png» alt=»opinary link icon»><a class=»opinary-link-text» target=»_blank» href=»https://compass.opinary.com/compasses/${w.dataset.customer}/${w.dataset.poll}?adblocker=true»>It looks like your browser is blocking the Poll: <u>Please open here instead`;
 w.parentNode.replaceChild(link, w);
 };
}
document.head.appendChild(embedScript);
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 // const captions = document.querySelectorAll(».image-media.media-caption»);
// const credits = document.querySelectorAll(».image-media.media-photo-credit»);



// captions.forEach((caption) => {
// const captionsWrapper = document.createElement(»div»);
// captionsWrapper.classList.add(»captions-wrapper»);
// captionsWrapper.appendChild(caption);
// caption.parentElement.prepend(captionsWrapper);
// caption.remove();
// })



// if (document.querySelector(».captions-wrapper»)) {
// captionsWrappers = document.querySelectorAll(».captions-wrapper»);
// credits.forEach((credit, i) => {
// captionsWrappers[i].appendChild(credit);
// credit.remove();
// })
// }
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 const tabs = document.querySelectorAll(’.tab’);
 const contents = document.querySelectorAll(’.tab-content’);

 tabs.forEach(tab => {
 tab.addEventListener(’click’, () => {
 // Remove active class from all tabs and contents
 tabs.forEach(t => t.classList.remove(’active’));
 contents.forEach(c => c.classList.remove(’active’));

 // Add active to current tab and related content
 tab.classList.add(’active’);
 document.getElementById(tab.dataset.tab).classList.add(’active’);
 });
});
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 async function loadTrendingMostRead() {
 try {
 const response = await fetch(
 `/res/custom_page/data.js?resource_id=generic&layout_name=MostRead`
 );
 const posts = await response.json();

 // Parse the HTML string
 const parser = new DOMParser();
 const doc = parser.parseFromString(posts.html, «text/html»);

 // Select all headline <a> elements
 const headlineElements = doc.querySelectorAll(».widget__headline-text»);

 // Select or create a container in your HTML to append these
 const container = document.getElementById(»stories»);

 // Loop and create <p> with number and link
 Array.from(headlineElements).forEach((el, index) => {
 const headlineText = el.textContent.trim();
 const href = el.getAttribute(»href»);

 const p = document.createElement(»p»);
 p.className = «trending-item»;

 // Create number span
 const span = document.createElement(»span»);
 span.className = «trending-article-number»;
 span.textContent = `${index + 1}`;

 // Create anchor
 const a = document.createElement(»a»);
 a.href = href;
 a.textContent = headlineText;
 a.className = «trending-body-text»;

 // Append span and anchor to paragraph
 p.appendChild(span);
 p.appendChild(a);

 // Append paragraph to container
 container.appendChild(p);
 });

 } catch (e) {
 console.error(’Failed to load’, e);
 }
}

loadTrendingMostRead();
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 async function loadTrendingMostWatched() {
 try {
 const response = await fetch(
 `/res/custom_page/data.js?resource_id=generic&layout_name=MostWatched`
 );
 const posts = await response.json();

 // Parse the HTML string
 const parser = new DOMParser();
 const doc = parser.parseFromString(posts.html, «text/html»);

 // Select all headline <a> elements
 const headlineElements = doc.querySelectorAll(».widget__headline-text»);

 // Select or create a container in your HTML to append these
 const container = document.getElementById(»videos»);

 // Loop and create <p> with number and link
 Array.from(headlineElements).forEach((el, index) => {
 const headlineText = el.textContent.trim();
 const href = el.getAttribute(»href»);

 const p = document.createElement(»p»);
 p.className = «trending-item»;

 // Create number span
 const span = document.createElement(»span»);
 span.className = «trending-article-number»;
 span.textContent = `${index + 1}`;

 // Create anchor
 const a = document.createElement(»a»);
 a.href = href;
 a.textContent = headlineText;
 a.className = «trending-body-text»;

 // Append span and anchor to paragraph
 p.appendChild(span);
 p.appendChild(a);

 // Append paragraph to container
 container.appendChild(p);
 });

 } catch (e) {
 console.error(’Failed to load’, e);
 }
}

loadTrendingMostWatched();
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 async function loadYourSay() {
 try {
 const response = await fetch(`https://www.gbnews.com/r/kappa/api/v2/reader/module_yoursay`, {
 method: ‘GET’,
 credentials: «omit»
 });
 const posts = await response.json();
 let yourSayArticles = posts.trending; // array
 // console.log(yourSayArticles);

 // Select the container in your HTML to append these
 const container = document.getElementById(»your-say»);

 // Loop through each article
 yourSayArticles.forEach((article, index) => {
 const headlineText = article.origin_title;
 const href = article.origin_url;

 // Create <p> wrapper
 const p = document.createElement(»p»);
 p.className = «trending-item»;

 // Create number <span>
 const span = document.createElement(»span»);
 span.className = «trending-article-number»;
 span.textContent = `${index + 1}`;

 // Create <a> tag
 const a = document.createElement(»a»);
 a.href = href;
 a.textContent = headlineText;
 a.className = «trending-body-text»;

 // Append to container
 p.appendChild(span);
 p.appendChild(a);
 container.appendChild(p);
 });


 } catch (e) {
 console.error(’Failed to load’, e);
 }
}

loadYourSay();
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 const articleId = window.dataLayer[0].cd12;
// Fill in *your* param values, as provided by Taboola:
// *Global* command queue for the page
window._taboola = window._taboola || [];

const taboolaPush = (mode, container, placement, target_type) => {
 _taboola.push({
 mode: mode,
 container: container /* The ID of the <div> container (e.g. ») */,
 placement: placement,
 target_type: target_type,
 });
 return;
};

let accessStatusFromWindowObj5 = window.userStatus;

if (accessStatusFromWindowObj5 !== ‘member’) {
 taboolaPush(’alternating-thumbnails-stream-rmp’, ‘taboola-mid-article-thumbnails’, ‘Mid Article Thumbnails’, ‘mix’);

 taboolaPush(’alternating-thumbnails-a’, ‘taboola-below-article-thumbnails’, ‘Below Article Thumbnails’, ‘mix’);
}

// // window._taboola = window._taboola || [];
// // _taboola.push({
// // mode: ‘alternating-thumbnails-a’,
// // container: ‘taboola-below-article-thumbnails’,
// // placement: ‘Below Article Thumbnails’,
// // target_type: ‘mix’,
// // });

// // const paragraphs = document.querySelectorAll(’.body-description p:not(small p, .evergreen-particle p)’);
// // if (paragraphs.length > 2) {
// // const video = paragraphs[2];
// // const div = document.createElement(’div’);
// // div.innerHTML = `<div id=»taboola-mid-article-thumbnails»>`;
// // video.after(div);
// // }
 

});

window.REBELMOUSE_LOWEST_TASKS_QUEUE.push(function(){

 
 REBELMOUSE_STDLIB.createElementChangeListener(».ssmp-content», function(poster) {
 const videoPlayer = document.querySelector(’.simplestream-holder video’);
 let isVideoStarted = false;
 let playVideoInterval;

 const handler = function() {
 if (!isVideoStarted) {
 playVideoInterval = setInterval(() => {
 if (videoPlayer.readyState === 4) {
 isVideoStarted = true;
 poster.removeEventListener(’click’, handler, true);
 clearInterval(playVideoInterval);
 return videoPlayer.play();
 }
 }, 100);
 }
 }

 return poster.addEventListener(’click’, handler, true);
});
 

});]]></script></body>


