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,EAAOpF,SAASqF,KAAKF,UAAY,KAAOnF,SAASsF,gBAAgBH,UAAY,IAC/EzE,EAAY6E,eACZjE,QAAQC,IAAsB,QAC9B6D,EACAF,EAAY/E,UAAUC,IAAI4E,GAE1BE,EAAY/E,UAAUE,OAAO2E,EACrC,CACA,SAASG,IACLzF,OAAO8F,SAAS,CAAErE,IAAK,EAAGsE,SAAU,UACxC,CAvBAjF,EAAQpB,UAJR,WACIkC,QAAQC,IAAI,eAKRb,EAAYW,OACZC,QAAQC,IAAI,yBAChBvB,SAASE,iBAAiB,SAAU+E,EALxC,C,cCRA3E,OAAOC,eAAeC,EAAS,aAAc,CAAEC,OAAO,IACtDD,EAAQkF,gBAAkBlF,EAAQS,kBAAoBT,EAAQI,OAASJ,EAAQ+E,cAAgB/E,EAAQa,WAAQ,EAC/Gb,EAAQa,OAAQ,EAChBb,EAAQ+E,cAAgB/E,EAAQa,QAAS,EACzCb,EAAQI,OAAS,QACjBJ,EAAQS,kBAAoB,GAAGT,EAAQI,qBACvCJ,EAAQkF,gBAAkB,GAAGlF,EAAQI,kB,GCNjC+E,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAatF,QAGrB,IAAIwF,EAASL,EAAyBE,GAAY,CAGjDrF,QAAS,CAAC,GAOX,OAHAyF,EAAoBJ,GAAUG,EAAQA,EAAOxF,QAASoF,GAG/CI,EAAOxF,OACf,CCpBAoF,EAAoB,KAEpBA,EAAoB,KACpBA,EAAoB,KACpBA,EAAoB,IACpBA,EAAoB,KACpBA,EAAoB,KACMA,EAAoB,I","sources":["webpack://2sic-standard-skin-template/./src/scripts/ambient/background.ts","webpack://2sic-standard-skin-template/./src/scripts/ambient/breadcrumbs.ts","webpack://2sic-standard-skin-template/./src/scripts/ambient/gtm.ts","webpack://2sic-standard-skin-template/./src/scripts/ambient/mail-encrypt.ts","webpack://2sic-standard-skin-template/./src/scripts/ambient/menu.ts","webpack://2sic-standard-skin-template/./src/scripts/ambient/pdf-in-new-window.ts","webpack://2sic-standard-skin-template/./src/scripts/ambient/to-top.ts","webpack://2sic-standard-skin-template/./src/scripts/shared/constants.ts","webpack://2sic-standard-skin-template/webpack/bootstrap","webpack://2sic-standard-skin-template/webpack/startup"],"sourcesContent":["\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst mail_encrypt_1 = require(\"./mail-encrypt\");\r\nconst menu_1 = require(\"./menu\");\r\nconst breadcrumbs_1 = require(\"./breadcrumbs\");\r\nconst pdf_in_new_window_1 = require(\"./pdf-in-new-window\");\r\nconst to_top_1 = require(\"./to-top\");\r\nconst gtm_1 = require(\"./gtm\");\r\n// import * as AOS from \"aos\";\r\n// import './breadcrumbs';\r\n(0, to_top_1.initToTop)();\r\n(0, pdf_in_new_window_1.openPdfInNewWindow)();\r\n(0, mail_encrypt_1.initMailDecrypt)();\r\n(0, breadcrumbs_1.initBreadcrumb)();\r\n(0, menu_1.initOffCanvasEvents)();\r\n(0, gtm_1.buildCre8magicGtm)();\r\nwindow.cre8magic.gtm.activate('GTM-T8W5TBL');\r\n// 2022-11-15 2dm - disable AOS for now, causes too much trouble\r\n// AOS.init({\r\n// // Global settings:\r\n// // Disable inspired by https://github.com/michalsnik/aos/issues/161\r\n// // Should help that google still sees the content\r\n// // But doesn't seem to work...\r\n// disable: true,\r\n// // (\r\n// // /bot|crawler|spider|crawling/i.test(navigator.userAgent)\r\n// // || window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches\r\n// // ),\r\n// startEvent: 'DOMContentLoaded', // name of the event dispatched on the document, that AOS should initialize on\r\n// initClassName: 'aos-init', // class applied after initialization\r\n// debounceDelay: 50, // the delay on debounce used while resizing window (advanced)\r\n// throttleDelay: 99, // the delay on throttle used while scrolling the page (advanced)\r\n// // Settings that can be overridden on per-element basis, by `data-aos-*` attributes:\r\n// offset: 50, // offset (in px) from the original trigger point\r\n// delay: 50, // values from 0 to 3000, with step 50ms\r\n// duration: 800, // values from 0 to 3000, with step 50ms\r\n// easing: 'ease-in-out', // default easing for AOS animations\r\n// once: false, // whether animation should happen only once - while scrolling down\r\n// mirror: false, // whether elements should animate out while scrolling past them\r\n// anchorPlacement: 'top-bottom', // defines which position of the element regarding to window should trigger the animation\r\n// });\r\n//use window.scrollY\r\nvar scrollpos = window.scrollY;\r\nvar header = document.getElementById(\"theme-page-navigation\");\r\nfunction add_class_on_scroll() {\r\n header.classList.add(\"bg-gray-900\");\r\n}\r\nfunction remove_class_on_scroll() {\r\n header.classList.remove(\"bg-gray-900\");\r\n}\r\nwindow.addEventListener('scroll', function () {\r\n //Here you forgot to update the value\r\n scrollpos = window.scrollY;\r\n if (scrollpos > 10) {\r\n add_class_on_scroll();\r\n }\r\n else {\r\n remove_class_on_scroll();\r\n }\r\n});\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.initBreadcrumb = void 0;\r\nconst constants_1 = require(\"../shared/constants\");\r\nfunction initBreadcrumb() {\r\n if (constants_1.debug)\r\n console.log(\"init breadcrumbs\");\r\n setBreadcrumbsStyling();\r\n window.addEventListener(\"resize\", setBreadcrumbsStyling);\r\n document.addEventListener('scroll', setBreadcrumbsStyling);\r\n var breadCrumbTrigger = document.querySelector(`.${constants_1.prefixBreadcrumbs}-trigger`);\r\n if (breadCrumbTrigger != null) {\r\n breadCrumbTrigger.addEventListener('click', () => {\r\n console.log(document.querySelector(`.${constants_1.prefixBreadcrumbs}`));\r\n document.querySelector(`.${constants_1.prefixBreadcrumbs}`).classList.toggle(`${constants_1.prefixBreadcrumbs}-open`);\r\n });\r\n }\r\n}\r\nexports.initBreadcrumb = initBreadcrumb;\r\nfunction setBreadcrumbsStyling() {\r\n var header = document.getElementById(`${constants_1.prefix}-page-navigation`);\r\n if (header != null) {\r\n var headerHeight = header.offsetHeight;\r\n var breadcrumbs = document.querySelector(`.${constants_1.prefixBreadcrumbs}`);\r\n breadcrumbs.style.top = headerHeight + \"px\";\r\n var breadcrumbsOffsetTop = breadcrumbs.getBoundingClientRect().top;\r\n if (breadcrumbsOffsetTop <= headerHeight && scrollY != 0) {\r\n breadcrumbs.classList.add(\"bg-gray-900\", \"shadow\");\r\n }\r\n else {\r\n breadcrumbs.classList.remove(\"bg-gray-900\", \"shadow\");\r\n }\r\n }\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.buildCre8magicGtm = void 0;\r\nconst constants_1 = require(\"../shared/constants\");\r\n// Temporary solution to add GTM, not final!\r\nconst debugGtm = constants_1.debug || true;\r\nfunction activateGtm(gtmKey) {\r\n if (debugGtm)\r\n console.log('2dm test activate GTM');\r\n // \r\n // \r\n // \r\n}\r\nclass GtmInterop {\r\n constructor() {\r\n this.activate = activateGtm;\r\n }\r\n pageView() {\r\n if (debugGtm)\r\n console.log('gtm-interop - track page view');\r\n gtag('event', 'blazor_page_view'); //\r\n }\r\n}\r\nwindow.dataLayer = window.dataLayer || [];\r\nfunction gtag(target, more) {\r\n if (constants_1.debug)\r\n console.log('gtm - gtag');\r\n window.dataLayer.push(arguments);\r\n}\r\nfunction buildCre8magicGtm() {\r\n window.cre8magic = window.cre8magic || {};\r\n window.cre8magic.gtm = window.cre8magic.gtm || new GtmInterop();\r\n window.gtag = window.gtag || gtag;\r\n}\r\nexports.buildCre8magicGtm = buildCre8magicGtm;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.initMailDecrypt = void 0;\r\nconst constants_1 = require(\"../shared/constants\");\r\nfunction initMailDecrypt() {\r\n if (constants_1.debug)\r\n console.log('initMailDecrypt');\r\n /* mailencrypting */\r\n setTimeout(function () {\r\n let mailElement = document.querySelectorAll('[data-madr1]:not(.madr-done)');\r\n mailElement.forEach((mail, index) => {\r\n const maddr = mail.getAttribute('data-madr1') + '@' + mail.getAttribute('data-madr2') + '.' + mail.getAttribute('data-madr3');\r\n const linktext = mail.getAttribute('data-linktext') ? mail.getAttribute('data-linktext') : maddr;\r\n const a = document.createElement('a');\r\n a.setAttribute('href', `mailto:${maddr}`);\r\n a.innerHTML = linktext;\r\n if (mail.parentElement)\r\n mail.parentElement.appendChild(a);\r\n mail.classList.add('madr-done');\r\n mail.style.display = 'none';\r\n });\r\n }, 500);\r\n}\r\nexports.initMailDecrypt = initMailDecrypt;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.initOffCanvasEvents = void 0;\r\nconst constants_1 = require(\"../shared/constants\");\r\n// Takes care of closing the offcanvas when clicking on a navigation link\r\n// The page is not reloaded, so the offcanvas does not close\r\nfunction initOffCanvasEvents() {\r\n if (constants_1.debug)\r\n console.log('initOffCanvasEvents');\r\n //Offcanvas close on link click\r\n var navLinks = document.querySelectorAll(\".mobile-navigation-link\");\r\n var navOffcanvas = document.getElementById('offcanvasNavbar');\r\n var bsNavOffcanvas = new bootstrap.Offcanvas(navOffcanvas);\r\n navLinks.forEach(element => {\r\n element.addEventListener('click', () => {\r\n bsNavOffcanvas.hide();\r\n });\r\n });\r\n}\r\nexports.initOffCanvasEvents = initOffCanvasEvents;\r\n","\"use strict\";\r\n// TODO: THIS PROBABLY doesn't work reliably, as it would need to be called again when the page changes\r\n// will probably need to be moved to the interop and called on every reload\r\n// or use a timeout similar to mail-decrypt\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.openPdfInNewWindow = void 0;\r\n/* Open all PDF links in a new window */\r\nfunction openPdfInNewWindow() {\r\n document.querySelectorAll('a').forEach((linkElem, index) => {\r\n if (linkElem.hasAttribute('href') && linkElem.getAttribute('href').endsWith('.pdf')) {\r\n linkElem.setAttribute('target', '_blank');\r\n }\r\n });\r\n}\r\nexports.openPdfInNewWindow = openPdfInNewWindow;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.initToTop = void 0;\r\nconst constants_1 = require(\"../shared/constants\");\r\nconst toTopElementId = `${constants_1.prefix}-to-top`;\r\nconst visibleClass = `visible`;\r\nfunction initToTop() {\r\n console.log('init to top');\r\n toTopShowHideOnScroll();\r\n}\r\nexports.initToTop = initToTop;\r\nfunction toTopShowHideOnScroll() {\r\n if (constants_1.debug)\r\n console.log('toTopShowHideOnScroll');\r\n document.addEventListener(\"scroll\", toTopButtonVisibility);\r\n}\r\nfunction toTopButtonVisibility() {\r\n var toTopButton = document.getElementById(toTopElementId);\r\n if (!toTopButton)\r\n return;\r\n // Ensure it has the event listener\r\n toTopButton.addEventListener(\"click\", scrollTop);\r\n // Todo: unsure why it does body + documentElement...\r\n const show = document.body.scrollTop > 200 || document.documentElement.scrollTop > 200;\r\n if (constants_1.debugDetailed)\r\n console.log('to-top' + show ? \"show\" : \"hide\");\r\n if (show)\r\n toTopButton.classList.add(visibleClass);\r\n else\r\n toTopButton.classList.remove(visibleClass);\r\n}\r\nfunction scrollTop() {\r\n window.scrollTo({ top: 0, behavior: 'smooth' });\r\n}\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.prefixLanguages = exports.prefixBreadcrumbs = exports.prefix = exports.debugDetailed = exports.debug = void 0;\r\nexports.debug = true;\r\nexports.debugDetailed = exports.debug && false;\r\nexports.prefix = 'theme';\r\nexports.prefixBreadcrumbs = `${exports.prefix}-breadcrumbs`;\r\nexports.prefixLanguages = `${exports.prefix}-languages`;\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\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.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](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// startup\n// Load entry module and return exports\n__webpack_require__(565);\n// This entry module is referenced by other modules so it can't be inlined\n__webpack_require__(693);\n__webpack_require__(227);\n__webpack_require__(77);\n__webpack_require__(231);\n__webpack_require__(758);\nvar __webpack_exports__ = __webpack_require__(657);\n"],"names":["mail_encrypt_1","menu_1","breadcrumbs_1","pdf_in_new_window_1","to_top_1","gtm_1","initToTop","openPdfInNewWindow","initMailDecrypt","initBreadcrumb","initOffCanvasEvents","buildCre8magicGtm","window","cre8magic","gtm","activate","scrollY","header","document","getElementById","addEventListener","classList","add","remove","Object","defineProperty","exports","value","constants_1","setBreadcrumbsStyling","prefix","headerHeight","offsetHeight","breadcrumbs","querySelector","prefixBreadcrumbs","style","top","getBoundingClientRect","debug","console","log","breadCrumbTrigger","toggle","debugGtm","activateGtm","gtmKey","w","d","s","l","i","push","Date","getTime","event","f","getElementsByTagName","j","createElement","async","src","parentNode","insertBefore","GtmInterop","constructor","this","pageView","gtag","target","more","dataLayer","arguments","setTimeout","querySelectorAll","forEach","mail","index","maddr","getAttribute","linktext","a","setAttribute","innerHTML","parentElement","appendChild","display","navLinks","navOffcanvas","bsNavOffcanvas","bootstrap","Offcanvas","element","hide","linkElem","hasAttribute","endsWith","toTopElementId","visibleClass","toTopButtonVisibility","toTopButton","scrollTop","show","body","documentElement","debugDetailed","scrollTo","behavior","prefixLanguages","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","module","__webpack_modules__"],"sourceRoot":""}