{"version":3,"file":"navigation-jumplinks-e284ba6e.js","sources":["../../../../src/scripts/modules/navigation-jumplinks.ts"],"sourcesContent":["import { Component } from '@verndale/core';\nimport { debounce } from '../helpers/debounce';\nimport { HEADER_EVENTS } from './header';\nimport { decodeHtmlEntities } from '../helpers/helpers';\n\nclass NavigationJumplinks extends Component {\n private menuWrapperSize: number;\n private menuSize: number;\n private menuInvisibleSize: number;\n private paddleMargin: number;\n private isJumping: boolean;\n private jumpingId: string;\n private reviewsThreshold: number;\n private thresholdVisible: number;\n private thresholdOverflow: number;\n private thresholdNotVisible: number;\n private lastScroll: number;\n private scrollDirection: string;\n private observerOptions: IntersectionObserverInit;\n\n constructor(el: HTMLElement) {\n super(el);\n\n //observers setup\n this.menuWrapperSize = 0;\n this.menuSize = 0;\n this.menuInvisibleSize = 0;\n this.paddleMargin = 0;\n this.isJumping = false;\n this.jumpingId = '';\n this.reviewsThreshold = 0.1;\n this.thresholdVisible = 0.5;\n this.thresholdOverflow = 0.4;\n this.thresholdNotVisible = 0.25;\n this.lastScroll = 0;\n this.scrollDirection = '';\n\n this.observerOptions = {\n threshold: [\n this.reviewsThreshold,\n this.thresholdVisible,\n this.thresholdOverflow,\n this.thresholdNotVisible\n ]\n };\n\n this.generateJumpLinks();\n\n window.scrollTo(0, 0);\n\n document.documentElement.style.setProperty('--jumplinks-block-size', '0px');\n\n setTimeout(() => {\n window.dispatchEvent(new Event('resize'));\n this.initSticky();\n this.initObserver();\n }, 300);\n }\n\n setupDefaults() {\n this.dom = {\n header: document.querySelector('.header') as HTMLElement,\n // paddles\n leftPaddle: this.el.querySelector(\n '.navigation-jumplinks__paddle--left'\n ),\n rightPaddle: this.el.querySelector(\n '.navigation-jumplinks__paddle--right'\n ),\n // sections\n sectionsData: document.querySelectorAll(\n '[data-section]:not([data-section] [data-section])'\n ),\n // items\n items: this.el.querySelectorAll('.navigation-jumplinks__item'),\n links: this.el.querySelectorAll('.navigation-jumplinks__link'),\n // wrapper\n wrapper: this.el.querySelector(\n '.navigation-jumplinks__wrapper'\n ),\n //jumplinks\n jumplinks: this.el.querySelector(\n '.navigation-jumplinks__list'\n ),\n dropdown: this.el.querySelector('.field__select')\n };\n\n this.initWidths();\n }\n\n addListeners() {\n setTimeout(() => {\n window.dispatchEvent(new Event('resize'));\n\n //avoid duplicated listeners\n window.removeEventListener('resize', this.handleResize.bind(this));\n window.removeEventListener(\n HEADER_EVENTS.HEADER_RESIZE,\n this.handleHeaderResize.bind(this)\n );\n window.removeEventListener(\n 'scroll',\n this.handleVerticalScroll.bind(this)\n );\n window.removeEventListener(\n 'resize',\n this.handleImmediateResize.bind(this)\n );\n\n //add listeners\n\n window.addEventListener('pause-jumplinks', this.handlePause.bind(this));\n\n window.addEventListener(\n 'resize',\n debounce(this.handleResize.bind(this), 250)\n );\n\n window.addEventListener(\n HEADER_EVENTS.HEADER_RESIZE,\n this.handleHeaderResize.bind(this)\n );\n\n window.addEventListener('scroll', this.handleVerticalScroll.bind(this));\n\n (this.dom.dropdown as HTMLElement)?.addEventListener(\n 'change',\n this.handleDropdownChange.bind(this)\n );\n\n (this.dom.links as NodeListOf)?.forEach(link => {\n link.addEventListener('click', this.handleJumpToSection.bind(this));\n });\n }, 2000);\n }\n\n getWrapperWidth() {\n return (this.dom.wrapper as HTMLElement)?.offsetWidth;\n }\n\n getItemsSize() {\n let itemSize = -16; // don't count the gap for the first item\n const allItems = this.el.querySelectorAll('.navigation-jumplinks__item');\n\n (allItems as NodeListOf)?.forEach(item => {\n itemSize += item.offsetWidth + 32; // 20 = gap size\n });\n\n return itemSize;\n }\n\n getMenuPosition() {\n return (this.dom.jumplinks as HTMLElement)?.scrollLeft;\n }\n\n getScrollingDirection() {\n const currentScroll = window.pageYOffset;\n let direction = '';\n\n if (currentScroll > this.lastScroll) {\n direction = 'down';\n } else if (currentScroll < this.lastScroll) {\n direction = 'up';\n }\n\n this.lastScroll = currentScroll;\n return direction ? direction : this.scrollDirection;\n }\n\n initPaddles() {\n this.menuInvisibleSize = this.menuSize - this.menuWrapperSize;\n const rightPaddle = this.dom.rightPaddle as HTMLElement;\n const leftPaddle = this.dom.leftPaddle as HTMLElement;\n\n if (this.menuInvisibleSize <= 0) {\n rightPaddle?.classList.add('hidden');\n leftPaddle?.classList.add('hidden');\n } else {\n rightPaddle?.classList.remove('hidden');\n }\n }\n\n initWidths() {\n // get wrapper width\n this.menuWrapperSize = this.getWrapperWidth();\n // get menu size\n this.menuSize = this.getItemsSize();\n // get how much of menu is invisible\n this.menuInvisibleSize = this.menuSize - this.menuWrapperSize;\n // get some relevant size for the paddle triggering point\n this.paddleMargin = 16;\n }\n\n manualSetStickiness() {\n this.el.classList.add('sticky--important');\n document.documentElement.style.setProperty(\n '--jumplinks-block-size',\n `${this.el.offsetHeight}px`\n );\n\n setTimeout(() => {\n this.el.classList.remove('sticky--important');\n this.detectSticky();\n }, 500);\n }\n\n initSticky() {\n const hash = window.location.hash.slice(1);\n\n if (hash) {\n const element = Array.from(\n this.dom.sectionsData as NodeListOf\n ).find(el => el.id === hash);\n\n if (element) {\n //get scroll distance from top\n const elementOffset = element?.offsetTop;\n\n //scroll to element\n window.scrollTo({\n top: (elementOffset as number) - 200,\n behavior: 'smooth'\n });\n\n this.manualSetStickiness();\n }\n } else {\n this.el.classList.remove('sticky--important');\n }\n }\n\n detectSticky() {\n const headerHeight = (this.dom.header as HTMLElement)?.clientHeight;\n const stickyElementTop = this.el.getBoundingClientRect().top;\n\n if (headerHeight && stickyElementTop <= headerHeight + 5) {\n this.el.classList.add('sticky');\n } else {\n this.el.classList.remove('sticky');\n }\n\n if (this.el.classList.contains('sticky')) {\n document.documentElement.style.setProperty(\n '--jumplinks-block-size',\n `${this.el.offsetHeight}px`\n );\n } else {\n document.documentElement.style.setProperty(\n '--jumplinks-block-size',\n '0px'\n );\n }\n }\n\n observerCallback(entries: IntersectionObserverEntry[]) {\n entries.forEach(entry => {\n if (entry.intersectionRatio >= this.thresholdVisible && !this.isJumping) {\n this.handleActive(entry);\n return;\n }\n\n if (\n entry.intersectionRatio >= this.thresholdOverflow &&\n !this.isJumping &&\n this.isBiggerElement(entry.target) &&\n this.scrollDirection === 'down' &&\n !this.isElementOverflowingTop(entry.target)\n ) {\n this.handleActive(entry);\n return;\n }\n\n if (\n entry.intersectionRatio < this.thresholdNotVisible &&\n !this.isJumping &&\n this.scrollDirection === 'up'\n ) {\n this.handleInactive(entry);\n return;\n }\n\n if (\n entry.intersectionRatio >= this.reviewsThreshold &&\n entry.target.classList.contains('review-embed') &&\n !this.isJumping\n ) {\n this.handleActive(entry);\n return;\n }\n\n if (this.isJumping && entry.target.id === this.jumpingId) {\n setTimeout(() => {\n this.isJumping = false;\n }, 500);\n }\n });\n }\n\n initObserver() {\n const observer = new IntersectionObserver(\n this.observerCallback.bind(this),\n this.observerOptions\n );\n (this.dom.sectionsData as NodeListOf)?.forEach(el =>\n observer.observe(el)\n );\n }\n\n isElementOverflowingTop(el: Element) {\n const elementTop = el.getBoundingClientRect().top;\n return elementTop < 150;\n }\n\n isBiggerElement(el: Element) {\n const elementHeight = el.getBoundingClientRect().height;\n const viewportHeight = window.innerHeight;\n\n return elementHeight > viewportHeight - 250;\n }\n\n generateJumpLinks() {\n const wrapper = this.dom.wrapper as HTMLElement;\n const dropdown = this.dom.dropdown as HTMLElement;\n const paddles = wrapper?.querySelector(\n '.navigation-jumplinks__paddles'\n ) as HTMLElement;\n\n wrapper.innerHTML = '';\n\n let links = '';\n\n (this.dom.sectionsData as NodeListOf)?.forEach(\n (section, index) => {\n const link = `\n \n `;\n if (section.dataset.section) {\n links += link;\n }\n\n const option = document.createElement('option');\n option.value = section.id;\n option.text = decodeHtmlEntities(\n section.dataset.section as string\n ) as string;\n if (index === 0) {\n option.selected = true;\n }\n if (section.dataset.section) {\n dropdown.appendChild(option);\n }\n }\n );\n\n wrapper.innerHTML = `\n \n ${paddles.outerHTML}\n `;\n\n this.setupDefaults();\n\n (this.dom.jumplinks as HTMLElement)?.addEventListener(\n 'scroll',\n this.handleHorizontalScroll.bind(this),\n { passive: true }\n );\n\n (this.dom.rightPaddle as HTMLElement)?.addEventListener(\n 'click',\n this.handleRightPaddleClick.bind(this)\n );\n\n (this.dom.leftPaddle as HTMLElement)?.addEventListener(\n 'click',\n this.handleLeftPaddleClick.bind(this)\n );\n\n (this.dom.links as NodeListOf)?.forEach(link => {\n link.addEventListener('click', this.handleJumpToSection.bind(this));\n });\n\n this.checkWraperReady();\n }\n\n checkWraperReady = () => {\n const interval = setInterval(() => {\n const width = this.getWrapperWidth();\n\n if (width > 0) {\n this.handleResize();\n clearInterval(interval);\n }\n }, 700);\n };\n\n handleActive(entry: IntersectionObserverEntry) {\n const currentSection = entry.target.id;\n\n (this.dom.links as NodeListOf)?.forEach(el => {\n el.classList.remove('active');\n\n if (el.href.includes(currentSection)) {\n (this.dom.dropdown as HTMLSelectElement).value = currentSection;\n el.classList.add('active');\n //get element horizontal scroll distance from container\n const elementOffset = el.offsetLeft;\n //get container horizontal scroll distance\n const containerOffset = (this.dom.jumplinks as HTMLElement)?.scrollLeft;\n //scroll to element\n (this.dom.jumplinks as HTMLElement).scrollLeft =\n elementOffset - containerOffset - 32; //32 = offset\n }\n });\n }\n\n handleInactive(entry: IntersectionObserverEntry) {\n const currentSection = entry.target.id;\n let previousItem: HTMLElement;\n\n (this.dom.links as NodeListOf)?.forEach(el => {\n if (el.href.includes(currentSection) && el.classList.contains('active')) {\n if (previousItem) {\n el.classList.remove('active');\n previousItem.classList.add('active');\n }\n }\n\n previousItem = el;\n });\n }\n\n handleResize() {\n this.menuWrapperSize = this.getWrapperWidth();\n this.menuSize = this.getItemsSize();\n this.menuInvisibleSize = this.menuSize - this.menuWrapperSize;\n this.initPaddles();\n }\n\n handleImmediateResize() {\n window.scrollTo(0, 0);\n }\n\n handleHorizontalScroll() {\n // get how much of the menu is invisible\n this.menuInvisibleSize = this.menuSize - this.menuWrapperSize;\n // get how much we have scrolled so far\n const menuPosition = this.getMenuPosition();\n //return (this.dom.jumplinks as HTMLElement)?.scrollLeft;\n const menuEndOffset = this.menuInvisibleSize - this.paddleMargin;\n\n const leftPaddle = this.dom.leftPaddle as HTMLElement;\n const rightPaddle = this.dom.rightPaddle as HTMLElement;\n\n // show and hide the paddles depending on menu position\n if (menuPosition <= this.paddleMargin) {\n leftPaddle?.classList.add('hidden');\n rightPaddle?.classList.remove('hidden');\n } else if (menuPosition - this.paddleMargin < menuEndOffset) {\n // show both paddles in the middle\n leftPaddle.classList.remove('hidden');\n rightPaddle.classList.remove('hidden');\n } else if (menuPosition >= menuEndOffset) {\n leftPaddle.classList.remove('hidden');\n rightPaddle.classList.add('hidden');\n }\n }\n\n handleVerticalScroll() {\n this.scrollDirection = this.getScrollingDirection();\n this.detectSticky();\n }\n\n handleRightPaddleClick() {\n (this.dom.jumplinks as HTMLElement).scrollLeft += 200;\n }\n\n handleLeftPaddleClick() {\n (this.dom.jumplinks as HTMLElement).scrollLeft -= 200;\n }\n\n handleHeaderResize() {\n this.detectSticky();\n }\n\n handleDropdownChange(e: Event) {\n const target = e.target as HTMLSelectElement;\n const selected = target.value;\n this.isJumping = true;\n this.jumpingId = selected;\n\n const element = Array.from(\n this.dom.sectionsData as NodeListOf\n ).find(el => el.id === selected);\n element?.scrollIntoView({ behavior: 'smooth' });\n }\n\n handleJumpToSection(e: Event) {\n e.preventDefault();\n const currentTarget = e.currentTarget as HTMLAnchorElement;\n\n this.isJumping = true;\n (this.dom.links as NodeListOf)?.forEach(el =>\n el.classList.remove('active')\n );\n\n currentTarget.classList.add('active');\n currentTarget.blur();\n\n this.jumpingId = currentTarget.dataset.id as string;\n\n const element = Array.from(\n this.dom.sectionsData as NodeListOf\n ).find(el => el.id === this.jumpingId);\n\n //get scroll distance from top\n const elementOffset = element?.offsetTop;\n\n //scroll to element\n window.scrollTo({\n top: (elementOffset as number) - 200,\n behavior: 'smooth'\n });\n\n // add hash to url or replace it\n if (window.location.hash) {\n window.history.replaceState(\n null,\n '',\n `#${currentTarget.dataset.id as string}`\n );\n } else {\n window.history.pushState(\n null,\n '',\n `#${currentTarget.dataset.id as string}`\n );\n }\n }\n\n handlePause() {\n this.isJumping = true;\n setTimeout(() => {\n this.isJumping = false;\n }, 500);\n }\n}\n\nexport default NavigationJumplinks;\n"],"names":["NavigationJumplinks","Component","el","__publicField","interval","HEADER_EVENTS","debounce","_a","_b","link","itemSize","allItems","item","currentScroll","direction","rightPaddle","leftPaddle","hash","element","elementOffset","headerHeight","stickyElementTop","entries","entry","observer","elementHeight","viewportHeight","wrapper","dropdown","paddles","links","section","index","option","decodeHtmlEntities","_c","_d","_e","currentSection","containerOffset","previousItem","menuPosition","menuEndOffset","selected","currentTarget"],"mappings":"0iBAKA,MAAMA,UAA4BC,CAAU,CAe1C,YAAYC,EAAiB,CAC3B,MAAMA,CAAE,EAfFC,EAAA,wBACAA,EAAA,iBACAA,EAAA,0BACAA,EAAA,qBACAA,EAAA,kBACAA,EAAA,kBACAA,EAAA,yBACAA,EAAA,yBACAA,EAAA,0BACAA,EAAA,4BACAA,EAAA,mBACAA,EAAA,wBACAA,EAAA,wBA0XRA,EAAA,wBAAmB,IAAM,CACjB,MAAAC,EAAW,YAAY,IAAM,CACnB,KAAK,kBAEP,IACV,KAAK,aAAa,EAClB,cAAcA,CAAQ,IAEvB,GAAG,CAAA,GA5XN,KAAK,gBAAkB,EACvB,KAAK,SAAW,EAChB,KAAK,kBAAoB,EACzB,KAAK,aAAe,EACpB,KAAK,UAAY,GACjB,KAAK,UAAY,GACjB,KAAK,iBAAmB,GACxB,KAAK,iBAAmB,GACxB,KAAK,kBAAoB,GACzB,KAAK,oBAAsB,IAC3B,KAAK,WAAa,EAClB,KAAK,gBAAkB,GAEvB,KAAK,gBAAkB,CACrB,UAAW,CACT,KAAK,iBACL,KAAK,iBACL,KAAK,kBACL,KAAK,mBACP,CAAA,EAGF,KAAK,kBAAkB,EAEhB,OAAA,SAAS,EAAG,CAAC,EAEpB,SAAS,gBAAgB,MAAM,YAAY,yBAA0B,KAAK,EAE1E,WAAW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