{"version":3,"file":"Boerneraadet.bundle.js","sources":["webpack://Boerneraadet/./Src/Scripts/architecture/componentRepository.js","webpack://Boerneraadet/webpack/bootstrap","webpack://Boerneraadet/webpack/runtime/define property getters","webpack://Boerneraadet/webpack/runtime/ensure chunk","webpack://Boerneraadet/webpack/runtime/get javascript chunk filename","webpack://Boerneraadet/webpack/runtime/global","webpack://Boerneraadet/webpack/runtime/hasOwnProperty shorthand","webpack://Boerneraadet/webpack/runtime/load script","webpack://Boerneraadet/webpack/runtime/make namespace object","webpack://Boerneraadet/webpack/runtime/publicPath","webpack://Boerneraadet/webpack/runtime/jsonp chunk loading","webpack://Boerneraadet/./Src/Scripts/index.js"],"sourcesContent":["export default class ComponentRepository {\r\n constructor(componentSourceMap) {\r\n // The property name is the key used to instantiate the component.\r\n // The property value is the path of the file (navigated from the scripts folder) excluded the file ending.\r\n // The order they appear in the sourcemap will affect the order they are instantiated in.\r\n // Shared components should generally be instantiated before controllers.\r\n this.componentSourceMap = componentSourceMap;\r\n\r\n this.componentClassPromiseMap = {}; // Will hold promises for all for classes needed to instantiate components\r\n this.globalInstances = {}; // Will hold components with a data-component-id, that can be queried globally\r\n this.loadedComponents = {}; // Will hold all loaded component instances\r\n\r\n // initializedPromise will resolve when the load function has run and all components have been initialized.\r\n this.initializedPromiseResolve = null;\r\n this.initializedPromiseReject = null;\r\n this.initializedPromise = new Promise((resolve, reject) => {\r\n this.initializedPromiseResolve = resolve;\r\n this.initializedPromiseReject = reject;\r\n });\r\n\r\n // Load all classes required for the components on the current page.\r\n for (const componentKey in this.componentSourceMap) {\r\n if (document.querySelector('[data-component=\"' + componentKey + '\"]')) {\r\n this.loadComponentClass(componentKey);\r\n }\r\n }\r\n\r\n this.load();\r\n }\r\n\r\n /*\r\n * Iterates all elements in the DOM with the 'data-component' attribute,\r\n * and instantiates the corresponding component.\r\n * Returns a promise that will resolve when all components have been instantiated or have failed.\r\n */\r\n load() {\r\n const loadComponentsPromiseArray = [];\r\n\r\n document.querySelectorAll('[data-component]').forEach(c => {\r\n const componentKey = c.getAttribute('data-component');\r\n const componentId = c.getAttribute('data-component-id');\r\n const componentArgs = c.getAttribute('data-component-args');\r\n\r\n\r\n\r\n if (this.componentClassPromiseMap[componentKey]) {\r\n const loadPromise = new Promise((resolve, reject) => {\r\n this.componentClassPromiseMap[componentKey]\r\n .then(Component => {\r\n let args = null;\r\n if (componentArgs) {\r\n args = JSON.parse(componentArgs);\r\n }\r\n\r\n const newComponentInstance = new Component(c, args);\r\n\r\n if (!this.loadedComponents[componentKey]) {\r\n this.loadedComponents[componentKey] = [];\r\n }\r\n this.loadedComponents[componentKey].push(newComponentInstance);\r\n\r\n // If the component has a component ID, add it to globalInstances\r\n if (componentId) {\r\n this.globalInstances[componentId] = newComponentInstance;\r\n }\r\n\r\n resolve(newComponentInstance);\r\n })\r\n .catch(error => {\r\n console.error('Error instantiating component: ', componentKey, error);\r\n reject();\r\n });\r\n });\r\n loadComponentsPromiseArray.push(loadPromise);\r\n } else {\r\n console.warn('unable to find component: ', componentKey);\r\n }\r\n });\r\n\r\n return Promise.all(loadComponentsPromiseArray)\r\n .then(() => {\r\n this.initializedPromiseResolve();\r\n });\r\n }\r\n\r\n /**\r\n * Returns a promise that will eventually resolve with\r\n * the class corresponsing the component key.\r\n */\r\n loadComponentClass(key) {\r\n if (this.componentClassPromiseMap[key]) {\r\n return this.componentClassPromiseMap[key];\r\n }\r\n\r\n // If the requested class is not specified in the source map, return a failed promise.\r\n if (!this.componentSourceMap[key])\r\n {\r\n return new Promise((resolve, reject) => {\r\n reject();\r\n });\r\n }\r\n\r\n this.componentClassPromiseMap[key] = this.componentSourceMap[key]()\r\n .then(componentLoad => {\r\n return componentLoad.default;\r\n });\r\n return this.componentClassPromiseMap[key];\r\n }\r\n\r\n\r\n /**\r\n * Returns a promise that will eventually resolve with\r\n * a specific instance of a component, based on its ID.\r\n */\r\n getGlobalInstance(instanceId) {\r\n return this.initializedPromise\r\n .then(() => {\r\n return instanceId ? this.globalInstances[instanceId] : undefined;\r\n });\r\n }\r\n\r\n\r\n /**\r\n * Returns a promise that will eventually resolve with\r\n * all instances of a specific type.\r\n */\r\n getInstancesOfType(key) {\r\n return this.initializedPromise\r\n .then(() => {\r\n return this.loadedComponents[key];\r\n });\r\n }\r\n}\r\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tif(__webpack_module_cache__[moduleId]) {\n\t\treturn __webpack_module_cache__[moduleId].exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".\" + {\"Src_Scripts_components_top-navigation_js\":\"2c27d6616cb86cabaf40\",\"Src_Scripts_components_hero-swiper_js\":\"11c2069b90ec6a49b39b\",\"vendors-node_modules_swiper_swiper_esm_js\":\"7d5d4f3e45d69c239f8e\",\"Src_Scripts_components_short-content-swiper_js\":\"3ac978292e835bbd64ac\",\"Src_Scripts_components_content-grid-swiper_js\":\"37cfc154f8f2a01a092d\",\"Src_Scripts_components_knowledge-swiper_js\":\"5b19a993ba07ba2a7243\",\"Src_Scripts_components_image-gallery_js\":\"0943fe6f448911b6d624\",\"Src_Scripts_components_accordion_js\":\"e7285ebb03fad02b8b48\",\"Src_Scripts_components_mobile-navigation_js\":\"191d9149ce93cc44c427\",\"vendors-node_modules_vimeo_player_dist_player_es_js\":\"17b9e8815e5a24b6156f\",\"Src_Scripts_components_media-with-video_js\":\"8fb78cc5ae4ce469b0de\",\"vendors-node_modules_swiper_swiper-bundle_js\":\"1d15b9783d6f3488ee29\",\"Src_Scripts_components_modal_js\":\"cb7faf91482ef0177db5\",\"Src_Scripts_components_map_js\":\"ac5183319250baad1643\",\"Src_Scripts_components_grid-item_js\":\"2c678758e479517fce38\",\"vendors-node_modules_masonry-layout_masonry_js\":\"5a81527618451447c57a\",\"Src_Scripts_components_knowledge-search_js\":\"d33b743dfd8ac1d51c63\",\"Src_Scripts_components_site-search_js\":\"7b4c41da7b25fb2917ca\",\"Src_Scripts_components_latest-knowledge_js\":\"437298fe2181d2a296ca\",\"Src_Scripts_components_animated-line_js\":\"c3621c17458608313ae7\",\"Src_Scripts_components_knowledge-article_js\":\"beca05b95233dc87440a\",\"Src_Scripts_components_maillist-signup_js\":\"4b32334c5f555daa7f5b\",\"Src_Scripts_components_checkbox_js\":\"85f48f1b223f18030e16\",\"Src_Scripts_components_footnote_js\":\"5ad61fc9e4175be3c96b\"}[chunkId] + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop)","var inProgress = {};\nvar dataWebpackPrefix = \"Boerneraadet:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => fn(event));\n\t\tif(prev) return prev(event);\n\t}\n\t;\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/Frontend/Scripts/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// Promise = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"Boerneraadet\": 0\n};\n\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => {\n\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n\t\t\t\t\t});\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no deferred startup\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0, resolves = [];\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tresolves.push(installedChunks[chunkId][0]);\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\tfor(moduleId in moreModules) {\n\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t}\n\t}\n\tif(runtime) runtime(__webpack_require__);\n\tparentChunkLoadingFunction(data);\n\twhile(resolves.length) {\n\t\tresolves.shift()();\n\t}\n\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunkBoerneraadet\"] = globalThis[\"webpackChunkBoerneraadet\"] || [];\nvar parentChunkLoadingFunction = chunkLoadingGlobal.push.bind(chunkLoadingGlobal);\nchunkLoadingGlobal.push = webpackJsonpCallback;","import ComponentRepository from './architecture/componentRepository';\r\n\r\ndocument.addEventListener('DOMContentLoaded', function () {\r\n window.cr = new ComponentRepository({\r\n 'header': () => import('./components/top-navigation'),\r\n 'hero-swiper': () => import('./components/hero-swiper'),\r\n 'short-content-swiper': () => import('./components/short-content-swiper'),\r\n 'content-grid-swiper': () => import('./components/content-grid-swiper'),\r\n 'knowledge-swiper': () => import('./components/knowledge-swiper'),\r\n 'image-gallery': () => import('./components/image-gallery'),\r\n 'accordion': () => import('./components/accordion'),\r\n 'top-navigation': () => import('./components/top-navigation'),\r\n 'mobile-navigation': () => import('./components/mobile-navigation'),\r\n 'media-with-video': () => import('./components/media-with-video'),\r\n 'swiper': () => import('../../node_modules/swiper/swiper-bundle.js'),\r\n 'modal': () => import('./components/modal'),\r\n 'map': () => import('./components/map'),\r\n 'grid-item': () => import('./components/grid-item'),\r\n 'knowledge-search': () => import('./components/knowledge-search'),\r\n 'site-search': () => import('./components/site-search'),\r\n 'latest-knowledge': () => import('./components/latest-knowledge'),\r\n 'animated-line': () => import('./components/animated-line'),\r\n 'knowledge-article': () => import('./components/knowledge-article'),\r\n 'maillist-signup': () => import('./components/maillist-signup'),\r\n 'checkbox': () => import('./components/checkbox'),\r\n 'footnote': () => import('./components/footnote'),\r\n /*\r\n This is an example component that demonstrates how to implement a filterable map. It should not be used in production sites as is but can serve as inspiration.\r\n 'domain-filterable-map': () => import('./components/example-components/example-domain-filterable-map'),\r\n */\r\n });\r\n});\r\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAA;AACA;AAAA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AACA;AACA;AAGA;AACA;AACA;AAEA;AACA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AADA;AACA;AAEA;AACA;AACA;AACA;AApIA;AACA;A;;A;;;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACRA;AACA;AACA;AACA;AACA;;;;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACPA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACNA;;;;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;ACzFA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3BA;AA4BA;;;;A","sourceRoot":""}