1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[82818],{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 r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];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 r=this._createPreparedRequest("POST",t,s);return this._sendRequest(r,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 r=this._createPreparedRequest("DELETE",t,s);return this._sendRequest(r,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 r=this._createPreparedRequest("PATCH",t,s);return this._sendRequest(r,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}}},94(t,e,i){i.d(e,{A:()=>l});var s=i(68),r=i(156),n=i.n(r);let o=window.maxiaListingVariants,a=window.PluginManager;class l{static #t=this.httpClient=new s.A;static #e=this.allowedQueryParams=["properties","productManufacturerId"];static loadProductBox(t,e,i){e=n()({productId:t},e),o.cmsPageId&&(e.pageId=o.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 r=o.ajaxUrl+"?"+new URLSearchParams(e).toString(),a=this.httpClient.get(r,()=>{i(a)},"text/html")}static initProductBox(t){void 0!==t._maxiaConfiguratorConfig&&(t._maxiaConfiguratorConfig=void 0);let e=a.getPluginInstanceFromElement(t,"MaxiaListingConfigurator");return 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()}})}}},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 r(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 o(t,e){try{return e in t}catch(t){return!1}}function a(t,i,l){(l=l||{}).arrayMerge=l.arrayMerge||r,l.isMergeableObject=l.isMergeableObject||e,l.cloneUnlessOtherwiseSpecified=s;var c,u,d=Array.isArray(i);return d!==Array.isArray(t)?s(i,l):d?l.arrayMerge(t,i,l):(u={},(c=l).isMergeableObject(t)&&n(t).forEach(function(e){u[e]=s(t[e],c)}
1),n(i).forEach(function(e){(!o(t,e)||Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))&&(o(t,e)&&c.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,c)(t[e],i[e],c):u[e]=s(i[e],c))}),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},579(t,e,i){i.d(e,{A:()=>n});var s=i(156),r=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 r().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",r={BEFORE:"before",INNER:"inner"};class n{constructor(t,e=r.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=e}create(){if(!this.exists()){if(this.position===r.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=n.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),n.getTemplate())}}remove(){if(this.position===r.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===r.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 o="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(`.${o}`);e&&e.classList.add("element-loader-backdrop-open")},1))}static remove(t){t.classList.remove("has-element-loader");let e=t.querySelector(`.${o}`);e&&e.remove()}static exists(t){return t.querySelectorAll(`.${o}`).length>0}static getTemplate(){return` 4 <div class="${o}"> 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()}}}},818(t,e,i){i.r(e),i.d(e,{default:()=>p});var s=i(59);class r{static serialize(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if("FORM"!==t.nodeName){if(e)throw Error("The passed element is not a form!");return{}}return new FormData(t)}static serializeJson(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=r.serialize(t,e);if(!(i instanceof FormData)&&0===Object.keys(i).length||i instanceof FormData&&0===Array.from(i.entries()).length)return{};let s={};for(let[t,e]of i.entries())s[t]=e;return s}}var n=i(581),o=i(94),a=i(579),l=i(156),c=i.n(l),u=i(632),d=i(68);let h=window.PluginBaseClass;class p extends h{static #t=this.options={formSelector:"form.maxia-listing-variants",formInputSelector:"input, select",labelSelector:"label",productImageSelector:".product-image-wrapper",buyButtonSelector:"[data-add-to-cart] .btn-buy",quantitySelector:'.quantity-selector-group-input, .product-action input[type="number"]',isExpanded:!0,productId:null,parentProductId:null,prepe
9ndedOptions:[],isQuickBuy:!1,selection:{}};init(){this.form=this.el.querySelector(this.options.formSelector),null!==this.form&&(this._httpClient=new d.A,this.isLoading=!1,this.options=a.A.getProductConfig(this.el,this.options),this._lastFocused=null,this.selection=this.options.selection,this.image=this.el.querySelector(this.options.productImageSelector),this.options.isQuickBuy&&(this.quantitySelect=this.el.querySelector(this.options.quantitySelector)),this._initForm(),this.$emitter.publish("onInit",{options:this.options,plugin:this}))}_initForm(){this.inputs=this.form.querySelectorAll(this.options.formInputSelector),this.labels=this.form.querySelectorAll(this.options.labelSelector),this._setUniqueInputIds(),this.inputs.forEach(t=>{this._initInput(t)}),this.options.isQuickBuy||(this.expandButtons=this.form.querySelectorAll("[data-product-id] .is-expand-button"),this.expandButtons.forEach(t=>{t.addEventListener("click",()=>{let e=t.closest("[data-product-id]");this._redirectViaForm(e.getAttribute("data-product-id"))})}))}_setUniqueInputIds(){let t=Math.random().toString(36).substr(2,9);this.inputs.forEach(e=>{let i=t.toString()+"-"+e.getAttribute("id");e.setAttribute("id",i);let s=null;if(null!==(s=e.nextElementSibling&&"label"===e.nextElementSibling.tagName.toLowerCase()?e.nextElementSibling:e.closest("label"))&&(s.setAttribute("for",i),s.hasAttribute("id"))){let i=s.getAttribute("id"),r=t.toString()+"-"+i;s.setAttribute("id",r),e.hasAttribute("aria-labelledby")&&e.getAttribute("aria-labelledby")===i&&e.setAttribute("aria-labelledby",r)}})}_initInput(t){this.options.isQuickBuy&&t.addEventListener("change",this._setSelectionOnChange.bind(this)),"radio"===t.type&&t.labels.length?(t.labels[0].addEventListener("mouseup",e=>{if(0===e.button)return this._navigateOnClick(e,t)}),this.options.isQuickBuy||t.addEventListener("click",t=>(t.preventDefault(),!1))):"SELECT"!==t.tagName||(t.addEventListener("focus",e=>{t.previousValue=t.value}),this.options.isQuickBuy||t.addEventListener("change",e=>this._navigateOnChange(e,t)));let e=null!==t.closest("a");e||"radio"!==t.type||t.addEventListener("focus",function(e){e.target.matches(":focus-visible")&&!t.checked&&(t.checked=!0,t.dispatchEvent(new Event("change")))}),e&&!this.options.isQuickBuy?(t.setAttribute("tabindex","-1"),t.labels.length&&t.labels[0].setAttribute("tabindex","-1")):e||"SELECT"===t.tagName||t.addEventListener("keypress",e=>{"Enter"===e.key&&this._navigateOnClick(e,t)})}_setSelectionOnChange(t){let e=t.target,i=e.getAttribute("name");if("SELECT"===e.tagName?this._restoreFocusSelector='select[name="'+i+'"]':this._restoreFocusSelector='input[name="'+i+'"][value="'+e.value+'"]',"SELECT"===e.tagName){if("0"===e.selectedOptions[0].value){e.value=e.previousValue;let t=new Event("openQuickbuy");e.dispatchEvent(t);return}}else if("radio"===e.type&&"0"===e.value)return;let s=r.serialize(this.form),n={};for(var[o,a]of s.entries())n[o]=a;this.setSelection(i,n)}_navigateOnClick(t,e){let i=null,s=null,r=e.closest("[data-product-id]");if(r?i=r.getAttribute("data-product-id"):(r=e.closest("[data-url]"))&&(s=r.getAttribute("data-url")),this.options.isQuickBuy){if(e.checked&&!this.isLoading&&"0"!==e.value){let t=a.A.getGlobalConfig();t&&t.quickBuyDetailLink&&(i?this._redirectViaForm(e.closest("[data-product-id]").getAttribute("data-product-id")):window.location=s)}}else{let r=e.closest("a");return null!==r?u.A.isTouchDevice()?null!==this._lastFocused&&r.isSameNode(this._lastFocused)?r.click():(r.focus(),this._lastFocused=r,r.addEventListener("blur",()=>{t.relatedTarget&&t.relatedTarget.isSameNode(this._lastFocused)&&(this._lastFocused=null)},{once:!0,passive:!0})):r.click():i?this._redirectViaForm(e.closest("[data-product-id]").getAttribute("data-product-id")):s&&(window.location=s),t.preventDefault(),!1}}_navigateOnChange(t,e){if(!e.selectedOptions.length)return;let i=e.selectedOptions[0];i.hasAttribute("data-url")?window.location=i.getAttribute("data-url"):i.hasAttribute("data-product-id")&&this._redirectViaForm(i.getAttribute("data-product-id"))}
9_redirectViaForm(t){this._httpClient.post(window.maxiaListingVariants.detailRedirectUrl,JSON.stringify({productId:t}),t=>{let e=JSON.parse(t);window.location=e.url})}getSelection(){return void 0!==this.selection?this.selection:{}}setSelection(t,e,i){this._addLoadingIndicator(),void 0===this.preselection&&(this.preselection=this.options.selection);let r=new Date().valueOf();this._latestRequestTimestamp=r,s.A.debounce(()=>{this.isLoading=!0,this.selection=c()(this.selection,e);let s=this.options.productId?this.options.productId:this.options.parentProductId,n=this._getParams(t);this.$emitter.publish("onProductBoxLoad",{productId:s,params:n}),o.A.loadProductBox(s,n,t=>{if(r===this._latestRequestTimestamp){if(200!==t.status||!t.responseText){console.warn("product box reload failed",t),this._removeLoadingIndicator(),this.isLoading=!1;return}this._insertProductBox(t.responseText),this.$emitter.publish("onProductBoxLoaded",{productId:s,params:n}),this._restoreFocus(),"function"==typeof i&&i(),this._removeLoadingIndicator(),this.isLoading=!1}})},250)()}_restoreFocus(){if(!this._restoreFocusSelector)return;let t=this.el.querySelector(this._restoreFocusSelector);!t||document.body.classList.contains("maxia-quickbuy-active")&&!t.closest(".product-box.is-popup")||("SELECT"!==t.tagName&&t.labels.length?(window.focusHandler.setFocus(t.labels[0]),t.checked||(t.checked=!0)):window.focusHandler.setFocus(t),this._restoreFocusSelector=null)}_insertProductBox(t){let e=this.options.isQuickBuy&&null!==this.quantitySelect?this.quantitySelect.value:null,i={min:this.options.minPurchase,max:this.options.maxPurchase,steps:this.options.purchaseSteps},s=!!this.el.style.minHeight;if(s){let t=this.el.offsetHeight;t+=parseInt(window.getComputedStyle(this.el).getPropertyValue("margin-top"),10),t+=parseInt(window.getComputedStyle(this.el).getPropertyValue("margin-bottom"),10),this.el.style.minHeight=t+"px"}let r=Object.assign(document.createElement("div"),{innerHTML:t}).querySelector(".product-box");if(!r){console.warn("Product box not found in html response");return}r.classList.add("is-loading"),this.el.querySelector(".card-body").innerHTML=r.querySelector(".card-body").innerHTML,o.A.initProductBox(this.el),s&&(this.el.style.minHeight=null),null!==e&&null!==this.quantitySelect&&this._restoreQuantity(e,i)}_restoreQuantity(t,e){this.options.minPurchase===e.min&&this.options.maxPurchase===e.max&&this.options.purchaseSteps===e.steps&&(this.quantitySelect.value=t,this.quantitySelect.dispatchEvent(new Event("change")))}_getParams(t){let e={};return void 0!==t&&(e.switched=t),e.options=JSON.stringify(this.selection),this.options.layout&&(e.layout=this.options.layout),this.options.displayMode&&(e.displayMode=this.options.displayMode),this.options.slotId&&(e.slotId=this.options.slotId),this.options.isExpanded&&(e.expandOptions=!0),this.options.prependedOptions&&this.options.prependedOptions.length&&(e.prependOptions=JSON.stringify(this.options.prependedOptions)),e}_addLoadingIndicator(){this.image.classList.contains("has-element-loader")||n.A.create(this.image),this.el.classList.add("is-loading")}_removeLoadingIndicator(){n.A.remove(this.image),this.el.classList.remove("is-loading")}}}}]);
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.