{"version":3,"sources":["modules.heroFilter.js"],"names":["app","heroFilter","init","container","document","querySelector","countryFilter","schoolTypeFilter","municipalityFilter","addEventListener","event","country","value","toUpperCase","schoolType","municipality","options","selectedIndex","text","pageUrl","window","location","option"],"mappings":"AAIAA,IAAIC,WA6BI,CACLC,KA3BD,WACE,IAAMC,EAAYC,SAASC,cAAc,oBAAoB,EAC7D,IAAMC,EAAgBH,EAAUE,cAAc,iBAAiB,EACzDE,EAAmBJ,EAAUE,cAAc,cAAc,EACzDG,EAAqBL,EAAUE,cAAc,sBAAsB,EACpDF,EAAUE,cAAc,uBAAuB,EAGvDI,iBAAiB,QAAS,SAAAC,GACrC,IAAMC,EAAUL,EAAcM,MAAMC,YAAY,EAC1CC,EAAaP,EAAiBK,MAC9BG,EACyB,SAA7BP,EAAmBI,MAAmB,MAAQJ,EAAmBQ,QAAQR,EAAmBS,eAAeC,KAI3GlB,GAAac,GAAWC,GAAxBf,IACEmB,UAASC,UAAOC,aAAiB,CACjCC,QAAQF,OAAGT,SAAWG,SACtBQ,OAAAX,MAAAG,KAAAC,CACJ,CAAA,CAEJ,CAAA,CAAA,CAMC","file":"../modules.heroFilter.min.js","sourcesContent":["/* ========================================================================\r\n Hero filter\r\n ========================================================================== */\r\n\r\napp.heroFilter = (function () {\r\n 'use strict';\r\n\r\n function init() {\r\n const container = document.querySelector('[data-hero-filter]');\r\n const countryFilter = container.querySelector('#filter-country');\r\n const schoolTypeFilter = container.querySelector('#filter-type');\r\n const municipalityFilter = container.querySelector('#filter-municipality');\r\n const submitButton = container.querySelector('button[type=\"submit\"]');\r\n\r\n // Add event listeners\r\n submitButton.addEventListener('click', (event) => {\r\n const country = countryFilter.value.toUpperCase();\r\n const schoolType = schoolTypeFilter.value;\r\n const municipality =\r\n municipalityFilter.value === '0000' ? '???' : municipalityFilter.options[municipalityFilter.selectedIndex].text;\r\n\r\n // DATALAYER\r\n if (country && schoolType && municipality) {\r\n app.dataLayer.pushEvent('heroFilter', {\r\n pageUrl: window.location.pathname,\r\n option: `${country};${schoolType};${municipality}`,\r\n });\r\n }\r\n });\r\n }\r\n\r\n // Expose public functions and variables\r\n return {\r\n init: init,\r\n };\r\n})();\r\n"]}