{"version":3,"file":"custom.min.js","names":["document","addEventListener","header","querySelector","isMobile","window","innerWidth","toggleHeaderClass","scrollY","classList","add","remove","moveElements","currentMobileState","element","desktop","mobile","forEach","target","getElementById","newParent","appendChild","console","log","func","delay","inDebounce","context","this","args","arguments","clearTimeout","setTimeout","apply","debounce","contactForm","contactFormTarget"],"sources":["custom.js"],"sourcesContent":["/*jshint esversion: 6 */\r\ndocument.addEventListener('DOMContentLoaded', () => {\r\n const header = document.querySelector('header.sticky-top');\r\n const breakpoint = 992;\r\n const scrollThreshold = 49;\r\n let isMobile = window.innerWidth < breakpoint;\r\n\r\n const toggleHeaderClass = () => {\r\n if (window.scrollY > scrollThreshold) {\r\n header.classList.add('is-pinned');\r\n } else {\r\n header.classList.remove('is-pinned');\r\n }\r\n };\r\n\r\n const moveElements = () => {\r\n const currentMobileState = window.innerWidth < breakpoint;\r\n if (currentMobileState !== isMobile) {\r\n isMobile = currentMobileState;\r\n }\r\n\r\n const elementsToMove = [\r\n { element: 'header-cta-wrapper', desktop: 'header-cta-desktop', mobile: 'header-cta-mob' }\r\n ];\r\n\r\n elementsToMove.forEach(({ element, desktop, mobile }) => {\r\n const target = document.getElementById(element);\r\n const newParent = isMobile ? document.getElementById(mobile) : document.getElementById(desktop);\r\n if(target != null){\r\n newParent.appendChild(target);\r\n }\r\n console.log(`Moved to ${isMobile ? 'mobile' : 'desktop'}`);\r\n });\r\n };\r\n\r\n const debounce = (func, delay) => {\r\n let inDebounce;\r\n return function() {\r\n const context = this;\r\n const args = arguments;\r\n clearTimeout(inDebounce);\r\n inDebounce = setTimeout(() => func.apply(context, args), delay);\r\n };\r\n };\r\n\r\n // Initialize\r\n toggleHeaderClass();\r\n moveElements();\r\n\r\n // Event listeners\r\n window.addEventListener('scroll', toggleHeaderClass);\r\n window.addEventListener('resize', debounce(moveElements, 100));\r\n\r\n\r\n\r\n // move form inside the form wrapper\r\n const contactFormWrapper = document.querySelector('body:not(.dnnEditState) #form-extra-content');\r\n const contactForm = document.querySelector('body:not(.dnnEditState) #dnn_BottomFormPane .LiveForm.Default');\r\n const contactFormTarget = document.querySelector('body:not(.dnnEditState) #js-form-target');\r\n\r\n if (contactForm && contactFormTarget) {\r\n contactFormTarget.appendChild(contactForm);\r\n }\r\n});"],"mappings":"AACAA,SAASC,iBAAiB,oBAAoB,KAC1C,MAAMC,EAASF,SAASG,cAAc,qBAGtC,IAAIC,EAAWC,OAAOC,WAFH,IAInB,MAAMC,EAAoB,KAClBF,OAAOG,QAJS,GAKhBN,EAAOO,UAAUC,IAAI,aAErBR,EAAOO,UAAUE,OAAO,YAC5B,EAGEC,EAAe,KACjB,MAAMC,EAAqBR,OAAOC,WAbnB,IAcXO,IAAuBT,IACvBA,EAAWS,GAGQ,CACnB,CAAEC,QAAS,qBAAsBC,QAAS,qBAAsBC,OAAQ,mBAG7DC,SAAQ,EAAGH,UAASC,UAASC,aACxC,MAAME,EAASlB,SAASmB,eAAeL,GACjCM,EAAYhB,EAAWJ,SAASmB,eAAeH,GAAUhB,SAASmB,eAAeJ,GAC1E,MAAVG,GACCE,EAAUC,YAAYH,GAE1BI,QAAQC,IAAI,aAAYnB,EAAW,SAAW,WAAY,GAC5D,EAcNG,IACAK,IAGAP,OAAOJ,iBAAiB,SAAUM,GAClCF,OAAOJ,iBAAiB,SAhBP,EAACuB,EAAMC,KACpB,IAAIC,EACJ,OAAO,WACH,MAAMC,EAAUC,KACVC,EAAOC,UACbC,aAAaL,GACbA,EAAaM,YAAW,IAAMR,EAAKS,MAAMN,EAASE,IAAOJ,EAC7D,CAAC,EAS6BS,CAAStB,EAAc,MAK9BZ,SAASG,cAAc,+CAAlD,MACMgC,EAAcnC,SAASG,cAAc,iEACrCiC,EAAoBpC,SAASG,cAAc,2CAE7CgC,GAAeC,GACfA,EAAkBf,YAAYc,EAClC"}