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SkipLinks.ts","webpack:///./modules/Navigation.ts","webpack:///./modules/NivTNavigation.ts","webpack:///./store/modules/CircleNavigation/actions.ts"],"sourcesContent":["import { createSkipLandmarkLink, createSkipSectionLink } from \"./libs/markUpCreator\";\r\n\r\nexport default class SkipLinks {\r\n    footerId: string = '#footer';\r\n    promotionBannerId: string = '#nx-promotion-banner';\r\n    mainId: string = '#main';\r\n\r\n    constructor(public element: HTMLElement) {\r\n        this.init();\r\n    }\r\n\r\n    private init() {\r\n        this.initSkipToMainContentLink()\r\n            .initSkipToFooterLink()\r\n            .initSkipSectionLinks();\r\n    }\r\n\r\n    private initSkipToMainContentLink() {\r\n        const skipToMainContentLink = this.createSkipToMainContentLink();\r\n        const skipToMainContentLinkAnchor = skipToMainContentLink?.querySelector('a');\r\n        const promotionBanner = document.getElementById('nx-promotion-banner');\r\n\r\n        if (promotionBanner && !promotionBanner.classList.contains(\"nx-promotion-banner--hidden\")) {\r\n            skipToMainContentLinkAnchor?.setAttribute('href', this.promotionBannerId);\r\n        } else {\r\n            skipToMainContentLinkAnchor?.setAttribute('href', this.mainId);\r\n        }\r\n\r\n        return this;\r\n    }\r\n\r\n    private initSkipToFooterLink() {\r\n        const skipToFooterLink = this.createSkipToFooterLink();\r\n        skipToFooterLink?.querySelector('a')?.setAttribute(\"href\", this.footerId);\r\n\r\n        return this;\r\n    }\r\n\r\n    private initSkipSectionLinks() {\r\n        const allSections = document.querySelector('main')?.querySelectorAll('section');\r\n        const sectionsToSkip = Array.from(allSections).filter(section => {\r\n            const sectionDeclinesSkipLink = section.closest('[data-allow-skip-link=\"false\"]');\r\n            const parentSectionDeclinesSkipLinks = section.parentElement.closest('[data-allow-skip-links-inside=\"false\"]');\r\n\r\n            return !sectionDeclinesSkipLink && !parentSectionDeclinesSkipLinks;\r\n        });\r\n\r\n        const text = this.element.dataset.skipSectionText ? this.element.dataset.skipSectionText : '';\r\n\r\n        const links = this.createAllSkipSectionLinks(sectionsToSkip, text);\r\n        this.addDestinationToSkipSectionLinks(links);\r\n    }\r\n\r\n    private createAllSkipSectionLinks(sections: Array<HTMLElement>, text: string) {\r\n        let links: HTMLElement[] = [];\r\n\r\n        sections.forEach((section, currentIndex) => {\r\n            const ariaLabel = this.getSkipSectionLinkAriaLabel(section, text);\r\n            const id = this.createSkipSectionLinkId(currentIndex);\r\n\r\n            const link = createSkipSectionLink(text, id, ariaLabel);\r\n            links.push(link);\r\n\r\n            this.insertSkipSectionLinkBeforeSection(section, link);\r\n        });\r\n\r\n        return links;\r\n    }\r\n\r\n    private addDestinationToSkipSectionLinks(links: HTMLElement[]) {\r\n        links.forEach((link: HTMLAnchorElement, currentIndex) => {\r\n            const linkAnchor = link.querySelector(\"a\");\r\n            const destinationAnchor = links[currentIndex + 1]?.querySelector(\"a\");\r\n\r\n            if (destinationAnchor && linkAnchor) {\r\n                const destinationId = \"#\" + destinationAnchor.id;\r\n                linkAnchor.setAttribute('href', destinationId);\r\n            } else {\r\n                linkAnchor.setAttribute('href', this.footerId);\r\n            }\r\n        });\r\n    }\r\n\r\n    private insertSkipSectionLinkBeforeSection(section: HTMLElement, link: HTMLElement) {\r\n        section.parentElement.insertBefore(link, section);\r\n    }\r\n\r\n    private getSkipSectionLinkAriaLabel(section: HTMLElement, text: string) {\r\n        const sectionHeadline = section.querySelector(\"h1, h2, h3, h4, h5, h6\");\r\n        const sectionHeadlineText = sectionHeadline ? sectionHeadline.textContent.trim() : '';\r\n        const ariaLabel = text.concat(\" \", sectionHeadlineText);\r\n        return ariaLabel;\r\n    }\r\n\r\n    private createSkipSectionLinkId(currentIndex: number) {\r\n        const id = \"skipSectionLink_\" + currentIndex;\r\n        return id;\r\n    }\r\n\r\n    private createSkipToMainContentLink() {\r\n        const text: string = this.element.dataset.skipToMainText;\r\n        const skipToMainContentLink = createSkipLandmarkLink(text);\r\n        const header = document.querySelector('header');\r\n        header?.prepend(skipToMainContentLink);\r\n\r\n        return skipToMainContentLink;\r\n    }\r\n\r\n    private createSkipToFooterLink() {\r\n        const text: string = this.element.dataset.skipToFooterText;\r\n        const skipToFooterLink = createSkipLandmarkLink(text);\r\n        const main = document.querySelector('main');\r\n        main?.prepend(skipToFooterLink);\r\n\r\n        return skipToFooterLink;\r\n    }\r\n}","// const DesktopNavigation = () => import(/* webpackChunkName: \"DesktopNavigation\" */'../modules/DesktopNavigation');\r\n\r\n// import DesktopNavigation from './DesktopNavigation';\r\n// import CircleNavigation from './CircleNavigation';\r\n// import MobileBurgerNavigation from './MobileBurgerNavigation';\r\n// import HeaderActions from './HeaderActions';\r\nimport NivTNavigation from './NivTNavigation';\r\nimport { ClassWithState } from '../store';\r\nimport { setNavStructure } from '../store/actions';\r\n//import OfflineBanner from './/OfflineBanner';\r\nimport SkipLinks from '../SkipLinks';\r\n\r\nconst moduleSelector = '[data-module=\"Navigation\"]';\r\n\r\nclass Navigation {\r\n    desktopNavigation: any;\r\n    mobileNavigation: any;\r\n    mobileBurgerNavigation: any;\r\n    protected navStructure: INavStructure;\r\n    private lastNavigationType: string;\r\n    private mobileNavigationInitialized: boolean = false;\r\n    private desktopNavigationInitialized: boolean = false;\r\n\r\n    constructor(public element: HTMLElement) {\r\n        this.init();\r\n    }\r\n\r\n    protected init(): void {\r\n        this.navStructure = this.getNavStructure();\r\n\r\n        if (!this.navStructure) return;\r\n\r\n        this.reinit();\r\n        this.onResize();\r\n        new NivTNavigation(this.element);\r\n    }\r\n\r\n    private getNavStructure(): INavStructure {\r\n        const configNode = document.querySelector('[data-navigation-structure]');\r\n        const navStructure: INavStructure = configNode && JSON.parse(configNode.innerHTML) || {};\r\n        return navStructure;\r\n    }\r\n\r\n    private onResize(): void {\r\n        NiveaX.addToEventStore('resize', this.reinit.bind(this), window);\r\n    }\r\n\r\n    private initDesktopNavigation(): void {\r\n        const DesktopNavigation = () => import(/* webpackChunkName: \"DesktopNavigation\" */'../modules/DesktopNavigation');\r\n            DesktopNavigation().then((module) => this.desktopNavigation = new module.default(this.element, this.navStructure));\r\n    }\r\n\r\n    private initMobileNavigation(): void {\r\n        if (this.element.classList.contains('nx-mob-burger-nav--activated')) {\r\n            const mobileBurgerNavigation = () => import(/* webpackChunkName: \"MobileBurgerNavigation\" */'../modules/MobileBurgerNavigation');\r\n                mobileBurgerNavigation().then(module => \r\n                    this.mobileBurgerNavigation = new module.default(<HTMLElement>this.element.querySelector('.nx-mob-burger-nav__wrapper'), this.navStructure));\r\n        } else {\r\n            const mobileNavigation = () => import(/* webpackChunkName: \"CircleNavigation\" */'../modules/CircleNavigation');\r\n                mobileNavigation().then(module => \r\n                    this.mobileNavigation = new module.default(<HTMLElement>this.element.querySelector('.nx-mob-nav__wrapper'), this.navStructure));\r\n        }\r\n    }\r\n\r\n    private initHeaderActions(): void {\r\n        const headerActions = ()=>  import(/* webpackChunkName: \"HeaderActions\" */'../modules/HeaderActions');\r\n              headerActions().then((module)=> new module.default(this.element, this.navStructure) )\r\n    }\r\n\r\n    private reinit(): void {\r\n        if (!window.NiveaX.deviceType.isDesktop && this.lastNavigationType !== 'mobile' && !this.mobileNavigationInitialized) {\r\n            this.initMobileNavigation();\r\n            this.mobileNavigationInitialized = true;\r\n            this.lastNavigationType = 'mobile';\r\n            return;\r\n        }\r\n\r\n        if (window.NiveaX.deviceType.isDesktop && this.lastNavigationType !== 'desktop' && !this.desktopNavigationInitialized) {\r\n            this.initDesktopNavigation();\r\n            this.initHeaderActions();\r\n            this.initSkipLinks();\r\n            this.desktopNavigationInitialized = true;\r\n            this.lastNavigationType = 'desktop';\r\n            return;\r\n        }\r\n    }\r\n\r\n    private initSkipLinks() {\r\n        new SkipLinks(this.element);\r\n    }\r\n}\r\n\r\nexport default class NavigationWithState extends ClassWithState(Navigation) {\r\n    static setup(selector: string = moduleSelector): void {\r\n        Array.from(document.querySelectorAll(selector)).filter((node: HTMLElement) => !node.dataset.moduleInitialized).forEach((element: HTMLElement) => {\r\n            new NavigationWithState(element);\r\n            element.dataset.moduleInitialized = 'true';\r\n        });\r\n    }\r\n\r\n    protected async init(): Promise<void> {\r\n        await super.init();\r\n\r\n        this.dispatch(setNavStructure(this.navStructure));\r\n    }\r\n}\r\n\r\n// Hot Module Replacement\r\nif (module.hot) {\r\n    let nodesCache: HMRNodes[] = Array.from(document.querySelectorAll(moduleSelector)).map((element: Node) => ({ nodeToReplace: element, nodeOrigin: element.cloneNode(true) }));\r\n\r\n    NavigationWithState.setup(moduleSelector);\r\n\r\n    module.hot.accept(() => {\r\n        NavigationWithState.setup(moduleSelector);\r\n    });\r\n    module.hot.dispose(() => {\r\n        nodesCache.forEach(({ nodeToReplace, nodeOrigin }) => { nodeToReplace = nodeToReplace.parentElement.replaceChild(nodeOrigin.cloneNode(true), nodeToReplace) });\r\n    });\r\n} else {\r\n    NavigationWithState.setup(moduleSelector);\r\n}","/// <reference path=\"../typings/niveax.d.ts\"/>\r\nimport { addLayer } from \"../ClassWithTracking/helpers\";\r\n\r\nconst fileName = 'NivTNavigation.ts';\r\n\r\n\r\nexport default class NivTNavigation {\r\n    constructor(public element: HTMLElement) {\r\n        \r\n        if (window.NiveaX.IsUAEnabled) {\r\n            this.init();\r\n        }\r\n    }\r\n\r\n    init() {\r\n        let logoElement: HTMLLinkElement = this.element.querySelector('.nx-nav-desktop__logo'),\r\n            navigationItem: HTMLElement = this.element.querySelector('.nx-nav-desktop'),\r\n            searchIcon: HTMLElement = this.element.querySelector('[data-action-id=\"search\"]'),\r\n            smartCompanion: HTMLElement = document.querySelector('.nx-mob-nav--initialized');\r\n\r\n        if (!logoElement) {\r\n            console.onSelectorError('.nx-nav-desktop__logo', fileName);\r\n            return;\r\n        }\r\n        if (!navigationItem) {\r\n            console.onSelectorError('.nx-nav-desktop', fileName);\r\n            return;\r\n        }\r\n        if (!searchIcon) {\r\n            console.onSelectorError('.nx-search-icon', fileName);\r\n            return;\r\n        }\r\n\r\n            // Tracking Home Logo\r\n        if (logoElement) logoElement.addEventListener('click', () => {\r\n            this.trackHomeLogo(logoElement.href);\r\n        });\r\n\r\n        // Tracking Desktop Menu Items\r\n        if (navigationItem) navigationItem.addEventListener('click', (event) => {\r\n            let linkElement: HTMLAnchorElement = <HTMLAnchorElement>event.target;\r\n            if (linkElement.classList.contains('nx-nav-third-level__link--has-submenu')) {\r\n                return false;\r\n            }\r\n            this.trackMenuItem(this.getLinkPath(event) + ' | ' + linkElement.getAttribute('href'), linkElement.href);\r\n        });\r\n\r\n        // Tracking Opening Search Layer\r\n        if (searchIcon) searchIcon.addEventListener('click', () => {\r\n            this.trackOpenSearchLayer();\r\n        });\r\n\r\n        // Tracking Submit Search Form\r\n        document.addEventListener('niveax:submitHeaderSearchForm', (event) => {\r\n            this.trackSubmitSearchForm(event);\r\n        });\r\n\r\n        // Tracking Opening Smart Companion\r\n        if (smartCompanion) {\r\n            this.trackOpenSmartCompanion();\r\n            this.trackMenuItemSmartCompanion();\r\n        } else {\r\n            document.addEventListener('niveax:smartCompanionInitialized', (event) => {\r\n                this.trackOpenSmartCompanion();\r\n                this.trackMenuItemSmartCompanion();\r\n            });\r\n        }\r\n\r\n        //@danko: missing listeners to track path of clicked companion link, proper path needs to be built Product>Face>link for example\r\n        this.resetMenuSessionValue();\r\n    }\r\n\r\n    trackHomeLogo(destinationUrl: any) {\r\n        addLayer({\r\n            event: 'ga_event',\r\n            eventCategory: 'Navigation',\r\n            eventAction: 'Nivea Button Click',\r\n            eventLabel: 'Homepage',\r\n            eventNonInteraction: false,\r\n        });\r\n\r\n        if (destinationUrl) { document.location = destinationUrl; }\r\n    }\r\n\r\n    trackMenuItem(eventLabel: string, destinationUrl: any) {\r\n        addLayer({\r\n            event: 'ga_event',\r\n            eventCategory: 'Navigation',\r\n            eventAction: 'Item Click',\r\n            eventLabel: eventLabel,\r\n            eventNonInteraction: false,\r\n        });\r\n\r\n        if (destinationUrl) { document.location = destinationUrl; }\r\n    }\r\n\r\n    trackOpenSearchLayer() {\r\n        addLayer({\r\n            event: 'ga_event',\r\n            eventCategory: 'Site Search',\r\n            eventAction: 'Focus',\r\n            eventLabel: undefined,\r\n            eventNonInteraction: false\r\n        });\r\n    }\r\n\r\n    trackSubmitSearchForm(event) {\r\n        let headerSearchForm: HTMLFormElement = document.querySelector('.nx-header-search-form');\r\n        if (!headerSearchForm) {\r\n            console.onSelectorError('.nx-header-search-form', fileName);\r\n            return;\r\n        }\r\n\r\n        headerSearchForm.addEventListener('submit', (event) => {\r\n            let target: HTMLElement = <HTMLElement>event.target;\r\n\r\n            addLayer({\r\n                event: 'ga_event',\r\n                eventCategory: 'Site Search',\r\n                eventAction: 'Submit',\r\n                eventLabel: target.querySelector('input').value,\r\n                eventNonInteraction: false,\r\n            });\r\n        });\r\n    }\r\n\r\n    trackOpenSmartCompanion() {\r\n        let smartCompanionIcon: HTMLFormElement = document.querySelector('.nx-mob-nav__button');\r\n        if (!smartCompanionIcon) {\r\n            console.onSelectorError('.nx-mob-nav__button', fileName);\r\n            return;\r\n        }\r\n\r\n        smartCompanionIcon.addEventListener('click', (event) => {\r\n            let target: HTMLElement = <HTMLElement>event.currentTarget;\r\n            if (!target.classList.contains('nx-btn--close-menu')) {\r\n                addLayer({\r\n                    event: 'ga_event',\r\n                    eventCategory: 'Navigation',\r\n                    eventAction: 'Open Menu',\r\n                    eventLabel: undefined,\r\n                    eventNonInteraction: false\r\n                });\r\n            }\r\n        });\r\n    }\r\n\r\n    trackMenuItemSmartCompanion() {\r\n        let navigationItem: HTMLFormElement = document.querySelector('.nx-mob-nav__inner');\r\n        if (!navigationItem) {\r\n            console.onSelectorError('.nx-mob-nav__inner', fileName);\r\n            return;\r\n        }\r\n\r\n        navigationItem.addEventListener('click', (event) => {\r\n            let clickedElement: HTMLAnchorElement = <HTMLAnchorElement>event.target,\r\n                clickedElementListElement = <IMobileNavLevelItem>clickedElement.parentElement,\r\n                pathObject = JSON.parse(sessionStorage.getItem('companionLinkPath'));\r\n\r\n            if (clickedElement.tagName === 'A' && clickedElementListElement.childrenList) {\r\n                event.preventDefault();\r\n\r\n                if (clickedElement.closest('nav').classList.contains('nx-mob-nav__level--1')) {\r\n                    this.updateMenuSessionValue('firstLevel', clickedElement.innerText);\r\n                    this.resetMenuLevels();\r\n                } else if (clickedElement.closest('nav').classList.contains('nx-mob-nav__level--2')) {\r\n                    this.updateMenuSessionValue('secondLevel', clickedElement.innerText);\r\n                } else if (clickedElement.closest('nav').classList.contains('nx-mob-nav__level--3')) {\r\n                    this.updateMenuSessionValue('thirdLevel', clickedElement.innerText);\r\n                } else if (clickedElement.closest('nav').classList.contains('nx-mob-nav__level--4')) {\r\n                    this.updateMenuSessionValue('fourthLevel', clickedElement.innerText);\r\n                }\r\n            }\r\n\r\n            if (clickedElement.innerText === pathObject.secondLevel) {\r\n                if (pathObject.secondLevel) {\r\n                    delete pathObject.secondLevel;\r\n                    sessionStorage.setItem('companionLinkPath', JSON.stringify(pathObject));\r\n                }\r\n            }\r\n\r\n            if (clickedElementListElement.classList.contains('nx-mob-nav__item--small') || clickedElement.classList.contains('nx-mob-nav__item--small')) {\r\n                this.trackMobileLinkPath(clickedElement);\r\n            }\r\n\r\n        });\r\n    }\r\n\r\n    updateMenuSessionValue(key: string, value: string) {\r\n        let pathObject = JSON.parse(sessionStorage.getItem('companionLinkPath'));\r\n        pathObject[key] = value;\r\n        sessionStorage.setItem('companionLinkPath', JSON.stringify(pathObject));\r\n    }\r\n\r\n    resetMenuSessionValue() {\r\n        sessionStorage.setItem('companionLinkPath', JSON.stringify({}));\r\n    }\r\n\r\n    resetMenuLevels() {\r\n        let pathObject = JSON.parse(sessionStorage.getItem('companionLinkPath'));\r\n        if (pathObject.secondLevel) {\r\n            delete pathObject.secondLevel;\r\n        }\r\n\r\n        if (pathObject.thirdLevel) {\r\n            delete pathObject.thirdLevel;\r\n        }\r\n        sessionStorage.setItem('companionLinkPath', JSON.stringify(pathObject));\r\n    }\r\n\r\n    trackMobileLinkPath(element: HTMLAnchorElement) {\r\n\r\n        let pathObject = JSON.parse(sessionStorage.getItem('companionLinkPath')),\r\n            linkPath: string = '';\r\n\r\n        if (pathObject.firstLevel) {\r\n            linkPath += pathObject.firstLevel;\r\n        }\r\n\r\n        if (pathObject.secondLevel) {\r\n            linkPath += ' » ' + pathObject.secondLevel;\r\n        }\r\n\r\n        if (pathObject.thirdLevel) {\r\n            linkPath += ' » ' + pathObject.thirdLevel;\r\n        }\r\n\r\n        if (element.parentElement.classList.contains('nx-mob-nav__item--small')) {\r\n            linkPath += `${(linkPath != '' ? ' »' : '')} ${element.innerText}`\r\n        }\r\n\r\n        addLayer({\r\n            event: 'ga_event',\r\n            eventCategory: 'Navigation',\r\n            eventAction: 'Item Click',\r\n            navigationLevel: this.getNavigationLevel(element),\r\n            eventLabel: linkPath,\r\n            eventNonInteraction: false,\r\n        });\r\n\r\n        if (element.href) { document.location.href = element.href; }\r\n    }\r\n\r\n    getLinkPath(event: any) {\r\n        let currentElement: HTMLElement = event.target,\r\n            secondLevel: HTMLElement = <HTMLElement>currentElement.closest('.nx-nav-second-level__item--list'),\r\n            secondLevelLink: HTMLElement,\r\n            firstLevel: HTMLElement = <HTMLElement>currentElement.closest('.nx-nav-first-level__item'),\r\n            firstLevelLink: HTMLElement,\r\n            thirdLevel: HTMLElement = <HTMLElement>currentElement.closest('.nx-nav-third-level__item'),\r\n            thirdLevelLink: HTMLElement,\r\n            returnPath: string = '';\r\n\r\n        if (firstLevel) {\r\n            firstLevelLink = <HTMLElement>firstLevel.querySelector('.nx-nav-first-level__link');\r\n            returnPath += firstLevelLink.title;\r\n        }\r\n\r\n        if (secondLevel) {\r\n            secondLevelLink = <HTMLElement>secondLevel.querySelector('.nx-nav-desktop__second-level-link');\r\n            returnPath += ' » ' + secondLevelLink.title;\r\n        }\r\n\r\n        if(thirdLevel){\r\n            thirdLevelLink = <HTMLElement>thirdLevel.querySelector('.nx-nav-third-level__link');\r\n            returnPath += ' » ' + thirdLevelLink.title;\r\n        }\r\n\r\n        if (currentElement !== secondLevelLink && currentElement !== firstLevelLink && currentElement !== thirdLevelLink) {\r\n            returnPath += ' » ' + currentElement.title;\r\n        }\r\n\r\n        return returnPath;\r\n    }\r\n\r\n    getNavigationLevel(target) {\r\n        if (target.closest('.nx-mob-nav__level--1'))\r\n            return '1'\r\n        else if (target.closest('.nx-mob-nav__level--2'))\r\n            return '2'\r\n        else if (target.closest('.nx-mob-nav__level--3'))\r\n            return '3'\r\n        else if (target.closest('.nx-mob-nav__level--4'))\r\n            return '4'\r\n\r\n        return '';\r\n    }\r\n}","import { \r\n    MOVE_LEFT,\r\n    MOVE_RIGHT,\r\n    NavPositionActionTypes,\r\n    OPEN_NAV,\r\n    CLOSE_NAV,\r\n    NavStateActionTypes,\r\n    SET_NAV_STRUCTURE,\r\n    SetNavStructure,\r\n} from './types';\r\n\r\nexport const moveNavLeft = (): NavPositionActionTypes => ({ type: MOVE_LEFT });\r\n\r\nexport const moveNavRight = (): NavPositionActionTypes => ({ type: MOVE_RIGHT });\r\n\r\nexport const openNav = (): NavStateActionTypes => ({ type: OPEN_NAV });\r\n\r\nexport const closeNav = (): NavStateActionTypes => ({ type: CLOSE_NAV });\r\n\r\nexport const setNavStructure = (structure: INavStructure): SetNavStructure => ({ type: SET_NAV_STRUCTURE, structure });"],"names":["SkipLinks","constructor","element","footerId","promotionBannerId","mainId","this","init","initSkipToMainContentLink","initSkipToFooterLink","initSkipSectionLinks","skipToMainContentLink","createSkipToMainContentLink","skipToMainContentLinkAnchor","querySelector","promotionBanner","document","getElementById","classList","contains","setAttribute","skipToFooterLink","createSkipToFooterLink","allSections","querySelectorAll","sectionsToSkip","Array","from","filter","section","sectionDeclinesSkipLink","closest","parentSectionDeclinesSkipLinks","parentElement","text","dataset","skipSectionText","links","createAllSkipSectionLinks","addDestinationToSkipSectionLinks","sections","forEach","currentIndex","ariaLabel","getSkipSectionLinkAriaLabel","id","createSkipSectionLinkId","link","push","insertSkipSectionLinkBeforeSection","linkAnchor","destinationAnchor","destinationId","insertBefore","sectionHeadline","sectionHeadlineText","textContent","trim","concat","skipToMainText","header","prepend","skipToFooterText","main","moduleSelector","Navigation","mobileNavigationInitialized","desktopNavigationInitialized","navStructure","getNavStructure","reinit","onResize","NivTNavigation","configNode","JSON","parse","innerHTML","NiveaX","addToEventStore","bind","window","initDesktopNavigation","then","module","desktopNavigation","default","initMobileNavigation","mobileBurgerNavigation","mobileNavigation","initHeaderActions","deviceType","isDesktop","lastNavigationType","initSkipLinks","NavigationWithState","setup","selector","node","moduleInitialized","super","dispatch","fileName","IsUAEnabled","logoElement","navigationItem","searchIcon","smartCompanion","addEventListener","trackHomeLogo","href","event","linkElement","target","trackMenuItem","getLinkPath","getAttribute","trackOpenSearchLayer","trackSubmitSearchForm","trackOpenSmartCompanion","trackMenuItemSmartCompanion","resetMenuSessionValue","console","onSelectorError","destinationUrl","eventCategory","eventAction","eventLabel","eventNonInteraction","location","undefined","headerSearchForm","value","smartCompanionIcon","currentTarget","clickedElement","clickedElementListElement","pathObject","sessionStorage","getItem","tagName","childrenList","preventDefault","updateMenuSessionValue","innerText","resetMenuLevels","secondLevel","setItem","stringify","trackMobileLinkPath","key","thirdLevel","linkPath","firstLevel","navigationLevel","getNavigationLevel","secondLevelLink","firstLevelLink","thirdLevelLink","currentElement","returnPath","title","moveNavLeft","type","moveNavRight","openNav","closeNav","setNavStructure","structure"],"sourceRoot":""}