PageSourceSearch

https://www.drhall.de/theme/d99fb49e846f980661fc07c4da47d877/js/mollie-payments/mollie-payments.js?1791279133

js drhall.de collected 2026-10-06 18:29:07 UTC 27,666 bytes, 1 lines download raw bytes

1(()=>{"use strict";let e="application/json";class t{get(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e;return this.send("GET",t,null,i,n,o)}post(t){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e;return this.send("POST",t,i,n,o,s)}send(t,i){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:e;return fetch(i,{method:t,headers:{"Content-Type":r},body:n}).then(e=>(e.headers.get("content-type")||"").includes("application/json")?e.json():e.text()).then(e=>{"function"==typeof o&&o(e)}).catch(e=>{"function"==typeof s&&s(e)})}}class i{static #e=this.options={};constructor(e,t={},i="Plugin"){this.el=e,this._pluginName=i,this._listeners=[],this.options=this._mergeOptions(t),this.init()}_addListener(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&"function"==typeof e.addEventListener&&(e.addEventListener(t,i,n),this._listeners.push({target:e,type:t,handler:i,options:n}))}destroy(){this._listeners.forEach(function(e){e.target.removeEventListener(e.type,e.handler,e.options)}),this._listeners=[]}_mergeOptions(e){let t=this._pluginName.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase(),i={};if(this.el&&"function"==typeof this.el.getAttribute){let e=this.el.getAttribute(`data-${t}-options`);if(e)try{i=JSON.parse(e)}catch(e){console.error(`[MolliePlugin] Could not parse data-${t}-options`,e)}}return Object.assign({},this.constructor.options,e,i)}init(){}}let n="d-none";class o extends i{static #e=this.options={newCardMandateOption:null,mollieCreditCardFormClass:".mollie-components-credit-card",mollieCreditCardMandateInput:'input[name="mandateId"]',mollieShouldSaveCardDetailInput:'input[name="mollieShouldSaveCardDetail"]'};init(){this.client=new t,this._fixShopUrl()}registerMandateEvents(){let{newCardMandateOption:e}=this.options;e&&(this.mollieCreditCarfFormEl=document.querySelector(this.options.mollieCreditCardFormClass),this.mollieCreditCardMandateEls=document.querySelectorAll(this.options.mollieCreditCardMandateInput),this.mollieCreditCarfFormEl&&this.mollieCreditCardMandateEls&&this._registerRadioButtonsEvent())}_fixShopUrl(){null!=this.options.shopUrl&&"/"===this.options.shopUrl.substr(-1)&&(this.options.shopUrl=this.options.shopUrl.substr(0,this.options.shopUrl.length-1))}_registerRadioButtonsEvent(){this.onMandateInputChange(this.getMandateCheckedValue()),this.mollieCreditCardMandateEls.forEach(e=>{e.addEventListener("change",()=>{this.onMandateInputChange(this.getMandateCheckedValue())})})}getMandateCheckedValue(){let e=document.querySelector(`${this.options.mollieCreditCardMandateInput}:checked`);return e&&e.value?e.value:null}isValidSelectedMandate(e){return e&&e!==this.options.newCardMandateOption}shouldSaveCardDetail(){let e=document.querySelector(this.options.mollieShouldSaveCardDetailInput);return!!e&&e.checked}onMandateInputChange(e){if(e===this.options.newCardMandateOption){this.mollieCreditCarfFormEl.classList.remove(n);return}null!==e&&this.mollieCreditCarfFormEl.classList.add(n)}}class s{constructor(e){this._document=e}getPaymentForm(){return this._document.querySelector("#changePaymentForm")}getConfirmForm(){return this._document.querySelector("#confirmOrderForm")}getSubmitButton(){let e=this._document.querySelector("#confirmFormSubmit");return null===e&&(e=this._document.querySelector('#confirmOrderForm button[type="submit"]')),e}}let r="error";class l extends o{static #e=this.options={...o.options,paymentId:null,customerId:null,locale:null,profileId:null,shopUrl:null,testMode:!0};init(){super.init();try{let e=new s(document);
1this._paymentForm=e.getPaymentForm(),this._confirmForm=e.getConfirmForm(),this._confirmFormButton=e.getSubmitButton()}catch(e){console.error("Mollie Credit Card components: Required HTML elements not found on this page!");return}this._initializeComponentInstance(),this._registerEvents(),this.registerMandateEvents()}_initializeComponentInstance(){let e=document.querySelector("#cardHolder");document.querySelector("div.mollie-components-credit-card")&&e&&!window.mollieComponentsObject&&(window.mollieComponentsObject=Mollie(this.options.profileId,{locale:this.options.locale,testmode:this.options.testMode}),window.mollieComponents={}),this.createComponentsInputs()}_registerEvents(){null!==this._confirmForm&&this._confirmForm.addEventListener("submit",this.submitForm.bind(this))}_reactivateFormSubmit(){this._confirmForm.dispatchEvent(new CustomEvent("removeLoader"))}getDefaultProperties(){return{styles:{base:{backgroundColor:"#fff",fontSize:"14px",padding:"10px 10px","::placeholder":{color:"rgba(68, 68, 68, 0.2)"}},valid:{color:"#090"},invalid:{backgroundColor:"#fff1f3"}}}}getInputFields(){return{cardHolder:{name:"cardHolder",id:"#cardHolder",errors:"cardHolderError"},cardNumber:{name:"cardNumber",id:"#cardNumber",errors:"cardNumberError"},expiryDate:{name:"expiryDate",id:"#expiryDate",errors:"expiryDateError"},verificationCode:{name:"verificationCode",id:"#verificationCode",errors:"verificationCodeError"}}}createComponentsInputs(){let e=this,t=[this.getInputFields().cardHolder,this.getInputFields().cardNumber,this.getInputFields().expiryDate,this.getInputFields().verificationCode];window.mollieComponentsObject&&t.forEach((t,i,n)=>{let o=this._mountMollieComponent(t.id,t.name);n[i][t.name]=o,o.addEventListener("change",e=>{let i=document.getElementById(`${t.name}`),n=document.getElementById(`${t.errors}`);e.error&&e.touched?(i.classList.add(r),n.textContent=e.error):(i.classList.remove(r),n.textContent="")}),o.addEventListener("focus",()=>{e.setFocus(`${t.id}`,!0)}),o.addEventListener("blur",()=>{e.setFocus(`${t.id}`,!1)})})}_mountMollieComponent(e,t){return window.mollieComponents[t]?window.mollieComponents[t].unmount():window.mollieComponents[t]=window.mollieComponentsObject.createComponent(t,this.getDefaultProperties()),window.mollieComponents[t].mount(e),window.mollieComponents[t]}setFocus(e,t){document.querySelector(e).classList.toggle("is-focused",t)}async submitForm(e){if(e.defaultPrevented)return;let t=this,i=this._confirmForm,n=document.querySelector(`#changePaymentForm input[type="radio"][value="${this.options.paymentId}"]`);if((null==n||!1===n.checked)&&this._confirmForm||n&&!1===n.checked)return;e.preventDefault();let o=this.getMandateCheckedValue();if(this.isValidSelectedMandate(o)){this.client.post(t.options.shopUrl+"/mollie/components/store-mandate-id/"+t.options.customerId+"/"+o,null,()=>{t.continueShopwareCheckout(i)},()=>{t.continueShopwareCheckout(i)},"application/json; charset=utf-8");return}let s=document.getElementById(`${this.getInputFields().verificationCode.errors}`);s.textContent="";let{token:r,error:l}=await window.mollieComponentsObject.createToken();if(l){s.textContent=l.message,this._reactivateFormSubmit(),s.scrollIntoView();return}document.getElementById("cardToken").setAttribute("value",r),t.continueShopwareCheckout(i)}continueShopwareCheckout(e){e.submit()}}class a{constructor(e){this._document=e}findClosestShopwareBuyButton(e){let t=this.findClosestBuyBox(e);return null===t?null:t.querySelector(".btn-buy")}findClosestApplePayContainer(e){return e.closest(".mollie-apple-pay-direct")}findClosestBuyBox(e){let t=e.closest(".product-action");return null===t&&(t=e.closest(".product-detail-form-container")),null===t&&(t=e.closest(".offcanvas-cart-actions")),null===t&&(t=e.closest(".checkout-aside-container")),null===t&&(t=e.closest(".checkout-main")),t}findAllExpressButtons(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=".mollie-express-button";return null!==t&&(i+=t),e.querySelectorAll(i)}findApplePayButtons(){return this._document.querySelectorAll(".mollie-express-button.js-apple-pay")}findApplePayContainers(){return this._document.querySelectorAll(".js-apple-pay-container")}findPayPalExpressButtons(){return this._document.querySelectorAll(".js-mollie-paypal-button")}findClosestPrivacyBox(e){let t=this.findClosestBuyBox(e);return null===t?null:t.querySelector(".mollie-privacy-note")}getPrivacyBoxCheckbox(e){return e.querySelector('input[name="acceptedDataProtection"]')}}let d="d-none",c="is-invalid",u="js-mollie-observed";class p{constructor(e){this._repoBuyBox=new a,this._document=e}initCheckbox(){let e=this._document.querySelectorAll(`.mollie-privacy-note:not(.${u})`);for(let t=0;t<e.length;t++){let i=e[t];i.classList.remove(d),i.classList.add(u);let n=this._repoBuyBox.findClosestBuyBox(i);if(null===n){i.classList.add(d);continue}let o=this._repoBuyBox.findAllExpressButtons(n,null);if(0===o.length){i.classList.add(d);continue}for(let e=0;e<o.length;
1e++){let t=o[e];new MutationObserver(e=>{let t=o.length;i.classList.remove(d),e.forEach(e=>{e.target.classList.contains(d)&&t--}),t<=0&&i.classList.add(d)}).observe(t,{attributes:!0,attributeFilter:["class"]})}}}getAcceptedDataProtection(e){let t=this._repoBuyBox.findClosestPrivacyBox(e);if(null===t)return 0;let i=this._repoBuyBox.getPrivacyBoxCheckbox(t);return null===i?0:+!!i.checked}validateForExpressButton(e){let t=this._repoBuyBox.findClosestPrivacyBox(e);if(!(t instanceof HTMLDivElement))return!0;let i=this._repoBuyBox.getPrivacyBoxCheckbox(t),n=+!!i.checked;return i.classList.remove(c),0!==n||(i.classList.add(c),!1)}}class h{addEventListenerOnce(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"click",n="__handler_"+i;e[n]||(e.addEventListener(i,t),e[n]=!0)}}class m{register(e,t){let i=window.PluginManager.getPluginList().OffCanvasCart;if(!i)return;let n=i.get("instances");if(n)for(let i=0;i<n.length;i++){let o=n[i];o["_"+t+"_subscribed"]||(o.$emitter.subscribe("registerEvents",e),o["_"+t+"_subscribed"]=!0)}}}let y="loading";class f{constructor(){this._repoBuyBox=new a}addItemToCart(e){let t=this._repoBuyBox.findClosestShopwareBuyButton(e);if(!(t instanceof HTMLButtonElement))return;let i=t.closest("form");if(!(i instanceof HTMLFormElement)||e.classList.contains(y))return;let n=i.elements,o=[];e.classList.add(y);for(let e=0;e<n.length;e++){let t=n[e];("radio"!==t.type||t.checked)&&t.name&&"redirectTo"!==t.name&&o.push(encodeURIComponent(t.name)+"="+encodeURIComponent(t.value))}o.push("isExpressCheckout=1");let s=i.action,r=i.method,l=new XMLHttpRequest;l.open(r,s,!1),l.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),l.onreadystatechange=()=>{if(l.readyState===XMLHttpRequest.DONE&&(e.classList.remove(y),l.status>=400))throw Error(`Request failed with status ${l.status}`)},l.send(o.join("&"))}}class C{constructor(){this.APPLE_PAY_VERSION=3,this.client=new t}create(e,t,i,n,o,s,r){let l=this;var a=["name","email","postalAddress"];1===n&&a.push("phone");let d=new ApplePaySession(this.APPLE_PAY_VERSION,{countryCode:t,currencyCode:i,requiredShippingContactFields:a,supportedNetworks:["amex","maestro","masterCard","visa","vPay"],merchantCapabilities:["supports3DS"],total:{label:"",amount:0}});return d.onvalidatemerchant=function(e){l.client.post(o+"/mollie/apple-pay/validate",JSON.stringify({validationUrl:e.validationURL}),t=>{if(!1===t.success)throw Error("Validation failed for URL: "+e.validationURL);let i=JSON.parse(t.session);d.completeMerchantValidation(i)},()=>{d.abort()})},d.onshippingcontactselected=function(e){var t="";void 0!==e.shippingContact.countryCode&&(t=e.shippingContact.countryCode),l.client.post(o+"/mollie/apple-pay/shipping-methods",JSON.stringify({countryCode:t}),e=>{e.success?d.completeShippingContactSelection(ApplePaySession.STATUS_SUCCESS,e.shippingmethods,e.cart.total,e.cart.items):d.completeShippingContactSelection(ApplePaySession.STATUS_FAILURE,[],{label:"",amount:0,pending:!0},[])},()=>{d.abort()})},d.onshippingmethodselected=function(e){l.client.post(o+"/mollie/apple-pay/set-shipping",JSON.stringify({identifier:e.shippingMethod.identifier}),e=>{e.success?d.completeShippingMethodSelection(ApplePaySession.STATUS_SUCCESS,e.cart.total,e.cart.items):d.completeShippingMethodSelection(ApplePaySession.STATUS_FAILURE,{label:"",amount:0,pending:!0},[])},()=>{d.abort()})},d.onpaymentauthorized=function(e){var t=e.payment.token;t=JSON.stringify(t),d.completePayment(ApplePaySession.STATUS_SUCCESS),l.finishPayment(o+"/mollie/apple-pay/start-payment",t,e.payment,s),r.classList.remove("processed")},d.oncancel=function(){e&&l.client.post(o+"/mollie/apple-pay/restore-cart"),r.classList.remove("processed")},d}finishPayment(e,t,i,n){let o=function(e,t){let i=document.createElement("input");return i.type="hidden",i.name=e,i.value=t,i},s=document.createElement("form");s.action=e,s.method="POST";let r=i.shippingContact.addressLines[0];i.shippingContact.addressLines.length>1&&(r+=" "+i.shippingContact.addressLines[1]),s.insertAdjacentElement("beforeend",o("email",i.shippingContact.emailAddress)),s.insertAdjacentElement("beforeend",o("lastname",i.shippingContact.familyName)),s.insertAdjacentElement("beforeend",o("firstname",i.shippingContact.givenName)),s.insertAdjacentElement("beforeend",o("street",r)),s.insertAdjacentElement("beforeend",o("postalCode",i.shippingContact.postalCode)),s.insertAdjacentElement("beforeend",o("city",i.shippingContact.locality)),s.insertAdjacentElement("beforeend",o("acceptedDataProtection",n)),void 0!==i.shippingContact.phoneNumber&&i.shippingContact.phoneNumber.length>0&&s.insertAdjacentElement("beforeend",o("phone",i.shippingContact.phoneNumber)),s.insertAdjacentElement("beforeend",o("countryCode",i.shippingContact.countryCode)),s.insertAdjacentElement("beforeend",o("paymentToken",t)),document.body.insertAdjacentElement("beforeend",s),s.submit()}}class g{constructor(){this._repoBuyBox=new a}isCheckoutPossible(e){let t=this._repoBuyBox.findClosestShopwareBuyButton(e);return!(t instanceof HTMLButtonElement)||!t.hasAttribute("disabled")}}class _{constructor(e,t){this._countryCode=e.querySelector('input[name="countryCode"]').value,this._currency=e.querySelector('input[name="currency"]').value,this._mode=e.querySelector('input[name="mode"]').value,this._withPhone=parseInt(e.querySelector('input[name="withPhone"]').value),this._isProductMode="productMode"===this._mode;let i=t.getAttribute("data-shop-url");"/"===i.slice(-1)&&(i=i.slice(0,-1)),this._shopSlug=i}isProductMode(){return this._isProductMode}getCountryCode(){return this._countryCode}getCurrency(){return this._currency}getMode(){return this._mode}getWithPhone(){return this._withPhone}getShopSlug(){return this._shopSlug}}let v="d-none";class S extends i{init(){this._privacySection=new p(document),this._eventUtils=new h,this._cartService=new f,this._productBoxValidator=new g,this._repoBuyBox=new a(document),new m().register(this.initCurrentPage.bind(this),"mollie-apple-pay-direct"),this.initCurrentPage()}initCurrentPage(){if(this._applePayButtons=this._repoBuyBox.findApplePayButtons(),this._applePayContainers=this._repoBuyBox.findApplePayContainers(),!window.ApplePaySession||!window.ApplePaySession.canMakePayments()||this._applePayButtons.length<=0){this.hideApplePayFeature();return}if(this._privacySection.initCheckbox(),this.showApplePayFeature(),this._applePayButtons)for(let e=0;e<this._applePayButtons.length;e++){let t=this._applePayButtons[e];this._eventUtils.addEventListenerOnce(t,this.onApplePayButtonClicked.bind(this),"click"),this.updateButtonVisibility(t);let i=this._repoBuyBox.findClosestBuyBox(t);null!==i&&i.addEventListener("change",()=>{this.updateButtonVisibility(t)})}}updateButtonVisibility(e){this._productBoxValidator.isCheckoutPossible(e)?(e.hidden=!1,e.classList.remove(v)):(e.hidden=!0,e.classList.add(v))}
1showApplePayFeature(){if(this._applePayContainers)for(let e=0;e<this._applePayContainers.length;e++)this._applePayContainers[e].classList.remove(v);if(this._applePayButtons)for(let e=0;e<this._applePayButtons.length;e++)this._applePayButtons[e].classList.remove(v)}hideApplePayFeature(){if(this._applePayContainers)for(let e=0;e<this._applePayContainers.length;e++)this._applePayContainers[e].classList.add(v);if(this._applePayButtons)for(let e=0;e<this._applePayButtons.length;e++)this._applePayButtons[e].classList.add(v)}onApplePayButtonClicked(e){let t=e.currentTarget;if(!this._productBoxValidator.isCheckoutPossible(t)||!this._privacySection.validateForExpressButton(t))return;let i=new _(this._repoBuyBox.findClosestApplePayContainer(t),t);i.isProductMode()&&this._cartService.addItemToCart(t),new C().create(i.isProductMode(),i.getCountryCode(),i.getCurrency(),i.getWithPhone(),i.getShopSlug(),this._privacySection.getAcceptedDataProtection(t),t).begin()}}class E extends i{static #e=this.options={shopUrl:null,hideAlways:!1,applePayId:null,hideApplePayOption:!1};init(){!(!this.options.hideAlways&&window.ApplePaySession&&window.ApplePaySession.canMakePayments())&&(this.hideApplePay("#paymentMethod"+this.options.applePayId),this.options.hideApplePayOption&&this.hideApplePaySelect(this.options.applePayId))}hideApplePay(e){let t=document.querySelector(e),i=this.getClosest(t,".payment-method");i&&i.classList&&i.remove()}hideApplePaySelect(e){let t=document.querySelector('option[value="'+e+'"]');null!==t&&t.remove()}getShopUrl(){let e=this.options.shopUrl;if(void 0===e)return"";for(;"/"===e.substr(-1);)e=e.substr(0,e.length-1);return e}getClosest(e,t){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){let t=(this.document||this.ownerDocument).querySelectorAll(e),i=t.length;for(;--i>=0&&t.item(i)!==this;);return i>-1});e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null}}let b="d-none";class w extends i{static #e=this.options={shopUrl:null,customerId:null,mollieMandateContainerClass:".mollie-credit-card-mandate",mollieMandateDataId:"data-mollie-credit-card-mandate-id",mollieMandateRemoveButtonClass:".mollie-credit-card-mandate-remove",mollieMandateRemoveModalButtonClass:".mollie-credit-card-mandate-remove-modal-button",mollieMandateDeleteAlertSuccessId:"#mollieCreditCardMandateDeleteSuccess",mollieMandateDeleteAlertErrorId:"#mollieCreditCardMandateDeleteError"};init(){if(!this.options.shopUrl)throw Error(`The "shopUrl" option for the plugin "${this._pluginName}" is not defined.`);if(!this.options.customerId)throw Error(`The "customerId" option for the plugin "${this._pluginName}" is not defined.`);this.mollieMandateDeleteAlertEl=document.querySelector(this.options.mollieMandateDeleteAlertSuccessId),this.mollieMandateDeleteAlertEl&&(this.mollieMandateDeleteAlertErrorEl=document.querySelector(this.options.mollieMandateDeleteAlertErrorId),this.mollieMandateDeleteAlertErrorEl&&(this.client=new t,this.registerEvents()))}registerEvents(){let e=document.querySelectorAll(this.options.mollieMandateRemoveButtonClass);if(!e||0===e.length)return;let t=document.querySelectorAll(this.options.mollieMandateRemoveModalButtonClass);t&&0!==t.length&&(e.forEach(e=>{e._mollieManageInit||(e._mollieManageInit=!0,e.addEventListener("click",t=>{t.preventDefault(),this.onRemoveButtonClick(e)}))}),t.forEach(e=>{e._mollieManageInit||(e._mollieManageInit=!0,e.addEventListener("click",e=>{e.preventDefault(),this.onConfirmRemoveButtonClick()}))}))}onRemoveButtonClick(e){this.currentContainerEl=e.closest(this.options.mollieMandateContainerClass),this.currentContainerEl&&(this.currentMandateId=this.currentContainerEl.getAttribute(this.options.mollieMandateDataId))}onConfirmRemoveButtonClick(){let e=this.currentContainerEl,t=this.currentMandateId;e&&t&&(this.currentMandateId=null,this.currentContainerEl=null,this.deleteMandate(t).then(t=>{let{success:i}=t;i?(this.mollieMandateDeleteAlertErrorEl.classList.add(b),this.mollieMandateDeleteAlertEl.classList.remove(b),e.remove()):(this.mollieMandateDeleteAlertEl.classList.add(b),this.mollieMandateDeleteAlertErrorEl.classList.remove(b))}))}deleteMandate(e){return new Promise(t=>{this.client.post(this.options.shopUrl+"/mollie/components/revoke-mandate/"+this.options.customerId+"/"+e,"",e=>{t({success:e&&e.success})},()=>{t({success:!1})},"application/json; charset=utf-8")})}}let P="d-none";class B extends i{init(){this._container=document.querySelector("div.mollie-pos-terminals"),void 0!==this._container&&null!==this._container&&(this.initControls(),null!==this._paymentForm&&null!==this._dropdownTerminals&&(this.registerEvents(),this.updateDropdownVisibility(this._posRadioInput,this._container,this._dropdownTerminals),this.updateTerminal(this._shopUrl,this._customerId,this._posRadioInput,this._dropdownTerminals,function(){})))}
1initControls(){if(this._shopUrl=this._container.getAttribute("data-shop-url"),"/"===this._shopUrl.substr(-1)&&(this._shopUrl=this._shopUrl.substr(0,this._shopUrl.length-1)),this._customerId=this._container.getAttribute("data-customer-id"),this._dropdownTerminals=document.querySelector("#posTerminals"),this._paymentForm=document.querySelector("#changePaymentForm"),void 0===this._paymentForm||null===this._paymentForm)return;this._radioInputs=this._paymentForm.querySelectorAll('input[type="radio"]');let e=this._container.getAttribute("data-pos-payment-id");this._posRadioInput=e?this._paymentForm.querySelector("#paymentMethod"+e):null}registerEvents(){if(null===this._paymentForm)return;let e=this._shopUrl,t=this._customerId,i=this._container,n=this._radioInputs,o=this._posRadioInput,s=this._dropdownTerminals;n.forEach(e=>{e.addEventListener("change",()=>{this.updateDropdownVisibility(o,i,s)})}),s.addEventListener("change",async()=>{this.updateTerminal(e,t,o,s,function(){})})}updateDropdownVisibility(e,t,i){let n=!1;void 0===e||!1===e.checked?t.classList.add(P):(t.classList.remove(P),n=!0),void 0!==i&&(i.required=n)}updateTerminal(e,i,n,o,s){if(void 0===n){s("POS Radio Input not defined");return}if(null===n){s("POS Radio Input not found");return}if(!1===n.checked){s("POS payment not active");return}if(void 0===o){s("POS terminals not defined");return}if(null===o){s("POS terminals not found");return}if(""===o.value){s("no POS terminal selected");return}new t().post(e+"/mollie/pos/store-terminal/"+i+"/"+o.value,"",function(){s("terminal updated successfully")},function(){s("error when updating terminal")},"application/json; charset=utf-8")}constructor(...e){super(...e),this._shopUrl="",this._customerId="",this._dropdownTerminals=null,this._container=null,this._paymentForm=null,this._radioInputs=null,this._posRadioInput=null}}let A="d-none";class M extends i{init(){this._privacySection=new p(document),this._eventUtils=new h,this._cartService=new f,this._productBoxValidator=new g,this._repoBuyBox=new a(document),new m().register(this.bindEvents.bind(this),"mollie-paypal-express"),this.bindEvents()}bindEvents(){let e=this._repoBuyBox.findPayPalExpressButtons();if(0!==e.length){this._privacySection.initCheckbox();for(let t=0;t<e.length;t++){let i=e[t];this._eventUtils.addEventListenerOnce(i,this.onExpressCheckout.bind(this),"click"),this.updateButtonVisibility(i);let n=this._repoBuyBox.findClosestBuyBox(i);null!==n&&n.addEventListener("change",()=>{this.updateButtonVisibility(i)})}}}updateButtonVisibility(e){this._productBoxValidator.isCheckoutPossible(e)?(e.hidden=!1,e.classList.remove(A)):(e.hidden=!0,e.classList.add(A))}onExpressCheckout(e){let t=e.currentTarget;if(!this._productBoxValidator.isCheckoutPossible(t)||!this._privacySection.validateForExpressButton(t))return;this._cartService.addItemToCart(t);let i=t.getAttribute("data-form-action"),n=document.createElement("form");n.setAttribute("action",i),n.setAttribute("method","POST");let o=document.createElement("input");o.type="hidden",o.name="acceptedDataProtection",o.value=this._privacySection.getAcceptedDataProtection(t),n.insertAdjacentElement("beforeend",o),document.body.insertAdjacentElement("beforeend",n),n.submit()}}let x="https://js.mollie.com/v2/mollie.js";class L{load(){return window.mollieExpressScriptPromise||(window.mollieExpressScriptPromise=new Promise((e,t)=>{let i=document.createElement("script");i.src=x,i.onload=()=>e(),i.onerror=()=>t(Error("Mollie: could not load "+x)),document.head.appendChild(i)})),window.mollieExpressScriptPromise}resolve(){return window.Mollie2&&"function"==typeof window.Mollie2.Checkout?window.Mollie2:window.Mollie&&"function"==typeof window.Mollie.Checkout?window.Mollie:null}createCheckout(e,t){let i=this.resolve();if(null===i)throw Error("Mollie: mollie.js v2 is not available");return i.Checkout(e,{locale:t})}}let I="data-mollie-express-component-mounted";class k extends i{init(){this._checkoutService=new L,new m().register(this.mountAll.bind(this),"mollie-express-components"),this.mountAll()}mountAll(){let e=document.querySelectorAll("[data-mollie-express-component]");0!==e.length&&this._checkoutService.load().then(()=>
1{e.forEach(e=>this.mount(e))}).catch(e=>{console.error(e)})}mount(e){if(e.hasAttribute(I))return;let t=e.getAttribute("data-client-access-token");if(t)try{this._checkoutService.createCheckout(t,e.getAttribute("data-locale")).create("express-component",this.getOptions(e)).mount(e),e.setAttribute(I,"true")}catch(e){console.error(e)}}getOptions(e){let t=e.getAttribute("data-options");if(!t)return{};try{return JSON.parse(t)}catch(e){return console.error(e),{}}}}let F="d-none",q="aria-invalid";class D extends i{init(){let e=document.getElementById("molliePayPhone");if(null===e)return;let t=document.querySelector(".mollie-phone-field"),i=document.querySelector('.mollie-phone-field [data-form-validation-invalid-phone="true"]');this._addListener(e,"focus",e=>{t.classList.add("was-validated"),e.target.removeAttribute(q),i.classList.add(F)}),this._addListener(e,"blur",e=>{let t=e.target.form;return!1===t.reportValidity()&&(e.target.setAttribute(q,"true"),i.classList.remove(F)),t.reportValidity()})}}class U extends i{static #e=this.options={productId:""};init(){this._form=this.el.closest("form"),null!==this._form&&(this._onSubmit=this._onSubmit.bind(this),this._addListener(this._form,"submit",this._onSubmit,!0))}_onSubmit(e){let t=this._form.querySelector(`input[name="${U.FIELD_NAME}"]`);if(e.submitter!==this.el){null!==t&&t.remove();return}null===t&&((t=document.createElement("input")).type="hidden",t.name=U.FIELD_NAME,this._form.appendChild(t)),t.value=this.options.productId}}U.FIELD_NAME="mollieSubscribe",window.addEventListener("pageshow",function(e){e.persisted&&window.location.pathname.includes("/account/order/edit/")&&window.location.reload()}),window.__mollieStorefrontRegistered||(window.__mollieStorefrontRegistered=!0,new class{register(){let e=window.PluginManager,t=[["MollieApplePayDirect",S,"body"],["PayPalExpressPlugin",M,"body"],["MollieExpressComponents",k,"body"],["MollieApplePayPaymentMethod",E,"[data-mollie-template-applepay-account]"],["MollieApplePayPaymentMethod",E,"[data-mollie-template-applepay-checkout]"],["MollieCreditCardComponents",l,"[data-mollie-template-creditcard-components]"],["MollieCreditCardMandateManage",w,"[data-mollie-credit-card-mandate-manage]"],["MolliePosTerminal",B,"[data-mollie-template-pos-terminal]"],["MolliePhonePlugin",D,"[data-mollie-phone-validation]"],["MollieSubscribeButton",U,"[data-mollie-subscribe-button]"]];t.forEach(function(t){e.register(t[0],t[1],t[2])}),t.forEach(function(t){e.initializePlugin(t[0],t[2])})}}().register())})();

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.