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UACnBrB,EAAWS,UAAUO,OAAO,cAC5BO,EAAQZ,MAAMS,QAAU,MAC5B,GAAG,CACCK,SAAS,EACTC,MAAM,EACNC,SAAS,IAGrB,CA/FY7B,SAAS8B,eAAe,UAE9B1B,iBAAiB,YAAY,SAAS2B,GAEtB,UAAdA,EAAMC,MAERD,EAAME,iBAENjC,SAAS8B,eAAe,SAASI,QAErC,IAuFK,WAEH,IAAK,IAAIC,KAAQ7B,EACT6B,EAAKlC,cAAc,aAEnBkC,EAAK/B,iBAAiB,QAASI,GAAc,GAGjDL,EAAWC,iBAAiB,QAASC,GAAY,EAEzD,CCpHA+B,E","sources":["webpack://ClientApi/./src/js/index.js","webpack://ClientApi/./src/js/site.js"],"sourcesContent":["const menu = document.querySelector(\".header__links\");\nconst headerlogo = document.querySelector(\".header__logo\");\n// get mobile animated open/close element\nconst newMenuBtn = document.querySelector('.cAnimatedExpander');\n\n/* add Event Listener to mobile animated open/close element */\nnewMenuBtn.addEventListener(\"click\", toggleMenu, false);\n\nconst items = document.querySelectorAll(\".item\");\n\n/* Trigger a Button Click on Enter */\n// Get the input field\nvar input = document.getElementById(\"search\");\n// Execute a function when the user presses a key on the keyboard\ninput.addEventListener(\"keypress\", function(event) {\n // If the user presses the \"Enter\" key on the keyboard\n if (event.key === \"Enter\") {\n // Cancel the default action, if needed\n event.preventDefault();\n // Trigger the button element with a click\n document.getElementById(\"myBtn\").click();\n }\n }); \n\nfunction toggleHeight() {\n var elem = this.querySelector(\".submenu\");\n // If the element is visible, hide it\n if (elem.classList.contains('is-visible')) {\n hide(elem);\n return;\n }\n // Otherwise, show it\n show(elem);\n};\n\n// .submenu passed as arg\nfunction show(elem) {\n // Get the natural height of the element\n var getHeight = function() {\n elem.style.display = 'block'; // Make it visible\n var height = elem.scrollHeight + 'px'; // Get it's height\n elem.style.display = ''; // Hide it again\n return height;\n };\n\n var height = getHeight(); // Get the natural height\n elem.classList.add('is-visible'); // Make the element visible\n elem.style.height = height; // Update the max-height\n\n // Once the transition is complete, remove the inline max-height so the content can scale responsively\n window.setTimeout(function() {\n elem.style.height = '';\n }, 350);\n // add down class to submenu\n elem.parentElement.classList.add('down');\n};\n\n// Hide an element\nfunction hide(elem) {\n // Give the element a height to change from\n elem.style.height = elem.scrollHeight + 'px';\n\n // Set the height back to 0\n window.setTimeout(function() {\n elem.style.height = '0';\n }, 1);\n\n // When the transition is complete, hide it\n window.setTimeout(function() {\n elem.classList.remove('is-visible');\n }, 350);\n elem.parentElement.classList.remove('down');\n\n};\n\n/* Toggle mobile menu */\nfunction toggleMenu() {\n\n const socials = document.querySelector(\".header__socials\");\n // look for hidden class which appended in mobile view\n if (menu.classList.contains(\"hidden\")) {\n // first remove hidden class that has display none\n // before asyncronously remove visullayhidden class that has opacity 0\n menu.classList.remove('hidden');\n // then add cAnimatedExpander close class that has css trans animation \n newMenuBtn.classList.add('close');\n setTimeout(function() {\n menu.classList.remove('visuallyhidden');\n }, 20);\n headerlogo.classList.add(\"activelogo\");\n socials.style.display = \"none\"; \n } else {\n // else the mobile menu is not present\n // first add visuallhidden class that has opacity 0 property\n // then asyncronously add hidden bolck display class\n menu.classList.add('visuallyhidden');\n newMenuBtn.classList.remove('close');\n menu.addEventListener('transitionend', function(e) {\n menu.classList.add('hidden');\n headerlogo.classList.remove(\"activelogo\");\n socials.style.display = \"flex\";\n }, {\n capture: false,\n once: true,\n passive: false\n }); \n }\n}\n\nexport function runNav() {\n /* Event Listeners */\n for (let item of items) {\n if (item.querySelector(\".submenu\")) {\n // add event listener when the mobile submenu is clicked\n item.addEventListener(\"click\", toggleHeight, false);\n //item.addEventListener(\"keypress\", toggleSubMenuItem, false);\n }\n newMenuBtn.addEventListener(\"click\", toggleMenu, false);\n }\n}","// Custom JS imports\nimport { runNav } from '../js/index.js';\n\nrunNav();\n\n// Custom CSS imports\nimport '../sass/main.scss';"],"names":["menu","document","querySelector","headerlogo","newMenuBtn","addEventListener","toggleMenu","items","querySelectorAll","toggleHeight","elem","this","classList","contains","style","height","scrollHeight","window","setTimeout","remove","parentElement","hide","getHeight","display","add","show","socials","e","capture","once","passive","getElementById","event","key","preventDefault","click","item","runNav"],"sourceRoot":""}