PageSourceSearch

https://www.schiebetueren-profi.com/theme/d7a99c6013422574ff9e3a05…/swag-amazon-pay.js?1788429656

js schiebetueren-profi.com collected 2026-09-26 06:35:29 UTC 20,724 bytes, 1 lines download raw bytes

1(()=>{"use strict";var t={857:t=>{var e=function(t){var e;return!!t&&"object"==typeof t&&"[object RegExp]"!==(e=Object.prototype.toString.call(t))&&"[object Date]"!==e&&t.$$typeof!==n},n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?s(Array.isArray(t)?[]:{},t,e):t}function a(t,e,n){return t.concat(e).map(function(t){return i(t,n)})}function o(t){return Object.keys(t).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[])}function r(t,e){try{return e in t}catch(t){return!1}}function s(t,n,c){(c=c||{}).arrayMerge=c.arrayMerge||a,c.isMergeableObject=c.isMergeableObject||e,c.cloneUnlessOtherwiseSpecified=i;var l,d,u=Array.isArray(n);return u!==Array.isArray(t)?i(n,c):u?c.arrayMerge(t,n,c):(d={},(l=c).isMergeableObject(t)&&o(t).forEach(function(e){d[e]=i(t[e],l)}),o(n).forEach(function(e){(!r(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(r(t,e)&&l.isMergeableObject(n[e])?d[e]=(function(t,e){if(!e.customMerge)return s;var n=e.customMerge(t);return"function"==typeof n?n:s})(e,l)(t[e],n[e],l):d[e]=i(n[e],l))}),d)}s.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,n){return s(t,n,e)},{})},t.exports=s}},e={};function n(i){var a=e[i];if(void 0!==a)return a.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}(()=>{n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e}})(),(()=>{n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})}})(),(()=>{n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})(),(()=>{var t=n(857),e=n.n(t);class i{static ucFirst(t){return t.charAt(0).toUpperCase()+t.slice(1)}static lcFirst(t){return t.charAt(0).toLowerCase()+t.slice(1)}static toDashCase(t){return t.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(t,e){let n=i.toUpperCamelCase(t,e);return i.lcFirst(n)}static toUpperCamelCase(t,e){return e?t.split(e).map(t=>i.ucFirst(t.toLowerCase())).join(""):i.ucFirst(t.toLowerCase())}static parsePrimitive(t){try{return/^\d+(.|,)\d+$/.test(t)&&(t=t.replace(",",".")),JSON.parse(t)}catch(e){return t.toString()}}}class a{static isNode(t){return"object"==typeof t&&null!==t&&(t===document||t===window||t instanceof Node)}static hasAttribute(t,e){if(!a.isNode(t))throw Error("The element must be a valid HTML Node!");return"function"==typeof t.hasAttribute&&t.hasAttribute(e)}static getAttribute(t,e){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!1===a.hasAttribute(t,e))throw Error('The required property "'.concat(e,'" does not exist!'));if("function"!=typeof t.getAttribute){if(n)throw Error("This node doesn't support the getAttribute function!");return}return t.getAttribute(e)}static getDataAttribute(t,e){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],o=e.replace(/^data(|-)/,""),r=i.toLowerCamelCase(o,"-");if(!a.isNode(t)){if(n)throw Error("The passed node is not a valid HTML Node!");return}if(void 0===t.dataset){if(n)throw Error("This node doesn't support the dataset attribute!");return}let s=t.dataset[r];if(void 0===s){if(n)throw Error('The required data attribute "'.concat(e,'" does not exist on ').concat(t,"!"));return s}return i.parsePrimitive(s)}static querySelector(t,e){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!a.isNode(t))throw Error("The parent node is not a valid HTML Node!");let i=t.querySelector(e)||!1;if(n&&!1===i)throw Error('The required element "'.concat(e,'" does not exist in parent node!'));return i}static querySelectorAll(t,e){let n=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(n&&!a.isNode(t))throw Error("The parent node is not a valid HTML Node!");let i=t.querySelectorAll(e);if(0===i.length&&(i=!1),n&&!1===i)throw Error('At least one item of "'.concat(e,'" must exist in parent node!'));return i}static getFocusableElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return t.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 t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return this.getFocusableElements(t)[0]}static getLastFocusableElement(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=this.getFocusableElements(t);return e[e.length-1]}}class o{publish(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=new CustomEvent(t,{detail:e,cancelable:n});return this.el.dispatchEvent(i),i}subscribe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this,a=t.split("."),o=n.scope?e.bind(n.scope):e;if(n.once&&!0===n.once){let e=o;o=function(n){i.unsubscribe(t),e(n)}}return this.el.addEventListener(a[0],o),this.listeners.push({splitEventName:a,opts:n,cb:o}),!0}unsubscribe(t){let e=t.split(".");return this.listeners=this.listeners.reduce((t,n)=>([...n.splitEventName].sort().toString()===e.sort().toString()?this.el.removeEventListener(n.splitEventName[0],n.cb):t.push(n),t),[]),!0}reset(){return this.listeners.forEach(t=>{this.el.removeEventListener(t.splitEventName[0],t.cb)}),this.listeners=[],!0}get el(){return this._el}set el(t){this._el=t}get listeners(){return this._listeners}set listeners(t){this._listeners=t}constructor(t=document){this._el=t,t.$emitter=this,this._listeners=[]}}class r{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(t){let n=i.toDashCase(this._pluginName),o=a.getDataAttribute(this.el,"data-".concat(n,"-config"),!1),r=a.getAttribute(this.el,"data-".concat(n,"-options"),!1),s=[this.constructor.options,this.options,t];o&&s.push(window.PluginConfigManager.get(this._pluginName,o));try{r&&s.push(JSON.parse(r))}catch(t){throw console.error(this.el),Error('The data attribute "data-'.concat(n,'-options" could not be parsed to json: ').concat(t.message))}return e().all(s.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(t){return t||(t=this.constructor.name),t}constructor(t,e={},n=!1){if(!a.isNode(t))throw Error("There is no valid element given.");this.el=t,this.$emitter=new o(this.el),this._pluginName=this._getPluginName(n),this.options=this._mergeOptions(e),this._initialized=!1,this._registerInstance(),this._init()}}class s{static iterate(t,e){if(t instanceof Map||Array.isArray(t))return t.forEach(e);if(t instanceof FormData){for(var n of t.entries())e(n[1],n[0]);return}if(t instanceof NodeList)return t.forEach(e);if(t instanceof HTMLCollection)return Array.from(t).forEach(e);if(t instanceof Object)return Object.keys(t).forEach(n=>{e(t[n],n)});throw Error("The element type ".concat(typeof t," is not iterable!"))}}let c="loader",l={BEFORE:"before",INNER:"inner"};class d{create(){if(!this.exists()){if(this.position===l.INNER){this.parent.innerHTML=d.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),d.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(c));s.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(c)).length>0}_getPosition(){return this.position===l.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(c,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return c}constructor(t,e=l.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}}let u="element-loader-backdrop";class h extends d{static create(t){t.classList.add("has-element-loader"),h.exists(t)||(h.appendLoader(t),setTimeout(()=>{let e=t.querySelector(".".concat(u));e&&e.classList.add("element-loader-backdrop-open")},1))}static remove(t){t.classList.remove("has-element-loader");let e=t.querySelector(".".concat(u));e&&e.remove()}static exists(t){return t.querySelectorAll(".".concat(u)).length>0}static getTemplate(){return'\n        <div class="'.concat(u,'">\n            <div class="loader" role="status">
1\n                <span class="').concat("visually-hidden",'">Loading...</span>\n            </div>\n        </div>\n        ')}static appendLoader(t){t.insertAdjacentHTML("beforeend",h.getTemplate())}}class p{get(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",i=this._createPreparedRequest("GET",t,n);return this._sendRequest(i,null,e)}post(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let a=this._createPreparedRequest("POST",t,i);return this._sendRequest(a,e,n)}delete(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let a=this._createPreparedRequest("DELETE",t,i);return this._sendRequest(a,e,n)}patch(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";i=this._getContentType(e,i);let a=this._createPreparedRequest("PATCH",t,i);return this._sendRequest(a,e,n)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(t){this._errorHandlingInternal=t}_registerOnLoaded(t,e){e&&(!0===this._errorHandlingInternal?(t.addEventListener("load",()=>{e(t.responseText,t)}),t.addEventListener("abort",()=>{console.warn("the request to ".concat(t.responseURL," was aborted"))}),t.addEventListener("error",()=>{console.warn("the request to ".concat(t.responseURL," failed with status ").concat(t.status))}),t.addEventListener("timeout",()=>{console.warn("the request to ".concat(t.responseURL," timed out"))})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,n){return this._registerOnLoaded(t,n),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,n){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),n&&this._request.setRequestHeader("Content-type",n),this._request}constructor(){this._request=null,this._errorHandlingInternal=!1}}class m extends r{init(){this._initializeAmazonScript(),this._initializeEventHandler()}getAmazonPayObject(){return window.amazon.Pay}setLoading(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.$emitter.publish("swagAmazonPay_setLoading",{loading:t});let e=document.getElementById(this.options.loadingElementId);this.el.hidden=!0,t?(e.hidden=!1,h.create(e)):(e.hidden=!0,h.remove(e))}displayError(){this.$emitter.publish("swagAmazonPay_displayError"),document.getElementById(this.options.errorElementId).hidden=!1,this.el.hidden=!0}onInsecureConnectionButtonInteraction(){document.querySelectorAll(".swag-amazon-pay-button-container").forEach(t=>{t.style.visibility="hidden"}),document.querySelectorAll(".swag-amazon-pay-button-error").forEach(t=>{t.classList.contains("connection-is-insecure")&&(t.hidden=!1)})}_initializeAmazonScript(){this.$emitter.publish("swagAmazonPay_beforeLoadAmazonPayScript"),window.amazonPayOnLoadCallbacks=window.amazonPayOnLoadCallbacks||[],window.amazonPayOnLoadCallbacks.push(this.renderButton.bind(this));let t="swag-amazon-pay-js-"+this.options.buttonConfig.merchantId;if(document.getElementById(t)){void 0!==window.amazon&&this.executeAmazonPayOnLoadCallbacks();return}this.scriptElement=document.createElement("script"),this.scriptElement.type="text/javascript",this.scriptElement.src=this.options.libraryUrl,this.scriptElement.id=t,this.scriptElement.addEventListener("load",this.executeAmazonPayOnLoadCallbacks.bind(this),!1),document.head.appendChild(this.scriptElement)}executeAmazonPayOnLoadCallbacks(){window.amazonPayOnLoadCallbacksExecuting&&setTimeout(this.executeAmazonPayOnLoadCallbacks,500),window.amazonPayOnLoadCallbacksExecuting=!0;try{window.amazonPayOnLoadCallbacks&&window.amazonPayOnLoadCallbacks.forEach((t,e)=>{t(),delete window.amazonPayOnLoadCallbacks[e]})}catch(t){console.error(t)}window.amazonPayOnLoadCallbacksExecuting=!1;let t="swag-amazon-pay-js-"+this.options.buttonConfig.merchantId,e=document.getElementById(t);e&&e.removeEventListener("load",this.executeAmazonPayOnLoadCallbacks),this.$emitter.publish("swagAmazonPay_amazonPayScriptLoaded")}_initializeEventHandler(){let t=this;document.querySelectorAll(".swag-amazon-pay-button-tooltip-overlay").forEach(e
1=>{e.classList.contains("connection-is-insecure")&&e.addEventListener("click",t.onInsecureConnectionButtonInteraction.bind(t))})}renderButton(){let t=this.getAmazonPayObject().renderButton("#".concat(this.el.id),this.options.buttonConfig);this._addAmazonPayButtonOnClickHandler(t),"product-box"===this.options.type&&this.addListingAddCartAction()}beforeInitCheckout(){return new Promise(t=>{t()})}initCheckout(t){this.$emitter.publish("swagAmazonPay_amazonPayCheckoutInitiated"),t.initCheckout({createCheckoutSessionConfig:this.options.createCheckoutSessionConfig})}_addAmazonPayButtonOnClickHandler(t){t.onClick(()=>(this.$emitter.publish("swagAmazonPay_amazonPayButtonClicked"),this.setLoading(),this.beforeInitCheckout().then(()=>{this.initCheckout(t),setTimeout(()=>{this.setLoading(!1)},3e3)})))}addListingAddCartAction(){this.$emitter.publish("swagAmazonPayButton_beforeListingAddProductToCart",{plugin:this});let t=this.el.closest("form");if(!t)return;let e=t.action,n=new FormData(t);this.beforeInitCheckout=()=>new Promise(t=>{new p().post(e,n,()=>{t(),this.$emitter.publish("swagAmazonPayButton_afterListingAddProductToCart",{plugin:this})})})}}m.options={libraryUrl:"https://static-eu.payments-amazon.com/checkout.js",amazonPayPluginVersion:"10.2.2",errorElementId:"swag-amazon-pay-button-error",loadingElementId:"swag-amazon-pay-loading-indicator",createCheckoutSessionConfig:{payloadJSON:"",signature:"",publicKeyId:""},type:"default",buttonConfig:{merchantId:"",sandbox:!1,ledgerCurrency:"",checkoutLanguage:"",productType:"",placement:"",buttonColor:"Gold"}};class g extends r{init(){this._initializeAmazonScript(),this._initializeEventHandler()}getAmazonPayObject(){return window.amazon.Pay}setLoading(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.$emitter.publish("swagAmazonPay_setLoading",{loading:t});let e=document.getElementById(this.options.loadingElementId);this.el.hidden=!0,t?(e.hidden=!1,h.create(e)):(e.hidden=!0,h.remove(e))}displayError(){this.$emitter.publish("swagAmazonPay_displayError"),document.getElementById(this.options.errorElementId).hidden=!1,this.el.hidden=!0}onInsecureConnectionButtonInteraction(){document.querySelectorAll(".swag-amazon-pay-button-container").forEach(t=>{t.style.visibility="hidden"}),document.querySelectorAll(".swag-amazon-pay-button-error").forEach(t=>{t.classList.contains("connection-is-insecure")&&(t.hidden=!1)})}_initializeAmazonScript(){this.$emitter.publish("swagAmazonPay_beforeLoadAmazonPayScript"),void 0!==this.scriptElement&&this._onLoadAmazonPayScript(),this.scriptElement=document.createElement("script"),this.scriptElement.type="text/javascript",this.scriptElement.src=this.options.libraryUrl,this.scriptElement.addEventListener("load",this._onLoadAmazonPayScript.bind(this),!1),document.head.appendChild(this.scriptElement)}_initializeEventHandler(){let t=this;document.querySelectorAll(".swag-amazon-pay-button-tooltip-overlay").forEach(e=>{e.classList.contains("connection-is-insecure")&&e.addEventListener("click",t.onInsecureConnectionButtonInteraction.bind(t))})}_onLoadAmazonPayScript(){this.getAmazonPayObject().renderButton("#".concat(this.el.id),this.options.buttonConfig),this.scriptElement.removeEventListener("load",this._onLoadAmazonPayScript),this.$emitter.publish("swagAmazonPay_amazonPayScriptLoaded")}}g.options={libraryUrl:"https://static-eu.payments-amazon.com/checkout.js",errorElementId:"swag-amazon-pay-button-error",loadingElementId:"swag-amazon-pay-loading-indicator",buttonConfig:{merchantId:"",sandbox:!1,ledgerCurrency:"",checkoutLanguage:"",productType:"",placement:"",signInConfig:{payloadJSON:"",signature:"",publicKeyId:""},buttonColor:"Gold"}};class y{static formToJson(t){let e=new FormData(t),n={};return e.forEach((t,e)=>{n[e]?(Array.isArray(n[e])||(n[e]=[n[e]]),n[e].push(t)):n[e]=t}),n}}class b extends r{init(){this.httpClient=new p,this.buttonPlugin=window.PluginManager.getPluginInstances("AmazonPayButton")[0],this.buttonPlugin.beforeInitCheckout=this._getAddProductPromise.bind(this)}_getAddProductPromise(){this.$emitter.publish("swagAmazonPayProductDetail_beforeAddProductToCart");let t=this._formatLineItems();return t._csrf_token=this.options.addLineItemToken,new Promise(e=>{this.httpClient.post(this.options.addLineItemUrl,JSON.stringify(t),()=>{e(),this.$emitter.publish("swagAmazonPayProductDetail_afterAddProductToCart")})})}_formatLineItems(){let t=y.formToJson(this.el.closest("form")),e={};return Object.keys(t).forEach(n=>{let i=n.match(/lineItems\[(.+)]\[(.+)]/);
1"redirectTo"!==n&&i&&3===i.length&&(e[i[1]]?e[i[1]][i[2]]=t[i[0]]:e[i[1]]={[i[2]]:t[i[0]]})}),{lineItems:e}}}b.options={addLineItemUrl:"",addLineItemToken:""};class f extends r{init(){this._initializeAmazonScript()}_initializeAmazonScript(){void 0!==this.scriptElement&&this._onLoadAmazonPayScript(),this.$emitter.publish("swagAmazonPay_beforeLoadAmazonPayScript"),this.scriptElement=document.createElement("script"),this.scriptElement.type="text/javascript",this.scriptElement.src=this.options.libraryUrl,this.scriptElement.addEventListener("load",this._onLoadAmazonPayScript.bind(this),!1),document.head.appendChild(this.scriptElement)}_onLoadAmazonPayScript(){window.amazon.Pay.bindChangeAction(this.options.changeShippingButtonSelector,{amazonCheckoutSessionId:this.options.checkoutSessionId,changeAction:"changeAddress"}),document.querySelector(this.options.changePaymentButtonSelector)&&window.amazon.Pay.bindChangeAction(this.options.changePaymentButtonSelector,{amazonCheckoutSessionId:this.options.checkoutSessionId,changeAction:"changePayment"})}}f.options={checkoutSessionId:"",libraryUrl:"https://static-eu.payments-amazon.com/checkout.js",changeShippingButtonSelector:"#swag-amazon-pay-change-shipping",changePaymentButtonSelector:"#swag-amazon-pay-change-amazon-payment"};class E extends r{init(){h.create(this.el),this._initializeAmazonScript()}_initializeAmazonScript(){this.$emitter.publish("swagAmazonPay_beforeLoadAmazonPayScript"),void 0!==this.scriptElement&&this._onLoadAmazonPayScript(),this.scriptElement=document.createElement("script"),this.scriptElement.type="text/javascript",this.scriptElement.src=this.options.libraryUrl,this.scriptElement.addEventListener("load",this._onLoadAmazonPayScript.bind(this),!1),document.head.appendChild(this.scriptElement)}_onLoadAmazonPayScript(){window.amazon.Pay.initCheckout({merchantId:this.options.merchantId,ledgerCurrency:this.options.ledgerCurrency,sandbox:!!this.options.sandbox,productType:this.options.productType,placement:"Other",createCheckoutSessionConfig:this.options.createCheckoutSessionConfig})}}E.options={libraryUrl:"https://static-eu.payments-amazon.com/checkout.js",merchantId:"",ledgerCurrency:"EUR",sandbox:!0,productType:"PayAndShip",createCheckoutSessionConfig:{payloadJSON:"",signature:"",publicKeyId:""}};let z=window.PluginManager;z.register("AmazonPayButton",m,"[data-amazon-pay-button]"),z.register("AmazonLoginButton",g,"[data-amazon-login-button]"),z.register("AmazonPayButtonProductDetail",b,"[data-amazon-pay-button-product-detail]"),z.register("AmazonPayConfirmPage",f,"[data-amazon-pay-confirm-page]"),z.register("AmazonLoginRegistrationPage",class extends r{init(){this._updateFormHandling(),this._setEmailReadOnly()}_updateFormHandling(){let t=this.el.dataset.amazonRegistrationUrl;this.el.querySelector("form").action=t}_setEmailReadOnly(){this.el.querySelector('input[name="email"]').readOnly=!0}},"[data-amazon-registration-url]"),z.register("AmazonPayPurePaymentMethodPlugin",E,'[data-amazon-pay-pure-payment-method="true"]')})()})();

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.