document.addEventListener("DOMContentLoaded",function(){const e=document.querySelector(".wp-block-carhop-blocks-story-timeline");if(!e)return;const t=new IntersectionObserver(e=>{e.forEach(e=>{const t=e.target.getAttribute("id"),r=document.querySelector(`a[href="#${t}"]`);e.isIntersecting&&(document.querySelectorAll('.story-timeline__years .story-timeline__year[data-active="true"]').forEach(e=>{e.setAttribute("data-active","false")}),e.target.setAttribute("active","true"),r?.parentElement?.setAttribute("data-active","true"))})},{rootMargin:"-10% 0px -50% 0px"});document.querySelectorAll(".story-timeline__innerblocks .wp-block-carhop-blocks-story-timeline-step").forEach(e=>{t.observe(e)}),e.querySelectorAll(".story-timeline__year").forEach((e,t)=>{e.setAttribute("data-active",0===t?"true":"false")})});