1(()=>{"use strict";class e{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,r){let s=e.toUpperCamelCase(t,r);return e.lcFirst(s)}static toUpperCamelCase(t,r){return r?t.split(r).map(t=>e.ucFirst(t.toLowerCase())).join(""):e.ucFirst(t.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class t{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,r){if(!t.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(r)}static getAttribute(e,r){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!1===t.hasAttribute(e,r))throw Error('The required property "'.concat(r,'" does not exist!'));if("function"!=typeof e.getAttribute){if(s)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(r)}static getDataAttribute(r,s){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],i=s.replace(/^data(|-)/,""),o=e.toLowerCamelCase(i,"-");if(!t.isNode(r)){if(n)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===r.dataset){if(n)throw Error("This node doesn't support the dataset attribute!");return}let a=r.dataset[o];if(void 0===a){if(n)throw Error('The required data attribute "'.concat(s,'" does not exist on ').concat(r,"!"));return a}return e.parsePrimitive(a)}static querySelector(e,r){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!t.isNode(e))throw Error("The parent node is not a valid HTML Node!");let n=e.querySelector(r)||!1;if(s&&!1===n)throw Error('The required element "'.concat(r,'" does not exist in parent node!'));return n}static querySelectorAll(e,r){let s=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(s&&!t.isNode(e))throw Error("The parent node is not a valid HTML Node!");let n=e.querySelectorAll(r);if(0===n.length&&(n=!1),s&&!1===n)throw Error('At least one item of "'.concat(r,'" must exist in parent node!'));return n}static getFocusableElements(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return e.querySelectorAll('\n input:not([tabindex^="-"]):not([disabled]):not([type="hidden"]),\n select:not([tabindex^="-"]):not([disabled]),\n textarea:not([tabindex^="-"]):not([disabled]),\n button:not([tabindex^="-"]):not([disabled]),\n a[href]:not([tabindex^="-"]):not([disabled]),\n [tabindex]:not([tabindex^="-"]):not([disabled])\n ')}static getFirstFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(e)[0]}static getLastFocusableElement(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=this.getFocusableElements(e);return t[t.length-1]}}class r{static iterate(e,t){if(e instanceof Map||Array.isArray(e))return e.forEach(t);if(e instanceof FormData){for(var r of e.entries())t(r[1],r[0]);return}if(e instanceof NodeList)return e.forEach(t);if(e instanceof HTMLCollection)return Array.from(e).forEach(t);if(e instanceof Object)return Object.keys(e).forEach(r=>{t(e[r],r)});throw Error("The element type ".concat(typeof e," is not iterable!"))}}class s{static serialize(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("FORM"!==e.nodeName){if(t)throw Error("The passed element is not a form!");return{}}return new FormData(e)}static serializeJson(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=s.serialize(e,t);if(0===Object.keys(n).length)return{};let i={};return r.iterate(n,(e,t)=>i[t]=e),i}}class n{get(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,r);return this._sendRequest(s,null,t)}post(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("POST",e,s);return this._sendRequest(n,t,r)}delete(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(n,t,r)}patch(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(n,t,r)}
1abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn("the request to ".concat(e.responseURL," was aborted"))}),e.addEventListener("error",()=>{console.warn("the request to ".concat(e.responseURL," failed with status ").concat(e.status))}),e.addEventListener("timeout",()=>{console.warn("the request to ".concat(e.responseURL," timed out"))})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,r){return this._registerOnLoaded(e,r),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,r){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),r&&this._request.setRequestHeader("Content-type",r),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}class i extends window.PluginBaseClass{init(){this._registerEvents()}_registerEvents(){this.$emitter.publish("beforeConfirmNewsletterRegistrationGuestRegisterEvents"),this._submitNewsletterGuestFormClickEvent(),this.$emitter.publish("afterConfirmNewsletterRegistrationGuestRegisterEvents")}_submitNewsletterGuestFormClickEvent(){let e=t.querySelector(document,this.options.elementSelectorConfirmNewsletterGuestFormCheckbox,!1),r=this._submitNewsletterGuestForm.bind(this);e&&(this.$emitter.publish("beforeConfirmNewsletterRegistrationGuestSubmitNewsletterGuestFormClickEvent"),e.removeEventListener("click",r),e.addEventListener("click",r),this.$emitter.publish("afterConfirmNewsletterRegistrationGuestSubmitNewsletterGuestFormClickEvent"))}_submitNewsletterGuestForm(){let e=t.querySelector(document,this.options.elementSelectorConfirmNewsletterGuestAction,!1),r=t.getDataAttribute(e,"data-subscribe"),s=t.getDataAttribute(e,"data-unsubscribe"),n=t.querySelector(document,this.options.elementSelectorConfirmNewsletterGuestFormCheckbox,!1);if(n.checked?e.value=r:e.value=s,n){if(void 0!==window.grecaptcha){if(this.grecaptcha=window.grecaptcha,document.querySelector(".captcha-google-re-captcha-v3")){let e=JSON.parse(document.querySelector(".captcha-google-re-captcha-v3").getAttribute("data-google-re-captcha-v3-options")).siteKey,t=document.querySelector(".captcha-google-re-captcha-v3 .grecaptcha_v3-input");this.grecaptcha.execute(e,{action:"submit"}).then(e=>{t.value=e,this._sendForm(this.options,n)}).catch(e=>{})}else document.querySelector(".captcha-google-re-captcha-v2")&&!JSON.parse(document.querySelector(".captcha-google-re-captcha-v2").getAttribute("data-google-re-captcha-v2-options")).invisible&&this._sendForm(this.options,n)}else this._sendForm(this.options,n)}}_addClass(e,r){let s=t.querySelector(document,e);s&&!s.classList.contains(r)&&s.classList.add(r)}_removeClass(e,r){let s=t.querySelector(document,e);s&&s.classList.contains(r)&&s.classList.remove(r)}_sendForm(e,r){this.$emitter.publish("beforeConfirmNewsletterRegistrationGuestSubmitNewsletterGuestForm"),this.client=new n;let i=t.querySelector(document,e.elementSelectorConfirmNewsletterGuestForm,!1),o=i.getAttribute("action"),a=s.serialize(i);this.client.post(o.toLowerCase(),a,t=>{let s=JSON.parse(t);if(s.length>0){this.$emitter.publish("beforeConfirmNewsletterRegistrationGuestSubmitNewsletterGuestFormCallback");let t=!1,n=!1;for(let e=0;e<s.length;e+=1)"success"===s[e].type?n=!0:"danger"===s[e].type&&(t=!0);n?(this._removeClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapper,e.hiddenClass),this._removeClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperSuccess,e.hiddenClass),this._addClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperDanger,e.hiddenClass),this._addClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperError,e.hiddenClass),r.checked?(this._addClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperUnsubscribe,e.hiddenClass),this._removeClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperSubscribe,e.hiddenClass)):(this._addClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperSubscribe,e.hiddenClass),this._removeClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperUnsubscribe,e.hiddenClass))):t&&(this._removeClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapper,e.hiddenClass),this._addClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperSuccess,e.hiddenClass),this._addClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperUnsubscribe,e.hiddenClass),this._addClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperSubscribe,e.hiddenClass),this._removeClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperDanger,e.hiddenClass),this._removeClass(e.elementSelectorConfirmNewsletterGuestAlertsWrapperError,e.hiddenClass)),this.$emitter.publish("afterConfirmNewsletterRegistrationGuestSubmitNewsletterGuestFormCallback")}},e.contentType),this.$emitter.publish("afterConfirmNewsletterRegistrationGuestSubmitNewsletterGuestForm")}}i.options={contentType:"application/x-www-form-urlencoded",elementSelectorConfirmNewsletterGuestAction:"#confirmNewsletterAction",elementSelectorConfirmNewsletterGuestAlertsWrapper:".js-newsletter-wrapper",elementSelectorConfirmNewsletterGuestAlertsWrapperDanger:".js-newsletter-wrapper .alert-danger",elementSelectorConfirmNewsletterGuestAlertsWrapperError:".js-newsletter-wrapper .alert-danger .alert-content-error",elementSelectorConfirmNewsletterGuestAlertsWrapperSubscribe:".js-newsletter-wrapper .alert-success .alert-content-subscribe",elementSelectorConfirmNewsletterGuestAlertsWrapperSuccess:".js-newsletter-wrapper .alert-success",elementSelectorConfirmNewsletterGuestAlertsWrapperUnsubscribe:".js-newsletter-wrapper .alert-success .alert-content-unsubscribe",elementSelectorConfirmNewsletterGuestForm:".cms-block-newsletter-form #confirmNewsletterForm",elementSelectorConfirmNewsletterGuestFormCheckbox:'[data-confirm-newsletter-registration="true"]',hiddenClass:"d-none"},window.PluginManager.register("ConfirmNewsletterRegistrationGuestPlugin",i,i.options.elementSelectorConfirmNewsletterGuestFormCheckbox)})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.