{"version":3,"sources":["app.js"],"names":["registerComponents","components","onLoad","context","arguments","length","undefined","document","elementsToFadeInUpOnScroll","Document","config","querySelectorAll","menu","window","addEventListener","forEach","element","positionFromTop","getBoundingClientRect","top","innerHeight","classList","add","link","e","preventDefault","href","getAttribute","target","querySelector","offsetTop","currentElement","offsetParent","scroll","behavior","MmenuLight","drawer","navigation","slidingSubmenus","title","offcanvas","position","open"],"mappings":"MAAA,4BACAA,kBAAA,KAAA,yBACAC,eAAA,wBACA,eACA,sCAMA,SAAAC,SAAA,IAAAC,EAAA,EAAAC,UAAAC,QAAAC,KAAAA,IAAAF,UAAA,GAAAA,UAAA,GAAAG,SAMAC,GAJAL,aAAAM,UAAA,CAAA,IAAAC,OAAAV,oBACAA,mBAAAC,UAAA,EAGAE,EAAAQ,iBAAA,2HAAA,GAsCAC,GApCA,EAAAJ,EAAAH,QACAQ,OAAAC,iBAAA,SAAA,WACAN,EAAAO,QAAA,SAAAC,GACA,IAAAC,EAAAD,EAAAE,sBAAA,EAAAC,IAEAF,GAAAJ,OAAAO,aAAA,GAAAH,GACAD,EAAAK,UAAAC,IAAA,YAAA,CACA,CAAA,CACA,CAAA,EAIAnB,EAAAQ,iBAAA,YAAA,EAAAI,QAAA,SAAAQ,GACAA,EAAAT,iBAAA,QAAA,SAAAU,GACAA,EAAAC,eAAA,EASA,IAPA,IAAAC,EAAAH,EAAAI,aAAA,MAAA,EACAC,EAAAzB,EAAA0B,cAAAH,CAAA,EAGAI,EAAAF,EAAAE,UACAC,EAAAH,EAEA,OAAAG,EAAAC,cAEAF,IADAC,EAAAA,EAAAC,cACAF,UAGAjB,OAAAoB,OAAA,CACAd,IAAAW,EACAI,SAAA,QACA,CAAA,CACA,CAAA,CACA,CAAA,EAGA,IAAAC,WAAA5B,SAAAsB,cAAA,cAAA,EAAA,oBAAA,GAiBAO,GAfAxB,EAAAyB,WAAA,CACAC,gBAAA,CAAA,EACAC,MAAA,MACA,CAAA,EAYA3B,EAAA4B,UAAA,CATAC,SAAA,MACA,CAAA,GAGAlC,SAAAsB,cAAA,6BAAA,EACAf,iBAAA,QAAA,SAAAU,GACAA,EAAAC,eAAA,EACAW,EAAAM,KAAA,CACA,CAAA,CACA,CA/DAnC,OAAAA,EAAAA,SAAAO,iBAAA,oBAAA,SAAAU,GAAA,OAAAtB,OAAAsB,EAAAI,MAAA,CAAA,CAAA,SAEA1B,MA6DA","file":"app.js","sourcesContent":["import 'bootstrap.collapse';\r\nimport { registerComponents } from 'component-utils';\r\nimport components from 'core-components';\r\nimport 'global';\r\nimport '/assets/theme/js/mmenu-light.js?v=2';\r\n\r\nonLoad();\r\n\r\ndocument.addEventListener('DOMContentUpdated', e => onLoad(e.target));\r\n\r\nexport function onLoad(context = document) {\r\n // Register the components (if applicable).\r\n if (context instanceof Document && config.registerComponents !== false)\r\n registerComponents(components);\r\n\r\n // Scroll reveal styles.\r\n const elementsToFadeInUpOnScroll = context.querySelectorAll('.scroll-reveal, .key-point, .contact-bar, .gallery-link, .latest-news.articles, .testimonial-box, .grid-item, .case-study');\r\n\r\n if (elementsToFadeInUpOnScroll.length > 0) {\r\n window.addEventListener('scroll', () => {\r\n elementsToFadeInUpOnScroll.forEach(element => {\r\n let positionFromTop = element.getBoundingClientRect().top;\r\n\r\n if (positionFromTop <= window.innerHeight && positionFromTop >= 0)\r\n element.classList.add('fade-in-up');\r\n });\r\n });\r\n }\r\n\r\n // Scroll To\r\n context.querySelectorAll('.scroll-to').forEach(link => {\r\n link.addEventListener('click', e => {\r\n e.preventDefault();\r\n\r\n const href = link.getAttribute('href'); // Use 'link' instead of 'this'.\r\n const target = context.querySelector(href);\r\n\r\n // Calculate the offsetTop including the offset of all parent elements.\r\n let offsetTop = target.offsetTop;\r\n let currentElement = target;\r\n\r\n while (currentElement.offsetParent !== null) {\r\n currentElement = currentElement.offsetParent;\r\n offsetTop += currentElement.offsetTop;\r\n }\r\n\r\n window.scroll({\r\n top: offsetTop,\r\n behavior: 'smooth'\r\n });\r\n });\r\n });\r\n\r\n // Mobile Menu\r\n const menu = new MmenuLight(document.querySelector('#menu-navbar'), '(max-width: 992px)');\r\n\r\n menu.navigation({\r\n slidingSubmenus: true,\r\n title: 'Menu'\r\n });\r\n\r\n const drawer = menu.offcanvas({\r\n position: 'left'\r\n });\r\n\r\n // Open the menu.\r\n document.querySelector('button[href=\"#menu-navbar\"]')\r\n .addEventListener('click', e => {\r\n e.preventDefault();\r\n drawer.open();\r\n });\r\n}"]}