1(()=>{var e={405(){window.addEventListener("ga4:ready",()=>{document.querySelectorAll(".inews__perspectives .inews__post-section__body a,.inews__perspectives .perspective__content a,.inews__perspectives-home .inews__post-section__body a,.inews__perspectives-home .perspective__content a").forEach(e=>{e.addEventListener("click",t=>{const n=e.closest(".inews__perspectives, .inews__perspectives-home"),o=n?.querySelector(".inews__perspective-description")?.textContent?.trim(),i=e.getAttribute("title")||null,s=o||i;s&&localStorage.setItem("event_label",s)})})})}},t={};function n(o){var i=t[o];if(void 0!==i)return i.exports;var s=t[o]={exports:{}};return e[o](s,s.exports,n),s.exports}n.dn=e=>{(Object.getOwnPropertyDescriptor(e,"name")||{}).writable||Object.defineProperty(e,"name",{value:"default",configurable:!0})},(()=>{"use strict";const e="inews.co.uk"===window.location.hostname?"G-B1HE1LBHLM":"G-E65172H56R";let t;window.iNews=window.iNews||{},window.iNews.eventHandlers=window.iNews.eventHandlers||[];let o=null;const i=async(n,i={},s={})=>{await(o||(o=new Promise(e=>{window.iNews.ga4Ready?e():(t=e,setTimeout(e,5e3))})),o),window.gtag&&(Object.keys(s).length&&window.gtag("set",s),window.gtag("event",n,{...i,send_to:e}),window.iNews.eventHandlers.forEach(e=>{try{e(n,i,s)}catch(e){}}))};window.addEventListener("ga4:ready",()=>{const e=document.getElementById("inews__back-to-top");e&&e.addEventListener("click",()=>{i("button_click",{event_object_name:"back_to_top"})})}),window.addEventListener("ga4:ready",()=>{const e=(e="not-set",t="not-set")=>{i("burger_menu",{event_category:e,event_label:t})},t=document.querySelector(".hamburger-toggle");t&&t.addEventListener("click",()=>{e()});const n=document.querySelector("#header__navigation__hamburger");n&&n.addEventListener("click",t=>{const n=t.target.closest("a");if(!n)return;const o=n.closest("li.menu-item"),i=o?.closest(".sub-menu"),s=i?o.closest("li.menu-item-has-children")?.querySelector("a")?.textContent.trim()||"not-set":n.textContent.trim(),a=i?n.textContent.trim():"not-set";e(s,a)}),document.querySelectorAll(".my-account-links > a, .my-account-links > .subs-logout").forEach(t=>{t.addEventListener("click",()=>{let n=t.getAttribute("title")||"not-set";"not-set"!==n&&(n=n.replace(/^\w/,e=>e.toUpperCase())),e("My Account",n)})})}),window.addEventListener("ga4:ready",()=>{document.querySelectorAll(".inews__post-byline__author-toggle-button").forEach(e=>{e.addEventListener("click",e=>{"true"===e.currentTarget.getAttribute("aria-expanded")&&i("editor_byline",{event_action:"expansion"})})})}),window.addEventListener("ga4:ready",()=>{const e=document.querySelector("footer");e?.addEventListener("click",e=>{const t=e.target.closest("a");if(!t)return;let n,o=(e=>{const t=e.querySelector("svg title")?.textContent;return(t||e.title||e.textContent).trim().toLowerCase().replace(/\s+/g,"_")})(t);if(t.closest("#menu-bottom-menu-1"))n="essentials";else if(t.closest("#menu-bottom-menu-2"))n="useful_links";else{if(!t.closest(".wp-block-social-links"))return;n="follow_us"}i("site_footer",{event_category:n,event_label:o})})}),window.addEventListener("load",()=>{window.tp=window.tp||[],window.tp.push(["addHandler","customEvent",e=>{"ireward_account_click"===e.eventName&&i("button_click",{event_category:"irewards",event_label:"your_account"}),"rewards"===e.eventName&&i("button_click",{event_category:"irewards",event_label:"subscription_page_banner"})}]),document.querySelectorAll('.footer-menu a[href*="/rewards"]').forEach(e=>{e.addEventListener("click",()=>{i("button_click",{event_category:"irewards",event_label:"useful_links"})})}),window.addEventListener("message",({data:e})=>{"ireward_banner_click"===e?.event&&i("button_click",{event_category:"irewards",event_label:"homepage_banner"})})}),n.dn(()=>{}),window.addEventListener("load",()=>{if(document.querySelector("body").classList.contains("post-template-liveblog")){const e=(e,t,n="")=>{const o="story_so_far"!==e&&"liveblog_text_link"!==e?document.querySelector(".headline")?.textContent??"":n;i("liveblog_interactions",{event_category:e,event_label:t?"":o})};window.addEventListener("dmgLiveblog:loadMore",t=>{t?.detail?.page&&e("load_more",!0)});const t=(e,t)=>{window.addEventListener(e,e=>{const n=e?.detail?.post?.link;n&&i(t,{event_category:"social",event_label:n})})};t("dmgLiveblog:shareButtons:whatsapp","whatsapp share"),t("dmgLiveblog:shareButtons:twitter","twitter share"),t("dmgLiveblog:shareButtons:facebook","facebook share"),t("dmgLiveblog:shareButtons:email","email share"),t("dmgLiveblog:shareButtons:copyLink","copy link"),window.addEventListener("dmgLiveblog:keyEvent:click",t=>{const{href:n,label:o}=t?.detail||{};n&&o&&e("liveblog_text_link",!1,o)}),window.addEventListener("dmgLiveblog:storySoFar:click",t=>{const{href:n,label:o}=t?.detail||{};n&&o&&e("story_so_far",!1,o)})}}),n.dn(()=>{}),window.tp=window.tp||[],window.location.pathname.includes("/my-account/")&&window.addEventListener("iNews:Subscriber:checked",()=>{const e=document.querySelectorAll(".todays-paper-download");window.location.pathname.includes("/my-account/todays-paper")&&(window.iNews.Subscriber.isSubscribed?fetch("/wp-json/pdf-edition/v1/download",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({aid:window.tp.aid,uid:window.iNews.Subscriber.uid})}).then(e=>e.json()).then(t=>{const n=t?.pdf_source;
1n?e.forEach(e=>{e.href=n,e.target="_blank",e.classList.remove("todays-paper-download-disabled")}):e.forEach(e=>e.classList.remove("todays-paper-download-disabled"))}):e.forEach(e=>e.classList.remove("todays-paper-download-disabled"))),document.querySelector('a[aria-controls="todays-paper"]')?.addEventListener("click",()=>{i("button_click",{event_object_name:"todays_paper"})}),document.querySelector('a[aria-controls="saved-items"]')?.addEventListener("click",()=>{i("button_click",{event_object_name:"saved_by_you_tab"})}),e.forEach(e=>{e.addEventListener("click",()=>{const e=document.querySelector(".todays-paper-management h3")?.textContent,t=e?new Date(e):new Date;i("todays_paper_pdf",{event_object_name:"read",publish_date:t.toISOString().replace(/T.+/gi,"T:00:00:00")})})})}),window.addEventListener("bookmarks:loaded",()=>{document.querySelectorAll(".inews_post_saved_item_toggle.bookmark").forEach(e=>{e.addEventListener("click",e=>{i("bookmark",{event_object_name:"removed",event_label:e.currentTarget.getAttribute("data-url"),article_id:e.currentTarget.getAttribute("data-postid"),article_title:e.currentTarget.getAttribute("data-title")})})}),document.querySelectorAll("#saved-articles-list").forEach(e=>{e.querySelectorAll(".inews_post_saved_item").forEach((e,t)=>{const n=e.querySelector(".inews__post__content-headline a"),o=n?.innerText??"";e.querySelectorAll("a").forEach(e=>{e.addEventListener("click",n=>{let s="not set";if(e.matches(".inews__post__badge-category a")){const t=e.getAttribute("href")||"";try{s=new URL(t,window.location.origin).pathname.split("/").filter(Boolean).pop()||"not set"}catch(e){s="not set"}}i("widget_click",{event_object_name:"your_saved_articles",event_object_text:o,unit_position:t+1,target_url:e.href,event_type:s})})})})})}),tp.push(["addHandler","logout",()=>{i("logOut",{event_category:"logOut",event_action:"not set",event_label:"not set"})}]),n.dn(()=>{}),window.addEventListener("newsletter:subscribe",e=>{const t=InewsSubscriptionActions.filterNewsLetterName(e.sailthruname),n=InewsSubscriptionActions.findNewsLetter(t);let o=t;n&&(o=`${o}_-_${n.list.replace(/ /g,"-").replace("'","")}`),o=o.toLowerCase(),i("subscribe now click",{event_category:"subscriber newsletters",event_label:o},{ico_internal_campaigns:`subscriber_newsletters_-_${o}`})}),window.addEventListener("newsletter:paidclick",e=>{let t=InewsSubscriptionActions.filterNewsLetterName(e.name);e.tileLabel&&(t=`${t}_-_${e.tileLabel.replace(/ /g,"-").replace("'","")}`),t=t.toLowerCase(),i("subscribe now click",{event_category:"subscriber newsletters",event_label:t},{ico_internal_campaigns:`subscriber_newsletters_-_${t}`})}),window.addEventListener("newsletter:topic_addremove",e=>{const{sailthruName:t,position:n,isRemoved:o,isNewSubscriber:s}=e.detail;let a;a=o?"newsletter_topic_removal":s?"newsletter_new_subscription":"newsletter_topic_addition";const r=n||new URLSearchParams(window.location.search).get("ico");i(a,{event_object_position:r,event_object_name:t})}),n.dn(()=>{}),n(405),window.addEventListener("ga4:ready",()=>{!function(){let e=0;const t="piano_gift_buttons_ready";let n=0;function o(e){return Array.isArray(e)?"event"===e[0]&&e[1]===t:!(!e||e.event!==t)}Array.isArray(window.dataLayer)||(window.dataLayer=[]);const s=setInterval(()=>{++n;const t=window.dataLayer.filter(o).length;t>e&&(document.querySelectorAll(".inews__post-gift-button").forEach(e=>{"true"!==e?.dataset?.gtagBound&&(e.dataset.gtagBound="true",e.addEventListener("click",t=>{const n=t.target.closest(".inews__post-gift"),o=n?.classList?.contains("inews__post-gift--vertical")?"in_article_sticky":"in_article_top",s=e.getAttribute("type");i("gifted_article",{event_object_position:o,social_platform:`${s}_share`})}))}),e=t),n>=20&&clearInterval(s)},500)}()}),window.tp=window.tp||[];window.addEventListener("load",()=>{if(document.body.classList.contains("single-post")){const e=(()=>{const e=document.querySelector(".article-wrapper");if(!e)return;const t=e.scrollHeight,n=[25,50,75,100],o=new Set,s=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(e.isIntersecting){const a=parseInt(e.target.dataset.milestone,10);o.has(a)||(o.add(a),i(`${s=a}%`,{event_category:"NTG article milestone",event_label:document.title,event_value:s,non_interaction:!0,timestamp:(new Date).toISOString()}),100===s&&i("article",{event_category:"scroll depth tracking",event_label:"end of article text"})),o.size===n.length&&t.disconnect()}var s})},{root:null,rootMargin:"0px",threshold:0});
1return n.forEach(n=>{const o=document.createElement("div");o.style.position="absolute",o.style.top=n/100*t+"px",o.style.left="0",o.style.width="100%",o.style.height="1px",o.style.visibility="hidden",o.id=`scroll-marker-${n}`,o.dataset.milestone=`${n}`,e.style.position="relative",e.appendChild(o),s.observe(o)}),s})();tp.push(["addHandler","checkoutStateChange",t=>{e&&"offer"===t?.stateName&&e.disconnect()}]),tp.push(["addHandler","showOffer",()=>{e&&e.disconnect()}])}}),window.addEventListener("load",()=>{const e=document.querySelectorAll(".inews__post-section, .inews__widget__popular_posts, .inews__widget__puzzles, .inews__perspectives-home");e.length&&e.forEach(e=>{const t=(e.getAttribute("data-type")||e.getAttribute("data-id")||"").replace("PostSection",""),n=e.querySelector(".inews__post-section__title a")||e.querySelector(".inews__post-section__title span")||e.querySelector(".inews__post-section__title h2"),o=n?.textContent||t;e.querySelectorAll(".inews__post, .skyline__slide, .puzzle-box").forEach((e,t)=>{e.addEventListener("click",({target:e})=>{("A"===e.nodeName||"H2"===e.nodeName||e.closest("a"))&&(localStorage.setItem("postSection_title",o),localStorage.setItem("postSection_index",t+1))})})})}),n.dn(()=>{}),window.addEventListener("ga4:ready",()=>{document.querySelectorAll(".inews__post-share, .inews__post-share--vertical").forEach(e=>{e.addEventListener("click",t=>{const n=t.target.closest(".inews__post-share-button"),o={"inews__post-share--vertical":"in_article_sticky",without_save:"in_article_bottom"},s=Object.keys(o).find(t=>e.classList.contains(t)),a=s?o[s]:"in_article_top";if(!n)return;if(n.classList.contains("share"))return void i("social_share",{event_object_position:a,event_type:"share_icon"});if("save"===n.getAttribute("type"))return;const r=n.dataset.track;if(!r)return;const[c]=r.split("_");i("social_share",{social_platform:`${c}_share`,event_object_position:a})})}),window.addEventListener("bookmarks:addremove",e=>{const t=e.detail.isSaved?"saved":"unsaved";i("bookmark",{event_object_name:t,event_label:window.location.href})})}),n.dn(()=>{}),window.tp=window.tp||[];let s=0,a=300;const r={initial:{gap:300,added:!1},gap:100,className:"reading_marker"},c={pageLoadTime:new Date,lastTrackerEventTime:null,getReadingDuration(e){const t=e?this.pageLoadTime.getTime():this.lastTrackerEventTime?.getTime()||this.pageLoadTime.getTime();return(Date.now()-t)/1e3},sendEvent(e){const t=this.getReadingDuration(),n=t>0&&t<=2,o={timestamp:new Date,quick_scroll_flag:n&&e.word_threshold>0,word_threshold:0,reading_duration:t,total_reading_duration:this.getReadingDuration(!0),...e};i("content_reading_tracker",{...o}),this.lastTrackerEventTime=o.timestamp}},l=()=>{const e=new IntersectionObserver((e,t)=>{e.forEach(e=>{if(e.isIntersecting){const n=parseInt(e.target.dataset.threshold,10)||0;c.sendEvent({word_threshold:n}),t.unobserve(e.target)}})});document.querySelectorAll(`.${r.className}`).forEach(t=>e.observe(t))};function d(e){const t=document.createDocumentFragment();if(e.nodeType===Node.TEXT_NODE){const n=(e=>{const t=e.match(/\S+|\s+/g)||[],n=document.createDocumentFragment();let o="";return t.forEach(e=>{if(/\s+/.test(e))o+=e;else{for(s++;s>=a;){o&&(n.appendChild(document.createTextNode(o)),o="");const e=document.createElement("span");e.className=r.className,e.dataset.threshold=a,n.appendChild(e),r.initial.added||a!==r.initial.gap||(r.initial.added=!0),a+=r.gap}o+=e}}),o&&n.appendChild(document.createTextNode(o)),n})(e.nodeValue);t.appendChild(n)}else if(e.nodeType===Node.ELEMENT_NODE){const n=e.cloneNode(!1);e.childNodes.forEach(e=>{const t=d(e);n.appendChild(t)}),t.appendChild(n)}else t.appendChild(e.cloneNode(!0));return t}window.tp.push(["init",()=>{window.addEventListener("ga4:ready",()=>{if(document.body.classList.contains("single-post")){const e=document.querySelector(".entry-content");if(!e)return;e.querySelectorAll("p").forEach(e=>{(e=>{const t=document.createDocumentFragment();e.childNodes.forEach(e=>{const n=d(e);t.appendChild(n)}),e.replaceChildren(t)})(e)}),window?.iNews?.Subscriber?.isSubscribed?(l(),c.sendEvent({word_threshold:0,timestamp:c.pageLoadTime})):setTimeout(()=>{document.body.classList.contains("tp-modal-close")||(l(),c.sendEvent({word_threshold:0,timestamp:c.pageLoadTime}))},2500),window.dispatchEvent(new CustomEvent("inews:post-word-depth:ready"))}})}]),n.dn(()=>{}),window.addEventListener("hulk:ready",()=>{const e=e=>{const t=e?.permission??"";return"default"===t?"closed":t};window.hulkInstance.on("notification_click",t=>{i("push_notification",{event_type:"click",event_details:e(t),event_label:t?.campaignId??""})}),window.hulkInstance.on("prompt_click",t=>{i("push_notification",{event_type:"prompt_click",event_details:e(t),event_label:t?.campaignId??""})}),window.hulkInstance.on("prompt_impression",t=>{i("push_notification",{event_type:"prompt_impression",event_details:e(t),event_label:t?.campaignId??""})})}),n.dn(()=>{}),window.addEventListener("message",e=>
1{if("puzzles track event"!==e.data?.msg)return;const t=document.getElementById("puzzle-iframe");if(!t)return;let n;try{const e=new URL(t.src);if("https:"!==e.protocol)return;n=e.origin}catch(e){return}if(!e.origin||e.origin!==n)return;if(e.source!==t.contentWindow)return;const{eventName:o,eventData:s={}}=e.data,a=t.dataset.puzzleSlug||"not-set",r=t.dataset.puzzleDate||"not-set",c=t.dataset.puzzleId||"not-set";"puzzle_play"===o&&i("puzzle",{event_object_text:"start",event_object_name:a,date_of_puzzle:r,puzzle_ID:c}),"puzzle_complete"===o&&i("puzzle",{event_object_text:"complete",event_object_name:a,date_of_puzzle:r,event_value:s.event_value||0,puzzle_ID:c})},!1);const _=()=>{(()=>{const e=document.getElementById("puzzle-iframe");if(!e||"1"===e.dataset.isToday)return;const t=e.dataset.puzzleDate||"not-set",n=e.dataset.category||"not-set",o=e.dataset.puzzleSlug||"not-set";let s=null;if("not-set"!==t){const e=864e5,[n,o,i]=(new Date).toLocaleDateString("en-GB",{timeZone:"Europe/London",day:"2-digit",month:"2-digit",year:"numeric"}).split("/"),a=`${i}-${o}-${n}`,r=Math.floor(Date.parse(t)/e),c=Math.floor(Date.parse(a)/e);s=String(r-c)}i("puzzles_category_archive_play",{event_object_position:s?`today_${s}`:"not-set",event_object_name:n,event_object_text:o})})(),(()=>{const e=document.getElementById("puzzle-iframe"),t=document.getElementById("puzzle-modal"),n=document.body.classList.contains("inews-puzzles-landing"),o=e?.dataset.category||"not-set",s=t?.dataset.puzzleName||"not-set";if(e&&"shared_link"===new URLSearchParams(window.location.search).get("source")){i("puzzle_shared_link_click",{puzzle_name:s,source:"shared_link",timestamp:(new Date).toISOString()});const e=new URL(window.location.href);e.searchParams.delete("source"),window.history.replaceState(window.history.state,"",e.toString())}n&&document.querySelectorAll(".wp-block-inews-date-nav .puzzles-date-nav__item").forEach(e=>{const t=e.dataset.dayOffset;if(!t||"0"===t)return;const n=e.querySelector("a");n&&n.addEventListener("click",()=>{i("puzzles_category_archive",{event_object_position:`today_${t}`,event_object_name:"not-set"})})}),t?.querySelectorAll(".subscribe-button").forEach(e=>{e.addEventListener("click",()=>{i("puzzle_popup_click",{event_object_text:"subscribe",event_object_name:"not-set",type_of_puzzle:"not-set"})})}),t?.querySelectorAll(".puzzles-date-nav__item").forEach(e=>{const t=e.querySelector(".puzzles-date-nav__link");t&&t.addEventListener("click",()=>{i("puzzle_popup_click",{event_object_text:"play_now",event_object_name:s,type_of_puzzle:o,publish_date:e.dataset.date||"not-set"})})}),t?.querySelectorAll("[data-puzzle-share]").forEach(e=>{e.addEventListener("click",()=>{const e=Number(t.dataset.completionSeconds)||0;i("puzzle_share_results",{puzzle_name:s,puzzle_type:o,completion_time:`${e}s`,timestamp:(new Date).toISOString()})})}),window.addEventListener("puzzle:share:outcome",e=>{const n=Number(t?.dataset.completionSeconds)||0;i("puzzle_share_results_outcome",{puzzle_name:s,puzzle_type:o,completion_time:`${n}s`,outcome:e.detail?.outcome||"not-set",timestamp:(new Date).toISOString()})}),t?.querySelectorAll(".see-all-puzzles-button").forEach(e=>{e.addEventListener("click",()=>{i("puzzle_popup_click",{event_object_text:"todays_puzzles",event_object_name:s,type_of_puzzle:"not-set"})})});const a=[];document.querySelectorAll('[class*="puzzle-block-"], .most-popular > .puzzles').forEach(e=>{const t=Array.from(e.classList).find(e=>e.includes("puzzle-block-")||e.includes("puzzles")),n=a.find(e=>e.identifier===t),o=e.querySelectorAll(".wp-block-inews-puzzler-puzzle");if(n)n.puzzles.push(...Array.from(o));else{let n=null,i=e.previousElementSibling||e.parentElement;for(;i;){if(i.classList&&i.classList.contains("puzzle-section-header")||"H2"===i.tagName){n=i;break}i=i.previousElementSibling}n&&a.push({identifier:t,sectionTitle:n?.textContent,puzzles:Array.from(o)})}}),a.forEach(e=>{e.puzzles.forEach((t,n)=>{t.querySelectorAll("a").forEach(t=>{t.addEventListener("click",()=>{localStorage.setItem("postSection_title",e.sectionTitle),localStorage.setItem("postSection_index",n+1)})})})})})()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",_):_(),n.dn(()=>{}),window.addEventListener("ga4:ready",()=>{const e=document.querySelector(".header__top__right .subscribe-button a.subs-subscribe");e&&e.addEventListener("click",()=>{const t=e.textContent.trim().toLowerCase()||"subscribe";i("banner",{event_action:"click",event_object_text:t,event_object_name:"mobile_view_subscription_banner"})})}),window.tp=window.tp||[];const u=e=>{try{return localStorage.getItem(e)}catch(e){return null}},p=()=>{const e={premiumCount:"not set",premiumLimit:"not set"},t=u("interaction_depth");if(null!==t){const[,,n,o]=t.slice(1,-1).split("/");void 0!==n&&(e.premiumCount=n),void 0!==o&&(e.premiumLimit=o)}return e};window.tp.push(["addHandler","customEvent",e=>{const{eventName:t}=e;["start_puzzling","browse_newsletter","saved_articles"].includes(t)&&i("button_click",{event_object_name:"registration_flow",event_object_text:t}),["purchase_start_puzzling","purchase_enjoy_newsletters","purchase_saved_articles"].includes(t)&&i("button_click",{event_object_name:"subscription_flow",event_object_text:{purchase_start_puzzling:"start_puzzling",purchase_enjoy_newsletters:"browse_newsletter",purchase_saved_articles:"saved_articles"}[t]||""}),"forgotPasswordLink"===t&&i("loginFail",{event_category:"loginFail",event_label:"forgot password"});const n={reg_onboarding_app_store:"Apple_App_Store",reg_onboarding_close:"Close",reg_onboarding_get_app:"Get_app",reg_onboarding_google_store:"Google_Play_Store",reg_onboarding_start_reading_CTA:"start_reading_now_CTA"};if(Object.hasOwn(n,t)&&i("registration_onboarding_overlay",{event_action:"click",event_object_name:n[t],event_object_type:"button"}),"banner"===t){const t={event_action:e.params?.event_action,event_object_type:e.params?.event_object_type,event_type:"article subscription banner"};e.params?.event_object_name&&(t.event_object_name=e.params.event_object_name),e.params?.event_object_text&&(t.event_object_text=e.params.event_object_text),gtag("event","banner",t)}
1const o={article_counter_banner_expanded:"collapsed banner",article_counter_banner_collapsed:"expanded banner",article_counter_banner_CTA:"button"};if(Object.hasOwn(o,t)){const{premiumCount:n,premiumLimit:s}=p(),a={event_action:"click",event_details:`[${n}/${s}]`,event_object_type:o[t],event_type:"article counter"};i("banner","article_counter_banner_CTA"===t?{...a,event_object_name:"subscribe now",event_object_text:e.params?.textCTA}:a)}}]),tp.push(["addHandler","loginSuccess",e=>{const t={MSQA:"microsoft_id",GOOGLE:"google_id",APPLE:"apple_id",FACEBOOK:"facebook_id"}[e.params?.ls]||"email";i("login",{event_category:"NTG account",event_label:"success",non_interaction:!1,social_platform:t})}]),tp.push(["addHandler","loginFailed",()=>{i("loginFail",{event_category:"loginFail",event_label:"wrong credentials"})}]),window.addEventListener("message",e=>{let t=e.data;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){return}if(t&&"object"==typeof t&&t.event&&("OneTapUserAuthSuccess"===t?.event&&(i("loginSuccess",{event_category:"NTG account",event_label:"success",non_interaction:!1,social_platform:"google_one_tap"}),i("login",{event_category:"NTG account",event_label:"success",non_interaction:!1,social_platform:"google_one_tap"})),"emitGAEvent"===t?.event&&"showTemplate"===t?.params?.eventCategory)){const e="inews.co.uk"===window.location.hostname?"OT3AMKSPN5XR":"OTCJ5L6W50HT";t?.params?.templateId===e&&i("registration_onboarding_overlay",{event_action:"impression"});const n="inews.co.uk"===window.location.hostname?"OTSL4BHOVUSQ":"OTJURN8ZGIFY";if(t?.params?.templateId===n){const{premiumCount:e,premiumLimit:t}=p();i("banner",{event_action:"impression",event_details:`[${e}/${t}]`,event_object_type:"collapsed banner",event_type:"article counter"})}}}),document.querySelectorAll(".i__header__account_register").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),i("header click",{event_category:"button_header",event_label:"subscribe"}),window.location.href=e.currentTarget.href})),document.querySelectorAll(".i__header__account_login").forEach(e=>e.addEventListener("click",e=>{e.preventDefault(),i("header click",{event_category:"button_header",event_label:"log in"}),window.tp?.pianoId?.show()})),window.tp.push(["addHandler","checkoutComplete",e=>{const{rid:t,termConversionId:n,chargeAmount:o,promotionId:s,termId:a}=e;"registration"===e?.type&&i("success",{event_category:"new_registration"}),window.tp.user?.isUserValid()&&(window.adverts?.config?.piano?.rid?.includes(t)||window.adverts?.config?.piano?.ridLite?.includes(t))&&window.tp.api.callApi("/conversion/list",{},e=>{const r=u("interaction_depth"),c=window?.adverts?.config?.piano?.ridLite?.includes(t)&&!window?.adverts?.config?.piano?.rid?.includes(t),l=c?"3":"2",d=c?"lite_subscription":"digital_subscription",_=e?.conversions.find(e=>{const t=c?window?.adverts?.config?.piano?.ridLite:window.adverts?.config?.piano?.rid;return t?.includes(e?.term?.resource?.rid)}),p=["1 - registered_user"],m=_?.user_access?.start_date?new Date(1e3*_.user_access.start_date):null,w=_?.user_access?.expire_date?new Date(1e3*_.user_access.expire_date):null,v=m?`${l} - ${m.toISOString().split("T")[0]}`:void 0,g=w?`${l} - ${w.toISOString().split("T")[0]}`:void 0,b=m&&w?(w-m)/864e5>32?"annual":"monthly":void 0;g&&p.push(`${l} - ${d}`);const h={account_user_id:_?.user_access?.user?.uid,logged_in_status:"loggedIn",subscription_latest_expiration_date:g,subscription_latest_start_date:v,subscription_package_type:b?`${l} - ${b}`:`${l} - Never`,user_login_details:p.join(",")},y={transaction_id:n,value:o,affiliation:"subscription page",currency:"GBP",coupon:s,items:[{id:a,name:_?.term?.name,category:b,variant:"digital",quantity:1,price:o}]};i("purchase",{...h,...y,interaction_depth:r}),i("submit",{event_category:"NTG subscription",event_label:"success",non_interaction:!1,...h}),i(b,{event_category:"new subscription",event_label:"digital"}),i("new_subscription",{transaction_id:n,subscription_length:b,price:o,...h,interaction_depth:r}),window.uetq&&window.uetq.push("event","digital",{event_label:"subscribe",event_value:1,event_category:b,revenue_value:o,currency:"GBP"}),"function"==typeof fbq&&fbq("track","Purchase",{value:o,currency:"GBP"}),"function"==typeof window?.rdt&&window?.rdt("track","Purchase",{value:o,currency:"GBP",transactionId:n,itemCount:1,product_type:"subscription",coupon:s})})}]),tp.push(["addHandler","registrationSuccess",e=>{const t={MSQA:"microsoft_id",GOOGLE:"google_id",APPLE:"apple_id",FACEBOOK:"facebook_id"}[e.user?.ls]||"email",n=u("freemium_count"),o=null!==n?`[${n}/0]`:null,s=u("regPosition");i("registration",{event_category:"NTG account",event_label:"success",non_interaction:!1,social_platform:t,interaction_depth:o,event_object_position:null!==s?s:null}),"function"==typeof window?.rdt&&window?.rdt("track","SignUp",{method:e?.user?.passwordType||"passwordless",provider:"Piano"})}]),n.dn(()=>{}),window.tp=window.tp||[];let m=null,w=!1;function v(e){if(!e)return null;const t=[/(?:youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/,/(?:youtube\.com\/watch\?v=)([a-zA-Z0-9_-]{11})/,/(?:youtu\.be\/)([a-zA-Z0-9_-]{11})/].map(t=>e.match(t)).find(Boolean);return t?.[1]||null}function g(e,t){const n=Array.from(t.querySelectorAll(".inews__post-videocarousel")).indexOf(e)+1;return{title:e.querySelector(".inews__post__content-headline h2")?.textContent?.trim()||"",category:e.querySelector(".inews__post__badge-category .category-name")?.textContent?.trim()||"",duration:e.querySelector(".inews__post__duration")?.textContent?.trim()||"",embedUrl:e.getAttribute("data-embed-url")||"",youtubeId:v(e.getAttribute("data-embed-url")||""),position:n}}function b(e){const t=e.target.closest(".inews__post-videocarousel");if(!t||"BUTTON"!==t.tagName)return;const n=t.closest("[data-carousel-body]");if(!n)return;const o=g(t,n),s={event_action:"landing",event_object_text:o.title,event_details:o.category,unit_position:o.position,video_duration:o.duration};o.youtubeId&&(s.event_label=o.youtubeId),i("video_carousel",s)}function h(e){const{lightboxWrapper:t,videoButton:n}=e.detail||{};if(!t||!n)return;const o=n.closest("[data-carousel-body]");if(!o)return;const s=g(n,o),a={event_action:"click",event_object_name:"close",event_object_type:"button",event_object_text:s.title,event_details:s.
1category,unit_position:s.position,video_duration:s.duration};s.youtubeId&&(a.event_label=s.youtubeId),i("video_carousel",a)}function y(){const e=document.querySelectorAll('.inews__post-section[data-type="VideoCarousel"]');if(0===e.length)return;const t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&!e.target.dataset.impressionTracked&&(i("video_carousel",{event_action:"impression"}),e.target.dataset.impressionTracked="true",t.unobserve(e.target))})},{threshold:.5});Array.from(e).forEach(e=>t.observe(e)),document.addEventListener("click",b),document.addEventListener("inewsVideoCarouselClose",h)}window.addEventListener("message",e=>{let t;try{t=JSON.parse(e.data)}catch(e){return}window.location.pathname.includes("/my-account/settings")&&t?.event&&("emitGAEvent"!==t.event||"showTemplate"!==t.params?.eventCategory||w||(i("cancel/save_journey",{event_type:"sorry to see you go",event_action:"cancellation_start"}),w=!0,localStorage.removeItem("subscription_cancellation")),"change"===t.event&&"Reason"===t.params?.[0]&&Array.isArray(t.params?.[1])&&t.params[1][0]&&(m=t.params[1][0]))}),window.tp.push(["addHandler","customEvent",e=>{const{eventName:t}=e;if("acp-next-step"===t&&(i("cancel/save_journey",{event_type:"sorry to see you go",event_action:"cancel",event_object_text:"[Name], weâre sorry to see you go"}),i("cancel/save_journey",{event_type:"cancellation reasons",event_action:"cancellation_start"})),"acp-retain-subscription"===t&&(i("cancel/save_journey",{event_type:"sorry to see you go",event_action:"stay",event_object_text:"[Name], weâre sorry to see you go"}),i("cancel/save_journey",{event_type:"sorry to see you go",event_action:"sub retained",event_details:"screen impression"})),"acp-form-next-step"===t){const e={event_type:"cancellation reasons",event_action:"cancel",event_object_text:"Could you tell us why youâd like to cancel your subscription?"};m&&(e.event_label=m),i("cancel/save_journey",e),i("cancel/save_journey",{event_type:"change mind",event_action:"cancellation_start"})}"acp-form-retain-subscription"===t&&(i("cancel/save_journey",{event_type:"cancellation reasons",event_action:"stay",event_object_text:"Could you tell us why youâd like to cancel your subscription?"}),i("cancel/save_journey",{event_type:"cancellation reasons",event_action:"sub retained",event_details:"screen impression"})),"acp-cancel-subscription"===t&&(i("cancel/save_journey",{event_type:"change mind",event_action:"cancel",event_object_text:"Can we change your mind?"}),i("cancel/save_journey",{event_type:"weâre sorry youâve left",event_action:"sub cancelled",event_details:"screen impression"}),localStorage.setItem("subscription_cancellation",!0)),"offer-subscribe-0"===t&&i("cancel/save_journey",{event_type:"change mind",event_action:"stay",event_object_text:"Can we change your mind?",event_details:"downgrade offer"}),"acp-resubscribe"===t&&i("cancel/save_journey",{event_type:"weâre sorry youâve left",event_action:"sub cancelled",event_object_text:"Weâre sorry to see you go, [Name]",event_details:"resubscribe"}),"acp-new-subscription"===t&&(i("cancel/save_journey",{event_type:"change mind",event_action:"stay",event_object_text:"Review and confirm changes to your subscription",event_details:"review and confirm"}),i("cancel/save_journey",{event_type:"change mind",event_action:"sub retained",event_details:"screen impression"})),"back-to-the-news"===t&&(localStorage.getItem("subscription_cancellation")?(i("cancel/save_journey",{event_type:"weâre sorry youâve left",event_action:"sub cancelled",event_object_text:"Weâre sorry to see you go, [Name]",event_details:"back to site"}),localStorage.removeItem("subscription_cancellation")):i("cancel/save_journey",{event_type:"sorry to see you go",event_action:"sub cancelled",event_object_text:"Thank you for staying with us [Name]",event_details:"back to site"}))}]),window.addEventListener("ga4:ready",()=>{const e=document.querySelector("#header__navigation__primary"),t=document.querySelector("#header__navigation__secondary"),n=e=>{e&&e.addEventListener("click",t=>{const n=t.target.closest("a");if(!n||!e.contains(n))return;const o=(e=>{const t=e.closest(".menu-item"),n=(e=>{let t=e.closest(".menu-item");for(;t&&t.parentElement&&!t.parentElement.classList.contains("menu");)t=t.parentElement.closest(".menu-item");return t})(e);let o="not_set",i="not_set";if(n){let s=null;if("function"==typeof n.querySelector&&(s=n.querySelector(":scope > a")||null),!s)for(let e=0;e<n.children.length;e++)if("A"===n.children[e].tagName){s=n.children[e];break}o=s?s.textContent.trim():"not_set",i=t!==n?e.textContent.trim():"not_set"}return{eventCategory:o,eventLabel:i}})(n);i("site_topbar_navigation",{event_category:o.eventCategory,event_label:o.eventLabel})})};n(e),n(t)}),n.dn(()=>{}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",y):y();const f=[{widgetIdentifier:'.inews__post-section[data-type="MostPopular"], .inews__widget__posts_most-popular',itemIdentifier:".inews__post",elementIdentifiers:["h2 a",".inews__post__badge-category a",".inews__post__media a"],widgetName:"most_popular"},{widgetIdentifier:".inews__widget__posts_editors-pick",itemIdentifier:".inews__widget__posts__list .inews__post",elementIdentifiers:["h2 a",".inews__post__badge-category a",".inews__post__media a"],widgetName:"editors_picks"},{widgetIdentifier:".inews__widget__posts_best-of-opinion",itemIdentifier:".inews__post",elementIdentifiers:["h2 a",".inews__post__badge-category a",".inews__post__media a"],widgetName:"best_of_opinion"},{widgetIdentifier:".most-read-by-subscribers",itemIdentifier:".most-read-by-subscribers__posts .inews__post",elementIdentifiers:["h2 a",".inews__post__badge-category a",".inews__post__media a"],widgetName:"most_read_by_subscribers"},{widgetIdentifier:".author-posts-widget",itemIdentifier:".inews__post",elementIdentifiers:["h2 a",".inews__post__badge-category a"],widgetName:"more_from_this_author"},{widgetIdentifier:'.inews-recirculation-widgets .inews__post-section[data-type="PostSection4xSmall"]',itemIdentifier:".inews__post",elementIdentifiers:[".inews__post__content-headline a",".inews__post__badge-category a",".inews__post__media a"],widgetName:"read_more_about"},{widgetIdentifier:".entry-content",addEventForItem:!0,itemIdentifier:".post_in-line_link",widgetName:"in-line_link"},{widgetIdentifier:".entry-content",addEventForItem:!0,itemIdentifier:".post_link_related-stories",widgetName:"related_stories"},{widgetIdentifier:".entry-content .inews__perspectives",addEventForItem:!0,itemIdentifier:".perspective__item",elementIdentifiers:[".perspective__media a, .perspective__item--author a, .perspective__item--headline a"],widgetName:"perspectives_in-article"},{widgetIdentifier:".perspective-header",itemIdentifier:".perspective-header__item",elementIdentifiers:[".perspective-header__link"],widgetName:"perspectives_in-article"}],S=(e,t,n)=>{if("true"===e.dataset.gaBound)return;e.dataset.gaBound="true";const{widgetName:o}=n;let i="not set";if(e.matches(".inews__post__badge-category a")){const t=e.getAttribute("href")||"";try{i=new URL(t,window.location.origin).pathname.split("/").filter(
1Boolean).pop()||"not set"}catch(e){i="not set"}}window.iNews.GA4.addGAClickListenerWithPosition(e,t,o,i)},E=e=>{if(!e||!e.widgetIdentifier)return;const{widgetIdentifier:t,itemIdentifier:n,elementIdentifiers:o,addEventForItem:i}=e;document.querySelectorAll(t).forEach(t=>{t.querySelectorAll(n).forEach((t,n)=>{if(i&&S(t,n,e),o){const i=Array.isArray(o)?o.join(","):o.toString();t.querySelectorAll(i).forEach(t=>{S(t,n,e)})}})})};function k(e){const t=function(){if(!window.vwoCampaigns?.length)return;const e=window.vwoCampaigns.filter(e=>e.startsWith("Shorts Placement "));return e.length?e.join(","):void 0}();t&&(e.vwo_campaigns=t)}function L(){document.addEventListener("shorts-carousel-nav",()=>{!function(){const e={event_category:"carousel",event_action:"click",event_object_type:"arrow"};k(e),i("article_shorts",e)}()}),document.addEventListener("shorts-card-view",e=>{if(!e?.detail)return;const{isLanding:t,previousShortId:n,cardIndex:o,totalCards:s,shortTitle:a,shortId:r,unitPosition:c,shortsSeen:l,totalShorts:d,publishDate:_}=e.detail;!function(e){if(!e)return;const{isLanding:t,previousShortId:n,cardIndex:o,totalCards:s,shortTitle:a,shortId:r,unitPosition:c,shortsSeen:l,totalShorts:d,publishDate:_}=e;let u;var p;u=t?"true"===new URLSearchParams(window.location.search).get("share_story")?"shared_landing":"landing":n&&n!==r?"switch":"manualAdvance";const m={event_action:u,event_category:"extended_view",event_label:o===s-1?"last_card":(["first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth"][(p=o+1)-1]||p)+"_card",event_object_position:o+1,event_object_text:a,event_object_type:"short_card",interaction_depth:`${l}/${d}`,unit_position:c};_&&(m.short_publish=_),k(m),i("article_shorts",m)}({isLanding:t,previousShortId:n,cardIndex:o,totalCards:s,shortTitle:a,shortId:r,unitPosition:c,shortsSeen:l,totalShorts:d,publishDate:_})}),document.addEventListener("shorts-exit",e=>{e?.detail?.lastEventObject&&function(e){if(!e||!Object.keys(e).length)return;const t={...e,event_action:"exit"};k(t),i("article_shorts",t)}(e.detail.lastEventObject)}),document.addEventListener("shorts-share",e=>{e?.detail?.lastEventObject&&function(e){if(!e||!Object.keys(e).length)return;const t={...e,event_action:"shared"};k(t),i("article_shorts",t)}(e.detail.lastEventObject)})}window.addEventListener("inews:post-word-depth:ready",()=>{f.forEach(E)}),window.addEventListener("ga4:ready",()=>{window.addEventListener("for_you",e=>{const{event_object_name:t,event_object_text:n,target_url:o,unit_position:s}=e?.detail||{};t&&n&&o&&void 0!==s&&i("widget_click",{event_object_name:t,event_object_text:n,target_url:o,unit_position:s,event_type:"not set"})})}),n.dn(()=>{}),"loading"===document.readyState?document.addEventListener("DOMContentLoaded",L):L(),window.tp=window.tp||[],window.iNews=window.iNews||{},window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)};const z=document.createElement("script");z.src=`https://www.googletagmanager.com/gtag/js?id=${e}`,z.async=!0,document.head.appendChild(z),gtag("js",new Date),gtag("consent","default",{ad_storage:"denied",ad_user_data:"denied",ad_personalization:"denied",analytics_storage:"denied",personalization_storage:"denied",wait_for_update:1e3});const I=Object.assign({},window.customDimensions||{},{user_login_details:"not set",send_page_view:!1});gtag("config",e,I);class j{constructor(){this.GA4ID=e,window.customDimensions=window.customDimensions||{},this.customDimensions=window.customDimensions}setCustomDimensions=async function(e){this.customDimensions=Object.assign(this.customDimensions,e),this.customDimensions.user_properties={user_clientId:this.customDimensions.clientId,user_account_user_id:window.iNews?.Subscriber?.uid};let t=new URLSearchParams(document.location.search).get("ico");const n=t?.match(/[^a-zA-Z0-9_-]+/g);t=n?t.split(n)[0]:t,this.customDimensions.ico_internal_campaigns=t||"undefined",this.customDimensions.referring_url=""!==document.referrer?document.referrer.split("?")[0]:"undefined";const o=localStorage.getItem("postSection_title"),i=localStorage.getItem("postSection_index");null!==o&&null!==i&&(this.customDimensions.section_name=o,this.customDimensions.unit_position=i,localStorage.removeItem("postSection_title"),localStorage.removeItem("postSection_index"));const s=localStorage.getItem("event_label");null!==s&&(this.customDimensions.event_label=s,localStorage.removeItem("event_label")),this.customDimensions.push_notification_status=this.getPushNotificationStatus(),this.setSubscriberDimensions(),Object.entries(this.customDimensions).forEac
1h(e=>{let[t,n]=e;void 0!==n&&null!=n&&0!==n.length&&"undefined"!=n&&""!==n&&(n=n?n.toString():"",""!=n&>ag("set",t,n))}),window.customDimensions=this.customDimensions};getPushNotificationStatus=function(){let e="not_supported";if("PushManager"in window&&"Notification"in window)switch(window.Notification.permission){case"default":e="eligible";break;case"denied":e="denied";break;case"granted":e="subscribed";break;default:e="not_supported"}return e};setSubscriberDimensions=function(){if(this.customDimensions.logged_in_status="not set",this.customDimensions.user_login_details="not set",this.customDimensions.account_user_id="not set",tp.pianoId.isUserValid()){this.customDimensions.logged_in_status="loggedIn",this.customDimensions.account_user_id=window.iNews?.Subscriber?.uid,this.customDimensions.google_one_tap_registrant="not set",window.iNews?.Subscriber?.conversions.forEach(e=>{["TM26TWK1C5CN","TMTARH7LN9MT"].includes(e.term.term_id)&&(this.customDimensions.google_one_tap_registrant="present")});const e=[];e.push("1 - registered_user"),window.iNews?.Subscriber?.isSubscribedLite&&(e.push("3 - lite_subscription"),this.customDimensions.subscription_latest_expiration_date="3 - Never",window.iNews?.Subscriber?.entitlements.forEach(e=>{if(!window.adverts.config.piano?.ridLite?.includes(e.resource.rid))return;let t,n;e.start_date&&(t=new Date(1e3*e.start_date),this.customDimensions.subscription_latest_start_date=`3 - ${t.toISOString().split("T")[0]}`),e.expire_date&&(n=new Date(1e3*e.expire_date),this.customDimensions.subscription_latest_expiration_date=`3 - ${n.toISOString().split("T")[0]}`);let o="annual";if(void 0!==n&&void 0!==t){const e=n.getTime()-t.getTime();o=Math.round(e/864e5)>32?"annual":"monthly"}this.customDimensions.subscription_package_type=`3 - ${o}`})),window.iNews?.Subscriber?.isSubscribed&&(e.push("2 - digital_subscription"),this.customDimensions.subscription_latest_expiration_date="2 - Never",window.iNews?.Subscriber?.entitlements.forEach(e=>{if(!window.adverts.config.piano.rid.includes(e.resource.rid))return;let t,n;e.start_date&&(t=new Date(1e3*e.start_date),this.customDimensions.subscription_latest_start_date=`2 - ${t.toISOString().split("T")[0]}`),e.expire_date&&(n=new Date(1e3*e.expire_date),this.customDimensions.subscription_latest_expiration_date=`2 - ${n.toISOString().split("T")[0]}`);let o="annual";if(void 0!==n&&void 0!==t){const e=n.getTime()-t.getTime();o=Math.round(e/864e5)>32?"annual":"monthly"}this.customDimensions.subscription_package_type=`2 - ${o}`})),this.customDimensions.user_login_details=e.join(",")}};addGAClickListenerWithPosition=function(e,t=null,n,o="not set"){e.addEventListener("click",s=>{const a=s.currentTarget,r=new URL(a.href);if(r.searchParams.delete("ico"),r&&r.length<1)return;let c=t;null===t&&(c=Array.prototype.slice.call(a.parentElement.children).indexOf(a));const l=e.closest(".inews__post");let d=l?l.querySelector("h2")?.textContent:"";if(null==l&&"above_article_ticker"===n){const t=e?e.querySelector("span"):null;t&&(d=t.textContent)}const _={event_object_name:n,target_url:r,unit_position:c+1,event_type:o};if(!["in-line_link","related_stories","read_more","perspectives_in-article"].includes(n)){const t=e.closest(".inews__post-section"),o=t?.querySelector(".inews__post-section h2")?.textContent;_.event_object_name=o?.trim()||n}if("in-line_link"===n&&(_.event_object_text=e.textContent),"perspectives_in-article"===n){d=(e.closest(".inews__perspectives")?.querySelector(".inews__perspective-description")?.textContent??e.closest(".inews__perspectives")?.attributes["data-name"]?.value)||d;const t=e.closest(".perspective__item"),n=Array.from(t?.parentElement?.children)?.indexOf(t);n>=0&&(_.unit_position=n+1)}window.UA_clientId&&(_.clientId=window.UA_clientId),d&&(_.event_object_text=d?.trim()),i("widget_click",_)})}}window.addEventListener("iNews:Subscriber:checked",async()=>{window.iNews.GA4||(window.iNews.GA4=new j),gtag("consent","update",{analytics_storage:"granted"}),gtag("get",window.iNews.GA4.GA4ID,"client_id",async n=>{await window.iNews.GA4.setCustomDimensions({clientId:n}
1),gtag("config",e,{...window.customDimensions,send_page_view:!1}),window.iNews.ga4Ready||(window.iNews.ga4Ready=!0,t?.(),window.dispatchEvent(new CustomEvent("ga4:ready",{}))),i("page_view",window.customDimensions)})})})()})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.