PageSourceSearch

https://www.moebel-rieger.de/theme/05552ce87d2d91d594de3c238262886…ia-listing-quickbuy-button.plugin.271efc.js

js moebel-rieger.de collected 2026-10-06 00:24:35 UTC 18,430 bytes, 9 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[51286],{59(t,e,i){i.d(e,{A:()=>s});class s{static debounce(t,e){let i,s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(){for(var o=arguments.length,n=Array(o),r=0;r<o;r++)n[r]=arguments[r];s&&!i&&setTimeout(t.bind(t,...n),0),clearTimeout(i),i=setTimeout(t.bind(t,...n),e)}}}},68(t,e,i){i.d(e,{A:()=>s});class s{constructor(){this._request=null,this._errorHandlingInternal=!1}get(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",t,i);return this._sendRequest(s,null,e)}post(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("POST",t,s);return this._sendRequest(o,e,i)}delete(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(o,e,i)}patch(t,e,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(e,s);let o=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(o,e,i)}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 ${t.responseURL} was aborted`)}),t.addEventListener("error",()=>{console.warn(`the request to ${t.responseURL} failed with status ${t.status}`)}),t.addEventListener("timeout",()=>{console.warn(`the request to ${t.responseURL} timed out`)})):t.addEventListener("loadend",()=>{e(t.responseText,t)}))}_sendRequest(t,e,i){return this._registerOnLoaded(t,i),t.send(e),t}_getContentType(t,e){return t instanceof FormData&&(e=!1),e}_createPreparedRequest(t,e,i){return this._request=new XMLHttpRequest,this._request.open(t,e),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}},156(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!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(t,e){return!1!==e.clone&&e.isMergeableObject(t)?a(Array.isArray(t)?[]:{},t,e):t}function o(t,e,i){return t.concat(e).map(function(t){return s(t,i)})}function n(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 a(t,i,c){(c=c||{}).arrayMerge=c.arrayMerge||o,c.isMergeableObject=c.isMergeableObject||e,c.cloneUnlessOtherwiseSpecified=s;var l,u,p=Array.isArray(i);return p!==Array.isArray(t)?s(i,c):p?c.arrayMerge(t,i,c):(u={},(l=c).isMergeableObject(t)&&n(t).forEach(function(e){u[e]=s(t[e],l)}),n(i).forEach(function(e){(!r(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(r(t,e)&&l.isMergeableObject(i[e])?u[e]=(function(t,e){if(!e.customMerge)return a;var i=e.customMerge(t);return"function"==typeof i?i:a})(e,l)(t[e],i[e],l):u[e]=s(i[e],l))}),u)}a.all=function(t,e){if(!Array.isArray(t))throw Error("first argument should be an array");return t.reduce(function(t,i){return a(t,i,e)},{})},t.exports=a},286(t,e,i){i.r(e),i.d(e,{default:()=>f});var s=i(390),o=i(581),n=i(632);let r="modal-backdrop",a="modal-backdrop-open",c="no-scroll",l={ON_CLICK:"backdrop/onclick"};class u{constructor(){return u.instance||(u.instance=this),u.instance}create(t){this._removeExistingBackdrops(),document.body.insertAdjacentHTML("beforeend",this._getTemplate());let e=document.body.lastChild;document.documentElement.classList.add(c),setTimeout(function(){e.classList.add(a),"function"==typeof t&&t()},75),this._dispatchEvents()}remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;
1this._getBackdrops().forEach(t=>t.classList.remove(a)),setTimeout(this._removeExistingBackdrops.bind(this),t),document.documentElement.classList.remove(c)}_dispatchEvents(){let t=n.A.isTouchDevice()?"touchstart":"click";document.addEventListener(t,function(t){t.target.classList.contains(r)&&document.dispatchEvent(new CustomEvent(l.ON_CLICK))})}_getBackdrops(){return document.querySelectorAll(`.${r}`)}_removeExistingBackdrops(){!1!==this._exists()&&this._getBackdrops().forEach(t=>t.remove())}_exists(){return document.querySelectorAll(`.${r}`).length>0}_getTemplate(){return`<div class="${r}"></div>`}}let p=Object.freeze(new u);class d{static create(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;p.create(t)}static remove(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;p.remove(t)}static SELECTOR_CLASS(){return r}}var h=i(59);class m{constructor(){this.previousViewport=null,this.currentViewport=m.getCurrentViewport(),this._registerEvents()}_registerEvents(){window.addEventListener("DOMContentLoaded",this._onDOMContentLoaded.bind(this)),window.addEventListener("resize",h.A.debounce(this._onResize.bind(this),200),{capture:!0,passive:!0})}_onDOMContentLoaded(){this._dispatchEvents()}_onResize(){this._viewportHasChanged(m.getCurrentViewport())&&(this._dispatchEvents(),this._dispatchViewportEvent("Viewport/hasChanged"))}_dispatchEvents(){m.isXS()?this._dispatchViewportEvent("Viewport/isXS"):m.isSM()?this._dispatchViewportEvent("Viewport/isSM"):m.isMD()?this._dispatchViewportEvent("Viewport/isMD"):m.isLG()?this._dispatchViewportEvent("Viewport/isLG"):m.isXL()?this._dispatchViewportEvent("Viewport/isXL"):m.isXXL()&&this._dispatchViewportEvent("Viewport/isXXL")}_viewportHasChanged(t){let e=t!==this.currentViewport;return e&&(this.previousViewport=this.currentViewport,this.currentViewport=t),e}_dispatchViewportEvent(t){document.$emitter.publish(t,{previousViewport:this.previousViewport})}static isXS(){return"XS"===m.getCurrentViewport()}static isSM(){return"SM"===m.getCurrentViewport()}static isMD(){return"MD"===m.getCurrentViewport()}static isLG(){return"LG"===m.getCurrentViewport()}static isXL(){return"XL"===m.getCurrentViewport()}static isXXL(){return"XXL"===m.getCurrentViewport()}static getCurrentViewport(){return window.getComputedStyle(document.documentElement).getPropertyValue("--sw-current-breakpoint").replace(/['"]+/g,"").toUpperCase()}}var g=i(475);let v=window.PluginBaseClass;class f extends v{static #t=this.options={productId:null,productBoxSelector:".product-box",productImageSelector:".product-image-wrapper",cartBtnSelector:".product-action .btn-buy",quantitySelector:".quantity-selector-group-input, .listing-quantity-select",anchorSelector:".card-body",activeClass:"maxia-quickbuy-active",minWidth:280,centerOnMobile:!1,minWidthPercentMobile:90,popupClasses:"",scrollToPopup:!0,overlay:!0,selection:{},activateOnEvent:"click",popupHideDelay:150};init(){if(this.productBox=this.el.closest(this.options.productBoxSelector),null===this.productBox){console.warn("product box not found");return}this.options=g.A.getProductConfig(this.productBox,this.options),this.options.productParentId&&(this.options.productId=this.options.productParentId);let t=g.A.getGlobalConfig();void 0!==t.scrollToPopup&&(this.options.scrollToPopup=t.scrollToPopup),this.image=this.el.querySelector(this.options.productImageSelector),this.anchorElement=this._getAnchorElement(),this.popupActive=!1,this._registerEvents()}setSelection(t){this.options.selection=t}_registerEvents(){if(this.el.addEventListener(this.options.activateOnEvent,this._onBuyButtonClick.bind(this)),"label"===this.el.tagName.toLowerCase()&&this.el.hasAttribute("for")){let t=document.getElementById(this.el.getAttribute("for"));t&&t.addEventListener("keypress",this._openOnKeyDown.bind(this))}}_openOnKeyDown(t){"Enter"!==t.key||this.popupActive||document.body.classList.contains(this.options.activeClass)||this.show()}_getAnchorElement(){return this.productBox}_onBuyButtonClick(t){return t.preventDefault(),this.popupActive||document.body.classList.contains(this.options.activeClass)||this.show(),!1}show(){this.$emitter.publish("onShow",{productBox:this.productBox}),document.body.classList.add(this.options.activeClass),o.A.create(this.productBox);let t=this.options.productId?this.options.productId:this.options.parentProductId;s.A.loadProductBox(t,this._getParams(),t=>{if(this.$emitter.publish("onProductBoxLoaded",{productBox:this.productBox}),200!==t.status||!t.responseText){console.warn("product box reload failed",t),o.A.remove(this.productBox);return}this.options.overlay&&(d.create(),document.documentElement.classList.remove("no-scroll")),this._createPopup(t.responseText),this.popupActive=!0,this._cartBtnMouseDown=!1,"function"==typeof callback&&callback(),window.focusHandler.saveFocusState("maxia-listing-variants"),this._handleFocusAfterOpen(),o.A.remove(this.productBox)})}_handleFocusAfterOpen(){if(null!==this.productBox.querySelector(":focus-visible")){let t=this.popup.querySelector(".maxia-listing-variants input:checked, .maxia-listing-variants select");t&&setTimeout(()=>{window.focusHandler.setFocus(t)},100)}}_getParams(){let t={expandOptions:!0};return this.options.layout&&(t.layout=this.options.layout),this.options.displayMode&&(t.displayMode=this.options.displayMode),this.options.slotId&&(t.slotId=this.options.slotId),this.options.selection&&(t.options=JSON.stringify(this.options.selection)),t}hide(){this.$emitter.publish("onHide",{productBox:this.productBox}),this._unregisterPopupEvents(),this.productBox.classList.remove(this.options.activeClass),void 0!==this.container&&(this.container.remove(),this.container=void 0),d.remove(),document.body.classList.remove(this.options.activeClass),setTimeout(()=>{window.focusHandler.resumeFocusState("maxia-listing-variants")},100),this.popupActive=!1,this._cartBtnMouseDown=!1}reposition(){let t=this.anchorElement.getBoundingClientRect(),e={left:t.left,top:t.top,width:t.width},i=this.anchorElement.offsetWidth,s=this.anchorElement.offsetHeight,o=i,n=window.innerWidth,r=this.options.minWidth;
1if(!e.width||!this._isVisible(this.anchorElement)){this.hide();return}if(r>n-20&&(r=n-20),this._isMobile()&&this.options.centerOnMobile)o=(n-20)/100*this.options.minWidthPercentMobile,e.left=n/2-o/2;else if(o<r){o=r;let t=e.left+i/2-o/2;t>=0&&t+o<=n?e.left=t:e.left=n/2-o/2}Object.assign(this.popup.style,{width:o.toString()+"px",top:(e.top+document.documentElement.scrollTop).toString()+"px",left:e.left+"px",minHeight:s+"px"}),this.$emitter.publish("onReposition",{productBox:this.productBox,popup:this.popup,productId:this.options.productId})}_isMobile(){return m.isXS()}_createPopup(t){let e=Object.assign(document.createElement("div"),{innerHTML:t}).querySelector(".product-box");if(e)this.popup=e;else{console.warn("Product box not found in html response");return}this.popupId=Math.random().toString(36).substr(2,9),this.popup.classList.add("id-"+this.popupId),this.popup.classList.add("is-popup"),this.closeButton=this._createCloseButton(),this.popup.insertAdjacentElement("afterbegin",this.closeButton),this.container=document.querySelector(".maxia-quickbuy-container"),this.container||(this.container=document.createElement("div"),this.container.classList.add("maxia-quickbuy-container"),document.body.appendChild(this.container));let i=this.anchorElement.querySelector(this.options.quantitySelector),o=this.popup.querySelector(this.options.quantitySelector);null!==i&&null!==o&&(o.value=i.value),this.container.insertAdjacentElement("beforeend",this.popup),s.A.initProductBox(this.popup).then(()=>{this.reposition(),this.options.scrollToPopup&&this._scrollToElement(this.popup,50,300),this._registerPopupEvents()})}_registerPopupEvents(){this.closeButton.addEventListener("click",()=>{this.hide()}),this.popupEventHandlers={resize:this._repositionOnResize.bind(this),click:this._closeOnBodyClick.bind(this),keyup:this._closeOnKeyUp.bind(this)},window.addEventListener("resize",this.popupEventHandlers.resize,{passive:!0}),this.options.overlay&&document.body.addEventListener("click",this.popupEventHandlers.click),document.addEventListener("keyup",this.popupEventHandlers.keyup),PluginManager.getPluginInstanceFromElement(this.popup,"MaxiaListingConfigurator").$emitter.subscribe("onProductBoxLoaded",this._registerProductBoxEvents.bind(this)),this._registerProductBoxEvents()}_registerProductBoxEvents(){let t=this.popup.querySelector(this.options.cartBtnSelector);t&&(t.addEventListener("click",()=>{setTimeout(()=>{this.hide()},this.options.popupHideDelay)}),t.addEventListener("mousedown",()=>{this._cartBtnMouseDown=!0}))}_unregisterPopupEvents(){void 0!==this.popupEventHandlers&&(window.removeEventListener("resize",this.popupEventHandlers.resize),document.body.removeEventListener("click",this.popupEventHandlers.click),document.removeEventListener("keyup",this.popupEventHandlers.keyup),this.popupEventHandlers=[])}_repositionOnResize(t){var e,i;(e=()=>{this.popupActive&&(this.reposition(),setTimeout(()=>this.reposition(),150))},i=null,function(){null==i&&(i=setTimeout(function(){e(),clearInterval(i),i=null},60))})()}_closeOnBodyClick(t){null===t.target.closest(".is-popup")&&(this._cartBtnMouseDown?setTimeout(()=>{this.hide()},this.options.popupHideDelay):this.hide())}_closeOnKeyUp(t){27===t.keyCode&&this.hide()}_createCloseButton(){let t=document.createElement("button");return t.classList.add("maxia-popup-close-btn"),t.setAttribute("aria-label",g.A.getGlobalConfig().popupCloseButtonLabel),t.innerHTML=g.A.getGlobalConfig().popupCloseIcon,t}_scrollToElement(t,e){let i=this._getCumulativeOffset(t).top;void 0===e&&(e=0),window.scrollTo({top:i-e,behavior:"smooth"})}_isVisible(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}_getCumulativeOffset(t){var e=0,i=0;do e+=t.offsetTop||0,i+=t.offsetLeft||0,t=t.offsetParent;while(t)return{top:e,left:i}}}},390(t,e,i){i.d(e,{A:()=>c});var s=i(68),o=i(156),n=i.n(o);let r=window.maxiaListingVariants,a=window.PluginManager;class c{static #t=this.httpClient=new s.A;static #e=this.allowedQueryParams=["properties","productManufacturerId"];static loadProductBox(t,e,i){e=n()({productId:t},e),r.cmsPageId&&(e.pageId=r.cmsPageId),void 0!==window.activeNavigationId&&(e.navigationId=window.activeNavigationId);let s=Object.fromEntries(new URLSearchParams(window.location.search).entries());for(let t in s)(t.includes("min-")||t.includes("max-")||-1!==this.allowedQueryParams.indexOf(t))&&(e[t]=s[t]);document.$emitter.publish("MaxiaVariantsBeforeLoadProductBox",{productId:t,params:e});let o=r.ajaxUrl+"?"+new URLSearchParams(e).toString(),a=this.httpClient.get(o,()=>{i(a)},"text/html")}static initProductBox(t){void 0!==t._maxiaConfiguratorConfig&&(t._maxiaConfiguratorConfig=void 0);let e=a.getPluginInstanceFromElement(t,"MaxiaListingConfigurator");
1return e&&e.init(),new Promise(i=>{try{a.initializePlugins().then(()=>{if(document.body.classList.contains("maxia-lazy")){let e=t.querySelector(".product-image-wrapper");if(void 0!==e){let i=t.querySelector(".product-image-wrapper img");null!==i&&(i.style.opacity="1",i.style.transition="none"),e.classList.add("maxia-lazy-loaded")}}document.$emitter.publish("MaxiaVariantsInitProductBox",{productBoxElement:t,configuratorPlugin:e}),i()})}catch(t){console.error(t),i()}})}}},475(t,e,i){i.d(e,{A:()=>n});var s=i(156),o=i.n(s);class n{static getProductConfig(t,e){if(void 0===t._maxiaConfiguratorConfig){let e=t.querySelector('input[name="maxia-configurator-config"]');if(null!==e)try{t._maxiaConfiguratorConfig=JSON.parse(e.getAttribute("value"))}catch(t){console.warn("Listing variants config could not be parsed to json",e),console.warn(t)}}if(void 0!==e){let i=[e,t._maxiaConfiguratorConfig];return o().all(i.filter(t=>t instanceof Object&&!(t instanceof Array)).map(t=>t||{}))}return t._maxiaConfiguratorConfig}static getGlobalConfig(){return window.maxiaListingVariants}}},581(t,e,i){i.d(e,{A:()=>a});let s="loader",o={BEFORE:"before",INNER:"inner"};class n{constructor(t,e=o.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}create(){if(!this.exists()){if(this.position===o.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=n.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),n.getTemplate())}}remove(){if(this.position===o.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${s}`).forEach(t=>t.remove())}exists(){return this.parent.querySelectorAll(`.${s}`).length>0}_getPosition(){return this.position===o.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${s}" role="status">
2                    <span class="visually-hidden">Loading...</span>
3                </div>`}static SELECTOR_CLASS(){return s}}let r="element-loader-backdrop";class a extends n{static create(t){t.classList.add("has-element-loader"),a.exists(t)||(a.appendLoader(t),setTimeout(()=>{let e=t.querySelector(`.${r}`);e&&e.classList.add("element-loader-backdrop-open")},1))}static remove(t){t.classList.remove("has-element-loader");let e=t.querySelector(`.${r}`);e&&e.remove()}static exists(t){return t.querySelectorAll(`.${r}`).length>0}static getTemplate(){return`
4        <div class="${r}">
5            <div class="loader" role="status">
6                <span class="visually-hidden">Loading...</span>
7            </div>
8        </div>
9        `}static appendLoader(t){t.insertAdjacentHTML("beforeend",a.getTemplate())}}},632(t,e,i){i.d(e,{A:()=>s});class s{static isTouchDevice(){return"ontouchstart"in document.documentElement}static isIOSDevice(){return s.isIPhoneDevice()||s.isIPadDevice()}static isNativeWindowsBrowser(){return s.isIEBrowser()||s.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":s.isTouchDevice(),"is-ios":s.isIOSDevice(),"is-native-windows":s.isNativeWindowsBrowser(),"is-iphone":s.isIPhoneDevice(),"is-ipad":s.isIPadDevice(),"is-ie":s.isIEBrowser(),"is-edge":s.isEdgeBrowser()}}}}}]);

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.