{"version":3,"file":"main.min.js","sources":["../../../Frontend/js/utils/windowResize.js","../../../Frontend/js/utils/scroll.js","../../../Frontend/js/utils/onReady.js","../../../Frontend/js/utils/elementProperties.js","../../../Frontend/js/utils/scrollLock.js","../../../Frontend/js/components/nav.js","../../../Frontend/js/utils/stickyNavOnScroll.js","../../../node_modules/promise-polyfill/src/finally.js","../../../node_modules/promise-polyfill/src/index.js","../../../node_modules/promise-polyfill/src/polyfill.js","../../../Frontend/js/utils/lazyImage.js","../../../Frontend/js/utils/animation.js","../../../Frontend/js/components/accordion.js","../../../Frontend/js/components/video.js","../../../Frontend/js/utils/helpers.js","../../../Frontend/js/utils/scrollTo.js","../../../Frontend/js/components/anchors.js","../../../Frontend/js/components/overlay.js","../../../Frontend/js/components/filter.js","../../../Frontend/js/components/image-to-video.js","../../../Frontend/js/components/tabs.js","../../../Frontend/js/components/entrances.js","../../../Frontend/js/components/newslist.js","../../../Frontend/js/components/gallery.js","../../../Frontend/js/components/calendarFilter.js","../../../Frontend/js/components/calendar.js","../../../Frontend/js/main.js","../../../Frontend/js/components/calendarAccordion.js"],"sourcesContent":["import settings from '../../settings.json';\r\n\r\nexport const breakpoints = settings.breakpoints;\r\nexport const breakpointKeys = Object.keys(breakpoints);\r\nexport let currentWindowWidth = window.innerWidth;\r\nexport let currentWindowHeight = window.innerHeight;\r\nexport let currentBreakpoint;\r\nexport let currentBreakpointIndex = 0;\r\nlet resizeTimer;\r\n\r\nconst resizeFunctions = [];\r\n\r\n/**\r\n * Get various window sizes - width, height etc.\r\n * This function is fired automatically upon page load. and run each time the window changes size.\r\n *\r\n */\r\nfunction getWindowSizes() {\r\n currentWindowWidth = window.innerWidth;\r\n currentWindowHeight = window.innerHeight;\r\n\r\n // Calculate which breakpoint is currently active, based on the screen width compared to the breakpoint definitions.\r\n\r\n let lastFoundWidth = 0;\r\n\r\n breakpointKeys.forEach((key, index) => {\r\n const width = breakpoints[key];\r\n if (currentWindowWidth >= width && width > lastFoundWidth) {\r\n lastFoundWidth = width;\r\n currentBreakpoint = key;\r\n currentBreakpointIndex = index;\r\n }\r\n });\r\n}\r\n\r\nfunction resizeHandler() {\r\n clearTimeout(resizeTimer);\r\n resizeTimer = setTimeout(() => {\r\n getWindowSizes();\r\n resizeFunctions.forEach(funcRef => funcRef());\r\n }, 100);\r\n}\r\n\r\nexport function onWindowResize(handler) {\r\n if (!currentBreakpoint) {\r\n initWindowResize();\r\n }\r\n\r\n resizeFunctions.push(handler);\r\n}\r\n\r\nexport function initWindowResize() { \r\n getWindowSizes();\r\n window.addEventListener('resize', resizeHandler);\r\n window.addEventListener('orientationchange', resizeHandler);\r\n}\r\n","export let scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\r\n\r\nlet ticking = false;\r\nconst scrollFunctions = [];\r\n\r\nfunction animate() {\r\n scrollFunctions.forEach(funcRef => funcRef());\r\n\r\n ticking = false;\r\n}\r\n\r\nanimate();\r\n\r\nfunction requestTick() {\r\n if (!ticking) {\r\n requestAnimationFrame(animate);\r\n ticking = true;\r\n }\r\n}\r\n\r\nfunction scrollHandler() {\r\n scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\r\n requestTick();\r\n}\r\n\r\nexport function onScroll(handler) {\r\n scrollFunctions.push(handler);\r\n}\r\n\r\nexport function initScroll() {\r\n window.addEventListener('scroll', scrollHandler);\r\n}","/**\r\n * Handler to trigger callbacks once the browser is ready for them.\r\n *\r\n * You can keep adding references using onReady() even after the page is loaded. In that case they will be\r\n * run at once.\r\n *\r\n * @example\r\n * import { onReady } from './utils/events/onReady';\r\n *\r\n * onReady(yourFunctionHere);\r\n *\r\n */\r\n\r\nlet functionReferences = [];\r\n\r\n// Set the initial readyState based on the browser's current state. If the script has been loaded\r\n// asynchronously, the DOM might be ready for us already, in which case there's no reason to delay\r\n// any further processing. The following will evaluate as true if the DOM is ready, or the page is\r\n// complete.\r\nlet readyState = document.readyState === 'interactive' || document.readyState === 'complete';\r\n\r\n// Defines whether or not the window.onReady event has been bound, so we won't do it twice. That\r\n// would just be stupid.\r\nlet readyEventBound = false;\r\n\r\n/**\r\n * Run the given array of callback functions.\r\n *\r\n * @private\r\n * @param {Array} funcArray\r\n */\r\nfunction runFunctionArray(funcArray) {\r\n funcArray.forEach(funcRef => funcRef());\r\n}\r\n\r\n/**\r\n * Empty the callback arrays\r\n *\r\n * @private\r\n */\r\nfunction emptyCallbackArrays() {\r\n // Keep iterating through the function references until there are none left.\r\n while (functionReferences.length) {\r\n // Set up a temporary array that mirrors the list of callbacks, and empty the real one.\r\n const tempArray = functionReferences.slice(0);\r\n functionReferences = [];\r\n\r\n // Run the callbacks. The callbacks themselves may set up more callbacks, which\r\n // is why we keep looping the array until we're done.\r\n runFunctionArray(tempArray);\r\n }\r\n\r\n // At this point we'll assume we're ready for anything!\r\n readyState = true;\r\n}\r\n\r\n/**\r\n * Make sure the \"ready\"-event is set.\r\n *\r\n * @private\r\n */\r\nfunction bindReadyEvent() {\r\n if (!readyEventBound) {\r\n if (document.readyState === 'loading') {\r\n // loading yet, wait for the event\r\n document.addEventListener('DOMContentLoaded', emptyCallbackArrays);\r\n } else {\r\n // DOM is ready!\r\n emptyCallbackArrays();\r\n }\r\n\r\n readyEventBound = true;\r\n }\r\n}\r\n\r\n/**\r\n * Register a function to run when the page is ready.\r\n *\r\n * @param {Function} functionReference - The function you want to run.\r\n */\r\nexport function onReady(functionReference) {\r\n if (typeof functionReference === 'function') {\r\n if (readyState) {\r\n functionReference();\r\n } else {\r\n bindReadyEvent();\r\n\r\n functionReferences.push(functionReference);\r\n }\r\n }\r\n}\r\n","/**\r\n * Utilities for checking properties and states of elements.\r\n */\r\n\r\n/**\r\n * Check if an element is empty.\r\n *\r\n * @param {Node} element - Check if this element is empty.\r\n * @param {boolean} [strict=true] - Set this to **false** to ignore nodes with whitespace.\r\n * @returns {boolean} **True** if the element is empty.\r\n */\r\nexport function elementIsEmpty(element, strict = true) {\r\n return strict ? !element.childNodes.length : !element.innerHTML.trim().length;\r\n}\r\n\r\n/**\r\n * Check if an element is hidden in the DOM with `display: none;`\r\n *\r\n * @param {HTMLElement} element - The element to check.\r\n * @returns {boolean} **True** if element is hidden, otherwise **false**.\r\n */\r\nexport function elementIsHidden(element) {\r\n return element.offsetParent === null;\r\n}\r\n\r\n/**\r\n * Check if an element is in the viewport\r\n * \r\n * @param {HTMLElement} elem - The element to check \r\n */\r\nexport function isVisible(elem) {\r\n return !!elem && !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);\r\n}\r\n\r\n/**\r\n * Find out whether or not the given argument is an element that would react somewhat normally to DOM-manipulations.\r\n *\r\n * @param {*} element - The element to check.\r\n * @returns {boolean} `true` if the given argument is an element (or document, or window), and `false` otherwise.\r\n */\r\nexport function isElement(element) {\r\n return element instanceof Element || element instanceof Document || element instanceof Window;\r\n}\r\n\r\n/**\r\n * Return the position of an element\r\n *\r\n * @param {Element|String} element - The HTML element to work with or its ID\r\n * @param {Element|String|Window} [relativeTo=window] - The HTML element to return the position relative to or its ID\r\n * @returns {{top: Number, left: Number}} An object with top and left positions in pixels\r\n *\r\n *\r\n * @example