{"version":3,"file":"location-list.js","sources":["../../../../src/assets/scripts/location-list.entry.js"],"sourcesContent":["window.arjoLocationListModule =\n window.arjoLocationListModule ||\n (() => {\n const state = {\n isInitialized: false,\n elements: {},\n };\n\n const classNamePrefix = 'arjo-o-location-list';\n\n const apiCall = (country, fetchUrl) => {\n return axios.request({\n method: 'get',\n url: fetchUrl,\n params: {\n country: country,\n },\n });\n };\n\n const setUp = () => {\n const els = [...document.querySelectorAll(`.${classNamePrefix}`)];\n els.forEach((el) => {\n const fetchUrl = el.dataset.fetchUrl;\n\n const resultDom = el.querySelector(`.${classNamePrefix}__results`);\n const dropdown = el.querySelector('.arjo-m-dropdown');\n\n dropdown.addEventListener('change', (e) => {\n const country = e.target.value;\n apiCall(country, fetchUrl).then((response) => {\n resultDom.innerHTML = response.data;\n });\n });\n });\n };\n const init = () => {\n if (state.isInitialized) return;\n setUp();\n state.isInitialized = true;\n };\n return { init };\n })();\n\nwindow.addEventListener('load', window.arjoLocationListModule.init);\n"],"names":["state","classNamePrefix","apiCall","country","fetchUrl","setUp","el","resultDom","e","response"],"mappings":"AAAA,OAAO,uBACL,OAAO,yBACN,IAAM,CACL,MAAMA,EAAQ,CACZ,cAAe,GACf,SAAU,CAAE,CAClB,EAEUC,EAAkB,uBAElBC,EAAU,CAACC,EAASC,IACjB,MAAM,QAAQ,CACnB,OAAQ,MACR,IAAKA,EACL,OAAQ,CACN,QAASD,CACV,CACT,CAAO,EAGGE,EAAQ,IAAM,CACN,CAAC,GAAG,SAAS,iBAAiB,IAAIJ,CAAe,EAAE,CAAC,EAC5D,QAASK,GAAO,CAClB,MAAMF,EAAWE,EAAG,QAAQ,SAEtBC,EAAYD,EAAG,cAAc,IAAIL,CAAe,WAAW,EAChDK,EAAG,cAAc,kBAAkB,EAE3C,iBAAiB,SAAWE,GAAM,CACzC,MAAML,EAAUK,EAAE,OAAO,MACzBN,EAAQC,EAASC,CAAQ,EAAE,KAAMK,GAAa,CAC5CF,EAAU,UAAYE,EAAS,IAC3C,CAAW,CACX,CAAS,CACT,CAAO,CACP,EAMI,MAAO,CAAE,KALI,IAAM,CACbT,EAAM,gBACVK,IACAL,EAAM,cAAgB,GAC5B,CACiB,CACjB,KAEA,OAAO,iBAAiB,OAAQ,OAAO,uBAAuB,IAAI"}