PageSourceSearch

https://www.keimling.de/theme/02e834c35d91c460f6f6cac81da5d15d/js/….shopping-list-add-to-cart.plugin.62efc8.js

js keimling.de collected 2026-09-26 00:30:56 UTC 14,266 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[7129],{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 s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?a(Array.isArray(e)?[]:{},e,t):e}function i(e,t,r){return e.concat(t).map(function(e){return s(e,r)})}function n(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,c){(c=c||{}).arrayMerge=c.arrayMerge||i,c.isMergeableObject=c.isMergeableObject||t,c.cloneUnlessOtherwiseSpecified=s;var l,d,u=Array.isArray(r);return u!==Array.isArray(e)?s(r,c):u?c.arrayMerge(e,r,c):(d={},(l=c).isMergeableObject(e)&&n(e).forEach(function(t){d[t]=s(e[t],l)}),n(r).forEach(function(t){(!o(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(o(e,t)&&l.isMergeableObject(r[t])?d[t]=(function(e,t){if(!t.customMerge)return a;var r=t.customMerge(e);return"function"==typeof r?r:a})(t,l)(e[t],r[t],l):d[t]=s(r[t],l))}),d)}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},49:(e,t,r)=>{r.d(t,{Z:()=>i});var s=r(140);class i{static isNode(e){return"object"==typeof e&&null!==e&&(e===document||e===window||e instanceof Node)}static hasAttribute(e,t){if(!i.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===i.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],n=t.replace(/^data(|-)/,""),o=s.Z.toLowerCamelCase(n,"-");if(!i.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 s.Z.parsePrimitive(a)}static querySelector(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelector(t)||!1;if(r&&!1===s)throw Error('The required element "'.concat(t,'" does not exist in parent node!'));return s}static querySelectorAll(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(r&&!i.isNode(e))throw Error("The parent node is not a valid HTML Node!");let s=e.querySelectorAll(t);if(0===s.length&&(s=!1),r&&!1===s)throw Error('At least one item of "'.concat(t,'" must exist in parent node!'));return s}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]}}},266:(e,t,r)=>{r.d(t,{Z:()=>s});class s{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!"))}}},140:(e,t,r)=>{r.d(t,{Z:()=>s});class s{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=s.toUpperCamelCase(e,t);return s.lcFirst(r)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>s.ucFirst(e.toLowerCase())).join(""):s.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}},293:(e,t,r)=>{r.d(t,{Z:()=>c});var s=r(857),i=r.n(s),n=r(49),o=r(140);class a{publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:r});return this.el.dispatchEvent(s),s}subscribe(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,i=e.split("."),n=r.scope?t.bind(r.scope):t;if(r.once&&!0===r.once){let t=n;n=function(r){s.unsubscribe(e),t(r)}}return this.el.addEventListener(i[0],n),this.listeners.push({splitEventName:i,opts:r,cb:n}),!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}
1reset(){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 c{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 t=o.Z.toDashCase(this._pluginName),r=n.Z.getDataAttribute(this.el,"data-".concat(t,"-config"),!1),s=n.Z.getAttribute(this.el,"data-".concat(t,"-options"),!1),a=[this.constructor.options,this.options,e];r&&a.push(window.PluginConfigManager.get(this._pluginName,r));try{s&&a.push(JSON.parse(s))}catch(e){throw console.error(this.el),Error('The data attribute "data-'.concat(t,'-options" could not be parsed to json: ').concat(e.message))}return i().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.Z.isNode(e))throw Error("There is no valid element given.");this.el=e,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(r),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}}},107:(e,t,r)=>{r.d(t,{Z:()=>s});class s{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 i=this._createPreparedRequest("POST",e,s);return this._sendRequest(i,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 i=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(i,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 i=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(i,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}}},363:(e,t,r)=>{r.d(t,{Z:()=>o});var s=r(266);let i="loader",n={BEFORE:"before",INNER:"inner"};class o{create(){if(!this.exists()){if(this.position===n.INNER){this.parent.innerHTML=o.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),o.getTemplate())}}remove(){let e=this.parent.querySelectorAll(".".concat(i));s.Z.iterate(e,e=>e.remove())}exists(){return this.parent.querySelectorAll(".".concat(i)).length>0}_getPosition(){return this.position===n.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(i,'" role="status">\n                    <span class="').concat("visually-hidden",'">Loading...</span>\n                </div>')}static SELECTOR_CLASS(){return i}constructor(e,t=n.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}}},551:(e,t,r)=>{r.d(t,{Z:()=>f});var s=r(363);class i{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return i.isIPhoneDevice()||i.isIPadDevice()}static isNativeWindowsBrowser(){return i.isIEBrowser()||i.isEdgeBrowser()}static isIPhoneDevice(){return!!navigator.userAgent.match(/iPhone/i)}static isIPadDevice(){return!!navigator.userAgent.match(/iPad/i)}static isIEBrowser(){return -1!==navigator.userAgent.toLowerCase().indexOf("msie")||!!navigator.userAgent.match(/Trident.*rv:\d+\./)}static isEdgeBrowser(){return!!navigator.userAgent.match(/Edge\/\d+/i)}static getList(){return{"is-touch":i.isTouchDevice(),"is-ios":i.isIOSDevice(),"is-native-windows":i.isNativeWindowsBrowser(),"is-iphone":i.isIPhoneDevice(),"is-ipad":i.isIPadDevice(),"is-ie":i.isIEBrowser(),"is-edge":i.isEdgeBrowser()}}}var n=r(266);let o="modal-backdrop",a="modal-backdrop-open",c="no-scroll",l={ON_CLICK:"backdrop/onclick"};class d{create(e){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let t=document.body.lastChild;document.documentElement.classList.add(c),setTimeout(function(){t.classList.add(a),"function"==typeof e&&e()},75),this._dispatchEvents()}remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350,t=this._getBackdrops();n.Z.iterate(t,e=>e.classList.remove(a)),setTimeout(this._removeExistingBackdrops.bind(this),e),document.documentElement.classList.remove(c)}_dispatchEvents(){let e=i.isTouchDevice()?"touchstart":"click";document.addEventListener(e,function(e){e.target.classList.contains(o)&&document.dispatchEvent(new CustomEvent(l.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(".".concat(o))}_removeExistingBackdrops(){if(!1===this._exists())return;let e=this._getBackdrops();n.Z.iterate(e,e=>e.remove())}_exists(){return document.querySelectorAll(".".concat(o)).length>0}_getTemplate(){return'<div class="'.concat(o,'"></div>')}constructor(){return d.instance||(d.instance=this),d.instance}}let u=Object.freeze(new d);class h{static create(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;u.create(e)}static remove(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;u.remove(e)}static SELECTOR_CLASS(){return o}}class p extends s.Z{create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];!this.exists()&&e&&(h.create(),document.querySelector(".".concat(h.SELECTOR_CLASS())).insertAdjacentHTML("beforeend",s.Z.getTemplate()))}remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];super.remove(),e&&h.remove()}constructor(){super(document.body)}}let g=Object.freeze(new p);class f{static create(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];g.create(e)}static remove(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];g.remove(e)}}},129:(e,t,r)=>{r.r(t),r.d(t,{default:()=>a});var s=r(293),i=r(551),n=r(107),o=r(266);class a extends s.Z{init(){this._client=new n.Z,this._registerEvents()}_registerEvents(){this.el.addEventListener("click",this._onAddToCartButtonClick.bind(this))}_openOffCanvasCarts(){let e=window.PluginManager.getPluginInstances("OffCanvasCart");o.Z.iterate(e,e=>this._openOffCanvasCart(e))}_openOffCanvasCart(e){e.openOffCanvas(window.router["frontend.cart.offcanvas"],!1,()=>{this.$emitter.publish("openOffCanvasCart")})}_formatDataIds(e){let t=new Map(JSON.parse(e));if(this.options.isAddMultipleProductsToCart){let e={};
1return Array.from(t.keys()).forEach(r=>{let{quantity:s,productId:i}=t.get(r);e[r]={id:i,quantity:parseInt(s),referencedId:i,stackable:!0,removable:!0,type:"product"}}),{lineItems:e}}return{ids:[...t.keys()]}}_onAddToCartButtonClick(){bootstrap.Modal.getInstance(this.el)&&bootstrap.Modal.getInstance(this.el).hide(),i.Z.create();let e={};this.options.lineItems&&(e={lineItems:this.options.productItems}),this.el.dataset.ids&&(e=this._formatDataIds(this.el.dataset.ids)),this.options.shoppingListId&&(e={ids:[this.options.shoppingListId]}),this._client.post(this.options.addToCartUrl,JSON.stringify(e),this._onAfterAjaxSubmit.bind(this))}_onAfterAjaxSubmit(){i.Z.remove(),this._openOffCanvasCarts()}}}}]);

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.