{"version":3,"file":"js/jobDetails.js","mappings":";;;;;;;;;;;;;;AAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACpBA,CAA0C;AAC2B;;AAErE;AACA;AACA;AACA,gBAAgB,WAAW,IAAI,sBAAsB;AACrD;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;;AAEO;AACP;AACA,mBAAmB,sDAAU;;AAE7B;AACA;AACA;AACA;AACA,cAAc,MAAM,IAAI,UAAU;AAClC,EAAE;AACF;;AAEO;AACP,cAAc,sEAAc,CAAC,gEAAY;AACzC,kBAAkB,sEAAc,CAAC,gEAAY;AAC7C,gBAAgB,sEAAc,CAAC,gEAAY;;AAE3C,uCAAuC,UAAU,IAAI,OAAO;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;ACpDuD;AACiB;AACd;AACE;;AAE5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,kEAAU,YAAY,GAAG,MAAM;;AAE3D;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM,kEAAU,qBAAqB;AACrC;AACA;AACA,kCAAkC,kEAAU;AAC5C,6DAA6D,OAAO;AACpE;AACA,EAAE;AACF;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,UAAU;AAC5C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,qDAAqD,2CAA2C;AAChG;AACA,EAAE;AACF;;AAEA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB,aAAa;AACrC;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,wBAAwB,mBAAmB;AAC3C;;AAEA;AACA;AACA,GAAG;AACH,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA,EAAE,yEAAuB;AACzB;AACA,GAAG;AACH,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA,GAAG,2EAAwB;AAC3B;;AAEA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAE,yEAAiB;AACnB,EAAE,oEAAY;AACd;AACA;;AAEA;AACA,mDAAmD,oBAAoB;;AAEvE;AACA;AACA,EAAE;;AAEF;AACA;AACA,MAAM,kEAAU,iBAAiB;AACjC;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA,EAAE;;AAEF;AACA;;AAEO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEO;AACP;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACvQA,CAA6B;AACM;AACY;AACa;;AAE5D;AACA;AACA;AACA;AACA,KAAK,kDAAe,CAAC,2BAA2B,KAAK;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,iCAAiC,kDAAe,CAAC;AACjD;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,GAAG;AACH,EAAE;;AAEF;AACA;AACA;;AAEA;AACA,GAAG,2EAAwB;AAC3B;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA,CAAC,+DAAkB;AACnB;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;;;;;;;;;;;AC9EA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,IAAI;AACJ,GAAG;AACH,EAAE;;AAEF;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,IAAI;AACJ,GAAG;AACH,EAAE;AACF,CAAC;;;;;;;;;;;;;;;;;;AC3H8B;AACyB;AACrB;;AAEnC;AACA;AACA;AACA,iCAAiC,kDAAe,CAAC,mBAAmB,UAAU;;AAE9E;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA,EAAE;AACF;;AAEA;AACA;AACA,OAAO,uDAAY;AACnB;AACA;;AAEA;;;;;;;;;;;;;;;;;;;ACrCO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACtBA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;AC9EA,CAAQ;AACR;AACA;AACA;;;;;;;;;;;;;;;;;;UCHA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCtBA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,IAAI;WACJ;WACA;WACA,IAAI;WACJ;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,CAAC;WACD;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;WACA,sGAAsG;WACtG;WACA;WACA;WACA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA,EAAE;WACF;WACA;;;;;WChEA;WACA;WACA;WACA;WACA;WACA,iCAAiC,WAAW;WAC5C;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;UENA;UACA;UACA;UACA","sources":["webpack://client-vacancy/./scripts/captcha-handler.js","webpack://client-vacancy/./scripts/google-analytics.js","webpack://client-vacancy/./scripts/job-alert.js","webpack://client-vacancy/./scripts/job-detail-alert.js","webpack://client-vacancy/./scripts/job-detail-external.js","webpack://client-vacancy/./scripts/job-detail.js","webpack://client-vacancy/./scripts/overview-filter-constants.js","webpack://client-vacancy/./scripts/overview-filter-state.js","webpack://client-vacancy/./scripts/utilities.js","webpack://client-vacancy/webpack/bootstrap","webpack://client-vacancy/webpack/runtime/async module","webpack://client-vacancy/webpack/runtime/compat get default export","webpack://client-vacancy/webpack/runtime/define property getters","webpack://client-vacancy/webpack/runtime/hasOwnProperty shorthand","webpack://client-vacancy/webpack/runtime/make namespace object","webpack://client-vacancy/webpack/before-startup","webpack://client-vacancy/webpack/startup","webpack://client-vacancy/webpack/after-startup"],"sourcesContent":["export const executeOnCaptchaSuccess = (callback) => {\n\t// Execute the captcha\n\t// The user might need to do a manual check\n\tconst executeCaptcha = new CustomEvent(\"executeCaptcha\");\n\tdocument.dispatchEvent(executeCaptcha);\n\n\tconst sendAlertHandler = async () => {\n\t\t// Call the callback\n\t\tcallback();\n\n\t\t// Reset the captcha\n\t\tconst resetCaptcha = new CustomEvent(\"resetCaptcha\");\n\t\tdocument.dispatchEvent(resetCaptcha);\n\n\t\t// Remove the event handler to execute when the captcha is done\n\t\tdocument.removeEventListener(\"captchaDone\", sendAlertHandler);\n\t};\n\n\t// Add the event handler to execute when the captcha is done\n\tdocument.addEventListener(\"captchaDone\", sendAlertHandler);\n}\n","import { isLoggedIn } from \"./utilities\";\nimport {getSearchParam, valueFilters} from \"./overview-filter-state\";\n\nconst track = (items) => {\n\twindow.dataLayer = window.dataLayer || [];\n\twindow.dataLayer.push(items);\n\tconsole.log(`${new Date()}: ${JSON.stringify(items)}`);\n}\n\nexport const trackContactSuccess = () => {\n\ttrack({\n\t\t\"event\": \"event-track\",\n\t\t\"category\": \"website action\",\n\t\t\"action\": \"webform submission\",\n\t\t\"label\": \"vacature_email\",\n\t});\n}\n\nexport const trackVacancyAlertSuccess = () => {\n\tconst page = window.location.pathname.indexOf(\"/vacature/\") === 0 ? \"vdp\" : \"vop\";\n\tconst userState = isLoggedIn() ? \"ingelogd\" : \"uitgelogd\";\n\n\ttrack({\n\t\t\"event\": \"event-track\",\n\t\t\"category\": \"website action\",\n\t\t\"action\": \"send vacancy alert\",\n\t\t\"label\": `${page} - ${userState}`\n\t});\n}\n\nexport const trackVacancySearch = () => {\n\tconst term = getSearchParam(valueFilters.searchTerm);\n\tconst location = getSearchParam(valueFilters.location);\n\tconst radius = getSearchParam(valueFilters.radius);\n\n\tconst label = location && radius ? `${location} + ${radius}km` : \"-\";\n\tconst action = term ? term : \"-\";\n\tconst currentSearchTrackingObject =\n\t\t{\n\t\t\t\"event\": \"event-track\",\n\t\t\t\"category\": \"vacature zoekactie\",\n\t\t\t\"action\": action,\n\t\t\t\"label\": label,\n\t\t};\n\n\tconst existingSearchTracking = localStorage.getItem(\"vacancySearchTracking\");\n\tconst currentSearchTracking = JSON.stringify(currentSearchTrackingObject);\n\n\tif (existingSearchTracking !== currentSearchTracking && (action !== \"-\" || label !== \"-\")) {\n\t\ttrack(currentSearchTrackingObject);\n\t\tlocalStorage.setItem(\"vacancySearchTracking\", currentSearchTracking);\n\t}\n}\n\n\n","import {attributes} from \"./overview-filter-constants\";\nimport {deleteSearchParam, trySaveToUrl} from \"./overview-filter-state\";\nimport {executeOnCaptchaSuccess} from \"./captcha-handler\";\nimport {trackVacancyAlertSuccess} from \"./google-analytics\";\n\nconst classesValidationMessageInvalid = [\n\t\"invalid-feedback\",\n\t\"mt-1\",\n\t\"d-block\",\n\t\"errorMessage\",\n];\nconst classesFieldInValid = [\"is-invalid\", \"error\"];\nlet formEnabled = true;\n\nconst getPopupElement = (popup) =>\n\tdocument.querySelector(`[${attributes.alertPopup}=${popup}]`);\n\nconst prefillPopupContent = () => {\n\tconst jobAlertLocation = document.querySelector(\"#job-alert-location\");\n\tconst jobAlertSearchTerm = document.querySelector(\"#job-alert-term\");\n\tconst jobAlertRadius = document.querySelector(\"#job-alert-radius\");\n\n\tconst queryString = window.location.search;\n\tconst urlParams = new URLSearchParams(queryString);\n\n\tif (urlParams.has(\"Location\")) {\n\t\tjobAlertLocation.value = urlParams.get(\"Location\");\n\t}\n\tif (urlParams.has(\"SearchTerm\")) {\n\t\tjobAlertSearchTerm.value = urlParams.get(\"SearchTerm\");\n\t}\n\tif (urlParams.has(\"Radius\")) {\n\t\tjobAlertRadius.value = urlParams.get(\"Radius\");\n\t}\n};\n\nconst prefill = () => {\n\tconst inputsToFill = document.querySelectorAll(\n\t\t`[${attributes.alertFieldForFilter}]`\n\t);\n\tinputsToFill.forEach((input) => {\n\t\tconst filter = input.attributes[attributes.alertFieldForFilter].value;\n\t\tconst source = document.querySelector(`[data-filter-name=${filter}]`);\n\t\tinput.value = source.value;\n\t});\n};\n\nconst setOpen = (popup, open) => {\n\tprefillPopupContent();\n\tconst element = getPopupElement(popup);\n\n\tif (open) {\n\t\tprefill();\n\n\t\tshowStep(popup, \"form\");\n\n\t\telement.style.display = \"block\";\n\t\tdocument.body.classList.add(\"dg-body-no-scroll\");\n\t} else {\n\t\telement.style.display = \"none\";\n\t\tdocument.body.classList.remove(\"dg-body-no-scroll\");\n\t}\n};\n\nconst elementsToValidate = [\"Term\", \"Location\", \"Email\", \"ReCaptcha\"];\n\nconst showValidationMessage = (validationMessageElement, message) => {\n\tif (validationMessageElement) {\n\t\tvalidationMessageElement.innerHTML = message;\n\t\tvalidationMessageElement.classList.add(\n\t\t\t...classesValidationMessageInvalid\n\t\t);\n\t}\n\n\tconst fieldName = validationMessageElement.attributes[\"data-valmsg-for\"].value;\n\tconst field =\n\t\tdocument.querySelector(`[name=${fieldName}]`) ||\n\t\tdocument.getElementById(fieldName);\n\tif (field) {\n\t\tfield.classList.add(...classesFieldInValid);\n\t}\n};\n\nconst resetValidationMessage = (validationMessageElements) => {\n\tvalidationMessageElements.forEach(validationMessageElement => {\n\t\tvalidationMessageElement.classList.remove(\n\t\t\t...classesValidationMessageInvalid\n\t\t);\n\t\tvalidationMessageElement.innerHTML = \"\";\n\n\t\tconst fields = document.querySelectorAll(`[name=\"${validationMessageElement.dataset.valmsgFor}\"]`);\n\t\tfields.forEach(field => field.classList.remove(...classesFieldInValid))\n\t});\n};\n\nconst removeValidationErrors = () => {\n\tconst validationMessages = Array.from(document.querySelectorAll(\"[data-valmsg-for]\"));\n\tconst elementsToValidate = validationMessages.map(elem => elem.dataset.valmsgFor);\n\n\telementsToValidate.forEach((propertyName) => {\n\t\tconst validation = document.querySelectorAll(\n\t\t\t`[data-valmsg-for=\"${propertyName}\"]`\n\t\t);\n\t\tresetValidationMessage(validation);\n\t});\n};\n\nconst disableSubmitButton = (disable) => {\n\tconst submitButton = document.getElementById(\"job-alert-submit\");\n\tif (disable) {\n\t\tsubmitButton.setAttribute(\"disabled\", \"true\");\n\t} else {\n\t\tsubmitButton.removeAttribute(\"disabled\");\n\t}\n};\n\nconst addValidationErrors = (errors) => {\n\terrors.forEach((error) => {\n\t\tif (!elementsToValidate.includes(error.propertyName)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst validationMessages = document.querySelectorAll(\n\t\t\t`[data-valmsg-for=\"${error.propertyName}\"]`\n\t\t);\n\n\t\tvalidationMessages.forEach((validation) => {\n\t\t\tshowValidationMessage(validation, error.errorMessage);\n\t\t});\n\t});\n};\n\nconst addGenericError = () => {\n\tconst genericError = document.querySelector(\"#generic-error\");\n\tshowValidationMessage(\n\t\tgenericError,\n\t\tgenericError.attributes[\"val-msg-generic\"].value\n\t);\n};\n\nconst handleFormSubmit = async (event) => {\n\tconst form = event.target.closest(\"form\");\n\n\tremoveValidationErrors();\n\n\tdisableSubmitButton(true);\n\n\tconst hasCaptcha = form.querySelectorAll('#google-recaptcha-placeholder').length > 0;\n\n\tif (hasCaptcha) {\n\t\texecuteOnCaptchaSuccess(async () => {\n\t\t\tawait sendAlert(form);\n\t\t});\n\t} else {\n\t\tawait sendAlert(form);\n\t}\n};\n\nasync function sendAlert(form) {\n\tconst action = form.action;\n\tconst method = form.method;\n\n\ttry {\n\t\tconst formData = new FormData(form);\n\n\t\tconst response = await fetch(action, {\n\t\t\tmethod,\n\t\t\tbody: formData,\n\t\t});\n\n\t\tif (response.ok) {\n\t\t\ttrackVacancyAlertSuccess();\n\t\t\tdisableSubmitButton(false);\n\n\t\t\tif (form.dataset.popup) {\n\t\t\t\tshowStep(form.dataset.popup, \"success\");\n\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\tform.classList.add(\"d-none\");\n\t\t\t\tdocument\n\t\t\t\t\t.getElementById(\"job-alert-success-message\")\n\t\t\t\t\t.classList.remove(\"d-none\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tconst errorResponse = await response.json();\n\t\tconst validationErrors = JSON.parse(errorResponse.detail);\n\t\taddValidationErrors(validationErrors);\n\t\tdisableSubmitButton(false);\n\t} catch (error) {\n\t\taddGenericError();\n\t\tdisableSubmitButton(false);\n\t}\n}\n\nconst showStep = (popup, step) => {\n\tconst popupElement = getPopupElement(popup);\n\n\tconst formStepElements = popupElement.querySelectorAll(\"[data-step=form]\");\n\tconst successStepElements = popupElement.querySelectorAll(\"[data-step=success]\");\n\n\tif (step === \"success\") {\n\t\tformStepElements.forEach(element => {\n\t\t\telement.classList.add(\"tw-hidden\")\n\t\t});\n\t\tsuccessStepElements.forEach(element => {\n\t\t\telement.classList.remove(\"tw-hidden\")\n\t\t});\n\t} else {\n\t\tformStepElements.forEach(element => {\n\t\t\telement.classList.remove(\"tw-hidden\")\n\t\t});\n\t\tsuccessStepElements.forEach(element => {\n\t\t\telement.classList.add(\"tw-hidden\")\n\t\t});\n\t}\n}\n\nconst handleDirectOpen = (popup) => {\n\tconst params = new URLSearchParams(window.location.search);\n\tif (params.has(\"alert\")) {\n\t\tsetOpen(popup, true);\n\t\tdeleteSearchParam(\"alert\");\n\t\ttrySaveToUrl(false);\n\t}\n};\n\nconst bindPopup = (openButtonAttribute, popup) => {\n\tconst openButtons = document.querySelectorAll(`[${openButtonAttribute}]`);\n\n\topenButtons.forEach((button) => {\n\t\tbutton.addEventListener(\"click\", () => setOpen(popup, true));\n\t});\n\n\tconst element = getPopupElement(popup);\n\tconst closeButtons = element.querySelectorAll(\n\t\t`[${attributes.alertPopupClose}]`\n\t);\n\tcloseButtons.forEach((button) => {\n\t\tbutton.addEventListener(\"click\", () => setOpen(popup, false));\n\t});\n\n\tdocument.addEventListener(\"keydown\", (event) => {\n\t\tif (event.key === \"Escape\") setOpen(popup, false);\n\t});\n\n\thandleDirectOpen(popup);\n};\n\nexport const bindJobAlertPopup = () => {\n\tconst form = document.getElementById(\"jobalert-form\");\n\n\tif (form.dataset.popup)\n\t\tbindPopup(\"data-open-button-alert\", form.dataset.popup);\n\n\tdisableSubmitButton(false);\n};\n\nexport const bindJobAlertSubmit = () => {\n\tconst button = document.getElementById(\"job-alert-submit\");\n\tbutton.addEventListener(\"click\", handleFormSubmit);\n};\n","import './job-detail-alert';\nimport config from './config.json';\nimport {bindJobAlertSubmit} from \"./job-alert\";\nimport {trackVacancyAlertSuccess} from \"./google-analytics\";\n\nconst loadInitialStatus = async () => {\n\t// Fetch current status\n\tconst term = document.getElementById(\"job-alert-term\").value;\n\tconst response = await fetch(\n\t\t`${config.basepath}/jobalert/isenabled?term=${term}`);\n\tconst jobAlertCheckbox = document.getElementById(\"job-alert-toggle\");\n\n\tif (response.ok) {\n\t\tconst result = await response.text();\n\t\tif (result === \"true\") {\n\t\t\tjobAlertCheckbox.checked = true;\n\t\t\tdocument.getElementById(\"toggle-jobalert-feedback-on\").classList.remove(\"d-none\");\n\t\t\tdocument.getElementById(\"toggle-jobalert-success-on-yaay\").classList.add(\"d-none\");\n\t\t\tdocument.getElementById(\"job-alert-toggle-into-text\").classList.add(\"d-none\");\n\t\t}\n\t}\n}\n\nconst toggleJobAlert = async () => {\n\tconst jobAlertCheckbox = document.getElementById(\"job-alert-toggle\");\n\tjobAlertCheckbox.disabled = true;\n\tconst antiForgeryToken = document.querySelector('#job-alert-form [name=\"__RequestVerificationToken\"]').value;\n\tconst term = document.getElementById(\"job-alert-term\").value;\n\tconst vacancyId = document.getElementById(\"job-alert-vacancy-id\").value;\n\n\tconst response = await fetch(`${config.basepath}/jobalert/toggle`, {\n\t\tmethod: 'POST',\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json',\n\t\t\t\"RequestVerificationToken\": antiForgeryToken\n\t\t},\n\t\tbody: JSON.stringify({\n\t\t\tterm: term,\n\t\t\tvacancyId: vacancyId\n\t\t})\n\t});\n\n\tif (response.ok) {\n\t\tconst result = (await response.text()) === \"true\";\n\t\tjobAlertCheckbox.checked = result;\n\n\t\tif (result) {\n\t\t\ttrackVacancyAlertSuccess();\n\t\t\tdocument.getElementById(\"toggle-jobalert-feedback-off\").classList.add(\"d-none\");\n\t\t\tdocument.getElementById(\"toggle-jobalert-feedback-on\").classList.remove(\"d-none\");\n\t\t} else {\n\t\t\tdocument.getElementById(\"toggle-jobalert-feedback-on\").classList.add(\"d-none\");\n\t\t\tdocument.getElementById(\"toggle-jobalert-feedback-off\").classList.remove(\"d-none\");\n\t\t}\n\t}\n\n\tjobAlertCheckbox.disabled = false;\n}\n\nconst initLoggedIn = async () => {\n\tawait loadInitialStatus();\n\n\tconst jobAlertCheckbox = document.getElementById(\"job-alert-toggle\");\n\tjobAlertCheckbox.addEventListener(\"click\", toggleJobAlert);\n}\n\n\nconst initLoggedOut = () => {\n\tbindJobAlertSubmit();\n}\n\nexport const init = async () => {\n\tconst loggedInForm = document.getElementById(\"job-alert-logged-in\");\n\n\tif (loggedInForm)\n\t\tawait initLoggedIn();\n\telse\n\t\tinitLoggedOut();\n}\n","//JDP - Set classes\nconst headerElement = document.getElementById('header-job-detail');\nconst headerApplicationElement = document.getElementById('job-sticky-bar');\n\nlet lastScrollTop = 0;\n\n// JDP - Body class\n// Add class job-detail to body if header element exists\nif (headerElement) {\n\t// The element exists\n\tdocument.body.classList.add('job-detail');\n}\n\n// JDP - Move up navigation if scolled 100 pixels from top\nwindow.addEventListener('scroll', () => {\n\tlet scrollPosition = window.scrollY;\n\tif (scrollPosition > 100) {\n\t\theaderElement.classList.add('navigation-hide-menu');\n\t\tlet st = document.documentElement.scrollTop;\n\t\tif (st > lastScrollTop){\n\t\t\t// user is scrolling down\n\t\t} else {\n\t\t\t// user is scrolling up\n\t\t\theaderElement.classList.remove('navigation-hide-menu');\n\t\t}\n\t\tlastScrollTop = st <= 0 ? 0 : st;\n\t}\n});\n\n// JDP - Job application bar - show/hide\nconst jobApplicationHeaderTrigger = document.getElementsByClassName('info-action')[0];\nconst body = document.body;\n\nconst checkScrollPosition = () => {\n\tif (jobApplicationHeaderTrigger.getBoundingClientRect().bottom > 100) {\n\t\theaderApplicationElement.classList.remove('show');\n\t} else {\n\t\theaderApplicationElement.classList.add('show');\n\t}\n};\n\nwindow.addEventListener('scroll', () => {\n\tcheckScrollPosition();\n});\n\n// JDP - Slider\ndocument.addEventListener(\"DOMContentLoaded\", function() {\n\tconst sliders = document.querySelectorAll('.slider--version-01');\n\n\tsliders.forEach(function(slider, index) {\n\t\tconst y = slider.getElementsByClassName(\"swiper\");\n\t\tslider.classList.add('slider--' + index);\n\n\t\tvar swiper = new Swiper(y[0], {\n\t\t\tspaceBetween: 20,\n\t\t\tgrabCursor: true,\n\t\t\tnavigation: {\n\t\t\t\tnextEl: '.slider--' + index + ' .swiper-button-next',\n\t\t\t\tprevEl: '.slider--' + index + ' .swiper-button-prev',\n\t\t\t},\n\t\t\tpagination: {\n\t\t\t\tel: \".swiper-pagination\",\n\t\t\t\ttype: 'bullets',\n\t\t\t\tclickable: true\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\t768: {\n\t\t\t\t\tslidesPerView: 2,\n\t\t\t\t},\n\t\t\t\t1200: {\n\t\t\t\t\tslidesPerView: 3,\n\t\t\t\t},\n\t\t\t},\n\t\t\ton: {\n\t\t\t\tlock: function () {\n\t\t\t\t\tslider.classList.remove(\"is-active\");\n\t\t\t\t},\n\t\t\t\tunlock: function () {\n\t\t\t\t\tslider.classList.add(\"is-active\");\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t});\n\n\tconst sliders2 = document.querySelectorAll('.slider--version-02');\n\n\tsliders2.forEach(function(slider, index) {\n\t\tconst y = slider.getElementsByClassName(\"swiper\");\n\t\tslider.classList.add('slider--' + index);\n\n\t\tvar swiper = new Swiper(y[0], {\n\t\t\tspaceBetween: 20,\n\t\t\tgrabCursor: true,\n\t\t\tnavigation: {\n\t\t\t\tnextEl: '.slider--' + index + ' .swiper-button-next',\n\t\t\t\tprevEl: '.slider--' + index + ' .swiper-button-prev',\n\t\t\t},\n\t\t\tpagination: {\n\t\t\t\tel: \".swiper-pagination\",\n\t\t\t\ttype: 'bullets',\n\t\t\t\tclickable: true\n\t\t\t},\n\t\t\tbreakpoints: {\n\t\t\t\t768: {\n\t\t\t\t\tslidesPerView: 2,\n\t\t\t\t},\n\t\t\t\t992: {\n\t\t\t\t\tslidesPerView: 3,\n\t\t\t\t},\n\t\t\t\t1200: {\n\t\t\t\t\tslidesPerView: 4,\n\t\t\t\t},\n\t\t\t},\n\t\t\ton: {\n\t\t\t\tlock: function () {\n\t\t\t\t\tslider.classList.remove(\"is-active\");\n\t\t\t\t},\n\t\t\t\tunlock: function () {\n\t\t\t\t\tslider.classList.add(\"is-active\");\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\t});\n});\n","import './job-detail-external';\nimport {init as jobAlertInit} from './job-detail-alert';\nimport config from './config.json';\n\nconst loadRecommendations = async () => {\n\tconst recommendedVacanciesElem = document.getElementById(\"recommended-vacancies\");\n\tconst vacancyId = recommendedVacanciesElem.getAttribute(\"vacancy-id\");\n\tconst response = await fetch(`${config.basepath}/recommendations/${vacancyId}`);\n\n\tif (response.ok) {\n\t\trecommendedVacanciesElem.innerHTML = await response.text();\n\t}\n}\n\nconst bindBackButtonClick = () => {\n\tconst backButton = document.querySelector(`[href=\"#back\"]`);\n\n\tif (!backButton)\n\t\treturn;\n\n\tbackButton.addEventListener(\"click\", (e) => {\n\t\te.preventDefault();\n\n\t\tif (window.history.length <= 1) {\n\t\t\t// Fallback for new tab\n\t\t\twindow.location = e.target.dataset.overviewUrl;\n\t\t} else {\n\t\t\twindow.history.back();\n\t\t}\n\t});\n}\n\nconst init = async () => {\n\tbindBackButtonClick();\n\tawait jobAlertInit();\n\tawait loadRecommendations();\n}\n\nawait init();\n","\nexport const attributes = {\n\talertPopup: \"data-alert-popup\",\n\talertPopupClose: \"data-alert-popup-close\",\n\talertFieldForFilter: \"data-jobalert-field-for-filter\",\n\tfilterMultiChoiceCounter: \"data-filter-multichoice-counter\",\n\tfilterMultiChoice: \"data-filter-multichoice\",\n\tfilterValue: \"data-filter-value\",\n\tfilterValueReset: \"data-filter-reset-target\",\n\tfilterToggle: \"data-filter-toggle\",\n\tfilterShowCount: \"data-filter-show-count\",\n\tfilterName: \"data-filter-name\",\n\tfilterVacancyAttribute: \"data-filter-vacancy-text\",\n\tfilterVacanciesAttribute: \"data-filter-vacancies-text\",\n\tfilterListAttribute: \"data-filter-list\",\n\tfilterGeoButton: \"data-filter-geo-target\",\n\tfilterPopup: \"data-filter-popup\",\n\tfilterPopupClose: \"data-filter-popup-close\",\n\tfilterPopupBack: \"data-filter-popup-back\",\n\tfilterPopupOpen: \"data-filter-popup-open\",\n\tfilterPopupConfirm: \"data-filter-popup-confirm\",\n\tfilterBadge: \"data-filter-badge\"\n}\n","let searchParams = new URLSearchParams(window.location.search);\n\nexport const valueFilters = {\n\tsearchTerm: \"SearchTerm\",\n\tlocation: \"Location\",\n\tradius: \"Radius\"\n}\n\nexport const numberFilters = {\n\tminHours: \"MinHours\",\n\tmaxHours: \"MaxHours\",\n}\n\nexport const multiChoiceFilters = {\n\tsector: \"Sector\",\n\tjobField: \"JobField\",\n\teducationLevel: \"EducationLevel\"\n}\n\nexport const pageFilter = {\n\tpage: \"Page\"\n}\n\nexport const toggleFilters = {\n\tpermanentContract: \"PermanentContract\"\n}\n\nexport const loadFromUrl = () => {\n\tsearchParams = new URLSearchParams(window.location.search);\n}\n\nexport const trySaveToUrl = (resetPages) => {\n\tlet newUrl = window.location.protocol + \"//\" + window.location.host + window.location.pathname + '?' + searchParams.toString();\n\n\tif(newUrl === history.state?.path)\n\t\treturn false;\n\n\tif(resetPages)\n\t{\n\t\tdeleteSearchParam(pageFilter.page);\n\t\tnewUrl = window.location.protocol + \"//\" + window.location.host + window.location.pathname + '?' + searchParams.toString();\n\t}\n\n\twindow.history.pushState(undefined, '', newUrl);\n\treturn true;\n}\n\nexport const getSearchParam = (key) => {\n\treturn searchParams.get(key);\n}\n\nexport const getSearchParams = () => {\n\treturn searchParams;\n}\n\nexport const deleteSearchParam = (key, value) => {\n\tsearchParams.delete(key, value);\n}\n\nexport const setSearchParam = (key, value) => {\n\tsearchParams.set(key, value);\n}\n\nexport const appendSearchParam = (key, value) => {\n\tsearchParams.append(key, value);\n}\n\nexport const clearFilters = () => {\n\tconst clearedFilters = new URLSearchParams();\n\n\t// Copy only valueFilters to clearedFilters\n\tfor (const [key, value] of searchParams.entries()) {\n if (Object.values(valueFilters).indexOf(key) > -1) {\n\t\t clearedFilters.set(key, value);\n }\n }\n\n\tsearchParams = clearedFilters;\n}\n","export const isLoggedIn = () =>\n{\n\treturn document.querySelector(\"meta[name=loggedin][content=true]\") != null;\n}\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var webpackQueues = typeof Symbol === \"function\" ? Symbol(\"webpack queues\") : \"__webpack_queues__\";\nvar webpackExports = typeof Symbol === \"function\" ? Symbol(\"webpack exports\") : \"__webpack_exports__\";\nvar webpackError = typeof Symbol === \"function\" ? Symbol(\"webpack error\") : \"__webpack_error__\";\nvar resolveQueue = (queue) => {\n\tif(queue && queue.d < 1) {\n\t\tqueue.d = 1;\n\t\tqueue.forEach((fn) => (fn.r--));\n\t\tqueue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));\n\t}\n}\nvar wrapDeps = (deps) => (deps.map((dep) => {\n\tif(dep !== null && typeof dep === \"object\") {\n\t\tif(dep[webpackQueues]) return dep;\n\t\tif(dep.then) {\n\t\t\tvar queue = [];\n\t\t\tqueue.d = 0;\n\t\t\tdep.then((r) => {\n\t\t\t\tobj[webpackExports] = r;\n\t\t\t\tresolveQueue(queue);\n\t\t\t}, (e) => {\n\t\t\t\tobj[webpackError] = e;\n\t\t\t\tresolveQueue(queue);\n\t\t\t});\n\t\t\tvar obj = {};\n\t\t\tobj[webpackQueues] = (fn) => (fn(queue));\n\t\t\treturn obj;\n\t\t}\n\t}\n\tvar ret = {};\n\tret[webpackQueues] = x => {};\n\tret[webpackExports] = dep;\n\treturn ret;\n}));\n__webpack_require__.a = (module, body, hasAwait) => {\n\tvar queue;\n\thasAwait && ((queue = []).d = -1);\n\tvar depQueues = new Set();\n\tvar exports = module.exports;\n\tvar currentDeps;\n\tvar outerResolve;\n\tvar reject;\n\tvar promise = new Promise((resolve, rej) => {\n\t\treject = rej;\n\t\touterResolve = resolve;\n\t});\n\tpromise[webpackExports] = exports;\n\tpromise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise[\"catch\"](x => {}));\n\tmodule.exports = promise;\n\tbody((deps) => {\n\t\tcurrentDeps = wrapDeps(deps);\n\t\tvar fn;\n\t\tvar getResult = () => (currentDeps.map((d) => {\n\t\t\tif(d[webpackError]) throw d[webpackError];\n\t\t\treturn d[webpackExports];\n\t\t}))\n\t\tvar promise = new Promise((resolve) => {\n\t\t\tfn = () => (resolve(getResult));\n\t\t\tfn.r = 0;\n\t\t\tvar fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));\n\t\t\tcurrentDeps.map((dep) => (dep[webpackQueues](fnQueue)));\n\t\t});\n\t\treturn fn.r ? promise : getResult();\n\t}, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));\n\tqueue && queue.d < 0 && (queue.d = 0);\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","","// startup\n// Load entry module and return exports\n// This entry module used 'module' so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(\"./scripts/job-detail.js\");\n",""],"names":[],"sourceRoot":""}