!function(){"use strict";var e=function(e){"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",e,{once:!0}):e()};window.requestAnimationFrame;var t;function n({elem:e,container:t,inner:n}){if(e&&t)if(e.scrollWidth>e.clientWidth){const s=Math.round(n.getBoundingClientRect().left),o=Math.round(e.getBoundingClientRect().left),i=Math.round(n.getBoundingClientRect().right),a=Math.round(e.getBoundingClientRect().right);t.classList.add("scroll-active"),sa?t.classList.add("scroll-active--right"):t.classList.remove("scroll-active--right")}else t.classList.remove("scroll-active"),t.classList.remove("scroll-active--left"),t.classList.remove("scroll-active--right")}function s({elem:e,container:t,inner:s}){let o;o&&window.clearTimeout(o),o=window.setTimeout((()=>{n({elem:e,container:t,inner:s})}),50)}!function(e){e.NYPostPageSix="NYPostPageSix",e.NYPostBusinessUnit="NYPostBusinessUnit",e.TheSun="TheSun",e.NewsUK="NewsUK"}(t||(t={})),t.NYPostPageSix,t.NYPostBusinessUnit,t.TheSun,t.NewsUK,function(t){const{component:n,load:s,name:o,querySelector:i={},querySelectorAll:a={},options:r={}}=t;if("function"!=typeof n)return;const l=()=>{(()=>{const e=void 0===o?null==t?void 0:t.root:`[data-component='${o}']`;let n;try{n=document.querySelectorAll(e)}catch(e){return console.error(e),[]}return n.length<1?(console.log(`No elements found for ${e}`),[]):Array.from(n).map((e=>{const t={};return Object.keys(i).forEach((n=>{t[n]=e.querySelector(i[n])})),Object.keys(a).forEach((n=>{const s=e.querySelectorAll(a[n]);t[n]=Array.from(s)})),{element:e,children:t,options:r}}))})().forEach((e=>new n(e)))};if(!1===s)return l;!0!==s?function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;if(t)if("function"==typeof n)n(t);else if(Array.isArray(n)){const[e,s]=n;null==e||e.addEventListener(s,t)}}(l,s):l()}({name:"sectionSubNav",component:class{constructor({element:e,children:t,options:o}){if(this.element=e,this.children=t,this.options=o,this.html=document.querySelector("html"),this.page=document.getElementById("page"),!this.html)return;this.toggleSubNav=this.toggleSubNav.bind(this),this.closeSubNavPageClick=this.closeSubNavPageClick.bind(this),this.closeSubNavTabbingPast=this.closeSubNavTabbingPast.bind(this);const{subNav:i,subNavToggle:a,subNavDropdown:r,subNavLinks:l,tertiaryItems:c,innerWrapper:u,horizontalMenu:d,currentMenuItem:v}=this.children,h=l[l.length-1];var b;this.lastNavLink=h,b=()=>{v&&v.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},"complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",b,{once:!0}):b(),a&&c.length>0?(a.addEventListener("click",this.toggleSubNav),i.classList.add("dropdown-active")):(null==a||a.remove(),null==r||r.remove()),u&&i&&d&&(n({elem:u,container:i,inner:d}),window.addEventListener("resize",(()=>s({elem:u,container:i,inner:d}))),u.addEventListener("scroll",(()=>s({elem:u,container:i,inner:d})),{passive:!0}))}openSubNav(){const{children:{subNavToggle:e,subNavDropdown:t},options:{htmlOpenClass:n},html:s,page:o,lastNavLink:i}=this;e.setAttribute("aria-expanded","true"),t.setAttribute("aria-hidden","false"),s.classList.add(n),o&&o.addEventListener("click",this.closeSubNavPageClick),i&&i.addEventListener("keydown",this.closeSubNavTabbingPast)}closeSubNav(){const{children:{subNavToggle:e,subNavDropdown:t},options:{htmlOpenClass:n},html:s,page:o,lastNavLink:i}=this;e.setAttribute("aria-expanded","false"),t.setAttribute("aria-hidden","true"),s.classList.remove(n),o&&o.removeEventListener("click",this.closeSubNavPageClick),i&&i.removeEventListener("keydown",this.closeSubNavTabbingPast)}toggleSubNav(){const{subNavToggle:e,subNavDropdown:t}=this.children;t&&("false"===e.getAttribute("aria-expanded")?this.openSubNav():this.closeSubNav())}closeSubNavPageClick(e){e.target&&"page"===e.target.id&&this.closeSubNav()}closeSubNavTabbingPast(e){9!==e.keyCode||e.shiftKey||this.closeSubNav()}},querySelector:{subNav:".section-subnav",subNavToggle:"[data-subnav-toggle]",subNavDropdown:"[data-subnav-dropdown]",innerWrapper:".section-subnav__inner-wrapper",horizontalMenu:".section-subnav__menu--horizontal",currentMenuItem:".section-subnav__menu--horizontal .current-menu-item"},querySelectorAll:{subNavLinks:"[data-subnav-dropdown] .section-subnav__menu--dropdown > li > a",tertiaryItems:".section-subnav__menu--horizontal .tertiary-item"},options:{htmlOpenClass:"no-scroll"}})}();