PageSourceSearch

https://poolpirat.de/theme/b002415d6dec30742cf6a0c793c99022/js/eas…/easy-credit-ratenkauf.js?1791281190

js poolpirat.de collected 2026-10-08 05:38:43 UTC 17,547 bytes, 1 lines download raw bytes

1(()=>{"use strict";var e={857:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==r},r="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function n(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function s(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function o(e,t){try{return t in e}catch(e){return!1}}function a(e,r,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=i;var c,u,d=Array.isArray(r);return d!==Array.isArray(e)?i(r,l):d?l.arrayMerge(e,r,l):(u={},(c=l).isMergeableObject(e)&&s(e).forEach(function(t){u[t]=i(e[t],c)}),s(r).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&c.isMergeableObject(r[t])?u[t]=(function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a})(t,c)(e[t],r[t],c):u[t]=i(r[t],c))}),u)}a.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return a(e,r,t)},{})},e.exports=a}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.exports}(()=>{r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t}})(),(()=>{r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}})(),(()=>{r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{var e=r(857),t=r.n(e);class i{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(e,t){let r=i.toUpperCamelCase(e,t);return i.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>i.ucFirst(e.toLowerCase())).join(""):i.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class n{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!n.isNode(e))throw Error("The element must be a valid HTML Node!");return"function"==typeof e.hasAttribute&&e.hasAttribute(t)}static getAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!1===n.hasAttribute(e,t))throw Error('The required property "'.concat(t,'" does not exist!'));if("function"!=typeof e.getAttribute){if(r)throw Error("This node doesn't support the getAttribute function!");return}return e.getAttribute(t)}static getDataAttribute(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=t.replace(/^data(|-)/,""),o=i.toLowerCamelCase(s,"-");if(!n.isNode(e)){if(r)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===e.dataset){if(r)throw Error("This node doesn't support the dataset attribute!");return}let a=e.dataset[o];if(void 0===a){if(r)throw Error('The required data attribute "'.concat(t,'" does not exist on ').concat(e,"!"));return a}return i.parsePrimitive(a)}static querySelector(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelector(t)||!1;if(r&&!1===i)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return i}static querySelectorAll(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!n.isNode(e))throw Error("The parent node is not a valid HTML Node!");let i=e.querySelectorAll(t);if(0===i.length&&(i=!1),r&&!1===i)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return i}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
1([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 s{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(i),i}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,n=e.split("."),s=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=s;s=function(r){i.unsubscribe(e),t(r)}}return this.el.addEventListener(n[0],s),this.listeners.push({splitEventName:n,opts:r,cb:s}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,r)=>([...r.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(r.splitEventName[0],r.cb):e.push(r),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}}class o{init(){throw Error('The "init" method for the plugin "'.concat(this._pluginName,'" is not defined.'))}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let r=i.toDashCase(this._pluginName),s=n.getDataAttribute(this.el,"data-".concat(r,"-config"),!1),o=n.getAttribute(this.el,"data-".concat(r,"-options"),!1),a=[this.constructor.options,this.options,e];s&&a.push(window.PluginConfigManager.get(this._pluginName,s));try{o&&a.push(JSON.parse(o))}catch(e){throw console.error(this.el),Error('The data attribute "data-'.concat(r,'-options" could not be parsed to json: ').concat(e.message))}return t().all(a.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}constructor(e,t={},r=!1){if(!n.isNode(e))throw Error("There is no valid element given.");this.el=e,this.$emitter=new s(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}}class a{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!"))}}let l="loader",c={BEFORE:"before",INNER:"inner"};class u{create(){if(!this.exists()){if(this.position===c.INNER){this.parent.innerHTML=u.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),u.getTemplate())}}remove(){let e=this.parent.querySelectorAll(".".concat(l));a.iterate(e,e=>e.remove())}exists(){return this.parent.querySelectorAll(".".concat(l)).length>0}_getPosition(){return this.position===c.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(l,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return l}constructor(e,t=c.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}}class d extends u{create(){super.create(),this._isButtonElement()?this.parent.disabled=!0:this._isAnchorElement()&&this.parent.classList.add("disabled")}remove(){super.remove(),this._isButtonElement()?this.parent.disabled=!1:this._isAnchorElement()&&this.parent.classList.remove("disabled")}_isButtonElement(){return"button"===this.parent.tagName.toLowerCase()}_isAnchorElement(){return"a"===this.parent.tagName.toLowerCase()}
1constructor(e,t="before"){if(super(e,t),!this._isButtonElement()&&!this._isAnchorElement())throw Error("Parent element is not of type <button> or <a>")}}let h=async()=>{let e;if(void 0===window.csrf)return;let t=window.csrf;return"1"===t.enabled&&"ajax"===t.mode&&(e=await fetch(window.router["frontend.csrf.generateToken"],{method:"POST",headers:new Headers({"content-type":"application/json"})}).then(e=>e.json()).then(e=>e.token)),e},m=(e,t)=>{var r=document.createElement("input");return r.setAttribute("type","hidden"),r.setAttribute("name",e),r.setAttribute("value",t),r};PluginManager.register("EasyCreditRatenkaufCheckout",class extends o{init(){if(!document.querySelector("easycredit-checkout"))return;this._submitButtonLoaders=[],document.addEventListener("easycredit-submit",e=>this.onEasyCreditSubmit(e));let e=document.getElementById("confirmOrderForm");e&&e.addEventListener("submit",e=>this.onConfirmOrderSubmit(e))}async onEasyCreditSubmit(e){var t;if(e.target.matches("easycredit-checkout"))return await this.startEasyCreditCheckout((t=e.detail)===null||void 0===t?void 0:t.numberOfInstallments),!1}async onConfirmOrderSubmit(e){let t=this.getActiveEasyCreditCheckout();if(!t||this.isEasyCreditApproved(t))return;let r=e.currentTarget;this._hasInvalidFields(r)||(e.preventDefault(),this.showConfirmSubmitLoading(r,e.submitter),await this.startEasyCreditCheckout(this.getNumberOfInstallments(t)))}getActiveEasyCreditCheckout(){return document.querySelector('easycredit-checkout[is-active="true"]')}isEasyCreditApproved(e){let t=e.getAttribute("payment-plan");return null!==t&&""!==t}getNumberOfInstallments(e){if(null!=e.numberOfInstallments&&""!==e.numberOfInstallments)return String(e.numberOfInstallments);if(null!=e.financingTerm&&""!==e.financingTerm)return String(e.financingTerm);if(e.shadowRoot){let t=e.shadowRoot.querySelector("select");if(null==t?void 0:t.value)return t.value}return""}showConfirmSubmitLoading(e,t){let r=window.PluginManager.getPluginInstanceFromElement(e,"FormHandler");if(r&&"function"==typeof r.addLoadingIndicator){var i;((i=r.submittButtonLoaders)===null||void 0===i?void 0:i.length)||r.addLoadingIndicator();return}this.getConfirmSubmitButtons(e,t).forEach(e=>{if(e.classList.contains("is-loading-indicator-inner"))return;let t=new d(e,c.INNER);t.create(),this._submitButtonLoaders.push(t)})}getConfirmSubmitButtons(e,t){if((null==t?void 0:t.type)==="submit")return[t];let r=Array.from(e.querySelectorAll('button[type="submit"]'));return e.id&&r.push(...Array.from(document.querySelectorAll('button[type="submit"][form="'.concat(e.id,'"]')))),[...new Set(r)]}_hasInvalidFields(e){if(void 0===window.formValidation)return!1;let t=e.elements?[...e.elements]:[];return window.formValidation.validateForm(e,t).length>0}async startEasyCreditCheckout(e){let t=document.getElementById("changePaymentForm");if(!t)return;let r=await h();r&&t.append(m("_csrf_token",r)),t.append(m("easycredit[submit]","1")),t.append(m("easycredit[number-of-installments]",null!=e?e:"")),t.submit()}},".is-ctl-checkout.is-act-confirmpage"),PluginManager.register("EasyCreditRatenkaufCheckoutExpress",class extends o{init(){document.addEventListener("easycredit-submit",async e=>{var t,r;if(!e.target.matches("easycredit-express-button"))return;let i=e.target,n=this.buildAdditionalParams(e.detail);if(document.querySelector(".is-ctl-checkout.is-act-cartpage")||i.closest(".cart-offcanvas")){let e=document.createElement("form");e.method="POST",e.action=(t=window.router["frontend.easycredit.express"])!==null&&void 0!==t?t:"/easycredit/express",e.style.display="none";let r=await h();for(let[t,i]of(r&&e.appendChild(m("_csrf_token",r)),Object.entries(n)))e.appendChild(m(t,i));document.body.appendChild(e),e.submit();return}let s=document.getElementById("productDetailPageBuyProductForm");if(s){let e={},t=await h();if(t&&(e._csrf_token=t),e.redirectTo="frontend.easycredit.express",e.redirectParameters=JSON.stringify(n),r=await this.replicateForm(s,e)){r.submit();return}}window.alert("Die Express-Zahlung mit easyCredit konnte nicht gestartet werden."),console.error("easyCredit payment could not be started. Please check the integration.")})}replicateForm(e,t){if(!(e instanceof HTMLFormElement))return!1;let r=e.getAttribute("action"),i=e.getAttribute("method");if(!r||!i)return!1;let n=document.createElement("form");n.setAttribute("action",r),n.setAttribute("method",i),n.style.display="none";let s=new FormData(e);for(let[e,r]of Object.entries(t))s.set(e,r);for(let e of s.keys()){let t=document.createElement("input");t.setAttribute("type","hidden"),t.setAttribute("name",e),t.setAttribute("value",s.get(e)),n.appendChild(t)}return document.body.appendChild(n),n}constructor(...e){super(...e),this.buildAdditionalParams=e=>{let t={};for(let[r,i]of(e.express="1",Object.entries(e)))t["easycredit["+r+"]"]=i;return t}}},"easycredit-express-button"),PluginManager.register("EasyCreditRatenkaufWidget",class extends o{init(){this.initWidget(document.querySelector(".product-detail-buy")),this.initWidget(document.querySelector(".cms-element-product-listing")),this.initWidget(document.querySelector(".is-act-cartpage")),this.registerOffCanvas(),this.registerListingListener()}registerOffCanvas(){let e=document.querySelector("[data-off-canvas-cart],[data-offcanvas-cart]");if(!e)return;let t=window.PluginManager.getPluginInstanceFromElement(e,"OffCanvasCart");t&&t.$emitter.subscribe("offCanvasOpened",()=>{this.initWidget(document.querySelector("div.offcanvas-cart"))})}registerListingListener(){let e=document.querySelector("[data-listing-pagination]");if(!e)return;let t=window.PluginManager.getPluginInstanceFromElement(e,"Listing");t&&t.$emitter.subscribe("Listing/afterRenderResponse",()=>{this.initWidget(document.querySelector(".cms-element-product-listing")),this.initWidget(document.querySelector(".product-detail-buy"))})}initWidget(e){if(!e)return;let t=this.getMeta("widget-selector",e);if(null===t||null===this.getMeta("api-key"))return;let r=this.processSelector(t);for(let t of e.querySelectorAll(r.selector))if(this.applyWidget(t,r.attributes),".checkout-aside-action:not(.d-grid)"===r.selector)break}applyWidget(e,t){let r=this.getMeta("amount",e);if(null===r||isNaN(r)){let t=e.parentNode;r=t&&t.querySelector("[itemprop=price]")?t.querySelector("[itemprop=price]").content:null}if(null===r||isNaN(r))return;let i=document.createElement("easycredit-widget");if(i.setAttribute("webshop-id",this.getMeta("api-key")),i.setAttribute("amount",r),i.setAttribute("payment-types",this.getMeta("payment-types",e)),this.getMeta("disable-flexprice",e)?i.setAttribute("disable-flexprice","true"):i.removeAttribute("disable-flexprice"),t)for(let[e,r]of Object.entries(t))i.setAttribute(e,r);e.appendChild(i)}getMeta(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(r){let t=this.searchUpTheTree(r,'script.easycredit-config[type="application/json"]'),i=this.extractConfigValueFromJson(t&&t.textContent,e);if(null!=i)return i}let i=document.head.querySelector(".easycredit-config"),n=this.extractConfigValueFromJson(i&&i.textContent,e);if(null!=n)return n;let s="meta[name=easycredit-"+e+"]";
1return(t=r?this.searchUpTheTree(r,s):document.querySelector(s))?t.content:null}processSelector(e){let t;if(t=e.match(/(.+) easycredit-widget(\[.+?\])$/)){let e=t[2].split("]").map(e=>e.slice(1).split("=")).filter(e=>{let[t,r]=e;return t}).reduce((e,t)=>{let[r,i]=t;return{...e,[r]:i}},{});return{selector:t[1],attributes:e}}return{selector:e}}searchUpTheTree(e,t){for(;e&&e.parentElement;){let r=e.parentElement,i=Array.from(r.children).find(r=>r!==e&&r.matches(t));if(i)return i;e=r}return e===document.documentElement&&Array.from(document.head.children).find(e=>e.matches(t))||null}extractConfigValue(e,t){if(!e||"object"!=typeof e||!Object.prototype.hasOwnProperty.call(e,t))return null;let r=e[t];return Array.isArray(r)?r.join(","):"object"==typeof r?Object.values(r).join(","):"boolean"==typeof r?r?"true":"":r}extractConfigValueFromJson(e,t){if(!e||"string"==typeof e&&""===e.trim())return null;try{let r=JSON.parse(e);return this.extractConfigValue(r,t)}catch(e){return null}}},"body"),PluginManager.register("EasyCreditRatenkaufMarketing",class extends o{init(){this.initMarketing()}initMarketing(){if(this.body=document.querySelector("body"),this.bar=document.querySelector("easycredit-box-top"),this.bar&&this.body.classList.add("easycredit-box-top"),this.card=document.querySelector(".easycredit-box-listing"),this.card){var e,t=[...(e=this.card).parentElement.children].filter(t=>t!=e),r=this.card.querySelector("easycredit-box-listing").getAttribute("position"),i=Number(r-1),n=Number(r-2);!r||i<=0||(n in t?t[n].after(this.card):this.card.parentElement.append(this.card))}}},"body")})()})();

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.