{"version":3,"sources":["webpack:///./src/components/pmicom/components/job-search-partial/controller.js"],"names":["onControllerReady","trackGtm","trackGtm4","require","getLinkWithTags","asyncImport","default","INCREMENT","DECREMENT","module","exports","init","window","onpageshow","event","persisted","location","reload","jobName","root","querySelector","jobNamesList","jobNamesInput","jobCta","jobLocationCta","title","server","dataset","url","locationID","currentJobName","getJobsList","document","addEventListener","keyEvent","bind","classList","remove","stopPropagation","debounce","inputEvent","focusOnJobInput","findAction","locationDropMenu","onCheck","locationInputEvent","setExtraEvents","initDefaultCountry","e","preventDefault","value","isV2CareerPageOnUse","v2","locations","assign","join","gtmTracking","fetch","jobsapi","method","then","answer","json","result","jobsList","catch","error","console","jobClickEvent","name","close","treatJobNamePosition","position","operation","length","shownJobsNamesList","currentElement","activeElement","contains","nodeName","key","moveInCurrentJob","forEach","element","i","childNodes","focus","blur","inputValue","srcElement","innerHTML","renderSearch","hasContent","regExp","RegExp","line","test","replace","occurence","button","createElement","listElement","appendChild","push","add","target","id","label","labels","innerText","checked","filter","setTitle","currentLocation","defaultcountry","split","setCheck","widgetName","search_term","widget_name","eventCategory","eventAction","eventLabel"],"mappings":";;;;;;;;;AAAA,MAAM;EAAEA,iBAAF;EAAqBC,QAArB;EAA+BC;AAA/B,IAA6CC,mBAAO,CAAC,6CAAD,CAA1D;;AACA,MAAM;EAAEC;AAAF,IAAsBD,mBAAO,CAAC,yDAAD,CAAnC;;AACA,MAAME,WAAW,GAAGF,mBAAO,CAAC,iDAAD,CAAP,CAA4BG,OAAhD;;AACA,MAAMC,SAAS,GAAG,WAAlB;AACA,MAAMC,SAAS,GAAG,WAAlB;AACAC,MAAM,CAACC,OAAP,GAAiB;EAChB,MAAMC,IAAN,GAAa;IACZ;IACAC,MAAM,CAACC,UAAP,GAAoB,UAAUC,KAAV,EAAiB;MACpC,IAAIA,KAAK,CAACC,SAAV,EAAqB;QACpBH,MAAM,CAACI,QAAP,CAAgBC,MAAhB;MACA;IACD,CAJD;;IAKA,KAAKC,OAA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K,EAAE,wBADE;MAETW,KAAK,EAAE,EAFE;MAGT6F,WAAW,EAAEpG,OAHJ;MAITF,QAAQ,EAAEqC,SAJD;MAKTkE,WAAW,EAAEF;IALJ,CAAD,CAAT;IAOApH,QAAQ,CAAC;MACRuH,aAAa,EAAE,MADP;MAERC,WAAW,EAAE,YAFL;MAGRC,UAAU,EAAG,GAAExG,OAAQ,KAAImC,SAAU;IAH7B,CAAD,CAAR;EAKA;;AA7Me,CAAjB,C","file":"components--job-search-partiald91775db6ac0caf70696.js","sourcesContent":["const { onControllerReady, trackGtm, trackGtm4 } = require('util/functions');\nconst { getLinkWithTags } = require('util/avatureTracking');\nconst asyncImport = require('util/asyncImport').default;\nconst INCREMENT = 'increment';\nconst DECREMENT = 'decrement';\nmodule.exports = {\n\tasync init() {\n\t\t//Safari back button solution (back-forward cache issue)\n\t\twindow.onpageshow = function (event) {\n\t\t\tif (event.persisted) {\n\t\t\t\twindow.location.reload();\n\t\t\t}\n\t\t};\n\t\tthis.jobName = this.root.querySelector('.job-names');\n\t\tthis.jobNamesList = this.root.querySelector('[data-job-names]');\n\t\tthis.jobNamesInput = this.root.querySelector('[name=\"job-name\"]');\n\t\tthis.jobCta = this.root.querySelector('a');\n\t\tthis.jobLocationCta = this.root.querySelector(\n\t\t\t'.job-location .search-field',\n\t\t);\n\t\tthis.title = this.root.querySelector('.job-search--title');\n\n\t\tthis.server = this.jobCta.dataset.url;\n\t\tthis.location = [];\n\t\tthis.locationID = [];\n\t\tthis.currentJobName = -1;\n\t\tthis.getJobsList();\n\n\t\tawait asyncImport(this, 'debounce');\n\n\t\tdocument.addEventListener('keydown', this.keyEvent.bind(this));\n\t\tdocument.addEventListener('click', () =>\n\t\t\tthis.jobNamesList.classList.remove('show'),\n\t\t);\n\t\tthis.jobName.addEventListener('click', event => event.stopPropagation());\n\t\tthis.jobNamesInput.addEventListener(\n\t\t\t'input',\n\t\t\tthis.debounce(this.inputEvent.bind(this), 20),\n\t\t);\n\t\tthis.jobNamesInput.addEventListener(\n\t\t\t'focus',\n\t\t\tthis.focusOnJobInput.bind(this),\n\t\t);\n\n\t\tthis.jobLocationCta.addEventListener('click', () =>\n\t\t\tthis.jobNamesList.classList.remove('show'),\n\t\t);\n\n\t\tthis.jobCta.addEventListener('click', this.findAction.bind(this));\n\n\t\tthis.locationDropMenu = await onControllerReady(\n\t\t\tthis.root.querySelector('.check-drop-down'),\n\t\t);\n\t\tif (!this.locationDropMenu) this.locationDropMenu = {};\n\t\tthis.locationDropMenu.onCheck = this.locationInputEvent.bind(this);\n\n\t\tif (this.locationDropMenu.setExtraEvents)\n\t\t\tthis.locationDropMenu.setExtraEvents();\n\t\tthis.initDefaultCountry();\n\t},\n\tfindAction(e) {\n\t\tif (e) e.preventDefault();\n\t\tconst jobName = this.jobNamesInput.value;\n\t\t// type casting to get boolean\n\t\tconst isV2CareerPageOnUse = this.root.dataset.v2 === 'true';\n\t\tconst locations = isV2CareerPageOnUse ? this.locationID : this.location;\n\n\t\twindow.location.assign(\n\t\t\tgetLinkWithTags(\n\t\t\t\t`${this.server}?title=${jobName}&locations=${locations.join('|')}`,\n\t\t\t),\n\t\t);\n\t\tthis.gtmTracking();\n\t},\n\tgetJobsList() {\n\t\twindow\n\t\t\t.fetch(this.root.dataset.jobsapi, {\n\t\t\t\tmethod: 'GET',\n\t\t\t})\n\t\t\t.then(answer => {\n\t\t\t\treturn answer.json();\n\t\t\t})\n\t\t\t.then(result => (this.jobsList = result))\n\t\t\t.catch(error => console.error(error));\n\t},\n\tjobClickEvent(name) {\n\t\tthis.jobNamesInput.value = name;\n\t\tthis.jobNamesList.classList.remove('show');\n\t\tthis.locationDropMenu.close();\n\t},\n\tfocusOnJobInput() {\n\t\tthis.locationDropMenu.close();\n\t},\n\ttreatJobNamePosition(position, operation) {\n\t\tconst { length } = this.shownJobsNamesList;\n\t\tif (operation === INCREMENT) {\n\t\t\treturn position >= length - 1 ? 0 : position + 1;\n\t\t}\n\n\t\tif (operation === DECREMENT) {\n\t\t\treturn position <= 0 ? length - 1 : position - 1;\n\t\t}\n\t},\n\tkeyEvent(event) {\n\t\tconst currentElement = document.activeElement;\n\t\tif (!this.root.contains(currentElement)) return;\n\t\tconst { name, nodeName } = currentElement;\n\t\tconst { key } = event;\n\t\tif (\n\t\t\t(name === 'job-name' || nodeName === 'BUTTON') &&\n\t\t\t(key === 'ArrowUp' || key === 'ArrowDown')\n\t\t) {\n\t\t\tevent.preventDefault();\n\n\t\t\tif (key === 'ArrowUp') this.moveInCurrentJob('decrement');\n\t\t\telse this.moveInCurrentJob(INCREMENT);\n\t\t} else if (name === 'job-name' && key === 'Enter') this.findAction();\n\t},\n\tmoveInCurrentJob(operation) {\n\t\tthis.currentJobName = this.treatJobNamePosition(\n\t\t\tthis.currentJobName,\n\t\t\toperation,\n\t\t);\n\t\tthis.shownJobsNamesList.forEach((element, i) => {\n\t\t\tif (i === this.currentJobName) {\n\t\t\t\telement.childNodes[0].focus();\n\t\t\t} else {\n\t\t\t\telement.childNodes[0].blur();\n\t\t\t}\n\t\t});\n\t},\n\tinputEvent(event) {\n\t\tconst inputValue = event.srcElement.value;\n\t\tif (inputValue.length > 2) {\n\t\t\tthis.jobNamesList.innerHTML = '';\n\t\t\tif (this.jobsList) this.renderSearch(inputValue);\n\t\t} else this.jobNamesList.innerHTML = '';\n\t},\n\trenderSearch(inputValue) {\n\t\tlet hasContent = false;\n\t\tthis.shownJobsNamesList = [];\n\t\tconst regExp = new RegExp(inputValue, 'gi');\n\t\tthis.jobsList.forEach(jobName => {\n\t\t\tlet line = jobName;\n\t\t\tif (regExp.test(line)) {\n\t\t\t\tline = line.replace(\n\t\t\t\t\tregExp,\n\t\t\t\t\toccurence => `${occurence}`,\n\t\t\t\t);\n\t\t\t\tconst button = document.createElement('button');\n\t\t\t\tbutton.innerHTML = line;\n\t\t\t\tbutton.addEventListener('click', () => {\n\t\t\t\t\tthis.jobClickEvent(jobName);\n\t\t\t\t});\n\t\t\t\tconst listElement = document.createElement('li');\n\t\t\t\tlistElement.appendChild(button);\n\t\t\t\tthis.jobNamesList.appendChild(listElement);\n\t\t\t\thasContent = true;\n\t\t\t\tthis.shownJobsNamesList.push(listElement);\n\t\t\t}\n\t\t});\n\n\t\tif (hasContent) this.jobNamesList.classList.add('show');\n\t\telse this.jobNamesList.classList.remove('show');\n\t},\n\tlocationInputEvent({ target }) {\n\t\tconst id = target.name;\n\t\tconst label = target.labels[0].innerText;\n\t\tif (target.checked) {\n\t\t\tthis.location.push(label);\n\t\t\tthis.locationID.push(id);\n\t\t} else {\n\t\t\tthis.location = this.location.filter(element => element !== label);\n\t\t\tthis.locationID = this.locationID.filter(element => element !== id);\n\t\t}\n\n\t\tthis.locationDropMenu.setTitle(\n\t\t\tthis.location.length > 0 ? this.locationID.join(', ') : null,\n\t\t);\n\t},\n\tinitDefaultCountry() {\n\t\tconst currentLocation = this.root.dataset.defaultcountry;\n\t\tif (currentLocation) {\n\t\t\tconst [id, label] = currentLocation.split(', ');\n\t\t\tthis.location.push(label);\n\t\t\tthis.locationID.push(id);\n\t\t\tthis.locationDropMenu.setTitle(\n\t\t\t\tthis.location.length > 0 ? this.locationID.join(', ') : null,\n\t\t\t);\n\t\t\tthis.locationDropMenu.setCheck(this.locationID, true);\n\t\t}\n\t},\n\tgtmTracking() {\n\t\tconst jobName = this.jobNamesInput.value;\n\t\tconst locations = this.location.join(', ');\n\t\tconst widgetName = this.root.dataset.widgetName\n\t\t\t? this.root.dataset.widgetName\n\t\t\t: 'V3-Job Banner';\n\t\ttrackGtm4({\n\t\t\tevent: 'GA4_event_c_job_search',\n\t\t\ttitle: '',\n\t\t\tsearch_term: jobName,\n\t\t\tlocation: locations,\n\t\t\twidget_name: widgetName,\n\t\t});\n\t\ttrackGtm({\n\t\t\teventCategory: 'jobs',\n\t\t\teventAction: 'job search',\n\t\t\teventLabel: `${jobName} |${locations}`,\n\t\t});\n\t},\n};\n"],"sourceRoot":""}