https://www.bushnellgolf.com/cdn/shop/t/133/assets/bushnell-produc…?v=140227876107109665501790611765
1function openAccordionItem(item){if(!(!item||item.classList.contains("is-open"))){item.classList.add("is-open");var btn=item.querySelector(".bushnell-acc__trigger");btn&&btn.setAttribute("aria-expanded","true")}}function resolveTarget(link){const sel=link.dataset.scroll;if(sel)return document.querySelector(sel);try{const hash=new URL(link.href,location.href).hash;if(!hash)return null;const exact=document.querySelector(hash);if(exact)return exact;const suffixMatch=hash.match(/__([^#]+)$/);return suffixMatch?document.querySelector('[id$="__'+suffixMatch[1]+'"]'):null}catch{return null}}class BushnellProductNav{constructor(nav){if(this.nav=nav,this.links=[...nav.querySelectorAll(".bushnell-pnav__link")],this.anchors=this.links.map(link=>resolveTarget(link)).filter(el=>el!==null),this.anchors.length&&(this.observer=new IntersectionObserver(this.onIntersect.bind(this),{rootMargin:"-20% 0px -60% 0px"}),this.anchors.forEach(el=>this.observer&&this.observer.observe(el))),this.links.forEach(link=>{link.addEventListener("click",e=>{const target=resolveTarget(link);if(!target)return;e.preventDefault();const navH=this.nav.offsetHeight,top=target.getBoundingClientRect().top+scrollY-navH-8;window.scrollTo({top,behavior:"smooth"}),target.classList.contains("bushnell-acc__item")&&openAccordionItem(target)})}),this.list=nav.querySelector(".bushnell-pnav__list"),this.list&&this._initScrollHints(this.list),nav.classList.contains("bushnell-pnav--sticky")){const sentinel=nav.previousElementSibling;sentinel&&sentinel.classList.contains("bushnell-pnav__sentinel")&&this._initSticky(sentinel)}}_initScrollHints(list){const updateHints=()=>{const max=list.scrollWidth-list.clientWidth;this.nav.classList.toggle("can-scroll-left",list.scrollLeft>2),this.nav.classList.toggle("can-scroll-right",list.scrollLeft<max-2)};this.nav.querySelectorAll(".bushnell-pnav__arrow").forEach(btn=>{btn.addEventListener("click",()=>{const dir=btn.classList.contains("bushnell-pnav__arrow--prev")?-1:1;list.scrollBy({left:dir*list.clientWidth*.7,behavior:"smooth"})})}),list.addEventListener("scroll",updateHints,{passive:!0}),window.addEventListener("resize",updateHints,{passive:!0}),window.addEventListener("load",updateHints,{once:!0}),requestAnimationFrame(updateHints)}_peek(){const list=this.list;this._peeked||!list||!this.nav.classList.contains("can-scroll-right")||list.scrollLeft>2||window.matchMedia("(prefers-reduced-motion: reduce)").matches||(this._peeked=!0,list.scrollTo({left:48,behavior:"smooth"}),setTimeout(()=>list.scrollTo({left:0,behavior:"smooth"}),450))}_initSticky(sentinel){let navTop=-1;const calcTop=()=>{this.nav.classList.remove("is-stuck"),sentinel.style.height="0",navTop=sentinel.getBoundingClientRect().top+window.scrollY},update=()=>{if(navTop<0)return;const stuck=window.scrollY>=navTop;this.nav.classList.contains("is-stuck")!==stuck&&(this.nav.classList.toggle("is-stuck",stuck),sentinel.style.height=stuck?this.nav.offsetHeight+"px":"0",stuck&&this._peek())};requestAnimationFrame(()=>{calcTop(),update()}),window.addEventListener("load",()=>{calcTop(),update()},{once:!0}),window.addEventListener("scroll",update,{passive:!0}),window.addEventListener("resize",()=>{calcTop(),update()},{passive:!0})}onIntersect(entries){entries.forEach(entry=>{if(!entry.isIntersecting)return;const idx=this.anchors.indexOf(entry.target);if(idx===-1)return;this.links.forEach(l=>l.classList.remove("is-active"));const activeLink=this.links[idx];activeLink&&activeLink.classList.add("is-active")})}}function initNavs(){if(document.querySelectorAll(".bushnell-pnav").forEach(el=>{el instanceof HTMLElement&&new BushnellProductNav(el)}),location.hash){var hashTarget=document.querySelector(location.hash);hashTarget&&hashTarget.classList.contains("bushnell-acc__item")&&openAccordionItem(hashTarget)}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initNavs):initNavs(); 2//# sourceMappingURL=/cdn/shop/t/133/assets/bushnell-product-nav-bar.js.map?v=140227876107109665501790611765
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.