PageSourceSearch

https://www.grantthornton.in/dist/v2/js-v2/modules/GTOnPageNavigation.9834319b3bdeaa68e14cad880154a682.js

js grantthornton.in collected 2026-10-02 03:58:06 UTC 5,048 bytes, 1 lines download raw bytes

1GT.OnPageNavigation=function(){const n=document.firstElementChild,o={ON_PAGE_NAV:".onpage-navigation",ON_PAGE_NAV_CONT:".onpage-navigation__container",EXPAND_BTN:".onpage-navigation__expand",CLOSE_BTN:".onpage-navigation__close",CURRENT_ITEM:".onpage-navigation__current",LINK_ITEMS:".onpage-navigation__link",OUT_VIEWPORT:"out-viewport",EXPANDED:"expanded",SHOW_OVERLAY:"showing-overlay",SHOW_ONPAGE_NAVIGATION:"showing-onpage-navigation"},l=document.querySelector(o.ON_PAGE_NAV);if(l){const A=l.querySelector(o.EXPAND_BTN),T=l.querySelector(o.CURRENT_ITEM),_=l.querySelector(o.CLOSE_BTN),h=l.querySelectorAll(o.LINK_ITEMS);let a=!0;if(window.addEventListener("load",e),GT.isDesktopView()||i(),g(!1),A?.addEventListener("click",()=>{l.classList.add(o.EXPANDED),GT.disableDetectScrollUpOrDown=!0,GT.lockScrollBehindOverlay(o.ON_PAGE_NAV_CONT),n.classList.add(o.SHOW_OVERLAY),i(!1),g(!0),_?.focus()}),_?.addEventListener("click",()=>{s()}),GT.listFunctionsTriggerInScrollEvent.onPageNav=()=>{n.classList.contains("opening-megamenu")||t()},n.querySelectorAll(o.LINK_ITEMS).forEach(e=>{e.addEventListener("click",t=>{const e=t.target;if(t.preventDefault(),!e.classList.contains("active")){GT.preventHeaderFromFlickeringWhileBodyHeightIsChanging(),s();{t=e.href;const n=r(t);if(n){t="undefined"!=typeof CSS&&"function"==typeof CSS.escape?CSS.escape(n):n.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),t=document.querySelector(`[data-block-id="${t}"], .text-area__contents [id="${t}"]`);if(t){var i=function(e){var t;if(e)return e=e.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight,e.top<0?"up":e.bottom>t?"down":"in view"}(t),t=GT.getElementOffset(t).top;let e=t-GT.headerElm.clientHeight-l.clientHeight-16;d()&&(e=t-l.clientHeight-16,"down"!=i&&(e-=GT.headerElm.clientHeight+32)),c(n),GT.preventOpeningMenu(1e3),window.scrollTo(0,e)}}}a=!0}})}),location.hash){a=!1,GT.preventHeaderFromFlickeringWhileBodyHeightIsChanging();const v=function(e){return u(r(e))}(location.hash);v&&(t(),setTimeout(()=>{v.click()},300))}return GT.isDesktopView()||setTimeout(()=>{n.classList.add(o.SHOW_ONPAGE_NAVIGATION),l.classList.add("visible")},300),{closeOnPageNav:s};function e(){document.body.classList.contains("epi-editmode")||h.forEach(function(e){const t=e.getAttribute("href");if(t&&"#"===t.charAt(0)){var i=t.slice(1);if(i){const n=document.querySelector(`[data-block-id="${i}"]`);if(n)if(!Array.from(n.children).some(function(e){return 1===e.nodeType&&0<e.clientHeight})){n.setAttribute("hidden","hidden"),n.classList.add("is-hidden");const a=e.closest("li");a?(a.setAttribute("hidden","hidden"),a.classList.add("is-hidden")):(e.setAttribute("hidden","hidden"),e.classList.add("is-hidden"))}}}})}function s(){l.classList.remove(o.EXPANDED),n.classList.remove(o.SHOW_OVERLAY),GT.disableDetectScrollUpOrDown=!1,GT.isDesktopView()||(i(),g(!1),a&&A?.focus())}function c(e){const t=u(e);t&&(n.classList.contains("animating")||(n.querySelectorAll(".onpage-navigation__link").forEach(e=>e.classList.remove("active")),t.classList.add("active"),T.textContent=t.getAttribute("title"),window.location.hash=t.hash),T.classList.add("active"))}function t(){var e,t;e=GT.getElementOffset(l).top-(GT.isScrollingUp?GT.headerElmHeight:d()?0:GT.mainHeaderElmHeight),t=GT.isDesktopView(),d()?GT.lastScrollTop>e?(l.classList.add("visible"),n.classList.add(o.SHOW_ONPAGE_NAVIGATION)):GT.lastScrollTop<l.offsetTop-l.clientHeight&&t&&(l.classList.remove("visible"),n.classList.remove(o.SHOW_ONPAGE_NAVIGATION)):GT.lastScrollTop>e?(l.classList.add("visible"),n.classList.add(o.SHOW_ONPAGE_NAVIGATION)):t&&(l.classList.remove("visible"),n.classList.remove(o.SHOW_ONPAGE_NAVIGATION));let i=n.querySelectorAll("[data-block-id], .text-area__contents a[id]"),s=n.classList.contains("animating"),r=(s||T.classList.remove("active"),!1);i.forEach((e,t)=>{var i,n,a,o=e.dataset.blockId||e.id;e=e,i=GT.getElementOffset(e).top,n=GT.lastScrollTop,a=GT.wHeight,e=i+e.clientHeight-a/4>n,i<n+a/2&&e&&!r?(c(o),r=!0):s||u(o)?.classList.remove("active")})}function d(){return n.classList.contains("has-menu-v3")}function r(e){e=e.split("#")[1]?.split("____")[0];if(!e)return e;try{return decodeURIComponent(e)}catch{return e}}function u(e){if(!e)return null;const t="#"+e+"____";return Array.from(n.querySelectorAll(".onpage-navigation__link")).find(function(e){return(e.getAttribute("href")||"").startsWith(t)})||null}
1function i(t=!0){h.forEach(e=>{t?(e.setAttribute("tabindex","-1"),e.setAttribute("aria-hidden","true")):(e.removeAttribute("tabindex"),e.removeAttribute("aria-hidden"))})}function g(e=!0){GT.isDesktopView()?(l.setAttribute("role","navigation"),l.removeAttribute("aria-modal"),l.removeAttribute("aria-label"),T.removeAttribute("aria-hidden")):(l.setAttribute("role","dialog"),l.setAttribute("aria-modal",e),l.setAttribute("aria-label",l.dataset.label),A.setAttribute("aria-label",l.dataset.label),T.setAttribute("aria-hidden","true"))}}},"undefined"==typeof isV1GT&&GT.domContentLoadedFncList.push(function(){GT.OnPageNavigation=GT.OnPageNavigation()});

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.