var dataLayer,addthis_share,__assign,__extends,Dlw;(function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){n.updateAltTexts();window.blazy=new Blazy({selector:n.dataSelector,successClass:"p-blazy--loaded",breakpoints:[{width:window.breakpoints.small,src:"data-src-small"},{width:window.breakpoints.medium,src:"data-src-medium"}],error:this.onBlazyError.bind(this)})}return n.revalidate=function(){window.blazy&&(n.updateAltTexts(),window.blazy.revalidate())},n.prototype.onBlazyError=function(){},n.updateAltTexts=function(){var t,i,r;window.breakpoints&&(t=jQuery(n.dataSelector),t.length)&&(i=window.breakpoints.isMobile(),r=window.breakpoints.isTablet(),t.each(function(t,u){var f=jQuery(u),e=f.attr(n.dataAltLarge)||f.attr("alt"),o,s;i?(o=f.attr(n.dataAltSmall)||e,o&&o.length&&f.attr("alt",o)):r?(s=f.attr(n.dataAltMedium)||e,s&&s.length&&f.attr("alt",s)):e&&e.length&&f.attr("alt",e)}))},n}();t.dataSelector="[data-selector='blazy']";t.dataAltSmall="data-alt-small";t.dataAltMedium="data-alt-medium";t.dataAltLarge="data-alt-large";n.BlazyImageBase=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))})(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.put=function(t,i){return this.setCookie(t,JSON.stringify(i),n.defaultCookieExpireDay)},n.prototype.get=function(n){return this.getCookie(n)},n.prototype.update=function(t,i){return this.setCookie(t,JSON.stringify(i),n.defaultCookieExpireDay)},n.prototype.remove=function(n){return this.removeCookie(n)},n.prototype.contains=function(n){return this.getCookie(n)?!0:!1},n.prototype.count=function(){return document.cookie.split(";").length},n.prototype.setCookie=function(n,t,i){var u="",r;i&&(r=new Date,r.setTime(r.getTime()+i*864e5),u="; expires="+r.toUTCString());document.cookie=n+"="+t+u+"; path=/"},n.prototype.getCookie=function(n){var t=document.cookie.match(new RegExp("(^| )"+n+"=([^;]+)"));return t?JSON.parse(decodeURIComponent(t[2])):null},n.prototype.removeCookie=function(n){this.setCookie(n,"",-1)},n}();t.defaultCookieExpireDay=180;n.CookieStorageProvider=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.debounce=function(n,t,i){var u=this,r;return function(){r!==0&&clearTimeout(r);r=setTimeout(function(){r=null;n.apply(u,i)},t)}},n}();n.Debounce=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.init=function(){$(document).ready(function(){$("[data-fancybox]").fancybox({loop:!1,keyboard:!0,toolbar:!0,infobar:!1,idleTime:!1,buttons:["close"],animationEffect:"fade",transitionEffect:"fade",slideClass:"c-fancybox__slide",baseClass:"c-fancybox",btnTpl:{arrowLeft:'<button data-fancybox-prev class="c-fancybox__btn c-fancybox__btn--prev" title="{{PREV}}"><span class="c-fancybox__icon icon-arrow-left"><\/span><\/button>',arrowRight:'<button data-fancybox-next class="c-fancybox__btn c-fancybox__btn--next" title="{{NEXT}}"><span class="c-fancybox__icon icon-arrow-right"><\/span><\/button>',close:'<button data-fancybox-close class="c-fancybox__btn c-fancybox__btn--close" title="{{CLOSE}}"><span class="c-fancybox__icon icon-close"><\/span><\/button>'}})})},n}();n.Fancybox=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.initializeAutocomplete=function(n,t){var u=this,r,i;n.length>0&&(r={types:t},i=new google.maps.places.Autocomplete(n[0],r),this.autoCompletes.push(i),google.maps.event.addListener(i,"place_changed",function(){var e=i.getPlace(),t,r,f;!e.geometry||(u.autoCompleteUsed=!0);e&&(t=e.address_components.filter(function(n){return n.types.indexOf("locality")!==-1}),t&&t.length?n.val(t[0].long_name):(r=n.val(),f=r.lastIndexOf(","),f>0&&n.val(r.substr(0,f<0?r.length:f))))}))},n.setCountryForAutocomplete=function(n){for(var r,t=0,i=this.autoCompletes;t<i.length;t++)r=i[t],r.setComponentRestrictions({country:n})},n}();t.autoCompletes=[];n.GoogleMapsLoader=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.stringifyOrDefault=function(n){return n?JSON.stringify(n):null}}return n.prototype.get=function(n,t,i){return this.send(n,t,"GET",i)},n.prototype.post=function(n,t,i){return this.send(n,this.stringifyOrDefault(t),"POST",i)},n.prototype.del=function(n,t,i){return this.send(n,this.stringifyOrDefault(t),"DELETE",i)},n.prototype.put=function(n,t,i){return this.send(n,this.stringifyOrDefault(t),"PUT",i)},n.prototype.postAsFormData=function(n,t,i){var r=__assign({contentType:"application/x-www-form-urlencoded; charset=utf-8"},i);return this.send(n,t,"POST",r)},n.prototype.send=function(n,t,i,r){var f=__assign({cache:!1,url:n,data:t,contentType:"application/json; charset=utf-8",type:i,headers:null},r),u=jQuery.Deferred();return jQuery.ajax(f).always(function(){window.Sitecore!=undefined&&Sitecore.PageModes.ChromeManager.resetChromes()}).done(function(n,t,i){u.resolve(n,t,i)}).fail(function(n,t,i){u.reject(n,t,i)}),u.promise()},n}();n.HttpClient=t;window.$http=new t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.settings=n;this.isBusy=!1;this.setEventName();this.registerScrollEvent();this.executeOnScroll(!0)}return n.prototype.registerScrollEvent=function(){var n=this;jQuery(document).on(this.eventName,function(){return n.executeOnScroll(!1)})},n.prototype.executeOnScroll=function(n){var r=this,t,i;if(!this.isBusy){if(this.isBusy=!0,t=this.getLastElementOffset(),t===0){this.isBusy=!1;return}if(i=this.getPageOffset(),i<this.lastWindowScrollTop&&!n){this.lastWindowScrollTop=i;this.isBusy=!1;return}i>t-this.settings.offset&&this.previousLastElementOffset!==t?(this.previousLastElementOffset=t,this.settings.loadMoreFunction().always(function(){r.lastWindowScrollTop=r.getPageOffset();r.isBusy=!1})):this.isBusy=!1}},n.prototype.getLastElementOffset=function(){var n=jQuery(this.settings.elementSelector).children().last()[0];return n?n.offsetTop+n.offsetHeight:0},n.prototype.getPageOffset=function(){return window.pageYOffset+window.innerHeight},n.prototype.setEventName=function(){var n="scroll";this.settings.namespace||(n+="."+this.settings.namespace);this.eventName=n},n.prototype.stopListening=function(){jQuery(document).off(this.eventName)},n.prototype.reset=function(){this.registerScrollEvent();this.previousLastElementOffset=0;this.executeOnScroll(!0)},n}();n.InfiniteScroll=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.initialize=function(n,t,i,r){return n.intlTelInput(__assign({initialCountry:i,formatOnInit:!0,separateDialCode:!0,placeholderNumberType:t,numberType:t,customPlaceholder:function(t){return n.data("placeholder")+": "+t}},r))},n}();n.IntlTelInput=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(t){var i=this;this.$form=t;this.isFilled=function(){return window.grecaptcha&&grecaptcha.getResponse(i.widgetId).length>0};n.scriptLoaded?this.initReCaptcha():n.initQueue.push(this)}return n.reset=function(){window.grecaptcha&&(jQuery(this.dataSelector).length<1||grecaptcha.reset())},n.prototype.initReCaptcha=function(){var i=this,t;this.$form&&this.$form.length&&((this.$form[0].tagName.toLowerCase()!=="form"&&(this.$form=this.$form.find("form")),this.$recaptcha=this.$form.find(n.dataSelector),!this.$recaptcha.length||this.$recaptcha.children().length>0)||(this.enabled=window.grecaptcha&&this.$recaptcha.length>0,this.enabled&&(t={callback:function(){var n=i.$recaptcha.siblings("input#ReCaptcha");n.valid()}},this.widgetId=grecaptcha.render(this.$recaptcha[0],t),this.$recaptcha.siblings("#ReCaptcha").removeClass("recaptcha").addClass("recaptcha"+this.widgetId),this.initValidation())))},n.prototype.reset=function(){window.grecaptcha&&(this.widgetId<0||grecaptcha.reset(this.widgetId))},n.prototype.initValidation=function(){var i=this.$form.find("[data-valmsg-for=ReCaptcha]").data("validationmessage"),n="recaptcha"+this.widgetId,t={};t[n]=!0;jQuery.validator.addMethod(n,this.isFilled,i);jQuery.validator.addClassRules(n,t);this.$form.data("validator").settings.ignore=".ignore, :hidden:not(.forcevalidation)"},n}();t.dataSelector='[data-selector="recaptcha"]';t.initQueue=[];t.reCaptchaLoaded=function(){if(t.initQueue&&t.initQueue.length){for(var n=0;n<t.initQueue.length;n++)t.initQueue[n].initReCaptcha();t.initQueue=[]}t.scriptLoaded=!0};n.ReCaptcha=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));window.reCaptchaLoaded=Dlw.ScBase.Unilin.ReCaptcha.reCaptchaLoaded,function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){this.small=480;this.medium=992}return n.prototype.isMobile=function(){return window.innerWidth<this.small},n.prototype.isTablet=function(){return window.innerWidth>=this.small&&window.innerWidth<this.medium},n.prototype.isDesktop=function(){return window.innerWidth>=this.medium},n.prototype.match=function(n){return window.innerWidth<n},n}();n.Breakpoints=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var t=function(){function t(t,i){var r=this;this.$component=t;this.$component.on("init",function(){var n=function(){r.adjustSlickArrows();r.$component.css("visibility","visible")},t=r.$component.find(".slick-current img").first();if(t.length>0)t.one("load",function(){return n()});else n()});this.slickOptions=this.getSlickOptions(i);this.updateEntireCarouselImageSource();this.$slick=t.slick(this.slickOptions);this.$slick.on("lazyLoadError",function(n,t,i,u){return r.lazyLoadError(n,t,i,u)});this.$slick.on("afterChange",function(){return r.adjustSlickArrows()});jQuery(window).on("resize",n.Debounce.debounce(function(){return r.updateSlickOnResize()},200))}return t.prototype.getCurrentSlide=function(){return this.$slick.find(".slick-current")},t.prototype.getCurrentSlideIndex=function(){return this.$slick.slick("slickCurrentSlide")},t.prototype.getSlickOptions=function(n){return __assign({infinite:!0,lazyLoad:"ondemand",slidesToShow:1,slidesToScroll:1,adaptiveHeight:!1,dots:!1},n)},t.prototype.adjustSlickArrows=function(){var i=this.slickOptions.responsive&&this.slickOptions.responsive.filter(function(n){return window.breakpoints.match(n.breakpoint)})[0],t,n,r,u;if(i){if(!i.settings.adjustArrows&&!this.slickOptions.adjustArrows)return}else if(!this.slickOptions.adjustArrows)return;(this.slickOptions.adjustArrowsSelector||(this.slickOptions.adjustArrowsSelector="img"),t=this.getCurrentSlide(),n=t.find(this.slickOptions.adjustArrowsSelector+":visible").first(),n.length<1)||(r=n.offset().top-t.offset().top,u=n.outerHeight(!0),this.$slick.find(".slick-arrow").css({top:r+u/2+"px"}))},t.prototype.lazyLoadError=function(n,t,i){if(i.hasClass("slick-lazyload-error"))if(this.slickOptions.notFoundImage){var r=this.slickOptions.notFoundImage.clone();i.replaceWith(r);r.css("display","block")}else i.remove()},t.prototype.updateSlickOnResize=function(){var n=this;this.updateEntireCarouselImageSource();setTimeout(function(){return n.adjustSlickArrows()},100)},t.prototype.updateEntireCarouselImageSource=function(){var t=this,n;this.slickOptions.supportMobileImages&&(n=this.$component.find('[data-selector="slick-image"]'),n.length)&&n.each(function(n,i){t.handleResponsiveImages(jQuery(i))})},t.prototype.handleResponsiveImages=function(n){if(this.slickOptions.supportMobileImages){var r=window.breakpoints.isMobile(),u=window.breakpoints.isTablet(),t=n.attr("data-desktop-src"),i=n.attr("data-tablet-src")||t,f=n.attr("data-mobile-src")||i;n.attr(n.attr("src")?"src":"data-lazy",r?f:u?i:t)}},t}();n.Slick=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.prototype.put=function(n,t){localStorage.setItem(n,JSON.stringify(t))},n.prototype.get=function(n){var t=localStorage.getItem(n);return t?JSON.parse(t):null},n.prototype.update=function(n,t){window.localStorage[n]=JSON.stringify(t)},n.prototype.remove=function(n){window.localStorage.removeItem(n)},n.prototype.contains=function(n){return window.localStorage.getItem(n)?!0:!1},n.prototype.count=function(){return window.localStorage.length},n}(),i;n.LocaleStorageProvider=t;i=function(){function n(){}return n.getProvider=function(){return n.provider==null&&(n.provider=n.isSupported()?new t:new t),n.provider},n.put=function(n,t){this.getProvider().put(n,t)},n.get=function(n){return this.getProvider().get(n)},n.update=function(n,t){this.getProvider().update(n,t)},n.remove=function(n){this.getProvider().remove(n)},n.contains=function(n){return this.getProvider().contains(n)},n.count=function(){return this.getProvider().count()},n.isSupported=function(){var n="modernizr";try{return window.localStorage.setItem(n,n),window.localStorage.removeItem(n),!0}catch(t){return!1}},n}();n.Storage=i})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.addClassFromSvg=function(n,t){n.classList?n.classList&&n.classList.contains(t)===!1&&n.classList.add(t):n.className&&n.className.baseVal.indexOf(t)<0&&(n.className.baseVal+=" "+t)},n.removeClassFromSvg=function(n,t){n.classList?n.classList&&n.classList.contains(t)&&n.classList.remove(t):n.className&&n.className.baseVal.indexOf(t)>-1&&(n.className.baseVal=n.className.baseVal.replace(t,""))},n.setClassFromSvg=function(n,t){n.classList?n.className=t:n.className.baseVal=t},n}();n.SvgHelpers=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));dataLayer=dataLayer||[],function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.getInstance=function(){return n.instance},n.prototype.registerEvent=function(n,t,i,r,u){var f={};n&&(f.event=n);u&&(f.category=u);t&&(f.action=t);i&&(f.label=i);r&&(f.value=r);this.registerEventOfType(f)},n.prototype.registerTransaction=function(n){dataLayer.push({event:"trackTrans",transactionId:n.transactionId,transactionAffiliation:n.affiliation,transactionTotal:n.total,transactionTax:n.tax,transactionShipping:n.shipping,transactionProducts:n.transactionProducts.map(function(n){return{sku:n.id,name:n.name,category:n.category,price:n.price,quantity:n.quantity}})})},n.prototype.registerAddToCart=function(n,t,i){n&&i.length!=0&&dataLayer.push({event:n,ecommerce:{currencyCode:t,add:{products:i}}})},n.prototype.registerRemoveFromCart=function(n,t,i){n&&i.length!=0&&dataLayer.push({event:n,ecommerce:{currencyCode:t,remove:{products:i}}})},n.prototype.registerVirtualPageview=function(n,t){dataLayer.push({event:"VirtualPageview",virtualPageURL:n,virtualPageTitle:t})},n.prototype.registerEventOfType=function(n){n&&dataLayer.push(n)},n}();t.instance=new t;n.GTM=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var u=function(){function n(){this.timeout=t.TOAST_TIMEOUT;this.level=t.LEVEL_DEFAULT}return n}(),t,r,i;n.ToastSettings=u;t=function(){function n(){}return n.show=function(t,i){var r=__assign({level:n.getToastLevelFromBody(t),timeout:i&&i.timeout?i.timeout:n.getTimeOutFromBody(t),body:t},i||{});return n.showToast(r)},n.update=function(t,i,r){return t?(t.update(n.getToastLevelFromBody(i),i,r),n.showAndTimeoutToast(t),n.toasts.indexOf(t)===-1&&(n.toasts.push(t),n.showAndTimeoutToast(t))):t=n.show(i,r),t},n["default"]=function(t,i){return n.showToast(__assign({body:t,level:n.LEVEL_DEFAULT,timeout:n.TOAST_TIMEOUT},i||{}))},n.info=function(t,i){return n.showToast(__assign({body:t,level:n.LEVEL_INFO,timeout:n.TOAST_TIMEOUT},i||{}))},n.confirmation=function(t,i){return n.showToast(__assign({body:t,level:n.LEVEL_CONFIRMATION,timeout:n.TOAST_TIMEOUT},i||{}))},n.error=function(t,i){return n.showToast(__assign({body:t,level:n.LEVEL_ERROR,timeout:n.TOAST_TIMEOUT},i||{}))},n.warning=function(t,i){return n.showToast(__assign({body:t,level:n.LEVEL_WARNING,timeout:n.TOAST_TIMEOUT},i||{}))},n.showToast=function(t){var i=window.toastProvider.createToast(n.getContainer(),"toast-"+n.toastsCounter++,t);return n.toasts.push(i),n.showAndTimeoutToast(i),i},n.close=function(t){var i=t.closest('[data-selector="toast"]');i.length&&n.destroy(n.getToastItemById(i.attr("id")))},n.getContainer=function(){if(n.$toastContainer)return n.$toastContainer;n.$toastContainer||(n.$toastContainer=jQuery('[data-selector="toast-container"]'));n.$toastContainer.length<1&&(n.$toastContainer=jQuery("<div/>").attr("class","c-toast-wrapper c-toast-wrapper--fly-right-top").attr("data-selector","toast-container").attr("data-webid","toast-container").appendTo("body"));n.$toastContainer.on("click",'[data-selector="toast-close-button"]',function(t){n.destroy(n.getToastItemById(jQuery(t.currentTarget).parents('[data-selector="toast"]').attr("id")))});return this.$toastContainer},n.destroy=function(t){var i=n.toasts.indexOf(t);return i>-1?(t.destroy(),n.toasts.splice(i,1),!0):!1},n.showAndTimeoutToast=function(t){t.show();t.toastSettings.timeout>0&&(t.timeoutId=setTimeout(n.destroy,t.toastSettings.timeout*1e3,t));t.toastSettings.zindex&&t.$container.css("z-index",t.toastSettings.zindex)},n.getToastItemById=function(t){var i=n.toasts.filter(function(n){return n.id===t});return i&&i.length?i[0]:null},n.getToastLevelFromBody=function(n){return jQuery(n).filter("[data-level]").data("level")},n.getTimeOutFromBody=function(n){return parseInt(jQuery(n).filter("[data-timeout]").data("timeout"))},n}();t.TOAST_TIMEOUT=15;t.HIGH_ZINDEX=1e4;t.LEVEL_DEFAULT="Default";t.LEVEL_INFO="Info";t.LEVEL_CONFIRMATION="Confirmation";t.LEVEL_ERROR="Error";t.LEVEL_WARNING="Warning";t.toasts=[];t.toastsCounter=0;n.Toast=t;r=function(){function n(){}return n.prototype.createToast=function(n,t,r){return new i(n,t,r)},n}();n.ToastProvider=r;i=function(){function n(n,t,i){this.$container=n;this.id=t;this.toastSettings=i;this.$toast=this.create(i)}return n.prototype.show=function(){this.$toast.show()},n.prototype.destroy=function(){this.timeoutId>0&&(clearTimeout(this.timeoutId),this.timeoutId=0);this.$toast.hide();this.$toast.remove()},n.prototype.update=function(n,t,i){this.destroy();this.$toast=this.create(__assign({},this.toastSettings,{body:t,level:n},i));this.show()},n.prototype.create=function(t){var i=this,r=jQuery(this.createToastHtml(this.id,this.getToastModifier(t.level),t.body)).prependTo(this.$container);if(t.primaryCallback)r.on("click",n.primaryButtonSelector,function(n){return t.primaryCallback.call(i,n,i)});if(t.secondaryCallback)r.on("click",n.secondaryButtonSelector,function(n){return t.secondaryCallback.call(i,n,i)});return r},n.prototype.createToastHtml=function(n,t,i){return'<div class="c-toast u-mb-0 '+t+'" id="'+n+'" data-selector="toast" style="display: none;">\n\t\t\t\t\t\t<div class="c-btn c-btn--bare u-color-white c-toast__close" data-parent-id="'+n+'" role="button" data-selector="toast-close-button">\n\t\t\t\t\t\t\t<div class="c-close c-close--small" aria-hidden="true">\n\t\t\t\t\t\t\t\tclose<span><\/span><span><\/span>\n\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<div class="c-toast__body">'+i+"<\/div>\n\t\t\t\t\t<\/div>"},n.prototype.getToastModifier=function(n){n||(n=t.LEVEL_DEFAULT);var i="";switch(n.toLowerCase()){case"default":i="";break;case"info":i="c-toast--info";break;case"confirmation":i="c-toast--success";break;case"error":i="c-toast--error";break;case"warning":i="c-toast--warning"}return i.length>0?i+" c-toast--icon":"c-toast--info"},n}();i.primaryButtonSelector='[data-selector="toast-primary-button"]';i.secondaryButtonSelector='[data-selector="toast-secondary-button"]';n.ToastItem=i})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var i=function(){function n(n){this.$component=n;this.$http=window.$http}return n.prototype.getJsonScript=function(n){var t=jQuery(n).filter("script[type=json]");return t.length?JSON.parse(t[0].innerHTML):undefined},n}(),t;n.BaseComponent=i;t=function(){function n(){this.objectFitDataSelector="object-fit";this.convertImagetoBackground()}return n.prototype.revalidateObjectFit=function(){this.convertImagetoBackground()},n.prototype.convertImagetoBackground=function(){var n=jQuery("[data-selector='"+this.objectFitDataSelector+"']:not([data-object-fit='complete'])");n.length<=0||("objectFit"in document.documentElement.style==!1?jQuery.each(jQuery(n),function(n,t){var u=jQuery(t),i=u.find("img"),r="";i.is("[data-selector='blazy']")&&(r=window.breakpoints.isMobile()?i.attr("data-src-small"):window.breakpoints.isTablet()?i.attr("data-src-medium"):i.attr("data-src"));r===""&&(r=i.attr("src"));u.css({"background-image":'url("'+r+'")'});i.hide()}):jQuery(n).find("img").show(),n.attr("data-object-fit","complete"))},n}();n.PolyFills=t;jQuery(function(){window.breakpoints||(window.breakpoints=new n.Breakpoints)})})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var t=function(){function n(){}return n.getQueryParameterByName=function(n,t){var i=this.getQueryParameters(t);return n in i?i[n]:null},n.getQueryParameters=function(n){n=n?n:window.location.href;for(var r=n.substr(n.indexOf("?")),i={},t,u=/[?&]?([^=]+)=([^&]*)/g;t=u.exec(r);)i[decodeURIComponent(t[1])]=decodeURIComponent(t[2]);return i},n.parseHtmlAndJson=function(t){var i=t.indexOf(n.beginScriptSelector),r=t.indexOf(n.endScriptSelector),u=t.substring(i+n.beginScriptSelector.length,r);return{html:t.substring(0,i),json:JSON.parse(u)}},n.initializePopovers=function(n){var i=this,t=n.find("[data-toggle=popover]");t.length&&t.each(function(n,t){return i.initializePopover(jQuery(t))})},n.initializePopover=function(n){n.length&&n.popover({trigger:"focus",viewport:{selector:"body",padding:15}})},n.attachObserver=function(n,t,i){if(n&&n.length){var r=new MutationObserver(function(n){n&&n.length&&t(n)});return r.observe(n[0],__assign({subtree:!0,childList:!0},i)),r}return null},n.scrollTo=function(n,t,i){t||(t="linear");var r="is-scrolling",u=jQuery("html");u.addClass(r).animate({scrollTop:n},t,function(){i&&i();u.removeClass(r)})},n}();t.beginScriptSelector='<script type="json">';t.endScriptSelector="<\/script>";n.UnilinHelpers=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},addthis_config=addthis_config||{},addthis_share=addthis_share||{},Dlw;(function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i){var r=n.call(this,t)||this;return r.params=i,r.initAddthisScript(),r.initAddThisConfig(),r.initAddThisShare(),r}return __extends(t,n),t.prototype.initAddthisScript=function(){var t=jQuery("script[src='"+this.params.addThisWidgetLink+"']"),n;t.length>0||(n=document.createElement("script"),n.setAttribute("src",this.params.addThisWidgetLink),document.body.appendChild(n))},t.prototype.initAddThisConfig=function(){addthis_config.pubId=this.params.pubId;addthis_config.ui_language=this.params.languageCode;addthis_config.services_compact=this.params.compactServices;addthis_config.services_expanded=this.params.expandedServices;addthis_config.services_exclude=this.params.excludedServices},t.prototype.initAddThisShare=function(){addthis_share.url=window.location.href;addthis_share.title=jQuery("meta[property='og:title']").attr("content");addthis_share.description=jQuery("meta[property='og:description']").attr("content")||jQuery("meta[name='description']").attr("content");addthis_share.media=jQuery("meta[property='og:image']").attr("content")},t}(n.BaseComponent);n.AddThis=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))})(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function t(t,i){if(i){var r=i.datalayerVariables,u=r.internalType;u===i.errorEventType&&(r.pageUrl=window.location.href,r.hostName=window.location.hostname);n.GTM.getInstance().registerEventOfType(r)}}return t}();n.PageEventTrigger=t})(t=n.Unilin||(n.Unilin={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n,t,i,r,u){u===void 0&&(u=!1);var f=this;this.$element=n;this.$form=t;this.$submitButton=i;this.$errorBox=r;u&&(t.removeData("validator"),t.removeData("unobtrusiveValidation"),jQuery.validator.unobtrusive.parse(t));this.initializeForm();this.$submitButton.on("click",function(){return f.initDynamicValidation()});this.$form.on("keypress",function(n){n.keyCode===13&&f.initDynamicValidation()})}return t.prototype.initializeForm=function(){var n=this;this.toggleErrorBox();this.$element.on("click","input[type=checkbox]",function(t){var i=jQuery(t.currentTarget),r=i.next("input[type=hidden]");r.length&&r.attr("value",""+i.is(":checked"));n.isValidationToggled()&&n.validateOrUpdate(!1)})},t.prototype.initDynamicValidation=function(){var r=this,t,i;this.dynamicValidationInitialized||(n.Unilin.UnilinHelpers.attachObserver(this.$errorBox,function(){return r.toggleErrorBox()}),t=this.$form.find("input, textarea, select"),i=n.Unilin.Debounce.debounce(function(){return r.validate()},100),t.blur(i),t.keyup(i),this.dynamicValidationInitialized=!0)},t.prototype.validate=function(n,t){n===void 0&&(n=null);t===void 0&&(t=null);this.validateOrUpdate(!1,n,t)},t.prototype.update=function(n){(n===void 0&&(n=!0),!n||this.dynamicValidationInitialized)&&this.validateOrUpdate(!0)},t.prototype.isValidationToggled=function(){return this.validationEnabled},t.prototype.validateOrUpdate=function(n,t,i){t===void 0&&(t=null);i===void 0&&(i=null);n||(this.$form.valid()?t&&t():i&&i());this.syncSelectizeErrors();this.toggleErrorBox();this.validationEnabled=!0},t.prototype.syncSelectizeErrors=function(){this.$form.find(".selectized").each(function(n,t){var i=jQuery(t);i.siblings(".selectize-control").find(".selectize-input").toggleClass("selectize-validation-error",i.hasClass("input-validation-error"))})},t.prototype.toggleErrorBox=function(){this.$errorBox&&(this.$errorBox.find("ul span, ul li").text().length<1?this.$errorBox.hide():this.$errorBox.show())},t}();t.CustomValidationHelper=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function t(t){var i=this;t?(this.baseUrl=ko.observable(t.baseUrl),this.materialList=ko.observableArray(t.materialList)):(this.baseUrl=ko.observable(""),this.materialList=ko.observableArray([]));this.floorAdvisorLink=ko.computed(function(){return n.FloorAdvisorManager.generateLink({baseUrl:i.baseUrl(),materialList:i.materialList()})})}return t.prototype.updateFloorAdvisorLink=function(n,t){if(t===void 0&&(t=!1),n){this.baseUrl()!==n.baseUrl&&this.baseUrl(n.baseUrl);t?(i=this.materialList).push.apply(i,n.materialList):this.materialList(n.materialList);var i}},t}();n.FloorAdvisorLinkUpdatable=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var i;(function(i){var u=function(t){function r(i,r){r===void 0&&(r=null);var u=t.call(this,i)||this;return i&&(u._$element=jQuery(i),u.trackingLabel=r?r:i.attr("data-component-class")),u.tagManager=n.ScBase.Unilin.GTM.getInstance(),u.isPageLoading=ko.observable(!0),u.contentLanguage=jQuery("meta[name='content-language']").attr("content"),u.applicationContext=jQuery("meta[name='application-context']").attr("content"),u}return __extends(r,t),r.prototype.registerEvent=function(n,t,i){this.tagManager.registerEvent(this.trackingLabel,n,t,i)},r.prototype.registerVirtualPage=function(n){try{this.tagManager.registerEvent("virtualpage",n)}catch(t){console.error("Failed to Register virtual page.")}},r.prototype.registerTransaction=function(n){this.tagManager.registerTransaction(n)},r.prototype.callInternalService=function(n,t,r,u){jQuery.ajax(n,{type:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:JSON.stringify(t),success:jQuery.proxy(function(n,t,i){r(n,t,i);this.refreshPageEditorControls(n,t,i)},this),error:u||i.FlooringHelpers.logErrorToConsole})},r.prototype.refreshPageEditorControls=function(){window.Sitecore!=undefined&&Sitecore.PageModes.ChromeManager.resetChromes()},r.prototype.pageHasLoaded=function(){this.isPageLoading(!1)},r.prototype.buildControllerUrl=function(n,t){return"/services/"+this.applicationContext+"/"+this.contentLanguage+"/"+n+"/"+t},r}(t.Unilin.BaseComponent),f,r;i.FlooringBase=u;f=function(n){function t(t,i){i===void 0&&(i=null);var r=n.call(this,t,i)||this;return r.$element=t,r.trackingLabel=i,r.initialize(),r.bindEvents(),r}return __extends(t,n),t.prototype.initialize=function(){this.initShoppingCardManager();this.initCompareManager()},t.prototype.bindEvents=function(){this.bindAddToShoppingCartEvents();this.bindCompareEvents()},t.prototype.initShoppingCardManager=function(){this.shoppingCartManager=new i.ShoppingCartManager(this._$element)},t.prototype.initCompareManager=function(){this.compareManager=new i.CompareManager(this._$element)},t.prototype.bindAddToShoppingCartEvents=function(){var n=this;this._$element.on("click","[data-selector='add-to-cart-trigger']",function(t){return n.onAddToCartTriggered(t)});this._$element.on("click","[data-selector='order-sample-trigger']",function(t){return n.onOrderSampleTriggered(t)})},t.prototype.bindCompareEvents=function(){var n=this;this._$element.on("click","[data-selector='add-to-compare']",function(t){return n.onAddToCompareTriggered(t)});this._$element.on("click","[data-selector='remove-from-compare']",function(t){return n.onRemoveFromCompareTriggered(t)});jQuery(document).off("compare-product-replaced.flooringbase");jQuery(document).on("compare-product-replaced.flooringbase",function(t,i){return n.onReplaceCompareProduct(t,i)})},t.prototype.onAddToCartTriggered=function(n){var t=jQuery(n.currentTarget),i;t&&(n.preventDefault(),i=1,this.shoppingCartManager.addB2CMaterial(t,i))},t.prototype.onOrderSampleTriggered=function(n){var t=jQuery(n.currentTarget);t&&(n.preventDefault(),this.shoppingCartManager.addB2CSample(t))},t.prototype.onAddToCompareTriggered=function(n){var r=this,i=jQuery(n.target).closest("[data-selector='add-to-compare']"),t;i&&(n.preventDefault(),t=i.data("id"),t)&&this.compareManager.tryAddProduct(t).done(function(n){n.succeed&&r.toggleProductAdded(t)})},t.prototype.onRemoveFromCompareTriggered=function(n){var r=this,i=jQuery(n.target).closest("[data-selector='remove-from-compare']"),t;i&&(n.preventDefault(),t=i.data("id"),t)&&this.compareManager.removeProduct(t,!1,null).done(function(n){n.succeed&&r.toggleProductRemoved(t)})},t.prototype.onReplaceCompareProduct=function(n,t){t&&(this.toggleProductRemoved(t.oldProductId),this.toggleProductAdded(t.newProductId))},t.prototype.toggleProductAdded=function(n){jQuery("[data-selector='add-to-compare'][data-id='"+n+"']").hide();jQuery("[data-selector='remove-from-compare'][data-id='"+n+"']").show()},t.prototype.toggleProductRemoved=function(n){jQuery("[data-selector='remove-from-compare'][data-id='"+n+"']").hide();jQuery("[data-selector='add-to-compare'][data-id='"+n+"']").show()},t}(u);i.ComponentWithProductActions=f;r=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t}(t.Unilin.Breakpoints);i.FlooringBreakpoints=r;window.breakpoints=new r;window.toastProvider=new t.Unilin.ToastProvider;jQuery(function(){window.polyFills=new t.Unilin.PolyFills})})(i=t.Flooring||(t.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function t(){}return t.showFullScreenWaitPanel=function(n){n===void 0&&(n=!0);var t=this.getWaitPanel(),i=t.find("div[data-selector='full-page-wait-panel-spinner']");t.css({width:jQuery(window).width(),height:jQuery(window).height()}).show();n?i.show():i.hide()},t.hideWaitPanel=function(){var n=this.getWaitPanel();n!=undefined&&n.hide()},t.renderEmailTextField=function(n,t){var i=t;(n!=null&&(n.preventDefault(),i=jQuery(n.target)),i.length!==0)&&i.hasAttr("data-email")&&(window.location.href="mailto:"+i.data("email"))},t.enableButtonBehaviorForDiv=function(n,t){var i=this;n.keyup(function(n){return i.executeOnEnterAndSpace(n,t)});n.click(function(n){return t(n)})},t.executeOnEnterAndSpace=function(n,t){(n.keyCode===13||n.keyCode===32)&&t(n)},t.getWaitPanel=function(){var n=function(){return jQuery("body").find("div[data-selector='full-page-wait-panel']")},t;return n().length===0&&(t=jQuery("<div data-selector='full-page-wait-panel' style='display: none;' class='full-page-wait-panel'><div class='loader' data-selector='full-page-wait-panel-spinner'><span><\/span><\/div><\/div>"),jQuery("body").append(t)),n()},t.logErrorToConsole=function(n){window.console.error(n)},t.logWarningToConsole=function(n){window.console.warn(n)},t.openFlyoutOrRedirectToDetailPage=function(n,t){var i=jQuery(n.target).parents('[data-selector="flyout-link"]');if(!(i.length<=0)){var u=i.data("mobile-flyout")==="True",e=i.data("desktop-flyout")==="True",r=i.data("current-device-is-mobile")==="True",f=window.innerWidth<=991;(r&&u||!r&&u&&f||!r&&e&&!f)&&(t(),n.preventDefault())}},t.getJsonScript=function(n){var t=jQuery(n).filter("script[type=json]");return t.length?JSON.parse(t[0].innerHTML):undefined},t.toggleErrorBox=function(n){n.find("ul span").text().length<1?n.hide():n.show()},t.startFloorAdvisor=function(t,i){t.preventDefault();var r=jQuery(t.target);n.FloorAdvisorManager.getInstance().openFloorAdvisor(r,i)},t.loadProductImagesAsync=function(n,i){jQuery("[data-selector='image-to-load']",n).imagesLoaded().progress(function(r,u){if(u.isLoaded){var f=jQuery(u.img,n);t.replaceImage(f);i&&i(f)}})},t.replaceImage=function(n){n.prev("[data-selector='image-to-replace']").hide().remove();n.show()},t.showNotification=function(n,t){n&&t&&(n.html(t),n.show())},t.hideNotification=function(n){n.html("");n.hide()},t.getLongLat=function(n,t){var i=jQuery.Deferred();if(t)try{n.geocode({address:t},function(n,t){t===google.maps.GeocoderStatus.OK?i.resolve(n):i.reject()})}catch(r){i.reject()}else i.reject();return i.promise()},t.buildAddressFromUserData=function(n){return t.buildAddress(n.Street,n.HouseNumber,n.PostalCode,n.City,n.Country)},t.buildAddress=function(n,t,i,r,u){var f=[n,t,i,r,u];return(f=f.filter(function(n){return n!=undefined&&n!=null&&n.length>0}),f&&f.length>1)?f.join(" "):null},t.initialiseComponentsInsideElement=function(n){n.find("[data-component-class]").each(function(n,t){for(var r,u,f=jQuery(t),s=f.attr("data-component-class"),e=s.split("."),i=window[e[0]],o=1;o<e.length;++o){if(!i)break;i=i[e[o]]}if(i){if(r=f.attr("data-component-parm"),u=null,r)try{u=JSON.parse(r)}catch(h){u=r}new i(f,u)}})},t.getFloatValue=function(n){var t=String(n),i=t.replace(",",".");return parseFloat(i)},t.stripNonWordCharacters=function(n,t){if(!n)return"";var i=n.replace(/\W/g,"");return t?i.toLowerCase():i},t.mergeUnexistingQuerystringParametersFromCurrentUrl=function(n,t){var u=window.location.search,e,f,i,r,o;if(!u||!n)return n;for(u=u.substring(1),e=u.split("&").map(function(n){return n.split("=")}),f=0;f<e.length;f++)(i=e[f],i&&i.length===2)&&(r=i[0],o=i[1],r&&o)&&(t&&t.indexOf(r)!==-1||n.indexOf(r)===-1&&(n+="&"+r+"="+o));return n},t}();n.FlooringHelpers=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this,t,"jsSublayout")||this;return i.executeAutosize(),i.executeMatchSublayoutRows(),i}return __extends(t,n),t.prototype.executeAutosize=function(){var t=this._$element.data("autosize"),n,i,r;t&&t==="True"&&((n=this._$element.find("div[class='row']"),!n||n.length<=0)||(i=n.first(),r=i.children("div[class*='col']").children(),r.matchHeight()))},t.prototype.executeMatchSublayoutRows=function(){var u=this._$element.data("matchsublayoutrows"),t,n,i;if(u&&u==="True"&&(t=this._$element.find("div[class='row']"),t&&!(t.length<=0))){var e=t.first(),f=e.children("div[class*='col']"),r=0;for(f.each(function(){r=Math.max(r,jQuery(this).children().length)}),n=0;n<r;n++)i=jQuery(),f.each(function(){jQuery(this).children().length>n&&(i=i.add(jQuery(this).children().eq(n)))}),i.matchHeight()}},t}(n.FlooringBase);n.Sublayout=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i){var r,u;if(i===void 0&&(i=!1),this.$element=n,this.autoSubmit=t,this.enablePostalCodeAutoComplete=i,t||(this.autoSubmit=!1),this.$autocompleteBox=n,this.targetUrl=n.attr("data-target-url"),this.defaultCountryIsoCode=this.$autocompleteBox.attr("data-default-country"),this.useAutocomplete=this.$autocompleteBox.data("useautocomplete")==="True",this.$autocompleteBox.keyup(jQuery.proxy(this.performSearchOnEnter,this)),this.useAutocomplete)try{r=["(cities)"];this.enablePostalCodeAutoComplete&&(r=["(regions)"]);u={types:r,componentRestrictions:{country:this.defaultCountryIsoCode}};this.autoComplete=new google.maps.places.Autocomplete(this.$autocompleteBox[0],u);this.autoSubmit&&google.maps.event.addListener(this.autoComplete,"place_changed",jQuery.proxy(this.onPlaceChanged,this))}catch(f){console.error("Failed to initialize AddressAutocomplete:");console.error(f)}}return n.prototype.clearInput=function(){this.$autocompleteBox.val("");this.$autocompleteBox.focus()},n.prototype.redirectToTargetPage=function(){var n=this.$autocompleteBox.val();window.location.href=this.targetUrl+encodeURIComponent(n)},n.prototype.onPlaceChanged=function(){var n=this.autoComplete.getPlace();n&&n.geometry&&this.redirectToTargetPage()},n.prototype.performSearchOnEnter=function(n){n.keyCode===13&&(n.preventDefault(),this.redirectToTargetPage())},n}();n.AddressAutocomplete=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)};__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(t){var s=n.Unilin.BlazyImageBase,r=function(i){function r(n,t,r,u,e,o,s,h){var c=i.call(this,null)||this;return c.query=n,c.updateUrl=u,c.bulkUpdateUrl=e,c.floorTypes=o,c.knownQueryStringParameters=h,c.initialRendering=!0,c.totalCount=ko.observable(),c.updating=!0,c.updateUrl=u,c.facetMap=new f(c,o,s),c.facetMap.update(t,null),c.updating=!1,c.totalCount(r),c.updateHistory(!0,!0),c}return __extends(r,i),r.prototype.facetMapAndListUpdate=function(n,t,i,r,u){this.bulkFacetMapAndListUpdate(n,[t],i,r,u)},r.prototype.bulkFacetMapAndListUpdate=function(n,t,i,u,f){var h,o,c,e,s;if(this.updating=!0,f==null&&(f=!0),u==null&&(u=jQuery("#currentQuery").val().toString()),i===""&&(i=" "),t&&t.length>0){for(h=[],o=0,c=t;o<c.length;o++)e=c[o],s=n?n.name:null,r.isFloorTypeRange(s)&&(s=r.floorTypeRangeAttribute),h.push({currentQuery:u,facet:s,facetValue:e?e.key:null,selectFacetValue:e?e.selected():!1,searchText:i});this.doAjaxRequest(n,f,h)}},r.isFloorTypeRange=function(n){if(!n)return!1;var t=n.toUpperCase().match("("+r.floorTypeRangeAttribute.toUpperCase()+")_(.*)");return t&&t.length>=2},r.prototype.doAjaxRequest=function(n,t,i){var r=this,u=i&&i.length>1,f=u?this.bulkUpdateUrl:this.updateUrl,e=u?i:i[0];this.$http.post(f,e).done(function(i){var u=r.processAjaxResponse(i);u&&(r.facetMap.update(u.facetMap,n),r.totalCount(u.totalCount));r.updateHistory(t);r.revalidateImages();r.updating=!1;r.initialRendering=!1})},r.prototype.processAjaxResponse=function(t){var i=n.Unilin.UnilinHelpers.parseHtmlAndJson(t);return jQuery("#productList").replaceWith(i.html),i.json},r.prototype.updateHistory=function(n,i,r){if(i===void 0&&(i=!1),r===void 0&&(r="#currentQuery"),history.pushState&&n){var f=jQuery(r).val(),u=window.location.toString(),e=u.indexOf("?");e>-1&&(u=u.substr(0,e));u=u+"?"+t.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(f,this.knownQueryStringParameters);i?history.replaceState(f,null,u):history.pushState(f,null,u)}},r.prototype.revalidateImages=function(){window.polyFills.revalidateObjectFit();s.revalidate()},r.prototype.setCollapseState=function(n){var t,i,r;for(this.facetMap.floorTypeRangeCollapseVm.setState(n),this.facetMap.searchCollapseVm.setState(n),t=0,i=this.facetMap.facets;t<i.length;t++)r=i[t],r.collapseVm.setState(n)},r.prototype.resetCollapseState=function(){var n,t,i;for(this.facetMap.floorTypeRangeCollapseVm.reset(),this.facetMap.searchCollapseVm.reset(),n=0,t=this.facetMap.facets;n<t.length;n++)i=t[n],i.collapseVm.reset()},r}(n.Unilin.BaseComponent),f,e,u,o,i;r.floorTypeRangeAttribute="FloorTypeRange";t.ComponentVm=r;f=function(){function t(n,t,r){this.component=n;this.floorTypes=t;this.showMoreCount=r;this.facets=[];this.searchText=ko.observable();this.filtersList=ko.observableArray();this.showFacets=ko.observable();this.showAllFacetsOnMobile=ko.observable();this.initFacetMap();this.searchCollapseVm=new i(!1);this.floorTypeRangeCollapseVm=new i(undefined)}return t.prototype.groupFloorTypeRangeFacets=function(n){var t=n.facets.filter(function(n){return n.name.toUpperCase()===r.floorTypeRangeAttribute.toUpperCase()})[0],l=n.facets.indexOf(t),f,s,u,e,o,h,c;if(t){for(f=0,s=this.floorTypes;f<s.length;f++){for(u=s[f],e=[],o=0,h=t.values;o<h.length;o++)c=h[o],c.key.toUpperCase().match(u.code.toUpperCase()+"_(.*)")&&e.push(c);n.facets.push(__assign({},t,{name:r.floorTypeRangeAttribute+"_"+u.code,displayName:u.materialGroupName,values:e,totalValueCount:e.length,id:t.id+u.code}))}this.floorTypeRangeCollapseVm.collapseState()===undefined&&(this.floorTypeRangeCollapseVm=new i(t.collapsed));n.facets.splice(l,1)}return n},t.prototype.update=function(n,t){var f,o,u,s,i,h,r;for(n=this.groupFloorTypeRangeFacets(n),this.facetMap=n,f=this.facets,i=0;i<n.facets.length;i++){for(o=n.facets[i],u=null,r=0;r<this.facets.length;r++)this.facets[r].facet.name.toUpperCase()===o.name.toUpperCase()&&(u=this.facets[r]);u?u.update(o):(this.showMoreCount=Math.max(o.values.filter(function(n){return n.selected}).length,this.showMoreCount),u=new e(this.component,o,this.showMoreCount),this.facets.push(u));f=f.filter(function(n){return n!==u})}for(i=0;i<f.length;i++)f[i].facet!==t&&f[i].readonlyWhenSelected();for(s=[],i=0;i<this.facets.length;i++){for(h=this.facets[i].facetValues(),r=0;r<h.length;r++)h[r].selected()&&s.push(h[r]);this.facets[i].isRangeFacet&&this.facets[i].rangeFacetValue()&&this.facets[i].rangeFacetValue().selected()&&s.push(this.facets[i].rangeFacetValue)}this.filtersList(s)},t.prototype.getFacetVm=function(n){return this.facets.filter(function(t){return t.facet.name.toUpperCase()===n.toUpperCase()})[0]},t.prototype.textSearchOnEnter=function(n,t){return t.keyCode===13?(this.textSearchOnClick(n,t),!1):!0},t.prototype.textSearchOnClick=function(){if(this.component.updating)return!1;this.component.facetMapAndListUpdate(null,null,this.searchText(),null,!0)},t.prototype.initFacetMap=function(){var n=jQuery("#searchText").val();n&&this.searchText(n)},t.prototype.toggleShowFacets=function(){this.showFacets(!this.showFacets())},t.prototype.hideFilters=function(){this.showFacets(!1);n.Unilin.UnilinHelpers.scrollTo(jQuery("#productList").offset().top-140,"linear")},t.prototype.showAllFacets=function(){var r=this,n,t,i;if(this.showAllFacetsOnMobile(!this.showAllFacetsOnMobile()),this.showAllFacetsOnMobile())this.facets.forEach(function(n){return n.showOnMobile(r.showAllFacetsOnMobile())});else for(n=0,t=this.facets;n<t.length;n++)i=t[n],i.showOnMobile(!i.collapseVm.initialState)},t}();t.FacetMapVm=f;e=function(){function t(n,t,r){var u=this;this.component=n;this.facet=t;this.showMoreCount=r;this.facetValues=ko.observableArray([]);this.readonlyText=ko.observable();this.selectedValue=ko.observable();this.selectedValue.subscribe(function(n){return u.singleSelectToggle(n)});this.displayName=t.displayName?t.displayName:t.name;this.showMore=ko.observable(!1);this.initRangeFacet(t);t.collapsed=t.collapsed&&!(t.values.filter(function(n){return n.selected}).length>0)&&!(this.isRangeFacet&&this.rangeFacetValue().selected());this.collapseVm=new i(t.collapsed);this.showOnMobile=ko.observable(!t.collapsed);this.id=t.id;this.update(t);this.facetCheckboxEnabled=ko.pureComputed(function(){return u.facetValues().filter(function(n){return n.enabled()}).length>0});this.facetCheckboxSelected=ko.pureComputed(function(){var n=u.facetValues().filter(function(n){return n.selected()}).length,t=u.facetValues().filter(function(n){return!n.enabled()}).length;return n===u.facetValues().length-t&&n>0})}return t.prototype.toggleShowMore=function(){this.showMore()?this.showMore(!1):this.showMore(!0)},t.prototype.update=function(n){for(var t,r,e,f=this.facetValues(),i=0;i<n.values.length;i++){for(t=null,r=0;r<this.facetValues().length;r++)this.facetValues()[r].key.toUpperCase()===n.values[i].key.toUpperCase()&&(t=this.facetValues()[r]);t?t.update(n.values[i],n):(t=new u(this.component,n,n.values[i]),t.hidden||(t.selected()&&this.selectedValue(t),this.component.appendNewFacetValues?this.facetValues.push(t):(e=this.facetValues().length-(f.length+i),this.facetValues.splice(i-e,0,t))));f=f.filter(function(n){return n!==t})}this.facetValues.push();f.forEach(function(n){return n.resetCounter()});this.readonlyText(null)},t.prototype.singleSelectToggle=function(n){if(!this.component.updating){this.component.updating=!0;for(var t=0;t<this.facetValues().length;t++)this.facetValues()[t]!==n&&this.facetValues()[t].selected(!1);this.component.updating=!1;n?n.selected(!0):this.reset()}},t.prototype.readonlyWhenSelected=function(){if(!this.readonlyText()&&this.facetValues().filter(function(n){return n.selected()}).length!==0){var n=this.facetValues().filter(function(n){return n.selected()}).map(function(n){return n.facetValue.displayName});n.length>0&&this.readonlyText(n.join(", "))}},t.prototype.reset=function(){this.component.updating||(this.component.updating=!0,this.facetValues().forEach(function(n){n.selected(!1)}),this.component.updating=!1,this.component.facetMapAndListUpdate(this.facet,null,null,null,!0))},t.prototype.selectAll=function(n){this.component.updating||(this.component.updating=!0,this.facetValues().forEach(function(t){n?t.enabled()&&t.selected(!0):t.selected(!1)}),this.component.updating=!1,this.component.bulkFacetMapAndListUpdate(this.facet,this.facetValues(),null,null,null))},t.prototype.onSelectAll=function(){return this.facetCheckboxSelected()?this.selectAll(!1):this.selectAll(!0),!0},t.prototype.getBitTrueFacetValue=function(){var n=this.facetValues().filter(function(n){return n.key==="1"});return n.length>0?n[0]:null},t.prototype.onRenderFacetValue=function(t){t&&n.Unilin.UnilinHelpers.initializePopovers(jQuery(t).filter("li"))},t.prototype.initRangeFacet=function(n){var t,f,i,e,r,u;this.isRangeFacet=n.isRangeFacet;this.allowCustomRange=n.allowCustomRange;this.isRangeFacet&&(t=new o(this.component,n,null),this.rangeFacetValue=ko.observable(t),f=jQuery("#currentQuery").val(),i=f.match(new RegExp(n.name+".+\\(([0-9\\-\\,]+)\\)","i")),i&&i.length>1&&(e=n.values.map(function(n){return n.key}),r=i[1].split(",").filter(function(n){return e.indexOf(n)<0}),r&&r.length>0&&(u=r[0].split("-",2),t.setMinMax(u[0],u[1]),t.selected(!0))))},t}();t.FacetVm=e;u=function(){function n(n,t,i){var r=this;this.component=n;this.facet=t;this.facetValue=i;this.selected=ko.observable();this.count=ko.observable();this.filterLabel=ko.observable();this.update(i,t);this.selected.subscribe(function(n){return r.selectionChanged(n)});this.enabled=ko.computed(function(){return r.selected()||r.count()>0});this.hasImage=ko.computed(function(){return r.iconImageUrl!==""})}return n.prototype.selectionChanged=function(n){this.component.updating||(this.selected(n),this.component.facetMapAndListUpdate(this.facet,this,null,null,!0))},n.prototype.update=function(n,i){this.id=t.FlooringHelpers.stripNonWordCharacters(i.id+n.key,!0);this.key=n.key;this.displayName=n.displayName;this.description=n.description;this.filterLabel(n.filterLabel);this.selected(n.selected);this.count(n.count);this.iconCssClass=n.iconCssClass;this.iconImageUrl=n.iconImageUrl;this.sortKey=n.sortKey;this.hidden=n.hidden},n.prototype.resetCounter=function(){this.count(0)},n.prototype.unselect=function(){this.selected(!1)},n}();t.FacetValueVm=u;o=function(n){function t(t,i,r){var u=n.call(this,t,i,r)||this;return u.component=t,u.facet=i,u.facetValue=r,u.minValue=ko.observable(""),u.maxValue=ko.observable(""),u}return __extends(t,n),t.prototype.update=function(){},t.prototype.selectionChanged=function(n){this.component.updating||(n?this.execute():!this.minValue()||!this.maxValue()||this.component.facetMapAndListUpdate(this.facet,this,null,null,!0))},t.prototype.updateKey=function(){this.key=this.minValue()+"-"+this.maxValue();var n=this.minValue().length>0,t=this.maxValue().length>0;n&&t?this.filterLabel(this.minValue()+" - "+this.maxValue()):n||t?n?this.filterLabel("> "+this.minValue()):this.filterLabel("< "+this.maxValue()):this.filterLabel("-")},t.prototype.setMinMax=function(n,t){this.minValue(n);this.maxValue(t);this.updateKey();this.lastKey=this.key},t.prototype.execute=function(){if((this.minValue().length||this.maxValue().length)&&!this.component.updating){if(this.component.updating=!0,this.selected(!0),this.updateKey(),this.component.updating=!1,this.lastKey&&this.lastKey!==this.key){var n=new t(this.component,this.facet,this.facetValue);n.key=this.lastKey;this.component.bulkFacetMapAndListUpdate(this.facet,[n,this],null,null,!0)}else this.component.facetMapAndListUpdate(this.facet,this,null,null,!0);this.lastKey=this.key}},t}(u);t.FacetRangeValueVm=o;i=function(){function n(n){this.initialState=n;this.collapseState=ko.observable(this.initialState);this.collapseState.subscribe(function(){jQuery("body").find(".collapse.in").each(function(n,t){var i=jQuery(t);i.hasClass("collapse")&&i.hasClass("in")&&i.hasAttr("style")&&i.removeAttr("style")})})}return n.prototype.setState=function(n){this.collapseState(n)},n.prototype.reset=function(){this.setState(this.initialState)},n}();t.CollapseVm=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(){var n=i.call(this,jQuery(document),"jsfavoritefloors")||this;return n.floorIdAttribute="data-product-id",n.erpIdAttribute="data-erpid",n.erpProductIdAttribute="data-erpproductid",n.favoriteSelectedCssClass="fav-icon--selected",n.addToFavoritesSelector="[data-selector='favoritesSelect']",n.updateFavoriteFloorUrl=n.buildControllerUrl("FavoriteFloors","UpdatePersonalFavorites"),n}return __extends(r,i),r.initialise=function(n,t){var i=this;this.instance==null&&(this.instance=new r);jQuery(n).off("click",this.instance.addToFavoritesSelector).on("click",this.instance.addToFavoritesSelector,function(n){return i.instance.updateFavorites(n,t)});return this.instance},r.prototype.updateFavorites=function(n,t){var r=this,i=jQuery(n.currentTarget).closest("["+this.floorIdAttribute+"]"),u=i.attr(this.floorIdAttribute),f=i.attr(this.erpIdAttribute),e=i.attr(this.erpProductIdAttribute);n.preventDefault();this.updateFavoriteFloor(u,f,e).done(function(n){n.succeed&&(jQuery(document).trigger("likes-changed",n.totalFavoriteFloors),n.isFavoriteFloor&&r.tagManager.registerEvent("jsfavoritefloors",i.data("event-action"),i.data("event-label"),null,"PersonalFavoriteAdded"),t?r.updateB2CIcon(n,i):r.updateNonB2CIcon(n,i))})},r.prototype.updateFavoriteFloor=function(n,i,r){var u=jQuery.Deferred();return jQuery.ajax({url:this.updateFavoriteFloorUrl,method:"GET",cache:!1,data:{floorId:n,erpId:i,erpProductId:r},success:function(n){var i=t.FlooringHelpers.getJsonScript(n);u.resolve(i)}}),u.promise()},r.prototype.updateNonB2CIcon=function(n,t){n.isFavoriteFloor?t.addClass(this.favoriteSelectedCssClass):t.removeClass(this.favoriteSelectedCssClass)},r.prototype.updateB2CIcon=function(t,i){var u="c-svg--ghost",e=i.find('[data-selector="favorite-icon"]'),r=i.find('[data-selector="favorite-label"]'),f=i.parents('[data-selector="product-card"]').find('[data-selector="tiny-heart-icon"]');e.children("path").each(function(i,e){t.isFavoriteFloor?(r.html(r.data("unfavorite")),f.show(),n.Unilin.SvgHelpers.removeClassFromSvg(e,u)):(r.html(r.data("favorite")),f.hide(),n.Unilin.SvgHelpers.addClassFromSvg(e,u))})},r}(t.FlooringBase);t.FavoriteFloorsManager=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(t){var i;(function(t){var i=function(){function t(){var i=this,t;this.containerId="faFrame";this.isLoaded=!1;this.tagManager=n.ScBase.Unilin.GTM.getInstance();t=jQuery("#"+this.containerId);this.faContainer=t.length?t:this.render();this.faContainer.on("click",'[data-selector="close-fa-overlay"]',function(){return i.faContainer.hide()})}return t.getInstance=function(){return t.instance==null&&(t.instance=new t),t.instance},t.prototype.render=function(){var n=document.createElement("div"),t;return n.id=this.containerId,n.className="overlay",n.innerHTML='<div class="overlay__close" data-selector="close-fa-overlay"><i>Â<\/i><\/div><div class="overlay__cnt"><iframe class="fa-frame" data-link="" data-selector="faFrame"><\/iframe><\/div>',t=document.querySelector("body"),t.appendChild(n),jQuery(n)},t.generateLink=function(n){var t,i,r;return!n.materialList||n.materialList.length<1?n.baseUrl:(t=new RegExp(/MaterialList=([^&]*)/i),i=n.baseUrl.match(t),i&&i.length)?(r=n.materialList.length>0?n.materialList.join(","):"",n.baseUrl.replace(t,"MaterialList="+r)):n.baseUrl},t.prototype.openFloorAdvisor=function(n,t){var u=this,i=n.attr("data-fa-url"),f=n.attr("data-context-id"),r;i||Error("Couldn't load floor advisor, because no url was provided!");f===this.currentContext&&this.isLoaded&&i===this.url?this.faContainer.show():(this.currentContext=f,r=this.faContainer.find("iframe").get(0),r.src=i,r.onload=function(){u.isLoaded=!0;u.faContainer.show()},this.url=i);this.tagManager.registerEvent(t,"Roomviewer")},t}();t.FloorAdvisorManager=i})(i=t.Flooring||(t.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(){function n(){}return n}(),r,u,f,e;i.FloorTypeRange="FloorTypeRange";t.Constants=i;r=function(){function t(t,i){var r=this;this.params=t;this.floorLister=i;this.initialRendering=!0;this.updateLister=function(t,i,u){i===undefined&&(i=!0);r.initialRendering||jQuery.ajax({type:"POST",url:r.params.listUpdateUrl,data:t,success:function(t){var e;if(t){if(u?u(t):jQuery("#product-list").html(t),e=n.FlooringHelpers.getJsonScript(t),e&&e.floorAdvisorLink&&r.floorAdvisor.updateFloorAdvisorLink(e.floorAdvisorLink,!0),history.pushState&&i){var o=jQuery("#currentQuery").val(),f=window.location.toString(),s=f.indexOf("?");s>-1&&(f=f.substr(0,s));o=n.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(o,r.params.knownQueryStrings);f=f+"?"+o;history.pushState(o,null,f)}r.floorLister.gridManager.reload()}}})};this.updateSorting=function(){var n={currentQuery:jQuery("#currentQuery").val(),sort:r.floorLister.$sortSelectBox.val()};r.updateLister(n,!0)};this.updating=!0;this.facetMap=new u(this,t.splitOn);this.facetMap.update(t.facetMap,null);this.updating=!1;this.totalCount=ko.observable(t.totalCount);this.floorAdvisor=new n.FloorAdvisorLinkUpdatable(t.floorAdvisorLink)}return t.prototype.facetMapAndListUpdate=function(n,t,i,r,u){this.bulkFacetMapAndListUpdate(n,[t],i,r,u)},t.prototype.bulkFacetMapAndListUpdate=function(n,r,u,f,e){var c,s,l,o,h;if(this.updating=!0,e==undefined&&(e=!0),f==null&&(f=jQuery("#currentQuery").val()),u===""&&(u=" "),r.length>0){for(c=[],s=0,l=r;s<l.length;s++)o=l[s],h=n?n.name:null,t.isFloorTypeRange(h)&&(h=i.FloorTypeRange),c.push({currentQuery:f,facet:h,facetValue:o?o.key:null,selectFacetValue:o?o.selected():!1,searchText:u});this.doAjaxRequest(n,e,c)}},t.isFloorTypeRange=function(n){if(!n)return!1;var t=n.toUpperCase().match("("+i.FloorTypeRange.toUpperCase()+")_(.*)");return t&&t.length>=2},t.prototype.doAjaxRequest=function(t,i,r){var u=this,f=!(r.length&&r.length===1);jQuery.ajax({type:"POST",url:f?this.params.bulkUpdateUrl:this.params.updateUrl,data:JSON.stringify(f?r:r[0]),contentType:"application/json; charset=utf-8"}).done(function(r){var s,e;if(jQuery("#product-list")[0].innerHTML=r,s=jQuery('#product-list script[type="json"]')[0].innerHTML,e=jQuery.parseJSON(s),u.floorAdvisor.updateFloorAdvisorLink(e.floorAdvisorLink),u.facetMap.update(e.facetMap,t),u.totalCount(e.totalCount),history.pushState&&i){var o=jQuery("#currentQuery").val(),f=window.location.toString(),h=f.indexOf("?");h>-1&&(f=f.substr(0,h));o=n.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(o,u.params.knownQueryStrings);f=f+"?"+o;history.pushState(o,null,f)}u.updating=!1;u.floorLister.gridManager.reload();u.initialRendering=!1})},t}();t.ComponentVm=r;u=function(){function n(n,t){var r=this,i;this.component=n;this.splitOn=t;i=decodeURIComponent(window.location.href).match(/search\((.*?)\)/i);this.facets=[];this.searchText=ko.observable(i?i[1]:"");this.filtersVisible=ko.observable(jQuery("#search-button").is(":visible"));this.filtersList=ko.pureComputed(function(){return r.facets.map(function(n){return n.facetValues().filter(function(n){return n.selected()})}).reduce(function(n,t){return n.concat(t)})})}return n.prototype.update=function(n,t){var u,e,s,h,c,o,i;for(this.facetMap=n,u=this.facets,i=0;i<n.facets.length;i++){for(e=null,s=0;s<this.facets.length;s++)this.facets[s].facet.name.toUpperCase()===n.facets[i].name.toUpperCase()&&(e=this.facets[s]);e?e.update(n.facets[i]):(e=new f(this.component,this,n.facets[i],this.splitOn),this.facets.push(e));u=u.filter(function(n){return n!==e})}for(h=0,c=u;h<c.length;h++)o=c[h],r.isFloorTypeRange(o.facet.name)&&o.update({name:o.facet.name,description:o.facet.description,displayName:o.facet.displayName,valueCount:0,values:[]});for(i=0;i<u.length;i++)u[i].facet!==t&&u[i].readonlyWhenSelected()},n.prototype.getFacetVm=function(n){var t=this.facets.filter(function(t){return t.facet.name.toUpperCase()===n.toUpperCase()});return t&&t.length?t[0]:null},n.prototype.getBitFacetVm=function(n){var t=this.facets.filter(function(t){return t.facet.name.toUpperCase()===n.toUpperCase()&&t.getBitTrueFacetValue()!=null});return t&&t.length?t[0]:null},n.prototype.textSearch=function(n,t,i){return(i===void 0&&(i=!1),this.component.updating)?!1:t.keyCode===13||i?(this.component.facetMapAndListUpdate(null,null,this.searchText(),null,null),!1):!0},n.prototype.clickTextSearch=function(){return this.component.updating?!1:(this.component.facetMapAndListUpdate(null,null,this.searchText(),null,null),!1)},n.prototype.showFilters=function(){this.filtersVisible(!0)},n.prototype.hideFilters=function(){this.filtersVisible(!1)},n.prototype.reset=function(){return this.facets.forEach(function(n){return n.reset()}),!1},n}();t.FacetMapVm=u;f=function(){function n(n,t,i,r){var u=this;this.component=n;this.facetMapVm=t;this.facet=i;this.splitOn=r;this.facetValues=ko.observableArray([]);this.readonlyText=ko.observable();this.selectedValue=ko.observable();this.selectedValue.subscribe(function(n){return u.singleSelectToggle(n)});this.displayName=i.displayName||i.name;this.update(i);this.initComputed()}return n.prototype.initComputed=function(){var n=this;this.filteredFacetValues=ko.observableArray(this.facetValues().filter(function(n){return n.displayName&&n.displayName.length>0&&!n.hidden}));this.columnsCount=ko.pureComputed(function(){return new Array(Math.ceil(n.filteredFacetValues().length/n.splitOn))});this.facetValuesColumns=function(t){return ko.pureComputed(function(){return n.filteredFacetValues.slice(t*n.splitOn,t*n.splitOn+n.splitOn)})};this.facetEnabled=ko.pureComputed(function(){return n.facetValues().filter(function(n){return n.enabled()}).length>0});this.facetSelected=ko.pureComputed(function(){var t=n.facetValues().filter(function(n){return n.selected()}).length,i=n.facetValues().filter(function(n){return!n.enabled()}).length;return t===n.facetValues().length-i&&t>0});this.isFloorTypeRange=ko.pureComputed(function(){return r.isFloorTypeRange(n.facet.name)})},n.prototype.update=function(n){for(var i,r,f,u=this.facetValues(),t=0;t<n.values.length;t++){for(i=null,r=0;r<this.facetValues().length;r++)this.facetValues()[r].key.toUpperCase()===n.values[t].key.toUpperCase()&&(i=this.facetValues()[r]);i?i.update(n.values[t],n):(i=new e(this.component,n,n.values[t]),f=this.facetValues().length-(u.length+t),this.facetValues.splice(t-f,0,i));u=u.filter(function(n){return n!==i})}u.forEach(function(n){return n.resetCounter()});this.readonlyText(null)},n.prototype.singleSelectToggle=function(n){if(!this.component.updating){this.component.updating=!0;for(var t=0;t<this.facetValues().length;t++)this.facetValues()[t]!==n&&this.facetValues()[t].selected(!1);this.component.updating=!1;n?n.selected(!0):this.reset()}},n.prototype.readonlyWhenSelected=function(){if(!this.readonlyText()&&this.facetValues().filter(function(n){return n.selected()}).length!==0){var n=this.facetValues().filter(function(n){return n.selected()}).map(function(n){return n.facetValue.displayName});n.length>0&&this.readonlyText(n.join(", "))}},n.prototype.reset=function(){this.component.updating||(this.component.updating=!0,this.facetValues().forEach(function(n){n.selected(!1)}),this.component.updating=!1,this.component.facetMapAndListUpdate(this.facet,null,null,null,null))},n.prototype.selectAll=function(n){this.component.updating||(this.component.updating=!0,this.facetValues().forEach(function(t){n?t.enabled()&&t.selected(!0):t.selected(!1)}),this.component.updating=!1,this.component.bulkFacetMapAndListUpdate(this.facet,this.facetValues(),null,null,null))},n.prototype.onSelectAll=function(){return this.facetSelected()?this.selectAll(!1):this.selectAll(!0),!0},n.prototype.getBitTrueFacetValue=function(){var n=this.facetValues().filter(function(n){return n.key==="1"});return n.length>0?n[0]:null},n}();t.FacetVm=f;e=function(){function n(n,t,i){var u=this,r;this.component=n;this.facet=t;this.facetValue=i;r=this;r.selected=ko.observable();r.count=ko.observable();r.update(i,t);r.selected.subscribe(function(n){return u.selectionChanged(n)});r.enabled=ko.computed(function(){return u.selected()||u.count()>0})}return n.prototype.selectionChanged=function(n){this.component.updating||(this.selected(n),this.component.facetMapAndListUpdate(this.facet,this,null,null,null))},n.prototype.update=function(n,t){this.id=t.name+n.key;this.key=n.key;this.displayName=n.displayName;this.selected(n.selected);this.count(n.count);this.description=n.description||"";this.hidden=n.hidden},n.prototype.resetCounter=function(){this.count(0)},n}();t.FacetValueVm=e})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function i(n){this.$element=n;this.initElements();this.initSliders()&&this.initEvents()}return i.prototype.initElements=function(){this.$galleryContainer=this.$element.find('[data-selector="gallery-container"]');this.$zoomButton=this.$element.find('[data-selector="slider-zoom"]');this.$notFoundImage=this.$element.find('[data-selector="not-found-image"]')},i.prototype.initEvents=function(){var n=this;this.$zoomButton.click(function(){var t=n.mainSlider.$slick.find(".slick-slide:not(.slick-cloned) a");window.slickFullscreen.open(t,{loadingPlaceholder:"/Components/Flooring/_Shared/Views/_FrontEnd/img/loading.gif",notFoundImage:n.$notFoundImage,slick:{lazyLoad:"ondemand",infinite:!1,asNavFor:n.mainSlider.$component.selector,initialSlide:n.mainSlider.getCurrentSlideIndex()}})});this.$element.find(this.mainSlider.$slick.selector).on("lazyLoaded lazyLoadError",function(){n.galleryVisible||(setTimeout(function(){n.$galleryContainer.show();n.mainSlider.$slick.slick("setPosition");n.thumbnailSlider.$slick.slick("setPosition")},500),n.galleryVisible=!0)})},i.prototype.initSliders=function(){var i='[data-selector="product-detail-slider"]',r='[data-selector="product-detail-thumbnails"]',u=this.$element.find(i);return u.length?(this.mainSlider=new n.Unilin.Slick(u,{notFoundImage:this.$notFoundImage,supportMobileImages:!0,adjustArrows:!0,adjustArrowsSelector:"img",speed:500,infinite:!0,lazyLoad:"ondemand",autoplay:!1,slidesToShow:1,adaptiveHeight:!1,dots:!1,arrows:!0,asNavFor:r,responsive:[{breakpoint:t.BreakPoints.md,settings:{slidesToShow:1,infinite:!1,arrows:!0,dots:!0}}]}),this.thumbnailSlider=new n.Unilin.Slick(this.$element.find(r),{notFoundImage:this.$notFoundImage,supportMobileImages:!0,adjustArrows:!1,speed:500,infinite:!0,lazyLoad:"anticipated",autoplay:!1,centerMode:!1,adaptiveHeight:!1,slidesToShow:5,slidesToScroll:5,asNavFor:i,dots:!1,arrows:!0,focusOnSelect:!0,touchMove:!1,swipeToSlide:!1,responsive:[{breakpoint:t.BreakPoints.md,settings:{slidesToShow:5,infinite:!1,arrows:!0}}]}),!0):(this.$galleryContainer.show(),!1)},i}();t.Gallery=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i;(function(i){var u=function(){function n(n,t){var i=this;this.$element=n;this.updateableComponent=t;this.updateIndex=function(n){return i.index=n.data("id")};this.updateLastClicked=function(n){return i.$lastClicked=n};this.selectedSelector="prd-lst__itm--select";this.animationSpeed=500}return n.prototype.init=function(n){return this.$grid=n?this.$element.find(n).find('[data-selector="grid-container"]').first():this.$element.find('[data-selector="grid-container"]').first(),this.$items=this.$grid.find(".prd-lst__itm"),this.initializeEvents(),this.preview=this.preview?this.preview:new r(this.animationSpeed,this.selectedSelector),t.BlazyImage.revalidate(),t.FavoriteFloorsManager.initialise(this.$element,!1),this.adjustTitleTextSize(),this},n.prototype.destroy=function(){return this.$grid.off(),this.$grid=null,this.$items=null,this},n.prototype.reload=function(n){return this.destroy().init(n)},n.prototype.addItems=function(n){this.$grid.find("div[data-selector='loadmore-result']").remove();var i=jQuery(n).appendTo(this.$grid),r=i.find(".prd-lst__itm");this.$items=this.$items.add(r);t.BlazyImage.revalidate()},n.prototype.initializeEvents=function(){var n=this;this.$grid.on("click",".prd-lst__itm",function(i){var u=jQuery(i.target),r;if(u.data("selector")==="favoritesSelect"){i.preventDefault();return}n.$lastClicked&&n.$lastClicked.removeClass(n.selectedSelector);r=u.closest(".prd-lst__itm");t.FlooringHelpers.openFlyoutOrRedirectToDetailPage(i,function(){n.index===r.data("id")?n.hidePreview():n.loadPreview(r)});n.updateLastClicked(r)});this.$grid.on("inview",'div[data-selector="load-more"]',function(t){return n.triggerLoadMore(t)})},n.prototype.adjustTitleTextSize=function(){jQuery(document).width()<768&&jQuery(".prd-lst__itm__ttl").each(function(n,t){var i=jQuery(t).text(),r=i.length;r>=35&&jQuery(t).text(i.substr(0,35)+"...")})},n.prototype.hidePreview=function(){this.index="";this.preview.close()},n.prototype.loadPreview=function(n){var t=this,i=n.offset().top,r=this.$lastClicked?this.$lastClicked.offset().top:0;if(this.preview.isExpanded){if(r===i){this.updateIndex(n);this.preview.update(n);return}this.preview.close(function(){t.updateIndex(n);t.preview.open(n)})}else this.updateIndex(n),this.preview.open(n)},n.prototype.triggerLoadMore=function(n){var i=this,r=jQuery(n.target),t;r.attr("data-selector")==="load-more"&&(r.attr("data-selector","load-more-result"),t=+jQuery("#pageNumber").val()+1,this.updateableComponent.updateLister({currentQuery:jQuery("#currentQuery").val(),pageNumber:t},!1,function(n){jQuery("#pageNumber").val(t);i.addItems(n);i.reload()}))},n}(),r;i.ProductGridManager=u;r=function(){function i(n,t){this.animationSpeed=n;this.selectedSelector=t;this.container=jQuery("<div class='col-xs-12'><div class='row' style='position:relative;'><div class='col-xs-12 prd-det' data-selector='preview-container'><\/div><\/div><\/div>");this.isExpanded=!1}return i.prototype.open=function(i){var r=this;this.setContent(i);this.injectDetailContainer(i);n.Unilin.UnilinHelpers.scrollTo(i.offset().top+i.height()/2,this.animationSpeed,function(){return r.isExpanded=!0});t.BlazyImage.revalidate()},i.prototype.update=function(n){this.setContent(n);t.BlazyImage.revalidate()},i.prototype.close=function(n){this.isExpanded=!1;this.container.remove();n&&n()},i.prototype.setContent=function(n){n.addClass(this.selectedSelector);var t=n.find('div[data-selector="container-html"]').first();t.length>0&&this.container.children().first().children().first().html(t.html())},i.prototype.injectDetailContainer=function(n){var t=this,r=n.offset().top,i=n.parent().siblings().length;i>0?n.parent().siblings().each(function(u,f){var e=jQuery(f).offset().top;if(e>r)return jQuery(f).prev().after(t.container),!1;u===i-1&&n.parent().parent().children().last().after(t.container)}):n.parent().after(this.container)},i}();i.ProductDetailContainer=r})(i=t.Commerce||(t.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var u=n.Unilin.Toast,i,r;(function(n){n[n.Added=0]="Added";n[n.NotAddedBecauseContainsSamples=1]="NotAddedBecauseContainsSamples";n[n.NotAddedBecauseContainsNonSamples=2]="NotAddedBecauseContainsNonSamples";n[n.NotAddedUnknowReason=3]="NotAddedUnknowReason";n[n.NotAddedBecauseOnlySamples=4]="NotAddedBecauseOnlySamples"})(i=t.AddToBasketResult||(t.AddToBasketResult={}));r=function(n){function r(t){var i=n.call(this,t)||this;return i.element=t,i}return __extends(r,n),r.triggerCartChanged=function(n){n!=null&&jQuery(document).trigger("shopping-cart-changed",n)},r.prototype.cartChanged=function(n){r.triggerCartChanged(n)},r.prototype.addB2CSample=function(n){var t={erpId:n.data("sample-erpid"),materialCode:n.data("sample-materialcode"),unit:n.data("order-unit"),displayUnit:n.data("display-unit"),quantity:1,showMessageOnSuccess:!0,succeed:!0},i=this.getGtmDataForProduct(n);return this.addSample(t,i)},r.prototype.addSample=function(n,t){var i=this;return this.addToCart("AddSample",n,t,jQuery.proxy(function(n){return i.addSample(n,t)},this))},r.prototype.addB2CMaterial=function(n,t){t===void 0&&(t=null);var r={erpId:n.data("erpid"),materialCode:n.data("materialcode"),unit:n.data("order-unit"),displayUnit:n.data("display-unit"),quantity:t!=null?t:1,showMessageOnSuccess:!0,succeed:!1},i=this.getGtmDataForProduct(n);return t&&(i.productData.quantity=t),this.addMaterial(r,i)},r.prototype.addMaterial=function(n,t){var i=this;return this.addToCart("AddMaterial",n,t,jQuery.proxy(function(n){return i.addMaterial(n,t)},this))},r.prototype.addToCart=function(n,i,u,f){var o=this,e;return i==null?null:(e=jQuery.Deferred(),jQuery.ajax({url:this.buildControllerUrl(r.shoppingCartController,n),method:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify(i),success:function(n){return o.onAddToCartSuccess(n,u,e,f)},error:function(n){return e.reject(n)},complete:function(){return t.FlooringHelpers.hideWaitPanel()}}),e.promise())},r.prototype.onAddToCartSuccess=function(n,r,f,e){var o,s,h;if(!n){f.reject(n);return}o=t.FlooringHelpers.getJsonScript(n);o&&(s=function(){},h=function(n,t){return t.destroy()},o.succeed?(this.cartChanged(o.totalItems),r&&this.tagManager.registerAddToCart("added-to-cart",r.currencyCode,[r.productData])):(o.cause===i.NotAddedBecauseContainsNonSamples||o.cause===i.NotAddedBecauseContainsSamples)&&(s=function(n,i){var r=o;r.clearBasket=!0;e(r);t.FlooringHelpers.showFullScreenWaitPanel(!0);i.destroy()}),this.toast=u.update(this.toast,n,{primaryCallback:s,secondaryCallback:h}),f.resolve(o))},r.prototype.getQuantityFromTotalSize=function(n){var f,r;if(!n)return-1;var u=n.data("value-old"),e=t.FlooringHelpers.getFloatValue(u),o=n.val(),i=t.FlooringHelpers.getFloatValue(o);return i===e||isNaN(i)||i<=0?(n.val(u),-1):(f=n.data("packed-size"),r=t.FlooringHelpers.getFloatValue(f),isNaN(r)||r<=0)?(n.val(u),-1):Math.ceil(+i/+r)},r.prototype.getGtmDataForProduct=function(n){var t=parseInt(n.data("quantity")),i={id:n.data("commercialcode"),name:n.data("commercialname"),price:n.data("price"),brand:n.data("brand"),category:n.data("category"),dimension1:n.data("floortype"),dimension2:n.data("rangecode"),variant:"",quantity:t?t:1};return{productData:i,currencyCode:n.data("currency")}},r.prototype.getQuantity=function(n,i){if(i===void 0&&(i=!1),!n)return-1;var u=n.data("value-old"),f=t.FlooringHelpers.getFloatValue(u),e=n.val(),r=Math.round(t.FlooringHelpers.getFloatValue(e));return r===f||isNaN(r)||r<=0?(n.val(u),-1):r},r}(t.FlooringBase);r.shoppingCartController="ShoppingCartApi";t.ShoppingCartManager=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function i(i){var r=n.call(this,i,"jsBucketedAccessoryLister")||this;return r.$element=i,r.gridManager=new t.ProductGridManager(r.$element,null).init(),r}return __extends(i,n),i}(n.ComponentWithProductActions);t.AccessoryLister=i})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function t(i){this.$element=i;i.find(t.anchorBarElement).each(function(t,i){var r=jQuery(i),u=r.attr("href"),f=jQuery(u);if(f.length){r.show();r.on("click",function(t){return t.preventDefault(),n.Unilin.UnilinHelpers.scrollTo(f.offset().top,"linear",function(){window.location.hash=u}),!1})}else r.remove()});jQuery(window).load(function(){return t.refresh()})}return t.removeUnexisting=function(){jQuery(t.anchorBarElement).each(function(n,t){var i=jQuery(t);jQuery(i.attr("href")).length||i.remove()})},t.refresh=function(t){t||(t=jQuery(document));var i=t.find(window.location.hash);i.length&&n.Unilin.UnilinHelpers.scrollTo(i.offset().top,"linear")},t}();i.anchorBarElement="[data-selector='anchorbar-element']";t.AnchorBar=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i){var r=n.call(this,t,"jsarticlearchive")||this;return r.$element=t,r.params=i,r.initElements(),r.initEvents(),r.mergeRows(),r}return __extends(t,n),t.prototype.initElements=function(){this.$container=this.$element.find("[data-selector=archive-container]");this.currentPage=1;this.lastPublicationYear=this.params.lastPublicationYear},t.prototype.initEvents=function(){var n=this;this.$element.on("inview","div[data-selector=load-more]",function(t,i){return n.loadMore(t,i)})},t.prototype.loadMore=function(){var n=this;jQuery.ajax({url:this.params.loadMoreUrl,type:"POST",data:{CategoryIds:this.params.categoryIds,CurrentPage:++this.currentPage,LastPublicationYear:this.lastPublicationYear},success:function(t){n.onSearchUpdateReceived(t)}})},t.prototype.onSearchUpdateReceived=function(n){if(n){var t=JSON.parse(jQuery(n).filter("script[type=json]")[0].innerHTML);this.$container.find("div[data-selector=load-more]").remove();this.$container.append(n);this.mergeRows();this.lastPublicationYear=t.lastPublicationYear}},t.prototype.mergeRows=function(){for(var u,t,i=this,r=jQuery("[data-selector=years]"),n=0;n<r.length-1;++n)u=jQuery(r[n]),t=jQuery(r[n+1]),u.data("year")===t.data("year")&&(u.append(t.children()),t.remove());jQuery("[data-selector=years]").each(function(n,t){for(var f,c=jQuery(t),e=c.find("[data-selector=article-row]"),r=0;r<e.length-1;++r){var o=jQuery(e[r]),s=o.children(),h=s.length%i.params.columns;if(h!==0&&o.length!==i.params.columns){var u=jQuery(e[r+1]),l=u.children(),a=Math.min(h,i.params.columns-s.length);for(f=0;f<a;++f)o.append(jQuery(l[f]));u.children().length||(u.next(".art-list__divider").remove(),u.remove())}}})},t}(n.FlooringBase);n.ArticleArchive=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n,r){var u=i.call(this,n,"jsArticleOverview")||this;return u.historySupport=function(){return!!(history&&history.replaceState)},u.queryString=function(){return u.$tagSelection.get(0).selectize.items.join(",")},u.updateUrl=r.updateUrl,u.knownQueryStrings=r.knownQueryStrings,u.$articlesGrid=u.$component.find('[data-selector="articles"]'),u.$tagSelection=u.$component.find('[data-selector="tag-filter"]').selectize({plugins:["remove_button"],onChange:function(){return u.filterArticles()}}),u.historySupport()&&(history.replaceState(t.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(u.queryString(),u.knownQueryStrings),document.title+" "),window.onpopstate=function(n){return u.popHistoryState(n)}),u}return __extends(r,i),r.prototype.filterArticles=function(){var i=this;t.FlooringHelpers.showFullScreenWaitPanel();this.$http.post(this.updateUrl,{queryString:this.queryString()}).always(function(){return t.FlooringHelpers.hideWaitPanel()}).done(function(t){i.$articlesGrid.get(0).innerHTML=t;i.changeHistoryState();n.Flooring.BlazyImage.revalidate()})},r.prototype.popHistoryState=function(n){this.historySupport()&&(this.popState=!0,n.state?this.$tagSelection.get(0).selectize.setValue(n.state.split(","),!1):(this.$tagSelection.get(0).selectize.clear(!1),this.filterArticles()))},r.prototype.changeHistoryState=function(){if(this.historySupport()){if(!this.popState){var i=this.queryString(),n=window.location.toString(),r=n.indexOf("?");r>-1&&(n=n.substr(0,r));i=t.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(i,this.knownQueryStrings);i&&(n=n+"?tags="+i);history.pushState(i,document.title+" ",n)}this.popState=!1}},r}(t.FlooringBase);t.ArticleOverview=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function t(t){var i=this;this.$element=t;this.$faButton=this.$element.find('[data-selector="fa-container"]');this.$faButton.on("click",function(){return n.FloorAdvisorManager.getInstance().openFloorAdvisor(i.$faButton,"jsFloorAdvisorCta")})}return t}();n.B2CFloorInfoCarousel=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(i){var r=t.call(this,i,"jsFloorInfoCarousel-CtaBar")||this;return r.$element=i,n.FavoriteFloorsManager.initialise(i,!0),r}return __extends(i,t),i}(n.ComponentWithProductActions);n.CtaBar=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this,t)||this;return i.$element=t,i}return __extends(t,n),t}(n.ComponentWithProductActions);n.SampleInfo=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(r,u){var f=i.call(this,r)||this;return f.$element=r,f.params=u,f.onChangeQualityLevel=function(n){if(f.qualityLevelsSelectize){var t=f.qualityLevelsSelectize.options;t.hasOwnProperty(n)&&(window.location.href=t[n].data)}},f.$qualityLevelsContainer=f.$element.find('[data-selector="quality-levels-container"]'),f.$availableInVariantsText=f.$element.find('[data-selector="available-in-variants-text"]'),f.$variantsCount=f.$availableInVariantsText.find('[data-selector="variants-count"]'),f.$qualityLevelsContainer.length?f.$http.post(f.params.loadQualityLevels,null).done(function(n){if(n&&n.length>0){f.$qualityLevelsContainer.html(n);var i=f.$qualityLevelsContainer.find("[data-key=QualityLevel]").first();i.length&&(f.qualityLevelsSelectize=t.Shared.Selectize.initialize(i,{onChange:f.onChangeQualityLevel}))}else f.$qualityLevelsContainer.hide()}):f.$availableInVariantsText.length&&f.$http.post(f.params.loadVariantsCountUrl,null).done(function(t){if(t){f.$variantsCount.text(t);f.$availableInVariantsText.fadeIn(200);f.$element.on("click",f.$availableInVariantsText.selector+" a",function(t){t.preventDefault();var i=jQuery(jQuery(t.currentTarget).attr("href"));n.Unilin.UnilinHelpers.scrollTo(i.offset().top,"linear",function(){return window.location.hash=i[0].id})})}}),f}return __extends(r,i),r}(n.Unilin.BaseComponent);t.Variants=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(n,i){var r=t.call(this,n,"jsFloorFacetSearch")||this;return r.$element=n,r.params=i,r.initProperties(),r.initEvents(),r.adjustFacetMapToScreenSize(),r.initBindingHandlers(),r.viewModel.updating=!0,ko.applyBindings(r.viewModel,n[0]),r.viewModel.updating=!1,r}return __extends(i,t),i.prototype.initProperties=function(){var r=[],t,i;(this.params.floorTypes&&(r=this.params.floorTypes.map(function(n){return{code:n.code.toLowerCase(),materialGroupName:n.materialGroupName}})),this.viewModel=new n.ComponentVm(this.params.query,this.params.facetMap,this.params.totalCount,this.params.updateUrl,this.params.bulkUpdateUrl,r,this.params.showMoreCount,this.params.knownQueryStrings),this.$facetMap=this.$element.find('[data-selector="facet-map"]'),this.$sortBox=this.$element.find('[data-selector="sort-box"]'),this.$desktopFacetContainer=this.$element.find('[data-selector="desktop-facet-map"]'),this.$mobileFacetContainer=this.$element.find('[data-selector="mobile-facet-map"]'),this.$desktopSortContainer=this.$element.find('[data-selector="desktop-sort-container"]'),this.$mobileSortContainer=this.$element.find('[data-selector="mobile-sort-container"]'),t=this.$sortBox.find("select"),t.length<1)||(t.selectize(),i=this.$component.find("#"+t.get(0).id+"-selectized"),i.length>0&&(i.get(0).readOnly=!0))},i.prototype.initEvents=function(){var t=this;jQuery(document).on("click","[data-loadmore-nextpage][data-loadmore-pagesize]",function(n){var i={currentQuery:jQuery("#currentQuery").val(),pageNumber:jQuery(n.currentTarget).data("loadmore-nextpage"),pageSize:jQuery(n.currentTarget).data("loadmore-pagesize"),totalPageGap:jQuery(n.currentTarget).data("loadmore-totalpagegap")};t.$http.post(t.params.loadMoreUrl,i).done(function(n){t.$element.find("[data-webid=pagination-block]").replaceWith(n);t.viewModel.updateHistory(!0,!0,"#loadMoreQuery");t.viewModel.revalidateImages()});n.preventDefault()});window.onpopstate=function(n){if(t.viewModel.initialRendering===!1){var i=n.state;i==null&&(i=decodeURI(location.search));t.viewModel.facetMapAndListUpdate(null,null,null,i,!1)}};jQuery(window).on("resize",function(){return t.adjustFacetMapToScreenSize()});n.FavoriteFloorsManager.initialise(this.$element,!0)},i.prototype.initBindingHandlers=function(){ko.bindingHandlers.slowVisible={init:function(n,t){var i=jQuery(n);i.toggle(ko.unwrap(t()))},update:function(n,t){var i=jQuery(n);ko.unwrap(t())?i.show("slow"):i.hide()}};ko.bindingHandlers.numericInput={init:function(n,t,i,r){ko.bindingHandlers.textInput.init(n,t,i,r)},update:function(n,t){var i=ko.unwrap(t());t()(i.replace(/\D/g,""))}}},i.prototype.adjustFacetMapToScreenSize=function(){window.matchMedia("(max-width: "+n.BreakPoints.md+"px)").matches?(this.isMobile===undefined||this.isMobile===!1)&&(this.$mobileFacetContainer.prepend(this.$facetMap),this.$mobileSortContainer.prepend(this.$sortBox),this.isMobile=!0,this.viewModel.setCollapseState(!0)):(this.isMobile===undefined||this.isMobile===!0)&&(this.$desktopFacetContainer.prepend(this.$facetMap),this.$desktopSortContainer.prepend(this.$sortBox),this.isMobile=!1,this.viewModel.resetCollapseState())},i}(n.ComponentWithProductActions);n.B2CFloorLister=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var i;(function(i){var f=n.ScBase.Unilin.BaseComponent,e=t.Unilin.UnilinHelpers,u=t.Unilin.BlazyImageBase,r=t.Unilin.Toast,o=function(f){function o(n,t){var r=f.call(this,n)||this,u;return r.parameters=t,r.bindEvents(),r.ShoppingCartManager=new i.ShoppingCartManager(r.$component),r.initPopovers(),r.initAbandonCart(),u=new i.QuantityCalculator(r.$component,!1,function(n,t,i){return r.updateQuantity(n,t,i)}),r}return __extends(o,f),o.prototype.initPopovers=function(){t.Unilin.UnilinHelpers.initializePopovers(this.$component)},o.prototype.bindEvents=function(){var n=this;jQuery(this.$component).on("click","[data-selector='remove-from-cart']",function(t){return n.removeFromShoppingCart(t)});jQuery(this.$component).on("click","[data-selector='add-to-cart-trigger']",function(t){return n.onAddToCartTriggered(t)});jQuery(this.$component).on("click","[data-selector='voucher-popup']",function(t){var i=jQuery(t.currentTarget);n.createPopover(i);i.popover("toggle")});jQuery(this.$component).on("click","[data-selector='checkout']",function(t){return n.checkout(t)});jQuery(document).on("click","[data-selector='remove-voucher']",function(t){return n.removeVoucher(t)});jQuery(document).on("click","[data-selector='add-voucher']",function(t){return n.addVoucher(t)})},o.prototype.createPopover=function(n){n.popover({container:"body",html:!0,template:'<div class="popover c-popover u-bg-color-gray-light"><div class="arrow c-popover__arrow"><\/div><div class="c-popover-inner"> <div class="popover-title c-popover__title"><\/div><div class="popover-content c-popover__content"><\/div><\/div><\/div>',trigger:"manual",content:function(){return jQuery("#popover-content-promocode").html()}})},o.prototype.hidePopover=function(n){jQuery(n.target).closest(".popover").popover("hide")},o.prototype.initAbandonCart=function(){var n=this,t=this.$component.find("[data-selector='abandon-cart-warning']");t.length<=0||(i.FlooringHelpers.showFullScreenWaitPanel(!1),r.show(t.html(),{level:r.LEVEL_WARNING,zindex:r.HIGH_ZINDEX,timeout:0,primaryCallback:function(t,i){return n.abandonCart(t,i)},secondaryCallback:function(){return n.keepCurrentCart()}}))},o.prototype.keepCurrentCart=function(){i.FlooringHelpers.hideWaitPanel();this.updateUrlWithoutQueryString()},o.prototype.abandonCart=function(n,t){var r=this,f,u;(i.FlooringHelpers.hideWaitPanel(),n.preventDefault(),f=window.location.href,u=e.getQueryParameterByName(this.parameters.cartQueryParameterName,f),u)&&(i.FlooringHelpers.showFullScreenWaitPanel(!0),this.$http.post(this.parameters.abandonCartUrl,{cartId:u}).done(function(n){var i=r.handleResult(n);i.success&&r.ShoppingCartManager.cartChanged(i.totalCount);t.destroy()}).always(function(){i.FlooringHelpers.hideWaitPanel();r.updateUrlWithoutQueryString()}))},o.prototype.updateUrlWithoutQueryString=function(){var n=window.location.href.split("?")[0];history.replaceState?window.history.replaceState({path:n},document.title,n):window.location.href=n},o.prototype.checkout=function(t){t.preventDefault();i.FlooringHelpers.showFullScreenWaitPanel();this.$http.get(this.parameters.checkoutUrl,null).done(function(t){var u=t;!u.success||u.url.length<=0?(r.show(t.html),i.FlooringHelpers.hideWaitPanel()):(n.ScBase.Unilin.GTM.getInstance().registerVirtualPageview("/ShoppingCart/step2","ShoppingCart Step 2 – ToHybrisCart"),window.location.href=u.url)})},o.prototype.removeVoucher=function(n){var r=this,u=jQuery(n.currentTarget),t;u.length<=0||(t=u.data("code"),!t||t.length<=0)||(i.FlooringHelpers.showFullScreenWaitPanel(),this.$http.get(this.parameters.removeVoucher,{voucherCode:t}).done(function(t){r.hidePopover(n.originalEvent);r.handleResult(t)}))},o.prototype.addVoucher=function(n){var t=this,f=jQuery(n.currentTarget),r,u;f.length<=0||(r=f.prev("[data-selector='voucher-code']"),r.length<=0)||(u=r.val(),u.length<=0)||(i.FlooringHelpers.showFullScreenWaitPanel(),this.$http.get(this.parameters.addVoucher,{voucherCode:u}).done(function(i){t.hidePopover(n.originalEvent);t.handleResult(i);t.initPopovers()}))},o.prototype.updateQuantity=function(n,t,r){var u=this,f=t.parents("[data-selector='line']").attr("id"),e;!f||f.length<=0||(e=t.val()-parseInt(t.attr("data-value-old")),i.FlooringHelpers.showFullScreenWaitPanel(),this.$http.get(this.parameters.updateQuantity,{lineId:f,quantity:r}).done(function(n){var f=u.handleResult(n),r,i;f.success&&(u.ShoppingCartManager.cartChanged(f.totalCount),r=t.parents("[data-selector='line']").find("[data-selector='remove-from-cart']"),r.length>0&&(i=u.ShoppingCartManager.getGtmDataForProduct(r),i&&(i.productData.quantity=Math.abs(e),e<0?u.ShoppingCartManager.tagManager.registerRemoveFromCart("removeFromCart",i.currencyCode,[i.productData]):u.ShoppingCartManager.tagManager.registerAddToCart("added-to-cart",i.currencyCode,[i.productData]))))}))},o.prototype.removeFromShoppingCart=function(n){var t=this,r=jQuery(n.currentTarget),u,f;r.length<=0||(u=r.parents("[data-selector='line']").attr("id"),!u||u.length<=0)||(f=r.parents("[data-selector='line']").find("[data-selector='quantity']").attr("value"),i.FlooringHelpers.showFullScreenWaitPanel(),this.$http.get(this.parameters.removeFromCartUrl,{lineId:u}).done(function(n){var u=t.handleResult(n),i;u.success&&(t.ShoppingCartManager.cartChanged(u.totalCount),i=t.ShoppingCartManager.getGtmDataForProduct(r),i&&(i.productData.quantity=parseInt(f),t.ShoppingCartManager.tagManager.registerRemoveFromCart("removeFromCart",i.currencyCode,[i.productData])))}))},o.prototype.handleResult=function(n){var t=n.json;if(t.success){var f=this.$component.html(n.html).find(u.dataSelector),o=f.length,e=0;f.one("load",function(){e+1>=o&&u.revalidate();e++})}else r.show(n.html);return i.FlooringHelpers.hideWaitPanel(),n.json.hasWarning&&this.showCartWarning(),t},o.prototype.onAddToCartTriggered=function(n){n.preventDefault();var t=jQuery(n.currentTarget);i.FlooringHelpers.showFullScreenWaitPanel();this.ShoppingCartManager.addB2CMaterial(t).done(function(n){if(n.succeed){window.location.reload(!0);return}i.FlooringHelpers.hideWaitPanel()})},o.prototype.showCartWarning=function(){var n=this.$component.find("[data-selector='cart-warning']");n.length<=0||r.show(n.html(),{level:r.LEVEL_WARNING})},o}(f);i.B2CShoppingCart=o})(i=t.Flooring||(t.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(n){function t(t){var i=n.call(this)||this;return i.fallbackImageHtml=t,i}return __extends(t,n),t.prototype.onBlazyError=function(n,t){if(this.fallbackImageHtml&&(t==="invalid"||t==="missing")){var i=jQuery(n),r=i.parents(".c-card__img").length<=0,u=""+(r?'<div class="c-card__img"><div class="o-mask">':"")+this.fallbackImageHtml+(r?"<\/div><\/div>":"");i.replaceWith(u)}},t}(n.Unilin.BlazyImageBase);t.BlazyImage=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(i,r){var u=t.call(this,i,"jsFadTeaserBlock")||this;return u.$element=i,u.enablePostalCodeAutoComplete=r,u.$dummyInputBlock=u.$element.find('[data-selector="dummy-input"]'),u.$addressInputBlock=u.$element.find('[data-selector="address-input"]'),u.$input=u.$addressInputBlock.children("input").first(),u.addressAutoComplete=new n.AddressAutocomplete(u.$input,!0,u.enablePostalCodeAutoComplete),u.$dummyInputBlock.click(function(n){return u.toggleAddressInputFields(n,!0)}),u.$addressInputBlock.focusout(function(n){return u.toggleAddressInputFields(n,!1)}),u}return __extends(i,t),i.prototype.toggleAddressInputFields=function(n,t){t?(this.$dummyInputBlock.hide(),this.$addressInputBlock.css("visibility","visible"),this.$input.focus()):(this.$addressInputBlock.css("visibility","hidden"),this.$dummyInputBlock.show())},i}(n.FlooringBase);n.FadTeaserBlock=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(n){var i=t.call(this,n,"jsFloorAdvisorCta")||this;return i.$element=n,i.initEvents(),i}return __extends(i,t),i.prototype.initEvents=function(){var t=this;this.$element.parent().click(function(){var i=t.$element.find('[data-selector="fa-container"]');n.FloorAdvisorManager.getInstance().openFloorAdvisor(i,t.trackingLabel)})},i}(n.FlooringBase);n.FloorAdvisorBlock=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,i){var r=n.call(this,t,"jsLocationCard")||this,f,u,e;return r.$element=t,r.params=i,f=r.$element.find('[data-selector="map"]'),u=new google.maps.LatLng(+i.latitude,+i.longitude),r.googleMap=new google.maps.Map(f.get(0),{zoom:+i.zoomLevel,maxZoom:21,center:u,mapTypeId:google.maps.MapTypeId.ROADMAP,disableDefaultUI:!0}),e=new google.maps.Marker({position:u,icon:i.icon}),e.setMap(r.googleMap),r}return __extends(t,n),t}(n.FlooringBase);n.LocationCardBlock=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this,t,"jsSampleBlock")||this;return i.$element=t,i}return __extends(t,n),t}(n.ComponentWithProductActions);n.SampleBlock=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(i,r){var u=t.call(this,i,"jsCompare")||this;return u.$element=i,u.params=r,u.initEvents(),u.compareManager=new n.CompareManager(i),u}return __extends(i,t),i.prototype.initEvents=function(){var n=this;this.compareTable=this._$element.find('[data-selector="compare-table"]');this.compareTable.on("click","[data-selector=remove-button]",function(t){return n.triggerRemoveProduct(t)})},i.prototype.triggerRemoveProduct=function(n){var t=this,i=jQuery(n.target).closest("[data-floor-id]").data("floor-id");this.compareManager.removeProduct(i,!0,this.params.dataSource).done(function(n){n.succeed&&t.removeProduct(n.html)})},i.prototype.removeProduct=function(n){this.compareTable.length>0&&this.compareTable.html(n)},i}(n.FlooringBase);n.Compare=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n,t){var r=i.call(this,n,t)||this;return r.$element=n,r.params=t,r.initElements(),r}return __extends(r,i),r.prototype.initElements=function(){var i=this;this.$submitForm=this.$element.find('[data-selector="compare-form"]');this.$submitButton=this.$submitForm.find("[data-selector='submit-button']");this.$errorBox=this.$submitForm.find("[data-selector='error-box']");this.$notificationPlaceholder=this.$submitForm.find("div[data-selector='notification-placeholder']");this.customValidation=new t.CustomValidationHelper(this.$element,this.$submitForm,this.$submitButton,this.$errorBox);this.$submitForm.keypress(function(n){n.keyCode===13&&n.preventDefault()});this.$submitButton.click(function(){i.customValidation.validate(function(){i.postForm().done(function(t){t&&(i.$notificationPlaceholder.html(t),i.$notificationPlaceholder.show());n.Unilin.ReCaptcha.reset()})},function(){i.$notificationPlaceholder.hide()})});this.reCaptcha=new n.Unilin.ReCaptcha(this.$submitForm)},r.prototype.postForm=function(){var n={};return this.$submitForm.serializeArray().forEach(function(t){return n[t.name]=t.value}),n.FloorIds=this.$element.find("[data-floor-id]").map(function(n,t){return jQuery(t).data("floor-id")}).get(),n.ErpProductIds=this.$element.find("[data-erp-id]").map(function(n,t){return jQuery(t).data("erp-id")}).get(),window.$http.postAsFormData(this.params.submitUrl,n)},r}(t.Compare);i.Compare=r})(i=t.MarketingAutomation||(t.MarketingAutomation={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=n.Unilin.Toast,r=function(n){function r(t){var r=n.call(this,t)||this;r.element=t;r.compareManagerClick="click.compareManager";r.removeButton="[data-selector=product-remove-button]";i.getContainer().off(r.compareManagerClick,r.removeButton).on(r.compareManagerClick,r.removeButton,function(n){return r.replaceProduct(n)});return r}return __extends(r,n),r.prototype.tryAddProduct=function(n){var f=this,o=this,u=jQuery.Deferred(),e=this.buildControllerUrl(r.controllerName,"TryAddProduct");return jQuery.ajax(e,{data:{NewProductId:n},method:"GET",cache:!1,success:function(n){r.toast=i.update(r.toast,n,{secondaryCallback:function(){return r.toast.destroy()}});var e=t.FlooringHelpers.getJsonScript(n);e&&e.succeed?(jQuery(document).trigger("compare-changed"),f.triggerProductAddedToCompareEvent(e.gtmEventData),u.resolve({succeed:!0})):e.isFull?(r.replacementProductId=e.productId,u.resolve({succeed:!1})):u.resolve({succeed:!1})}}),u.promise()},r.prototype.removeProduct=function(n,t,u){var f=jQuery.Deferred(),e=this.buildControllerUrl(r.controllerName,"RemoveProduct");return u!=null&&(e+="?dataSource="+u),jQuery.ajax(e,{data:{CurrentProductId:n,IncludeHtml:t},method:"GET",cache:!1,success:function(u){jQuery(document).trigger("compare-product-removed",n);jQuery(document).trigger("compare-changed");u&&!t?r.toast=i.update(r.toast,u,{secondaryCallback:function(){return r.toast.destroy()}}):i.destroy(r.toast);f.resolve({succeed:!0,html:u})}}),f.promise()},r.prototype.replaceProduct=function(n){var e=this,o,u,f;(n.preventDefault(),o=this,u=jQuery(n.currentTarget).data("id"),u)&&(f=this.buildControllerUrl(r.controllerName,"ReplaceProduct"),jQuery.ajax(f,{data:{NewProductId:r.replacementProductId,CurrentProductId:u},method:"GET",cache:!1,success:function(n){n&&(r.toast=i.update(r.toast,n,{secondaryCallback:function(){return r.toast.destroy()}}));var f=t.FlooringHelpers.getJsonScript(n);f&&f.succeed&&(jQuery(document).trigger("compare-product-replaced",{oldProductId:u,newProductId:r.replacementProductId}),jQuery(document).trigger("compare-changed"),e.triggerProductAddedToCompareEvent(f.gtmEventData))}}))},r.prototype.triggerProductAddedToCompareEvent=function(n){n&&this.tagManager.registerEvent("jscomparefloors",n.action,n.label,null,"AddToCompare")},r}(t.FlooringBase);r.controllerName="Compare";t.CompareManager=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n,t){var r=i.call(this,n,"jscontactus")||this;return r.$element=n,r.params=t,r.initializeFields(),r.initializeEvents(),r}return __extends(r,i),r.prototype.initializeFields=function(){this.$contactForm=this.$element.find("#contact-us-form");this.$questionInput=this.$element.find("textarea#Question");this.$notificationPlaceholder=this.$element.find("div[data-selector='notification-placeholder']");this.$errorBox=this.$element.find("div[data-selector=data-error-box]");this.$selectizeElement=this.$element.find("select#SubjectId").selectize();this.$phoneInput=this.$element.find('[data-selector="phone-input"]');this.$callMeBackCheck=this.$element.find('[data-selector="call-me-back"]');this.$postalCodeInput=this.$element.find("[data-mask]");this.$countrySelectize=t.Shared.Selectize.initialize(this.$element.find("[data-selector=selectize]"));this.updatePostalCodeMask();this.reCaptcha=new n.Unilin.ReCaptcha(this.$contactForm)},r.prototype.initializeEvents=function(){var i=this;t.FlooringHelpers.enableButtonBehaviorForDiv(this.$element.find("a[data-selector='submit-form-trigger']"),function(n){return i.submitButtonOnClick(n)});this.$countrySelectize.on("change",function(n){return i.countryChanged(n)});n.Unilin.UnilinHelpers.attachObserver(this.$errorBox,function(){return i.toggleErrorBox()})},r.prototype.countryChanged=function(n){var i=this.$countrySelectize.getItem(n).find("span"),t;i&&(t=i.data("postalcodemask"),t?(this.$postalCodeInput.data("mask",t),this.updatePostalCodeMask()):this.$postalCodeInput.unmask())},r.prototype.updatePostalCodeMask=function(){this.$postalCodeInput.each(function(n,t){var i=jQuery(t);i.maskinput(""+i.data("mask"),{placeholder:"_"})})},r.prototype.submitButtonOnClick=function(i){var r=this;i.preventDefault();this.hideNotification();this.$contactForm.valid()&&(t.FlooringHelpers.showFullScreenWaitPanel(),window.$http.postAsFormData(this.params.submitContactFormUrl,this.getSubmitModel()).done(function(t){r.hideNotification();r.showNotification(t);var i=JSON.parse(r.$notificationPlaceholder.find("script[type=json]")[0].innerHTML);i&&i.succeeded&&(r.$questionInput.val(""),r.registerEvent("ContactSubmit"));n.Unilin.ReCaptcha.reset()}).always(function(){return t.FlooringHelpers.hideWaitPanel()}))},r.prototype.getSubmitModel=function(){var n={};return this.$contactForm.serializeArray().forEach(function(t){return n[t.name]=t.value}),n.CallMeBack=n.hasOwnProperty("CallMeBack"),n},r.prototype.showNotification=function(n){n&&(this.$notificationPlaceholder.html(n),this.$notificationPlaceholder.show())},r.prototype.hideNotification=function(){this.$notificationPlaceholder.html("");this.$notificationPlaceholder.hide()},r.prototype.toggleErrorBox=function(){this.$errorBox.find("ul span").text().length<1?this.$errorBox.hide():this.$errorBox.show()},r}(t.FlooringBase);t.ContactUs=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function i(i,r){this.$element=i;this.params=r;this.tabsHelper=new t.TabsHelper(i);this.initElements();this.initEvents();this.initGoogleMaps();n.Unilin.UnilinHelpers.initializePopovers(this.$element)}return i.prototype.initElements=function(){this.$appointmentTabHeader=this.$element.find('[data-selector="tab-header"]#'+i.APPOINTMENT);this.$appointmentContainer=this.$element.find('[data-selector="appointment-container-placeholder"]')},i.prototype.initEvents=function(){var n=this;this.$appointmentTabHeader.on("click",function(){return n.loadAppointment()})},i.prototype.initGoogleMaps=function(){var n=this.$element.find("#google-map"),t=new google.maps.LatLng(parseFloat(n.data("lat")),parseFloat(n.data("lng"))),i;this.googleMap=new google.maps.Map(n.get(0),{zoom:14,maxZoom:null,center:t,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!1,panControl:!1,navigationControl:!1,streetViewControl:!1,zoomControl:!0,styles:[{featureType:"administrative.country",elementType:"geometry",stylers:[{visibility:"simplified"},{hue:"#ff0000"}]},{featureType:"poi",stylers:[{visibility:"off"}]}]});i=new google.maps.Marker({position:t,icon:n.data("icon")});i.setMap(this.googleMap)},i.prototype.loadAppointment=function(){var n=this;this.isAppointmentLoaded||jQuery.ajax({url:this.params.loadAppointmentUrl,type:"POST",contentType:"application/json; charset=utf-8",success:function(i){i&&setTimeout(function(i){n.$appointmentContainer.html(i);n.$appointmentContainer.removeAttr("style");t.FlooringHelpers.initialiseComponentsInsideElement(n.$appointmentContainer);n.isAppointmentLoaded=!0},250,i)}})},i}();i.APPOINTMENT="Appointment";t.DealerDetail=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=n.Unilin.BlazyImageBase,r=function(n){function t(t){var r=n.call(this,t)||this;r.$element=t;jQuery("body").on("shown.bs.collapse shown.bs.tab",function(){i.revalidate()});return r}return __extends(t,n),t}(t.ComponentWithProductActions);t.AllAccessories=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)};__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(n,i){var r=t.call(this,n)||this;return r.$element=n,r.params=i,r.lazyLoadComponent(),r}return __extends(i,t),i.prototype.lazyLoadComponent=function(){var t=this;window.$http.post(this.params.loadFloorVariantsUrl,null).done(function(i){if(!i){t.$element.remove();n.AnchorBar.removeUnexisting();return}t.$element.find('[data-selector="lazy-load-placeholder"]').replaceWith(i);t.initElements();t.initSelectize();n.FavoriteFloorsManager.initialise(t.$element,!0);n.AnchorBar.refresh(t.$element);n.BlazyImage.revalidate()})},i.prototype.initElements=function(){this.$selectLeft=this.$element.find('[data-selector="variants-select-left"]');this.$selectRight=this.$element.find('[data-selector="variants-select-right"]');this.$cardLeft=this.$element.find('[data-selector="variants-card-left"]');this.$cardRight=this.$element.find('[data-selector="variants-card-right"]')},i.prototype.initSelectize=function(){var n=this,t={maxItems:1,openOnFocus:!0,highlight:!0,closeAfterSelect:!0,diacritics:!0,render:{item:function(n,t){return'<div class="u-txt-indent-none">'+t(n.text)+"<\/div>"}}};this.$selectLeft.length<1||this.$selectRight.length<1||(this.selectizeLeft=this.$selectLeft.selectize(__assign({},t,{onChange:function(t){return n.onChange(n.selectizeLeft,t)}}))[0].selectize,this.selectizeRight=this.$selectRight.selectize(__assign({},t,{onChange:function(t){return n.onChange(n.selectizeRight,t)}}))[0].selectize,this.selectizeLeft.$control_input[0].readOnly=!0,this.selectizeRight.$control_input[0].readOnly=!0,this.setSavedValue(this.selectizeLeft,this.selectizeLeft.getValue()),this.setSavedValue(this.selectizeRight,this.selectizeRight.getValue()))},i.prototype.onChange=function(n,t){var i=this.getOppositeSelectize(n);t===i.getValue()&&this.setCard(i,this.getSavedValue(n));this.setCard(n,t)},i.prototype.setCard=function(t,i){if(this.hasOptions(t)){var r=this.$element.find('[data-productcode="'+i+'"]');r.length<1||(this.getCardElement(t).html(r[0].outerHTML),this.setSavedValue(t,i),t.setValue(i,!0),n.BlazyImage.revalidate())}},i.prototype.hasOptions=function(n,t){return t===void 0&&(t=2),n!=null&&n.options!=null&&Object.keys(n.options).length>=t},i.prototype.getOppositeSelectize=function(n){return this.isLeft(n)?this.selectizeRight:this.selectizeLeft},i.prototype.getCardElement=function(n){return this.isLeft(n)?this.$cardLeft:this.$cardRight},i.prototype.getSavedValue=function(n){return this.isLeft(n)?this.leftValue:this.rightValue},i.prototype.setSavedValue=function(n,t){this.isLeft(n)?this.leftValue=t:this.rightValue=t},i.prototype.isLeft=function(n){return n===this.selectizeLeft},i}(n.ComponentWithProductActions);n.FloorVariants=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=n.Unilin.BlazyImageBase,r=function(n){function t(t){var r=n.call(this,t)||this;r.$element=t;jQuery("body").on("shown.bs.collapse",function(){i.revalidate()});return r}return __extends(t,n),t}(t.ComponentWithProductActions);t.RecommendedAccessories=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(i,r){var u=t.call(this,i,"jsFloorInfoCarousel")||this;return u.$element=i,u.params=r,u.onChangeQualityLevel=function(n){if(u.qualityLevelsSelectize){var t=u.qualityLevelsSelectize.options;t.hasOwnProperty(n)&&(window.location.href=t[n].data)}},u.initElements(),u.initThirdParty(),jQuery(document).ready(function(){u.$qualityLevelsContainer.length&&jQuery.ajax({url:u.params.loadQualityLevels,type:"POST"}).done(function(t){if(t&&t.length){u.$qualityLevelsContainer.html(t);var i=u.$qualityLevelsContainer.find("[data-key=QualityLevel]").first();i.length&&(u.qualityLevelsSelectize=n.Shared.Selectize.initialize(i,{onChange:u.onChangeQualityLevel}))}})}),u}return __extends(i,t),i.prototype.initElements=function(){var t=this.$element.find('[data-selector="floor-identification"]');t.length>0&&(this.floorId=t.data("id"));this.$imagesCarousel=this.$element.find('[data-selector="imagesCarousel"]');this.$addToCartButton=this.$element.find('[data-selector="add-to-cart-trigger"]');this.$orderSampleTrigger=this.$element.find('[data-selector="order-sample-trigger"]');this.$qualityLevelsContainer=this.$element.find('[data-selector="quality-levels-container"]');n.FavoriteFloorsManager.initialise(this.$element,!1)},i.prototype.initThirdParty=function(){this.$imagesCarousel.bxSlider({pager:!0,auto:!0,captions:!1,infiniteLoop:!0})},i}(n.ComponentWithProductActions);n.FloorInfoCarousel=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n,t){var r=i.call(this,n,"jsFloorInformationTabs")||this;return r.element=n,r.dataSource=t.datasource,r.currentFloorId=t.currentFloorId,r.bindSpecificEvents(),r.loadContent(jQuery("[data-selector='tab-header']",r._$element).first()),r}return __extends(r,i),r.prototype.bindSpecificEvents=function(){var n=this;this._$element.on("click","[data-selector='tab-header']",function(t){return n.activateTab(t)});this._$element.on("click","[data-selector='toggle-acc-group']",function(t){n.toggleAccessoryGroup(t);n.toggleChevron(t)});this._$element.on("click","[data-selector='tab-header-mobile']",function(t){var i=jQuery(t.currentTarget);n.loadContent(i);setTimeout(n.toggleMobileChevron,250,i)})},r.prototype.toggleMobileChevron=function(){jQuery('[data-toggle="collapse"]').each(function(t,i){var r=jQuery(i),f=r.find("span.glyphicon"),u=r.attr("aria-expanded")==="true";f.toggleClass("glyphicon-chevron-down",u);f.toggleClass("glyphicon-chevron-right",!u);u&&n.Unilin.UnilinHelpers.scrollTo(r.offset().top-70,100)})},r.prototype.toggleChevron=function(n){var t=jQuery(n.currentTarget).find(".glyphicon");t.hasClass("glyphicon-chevron-right")?t.removeClass("glyphicon-chevron-right").addClass("glyphicon-chevron-down"):t.removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-right")},r.prototype.toggleAccessoryGroup=function(n){jQuery(n.target).closest("[data-selector=acc-group-container]").children("[data-selector=acc-group]").slideToggle()},r.prototype.activateTab=function(n){n.preventDefault();jQuery(n.target).parent().addClass("current");jQuery(n.target).parent().siblings().removeClass("current");this.loadContent(jQuery(n.target))},r.prototype.loadContent=function(n){var u=this,i=this._$element.find('[data-tabid="'+n.attr("href")+'"]'),r;if(i.length===0){this.showTab(n);return}if(r=n.attr("data-loadurl"),!r){this.showTab(n);return}this._$element.find("[data-selector=tab-content]:visible").hide();i.show();jQuery.ajax({url:r+"?dataSource="+this.dataSource,data:{floorid:this.currentFloorId},success:function(r){var f=t.FlooringHelpers.getJsonScript(r);i.hide();f&&f.succeed&&i.replaceWith(r);u.showTab(n)}})},r.prototype.showTab=function(n){var t=jQuery(n).attr("href"),i=this._$element.find("[data-selector=tab-content]");i.not(t).hide();jQuery(t).show();jQuery(t).find("[data-selector=tab-content]").show()},r}(t.ComponentWithProductActions);t.FloorInformationTabs=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n,t){var u=r.call(this,n,"jsFloorFacetSearch")||this;return u.$element=n,u.params=t,u.viewModel=new i.ComponentVm(u.params,u),u.initElements(),u.initEvents(t.queryState),u.initPlugins(),u.viewModel.updating=!0,ko.applyBindings(u,u.$element[0]),u.pageHasLoaded(),u.viewModel.updating=!1,u.$listerContainer.fadeTo(250,1),u}return __extends(u,r),u.prototype.initElements=function(){this.$listerContainer=this.$element.find("[data-selector=lister-container]");this.$tabsContainer=this.$element.find("[data-selector='fac-tab-control']");this.$sortSelectBox=this.$element.find("select#SortOption").selectize();this.gridManager=new i.ProductGridManager(this.$element,this.viewModel).init()},u.prototype.initEvents=function(n){var i=this;window.onpopstate=function(n){if(i.viewModel.initialRendering===!1){var t=n.state;t==null&&(t="");i.viewModel.facetMapAndListUpdate(null,null,null,t,!1)}};this.$element.on("click","[data-selector=tab-header]",function(n){return i.activateTab(n)});this.$element.on("click","[data-selector=fa-container]",function(n){return t.FlooringHelpers.startFloorAdvisor(n,i.trackingLabel)});this.viewModel.facetMapAndListUpdate(null,null,null,n,!0)},u.prototype.initPlugins=function(){this.$tabsContainer.easyResponsiveTabs({type:"default",width:"auto",fit:!0,closed:!0,activate:function(){setTimeout(function(){jQuery(window).width()<t.BreakPoints.md&&n.Unilin.UnilinHelpers.scrollTo(jQuery(".resp-accordion.resp-tab-active").offset().top-120,100)},500)}})},u.prototype.activateTab=function(n){n.preventDefault();jQuery(n.target).closest("[data-selector=tab-link]").addClass("current");jQuery(n.target).closest("[data-selector=tab-link]").siblings().removeClass("current");var t=jQuery(n.target).closest("[data-selector=tab-header]").attr("href");this.$element.find("[data-selector=tab-content]").not(t).css("display","none");jQuery(t).fadeIn()},u}(t.ComponentWithProductActions);i.FloorLister=r})(i=t.Commerce||(t.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(n){function i(i,r){var u=n.call(this,i)||this;u.params=r;u.$cookieLawBannerContainer=u.$component.find("[data-selector='cookielawbanner-panel']");u.loadCookieBanner();u.$component.on("click","[data-selector='footer-contact-email']",function(n,i){return t.FlooringHelpers.renderEmailTextField(n,i)});u.$cookieLawBannerContainer.on("click","[data-selector='cookielawbanner-button']",function(n){return u.performCookieLawBannerOnButtonClick(n)});return u}return __extends(i,n),i.prototype.loadCookieBanner=function(){var n=this;this.$http.post(this.params.loadCookieBannerUrl,null).done(function(i){if(i){var r=t.FlooringHelpers.getJsonScript(i);if(!r||!r.succeed||!r.showCookieBanner)return;n.$cookieLawBannerContainer.html(i)}})},i.prototype.performCookieLawBannerOnButtonClick=function(n){var t=this;n.preventDefault();this.$http.post(this.params.acceptCookieUrl,null).done(function(n){n&&t.$cookieLawBannerContainer.remove()})},i}(n.Unilin.BaseComponent);t.Footer=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function t(n,t){this.$element=n;this.params=t;this.scrollTopDuration=700;this.$toTopButton=jQuery("[data-selector='go-to-top']",this.$element);this.$window=jQuery(window);this.bindEvents()}return t.prototype.bindEvents=function(){var n=this;this.toggleTop();this.$window.on("scroll",function(){return n.toggleTop()});this.$toTopButton.on("click",function(t){return n.scrollToTop(t)})},t.prototype.scrollToTop=function(t){t.preventDefault();n.Unilin.UnilinHelpers.scrollTo(0,this.scrollTopDuration)},t.prototype.toggleTop=function(){var n=this.$window.scrollTop()>this.params.threshold;this.$toTopButton.toggleClass(t.classTopVisible,n)},t}();i.classTopVisible="c-top--visible";t.Top=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(n){function i(t,i){var r=n.call(this,t)||this;return r.params=i,r.initElements(),r.initEvents(),r}return __extends(i,n),i.prototype.initElements=function(){this.$basketCount=this.$component.find("[data-selector='basket-count']");this.$likesCount=this.$component.find("[data-selector='likes-count']");this.$compareCount=this.$component.find("[data-selector='compare-count']");this.$searchBox=this.$component.find("[data-selector='search-box']");this.$searchButton=this.$component.find("[data-selector='search-button']");this.mobileHeader=new t.MobileHeader(this.$component)},i.prototype.initEvents=function(){var n=this;jQuery(document).ready(function(){n.$http.post(n.params.initHeaderUrl,null).done(function(t){t&&(n.updateShoppingCartItemCount(t.basketCount),n.updateLikesCount(t.likesCount),n.updateCompareCount(t.compareCount))})});this.$searchButton.on("click",function(t){return n.performSearch(t)});this.$searchBox.on("keypress",function(t){t.keyCode==13&&n.performSearch(t)});jQuery(document).on("shopping-cart-changed",function(t,i){return n.updateShoppingCartItemCount(i)});jQuery(document).on("likes-changed",function(t,i){return n.updateLikesCount(i)});jQuery(document).on("compare-changed",function(){return n.fetchCompareCount()})},i.prototype.numberOrEmpty=function(n){return n&&n>0?""+n:""},i.prototype.updateShoppingCartItemCount=function(n){this.$basketCount.text(this.numberOrEmpty(+n))},i.prototype.updateLikesCount=function(n){this.$likesCount.text(this.numberOrEmpty(+n))},i.prototype.updateCompareCount=function(n){this.$compareCount.text(this.numberOrEmpty(+n))},i.prototype.fetchCompareCount=function(){var n=this;this.$http.post(this.params.getCompareCountUrl,null).done(function(t){t&&n.updateCompareCount(t.count)})},i.prototype.performSearch=function(n){n.preventDefault();var t=encodeURIComponent(this.$searchBox.val());t&&(window.location.href=this.$searchButton.attr("href")+"?FreeTextSearch="+t)},i}(n.Unilin.BaseComponent);t.Header=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.$element=n;this.activeMenuItems=Object.create([]);this.initEvents();this.toggleMobileSearch()}return n.prototype.initEvents=function(){var t=this;jQuery(window).on("debouncedresize",function(){window.matchMedia("(max-width: "+i.md+"px)").matches||t.resetMobileMenu();jQuery(document.activeElement).prop("type")!=="text"&&(jQuery(n.CLASS_MENU_MASK).hide(),t.toggleMobileSearch())});jQuery('[data-target="#toggleNavMenu"]').click(function(i){jQuery(i.currentTarget).find("input").is(":checked")?(jQuery(n.CLASS_MENU_MOBILE).children().not(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).addClass(n.CLASS_ANIMATE_OUTRIGHT),jQuery(n.CLASS_MENU_MASK).show()):(t.resetMobileMenu(),jQuery(n.CLASS_MENU_MASK).hide())});jQuery(n.CLASS_MENU_MOBILE).children().not(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).mouseenter(function(t){window.matchMedia("(min-width: "+i.md+"px)").matches&&jQuery(t.currentTarget).children(n.CLASS_MENU_MOBILE_LIST).length>0&&(jQuery(n.CLASS_MENU_MASK).show(),jQuery(t.currentTarget).addClass("active"),jQuery(t.currentTarget).find(".container").mouseleave(function(t){if(jQuery(t.relatedTarget).hasClass("active")||jQuery(t.relatedTarget).hasClass(n.CLASS_MENU_MOBILE_ITEM.replace(".","")))return!0;jQuery(n.CLASS_MENU_MASK).hide();jQuery(t.currentTarget).closest(".active").removeClass("active")}))}).mouseleave(function(t){if(jQuery.contains(t.currentTarget,t.relatedTarget))return!0;jQuery(n.CLASS_MENU_MASK).hide();jQuery(t.currentTarget).removeClass("active")});jQuery(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).click(function(n){return t.backMobileNav(n)});jQuery(n.CLASS_MENU_MOBILE_ITEM).click(function(n){return t.toggleMobileSubNav(n)});this.$element.find('[data-selector="mobile-search-icon"]').click(function(n){return t.toggleMobileSearch(n)})},n.prototype.toggleFixedHeader=function(){var t=jQuery(n.CLASS_HEADER);jQuery(window).scrollTop()>0?t.addClass(n.CLASS_HEADER_FIXED):t.removeClass(n.CLASS_HEADER_FIXED)},n.prototype.toggleMobileSearch=function(t){var r=this.$element.find('[data-selector="search-bar"]'),u=this.$element.find('[data-selector="header"]');window.matchMedia("(max-width: "+i.md+"px)").matches?t&&t.type==="click"?(r.toggleClass(n.CLASS_HIDE),u.parent().toggleClass("is-search")):(r.addClass(n.CLASS_HIDE),u.parent().removeClass("is-search")):(r.removeClass(n.CLASS_HIDE),u.parent().removeClass("is-search"))},n.prototype.resetMobileMenu=function(){jQuery(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).addClass(n.CLASS_HIDE).find("span:last").text("");this.activeMenuItems=[];jQuery(n.CLASS_MENU_MOBILE).children().not(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).removeClass(n.CLASS_ANIMATE_OUTRIGHT).removeClass(n.CLASS_ANIMATE_INFROMLEFT).removeClass(n.CLASS_HIDE).find("."+n.CLASS_HIDE).removeClass(n.CLASS_HIDE);jQuery(n.CLASS_MENU_MOBILE).children().not(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).find("."+n.CLASS_ACTIVE).removeClass(n.CLASS_ACTIVE);jQuery('[data-target="#toggleNavMenu"] input').is(":checked")&&jQuery('[data-target="#toggleNavMenu"] input').trigger("click")},n.prototype.backMobileNav=function(){var t=this.activeMenuItems.pop(),i=this.activeMenuItems[this.activeMenuItems.length-1];jQuery(n.CLASS_MENU_MOBILE).children().not(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).addClass(n.CLASS_ANIMATE_OUTRIGHT).removeClass(n.CLASS_ANIMATE_INFROMLEFT);jQuery(t).removeClass(n.CLASS_HIDE).parent().siblings().removeClass(n.CLASS_HIDE);jQuery(t).next(n.CLASS_MENU_MOBILE_LIST).removeClass(n.CLASS_ACTIVE);this.activeMenuItems.length===0?jQuery(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).addClass(n.CLASS_HIDE).find("span:last").text(""):jQuery(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).find("span:last").text(i.text());jQuery(n.CLASS_MENU_MOBILE).children().not(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).addClass(n.CLASS_ANIMATE_INFROMLEFT).removeClass(n.CLASS_ANIMATE_OUTRIGHT)},n.prototype.toggleMobileSubNav=function(t){window.matchMedia("(max-width: "+(i.md-1)+"px)").matches&&(jQuery(n.CLASS_MENU_MOBILE).children().not(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).addClass(n.CLASS_ANIMATE_INFROMLEFT).removeClass(n.CLASS_ANIMATE_OUTRIGHT),jQuery(t.currentTarget).next(n.CLASS_MENU_MOBILE_LIST).length>0&&(t.preventDefault(),this.activeMenuItems.push(jQuery(t.currentTarget)),jQuery(t.currentTarget).addClass(n.CLASS_HIDE).parent().siblings().addClass(n.CLASS_HIDE),jQuery(t.currentTarget).next(n.CLASS_MENU_MOBILE_LIST).addClass(n.CLASS_ACTIVE),jQuery(n.CLASS_MENU_MOBILE_ITEM_ACTIVE).removeClass(n.CLASS_HIDE).find("span:last").text(jQuery(t.currentTarget).text())))},n}(),i;t.CLASS_HEADER=".js-header";t.CLASS_HEADER_FIXED="c-header--fixed";t.CLASS_MENU_MASK=".js-menu-mask";t.CLASS_MENU_MOBILE_ITEM_ACTIVE=".js-menu-nav";t.CLASS_MENU_MOBILE=".js-menu";t.CLASS_MENU_MOBILE_LIST=".js-nav-list";t.CLASS_MENU_MOBILE_ITEM=".js-nav-item";t.CLASS_HIDE="hidden";t.CLASS_ACTIVE="active";t.CLASS_ANIMATE_OUTLEFT="c-animate-outToLeft";t.CLASS_ANIMATE_OUTRIGHT="c-animate-outToRight";t.CLASS_ANIMATE_INFROMLEFT="c-animate-inFromLeft";t.CLASS_ANIMATE_INFROMRIGHT="c-animate-inFromRight";n.MobileHeader=t,function(n){n[n.xs=480]="xs";n[n.sm=768]="sm";n[n.md=992]="md";n[n.lg=1200]="lg";n[n.xl=1600]="xl"}(i=n.BreakPoints||(n.BreakPoints={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function i(i){this.$element=i;this.tabsHelper=new t.TabsHelper(i);this.initGoogleMaps();n.Unilin.UnilinHelpers.initializePopovers(this.$element)}return i.prototype.initGoogleMaps=function(){var n=this.$element.find("#google-map"),t=new google.maps.LatLng(parseFloat(n.data("lat")),parseFloat(n.data("lng"))),i;this.googleMap=new google.maps.Map(n.get(0),{zoom:14,maxZoom:null,center:t,mapTypeId:google.maps.MapTypeId.ROADMAP,mapTypeControl:!1,panControl:!1,navigationControl:!1,streetViewControl:!1,zoomControl:!0,styles:[{featureType:"administrative.country",elementType:"geometry",stylers:[{visibility:"simplified"},{hue:"#ff0000"}]},{featureType:"poi",stylers:[{visibility:"off"}]}]});i=new google.maps.Marker({position:t,icon:n.data("icon")});i.setMap(this.googleMap)},i}();t.InstallerDetail=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));window.languageSwitch=function(n){return{load:function(t,i){var r,u;t!=null&&i!=null&&(r=n('[itemprop="page-id"]').attr("content"),r)&&(u=window.$http,u.get(t+"/"+r+window.location.search,{}).done(function(t){t&&n(document).find('[data-selector="'+i+'"]').each(function(i,r){var u=n(r);u.html(t)})}))}}}(jQuery);__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(i,r){var u=t.call(this,i,"jsfindadealerteaser")||this,f;u.$element=i;f=u.$element.find("input[name='autocomplete-address']");u.jAddressAutoComplete=new n.AddressAutocomplete(f,!0,r);u.$clearButton=u.$element.find("[data-selector='clear-fad-input-button']");u.$clearButton.on("click",function(){return u.clearInput()});u.$findButton=u.$element.find("[data-selector='find-button']");u.$findButton.on("click",function(n){return u.performFindButtonOnButtonClick(n)});return u}return __extends(i,t),i.prototype.clearInput=function(){this.jAddressAutoComplete.clearInput()},i.prototype.performFindButtonOnButtonClick=function(n){n.preventDefault();this.jAddressAutoComplete.redirectToTargetPage()},i}(n.FlooringBase);n.MobileFadTeaserBlock=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this,t,"jsportal")||this;return i.$element=t,i.$element.find('a[data-selector="country-link"]').click(function(n){return i.onCountryLinkClicked(n)}),i}return __extends(t,n),t.prototype.onCountryLinkClicked=function(n){var t=jQuery(n.target).attr("href"),i=new Date;i.setFullYear(i.getFullYear()+25);t&&t.length>0&&(document.cookie="PortalSiteSelection="+t+"; expires="+i.toUTCString(),document.location.href=t,n.preventDefault())},t}(n.FlooringBase);n.Portal=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(t){var r=n.Unilin.GTM,i=n.Unilin.Toast,u=function(){function n(){this._currentState=t.ProjectManager.getProject()}return n.prototype.current=function(){return this._currentState},n.prototype.save=function(n,i){if(i){var r=__assign({},this._currentState,n);this._currentState=r}else this._currentState=n;return t.ProjectManager.createOrUpdateProject(this._currentState),this._currentState},n.prototype["delete"]=function(){this._currentState=null;t.ProjectManager.deleteProject()},n}(),f=function(){function n(n,t){var i=this;this.$element=n;this.settings=t;this.index=-1;this.context=new u;this.wizard=[new e(this.$element.find('[data-selector="step-0"]'),0,this.settings),new o(this.$element.find('[data-selector="step-1"]'),1,this.settings),new s(this.$element.find('[data-selector="step-2"]'),2,this.settings)];this.$spinner=this.$element.find('[data-selector="spinner"]');this.$element.on("click",'[data-event="next"]',function(n){return i.next(n)});this.$element.on("click",'[data-event="back"]',function(n){return i.back(n)});this.loading(function(){return i.loadLocalStorageState()});this.loadServerState()}return n.prototype.next=function(n){var t=this;this.loading(function(){var u=t.wizard[t.index],i;u.tryComplete(t.context,n)&&(u.hide(),t.index++,i=t.wizard[t.index],i.load(t.context)?(i.show(),i.index===2&&r.getInstance().registerVirtualPageview("/ProjectCalculator/step2","ProjectCalculator Step 2 – Project overview")):(t.index--,u.show()))})},n.prototype.back=function(){var n=this;this.loading(function(){var i,t;n.index<0||(i=n.wizard[n.index],i.hide(),n.index--,t=n.wizard[n.index],t.load(n.context),t.show())})},n.prototype.loading=function(n){this.$spinner.show();var t=n();return this.$spinner.hide(),t},n.prototype.loadLocalStorageState=function(){var t=this.wizard.length,n;for(this.index=t-1;this.index>=0;this.index--)if(n=this.wizard[this.index],n.hide(),n.canLoad(this.context)){n.load(this.context);n.show();return}},n.prototype.loadServerState=function(){var n=this,i,t;this.index<2||(i=this.context.current(),t=this.index,window.$http.post(this.settings.validateProjectStateEndPoint,{projectCalculatorStep:t,projectModel:i}).done(function(i){var r=n.wizard[t].validateProjectState(n.context,i);r||n.loadLocalStorageState()}))},n}();t.ProjectCalculator=f;var e=function(){function n(n,t,i){this.$scope=n;this.index=t;this.settings=i}return n.prototype.canLoad=function(n){var t=n.current();return t==null},n.prototype.load=function(){return!0},n.prototype.tryComplete=function(){return!1},n.prototype.show=function(){this.$scope.show()},n.prototype.hide=function(){this.$scope.hide()},n.prototype.validateProjectState=function(){return!0},n}(),o=function(){function u(n,t,i){this.$scope=n;this.index=t;this.settings=i}return u.prototype.canLoad=function(n){var t=n.current();return t!=null},u.prototype.load=function(i){var u=this;return t.FlooringHelpers.showFullScreenWaitPanel(),n.Unilin.UnilinHelpers.initializePopovers(this.$scope),this.$form=this.$scope.find('[data-selector="calculate-project-form"]'),this.$errorBox=this.$scope.find('[data-selector="error-box"]'),this.selectizeForms=t.Shared.Selectize.initializeAll(this.$form),this.validator=this.$form.validate(),this.validator.resetForm(),this.restoreState(i.current()),r.getInstance().registerVirtualPageview("/ProjectCalculator/step1","ProjectCalculator Step 1 – Project info"),this.$form.find("select").each(function(n,t){jQuery(t).on("change",function(){u.$form.validate().element(jQuery(t));u.modifySelectizeValidationState(t)})}),!0},u.prototype.tryComplete=function(n){if(this.validator.form()===!1)return this.modifyAllSelectizeValidationStates(),this.$errorBox.show(),!1;this.modifyAllSelectizeValidationStates();this.$errorBox.hide();var t=n.current();return this.$form.serializeArray().forEach(function(n){n.value&&(t[n.name.charAt(0).toLowerCase()+n.name.slice(1)]=n.value)}),n.save(t,!0),!0},u.prototype.show=function(){t.FlooringHelpers.hideWaitPanel();this.$scope.show()},u.prototype.hide=function(){this.$scope.hide()},u.prototype.validateProjectState=function(n,t){return t.json.success?!0:(i.update(null,t.html),n["delete"](),!1)},u.prototype.modifySelectizeValidationState=function(n){var t="#"+n.id+"-selectized";jQuery(t).parent().toggleClass("selectize-validation-error",jQuery(n).hasClass("input-validation-error"))},u.prototype.modifyAllSelectizeValidationStates=function(){var n=this;this.$form.find(".selectized").each(function(t,i){n.modifySelectizeValidationState(i)})},u.prototype.restoreState=function(n){var t=this;Object.keys(n).forEach(function(i){var f=n[i],e=i.charAt(0).toUpperCase()+i.slice(1),r,u;for(t.$form.find('input[name="'+e+'"]').val(f),r=0;r<t.selectizeForms.length;r++)if(u=t.selectizeForms[r],u.$input.attr("name")===e){u.setValue(f);break}})},u}(),s=function(){function u(n,t,i){this.$scope=n;this.index=t;this.settings=i;this.$scope=n;n.find(".js-basket.item").on("click",function(n){var t=n.currentTarget.closest("[type=checkbox]"),i=t.checked;t.checked=!i})}return u.prototype.canLoad=function(n){var t=n.current();return t==null?!1:t.productCode&&t.floorLevel&&t.linearMeter&&t.roomTypes&&t.surface?!0:!1},u.prototype.load=function(i){var r=this;if(n.Unilin.UnilinHelpers.initializePopovers(this.$scope),i.current().floorSection!=null||this.calculateProject(i))this.createAndBindViewModel(i);else return!1;return this.$scope.find('[data-selector="change-floor-button"]').click(function(){return t.ProjectManager.deleteProject()}),this.$scope.find("[data-selector='add-to-cart']").click(function(n){return r.executeAction(n,i)}),this.setupEmailForm(i),!0},u.prototype.setupEmailForm=function(i){var r=this;this.$mailForm=this.$scope.find('[data-selector="email-me-form"]');this.$mailErrorBox=this.$scope.find('[data-selector="error-box-mail"]');jQuery.validator.unobtrusive.parse(this.$mailForm);this.emailValidator=this.$mailForm.validate();this.$mailForm.submit(function(n){return r.submitEmail(n,i)});n.Unilin.UnilinHelpers.attachObserver(this.$mailErrorBox,function(){return t.FlooringHelpers.toggleErrorBox(r.$mailErrorBox)});this.reCaptcha=new n.Unilin.ReCaptcha(this.$mailForm)},u.prototype.tryComplete=function(){return!1},u.prototype.show=function(){this.$scope.show()},u.prototype.hide=function(){this.$scope.hide()},u.prototype.validateProjectState=function(n,t){return t.json.success?(r.getInstance().registerVirtualPageview("/ProjectCalculator/step2","ProjectCalculator Step 2 – Project overview"),!0):(t.json.project===null?n["delete"]():n.save(t.json.project,!1),i.update(null,t.html),!1)},u.prototype.calculateProject=function(n){var r=this,u=n.current(),t=!1;return window.$http.post(this.settings.calculateProjectEndPoint,u,{async:!1}).done(function(u){if(!u.json.success){i.update(null,u.html);t=!1;return}n.save(u.json.project,!1);t=!0;r.createAndBindViewModel(n);return}),t},u.prototype.submitEmail=function(i){var u=this,r;i.preventDefault();this.emailValidator.form()&&(r={},r.Project=this.rootModel.viewModel().toJSON(),this.$mailForm.serializeArray().forEach(function(n){return r[n.name]=n.value}),t.FlooringHelpers.showFullScreenWaitPanel(),window.$http.postAsFormData(this.settings.emailEndPoint,r).done(function(t){if(n.Unilin.ReCaptcha.reset(),t)if(t.json&&t.json.success)u.$mailForm.replaceWith(t.html);else{var i=u.$mailForm.find("[data-selector='notification-message']");i.length?i.replaceWith(t.html):u.$mailForm.append(t.html)}}).always(function(){return t.FlooringHelpers.hideWaitPanel()}))},u.prototype.executeAction=function(n,t){n.preventDefault();var i=t.current();i&&(i.readyFit&&i.readyFit.readyFitEnabled?this.createQuote(t):this.addProjectToCart(i))},u.prototype.createQuote=function(n){var r=n.current();t.FlooringHelpers.showFullScreenWaitPanel();window.$http.post(this.settings.createOrUpdateQuoteEndPoint,{projectModel:r}).done(function(t){i.show(t.html,{secondaryCallback:function(n,t){return t.destroy()}});t.json.success&&(r.quoteId=t.json.quoteId,n.save(r,!1),t.json.uri&&(window.location.href=t.json.uri))}).always(function(){return t.FlooringHelpers.hideWaitPanel()})},u.prototype.addProjectToCart=function(n,u){var f=this;u===void 0&&(u=!1);t.FlooringHelpers.showFullScreenWaitPanel();window.$http.post(this.settings.addToCartEndPoint,{projectModel:n,replaceCart:u}).done(function(u){u.json.success?(r.getInstance().registerVirtualPageview("/ProjectCalculator/step3","ProjectCalculator Step 3 – Converted to Cart"),i.show(u.html,{secondaryCallback:function(n,t){return t.destroy()}})):i.show(u.html,{primaryCallback:function(t,i){f.addProjectToCart(n,!0);i.destroy()},secondaryCallback:function(n,t){return t.destroy()}});u.json.cartCount&&t.ShoppingCartManager.triggerCartChanged(u.json.cartCount)}).always(function(){return t.FlooringHelpers.hideWaitPanel()})},u.prototype.createAndBindViewModel=function(i){var u=this,r=i.current();this.rootModel?this.rootModel.viewModel(new t.ProjectViewModel(r)):(this.rootModel=new t.RootModel(new t.ProjectViewModel(r)),ko.bindingHandlers.easeFadeToggle={update:function(n,t){var i=t();jQuery(n).toggle("ease")}},ko.applyBindings(this.rootModel));this.rootModel.viewModel().totalProjectPrice.subscribe(function(){return i.save(u.rootModel.viewModel(),!1)});n.Unilin.BlazyImageBase.revalidate();this.bindImageLoadForExtraSections();this.setupStep1CalculatorForm(i,r)},u.prototype.bindImageLoadForExtraSections=function(){this.$scope.find('[data-selector="extra-product-section"]').each(function(t,i){jQuery(i).on("show.bs.collapse",function(t){n.Unilin.BlazyImageBase.revalidate();jQuery(i).off(t.type)})})},u.prototype.setupStep1CalculatorForm=function(n,i){var r=this,o,f,e,u;for(this.$form=this.$scope.find('[data-selector="calculate-project-form"]'),this.$errorBox=this.$scope.find('[data-selector="error-box"]'),jQuery.validator.unobtrusive.parse(this.$form),this.selectizeForms=t.Shared.Selectize.initializeAll(this.$form),this.validator=this.$form.validate(),o=Object.keys(i),f=0;f<this.selectizeForms.length;f++)e=this.selectizeForms[f],u=e.$input.attr("name"),u=u.charAt(0).toLowerCase()+u.slice(1),o.indexOf(u)>-1&&e.setValue(i[u]);this.$form.find("select").each(function(n,t){jQuery(t).on("change",function(){r.$form.validate().element(jQuery(t));r.modifySelectizeValidationState(t)})});this.$scope.find('[data-selector="recalculate-project"]').on("click",function(t){if(t.stopImmediatePropagation(),r.validator.form()===!1){r.modifyAllSelectizeValidationStates();r.$errorBox.show();return}jQuery(t.currentTarget).off(t.type);r.modifyAllSelectizeValidationStates();r.$errorBox.hide();var i=n.current();r.$form.serializeArray().forEach(function(n){n.value&&(i[n.name.charAt(0).toLowerCase()+n.name.slice(1)]=n.value)});n.save(i,!1);r.calculateProject(n)})},u.prototype.modifySelectizeValidationState=function(n){var t="#"+n.id+"-selectized";jQuery(t).parent().toggleClass("selectize-validation-error",jQuery(n).hasClass("input-validation-error"))},u.prototype.modifyAllSelectizeValidationStates=function(){var n=this;this.$form.find(".selectized").each(function(t,i){n.modifySelectizeValidationState(i)})},u}()})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var u=n.Unilin.Storage,v=function(){function n(n){this.viewModel=ko.observable(n)}return n}(),a,i,r,f,e,o,s,h,c,l;t.RootModel=v;a=function(){function n(n){var t=this;this.contentLanguage=jQuery("meta[name='content-language']").attr("content");this.priceFormat=new Intl.NumberFormat(this.contentLanguage,{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2,minimumIntegerDigits:1});this.areaFormat=new Intl.NumberFormat(this.contentLanguage,{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2,minimumIntegerDigits:1,useGrouping:!1});this.productCode=n.productCode;this.roomTypes=n.roomTypes;this.floorLevel=n.floorLevel;this.surface=n.surface;this.linearMeter=n.linearMeter;this.currency=n.currency;this.translatedCurrency=n.translatedCurrency;this.floorSection=new f(this.priceFormat,this.areaFormat,n.floorSection);this.underlaySection=new e(this.priceFormat,this.areaFormat,n.underlaySection);this.skirtingSection=new o(this.priceFormat,this.areaFormat,n.skirtingSection);this.extraProductsSection=new s(this.priceFormat,this.areaFormat,n.extraProductsSection);this.readyFit=new c(this.floorSection.floor,this.priceFormat);this.quoteId=n.quoteId;this.totalProjectPrice=ko.computed(function(){return t.floorSection.floor.totalPrice()+t.underlaySection.underlay.totalPrice()+t.skirtingSection.totalPrice()+t.extraProductsSection.totalPrice()+t.readyFit.totalPrice()});this.totalProjectPriceString=ko.computed(function(){return t.priceFormat.format(t.totalProjectPrice())});this.openStep1Calc=ko.observable(!1);this.hasExtraProductsToShow=ko.computed(function(){return t.extraProductsSection.extraProductsSectionGroups.length>0})}return n.prototype.toggleOpenStep1Calc=function(){var n=this.openStep1Calc();this.openStep1Calc(!n)},n.prototype.toJSON=function(){return{productCode:this.productCode,roomTypes:this.roomTypes,floorLevel:this.floorLevel,surface:this.surface,linearMeter:this.linearMeter,currency:this.currency,floorSection:this.floorSection.toJSON(),underlaySection:this.underlaySection.toJSON(),skirtingSection:this.skirtingSection.toJSON(),extraProductsSection:this.extraProductsSection.toJSON(),savedTotalPriceString:this.totalProjectPriceString(),readyFit:this.readyFit.toJSON(),translatedCurrency:this.translatedCurrency,quoteId:this.quoteId}},n}();t.ProjectViewModel=a;i=function(){function n(n,i,r){var u=this;this.priceFormat=n;this.areaFormat=i;this.isUpdating=!1;this.onlyShowOrderUnit=!1;this.image=r.image;this.url=r.url;this.title=r.title;this.subTitle=r.subTitle;this.originalPrice=r.originalPrice;this.originalPriceUnit=r.originalPriceUnit;this.price=r.price;this.priceUnit=r.priceUnit;this.stockUnit=r.stockUnit;this.conversionFactor=r.conversionFactor;this.area=r.area;this.quantity=r.quantity;this.productCode=r.productCode;this.hybrisProductCode=r.hybrisProductCode;this.areaObservable=ko.observable(i.format(this.area));this.quantityObservable=ko.observable(this.quantity.toString());this.onlyShowOrderUnit=r.conversionFactor===1;this.erpId=r.erpId;this.erpProductId=r.erpProductId;this.originalUnit=r.originalUnit;this.originalDisplayUnit=r.originalDisplayUnit;this.isReadyFitCompliant=r.isReadyFitCompliant;this.areaObservable.subscribe(function(n){var r=t.FlooringHelpers.getFloatValue(n);u.isUpdating||isNaN(r)||u.executeCalculation(1e3,function(){var n,r,f;u.isUpdating=!0;n=t.FlooringHelpers.getFloatValue(u.areaObservable());isNaN(n)&&(n=u.area);r=Math.ceil(n/u.conversionFactor);f=r*u.conversionFactor;u.area=f;u.quantity=r;u.quantityObservable(u.quantity.toString());u.areaObservable(i.format(f));u.isUpdating=!1})});this.quantityObservable.subscribe(function(n){var r=t.FlooringHelpers.getFloatValue(n);u.isUpdating||isNaN(r)||u.executeCalculation(500,function(){var n,r;u.isUpdating=!0;n=t.FlooringHelpers.getFloatValue(u.quantityObservable());isNaN(n)&&(n=u.quantity);r=n*u.conversionFactor;u.area=r;u.quantity=n;u.areaObservable(i.format(r));u.quantityObservable(u.quantity.toString());u.areaObservable.notifySubscribers();u.isUpdating=!1})});this.totalPrice=ko.computed(function(){return t.FlooringHelpers.getFloatValue(u.areaObservable())*u.price});this.totalPriceString=ko.computed(function(){return n.format(u.totalPrice())});this.priceString=n.format(this.price);this.originalPriceString=n.format(this.originalPrice)}return n.prototype.executeCalculation=function(n,t){this.clearTimer();this.inputTimer=setTimeout(t,n)},n.prototype.clearTimer=function(){this.inputTimer&&(clearTimeout(this.inputTimer),this.inputTimer=undefined)},n.prototype.toJSON=function(){return{image:this.image,url:this.url,title:this.title,subTitle:this.subTitle,originalPrice:this.priceFormat.format(this.originalPrice),originalPriceUnit:this.originalPriceUnit,price:this.priceFormat.format(this.price),priceUnit:this.priceUnit,stockUnit:this.stockUnit,savedTotalPriceString:this.totalPriceString(),conversionFactor:this.priceFormat.format(this.conversionFactor),area:this.areaFormat.format(this.area),quantity:this.quantity,productCode:this.productCode,hybrisProductCode:this.hybrisProductCode,erpId:this.erpId,erpProductId:this.erpProductId,originalUnit:this.originalUnit,originalDisplayUnit:this.originalDisplayUnit,isReadyFitCompliant:this.isReadyFitCompliant}},n}();t.ViewModelProductCard=i;r=function(n){function t(t,i,r){var u=n.call(this,t,i,r)||this;return u.selected=r.selected,u.selectedObservable=ko.observable(u.selected),u.selectedObservable.subscribe(function(n){return u.selected=n}),u}return __extends(t,n),t.prototype.toJSON=function(){var t=n.prototype.toJSON.call(this);return t.selected=this.selected,t},t}(i);t.ViewModelSelectableProductCard=r;f=function(){function n(n,t,r){this.floor=new i(n,t,r.floor)}return n.prototype.toJSON=function(){return{floor:this.floor.toJSON()}},n}();t.ViewModelFloorSection=f;e=function(){function n(n,t,r){this.description=r.description;this.underlay=new i(n,t,r.underlay)}return n.prototype.toJSON=function(){return{description:this.description,underlay:this.underlay.toJSON()}},n}();t.ViewModelUnderlaySection=e;o=function(){function n(n,t,i){var f=this,u;for(this.description=i.description,this.skirtings=new Array(i.skirtings.length),u=0;u<i.skirtings.length;u++)this.skirtings[u]=new r(n,t,i.skirtings[u]);this.totalPrice=ko.computed(function(){for(var t=0,n=0;n<f.skirtings.length;n++)f.skirtings[n].selectedObservable()&&(t+=f.skirtings[n].totalPrice());return t})}return n.prototype.toJSON=function(){for(var t={description:this.description,skirtings:Array(this.skirtings.length)},n=0;n<this.skirtings.length;n++)t.skirtings[n]=this.skirtings[n].toJSON();return t},n}();t.ViewModelSkirtingSection=o;s=function(){function n(n,t,i){var u=this,r;for(this.extraProductsSectionGroups=new Array(i.extraProductsSectionGroups.length),r=0;r<i.extraProductsSectionGroups.length;r++)this.extraProductsSectionGroups[r]=new h(n,t,i.extraProductsSectionGroups[r]);this.totalPrice=ko.computed(function(){for(var t=0,n=0;n<u.extraProductsSectionGroups.length;n++)t+=u.extraProductsSectionGroups[n].totalPrice();return t})}return n.prototype.toJSON=function(){for(var t={extraProductsSectionGroups:Array(this.extraProductsSectionGroups.length)},n=0;n<this.extraProductsSectionGroups.length;n++)t.extraProductsSectionGroups[n]=this.extraProductsSectionGroups[n].toJSON();return t},n}();t.ViewModelExtraProductsSection=s;h=function(){function n(n,t,i){var f=this,u;for(this.groupId=i.groupId,this.groupName=i.groupName,this.extraProducts=new Array(i.extraProducts.length),u=0;u<i.extraProducts.length;u++)this.extraProducts[u]=new r(n,t,i.extraProducts[u]);this.totalPrice=ko.computed(function(){for(var t=0,n=0;n<f.extraProducts.length;n++)f.extraProducts[n].selectedObservable()&&(t+=f.extraProducts[n].totalPrice());return t})}return n.prototype.toJSON=function(){for(var t={groupId:this.groupId,groupName:this.groupName,extraProducts:Array(this.extraProducts.length)},n=0;n<this.extraProducts.length;n++)t.extraProducts[n]=this.extraProducts[n].toJSON();return t},n}();t.ViewModelExtraProductsSectionGroup=h;c=function(){function n(n,t){this.product=n;this.isReadyFitCompliant=n.isReadyFitCompliant;this.priceFormat=t;this.isReadyFitCompliant?this.bind():this["default"]()}return n.prototype["default"]=function(){this.enabledReadyFit=ko.observable(!1);this.additionalSummary="";this.additionalCostSummary=ko.observable(null);this.unfurnishedSummary="";this.furnishedSummary="";this.selectedService=ko.observable(null);this.measurementCost=ko.observable(null);var n=function(){return 0};this.additionalCost=ko.computed(n);this.totalPrice=ko.computed(n)},n.prototype.bind=function(){var n=this,t=this.parseData();t?(this.additionalService=t.additionalCost,this.unfurnishedService=t.unfurnishedCost,this.furnishedService=t.furnishedCost,this.enabledReadyFit=ko.observable(!1),this.enabledReadyFit.subscribe(function(t){t===!1?n.selectedService(null):n.selectedService(n.unfurnishedService.id);n.readyFitEnabled=t}),this.additionalSummary=this.formatService(this.additionalService)+" "+this.additionalService.summary,this.unfurnishedSummary=this.formatService(this.unfurnishedService)+" "+this.unfurnishedService.summary,this.furnishedSummary=this.formatService(this.furnishedService)+" "+this.furnishedService.summary,this.selectedService=ko.observable(null),this.selectedService.subscribe(function(t){var i=n.getMeasurementService(t);i&&(n.measurementCost("+"+n.formatService(i)),n.fixedServiceCost=i)}),this.additionalCost=ko.computed(function(){if(n.enabledReadyFit()){var t=n.calculateAddtionalCost();return n.additionalCostSummary(n.formatPriceWithCurreny(n.additionalService.currency,t)),t}return 0}),this.additionalCostSummary=ko.observable(""),this.measurementCost=ko.observable(""),this.totalPrice=ko.computed(function(){return n.enabledReadyFit()?n.additionalCost()+n.getMeasurementService(n.selectedService()).price:0})):this["default"]()},n.prototype.formatService=function(n){return""+n.currency+this.priceFormat.format(n.price)},n.prototype.formatPriceWithCurreny=function(n,t){return"+"+n+this.priceFormat.format(t)},n.prototype.getMeasurementService=function(n){return n===this.unfurnishedService.id?this.unfurnishedService:n===this.furnishedService.id?this.furnishedService:{id:"default",price:1,currency:null,summary:null,productCode:null,unitCode:null}},n.prototype.parseData=function(){var n=document.querySelector('[data-selector="ready-fit-data"]');return n?JSON.parse(n.textContent):null},n.prototype.calculateAddtionalCost=function(){var n=t.FlooringHelpers.getFloatValue(this.product.areaObservable()),i=this.additionalService.price;return n*i},n.prototype.toJSON=function(){return{readyFitEnabled:this.readyFitEnabled,additionalService:this.additionalService,fixedServiceCost:this.fixedServiceCost}},n}();t.ReadyFit=c;l=function(){function n(){}return n.createOrUpdateProject=function(t){if(!t||!t.productCode)throw new Error("The project or productCode is undefined.");u.put(n.storageKey,t)},n.deleteProject=function(){u.remove(n.storageKey)},n.getProject=function(){var t=u.get(n.storageKey);return!t||!t.productCode?null:t},n.projectExists=function(){return n.getProject()!=null},n}();l.storageKey="project_calculator";t.ProjectManager=l})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=n.Unilin.Toast,r=function(){function n(n,i,r){var u=this;if(this.addToProjectSelector='[data-selector="add-to-project"]',this.continueToProjectSelector='[data-selector="continue-to-project"]',this.$addToProjectButton=n.find(this.addToProjectSelector),!this.$addToProjectButton.length)throw new Error("Selector not found "+this.addToProjectSelector+". \nProjectcalculator enabled but add to project button is not rendered.");if(this.$continueToCalculatorLink=n.find(this.continueToProjectSelector),!this.$continueToCalculatorLink.length)throw new Error("Selector not found "+this.continueToProjectSelector+". \nProjectcalculator enabled but continue to project button is not rendered.");this.productCode=i;this.startProjectEndpoint=r;var e=t.ProjectManager.getProject(),f=e!=null,o=f&&e.productCode===this.productCode;this.setState(o);this.$addToProjectButton.on("click",function(){if(!u.disabled){var n=f?{productCode:e.productCode,hasCurrentProject:f}:{productCode:u.productCode,hasCurrentProject:f};window.$http.post(u.startProjectEndpoint,n).done(function(n){f?u.handleAbandonProject(n):u.handleNewProject(n)})}})}return n.prototype.setState=function(n){if(n){this.$addToProjectButton.attr("disabled","disabled");this.$addToProjectButton.hide();this.$continueToCalculatorLink.show();this.disabled=!0;return}this.$addToProjectButton.removeAttr("disabled");this.$addToProjectButton.show();this.$continueToCalculatorLink.hide();this.disabled=!1},n.prototype.handleNewProject=function(n){t.ProjectManager.createOrUpdateProject({productCode:this.productCode});this.setState(!0);this.showToast(n)},n.prototype.handleAbandonProject=function(n){var i=this;this.showToast(n,function(n){n.preventDefault();t.ProjectManager.createOrUpdateProject({productCode:i.productCode});var r=jQuery(n.currentTarget).attr("href");r&&(window.location.href=r)})},n.prototype.showToast=function(n,t){var r=this;this.toast=i.update(this.toast,n,{secondaryCallback:function(){return r.toast.destroy()},primaryCallback:t})},n}();t.ProjectCalculatorWidget=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(r,u){var f=i.call(this,r,"jsRangeDetail")||this;f.$element=r;f.params=u;f.gridManager=new t.ProductGridManager(f.$element,f).init();f.floorAdvisor=new n.FloorAdvisorLinkUpdatable(u.floorAdvisorLink);ko.applyBindings(f,f.$element[0]);f.$element.on("click","[data-selector=fa-container]",function(t){return n.FlooringHelpers.startFloorAdvisor(t,f.trackingLabel)});return f}return __extends(r,i),r.prototype.updateLister=function(t,i,r){var u=this;jQuery.ajax({type:"POST",url:this.params.updateUrl,contentType:"application/json; charset=utf-8",data:JSON.stringify(t),success:function(t){if(t){r?r(t):jQuery("#product-list").html(t);var i=n.FlooringHelpers.getJsonScript(t);u.floorAdvisor.updateFloorAdvisorLink(i.floorAdvisorLink,!0);u.gridManager.reload()}}})},r}(n.ComponentWithProductActions);t.RangeDetail=i})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function i(i){var r=n.call(this,i,"jsRangeOverview")||this;return r.$element=i,r.gridManager=new t.ProductGridManager(r.$element,null).init(),r}return __extends(i,n),i}(n.FlooringBase);t.RangeOverview=i})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(r){var u=i.call(this,r,"jsRecommendedFloors")||this;u.$element=r;u.gridManager=new t.ProductGridManager(u.$element,null).init();u.$element.on("click","[data-selector=fa-container]",function(t){return n.FlooringHelpers.startFloorAdvisor(t,u.trackingLabel)});return u}return __extends(r,i),r}(n.ComponentWithProductActions);t.RecommendedFloors=i})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=n.Unilin.BlazyImageBase,r=function(n){function r(r){var f=n.call(this,r,"jsReferenceCaseDetails")||this,u,e;f.$element=r;u=f.$element.find('[data-selector="sharing-button"]');e=jQuery(u.attr("data-target"));u.on("click",function(){return e.stop().fadeToggle(250)});jQuery(document).on("click",function(n){u.is(n.target)||u.has(n.target).length||e.fadeOut(250)});t.FavoriteFloorsManager.initialise(r,!0);jQuery("body").on("shown.bs.collapse shown.bs.tab",function(){i.revalidate()});return f}return __extends(r,n),r}(t.ComponentWithProductActions);t.ReferenceCaseDetail=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var r=function(t){function r(u,f){var e=t.call(this,u)||this;return e.parm=f,e.infiniteScroll=new n.Unilin.InfiniteScroll({offset:0,loadMoreFunction:function(){return e.loadMore()},elementSelector:r.listId,namespace:"referenceCaseLister"}),e.viewModel=new i(e.parm.knownQueryStrings),e}return __extends(r,t),r.prototype.loadMore=function(){var t=this,n=jQuery.Deferred(),i=jQuery("#currentQuery"),u=jQuery("#nextPage"),f=jQuery("#pageSize"),e=jQuery("#totalPageGap"),o;return i.length===0||u.length===0||f.length===0||e.length===0?(this.infiniteScroll&&this.infiniteScroll.stopListening(),n.resolve()):(o={currentQuery:i.val(),pageNumber:u.val(),pageSize:f.val(),totalPageGap:e.val()},this.$http.post(this.parm.loadMoreUrl,o).fail(function(){return n.reject()}).done(function(i){var u=jQuery(r.listId).children().last();return jQuery(i.html).insertAfter(u),t.viewModel.updateHistoryWithQuery(!0,!0,i.json.queryUpdate),window.blazy&&window.blazy.revalidate(),i.json.isLastPage?t.infiniteScroll&&t.infiniteScroll.stopListening():jQuery("#nextPage").val(i.json.nextPage),n.resolve()}),n.promise())},r}(n.Unilin.BaseComponent),i;r.listId="#referenceCaseList";t.ReferenceCaseLister=r;i=function(){function n(n){this.knownQueryStrings=n;this.updateHistory(!0,!0)}return n.prototype.updateHistoryWithJqueryElement=function(n,t,i){(t===void 0&&(t=!1),n)&&this.updateHistoryInternal(t,i.val())},n.prototype.updateHistoryWithQuery=function(n,t,i){(t===void 0&&(t=!1),n)&&this.updateHistoryInternal(t,i)},n.prototype.updateHistory=function(n,t,i){if(t===void 0&&(t=!1),i===void 0&&(i="#currentQuery"),n){var r=jQuery(i);this.updateHistoryInternal(t,r.val())}},n.prototype.updateHistoryInternal=function(n,i){if(n===void 0&&(n=!1),history.pushState){var r=window.location.toString(),u=r.indexOf("?");u>-1&&(r=r.substr(0,u));i=t.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(i,this.knownQueryStrings);r=r+"?"+i;n?history.replaceState(i,null,r):history.pushState(i,null,r)}},n}();t.ListerComponentVm=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var o=function(n){function t(t,i){var u=n.call(this,t,i)||this;return u.parm=i,u.viewModel=new r(i.query,i.facetMap,i.totalCount,i.updateUrl,u.infiniteScroll,i.knownQueryStrings),u.viewModel.updating=!0,ko.applyBindings(u.viewModel,t[0]),u.viewModel.updating=!1,u.$dropdowns=jQuery("[data-selector='dropdown']"),u.initOverviewEvents(),u}return __extends(t,n),t.prototype.initOverviewEvents=function(){var n=this;jQuery(document).on("click",function(t){return n.closeDropdowns(t)});jQuery.each(this.$dropdowns.find('[data-toggle="collapse"][data-mode="single"]'),function(t,i){var r=jQuery(i).data("target");jQuery(r).find('input[type="radio"]').on("change",function(t){var i=jQuery(t.currentTarget).closest('[data-selector="collapse-panel"]').prop("id"),r='[data-target="#'+i+'"]';n.$dropdowns.find(r).trigger("click")})})},t.prototype.closeDropdowns=function(n){if(n)var t=jQuery(n.target);jQuery.each(this.$dropdowns,function(n,i){var r=jQuery(i),u=r.find('[data-toggle="collapse"]');r===t||r.has(t[0]).length||u.not(".collapsed").trigger("click")})},t}(t.ReferenceCaseLister),r,u,f,e;i.ReferenceCaseOverview=o;r=function(i){function r(n,t,r,f,e,o){var s=i.call(this,o)||this;return s.updateUrl=f,s.infiniteScroll=e,s.initialRendering=!0,s.updating=!0,s.infiniteScroll=e,s.updateUrl=f,s.facetMap=new u(s),s.facetMap.update(t,null),s.updating=!1,s.totalCount=ko.observable(),s.totalCount(r),s}return __extends(r,i),r.prototype.facetMapAndListUpdate=function(n,t,i,r){this.updating=!0;r==null&&(r=!0);i==null&&(i=jQuery("#currentQuery").val().toString());var u={currentQuery:i,facet:n?n.name:null,facetValue:t?t.key:null,selectFacetValue:t?t.selected():!1};this.doAjaxRequest(n,r,u)},r.prototype.doAjaxRequest=function(i,r,u){var f=this;window.$http.post(this.updateUrl,u).done(function(u){jQuery(t.ReferenceCaseLister.listId).replaceWith(u.html);var e=u.json;e&&(f.facetMap.update(e.facetMap,i),f.totalCount(e.totalCount));f.updateHistory(r);f.updating=!1;f.initialRendering=!1;n.Unilin.BlazyImageBase.revalidate();f.infiniteScroll.reset()})},r}(t.ListerComponentVm);i.ListerComponentWithFacetmapVm=r;u=function(){function n(n){this.component=n;this.facets=[];this.searchText=ko.observable();this.selectedFilters=ko.observableArray()}return n.prototype.update=function(n){var u,e,r,i,o,t,s;for(this.facetMap=n,u=this.facets,e=[],r=0;r<n.facets.length;r++){for(i=null,t=0;t<this.facets.length;t++)this.facets[t].facet.name.toUpperCase()===n.facets[r].name.toUpperCase()&&(i=this.facets[t]);for(i?i.update(n.facets[r]):(i=new f(this.component,n.facets[r]),this.facets.push(i)),u=u.filter(function(n){return n!==i}),o=i.facetValues(),t=0;t<o.length;t++)s=o[t],s.selected()&&e.push(s)}this.selectedFilters(e)},n.prototype.getFacetVm=function(n){return this.facets.filter(function(t){return t.facet.name.toUpperCase()===n.toUpperCase()})[0]},n.prototype.clearFilters=function(){var n,r,i,t,u;for(this.component.updating=!0,n=0;n<this.facets.length;n++)for(r=this.facets[n],i=r.facetValues(),t=0;t<i.length;t++)u=i[t],u.selected(!1);this.component.updating=!1;this.component.facetMapAndListUpdate(null,null,"",!0)},n}();i.FacetMapVm=u;f=function(){function n(n,t){var i=this;this.component=n;this.facet=t;this.facetValues=ko.observableArray([]);this.selectedValue=ko.observable();this.selectedValue.subscribe(function(n){return i.singleSelectToggle(n)});this.displayName=t.displayName?t.displayName:t.name;this.update(t)}return n.prototype.update=function(n){for(var t,r,o,s,u=this.facetValues(),f=!1,i=0;i<n.values.length;i++){for(t=null,r=0;r<this.facetValues().length;r++)this.facetValues()[r].key.toUpperCase()===n.values[i].key.toUpperCase()&&(t=this.facetValues()[r]);if(t)s=n.values[i],t.update(n.values[i],n),s.selected&&(f=!0);else{if(t=new e(this.component,n,n.values[i]),t.hidden)continue;t.selected()&&(f=!0,this.selectedValue(t.key));this.component.appendNewFacetValues?this.facetValues.push(t):(o=this.facetValues().length-(u.length+i),this.facetValues.splice(i-o,0,t))}u=u.filter(function(n){return n!==t})}u.forEach(function(n){return n.resetCounter()});f||this.selectedValue("")},n.prototype.singleSelectToggle=function(n){var i,t;if(!this.component.updating){for(this.component.updating=!0,t=0;t<this.facetValues().length;t++)this.facetValues()[t].key!==n?this.facetValues()[t].selected(!1):i=this.facetValues()[t];this.component.updating=!1;i?i.selected(!0):this.reset()}},n.prototype.reset=function(){this.component.updating||(this.component.updating=!0,this.facetValues().forEach(function(n){n.selected(!1)}),this.component.updating=!1,this.component.facetMapAndListUpdate(this.facet,null,null,!0))},n}();i.FacetVm=f;e=function(){function n(n,t,i){var u=this,r;this.component=n;this.facet=t;this.facetValue=i;r=this;r.selected=ko.observable();r.count=ko.observable();r.update(i,t);r.selected.subscribe(function(n){return u.selectionChanged(n)});r.enabled=ko.computed(function(){return u.selected()||u.count()>0});r.filterLabel=i.filterLabel}return n.prototype.selectionChanged=function(n){this.component.updating||(this.selected(n),this.component.facetMapAndListUpdate(this.facet,this,null,!0))},n.prototype.update=function(n,t){this.id=t.name+n.key;this.key=n.key;this.displayName=n.displayName;this.selected(n.selected);this.count(n.count);this.filterLabel=n.filterLabel;this.hidden=n.hidden},n.prototype.unselect=function(){this.selected(!1)},n.prototype.resetCounter=function(){this.count(0)},n}();i.FacetValueVm=e})(i=t.ReferenceCaseOverview||(t.ReferenceCaseOverview={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(n){function i(i,r){var u=n.call(this,i,"jsRelatedFloors")||this;return u.$element=i,u.params=r,u.gridManager=new t.ProductGridManager(u.$element,u).init(),u}return __extends(i,n),i.prototype.updateLister=function(n,t,i){jQuery.ajax({url:this.params.loadMoreUrl,type:"POST",contentType:"application/json; charset=utf-8",data:JSON.stringify({filterQuery:n.currentQuery,page:n.pageNumber}),success:function(n){n&&(i?i(n):jQuery("#product-list").html(n))}})},i}(n.ComponentWithProductActions);t.RelatedFloors=i})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n,r){var u=i.call(this,n,"jsrequestbrochures")||this;return u.$element=n,u.params=r,u.initializeFields(),u.initializeEvents(),u.initializeKnockout(),u.customValidation=new t.CustomValidationHelper(n,u.$requestBrochureForm,u.$formSubmitButton,u.$errorBox),u}return __extends(r,i),r.prototype.initializeKnockout=function(){this.showForm=ko.observable(!1);this.isHardcopy=ko.observable(!1);ko.applyBindings(this,this.$element[0])},r.prototype.initializeFields=function(){this.$brochuresContainer=this.$element.find("[data-selector=brochures-container]");this.$requestBrochureForm=jQuery('[data-selector="request-brochure-form"]');this.$formSubmitButton=this.$element.find("a[data-selector=brochure-submit]");this.$errorBox=this.$element.find("[data-selector='error-box']");this.$notificationBox=this.$element.find("div[data-selector=notification-placeholder]");this.$element.find("[data-mask]").each(function(n,t){var i=jQuery(t);i.maskinput(i.data("mask").toString(),{placeholder:"_"})});n.Unilin.UnilinHelpers.initializePopovers(this.$element);t.Shared.Selectize.initializeAll(this.$element);this.numberFormatter=new Intl.NumberFormat(this.contentLanguage,{style:"decimal",maximumFractionDigits:20});this.reCaptcha=new n.Unilin.ReCaptcha(this.$requestBrochureForm)},r.prototype.initializeEvents=function(){var n=this;this.$formSubmitButton.click(this.$formSubmitButton,function(t){return n.submitOrderFormButtonOnClick(t)});this.$brochuresContainer.on("click","[data-selector='brochure-checkboxes']",function(t){return n.updateForm(t)})},r.prototype.updateForm=function(){var i=this.$brochuresContainer.find("[data-selector=download-brochure-button]:checked"),n=this.$brochuresContainer.find("[data-selector=order-brochure-button]:checked"),r=this.showForm();this.isHardcopy(n.length?!0:!1);this.showForm(i.length>0||n.length>0);this.customValidation.isValidationToggled()&&(this.customValidation.validate(),t.FlooringHelpers.hideNotification(this.$notificationBox));!r&&this.showForm()&&t.FlooringHelpers.hideNotification(this.$notificationBox)},r.prototype.getSubmitModel=function(n){var r=this,e=this.$requestBrochureForm.serializeArray(),i={},u,f;e.forEach(function(n){i[n.name]=n.value});i.AcceptForm=this.$element.find("#AcceptForm").is(":checked");i.RoomTypes=[];this.$element.find('select#RoomTypes option[selected="selected"]').each(function(n,t){return i.RoomTypes.push(t.getAttribute("value"))});i.BrochureDownloadIds=this.$brochuresContainer.find('[data-selector="download-brochure-button"]:checked').map(function(n,t){return jQuery(t).data("id")}).toArray();i.BrochureHardcopyIds=this.$brochuresContainer.find('[data-selector="order-brochure-button"]:checked').map(function(n,t){return jQuery(t).data("id")}).toArray();i.Latitude=null;i.Longitude=null;u=new google.maps.Geocoder;f=t.FlooringHelpers.buildAddressFromUserData(i);t.FlooringHelpers.getLongLat(u,f).done(function(t){i.Latitude=r.numberFormatter.format(t[0].geometry.location.lat());i.Longitude=r.numberFormatter.format(t[0].geometry.location.lng());n(i)}).fail(function(){return n(i)})},r.prototype.getBrochureNames=function(n){return this.$brochuresContainer.find('[data-selector="'+n+'"]:checked').map(function(n,t){return jQuery(t).data("name")}).toArray()},r.prototype.submitOrderFormButtonOnClick=function(n){var i=this,r;n.preventDefault();r=function(){var n=function(n){t.FlooringHelpers.showFullScreenWaitPanel();window.$http.postAsFormData(i.params.requestBrochureUrl,n).done(function(n){var e,h,c,r,o,f,s,u;if(t.FlooringHelpers.showNotification(i.$notificationBox,n),e=t.FlooringHelpers.getJsonScript(n),e&&e.success){for(h=i.getBrochureNames("download-brochure-button"),c=i.getBrochureNames("order-brochure-button"),r=0,o=h;r<o.length;r++)u=o[r],i.tagManager.registerEvent(i.trackingLabel,"BrochureDownload",u);for(f=0,s=c;f<s.length;f++)u=s[f],i.tagManager.registerEvent(i.trackingLabel,"BrochureHardcopyRequest",u)}i.reCaptcha.reset()}).always(function(){return t.FlooringHelpers.hideWaitPanel()})};i.getSubmitModel(n)};this.customValidation.validate(r)},r}(t.FlooringBase);i.RequestBrochure=r})(i=t.MarketingAutomation||(t.MarketingAutomation={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i,r;(function(n){n[n.None=0]="None";n[n.Download=1]="Download";n[n.Order=2]="Order";n[n.Both=3]="Both"})(i=t.BrochureRequestType||(t.BrochureRequestType={}));r=function(r){function u(t,i){var u=r.call(this,t,"jsrequestbrochures")||this;return u.$element=t,u.params=i,u.initializeFields(),u.initSubscribes(),u.initializeEvents(),ko.applyBindings(u,t[0]),u.orderReCaptcha=new n.Unilin.ReCaptcha(u.$orderForm),u.downloadReCaptcha=new n.Unilin.ReCaptcha(u.$downloadForm),u}return __extends(u,r),u.prototype.initSubscribes=function(){var n=this;this.showOrderForm=ko.computed(function(){return n.brochureRequestType()===i.Order||n.brochureRequestType()===i.Both});this.showDownloadForm=ko.computed(function(){return n.brochureRequestType()===i.Download})},u.prototype.initializeFields=function(){this.brochureRequestType=ko.observable(i.None);this.$brochuresContainer=this.$element.find("[data-selector=brochures-container]");this.$requestBrochuresForm=this.$element.find("[data-selector=order-brochures-form]");this.$orderForm=this.$element.find("[data-selector=order-brochure-form]");this.$downloadForm=this.$element.find("[data-selector=download-brochure-form]");this.$orderErrorBox=this.$requestBrochuresForm.find("div[data-selector=data-order-error-box]");this.$downloadErrorBox=this.$requestBrochuresForm.find("div[data-selector=data-download-error-box]");this.$notificationPlaceholder=this.$element.find("div[data-selector=notification-placeholder]");this.$requestBrochuresForm.hide();this.$element.find("[data-mask]").each(function(n,t){var i=jQuery(t);i.maskinput(i.data("mask").toString(),{placeholder:"_"})})},u.prototype.initializeEvents=function(){var i=this,r=jQuery(this.$element.find("a[data-selector=brochure-submit]"));this.$brochuresContainer.on("click",'[data-selector="download-brochure-button"]',function(n){return i.updateForms(n)});this.$brochuresContainer.on("click",'[data-selector="order-brochure-button"]',function(n){return i.updateForms(n)});n.Unilin.UnilinHelpers.attachObserver(this.$orderErrorBox,function(){return i.toggleErrorBox()});n.Unilin.UnilinHelpers.attachObserver(this.$downloadErrorBox,function(){return i.toggleErrorBox()});t.FlooringHelpers.enableButtonBehaviorForDiv(r,function(n){return i.submitOrderFormButtonOnClick(n)})},u.prototype.updateForms=function(){var n=this.$brochuresContainer.find("[data-selector=download-brochure-button]:checked"),t=this.$brochuresContainer.find("[data-selector=order-brochure-button]:checked");this.hideNotification();n.length&&t.length?this.brochureRequestType(i.Both):n.length?this.brochureRequestType(i.Download):t.length&&this.brochureRequestType(i.Order);n.length||t.length?this.$requestBrochuresForm.show():this.$requestBrochuresForm.hide();this.toggleErrorBox()},u.prototype.submitOrderFormButtonOnClick=function(n){n.preventDefault();switch(this.brochureRequestType()){case i.Both:case i.Order:this.$orderForm.valid()&&this.submitForm();break;case i.Download:this.$downloadForm.valid()&&this.submitForm()}this.toggleErrorBox()},u.prototype.submitForm=function(){var n=this,i;t.FlooringHelpers.showFullScreenWaitPanel();i=this.getSubmitModel();window.$http.postAsFormData(this.params.requestBrochureUrl,i).done(function(t){var f,s,h,i,e,u,o,r;if(n.showNotification(t),f=JSON.parse(jQuery(t).filter("script[type=json]")[0].innerHTML),f&&f.success){for(s=n.getBrochureNames("download-brochure-button"),h=n.getBrochureNames("order-brochure-button"),i=0,e=s;i<e.length;i++)r=e[i],n.tagManager.registerEvent(n.trackingLabel,"BrochureDownload",r);for(u=0,o=h;u<o.length;u++)r=o[u],n.tagManager.registerEvent(n.trackingLabel,"BrochureHardcopyRequest",r)}n.showOrderForm()?n.orderReCaptcha.reset():n.downloadReCaptcha.reset()}).always(function(){return t.FlooringHelpers.hideWaitPanel()})},u.prototype.getSubmitModel=function(){var n={BrochureRequestType:this.brochureRequestType(),BrochureDownloadIds:this.$brochuresContainer.find('[data-selector="download-brochure-button"]:checked').map(function(n,t){return jQuery(t).data("id")}).toArray(),BrochureOrderIds:this.$brochuresContainer.find('[data-selector="order-brochure-button"]:checked').map(function(n,t){return jQuery(t).data("id")}).toArray(),OrderBrochureFormModel:{},DownloadBrochureFormModel:{}};return this.$orderForm.serializeArray().forEach(function(t){return n.OrderBrochureFormModel[t.name]=t.value}),this.$downloadForm.serializeArray().forEach(function(t){return n.DownloadBrochureFormModel[t.name]=t.value}),n["g-recaptcha-response"]=this.showOrderForm()?n.OrderBrochureFormModel["g-recaptcha-response"]:n.DownloadBrochureFormModel["g-recaptcha-response"],n},u.prototype.getBrochureNames=function(n){return this.$brochuresContainer.find('[data-selector="'+n+'"]:checked').map(function(n,t){return jQuery(t).data("name")}).toArray()},u.prototype.showNotification=function(n){n&&(this.$notificationPlaceholder.html(n),this.$notificationPlaceholder.show())},u.prototype.hideNotification=function(){this.$notificationPlaceholder.html("");this.$notificationPlaceholder.hide()},u.prototype.toggleErrorBox=function(n){n===void 0&&(n=undefined);this.showOrderForm()?this.$orderErrorBox.find("ul span").text().length<1?this.$orderErrorBox.hide():this.$orderErrorBox.show():this.showDownloadForm()&&(this.$downloadErrorBox.find("ul span").text().length<1?this.$downloadErrorBox.hide():this.$downloadErrorBox.show())},u}(t.FlooringBase);t.RequestBrochure=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(n,t){var r=i.call(this,n,"jsSearch")||this;return r.$element=n,r.initializeFields(t),r.initializeEvents(),r.initScrollToFixed(),r}return __extends(r,i),r.prototype.initializeFields=function(i){this.gridManager=new t.ProductGridManager(this.$element,this).init('[data-selector="Products-wrapper"]');this.updateActionUrl=i.updateActionUrl;this.productLoadMoreUrl=i.productLoadMoreUrl;this.textSearchLoadMoreUrl=i.textSearchLoadMoreUrl;this.$searchInput=this._$element.find('[data-selector="search-input"]').first();this.$searchContainer=this._$element.find('[data-selector="search-container"]');this.$SearchResultDescription=this._$element.find('[data-selector="search-result-description"]');this.$textSearchContainer=this._$element.find('[data-selector="Text-wrapper"]');n.FavoriteFloorsManager.initialise(this.$element,!1)},r.prototype.initializeEvents=function(){var n=this;this._$element.on("click","[data-selector='search-button']",function(t){n.performSearch(t)});this._$element.on("keyup","[data-selector='search-input']",function(t){t.keyCode===13&&n.performSearch(t)});this.$textSearchContainer.on("inview",'div[data-selector="load-more"]',function(t){return n.loadMoreTextSearchResults(t)});this._$element.on("click",".media-separator",function(t){return n.onSeparatorClicked(t)})},r.prototype.initScrollToFixed=function(){var n=this._$element.find('[data-search="result-set"]'),t=n.length-1;n.each(function(n,i){if(n!==0){var r=jQuery(i).find(".media-separator").first();r.scrollToFixed({bottom:(t-n)*46,dontSetWidth:"true",limit:r.offset().top})}})},r.prototype.performSearch=function(){var t=this;n.FlooringHelpers.showFullScreenWaitPanel();jQuery.ajax({type:"POST",url:this.updateActionUrl,data:{freeTextSearch:this.$searchInput.val()},success:function(n){return t.updateResultsReceived(n)}}).always(function(){return n.FlooringHelpers.hideWaitPanel()})},r.prototype.updateResultsReceived=function(n){var i=jQuery("<div>").append(n),t=JSON.parse(i.find("script[type=json]")[0].innerHTML);t&&t.succeeded&&(t.freeTextSearch!=null&&this.showSearchResultDescription(t.freeTextSearch,t.totalResults),this.$searchContainer.html(n),this.gridManager.reload())},r.prototype.showSearchResultDescription=function(n,t){this.$SearchResultDescription.find("span[data-selector=search-text]").html(n);this.$SearchResultDescription.find("span[data-selector=result-count]").html(t.toString());this.$SearchResultDescription.show()},r.prototype.loadMoreTextSearchResults=function(n){var r=this,i=jQuery(n.target),t;i.attr("data-selector")==="load-more"&&(i.attr("data-selector","load-more-result"),t=+jQuery("#textPageNumber").val()+1,jQuery.ajax({type:"POST",url:this.textSearchLoadMoreUrl,data:{searchText:this.$searchInput.val(),page:t},success:function(n){n&&(jQuery("#textPageNumber").val(t),r.addTextSearchResultItems(n))}}))},r.prototype.addTextSearchResultItems=function(n){this.$textSearchContainer.find("div[data-selector='loadmore-result']").remove();jQuery(n).appendTo(this.$textSearchContainer.find("div[data-selector='grid-container']"))},r.prototype.onSeparatorClicked=function(n){var t=jQuery(n.target),i,r;t.hasClass("btn--show-all")||(n.preventDefault(),t.hasClass("media-separator")||(t=t.parents(".media-separator")),t)&&(i=t.data("target"),i)&&(r=this._$element.find('[data-selector="'+i+'"]').offset().top,this.scrollTo(r-120,750,null))},r.prototype.scrollTo=function(n,t,i){var u=navigator.userAgent.indexOf("Firefox")!==-1||navigator.userAgent.indexOf("MSIE")!==-1||!!navigator.userAgent.match(/Trident.*rv\:11\./)?document.documentElement:document.body,f=u.scrollTop,s=n-f,r=0,h=20,c=!!window.requestAnimationFrame,e=function(n){return c?window.requestAnimationFrame(n):window.setTimeout(n,1e3/60)},l=function(n,t,i,r){return(n/=r/2,n<1)?i/2*n*n+t:(n--,-i/2*(n*(n-2)-1)+t)},o=function(){r+=h;var n=l(r,f,s,t);u.scrollTop=n;r>t?i&&typeof i=="function"&&i():e(o)};e(o)},r.prototype.updateLister=function(n,t,i){var r=this;jQuery.ajax({type:"POST",url:this.productLoadMoreUrl,data:n,success:function(n){n&&(i?i(n):jQuery("#product-list").html(n),r.gridManager.reload())}})},r}(n.ComponentWithProductActions);t.Search=i})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(r,u){var f=i.call(this,r,"jsShowroomReservation")||this;return f.$element=r,f.params=u,f.computeHasNumber=function(){f.hasNumber(f.$phoneField.val().length>0||f.$landlineField.val().length>0)},f.initKnockout(),f.initJQueryElements(),f.initJQueryEvents(),f.calendar=new t.Calendar(f.$element,f.params.calendarSettings),f.reCaptcha=new n.Unilin.ReCaptcha(f.$element),ko.applyBindings(f,r[0]),f}return __extends(r,i),r.prototype.initKnockout=function(){this.acceptForm=ko.observable(!1);this.hasNumber=ko.observable(!1)},r.prototype.initJQueryElements=function(){t.Shared.Selectize.initializeAll(this.$element);var i=this.$element.find("#CountryCode").val();n.Unilin.IntlTelInput.initialize(this.$element.find("#Phone"),"MOBILE",i);n.Unilin.IntlTelInput.initialize(this.$element.find("#Landline"),"FIXED_LINE",i);n.Unilin.UnilinHelpers.initializePopovers(this.$element);this.$contactForm=this.$element.find("[data-selector=showroom-contact-form]");this.$submitButton=this.$element.find("[data-selector=submit-form], [data-selector=step1Button]");this.$errorBox=this.$element.find("div[data-selector=error-box]");this.$phoneField=this.$element.find("#Phone");this.$landlineField=this.$element.find("#Landline");this.$notificationPlaceholder=this.$element.find("div[data-selector='notification-placeholder']");this.customValidation=new t.CustomValidationHelper(this.$element,this.$contactForm,this.$submitButton,this.$errorBox)},r.prototype.initJQueryEvents=function(){var n=this;t.FlooringHelpers.enableButtonBehaviorForDiv(jQuery(this.$element.find("a[data-selector='submit-form']")),function(t){return n.submitButtonOnClick(t)});this.handleMobileEvents();this.resizeShowroomMobileNavSteps();this.computeHasNumber();this.$phoneField.on("input",function(){return n.computeHasNumber()});this.$landlineField.on("input",function(){return n.computeHasNumber()})},r.prototype.getSubmitModel=function(){var i=this.$element.find("[data-selector=timeslot-form]"),r=parseInt(i.find("input:radio:checked").val()),t=new Date(this.calendar.selectedDate().date),n={Hours:this.calendar.getSelectedTimeslotHours(r),Day:t.getDate(),Month:t.getMonth()+1,Year:t.getFullYear()};return this.$contactForm.serializeArray().forEach(function(t){return n[t.name]=t.value}),n.AcceptForm=this.acceptForm(),n.RoomTypes=[],this.$element.find('select#RoomTypes option[selected="selected"]').each(function(t,i){return n.RoomTypes.push(i.getAttribute("value"))}),this.$phoneField.val().length>0&&this.$phoneField.intlTelInput("isValidNumber")&&(n.Phone=this.$phoneField.intlTelInput("getNumber")),this.$landlineField.val().length>0&&this.$landlineField.intlTelInput("isValidNumber")&&(n.Landline=this.$landlineField.intlTelInput("getNumber")),n},r.prototype.submitButtonOnClick=function(i){var r=this;i.preventDefault();this.hideNotification();this.$contactForm.valid()?(t.FlooringHelpers.showFullScreenWaitPanel(),window.$http.postAsFormData(this.params.requestShowroomReservationUrl,this.getSubmitModel()).done(function(i){n.Unilin.ReCaptcha.reset();var u=t.FlooringHelpers.getJsonScript(i);u&&u.succeeded&&(r.$notificationPlaceholder=r.$element.find(".showroom-app"),r.registerEvent("Showroom","Booking"),r.hideNotification());r.$notificationPlaceholder.html(i);r.$notificationPlaceholder.show();n.Unilin.UnilinHelpers.scrollTo(r.$notificationPlaceholder.offset().top-100,500,null)}).always(function(){return t.FlooringHelpers.hideWaitPanel()})):this.$errorBox.show()},r.prototype.hideNotification=function(){this.$notificationPlaceholder.html("");this.$notificationPlaceholder.hide()},r.prototype.handleMobileEvents=function(){var i=this,s=this.$element.find("[data-selector='mobileStart']"),f=this.$element.find("[data-selector='step1']"),u=this.$element.find("[data-selector='step2']"),e=this.$element.find("[data-selector='step3']"),o=this.$element.find("[data-selector='makeReservation']"),r=this.$element.find("[data-selector='mobileNav']");s.find("[data-selector='startButton']").bind("click",function(){s.addClass("hidden-xs");r.removeClass("hidden-xs");f.removeClass("hidden-xs");f.find("#FirstName").focus();i.resizeShowroomMobileNavSteps()});f.find("[data-selector='step1Button']").bind("click",function(){i.$contactForm.valid()||t.FlooringHelpers.toggleErrorBox(i.$errorBox);i.$errorBox.find("ul span").text().length<1?(f.addClass("hidden-xs"),u.removeClass("hidden-xs"),r.find(".step1").removeClass("showroom-steps__itm--current"),r.find(".step2").addClass("showroom-steps__itm--current"),i.resizeShowroomMobileNavSteps()):n.Unilin.UnilinHelpers.scrollTo(i.$errorBox.offset().top-500,1e3)});u.find("[data-selector='step2NextButton']").bind("click",function(){e.find("[data-selector='timeslot-form']").children().length>0?(u.addClass("hidden-xs"),e.removeClass("hidden-xs"),o.removeClass("hidden-xs"),r.find(".step2").removeClass("showroom-steps__itm--current"),r.find(".step3").addClass("showroom-steps__itm--current"),i.resizeShowroomMobileNavSteps()):(t.FlooringHelpers.toggleErrorBox(i.$errorBox),n.Unilin.UnilinHelpers.scrollTo(i.$errorBox.offset().top-500,1e3))});u.find("[data-selector='step2PreviousButton']").bind("click",function(){u.addClass("hidden-xs");f.removeClass("hidden-xs");r.find(".step2").removeClass("showroom-steps__itm--current");r.find(".step1").addClass("showroom-steps__itm--current");t.FlooringHelpers.toggleErrorBox(i.$errorBox);i.resizeShowroomMobileNavSteps()});o.find("[data-selector='step3PreviousButton']").bind("click",function(){e.addClass("hidden-xs");o.addClass("hidden-xs");u.removeClass("hidden-xs");r.find(".step3").removeClass("showroom-steps__itm--current");r.find(".step2").addClass("showroom-steps__itm--current");t.FlooringHelpers.toggleErrorBox(i.$errorBox);i.resizeShowroomMobileNavSteps()})},r.prototype.resizeShowroomMobileNavSteps=function(){if(this.$element.find(".showroom-steps:visible")){var n=this.$element.find('.showroom-steps [class*="col-"] > .showroom-steps__itm--current').parent(),t=this.$element.find('.showroom-steps [class*="col-"] > :not(".showroom-steps__itm--current")').parent();n.removeClass(function(n,t){return(t.match(/\bcol-\S+/g)||[]).join(" ")});n.addClass("col-xs-6");t.each(function(n,t){jQuery(t).removeClass(function(n,t){return(t.match(/col-/g)||[]).join(" ")});jQuery(t).addClass("col-xs-3")})}},r}(t.FlooringBase);i.ShowroomReservation=r})(i=t.MarketingAutomation||(t.MarketingAutomation={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(r,u){var f=i.call(this,r,"jsShowroomReservation")||this;return f.$element=r,f.params=u,f.initJQueryElements(),f.initJQueryEvents(),f.calendar=new t.Calendar(f.$element,f.params.calendarSettings),f.reCaptcha=new n.Unilin.ReCaptcha(f.$element),ko.applyBindings(f,r[0]),f}return __extends(r,i),r.prototype.initJQueryElements=function(){this.$contactForm=this.$element.find("[data-selector=showroom-contact-form]");this.$errorBox=this.$element.find("div[data-selector=data-error-box]");this.$desktopErrorBox=this.$element.find("div[data-selector=desktop-error-box]");this.$mobileErrorBox=this.$element.find("div[data-selector=mobile-error-box]");this.$notificationPlaceholder=this.$element.find("div[data-selector='notification-placeholder']")},r.prototype.initJQueryEvents=function(){var i=this;n.Unilin.UnilinHelpers.attachObserver(this.$errorBox,function(){return i.toggleErrorBox()});t.FlooringHelpers.enableButtonBehaviorForDiv(jQuery(this.$element.find("a[data-selector='submit-form']")),function(n){return i.submitButtonOnClick(n)});this.handleMobileEvents();this.resizeShowroomMobileNavSteps()},r.prototype.getSubmitModel=function(){var i=this.$element.find("[data-selector=timeslot-form]"),r=parseInt(i.find("input:radio:checked").val()),n=new Date(this.calendar.selectedDate().date),t={Hours:this.calendar.getSelectedTimeslotHours(r),Day:n.getDate(),Month:n.getMonth()+1,Year:n.getFullYear()};return this.$contactForm.serializeArray().forEach(function(n){return t[n.name]=n.value}),t},r.prototype.submitButtonOnClick=function(i){var r=this;i.preventDefault();this.toggleErrorBox();this.hideNotification();this.$contactForm.valid()?(t.FlooringHelpers.showFullScreenWaitPanel(),window.$http.postAsFormData(this.params.requestShowroomReservationUrl,this.getSubmitModel()).done(function(t){n.Unilin.ReCaptcha.reset();var i=JSON.parse(jQuery(t).filter("script[type=json]").text());i&&i.succeeded&&(r.$notificationPlaceholder=r.$element.find(".showroom-app"),r.registerEvent("Showroom","Booking"),r.hideNotification());r.$notificationPlaceholder.html(t);r.$notificationPlaceholder.show();n.Unilin.UnilinHelpers.scrollTo(r.$notificationPlaceholder.offset().top-100,500)}).always(function(){return t.FlooringHelpers.hideWaitPanel()})):this.$errorBox.show()},r.prototype.hideNotification=function(){this.$notificationPlaceholder.html("");this.$notificationPlaceholder.hide()},r.prototype.toggleErrorBox=function(n){n===void 0&&(n=undefined);n!=undefined?n?this.$errorBox.show():this.$errorBox.hide():this.$errorBox.find("ul span").text().length<1?this.$errorBox.hide():this.$errorBox.show();this.$mobileErrorBox.is(":visible")&&this.$mobileErrorBox.html(this.$desktopErrorBox.html())},r.prototype.handleMobileEvents=function(){var t=this,o=this.$element.find("[data-selector='mobileStart']"),u=this.$element.find("[data-selector='step1']"),r=this.$element.find("[data-selector='step2']"),f=this.$element.find("[data-selector='step3']"),e=this.$element.find("[data-selector='makeReservation']"),i=this.$element.find("[data-selector='mobileNav']");o.find("[data-selector='startButton']").bind("click",function(){o.addClass("hidden-xs");i.removeClass("hidden-xs");u.removeClass("hidden-xs");u.find("#FirstName").focus();t.resizeShowroomMobileNavSteps()});u.find("[data-selector='step1Button']").bind("click",function(){t.$contactForm.valid()||t.toggleErrorBox(!0);t.$errorBox.find("ul span").text().length<1?(u.addClass("hidden-xs"),r.removeClass("hidden-xs"),i.find(".step1").removeClass("showroom-steps__itm--current"),i.find(".step2").addClass("showroom-steps__itm--current"),t.resizeShowroomMobileNavSteps()):n.Unilin.UnilinHelpers.scrollTo(t.$mobileErrorBox.offset().top-500,1e3)});r.find("[data-selector='step2NextButton']").bind("click",function(){f.find("[data-selector='timeslot-form']").children().length>0?(t.toggleErrorBox(),r.addClass("hidden-xs"),f.removeClass("hidden-xs"),e.removeClass("hidden-xs"),i.find(".step2").removeClass("showroom-steps__itm--current"),i.find(".step3").addClass("showroom-steps__itm--current"),t.resizeShowroomMobileNavSteps()):(t.toggleErrorBox(!0),n.Unilin.UnilinHelpers.scrollTo(t.$mobileErrorBox.offset().top-500,1e3))});r.find("[data-selector='step2PreviousButton']").bind("click",function(){r.addClass("hidden-xs");u.removeClass("hidden-xs");i.find(".step2").removeClass("showroom-steps__itm--current");i.find(".step1").addClass("showroom-steps__itm--current");t.resizeShowroomMobileNavSteps()});e.find("[data-selector='step3PreviousButton']").bind("click",function(){f.addClass("hidden-xs");e.addClass("hidden-xs");r.removeClass("hidden-xs");i.find(".step3").removeClass("showroom-steps__itm--current");i.find(".step2").addClass("showroom-steps__itm--current");t.resizeShowroomMobileNavSteps()})},r.prototype.resizeShowroomMobileNavSteps=function(){if(this.$element.find(".showroom-steps :visible")){var n=this.$element.find('.showroom-steps [class*="col-"] > .showroom-steps__itm--current').parent(),t=this.$element.find('.showroom-steps [class*="col-"] > :not(".showroom-steps__itm--current")').parent();n.removeClass(function(n,t){return(t.match(/\bcol-\S+/g)||[]).join(" ")});n.addClass("col-xs-6");t.each(function(n,t){jQuery(t).removeClass(function(n,t){return(t.match(/col-/g)||[]).join(" ")});jQuery(t).addClass("col-xs-3")})}},r}(t.FlooringBase);t.ShowroomReservation=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=function(){function t(t,i){var r=new n.Unilin.Slick(t.find('[data-webid="simpleCarousel"]'),{useCSS:!1,lazyLoad:"progressive",adjustArrows:!1,supportMobileImages:!0,arrows:!0,adjustArrowsSelector:"img",slidesToShow:1,responsive:[{breakpoint:window.breakpoints.small,settings:{adjustArrows:!0,adaptiveHeight:!1}},{breakpoint:window.breakpoints.medium,settings:{adjustArrows:!0,adaptiveHeight:!1}}],autoplay:i.autoScroll,autoplaySpeed:i.scrollSpeed})}return t}();t.SimpleCarousel=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t,u){var f=n.call(this,t,"jsSocialFeed")||this,o,c,e,s,h;for(f.$scope=t,f.params=u,f.feedTiles=[],f.queue=[],f.feedCache=new i(10),f.page=u.nextPage,o=[],c=f.getTiles(f.$scope),e=0,s=c;e<s.length;e++)h=s[e],f.feedTiles.push(new r(f,jQuery(h))),o.push(h.innerHTML);return f.feedCache.upsert(0,o),f.refreshContent(),f}return __extends(t,n),t.prototype.update=function(){return this.queue.length<=1&&!this.isBusy&&this.refreshContent(),this.queue.shift()},t.prototype.refreshContent=function(){var n=this,t;if(this.params.isLastPage){this.page=0;this.cacheOnly=!0;return}this.failedRequestCount>=3||(this.cacheOnly?(this.page>=this.feedCache.size()&&(this.page=0),(t=this.queue).push.apply(t,this.feedCache.getOrDefault(this.page++))):(this.isBusy=!0,window.$http.post(this.params.refreshContentUrl,{page:this.page}).done(function(t){var r,e,i,u,o,f;if(!t||!t.json||!t.json.succeeded){n.failedRequestCount++;return}for(r=[],e=n.getTiles(jQuery(t.html)),i=0,u=e;i<u.length;i++)o=u[i],f=o.innerHTML,n.queue.push(f),r.push(f);n.feedCache.upsert(n.page-1,r);t.json.isLastPage?(n.page=0,n.cacheOnly=!0):(n.page=t.json.nextPage,n.failedRequestCount=0)}).fail(function(){return n.failedRequestCount++}).always(function(){return n.isBusy=!1})))},t.prototype.getTiles=function(n){return n.find(t.tileSelector).get()},t}(n.FlooringBase);t.tileSelector='[data-selector="Tile"]';n.SocialFeed=t;var i=function(){function n(n){n===void 0&&(n=10);this.feedCacheSize=n;this.cache=[[]]}return n.prototype.upsert=function(n,t){t&&t.length&&this.cache.splice(n%this.feedCacheSize,1,t)},n.prototype.getOrDefault=function(n){if(n>=this.cache.length)throw Error("The index ("+n+") is out of the boundaries ("+this.cache.length+") of the cache array.");return this.cache[n]},n.prototype.size=function(){return this.cache.length},n}(),r=function(){function n(n,t){var i=this;this.socialFeed=n;this.$tile=t;this.timer=new u(function(){return i.getUpdate()});this.timer.start();this.retry=0}return n.prototype.getUpdate=function(){if(this.socialFeed.isBusy){this.timer.restart();return}var n=this.socialFeed.update();if(n)this.retry=0,this.$tile.empty().html(n);else{this.retry++;this.retry>9&&this.timer.stop();return}},n}(),u=function(){function n(n){this.action=n;this.getRandomNumber=function(n,t){return Math.floor(Math.random()*(t-n+1))+n};this.isStopped=!1}return n.prototype.start=function(){var n=this;window.clearTimeout(this.timerId);this.isStopped||(this.timerId=window.setTimeout(function(){return n.play()},this.getRandomNumber(1e4,4e4)))},n.prototype.restart=function(){this.isStopped&&(this.isStopped=!1);this.start()},n.prototype.stop=function(){this.isStopped=!0;window.clearTimeout(this.timerId)},n.prototype.play=function(){this.action();this.start()},n}()})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(r,u){var f=i.call(this,r,"jsTaggedFloorLister")||this;f.$element=r;f.params=u;f.gridManager=new t.ProductGridManager(f.$element,f).init();f.floorAdvisor=new n.FloorAdvisorLinkUpdatable(u.floorAdvisorLink);f.$element.on("click","[data-selector=fa-container]",function(t){return n.FlooringHelpers.startFloorAdvisor(t,f.trackingLabel)});return ko.applyBindings(f,f.$element[0]),f}return __extends(r,i),r.prototype.updateLister=function(t,i,r){var u=this;jQuery.ajax({type:"POST",url:this.params.updateUrl,data:t,success:function(t){if(t!=null){r?r(t):jQuery("#product-list").html(t);var i=n.FlooringHelpers.getJsonScript(t);u.floorAdvisor.updateFloorAdvisorLink(i.floorAdvisorLink,!0);u.gridManager.reload()}}})},r}(n.ComponentWithProductActions);t.TaggedFloorLister=i})(t=n.Commerce||(n.Commerce={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(i){var r=t.call(this,i,"jsunsubscribe")||this;r.$element=i;var u=jQuery('[data-selector="unsubscribe-form"]'),f=r.$element.find("input[data-selector='submit']"),e=r.$element.find("[data-selector='error-box']");return r.customValidation=new n.CustomValidationHelper(i,u,f,e),r}return __extends(i,t),i}(n.FlooringBase);n.Unsubscribe=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(n){function t(t){var i=n.call(this,t,"jsvideolister")||this;i.aspectRatio=.5625;i.$videoPlayer=t.find("[data-selector='video-player']");i.$videoWrapper=t.find("[data-selector='video-wrapper']");i.$videoPlayer.data("aspectRatio",i.aspectRatio).removeAttr("height").removeAttr("width");t.on("click","a[data-selector='video-item']",function(n){return i.videoItemOnClick(n)});return window.onresize=i.onResize.bind(i),i.onResize(),i}return __extends(t,n),t.prototype.videoItemOnClick=function(n){n.preventDefault();var t=jQuery(n.target).closest("[data-selector='video-item']").data("video-source");t&&this.$videoPlayer.attr("src",t)[0].scrollIntoView({behavior:"smooth"});this.registerEvent("video-clicked")},t.prototype.onResize=function(){var n=this.$videoWrapper.width();this.$videoPlayer.width(n).height(n*this.$videoPlayer.data("aspectRatio"))},t}(n.FlooringBase);n.VideoLister=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var r=function(){function n(){this.selectedElementKeys=[];this.scrollState=-1}return n}(),u,i;t.WizardStateObject=r;u=function(t){function u(n){var i=t.call(this,n,"jswizard")||this,r;return i.$element=n,i.updateHistory=!0,i.hasHistoryStateSupport=!!history.pushState,i.filterRoomType="room",i.filterColor="color",i.filterStyle="style",i.initializeFields(),i.initializeEvents(),r=history.state,!r||i.setFilters(r),i.$stepOneWrapper=i.$element.find("[data-selector='stepOne']"),i.$stepTwoWrapper=i.$element.find("[data-selector='stepTwo']"),i.$stepThreeWrapper=i.$element.find("[data-selector='stepThree']"),i.resizeWizardMobileNavSteps(),i}return __extends(u,t),u.prototype.initializeFields=function(){var n=this.$element.find("[data-selector='colorGrid']");this.roomTypeKey=this.$element.find("[data-selector='roomtypeGrid']").attr("data-key");this.colorKey=n.attr("data-color-key");this.filter=new i(this.roomTypeKey,this.colorKey);this.$resultButton=this.$element.find("[data-selector='resultLink']");this.$form=this.$element.find("[data-selector='wizardForm']");this.resultLink=this.$form.attr("action");this.$roomTypeSelection=this.$element.find("[data-selector='selectedRoomTypes']")},u.prototype.initializeEvents=function(){var n=this;this.$element.find("[data-selector='roomtypeItem']").on("click",function(t){return n.toggleFilterItem(t,n.filterRoomType)});this.$element.find("[data-selector='colorItem']").on("click",function(t){return n.toggleFilterItem(t,n.filterColor)});this.$element.find("[data-selector='styleItem']").on("click",function(t){return n.toggleFilterItem(t,n.filterStyle)});this.$element.find("[data-selector='buttonStep1']").bind("click",function(t){n.scrollToStep2(t);n.$element.find(".step1").removeClass("wizard-steps__itm--current");n.$element.find(".step2").addClass("wizard-steps__itm--current");n.$stepOneWrapper.addClass("hidden-xs");n.$stepTwoWrapper.removeClass("hidden-xs");n.resizeWizardMobileNavSteps();n.tagManager.registerVirtualPageview("/FloorExplorer/step2","FloorExplorer Step 2 – Color")});this.$element.find("[data-selector='buttonStep2']").bind("click",function(t){n.scrollToStep3(t);n.$element.find(".step2").removeClass("wizard-steps__itm--current");n.$element.find(".step3").addClass("wizard-steps__itm--current");n.$stepTwoWrapper.addClass("hidden-xs");n.$stepThreeWrapper.removeClass("hidden-xs");n.resizeWizardMobileNavSteps();n.tagManager.registerVirtualPageview("/FloorExplorer/step3","FloorExplorer Step 3 – Styles")});this.$element.find("[data-selector='buttonStep2Previous']").bind("click",function(t){n.scrollToStep1(t);n.$element.find(".step1").addClass("wizard-steps__itm--current");n.$element.find(".step2").removeClass("wizard-steps__itm--current");n.$stepOneWrapper.removeClass("hidden-xs");n.$stepTwoWrapper.addClass("hidden-xs");n.resizeWizardMobileNavSteps()});this.$element.find("[data-selector='buttonStep3Previous']").bind("click",function(t){n.scrollToStep2(t);n.$element.find(".step2").addClass("wizard-steps__itm--current");n.$element.find(".step3").removeClass("wizard-steps__itm--current");n.$stepTwoWrapper.removeClass("hidden-xs");n.$stepThreeWrapper.addClass("hidden-xs");n.resizeWizardMobileNavSteps()});this.$resultButton.click(function(t){return n.showResult(t)});this.hasHistoryStateSupport&&(window.onpopstate=function(t){return n.onHistoryPopState(t)})},u.prototype.toggleFilterItem=function(n,t){var i=jQuery(n.currentTarget),r=jQuery(n.currentTarget).attr("data-selected");switch(t){case this.filterRoomType:this.setRoomTypeItem(i,r!=="true");break;case this.filterColor:this.setColorItem(i,r!=="true");break;case this.filterStyle:this.setStyleItem(i,r!=="true")}this.updateHistory&&(this.pushHistory(i),this.setResultUrl())},u.prototype.setResultUrl=function(){this.$form.attr("action",this.resultLink+"?"+this.filter.queryString())},u.prototype.setRoomTypeItem=function(n,t){var i=this.$element.find(".wizard-steps :visible").length>0;t?(this.filter.addRoomType(n.attr("data-key")),n.find(".wiz-grid__img").addClass("wiz-grid__img--selected"),i&&n.find(".mobile-overlay").attr("style","display: none !important")):(this.filter.removeRoomType(n.attr("data-key")),n.find(".wiz-grid__img").removeClass("wiz-grid__img--selected"),i&&n.find(".mobile-overlay").attr("style","display: block !important"));n.attr("data-selected",""+t)},u.prototype.setColorItem=function(n,t){t?(this.filter.addBrightnessColor(n.attr("data-key")),n.find(".wiz-col__img").addClass("wiz-col__img--selected")):(this.filter.removeBrightnessColor(n.attr("data-key")),n.find(".wiz-col__img").removeClass("wiz-col__img--selected"));n.attr("data-selected",""+t)},u.prototype.setStyleItem=function(n,t){t?n.find(".wiz-grid__img").addClass("wiz-grid__img--selected"):n.find(".wiz-grid__img").removeClass("wiz-grid__img--selected");n.attr("data-selected",""+t);this.updateHistory&&this.addStylesToFilter()},u.prototype.addStylesToFilter=function(){var n=[];jQuery.each(this.$element.find("[data-selector='styleItem'][data-selected='true']"),function(t,i){n.push(jQuery(i).attr("data-key"))});this.filter.addStylesToFilter(n)},u.prototype.pushHistory=function(){if(this.hasHistoryStateSupport&&this.updateHistory){var t=new r,i=jQuery.map(this.$element.find("[data-selected='true']"),function(n){return jQuery(n).attr("data-key")}),n=[];jQuery.each(i,function(t,i){jQuery.inArray(i,n)===-1&&n.push(i)});t.selectedElementKeys=n;history.pushState(t,"",window.location.toString())}},u.prototype.setFilters=function(n){var c,t,l,u,a,f,v,e,y,o,p,s,h,w;for(this.updateHistory=!1,this.filter=new i(this.roomTypeKey,this.colorKey),n||(n=new r),n.selectedElementKeys||(n.selectedElementKeys=[]),n.scrollState||(n.scrollState=0),c=this.$element.find("[data-selector='roomtypeItem'][data-selected='true']"),t=0;t<c.length;t++)l=jQuery(c[t]),u=jQuery.inArray(l.attr("data-key"),n.selectedElementKeys),this.setRoomTypeItem(l,u>-1),u>-1&&n.selectedElementKeys.splice(u,1);for(a=this.$element.find("[data-selector='colorItem'][data-selected='true']"),f=0;f<a.length;f++)v=jQuery(a[f]),e=jQuery.inArray(v.attr("data-key"),n.selectedElementKeys),this.setColorItem(v,e>-1),e>-1&&n.selectedElementKeys.splice(e,1);for(y=this.$element.find("[data-selector='styleItem'][data-selected='true']"),o=0;o<y.length;o++)p=jQuery(y[o]),s=jQuery.inArray(p.attr("data-key"),n.selectedElementKeys),this.setRoomTypeItem(p,s>-1),s>-1&&n.selectedElementKeys.splice(s,1);for(h=0;h<n.selectedElementKeys.length;h++)w=this.$element.find('[data-key="'+n.selectedElementKeys[h]+'"]'),w.trigger("click");this.addStylesToFilter();this.setResultUrl();this.updateHistory=!0},u.prototype.onHistoryPopState=function(n){var t=n.state;this.setFilters(t)},u.prototype.scrollToStep1=function(){var t=this.$element.find(".wizard-steps");n.Unilin.UnilinHelpers.scrollTo(t.offset().top-100,500,null)},u.prototype.scrollToStep2=function(){var t;this.$element.find(".wizard-steps").is(":visible")?(t=this.$element.find(".wizard-steps"),n.Unilin.UnilinHelpers.scrollTo(t.offset().top-100,500,null)):(t=this.$element.find("[data-selector='stepTwo']"),n.Unilin.UnilinHelpers.scrollTo(t.offset().top-74,500,null))},u.prototype.scrollToStep3=function(){var t;this.$element.find(".wizard-steps").is(":visible")?(t=this.$element.find(".wizard-steps"),n.Unilin.UnilinHelpers.scrollTo(t.offset().top-100,500,null)):(t=this.$element.find("[data-selector='stepThree']"),n.Unilin.UnilinHelpers.scrollTo(t.offset().top-52,500,null))},u.prototype.showResult=function(n){n.preventDefault();n.stopPropagation();this.tagManager.registerVirtualPageview("/FloorExplorer/result","FloorExplorer Result");this.setSelectedRoomTypes();this.$form.submit()},u.prototype.setSelectedRoomTypes=function(){var n=this.$element.find("[data-selector='roomtypeItem'][data-selected='true']"),t=n.map(function(n,t){return jQuery(t).attr("data-cmsid")}).get().join(";");this.$roomTypeSelection.val(t)},u.prototype.resizeWizardMobileNavSteps=function(){if(this.$element.find(".wizard-steps :visible")){var n=this.$element.find('.wizard-steps [class*="col-"] > .wizard-steps__itm--current').parent(),t=this.$element.find('.wizard-steps [class*="col-"] > :not(".wizard-steps__itm--current")').parent();n.removeClass(function(n,t){return(t.match(/\bcol-\S+/g)||[]).join(" ")});n.addClass("col-xs-6");t.each(function(n,t){jQuery(t).removeClass(function(n,t){return(t.match(/col-/g)||[]).join(" ")});jQuery(t).addClass("col-xs-3")})}},u}(t.FlooringBase);t.Wizard=u;i=function(){function n(n,t){this.roomTypes=[];this.colors=[];this.styles=[];this.roomTypeKey="";this.colorKey="";this.stylesKey="styles";this.roomTypeKey="uf_"+n;this.colorKey="cl_"+t;this.knownQuerystrings=[this.roomTypeKey,this.colorKey,this.stylesKey]}return n.prototype.addRoomType=function(n){this.addToFilters(this.roomTypes,n)},n.prototype.removeRoomType=function(n){this.removeFromFilters(this.roomTypes,n)},n.prototype.addBrightnessColor=function(n){this.addToFilters(this.colors,n)},n.prototype.removeBrightnessColor=function(n){this.removeFromFilters(this.colors,n)},n.prototype.addStylesToFilter=function(n){var t=this;this.styles=[];jQuery.each(n,function(n,i){jQuery.each(i.split(","),function(n,i){t.addToFilters(t.styles,i)})})},n.prototype.addToFilters=function(n,t){var i=jQuery.inArray(t,n);i===-1&&n.push(t)},n.prototype.removeFromFilters=function(n,t){var i=jQuery.inArray(t,n);i>-1&&n.splice(i,1)},n.prototype.queryString=function(){var n="";return this.roomTypes.length>0&&(n=this.roomTypeKey+"="+this.roomTypes.join(";")+";"),this.colors.length>0&&(n.length>0&&(n+="&"),n+=this.colorKey+"="+this.colors.join(";")+";"),this.styles.length>0&&(n.length>0&&(n+="&"),n+=this.stylesKey+"="+this.styles.join(";")+";"),t.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(n,this.knownQuerystrings)},n}();t.Filter=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)};addthis_share=addthis_share||{},function(n){var t;(function(n){var t;(function(t){var r=function(n){function r(i,r){var u=n.call(this,i,"jswizardresult")||this;return u.element=i,u.settings=r,u.filter={floortypes:[],budgetValues:[],budgetPropertyKey:""},u.updatingResult=!1,u.masonryLoaded=!1,u.updateIndex=function(n){return u.index=n.data("id")},u.updateLastClicked=function(n){return u.$lastClicked=n},u.selectedSelector="prd-lst__itm--select",u.initializeFields(r),u.initializeControls(),u.initializeEvents(),u.registerFloorAdvisorEvent(),u.setTwitterMessage(r.twitterText),u.floorAdvisor=new t.FloorAdvisorLinkUpdatable(r.floorAdvisorLink),u.initKnockout(),u}return __extends(r,n),r.prototype.initKnockout=function(){ko.applyBindings(this,this.element[0])},r.prototype.initializeFields=function(n){var u=this,r;this.updateActionUrl=n.updateActionUrl;this.$previewItemsContainer=this._$element.find("[data-selector='floorPreviews']");this.preview=new i(this.selectedSelector,this.$previewItemsContainer,function(){return u.onUpdateLastClicked(null)});this.$resultContainer=this._$element.find(".wizResult").first();r=this._$element.find("[data-selector='budgetData']");r&&r.length>0&&(this.budgetData=r.length!==0?JSON.parse(r.val()):null,this.budgetData&&(this.filter.budgetPropertyKey=this.budgetData.BudgetPropertyKey));t.FavoriteFloorsManager.initialise(this._$element,!1)},r.prototype.registerFloorAdvisorEvent=function(){this.settings.dataLayerVariables&&this.$resultContainer.length>0&&this.tagManager.registerEventOfType(this.settings.dataLayerVariables)},r.prototype.setTwitterMessage=function(n){n&&n.length!==0&&(addthis_share.passthrough={twitter:{text:n}})},r.prototype.initializeControls=function(){var n,i,r;this.$floortypeFilter=this._$element.find("[data-selector='floortypeFilter']").selectize({plugins:["remove_button"]});n=this._$element.find("[data-selector='budgetFilter']").first();n&&n.length>0&&(i=0,r=this.budgetData.SliderSteps,this.$budgetFilter=this._$element.find("[data-selector='budgetFilter']").noUiSlider({start:[i,r],connect:!0,step:1,range:{min:i,max:r}}));this.$masonryContainer=this._$element.find("#wizardResultContainer");this.initializeMasonry();t.FlooringHelpers.loadProductImagesAsync(this.$previewItemsContainer,null)},r.prototype.initializeMasonry=function(){var n=this;this.$masonryContainer.imagesLoaded().always(function(){n._$element.find("#wizResultLoader").remove();n.$masonryContainer.show();n.bindMasonryEvent();n.$masonryContainer.find(".t").css("margin-bottom",n.$masonryContainer.find(".gutter").first().width()+"px");n.$masonryContainer.masonry({columnWidth:".myMasonryClass",itemSelector:".myMasonryClass",gutter:".gutter",isAnimated:!1,transitionDuration:"1s"});n.$masonryContainer.masonry("unbindResize");n.masonryLoaded=!0;n.layoutMasonry(null)})},r.prototype.layoutMasonry=function(){this.masonryLoaded&&(this.$masonryContainer.find(".t").css("margin-bottom",this.$masonryContainer.find(".gutter").first().width()+"px"),this.$masonryContainer.masonry("layout"),this.preview.resetInitialHeight(this.$masonryContainer.height()))},r.prototype.initializeEvents=function(){var n=this;this._$element.on("click","[data-selector='fa-container']",function(i){i.preventDefault();var r=jQuery(i.target);t.FloorAdvisorManager.getInstance().openFloorAdvisor(r,n.trackingLabel)});if(this.$floortypeFilter)this.$floortypeFilter.on("change",jQuery.proxy(this.onFloortypeFilterChanged,this));if(this.$budgetFilter)this.$budgetFilter.on("change",jQuery.proxy(this.onBudgetFilterChanged,this));jQuery(window).resize(function(t){return n.onWindowResize(t)})},r.prototype.onWindowResize=function(n){this.$lastClicked&&this.preview.isExpanded&&this.preview.closePreview(n,this.$lastClicked);this.layoutMasonry(n)},r.prototype.bindMasonryEvent=function(){var n=this;this.$masonryContainer.find(".t").bind("click",function(t){return n.onItemClicked(t)})},r.prototype.onFloortypeFilterChanged=function(n){n.preventDefault();this.filter.floortypes=this.$floortypeFilter.val();this.updateResults()},r.prototype.onBudgetFilterChanged=function(){var t=this.$budgetFilter.val(),i,r,n;if(this.filter.budgetValues=[],t&&this.budgetData)for(i=+t[0],r=+t[1],n=i;n<r;++n)this.filter.budgetValues.push(this.budgetData.SliderValues[n]);this.updateResults()},r.prototype.setQueryParams=function(n){this.filter=n;this.$floortypeFilter[0].selectize.clear(!0);for(var t=0;t<n.floortypes.length;t++)this.$floortypeFilter[0].selectize.addItem(n.floortypes[t],!0)},r.prototype.updateResults=function(){var n=this;jQuery.ajax({type:"POST",url:this.updateActionUrl,data:this.filter,success:function(t){return n.updateResultsReceived(t)}}).always(function(){return t.FlooringHelpers.hideWaitPanel()})},r.prototype.updateResultsReceived=function(n){var r=this,u=jQuery("<div>").append(n),t=JSON.parse(u.find("script[type=json]")[0].innerHTML);t&&(t.floorAdvisorLink&&this.floorAdvisor.updateFloorAdvisorLink(t.floorAdvisorLink),this.masonryLoaded=!1,this.setQueryParams(t),this.$resultContainer.html(n),this.$masonryContainer=this.$resultContainer.find("#wizardResultContainer"),this.$previewItemsContainer=this.$resultContainer.find("[data-selector='floorPreviews']"),this.preview=new i(this.selectedSelector,this.$previewItemsContainer,function(){return r.onUpdateLastClicked(null)}),this.$previewItemsContainer.imagesLoaded().progress(function(n,t){t.img.hasAttribute("data-src")&&(t.img.src=t.img.getAttribute("data-src"))}),this.initializeMasonry())},r.prototype.onItemClicked=function(n){var i=this;t.FlooringHelpers.openFlyoutOrRedirectToDetailPage(n,function(){var r=jQuery(n.target).closest(".t");r&&(!i.$lastClicked||r[0].outerHTML!==i.$lastClicked[0].outerHTML)?(i.$lastClicked&&i.$lastClicked.removeClass(i.selectedSelector),i.preview.open(r),i.updateLastClicked(r),t.BlazyImage.revalidate()):i.preview.closePreview(n,i.$lastClicked)})},r.prototype.onUpdateLastClicked=function(n){this.$lastClicked=n},r}(t.ComponentWithProductActions),i;t.WizardResult=r;i=function(){function t(n,t,i){this.speed=500;this.container=jQuery("<div class='prd-det col-xs-12' data-selector='preview-container'><\/div>");this.isExpanded=!1;this.$previewItemContainer=t;this.onCloseCallback=i;this.selectedSelector=n}return t.prototype.open=function(t){var u=this,i=t.parent().parent(),r,f;this.parentContainerInitialHeight||(this.parentContainerInitialHeight=i.height());this.setContent(t);t.after(this.container);this.container.offset({left:0,top:t.offset().top+t.height()});r=this.container.offset().top+this.container.outerHeight(!0)-i.offset().top;f=i.height();this.parentContainerInitialHeight<r?r!==f&&i.height(r):this.parentContainerInitialHeight!==f&&i.height(this.parentContainerInitialHeight);this.container.find("[data-selector='close-fa-overlay']").on("click",function(n){return u.close(n,t,u.onCloseCallback)});n.Unilin.UnilinHelpers.scrollTo(t.offset().top+t.height()/2,this.speed,function(){return u.isExpanded=!0})},t.prototype.resetInitialHeight=function(n){this.parentContainerInitialHeight=n},t.prototype.closePreview=function(n,t){this.close(n,t,this.onCloseCallback)},t.prototype.close=function(n,t,i){this.isExpanded=!1;t.removeClass(this.selectedSelector);this.container.html("");this.container.remove();t.parent().height(this.parentContainerInitialHeight);i&&typeof i=="function"&&i()},t.prototype.setContent=function(n){n.addClass(this.selectedSelector);var i=n.data("id"),t=this.$previewItemContainer.find("[data-selector='previewContainer'][data-id='"+i+"']").first();t.length>0&&this.container.html("<div class='overlay__close hidden-xs hidden-sm' data-selector='close-fa-overlay'><i>Â<\/i><\/div>"+t.html())},t}();t.ProductDetailContainer=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(r,u){var f=i.call(this,r,u)||this;return f.$element=r,f.settings=u,f.initEvents=function(){var t=window.location.hash.indexOf(f.settings.floorExplorerAnchorName)>=0;t&&f.$element.find("[data-selector='hide-wizardelement']").hide();t||(f.$submitForm.keypress(function(n){n.keyCode===13&&n.preventDefault()}),f.$submitButton.click(function(){var t=function(){f.postForm().done(function(t){t&&(f.$notificationPlaceholder.html(t),f.$notificationPlaceholder.show());n.Unilin.ReCaptcha.reset()})};f.customValidation.validate(t,function(){f.$notificationPlaceholder.hide()})}));f.$element.find(".js-filter").on("click",function(n){jQuery(n.currentTarget).children("span").toggle()})},f.initElements(),f.initEvents(),f.customValidation=new t.CustomValidationHelper(r,f.$submitForm,f.$submitButton,f.$errorBox),f}return __extends(r,i),r.prototype.initElements=function(){this.$submitForm=this.$element.find("[data-selector='wizard-result-form']");this.$submitButton=this.$submitForm.find("[data-selector='submit-button']");this.$errorBox=this.$submitForm.find("[data-selector='error-box']");this.$notificationPlaceholder=this.$submitForm.find("div[data-selector='notification-placeholder']");this.reCaptcha=new n.Unilin.ReCaptcha(this.$submitForm)},r.prototype.postForm=function(){var n={};return this.$submitForm.serializeArray().forEach(function(t){return n[t.name]=t.value}),window.$http.postAsFormData(this.settings.emailResultsUrl,n)},r}(t.WizardResult);i.WizardResult=r})(i=t.MarketingAutomation||(t.MarketingAutomation={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=n.Unilin.UnilinHelpers,r=function(r){function u(n,t){var u=r.call(this,n,t.trackingLabel)||this;return u.$element=n,u.params=t,u.markers=[],u.$form=u.$element.find("form"),u.$errorBox=u.$element.find('[data-selector="error-box"]'),u.$addressInput=u.$element.find("#pac-input"),u.$searchRetailerButton=u.$element.find('a[data-selector="search-retailer-button"]'),u.$messageContainer=u.$element.find('[data-selector="no-results-container"]'),u.$sortingContainer=u.$element.find('[data-selector="sorting-container"]'),u.$floorTypeSelector=u.$element.find('[data-selector="floortype-selector"]'),u.$serviceFilters=u.$element.find('[data-selector="service-filters"]'),u.$retailerSearchResultContainer=u.$element.find("#retailer-search-result"),u.addressQuerystring="address",u.countryQuerystring="countryCode",u.floorTypesQueryString="floorTypes",u.servicesQueryString="services",u.sortingQueryString="sorting",u.knownQueryStringParameters=[u.addressQuerystring,u.countryQuerystring,u.floorTypesQueryString,u.servicesQueryString,u.sortingQueryString],u.init(),window.onpopstate=function(n){if(n.state===!0){u.backEntry=!0;var t=i.getQueryParameters(document.location.href);u.updateSearchFilterSorter(t)}},u}return __extends(u,r),u.prototype.init=function(){this.params.settings.googleGeoCodeFilter=this.params.settings.googleGeoCodeFilter.split(";");this.initSelectizeComponents();this.initGoogleServices();this.initEvents();n.Unilin.UnilinHelpers.initializePopovers(this.$element);this.$element.find("[data-toggle=popover]").click(function(n){return n.preventDefault()});this.update()},u.prototype.updateSearchFilterSorter=function(n){this.params.settings.autoCompleteUsed=!1;this.addressQuerystring in n&&this.$addressInput.val(n[this.addressQuerystring]);this.updateCheckboxes(this.$floorTypeSelector,this.floorTypesQueryString in n?n[this.floorTypesQueryString].split(","):null);this.updateCheckboxes(this.$serviceFilters,this.servicesQueryString in n?n[this.servicesQueryString].split(","):null);this.sortingQueryString in n&&this.$sortingSelectize[0].selectize.setValue(n[this.sortingQueryString])},u.prototype.update=function(){var n=this;this.$addressInput.val()?this.performGeoCodeSearch(this.$addressInput.val(),function(t){return n.performRetailerSearch(t)}):this.setMapToCountry()},u.prototype.updateCheckboxes=function(n,t){n&&n.length&&n.find("input[type=checkbox]").each(function(n,i){i.checked=t&&t.length?t.indexOf(i.id)>-1:!1})},u.prototype.initSelectizeComponents=function(){var n=this;this.$countrySelectize=this.$element.find('[data-selector="country-selection"]').selectize();this.$countrySelectize[0].selectize.on("change",function(t){n.setMapToCountry(t)});if(this.params.settings.enableSortingFilters){this.params.settings.hideSorting=this.$sortingContainer.find("option").length<=1;this.$sortingSelectize=this.$element.find('[data-selector="filter-selection"]').selectize();this.$sortingSelectize[0].selectize.on("change",function(){n.update()})}},u.prototype.initGoogleServices=function(){var t=this,i,n;this.params.settings.enableGoogleMap&&(i=[{featureType:"administrative.country",elementType:"geometry",stylers:[{visibility:"simplified"},{hue:"#ff0000"}]},{featureType:"poi",stylers:[{visibility:"off"}]}],this.googleMap=new google.maps.Map(document.getElementById("google-map"),{center:new google.maps.LatLng(-28.0080047,-111.1842297),mapTypeId:google.maps.MapTypeId.ROADMAP,disableDefaultUI:!0,panControl:!0,scaleControl:!0,zoomControl:!0,clickableIcons:!1,zoom:8,maxZoom:null,styles:i}));this.params.settings.enableAddressAutoComplete&&(n=["(cities)"],this.params.settings.enablePostalCodeAutoComplete&&(n=["(regions)"]),this.googleAutoComplete=new google.maps.places.Autocomplete(this.$addressInput.get(0),{types:n,componentRestrictions:{country:this.$countrySelectize[0].selectize.getValue()}}),this.googleAutoComplete.addListener("place_changed",function(){var n=t.googleAutoComplete.getPlace();!n.geometry||(t.params.settings.autoCompleteUsed=!0)}));this.googleGeoCoder=new google.maps.Geocoder},u.prototype.executeSearch=function(){var n=this;this.$form.valid()?this.performGeoCodeSearch(this.$addressInput.val(),function(t){return n.performRetailerSearch(t)}):(this.clear(),this.showErrorBox())},u.prototype.initEvents=function(){var t=this;this.$addressInput.keyup(function(n){n.keyCode===13?(n.preventDefault(),t.executeSearch()):t.params.settings.autoCompleteUsed=!1});this.$searchRetailerButton.click(function(n){n.preventDefault();t.executeSearch()});this.$floorTypeSelector.change(function(){return t.update()});this.$serviceFilters.change(function(){return t.update()});jQuery('[data-selector="collapse-filters"]').on("click",function(n){n.preventDefault();jQuery(n.currentTarget).closest('[data-selector="Fad-filter"]').find(".btn:first").toggle()});n.Unilin.UnilinHelpers.attachObserver(this.$errorBox,function(){t.$errorBox.has(".field-validation-error").length>0?t.$errorBox.show():t.$errorBox.hide()})},u.prototype.performGeoCodeSearch=function(n,t){var i=this,r;n&&(this.clear(),r=this.params.settings.autoCompleteUsed&&this.params.settings.googleAutoComplete?{placeId:this.googleAutoComplete.getPlace().place_id}:{address:n+", "+this.$countrySelectize[0].selectize.getValue(),componentRestrictions:{country:this.$countrySelectize[0].selectize.getValue()}},this.googleGeoCoder.geocode(r,function(n,r){if(r!==google.maps.GeocoderStatus.OK){i.showNoResultsContainer();return}if(!n[0].types.some(function(n){return i.params.settings.googleGeoCodeFilter.indexOf(n)>=0})){i.showNoResultsContainer();return}if(t&&typeof t=="function"){t(n[0]);return}i.params.settings.enableGoogleMap&&(i.googleMap.setCenter(n[0].geometry.location),n[0].geometry.viewport&&i.googleMap.fitBounds(n[0].geometry.viewport))}))},u.prototype.clear=function(){this.params.settings.enableGoogleMap&&(this.markers.forEach(function(n){return n.setMap(null)}),this.markers.length=0);this.$sortingContainer.hide();this.$messageContainer.hide();this.$retailerSearchResultContainer.html("")},u.prototype.setMapToCountry=function(n){var t=this;(n===void 0&&(n=null),this.params.settings.enableGoogleMap)&&(n||(n=this.$countrySelectize[0].selectize.getValue()),this.googleAutoComplete&&this.googleAutoComplete.setComponentRestrictions({country:n}),this.googleGeoCoder.geocode({componentRestrictions:{country:n}},function(n){t.params.settings.enableGoogleMap&&n&&n[0]&&n[0].geometry&&(t.googleMap.setCenter(n[0].geometry.location),n[0].geometry.viewport&&t.googleMap.fitBounds(n[0].geometry.viewport))}))},u.prototype.showRetailerSearchResult=function(i){var r=t.FlooringHelpers.getJsonScript(i),u,f;if(!r||!r.success){this.$sortingContainer.hide();this.showNoResultsContainer();return}if(this.params.settings.enableGoogleMap){for(u=new google.maps.LatLngBounds,f=0;f<r.markers.length;f++)this.createGoogleMapMarker(r.markers[f],u);this.setBounds(u,null);this.setCenter(u.getCenter())}this.$retailerSearchResultContainer.html(i);this.params.settings.hideSorting||this.$sortingContainer.show();n.Unilin.UnilinHelpers.initializePopovers(this.$retailerSearchResultContainer);this.params.settings.shouldScrollToResults&&n.Unilin.UnilinHelpers.scrollTo(this.$retailerSearchResultContainer.offset().top-120,"linear")},u.prototype.createGoogleMapMarker=function(t,i){var r=this,f=new google.maps.LatLng(t.latitude,t.longitude),u=new google.maps.Marker({title:t.title,position:f,icon:t.icon,animation:google.maps.Animation.DROP,customId:t.id}),e,o;i.extend(f);u.setMap(this.googleMap);this.markers.push(u);t.title&&t.address?(e=new google.maps.InfoWindow({maxWidth:640,disableAutoPan:!0}),o='<div id="'+u.customId+'-infoWindow" class="c-googleinfo"><contact class="c-contact"><div class="c-contact-inner"><div class="c-contact__ttl">'+t.title+'<\/div><div class="c-contact__addr">'+t.address+('<a href="'+t.url+'" class="u-text-size-smaller"> '+t.moreInfoPlaceholder+"<\/a>")+"<\/div><\/div><\/contact><\/div>",google.maps.event.addListener(u,"click",function(n,t,i){return i&&i.close(),function(){var f;i.setContent(t);i.open(r.googleMap,n);var s=r.googleMap.getDiv().clientWidth,h=jQuery(window).width()<768,o=r.$element.find("#"+n.customId+"-infoWindow"),e=100+o.height(),u=40+o.width();u=u/2;h||(e+=r.$element.find(".fad__map__ctrl").height()-65);f=r.getPixelPosition(i);f.y<=e&&r.googleMap.panBy(0,-1*(e-f.y));f.x-u<0&&r.googleMap.panBy(-1*u,0);f.x+u>=s&&r.googleMap.panBy(u,0)}}(u,o,e))):google.maps.event.addListener(u,"click",function(){r.$retailerSearchResultContainer.find(".fad__itm").each(function(n,t){jQuery(t).removeClass("fad__itm--active")});var t=r.$retailerSearchResultContainer.find("#"+u.customId);n.Unilin.UnilinHelpers.scrollTo(t.offset().top-100,500,function(){return t.addClass("fad__itm--active")})})},u.prototype.getPixelPosition=function(n){var t=Math.pow(2,this.googleMap.getZoom()),u=new google.maps.LatLng(this.googleMap.getBounds().getNorthEast().lat(),this.googleMap.getBounds().getSouthWest().lng()),i=this.googleMap.getProjection().fromLatLngToPoint(u),r=this.googleMap.getProjection().fromLatLngToPoint(n.getPosition());return new google.maps.Point(Math.floor((r.x-i.x)*t),Math.floor((r.y-i.y)*t))},u.prototype.setBounds=function(n,t){var e=this,i=this.googleMap,r=i.getProjection(),u,f;n||(n=i.getBounds());u=r.fromLatLngToPoint(n.getNorthEast());f=r.fromLatLngToPoint(n.getSouthWest());t?u.y-=192/Math.pow(2,i.getZoom()):google.maps.event.addListenerOnce(i,"bounds_changed",function(){e.setBounds(n,1)});i.fitBounds(new google.maps.LatLngBounds(r.fromPointToLatLng(f),r.fromPointToLatLng(u)))},u.prototype.setCenter=function(n){var t=this.googleMap,r=Math.pow(2,t.getZoom()),i=t.getProjection().fromLatLngToPoint(n);t.setCenter(t.getProjection().fromPointToLatLng(new google.maps.Point(i.x,i.y+96/r)))},u.prototype.performRetailerSearch=function(n){var o=this,u,r;t.FlooringHelpers.showFullScreenWaitPanel();var s=function(n){return jQuery.makeArray(n.find(":checked").map(function(n,t){return t.id}))},f=s(this.$floorTypeSelector),e=s(this.$serviceFilters),h=this.params.settings.enableSortingFilters?this.$sortingSelectize[0].selectize.getValue()==="distance":this.params.settings.defaultSorting?this.params.settings.defaultSorting==="distance":null,i={address:n.formatted_address,longitude:""+n.geometry.location.lng(),latitude:""+n.geometry.location.lat(),isoCode:this.$countrySelectize[0].selectize.getValue(),floorTypes:f,services:e,distanceFilter:h,promocode:this.params.settings.promoCode};this.registerEvent(this.params.componentName,n.formatted_address);f.length&&this.registerEvent(this.params.componentName,"FloorTypes",f.join(";"));e.length&&this.registerEvent(this.params.componentName,"Services",e.join(";"));this.backEntry||(u=location.protocol+"//"+location.host+location.pathname,r="?"+this.addressQuerystring+"="+encodeURIComponent(this.$addressInput.val())+("&"+this.countryQuerystring+"="+encodeURIComponent(i.isoCode)),i.floorTypes&&i.floorTypes.length&&(r+="&"+this.floorTypesQueryString+"="+i.floorTypes),i.services&&i.services.length&&(r+="&"+this.servicesQueryString+"="+i.services),this.params.settings.enableSortingFilters&&(r+="&"+this.sortingQueryString+"="+this.$sortingSelectize[0].selectize.getValue()),u=u+t.FlooringHelpers.mergeUnexistingQuerystringParametersFromCurrentUrl(r,this.knownQueryStringParameters),window.history.pushState(!0,document.title,u));window.$http.post(this.params.searchUrl,i).done(function(t){o.showRetailerSearchResult(t,n.geometry.location);var i=o.$element.find(".mobileDescriptionTeaser");i.on("click",function(n){i.is(":visible")&&jQuery(n.currentTarget).siblings(".fullDescription").toggle()})}).always(function(){return t.FlooringHelpers.hideWaitPanel()})},u.prototype.showNoResultsContainer=function(){this.$messageContainer.show();this.params.settings.shouldScrollToResults&&n.Unilin.UnilinHelpers.scrollTo(this.$messageContainer.offset().top-120,"linear")},u.prototype.showErrorBox=function(){this.$errorBox.show();this.params.settings.shouldScrollToResults&&n.Unilin.UnilinHelpers.scrollTo(this.$errorBox.offset().top-120,"linear")},u}(t.FlooringBase);t.FindPartner=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(n,i){var r=t.call(this,n,i)||this;if(r.$element=n,r.$parentElement=r.$element.closest('[data-type="tab"]'),r.$currentStep=r.$element.parent(),r.$nextButton=r.$currentStep.find('button[data-selector="steps-action"]'),r.$previousButton=r.$currentStep.find('span[data-selector="steps-action"]'),r.currentStepId=r.$currentStep.data("selector"),r.$nextButton.length)r.$nextButton.on("click",function(n){return r.onClickNext(n)});if(r.$previousButton.length)r.$previousButton.on("click",function(n){return r.onClickPrevious(n)});jQuery('[data-selector="tab-header"]').on("click",function(){return r.initiateOnStepShownEvent()});jQuery(document).on(r.currentStepId+"_Shown",function(){return r.onStepShown()});return r.initiateOnStepShownEvent(),r.stepType=r.$parentElement.find("#StepType").val(),r.componentType=r.$parentElement.find("#ComponentType").val(),r}return __extends(i,t),i.prototype.initiateOnStepShownEvent=function(){this.$parentElement.hasClass("active")&&jQuery("#"+this.currentStepId).hasClass("current")&&jQuery(document).trigger(this.currentStepId+"_Shown")},i.prototype.onClickNext=function(n){this.handlePreviousOrNext(n)},i.prototype.onClickPrevious=function(n){this.handlePreviousOrNext(n)},i.prototype.handlePreviousOrNext=function(t){var r=jQuery(t.currentTarget).prop("id"),u=this.$parentElement.find('[data-selector="step-header"]#'+r),f;u.length>0?(this.$parentElement.find('[data-selector="step-header"]').removeClass(i.CLASS_CURRENT).removeClass(i.CLASS_DONE),u.prevAll().addClass(i.CLASS_DONE),u.addClass(i.CLASS_CURRENT),this.$parentElement.find('[data-type="step"]').not(".hidden").addClass("hidden"),this.$parentElement.find('[data-selector="'+r+'"]').removeClass("hidden"),jQuery(document).trigger(r+"_Shown")):(this.$parentElement.find('[data-selector="step-header"]#'+this.currentStepId).addClass(i.CLASS_DONE),this.$parentElement.find('[data-type="step"]').not(".hidden").addClass("hidden"),this.$parentElement.find('[data-selector="'+r+'"]').removeClass("hidden"));f=this.$parentElement.find("[data-selector='step-header'].current");n.Unilin.UnilinHelpers.scrollTo(jQuery(f).offset().top-jQuery(f).height()-100,500);t.preventDefault()},i.prototype.onStepShown=function(){},i}(t.FlooringBase);i.CLASS_CURRENT="current";i.CLASS_DONE="done";t.BaseStep=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.$element=n;this.initEvents()}return n.prototype.initEvents=function(){var n=this;this.$element.find("[data-selector='tab-header']").on("click",function(t){return n.selectTab(t)});jQuery(document).ready(function(){return n.initTabs()})},n.prototype.selectTab=function(t){var i=jQuery(t.currentTarget).prop("id");jQuery(t.currentTarget).toggleClass(n.CLASS_ACTIVE).siblings().removeClass(n.CLASS_ACTIVE);jQuery('[data-selector="'+i+'"]').toggleClass(n.CLASS_ACTIVE).siblings().removeClass(n.CLASS_ACTIVE);window.location.hash=jQuery(t.currentTarget).hasClass(n.CLASS_ACTIVE)?i:"";t.preventDefault()},n.prototype.initTabs=function(){var n=this.getHashInUrl();n.length>0&&jQuery(n).trigger("click")},n.prototype.getHashInUrl=function(){return jQuery(location).attr("hash")},n}();t.CLASS_ACTIVE="active";n.TabsHelper=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(r){function u(n){var t=r.call(this,n,null)||this;return t.$element=n,t.maskPlaceholder="_",t.computeHasNumber=function(){t.hasNumber(t.$phoneField.val().length>0||t.$landlineField.val().length>0)},t.initKnockout(),t.initElements(),ko.applyBindings(t,t.$element[0]),t.computeHasNumber(),t.initEvents(),t}return __extends(u,r),u.prototype.initElements=function(){var e=this,u,f,r;if(this.$form=this.$element.find("form"),this.$errorBox=this.$element.find('[data-selector="error-box"]'),this.$phoneField=this.$element.find("#Phone"),this.$landlineField=this.$element.find("#Landline"),this.$postalCodeInput=this.$element.find("#PostalCode"),this.$postalCodeMaskHiddenInput=this.$element.find("#PostalCodeMask"),this.$countryCodeHiddenInput=this.$element.find("#CountryCode"),this.updatePostalCodeMask(),u=jQuery("#CountryCode").val(),n.Unilin.IntlTelInput.initialize(this.$phoneField,"MOBILE",u),n.Unilin.IntlTelInput.initialize(this.$landlineField,"FIXED_LINE",u),f=i.Selectize.initializeAll(this.$element),r=f.filter(function(n){var t=n;return t&&t.$input&&t.$input.attr("id")==="Country"}),r&&r.length>0){this.$countrySelectize=r[0];this.$countrySelectize.on("change",function(n){return e.countryChanged(n)})}n.Unilin.UnilinHelpers.initializePopovers(this.$element);this.customValidation=new t.CustomValidationHelper(this.$element,this.$form,this.$nextButton,this.$errorBox,!0);this.reCaptcha=new n.Unilin.ReCaptcha(this.$form)},u.prototype.initEvents=function(){var n=this,t;this.$phoneField.on("input",function(){return n.computeHasNumber()});this.$landlineField.on("input",function(){return n.computeHasNumber()});t=this.$form.find('[data-selector="AcceptForm"]');t.on("click",function(t){return n.fixCheckboxBug(jQuery(t.currentTarget))});this.fixCheckboxBug(t)},u.prototype.initKnockout=function(){var n=this;this.hasNumber=ko.observable(!1);this.hasNumber.subscribe(function(){jQuery("#HasNumber").val(n.hasNumber()?"true":"false")})},u.prototype.onStepShown=function(){r.prototype.onStepShown.call(this);n.Unilin.GTM.getInstance().registerVirtualPageview("/Find"+this.componentType+"/"+this.stepType.toLowerCase()+"/step2",this.componentType+" "+this.stepType+" Step 2 - Personal Info")},u.prototype.onClickNext=function(n){var t=this;this.customValidation.validate(function(){r.prototype.onClickNext.call(t,n)})},u.prototype.fixCheckboxBug=function(n){var t=jQuery("input[name=AcceptForm]"),i;t.attr("style")||(t.attr("type",""),t.attr("style","position: absolute; left: -9999px;"));i=n.is(":checked")?"true":"false";t.val(i)},u.prototype.countryChanged=function(n){var r=this.$countrySelectize.getItem(n).find("span"),i,t;r&&(i=r.data("postalcodemask"),t=r.data("countrycode"),i?(this.$postalCodeInput.data("mask",i),this.updatePostalCodeMask()):this.$postalCodeInput.unmask(),t&&(this.$phoneField.intlTelInput("setCountry",t),this.$landlineField.intlTelInput("setCountry",t)),this.$postalCodeMaskHiddenInput.val(i),this.$countryCodeHiddenInput.val(t))},u.prototype.updatePostalCodeMask=function(){var n=this;this.$element.find("[data-mask]").each(function(t,i){var r=jQuery(i);r.maskinput(""+r.data("mask"),{placeholder:n.maskPlaceholder})})},u}(t.BaseStep);i.ContactForm=r})(i=t.Shared||(t.Shared={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n,t){var r=i.call(this,n,"js"+t.componentType.toLowerCase()+"detail")||this;return r.$element=n,r.params=t,r.initElements(),r}return __extends(r,i),r.prototype.initElements=function(){this.$form=this.$parentElement.find("form");this.$notificationBox=this.$element.find('[data-selector="notification-placeholder"]')},r.prototype.getSubmitModel=function(){var n={},r=this.$form.serializeArray(),t,i;return r.forEach(function(t){return n[t.name]=t.value}),n.RoomTypes=r.filter(function(n){return n.name==="RoomTypes"}).map(function(n){return n.value}),n.RoomTypes.shift(),t=jQuery("#Phone"),i=jQuery("#Landline"),t.intlTelInput("isValidNumber")&&t.val().length>0&&(n.Phone=t.intlTelInput("getNumber")),i.intlTelInput("isValidNumber")&&i.val().length>0&&(n.Landline=i.intlTelInput("getNumber")),n},r.prototype.onStepShown=function(){var f=this,t=function(n,t){var i=f.$element.find('[data-selector="'+n+'"]');i.html(t);i.prop("type")==="checkbox"&&i.prop("checked",t==="true")},n=this.getSubmitModel(),i,e,o,r,u;for(i in n)t(i,n[i]);e=n.RoomTypes.map(function(n){return f.$form.find('div[data-value="'+n+'"] span').text()+"<\/br>"});t("RoomTypes",e);o=""+this.$form.find('div[data-value="'+n.Salutation+'"] span').first().text();t("Salutation",o);var s=n.Phone,h=n.Landline,c=this.$element.find('[data-selector="Phone-container"]');s?c.show():c.hide();r=this.$element.find('[data-selector="Landline-container"]');h?r.show():r.hide();u=this.$element.find('[data-selector="phone-numbers-container"]');s||h?u.show():u.hide()},r.prototype.onClickNext=function(r){var u=this;t.FlooringHelpers.showFullScreenWaitPanel();window.$http.postAsFormData(this.params.submitUrl,this.getSubmitModel()).done(function(f){if(f){var e=t.FlooringHelpers.getJsonScript(f);e&&e.succeeded?i.prototype.onClickNext.call(u,r):(u.$notificationBox.html(f),u.$notificationBox.show())}n.Unilin.ReCaptcha.reset()}).always(function(){t.FlooringHelpers.hideWaitPanel();u.registerEvent(u.params.gtmEventName)})},r}(t.BaseStep);i.Overview=r})(i=t.Shared||(t.Shared={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(i){function r(n,t){var r=i.call(this,n,null)||this;return r.$element=n,r.params=t,r.calendar=null,r.initElements(),ko.applyBindings(r,r.$element[0]),r}return __extends(r,i),r.prototype.initElements=function(){this.$form=this.$element.find('[data-selector="appointment-calendar-form"]');this.$errorBox=this.$element.find('[data-selector="error-box"]');this.params.calendarSettings&&(this.calendar=new t.Calendar(this.$element,this.params.calendarSettings));this.customValidation=new t.CustomValidationHelper(this.$element,this.$form,this.$nextButton,this.$errorBox,!0)},r.prototype.onStepShown=function(){i.prototype.onStepShown.call(this);n.ScBase.Unilin.GTM.getInstance().registerVirtualPageview("/FindDealer/appointment/step1","Dealer Appointment Step 1 - Date and hour")},r.prototype.onClickNext=function(n){var t=this;this.customValidation.validate(function(){i.prototype.onClickNext.call(t,n)})},r}(t.BaseStep);i.Step1=r})(i=t.Appointment||(t.Appointment={}))})(i=t.Flooring||(t.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(t){var i;(function(t){var i;(function(i){var r=function(i){function r(n,t){var r=i.call(this,n,t)||this;return r.$element=n,r.params=t,r.latitude=null,r.longitude=null,r.numberFormatter=new Intl.NumberFormat(r.contentLanguage,{style:"decimal",maximumFractionDigits:20}),r}return __extends(r,i),r.prototype.onStepShown=function(){var r=this,u,f;i.prototype.onStepShown.call(this);t.FlooringHelpers.showFullScreenWaitPanel();var e=new Date(this.$form.find("#SelectedDate").val()),o=this.$form.find("#Timeslot").val(),s=jQuery('meta[property="og:locale"]').attr("content"),h=e.toLocaleDateString(s,{weekday:"long",year:"numeric",month:"long",day:"numeric"}),c=this.$element.find('[data-selector="Appointment"]');c.html(h+"<br/>"+o);u=new google.maps.Geocoder;f=this.$element.find('[data-selector="Address"]').text().trim().replace(/\s+/g," ");this.latitude=null;this.longitude=null;t.FlooringHelpers.getLongLat(u,f).done(function(n){r.latitude=r.numberFormatter.format(n[0].geometry.location.lat());r.longitude=r.numberFormatter.format(n[0].geometry.location.lng())}).always(function(){return t.FlooringHelpers.hideWaitPanel()});n.ScBase.Unilin.GTM.getInstance().registerVirtualPageview("/FindDealer/appointment/step3","Dealer Appointment Step 3 - Summary")},r.prototype.getSubmitModel=function(){var n=i.prototype.getSubmitModel.call(this);return n.Latitude=this.latitude,n.Longitude=this.longitude,n},r.prototype.onClickNext=function(t){i.prototype.onClickNext.call(this,t);var r=n.ScBase.Unilin.GTM.getInstance();r.registerVirtualPageview("/FindDealer/appointment/step4","Dealer Appointment Step 4 - Confirmation");r.registerEvent("jsfinddealer","DealerAppointment",this.$element.find("#DealerName").data("name"))},r}(t.Shared.Overview);i.Step3=r})(i=t.Appointment||(t.Appointment={}))})(i=t.Flooring||(t.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(i){function r(n){var t=i.call(this,n,null)||this;return t.$element=n,t.initElements(),t}return __extends(r,i),r.prototype.initElements=function(){this.$form=this.$element.find('[data-selector="question-input-form"]');this.$errorBox=this.$element.find('[data-selector="error-box"]');this.customValidation=new t.CustomValidationHelper(this.$element,this.$form,this.$nextButton,this.$errorBox)},r.prototype.onStepShown=function(){i.prototype.onStepShown.call(this);n.Unilin.GTM.getInstance().registerVirtualPageview("/Find"+this.componentType+"/question/step1",this.componentType+" Question Step 1 - Question")},r.prototype.onClickNext=function(n){var t=this;this.customValidation.validate(function(){i.prototype.onClickNext.call(t,n)})},r}(t.BaseStep);i.Step1=r})(i=t.Question||(t.Question={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i;(function(i){var r=function(t){function i(n,i){var r=t.call(this,n,i)||this;return r.$element=n,r.params=i,r}return __extends(i,t),i.prototype.onStepShown=function(){t.prototype.onStepShown.call(this);n.Unilin.GTM.getInstance().registerVirtualPageview("/Find"+this.componentType+"/question/step3",this.componentType+" Question Step 3 - Summary")},i.prototype.onClickNext=function(i){t.prototype.onClickNext.call(this,i);var r=n.Unilin.GTM.getInstance();r.registerVirtualPageview("/Find"+this.componentType+"/question/step4",this.componentType+" Question Step 4 - Confirmation");r.registerEvent("js"+this.componentType.toLowerCase()+"detail",this.componentType+"Question",this.$element.find("#DealerName").data("name"))},i}(t.Shared.Overview);i.Step3=r})(i=t.Question||(t.Question={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(t){var i=n.Unilin.BlazyImageBase,r=function(){function n(n){this.$element=n;this.$element.find(".collapse").on("hidden.bs.collapse",function(n){jQuery(n.currentTarget).css("height","")});this.$element.find(".collapse").on("shown.bs.collapse shown.bs.tab",function(){i.revalidate()})}return n}();t.FloorDetail=r})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(t){function i(i){var r=t.call(this,i)||this;return r.$element=i,n.Unilin.UnilinHelpers.initializePopovers(i),r}return __extends(i,t),i}(t.FlooringBase);t.FloorSpecifications=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(t){var i=function(i){function r(r,u){var f=i.call(this,r)||this;return f.$element=r,f.params=u,f.$price=f.$element.find('[data-selector="price"]'),n.Unilin.UnilinHelpers.initializePopovers(r),f.priceFormat=new Intl.NumberFormat(f.contentLanguage,{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2,minimumIntegerDigits:1}),f.calculator=new t.QuantityCalculator(r,!0,function(n){return f.updatePrice(n)}),u.enableProjectCalculator&&(f.projectCalculator=new t.ProjectCalculatorWidget(f.$element,u.productCode,u.startProjectEndpoint)),f}return __extends(r,i),r.prototype.onAddToCartTriggered=function(n){var r=jQuery(n.currentTarget),t,i;r&&(n.preventDefault(),t=1,i=this.$component.find('input[data-selector="quantity"]'),i.length>0&&(t=i.val()),this.shoppingCartManager.addB2CMaterial(r,t))},r.prototype.updatePrice=function(n){var i=t.FlooringHelpers.getFloatValue(this.$price.data("price"))*n;this.$price.text(this.priceFormat.format(i))},r}(t.ComponentWithProductActions);t.Calculator=i})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n){this.$element=n;this.initElements();this.initEvents();this.$description.height()>this.$descriptionContainer.height()?this.$readMoreToggle.css("visibility","visible"):this.$readMoreToggle.hide()}return n.prototype.initElements=function(){this.$readMoreToggle=this.$element.find('[data-selector="read-more-toggle"]');this.$descriptionOverlay=this.$element.find('[data-selector="description-overlay"]');this.$descriptionContainer=this.$element.find('[data-selector="description-container"]');this.$description=this.$element.find('[data-selector="description"]')},n.prototype.initEvents=function(){var n=this;this.$readMoreToggle.click(function(){n.$descriptionOverlay.fadeIn(200)});this.$descriptionOverlay.mouseleave(function(){n.$descriptionOverlay.hide()});jQuery(window).click(function(t){var i=jQuery(t.target);i.is(n.$descriptionOverlay)||i.is(n.$readMoreToggle)||n.$descriptionOverlay.hide()})},n}();n.Description=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(n){var t=function(){function n(n,t,i){i===void 0&&(i=null);var r=this;this.$element=n;this.calendarSettings=t;this.onClickDayDelegate=i;this.currentTimeSlots=ko.observableArray([]);this.selectedTimeslot=ko.observable(null);this.selectedDate=ko.observable(null);this.$calendar=this.$element.find('[data-selector="calendar"]').datepicker({minDate:new Date(this.calendarSettings.minimumDate),maxDate:new Date(this.calendarSettings.maximumDate),beforeShowDay:function(n){return r.renderDate(n)},onSelect:function(){return r.dayOnClick()}});this.moveToFirstAvailableDayNotExcluded();this.dayOnClick()}return n.prototype.renderDate=function(n){var t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()));return this.calendarSettings.excludeDays&&this.isExcludeDay(t)?[!1]:this.calendarSettings.availableDays&&this.isInAvailableDates(t)?[!0,"available-day"]:this.calendarSettings.freeVisitDays&&this.isFreeVisitDay(t)?[!1,"free-visit-day"]:[!1]},n.prototype.isInAvailableDates=function(n){if(!this.calendarSettings.availableDays)return!1;for(var t=0;t<this.calendarSettings.availableDays.length;t++)if(n.valueOf()===new Date(this.calendarSettings.availableDays[t].date).valueOf())return!0;return!1},n.prototype.isFreeVisitDay=function(n){if(!this.calendarSettings.freeVisitDays)return!1;for(var t=0;t<this.calendarSettings.freeVisitDays.length;t++)if(n.getUTCDay()===this.calendarSettings.freeVisitDays[t]%7)return!0;return!1},n.prototype.isExcludeDay=function(n){var t,i;if(!this.calendarSettings.excludeDays)return!1;for(t=0;t<this.calendarSettings.excludeDays.length;t++)if(this.calendarSettings.excludeDays[t].excludeYearly){if(i=new Date(this.calendarSettings.excludeDays[t].date),n.getDate()===i.getDate()&&n.getMonth()===i.getMonth())return!0}else if(n.valueOf()===new Date(this.calendarSettings.excludeDays[t].date).valueOf())return!0;return!1},n.prototype.dayOnClick=function(){for(var i=this.$calendar.datepicker("getDate"),r=new Date(Date.UTC(i.getFullYear(),i.getMonth(),i.getDate())),n,t=0;t<this.calendarSettings.availableDays.length;t++)if(r.valueOf()===new Date(this.calendarSettings.availableDays[t].date).valueOf()&&!this.isExcludeDay(r)){n=this.calendarSettings.availableDays[t];break}if(n&&(this.currentTimeSlots(n.timeSlots),this.selectedDate(n),this.onClickDayDelegate))this.onClickDayDelegate(this.selectedDate)},n.prototype.moveToFirstAvailableDayNotExcluded=function(){var n=this.$calendar.datepicker("getDate"),t=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()));this.$calendar.datepicker("setDate",this.getNextAvailableAndNotExcludedDateFollowing(t))},n.prototype.getNextAvailableAndNotExcludedDateFollowing=function(n){if(this.isInAvailableDates(n)&&!this.isExcludeDay(n))return n;var t=new Date(n);return t.setDate(n.getDate()+1),this.getNextAvailableAndNotExcludedDateFollowing(t)},n.prototype.getSelectedTimeslotHours=function(n){for(var i,t=0;t<this.selectedDate().timeSlots.length;t++)this.selectedDate().timeSlots[t].id===n&&(i=this.selectedDate().timeSlots[t].hours);return i},n}();n.Calendar=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__assign=this&&this.__assign||Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},function(n){var t;(function(n){var t;(function(n){var t;(function(n){var i=function(){function n(){}return n}(),t;n.ISelectizeListItem=i;t=function(){function n(){}return n.initialize=function(n,t){var s=n.data("showremovebuttons")==="True",h=n.data("restoreonbackspace")==="True",c=n.data("createitems")==="True",e=n.data("options"),l=n.data("key"),r=[],i;s&&r.push("remove_button");h&&r.push("restore_on_backspace");var u=n.find('select[data-selector="'+l+'"]').selectize(__assign({plugins:r,persist:!1,create:c,options:e,valueField:"value",labelField:"text",render:{item:function(n){return"<div><span class='"+n["class"]+"' "+n.data+">"+n.text+"<\/span><\/div>"},option:function(n){return"<div><span class='"+n["class"]+"' "+n.data+">"+n.text+"<\/span><\/div>"}}},t)),o=u[0].selectize,f=e.filter(function(n){return n.selected});return f&&f.length&&(i=f.map(function(n){return n.value}),i&&i.length&&o.setValue(i)),u.show(),u.attr("style","position: absolute; left: -99999px;"),o},n.initializeAll=function(t){var i=[];return t.find("[data-selector=selectize]").each(function(t,r){var u=n.initialize(jQuery(r));i.push(u)}),i},n}();n.Selectize=t})(t=n.Shared||(n.Shared={}))})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}));__extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},function(n){var t;(function(n){var t;(function(n){var t=function(t){function i(i,r,u){r===void 0&&(r=!1);u===void 0&&(u=null);var f=t.call(this,i)||this;return f.shoppingCartManager=new n.ShoppingCartManager(i),f.update=u,f.calculateOnKeyDown=r,f.numberFormat=new Intl.NumberFormat(f.contentLanguage,{style:"decimal",minimumFractionDigits:0,maximumFractionDigits:4,minimumIntegerDigits:1}),f.initEvents(),f}return __extends(i,t),i.prototype.initEvents=function(){var n=this,t=function(t){if(t.length){var i=n.shoppingCartManager.getQuantityFromTotalSize(t);n.calculateInputs(t,i)}},i=function(t){if(t.length){var i=n.shoppingCartManager.getQuantity(t);n.calculateInputs(t,i)}};if(this.calculateOnKeyDown){this.$component.on("keydown",'[data-selector="total-size"]',function(i){return n.executeCalculation(i,t,1e3)});this.$component.on("keydown",'[data-selector="quantity"]',function(t){return n.executeCalculation(t,i,500)})}this.$component.on("blur",'[data-selector="total-size"]',function(i){n.clearTimer();t(jQuery(i.currentTarget))});this.$component.on("blur",'[data-selector="quantity"]',function(t){n.clearTimer();i(jQuery(t.currentTarget))})},i.prototype.clearTimer=function(){this.inputTimer&&(clearTimeout(this.inputTimer),this.inputTimer=undefined)},i.prototype.executeCalculation=function(n,t,i){this.clearTimer();var r=jQuery(n.currentTarget),u=n.keyCode===8;u&&r.val().length===1||(this.inputTimer=setTimeout(t,u?2e3:i,r))},i.prototype.calculateInputs=function(t,i){var u;if(i&&!(i<0)){var e=t.parents('[data-selector="calculator"]'),o=e.find('[data-selector="total-size"]'),f=e.find('[data-selector="quantity"]'),r=n.FlooringHelpers.getFloatValue(o.data("packed-size"));(isNaN(r)||r<=0)&&(r=1);u=r*i;o.val(this.numberFormat.format(u));f.data("value-old",u);f.val(i);f.data("value-old",i);this.update!=null&&this.update(u,t,i)}},i}(n.FlooringBase);n.QuantityCalculator=t})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={})),function(n){var t;(function(n){var t;(function(){$.fn.hasAttr=function(n){return this.attr(n)!==undefined}})(t=n.Flooring||(n.Flooring={}))})(t=n.ScBase||(n.ScBase={}))}(Dlw||(Dlw={}))