PageSourceSearch

https://nianticspatial.com/assets/C1CmV32e.min.js

js nianticspatial.com collected 2026-10-09 22:38:48 UTC 6,327 bytes, 1 lines download raw bytes

1import{n as e}from"../chunks/Bu1b7I3T.min.js";var t=class extends HTMLElement{lastScrollTop=0;currentScrollTop=0;header=null;isHeaderVisible=!0;isDark=!1;observer=null;bannerObserver=null;scrollTrigger=null;urlCheckInterval=0;lastUrl=window.location.href;_gsap=null;onBannerDismiss=()=>{this._gsap&&this.header&&this._gsap.to(this.header,{y:0,yPercent:0,duration:.3,ease:`power2.out`})};async connectedCallback(){try{let{gsap:t,ScrollTrigger:n}=await e();if(!this.isConnected||(this._gsap=t,this.header=this.querySelector(`header`),!this.header))return;this.isDark=this.dataset.dark===`true`,this.observer=new MutationObserver(()=>{this.checkScrollPosition()}),this.observer.observe(document.body,{childList:!0,subtree:!0}),this.checkScrollPosition(),this.setupHoverListener(),this.setupNavigationListeners(),this._gsap.set(this.header,{y:this.getBannerHeight(),yPercent:0});let r=document.querySelector(`[data-template="TemplateBanner"]`);r&&(this.bannerObserver=new ResizeObserver(()=>{this.isHeaderVisible&&this._gsap&&this.header&&this._gsap.set(this.header,{y:this.getBannerHeight()})}),this.bannerObserver.observe(r)),document.addEventListener(`banner:dismiss`,this.onBannerDismiss),this.scrollTrigger=n.create({start:`top top`,end:`max`,onUpdate:()=>{this.currentScrollTop=window.pageYOffset||document.documentElement.scrollTop;let e=this.currentScrollTop-this.lastScrollTop,t=this.currentScrollTop<=0,n=e<0;t&&!this.isDark?(this.showHeader(),this.header.classList.remove(`bg-white`),this.removeWhiteBackgrounds(),this.updateButtonStyles(),this.querySelector(`.header-logo`)?.classList.remove(`!text-black`),this.querySelector(`.header-logo`)?.classList.add(`text-white`)):n&&!this.isHeaderVisible?this.showHeader():!n&&this.isHeaderVisible&&Math.abs(e)>10?this.hideHeader():t||(this.header.classList.add(`bg-white`),this.addWhiteBackgrounds(),this.removeWhiteButtonStyles(),this.querySelector(`.header-logo`)?.classList.add(`!text-black`),this.querySelector(`.header-logo`)?.classList.remove(`text-white`)),this.lastScrollTop=this.currentScrollTop}})}catch(e){console.error(`[root-header-2025] Failed to load GSAP:`,e)}}disconnectedCallback(){this.observer?.disconnect(),this.observer=null,this.bannerObserver?.disconnect(),this.bannerObserver=null,this.scrollTrigger?.kill(),this.scrollTrigger=null,window.clearInterval(this.urlCheckInterval),document.removeEventListener(`banner:dismiss`,this.onBannerDismiss)}setupNavigationListeners(){this.querySelectorAll(`.top-level-link`).forEach(e=>{e.addEventListener(`click`,()=>{this.addWhiteBackgrounds(),this.removeWhiteButtonStyles(),this.querySelector(`.header-logo`)?.classList.add(`!text-black`)})});let e=()=>{window.location.href!==this.lastUrl&&(this.lastUrl=window.location.href,this.currentScrollTop<=0&&!this.isDark&&(this.removeWhiteBackgrounds(),this.updateButtonStyles(),this.querySelector(`.header-logo`)?.classList.remove(`!text-black`)))};this.urlCheckInterval=window.setInterval(e,50)}setupHoverListener(){let e=this.querySelector(`.site-header`);e&&(e.addEventListener(`mouseenter`,()=>{this.currentScrollTop>0||this.isDark?(this.addWhiteBackgrounds(),this.removeWhiteButtonStyles()):(this.removeWhiteButtonStyles(),this.querySelector(`.header-logo`)?.classList.add(`!text-black`))}),e.addEventListener(`mouseleave`,()=>{this.currentScrollTop>0||this.isDark?(this.addWhiteBackgrounds(),this.removeWhiteButtonStyles()):(this.removeWhiteBackgrounds(),this.updateButtonStyles(),this.querySelector(`.header-logo`)?.classList.remove(`!text-black`))}))}getBannerHeight(){return document.querySelector(`[data-template="TemplateBanner"]`)?.offsetHeight??0}showHeader(){this.isHeaderVisible=!0,this._gsap.to(this.header,{y:this.getBannerHeight(),yPercent:0,duration:.3,ease:`power2.out`}),this.currentScrollTop<=0?(this.removeWhiteBackgrounds(),this.removeWhiteButtonStyles(),this.isDark||this.updateButtonStyles()):this.addWhiteBackgrounds()}hideHeader(){this.isHeaderVisible=!1;let e=-(this.getBannerHeight()+(this.header?.offsetHeight??0));this._gsap.timeline().to(this.header,{y:e,yPercent:0,duration:.3,ease:`power2.out`}).to({},{duration:.5}).add(()=>{this.removeWhiteButtonStyles()}).add(()=>
1{this.addWhiteBackgrounds()})}addWhiteBackgrounds(){let e=this.querySelectorAll(`.header-bg`),t=this.querySelectorAll(`.top-level-link`),n=this.querySelectorAll(`.top-level-link-chevron`),r=this.querySelector(`.header-logo`),i=this.querySelectorAll(`.header-mobile-menu-button-line`);e.forEach(e=>{e.classList.add(`!bg-white`)}),t.forEach(e=>{e.classList.add(`!text-[#404040]`)}),n.forEach(e=>{e.classList.add(`!text-[#818181]`)}),r?.classList.add(`!text-black`),i.forEach(e=>{e.classList.add(`!bg-[#525252]`)})}removeWhiteBackgrounds(){if(this.isDark)return;let e=this.querySelectorAll(`.header-bg`),t=this.querySelectorAll(`.top-level-link`),n=this.querySelectorAll(`.top-level-link-chevron`),r=this.querySelector(`.header-logo`),i=this.querySelectorAll(`.header-mobile-menu-button-line`);e.forEach(e=>{e.classList.remove(`!bg-white`)}),t.forEach(e=>{e.classList.remove(`!text-[#404040]`)}),n.forEach(e=>{e.classList.remove(`!text-[#818181]`)}),r?.classList.remove(`!text-black`),i.forEach(e=>{e.classList.remove(`!bg-[#525252]`),e.classList.add(`bg-white`)})}removeWhiteButtonStyles(){this.querySelectorAll(`.header-button`).forEach(e=>{e.classList.remove(`button-white-header`,`button-outline-white-header`)})}updateButtonStyles(){this.isDark||this.querySelectorAll(`.header-button`).forEach(e=>{e.classList.contains(`button-black`)&&e.classList.add(`button-white-header`),e.classList.contains(`button-outline`)&&e.classList.add(`button-outline-white-header`)})}checkScrollPosition(){this.header&&(this.currentScrollTop=window.pageYOffset||document.documentElement.scrollTop,this.currentScrollTop>0?(this.header.classList.add(`bg-white`),this.addWhiteBackgrounds(),this.removeWhiteButtonStyles(),this.querySelector(`.header-logo`)?.classList.add(`!text-black`),this.querySelector(`.header-logo`)?.classList.remove(`text-white`)):this.isDark||(this.header.classList.remove(`bg-white`),this.removeWhiteBackgrounds(),this.updateButtonStyles(),this.querySelector(`.header-logo`)?.classList.remove(`!text-black`),this.querySelector(`.header-logo`)?.classList.add(`text-white`)))}};customElements.get(`root-header-2025`)||customElements.define(`root-header-2025`,t);

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.