1 2function initCustomerProfileBanner(){document.querySelectorAll(".customerProfileBanner").forEach(e=>{new Swiper(e,{slidesPerView:1,slidesPerGroup:1,loop:!0,watchSlidesProgress:!0,autoplay:{delay:8e3},pause:{enabled:!0,el:e.querySelector(".swiper-button-pause")},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})})}$(".customerProfileBanner").length>0&&initCustomerProfileBanner(),$("li.coupons-js, li.discounts-js").on("click",function(e){setTimeout(function(){$(".customerProfileBanner").length>0&&initCustomerProfileBanner()},1e3)}),$("body").on("click",".discountsDetails-js",function(e){$(".discountsDetailsTemplate-js").removeClass("hidden"),$(".discountsMainTemplate-js").addClass("hidden"),window.scroll(top);var t=$(e.currentTarget).data("url"),n=$(e.currentTarget).data("template"),s=$(".discountsDetailsTemplate-js");$(e.currentTarget).hasClass("coupon-js"),$.get(t,{__collection:"customer-profile.DiscountERPDetails",__template:n,__include:__onePageShop},function(e){e&&e.collection&&e.template&&s.html(e.template)})}),$("body").on("click",".discountsDetailsButton-js",function(e){$(".discountsDetailsTemplate-js").addClass("hidden"),$(".discountsMainTemplate-js").removeClass("hidden")}); 3 4function initCustomerProfileBanner(){document.querySelectorAll(".customerProfileBanner").forEach(e=>{new Swiper(e,{slidesPerView:1,slidesPerGroup:1,loop:!0,watchSlidesProgress:!0,autoplay:{delay:8e3},pause:{enabled:!0,el:e.querySelector(".swiper-button-pause")},navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"}})})}$(".customerProfileBanner").length>0&&initCustomerProfileBanner(),$("li.coupons-js, li.discounts-js").on("click",function(e){setTimeout(function(){$(".customerProfileBanner").length>0&&initCustomerProfileBanner()},1e3)}),$("body").on("click",".discountsDetails-js",function(e){$(".discountsDetailsTemplate-js").removeClass("hidden"),$(".discountsMainTemplate-js").addClass("hidden"),window.scroll(top);var t=$(e.currentTarget).data("url"),n=$(e.currentTarget).data("template"),s=$(".discountsDetailsTemplate-js"),o="customer-profile.DiscountERPDetails";$(e.currentTarget).hasClass("coupon-js")&&(o="customer-profile.CouponDetails"),$.get(t,{__collection:o,__template:n,__include:__onePageShop},function(e){e&&e.collection&&e.template&&s.html(e.template)})}),$("body").on("click",".discountsDetailsButton-js",function(e){$(".discountsDetailsTemplate-js").addClass("hidden"),$(".discountsMainTemplate-js").removeClass("hidden"),$(function(){$(".customer__content-js").addClass("customer__content--width")})}),$(document).ready(function(){$("li.coupons-js").hasClass("active-js")&&$(function(){$(".customer__content-js").addClass("customer__content--width")})}); 5 6$(function(){window.initRecommendedProductsSlider=function(){lazy.init(".recommended-products-box-js",e=>new Swiper(e,{slidesPerView:3,slidesPerGroup:1,spaceBetween:15,navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},breakpoints:{0:{slidesPerView:1,slidesPerGroup:1},701:{slidesPerView:2,slidesPerGroup:1},1190:{slidesPerView:3,slidesPerGroup:1}}}))},initRecommendedProductsSlider()}),$("body").on("click",".recommended-products-box-item-js .js-addToCart",function(e){if(e.preventDefault(),1!=app.isPlacingOrdersLockDueToTime()){if(!e.detail||1==e.detail){var t=$(this),i=t.closest(".recommended-products-box-js"),a=$(this).find('input[name="productId"]').val(),d=$(this).find('input[name="item-url"]').val();if($(".popup-dialog:not(.image-rotate-popup)").remove(),t.hasClass("js-notifyAboutAvailability"))t.find(".notify-about-availability-popup").remove(),$.get(d,{__template:"partials/common/notify-about-availability-popup.html"},function(e){i.append(e.template);var d=$(t).find("span").data("popup-class");$(d).find('input[name="productId"]').val(a),$(d).removeClass("hidden"),productDetailsFunctions.checkWishList(a),$(d).show()});else if(t.hasClass("js-askForPrice"))t.find(".ask-for-price-popup").remove(),$.get(d,{__template:"partials/common/ask-for-price-popup.html"},function(e){i.append(e.template);var d=$(t).find("span").data("popup-class");$(d).find('input[name="productId"]').val(a),$(d).removeClass("hidden"),productDetailsFunctions.checkWishList(a),$(d).show()});else{if("PDnewVariant"==__productDetailsVariant)var o=!0;else o=!1;$.get(d,{__collection:"product-details.Product",__template:"partials/products-list/add-to-cart-popup.html"},function(e){if(i.append(e.template),$("body").addClass("noscroll"),t.hasClass("js-setAISource")&&i.find("#AddToCartForm").append('<input type="hidden" name="source" value="2"/>'),$("#cartPage").index()>-1&&(i.find(".product-item__cartPopup .recommended-products-box-js").remove(),i.find("#after-adding-to-cart").val(1),i.find(".product-item__cartPopup--container").css("min-height","400px")),1==o?i.find(".product-item__cartPopup--oldView").remove():i.find(".product-item__cartPopup--newView").remove(),t.hasClass("recommended-item-discount-js")){var a=i.find(".product-item__cartPopup .product-details__prices");o&&(a=i.find(".product-item__cartPopup .productDetails-details--prices")),a.find(".min-price").addClass("hidden"),a.find(".red-price").addClass("hidden"),a.find(".old-price").addClass("hidden");var d=t.find("input[name=value]"),n=Number(d.val());n<=0?(n=d.data("free"),a.find(".price span").text(n)):a.find(".price .value").text(n.toPrice());var p=i.find(".product-item__cartPopup .quantity__field-js"),r=Number(t.find("input[name=quantity]").val()),s=t.find("input[name=saleUnit]").val();o&&(s=""),p.val(r),p.attr("type","hidden"),p.parent().find("button").addClass("hidden"),p.parent().append("<span>"+r+" "+s+"</span>")}addClipAndBatchToCartInPopup(!0),changeAttributesDivToSelectInPopup(),changeAttributesPolyToSelectInPopup(),initProductDetailsInPopup(!0),null!=e.collection.Image&&null!=e.collection.Image.Id&&-1!=e.collection.Image.Id&&e.collection.Image.Link?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="img/medium/'+e.collection.Image.Id+"/"+e.collection.Image.Link+'.jpg">'):null!=e.collection.Image&&null!=e.collection.Image.ExternalUrl&&""!=e.collection.Image.ExternalUrl?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="'+e.collection.Image.ExternalUrl+'">'):$(".product-details__detailsWrapper--productImage").append('<i><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#image-light"></use></svg></i>')})}}}else app.getOrdersUnablePopup()}); 7 8let isHoldingMyCard=!1,myCardStartCursor=0;var customerProfile={indexToFocusAfter:null,init:function(){customerProfile.removeFooterOnMobile(),customerProfile.events(),customerProfile.showOrderLink(),sessionStorage.clear()},removeFooterOnMobile:function(){var e=document.querySelector("body footer");window.matchMedia("screen and (max-width: 599px)").matches?(e.style.display="none",e.style.visibility="hidden"):(e.style.display="block",e.style.visibility="visible")},showTabContent:function(e){e.stopImmediatePropagation();var t=e.currentTarget.dataset.template,o=document.querySelector(".customer__content-js"),n=window.matchMedia("screen and (max-width: 599px)"),r=document.querySelector("main");sessionStorage.getItem(t)?(o.innerHTML=sessionStorage.getItem(t),"my-card"===t?o.classList.add("customer__content--width"):o.classList.remove("customer__content--width"),!n.matches&&t.includes("orders")?r.style.height=o.clientHeight+300+"px":r.style.height="unset",app.getBarcode(),setTimeout(function(){customerProfile.allowToFocusOnMenuItems(),1!=e.detail&&app.getFirstFocusableInContainer(".customer__content")},200)):customerProfile.currentTabTemplateUpdate(e,t)},showHideHiddenForm:function(e){var t,o,n=e.currentTarget.parentNode.querySelector(".customer__hiddenForm-js"),r=document.querySelectorAll(".customer__editHiddenFormBtn-js"),s=e.currentTarget.querySelector("svg use"),a=n.parentNode,i=a.classList.contains("customer__contentBox"),c=a.parentNode.querySelector(".popupBackgroun
8d-js"),d=s.dataset.icon,u=e.currentTarget.dataset.icon;if("pen"===d||"plus"===d){for(var l=0;l<r.length;l++)t=(o=r[l]).querySelector("svg use"),o.parentNode.querySelector(".customer__hiddenForm-js").classList.remove("editMode-js"),u=o.dataset.icon,customerProfile.changeIcon(t,u);n.classList.add("editMode-js"),a.classList.add("editSection-js"),s.setAttribute("xlink:href","css/img/icons-sprite.svg#times-light"),s.dataset.icon="times",i&&c.classList.remove("hidden"),ui.formLabelAnimationOnLoadPage(),app.activateFocusTrap(".editSection-js",e.currentTarget)}else n.classList.remove("editMode-js"),a.classList.remove("editSection-js"),customerProfile.changeIcon(s,u),i&&c.classList.add("hidden")},changeIcon:function(e,t){"pen"===t?(e.setAttribute("xlink:href","css/img/icons-sprite.svg#pen-"+__iconStyle),e.dataset.icon="pen"):(e.setAttribute("xlink:href","css/img/icons-sprite.svg#plus-"+__iconStyle),e.dataset.icon="plus")},disableEnableCustomerProfileScrolling:function(){$(".customer__menu-js").hasClass("customer__menuActive-js")&&$(window).width()<769&&window.innerHeight>window.innerWidth?$("body").css("overflow-y","hidden"):$("body").css("overflow-y","visible")},hideCustomerProfileMenu:function(){document.querySelector(".customer__menu-js").classList.remove("customer__menuActive-js"),customerProfile.disableEnableCustomerProfileScrolling(),customerProfile.allowToFocusOnMenuItems()},showCustomerProfileMenu:function(){var e=document.querySelector(".customer__menu-js");e.classList.contains("customer__menuActive-js")?e.classList.remove("customer__menuActive-js"):e.classList.add("customer__menuActive-js"),customerProfile.disableEnableCustomerProfileScrolling(),customerProfile.allowToFocusOnMenuItems()},showHideSubmenu:function(e){var t=document.querySelector(".customer__menu-js"),o=$(t).find("li.active-js"),n=e.currentTarget.parentNode;$.each(o,function(e,t){$(t).removeClass("active-js")}),$(e.currentTarget).addClass("active-js"),n.classList.contains("customerPrimaryMenu-js")?$(e.currentTarget).find("ul > li").first().addClass("active-js"):$(e.currentTarget).parent().parent().addClass("active-js"),customerProfile.allowToFocusOnMenuItems()},allowToFocusOnMenuItems:function(e){$(window).width()>768?($(".customer__menu--submenu").find("li").attr("tabindex","0").attr("role","button"),$(".customerPrimaryMenu-js li").find(".customer__menu--label").attr("tabindex","0").attr("role","button"),$(".customer__menu-js").parent().find('a[href], button:not([disabled]), textarea, input:not([disabled]):not([type="hidden"]):not([tabindex="-1"]), select, [tabindex]:not([tabindex="-1"])').attr("tabindex","0"),$(".customer-focus").removeAttr("role"),$(".customer-focus").attr("tabindex","-1"),$(".mobileLogoutButton").attr("tabindex","-1")):($(".customer__menu-js:not(.customer__menuActive-js)").parent().find(".customer-focus").attr("role","button"),$(".customer__menu-js:not(.customer__menuActive-js)").parent().find('.customer-focus, a[href], button:not([disabled]), textarea, input:not([disabled]):not([type="hidden"]):not([tabindex="-1"]), select, [tabindex]:not([tabindex="-1"])').attr("tabindex","0"),$(".customer__menuActive-js").parent().find('.customer-focus, a[href], button:not([disabled]), textarea, input:not([disabled]):not([type="hidden"]):not([tabindex="-1"]), select, [tabindex]:not([tabindex="-1"])').attr("tabindex","-1"),$(".customer__menuActive-js").parent().find(".customer-focus").removeAttr("role"),$(".customer__menu-js:not(.customer__menuActive-js)").parent().find(".customerLogout-js").attr("tabindex","-1"),$(".customer__menuActive-js").parent().find(".customerLogout-js").attr("tabindex","0"),$(".customer__menu-js").hasClass("customer__menuActive-js")?($(".customer__menu--submenu").find("li").attr("tabindex","0").attr("role","button"),$(".customerPrimaryMenu-js li").find(".customer__menu--label").attr("tabindex","0").attr("role","button")):($(".customer__menu--submenu").find("li").attr("tabindex","-1").removeAttr("role"),$(".customerPrimaryMenu-js li").find(".customer__menu--label").attr("tabindex","-1").removeAttr("role")))},currentTabTemplateUpdate:function(e,t,o="",n=!0){var r=document.querySelector(".customer__content-js"),s="partials/customer/"
8+t+".html",a=window.matchMedia("screen and (max-width: 599px)"),i=document.querySelector("main"),c=!1;let d=[];d.push({name:"__template",value:s}),"wish-list"===t&&""!==o&&(d.push({name:"__action",value:"Product/WishListDelete"}),d.push({name:"__csrf",value:__CSRF}),d.push({name:"productId",value:o}),d.push({name:"fav",value:1}));var u=new URLSearchParams(window.location.search);switch(t){case"discounts/discounts":u.set("tab","discounts");break;case"coupons/coupons":u.set("tab","coupon"),c=!0;break;case"history":u.set("tab","history");break;case"consents":u.set("tab","consents");break;case"reviews":u.set("tab","reviews-active");break;case"reviews-comented":u.set("tab","reviews-commented");break;case"wish-list":u.set("tab","wish-list");break;case"complains":u.set("tab","complains-active");break;case"complains-completed":u.set("tab","complains-completed");break;case"loyalty-program":u.set("tab","loyalty");break;case"my-card":u.set("tab","my-card"),c=!0;break;case"orders":u.set("tab","orders-active");break;case"orders-completed":u.set("tab","orders-completed");break;case"account-data":default:u.set("tab","account-data");break;case"account-data-address":u.set("tab","address")}u.delete("orderId"),u.delete("orderHash"),window.history.replaceState(null,null,__canonicalLink+"?"+u),$.post(null,d,function(o){var s=o.template;r.innerHTML=s,c?r.classList.add("customer__content--width"):r.classList.remove("customer__content--width"),sessionStorage.setItem(t,s),!a.matches&&t.includes("orders")?i.style.height=r.clientHeight+300+"px":i.style.height="unset",app.getBarcode(),setTimeout(function(){customerProfile.allowToFocusOnMenuItems(),n&&1!=e.detail&&app.getFirstFocusableInContainer(".customer__content")},200)})},cuponTabTemplateUpdate:function(){if("coupon-details"===new URLSearchParams(window.location.search).get("tab")){$(".discountsDetailsTemplate-js").removeClass("hidden"),$(".discountsMainTemplate-js").addClass("hidden"),$(".customer__menuActive-js").removeClass("customer__menuActive-js").addClass("customer__menu-js");const e=window.location.pathname,t=window.location.search,o=e.substring(1)+t,n=$(".discountsDetailsTemplate-js"),r="customer-profile.CouponDetails",s="partials/customer/coupons/coupon-details.html";$.get(o,{__collection:r,__template:s,__include:__onePageShop},function(e){e&&e.collection&&e.template&&n.html(e.template)})}},paginationChangeTab:function(e){var t=$(e.currentTarget.querySelectorAll("input")).serializeArray(),o=document.querySelector(".customer__content-js");$.get(null,t,function(t){o.innerHTML=t.template,$(window).scrollTop(0),customerProfile.allowToFocusOnMenuItems(),1!=e.detail&&app.getFirstFocusableInContainer(".customer__content-js")})},showOrderLink:function(){$(".hashLink-js").length>0&&$(".showOrder-js").trigger("click")},showOrderDetails:function(e){let t=e.currentTarget;var o=e.currentTarget.dataset.id,n=[{name:"__collection",value:"customer-profile.Order"},{name:"__template",value:"partials/customer/order-content.html"}];window.location.search.includes("orderId")||o&&n.push({name:"orderId",value:o});var r=document.createElement("div"),s=document.querySelector(".customer__content-js"),a=function(){var e=window.matchMedia("screen and (max-width: 599px)"),t=0,o=document.querySelector(".customer__content-js").clientHeight;$(window).scrollTop(0),e.matches||(o<(t=document.querySelector(".orderContent").clientHeight+150)?(document.querySelector(".orderContent").style.height=t+"px",document.querySelector("main").style.height=t+150+"px"):(document.querySelector(".orderContent").style.height=o+"px",document.querySelector("main").style.height=o+150+"px")),customerProfile.setDigitalProductLink()};r.classList.add("order"+o,"customer__orderContent"),r.setAttribute("data-id",o),null!=o&&sessionStorage.getItem("order"+o)?(r.innerHTML=sessionStorage.getItem("order"+o),s.append(r),a()):$.get("",n,function(e){r.innerHTML=e.template,s.append(r),sessionStorage.setItem("order"+o,r.innerHTML),a()}),setTimeout(function(){$(window).width()<=768?app.activateFocusTrap(".order"+o,t):1!=e.detail&&app.getFirstFocusableInContainer(".order"+o)},200)},customerUpdate:function(e){app.post(e,customerProfile.currentTabTemplateUpdate,[e,"account-data"])},customerDeliveryAddressUpdate:function(e){app.post(e,function(){$(".editSection-js").find(".customer__editHiddenFormBtn-js").click(),customerProfile.currentTabTemplateUpdate(e,"account-data-address","",!1);const t=setTimeout(function(){app.activateFocusTrap(".temporaryPopupBg",document.querySelectorAll(".customer__editAddress-js")[customerProfile.indexToFocusAfter]),customerProfile.indexToFocusAfter=null,clearTimeout(t)},500);$(e.currentTarget).parents(".customer__contentBox").find('input[name="__action"]').val("Order/DeliveryAddressUpdate")})},productWishListDelete:function(e){let t=$(e.currentTarget).data("product-id");if(customerProfile.currentTabTemplateUpdate(e,"wish-list",t),$(".bottomMenu")){var o=parseInt($(".bottomMenu .menuItem .favouriteItems").text())-1;$(".bottomMenu .menuItem .favouriteItems").text(o),parseInt($(".bottomMenu .menuItem .favouriteItems").text())>0?$(".bottomMenu .menuItem .favouriteItems").removeClass("hidden"):$(".bottomMenu .menuItem .favouriteItems").addClass("hidden")}$(".headerThirdType")&&(o=parseInt($(".favCounter").text())-1,$(".favCounter").text(o),parseInt($(".favCounter").text())>0?$(".favCounter").removeClass("hidden"):$(".favCounter").addClass("hidden"))},closeOrderDetails:function(e){var t=e.currentTarget.dataset.id;$("main .order"+t).remove()},setComplainReturnRadioButtons:function(e,t){"true"!==e?(t.addClass("hidden"),t.find("input").attr("disabled","true")):(t.removeClass("hidden"),t.find("input").removeAttr("disabled"))},addDataToComplaintForm:function(e){$.get("",{__template:"partials/common/complaint-popup.html"},function(t){$(".customer__content-js").append(t.template),$(".popupDialog__complain").show(),$("body").addClass("customerProfileNoScroll");var o=e.currentTarget,n=$(".productImage-js"),r=$(".productName-js"),s=$(".productAmount-js"),a=$(".radioReturn-js"),i=$(".radioComplaint-js"),c=$(".productId-js"),d=$(".quantity__field-js"),u=$(".orderId-js"),l=$(".orderComplaintOrReturnAdd-js"),m=$
8(".orderDate-js");r.text(o.dataset.productName),s.text(o.dataset.productCount),c.val(o.dataset.productId),d.attr("max",o.dataset.productQuantity),u.val(o.dataset.orderId),l.attr("data-id",o.dataset.orderId),m.attr("min",o.dataset.orderDate),"-1"===o.dataset.imageId||o.dataset.imageext?o.dataset.imageext?(n.attr("src",o.dataset.imageext),n.closest("figure").removeClass("noImage-js")):n.closest("figure").addClass("noImage-js"):(n.attr("src","img/medium/"+o.dataset.imageId+"/img.jpg"),n.closest("figure").removeClass("noImage-js")),customerProfile.setComplainReturnRadioButtons(o.dataset.productComplain,i),customerProfile.setComplainReturnRadioButtons(o.dataset.productReturn,a),$(".radioContainer-js").find('input[type="radio"]:not(:disabled)').first().click(),setTimeout(function(){app.activateFocusTrap(".popupDialog__complain",e.target)},200)})},changeReturnComplaintForm:function(e){var t=$(e.currentTarget).closest(".inputs-container-js").find(".complaintInputWrapper-js");$(e.currentTarget).is(":checked")&&"complaint"===e.currentTarget.dataset.name&&($.each(t,function(e,t){$(t).find("input, select").first().removeAttr("disabled"),$(t).show(300)}),$(".returnInputWrapper-js").find("input, select").first().attr("disabled","true"),$(".returnInputWrapper-js").hide(300)),$(e.currentTarget).is(":checked")&&"return"===e.currentTarget.dataset.name&&($.each(t,function(e,t){$(t).find("input, select").first().attr("disabled","true"),$(t).hide(300)}),$(".returnInputWrapper-js").find("input, select").first().removeAttr("disabled"),$(".returnInputWrapper-js").show(300))},orderComplaintCancel:function(e){app.post(e,customerProfile.currentTabTemplateUpdate,[e,"complains"]),sessionStorage.removeItem("complains-completed"),sessionStorage.removeItem("order"+e.currentTarget.dataset.id)},orderComplaintPrint:function(e){if($(e.currentTarget).data("report-url"))window.open($(e.currentTarget).data("report-url"));else{const t=$(e.currentTarget).data("url");$.get(t,{__collection:"customer-profile"},function(t){if(t.collection){const o=t.collection.Complaint.ReportUrl;$(e.currentTarget).data("report-url",o),window.open(o)}})}},importComplaintData:function(e){var t,o,n,r,s,a,i=e.currentTarget.dataset.id,c=$(e.currentTarget).parent().find(".complaintDetails-js"),d="";function u(e){return e<10&&(e="0"+e),e}$.get("",{__collection:"customer-profile.Complaint.Request|customer-profile.Complaint.ModifiedDate",complaintId:i},function(i){c.find(".complaintForm-js").text(i.collection["customer-profile.Complaint.Request"]),t=new Date(i.collection["customer-profile.Complaint.ModifiedDate"]),o=u(t.getDate()),n=u(t.getMonth()+1),s=u(t.getHours()),r=u(t.getMinutes()),a=u(t.getSeconds()),d=o+"."+n+"."+t.getFullYear()+'<span class="customer__dateHourSpace">|</span>'+s+":"+r+":"+a,c.find(".complaintChangeDate-js").append(d),e.currentTarget.classList&&e.currentTarget.classList.contains("importComplaintData-js")&&e.currentTarget.classList.remove("importComplaintData-js")})},orderAccept:function(e){var t=e.currentTarget.dataset.id;app.post(e,customerProfile.currentTabTemplateUpdate,[e,"orders"]),sessionStorage.removeItem("order"+t),customerProfile.showOrderDetails(e)},orderCancel:function(e){var t=e.currentTarget.dataset.id;app.post(e,customerProfile.currentTabTemplateUpdate,[e,"orders"]),sessionStorage.removeItem("order"+t)},orderCopy:function(e){1!=app.isPlacingOrdersLockDueToTime()?app.post(e,function(){ui.updateProductsInCart()}):app.getOrdersUnablePopup()},editAcceptedConsents:function(e){var t=e.currentTarget.querySelector("svg use"),o=t.dataset.icon,n=$(".acceptedConsents-js").find(".consentDetails-js"),r=$("span#channelConsentNotChecked");r.length>0&&r.hasClass("hidden")?r.removeClass("hidden"):r.addClass("hidden"),"pen"===o?(t.setAttribute("xlink:href","css/img/icons-sprite.svg#times-light"),t.dataset.icon="times",$.each(n,function(e,t){$(t).show(300)})):(customerProfile.changeIcon(t,"pen"),$.each(n,function(e,t){$(t).hide(300)}))},customerConsentWithdraw:function(e){var t=$(e.currentTarget).data("id"),o=$(e.currentTarget).data("key"),n=[{name:"__csrf",value:__CSRF},{name:"__action",value:"Customer/ConsentWithdraw"},{name:t,value:o}];$.post(null,n,function(t){t.action.Result?null!==t.action.Redirect302?window.location.replace(t.action.Redirect302):customerProfile.currentTabTemplateUpdate(e,"consents"):app.showTemporaryPopup(t.action.Message,"error")})},customerConsentAccept:function(e){var t=$(e.currentTarget).data("id"),o=$(e.currentTarget).data("key"),n=[{name:"__csrf",value:__CSRF},{name:"__action",value:"Customer/ConsentAccept"},{name:t,value:o}];$.post(null,n,function(t){t.action.Result?customerProfile.currentTabTemplateUpdate(e,"consents"):app.showTemporaryPopup(t.action.Message,"error")})},customerDeliveryAddressDelete:function(e){var t=$(e.currentTarget).data("address-id"),o=[{name:"__csrf",value:__CSRF},{name:"__action",value:"Customer/DeliveryAddressDelete"},{name:"addressId",value:t}];$.post(null,o,function(t){customerProfile.indexToFocusAfter=null,t.action.Result?(customerProfile.currentTabTemplateUpdate(e,"account-data-address"),app.showTemporaryPopup(t.action.Message,"success")):app.showTemporaryPopup(t.action.Message,"error")})},customerUpdateAdressAndDelivery:function(e){var t=app.post(e,function(){$("main .temporaryPopupBg").remove()}),o=$(e.currentTarget).closest(".inputs-container-js").find('input[name="__action"]')[0];$(o).val("Customer/Update"),$.when(t).done(function(){sessionStorage.removeItem("account-data-address"),app.post(e,customerProfile.currentTabTemplateUpdate,[e,"account-data"])})},showSet:function(e){var t=$(e.currentTarget).closest(".productItem-js"),o=$(t).nextAll(".productItem-js");$.each(o,function(e,t){if(!$(t).hasClass("setElement-js"))return!1;$(t).toggleClass("elementVisible-js")})},addAttachementInComplaint:function(e){window.attachementsInComplaint=[],$(e.currentTarget).parents(".inputs-container-js").find(".addAttachementInComplaint-js").each(function(){if(this.files.length>0){var t=this.files[0].name.split(".")[1];if("jfif"==t||"jpe"==t||"jpeg"==t||"jpg"==t)var o="file-image";else o="csv"==t?"file-csv":"docx"==t||"odt"==t?"file-word":"xlsx"==t||"ods"==t?"file-excel":"pdf"==t?"file-pdf":"file";$(e.currentTarget).parent().find(".svgIconType").attr("href","css/img/icons-sprite.svg#"+o+"-light");var n=$(this).data("file-size");if(this.files[0].size>n){var r=$("[data-not-added-info]").data("not-added-info")+". <strong>"+this.files[0].name+"</strong>: "+$(this).data("size-exceeded");app.showTemporaryPopup(r,"error","",8e3),$(this).val(""),$(this).next().hide()}else $(e.currentTarget).parent().removeClass("form__attachement-input-container--hidden"),$(e.currentTarget).parent().find(".form__attachement-input-container-attachments__text").text(e.currentTarget.files[0].name),window.attachementsInComplaint.push(this.files[0]),$(this).next().show()}})},sendComplaint:function(e){if("error"!=app.validationBeforePost(e)){var t=$(e.currentTarget).parents(".inputs-container-js"),o=t.find("input:not([disabled]), select:not([disabled]), textarea:not([disabled])").seri
8alizeArray(),n=window.attachementsInComplaint;if(null!=n)var r=n.length;var s=new FormData;s.append("__csrf",__CSRF);for(var a=0;a<o.length;a++)s.append(o[a].name,o[a].value);if(r>0){function i(e,t){null==window.AttachementsNotAdded&&(window.AttachementsNotAdded=[]);var o='<div style="padding: 20px;"><strong>'+e.name+"</strong>: "+t+"</div>";window.AttachementsNotAdded.push(o),window.AttachementsErrors+=1}window.AttachementsErrors=0;var c=t.find("[name=file]").eq(0),d=c.attr("accept").split(", "),u=c.data("file-size");for(a=0;a<r;a++){var l=n.pop();if(l.size<u){for(var m=l.name.split("."),p="."+m[m.length-1].toLowerCase(),f=!0,h=0;h<d.length;h++)p==d[h]&&(s.append("file"+a,l),f=!1);f&&i(l,_=c.data("invalid-file"))}else i(l,_=c.data("size-exceeded"))}if(window.AttachementsNotAdded){var _=$("[data-not-added-info]").data("not-added-info")+window.AttachementsNotAdded.join("");app.showTemporaryPopup(_,"error","",8e3),window.AttachementsNotAdded=void 0,window.AttachementsErrors=void 0}}$.ajax({data:s,processData:!1,contentType:!1,type:"POST",success:function(o){if($(".addAttachementInComplaint-js").val(""),o.action.Result){var n=t.data("success-info");app.showTemporaryPopup(n,"success","",8e3),$(".clearFileInput-js").hide(),app.hidePopup(e),sessionStorage.removeItem("complains"),sessionStorage.removeItem("order"+e.currentTarget.dataset.id),$(".order"+e.currentTarget.dataset.id).remove(),$(".popupDialog__complain").remove(),$("body").removeClass("customerProfileNoScroll"),customerProfile.showOrderDetails(e)}else null!=o.action.Description?app.showTemporaryPopup(o.action.Description,"error","",8e3):app.showTemporaryPopup(o.action.Message,"error","",8e3)}})}},setDigitalProductLink:function(){$(".order-content-link-btn-js").length<1||$(".order-content-js .productItem-js").each(function(){const e=$(this).find(".order-content-link-btn-js").clone();$(this).find(".order-content-link-btn-js").remove(),$(window).width()<769?$(this).append(e):$(this).find(".order-content-product-title-js").append(e)})}
8,events:function(){var e=$("main");$(window).on("load",function(e){$(".customer__menuActive-js").length&&(customerProfile.disableEnableCustomerProfileScrolling(),customerProfile.cuponTabTemplateUpdate()),customerProfile.allowToFocusOnMenuItems()}),$(window).on("resize",function(e){$(".customer__menuActive-js").length&&customerProfile.disableEnableCustomerProfileScrolling(),customerProfile.allowToFocusOnMenuItems()}),e.on("click",".popupDialog__complain .closePopupBtn-js",function(){$(".popupDialog__complain").remove(),$("body").removeClass("customerProfileNoScroll")}),e.on("click",".customerLogout-js",function(e){app.customerLogout(e)}),e.on("click",".customerUpdate-js",function(e){e.detail&&1!=e.detail||customerProfile.customerUpdateAdressAndDelivery(e)}),e.on("click",".emailChange-js",function(e){customerProfile.customerUpdate(e)}),e.on("click",".oldPasswordChange-js",function(e){customerProfile.customerUpdate(e)}),e.on("click",".genderChange-js",function(e){customerProfile.customerUpdate(e)}),e.on("click",".birthDateChange-js",function(e){customerProfile.customerUpdate(e)}),e.on("click",".reviewAuthorUpdate-js",function(e){customerProfile.customerUpdate(e)}),e.on("click",".customerDeliveryAddressUpdate-js",function(e){customerProfile.customerDeliveryAddressUpdate(e)}),e.on("click",".customer__submenu-js li",customerProfile.showTabContent),e.on("click",".customer__editHiddenFormBtn-js",customerProfile.showHideHiddenForm),e.on("click",".customer__editAddress-js",function(e){customerProfile.indexToFocusAfter=1+Array.from($(".customer__editAddress-js")).indexOf(e.currentTarget)-1}),e.on("click",".customer__menu-js li",function(e){if(!($(e.currentTarget).hasClass("prevent-on-mobile-js")&&window.innerWidth<769)&&(customerProfile.showTabContent(e),customerProfile.hideCustomerProfileMenu(),customerProfile.showHideSubmenu(e),"none"!=$(".bottomMenu").css("display"))){var t=$(this).find("span").text(),o=$(".customer__menuActivate-js svg");$(".headerSection").removeClass("hidden"),$(".customer__breadcrumbs--mobile").removeClass("hidden"),$(".customer__menuActivate-js").html(),$(".customer__menuActivate-js").html(o),$(".customer__menuActivate-js").append(t)}}),e.on("keydown",".customer__menu-js li",function(e){if("Enter"===e.key){if($(e.currentTarget).hasClass("prevent-on-mobile-js")&&window.innerWidth<769)return;if(customerProfile.showTabContent(e),customerProfile.hideCustomerProfileMenu(),customerProfile.showHideSubmenu(e),"none"!=$(".bottomMenu").css("display")){var t=$(this).find("span").text(),o=$(".customer__menuActivate-js svg");$(".headerSection").removeClass("hidden"),$(".customer__breadcrumbs--mobile").removeClass("hidden"),$(".customer__menuActivate-js").html(),$(".customer__menuActivate-js").html(o),$(".customer__menuActivate-js").append(t)}}}),e.on("click",".customer__menuActivate-js",function(e){"none"!=$(".bottomMenu").css("display")&&$(".customer__breadcrumbs--mobile").addClass("hidden"),$(window).width()<600&&($(".customer__editHiddenFormBtn-js").click(),$(".editMode-js").removeClass("editMode-js"),$(".editSection-js").removeClass("editSection-js"))}),$(window).on("resize",function(e){"none"!=$(".bottomMenu").css("display")?$(".customer__menu-js").hasClass("customer__menuActive-js")?$(".customer__breadcrumbs--mobile").addClass("hidden"):($(".headerSection").removeClass("hidden"),$(".customer__breadcrumbs--mobile").removeClass("hidden")):$(".headerSection").removeClass("hidden"),customerProfile.setDigitalProductLink()}),$(window).on("load",function(e){let t=new URLSearchParams(window.location.search);t.has("fav")?($(".customerPrimaryMenu-js").find('[data-template="wish-list"]').click(),$(".customer__menu").addClass("customer__menu-js"),$(".customerProfileButton").removeClass("activePage"),$(".favouriteItemsButton").addClass("activePage"),$(".customer__breadcrumbs--mobile").addClass("hidden"),$(".headerThirdType").length>0&&$(".closeCustomerMenuButton").removeClass("hidden")):$(".closeCustomerMenuButton").addClass("hidden"),t.has("accountData")&&"none"!=$(".bottomMenu").css("display")&&$(".customer__breadcrumbs--mobile").addClass("hidden")}),$(window).on("resize",function(e){new URLSearchParams(window.location.search).has("fav")&&$(".customer__breadcrumbs--mobile").addClass("hidden"),customerProfile.removeFooterOnMobile()}),e.on("click",".customer__menuActivate-js",customerProfile.showCustomerProfileMenu),e.on("click",".customerPagination-js li",function(e){customerProfile.paginationChangeTab(e)}),e.on("click",".showOrder-js",function(e){e.detail&&1!=e.detail||(e.preventDefault(),customerProfile.showOrderDetails(e))}
8),e.on("keydown",".showOrder-js",function(e){e.detail&&1!=e.detail||"Enter"!==e.key||(e.preventDefault(),customerProfile.showOrderDetails(e))}),e.on("click",".closeOrderDetails-js",function(e){customerProfile.closeOrderDetails(e)}),e.on("click",".productWishListDelete-js",function(e){customerProfile.productWishListDelete(e)}),e.on("click",".addDataToComplaintForm-js",function(e){customerProfile.addDataToComplaintForm(e)}),e.on("click",".popupDialog__complain .closePopupBtn-js",function(e){let t=$(".orderContent").parent().data("id");$(".closeOrderDetails-js").click(),$('.showOrder-js[data-id="'+t+'"]').eq(0).click()}),e.on("change",".radioContainer-js input",function(e){customerProfile.changeReturnComplaintForm(e)}),e.on("click",".orderComplaintCancel-js",function(e){customerProfile.orderComplaintCancel(e)}),e.on("click",".complaintPrintout-js",function(e){customerProfile.orderComplaintPrint(e)}),e.on("click",".importComplaintData-js",function(e){customerProfile.importComplaintData(e)}),e.on("click",".orderAccept-js",function(e){customerProfile.orderAccept(e)}),e.on("click",".orderCancel-js",function(e){customerProfile.orderCancel(e)}),e.on("click",".orderCopy-js",function(e){customerProfile.orderCopy(e)}),e.on("click",".editAcceptedConsents-js",function(e){customerProfile.editAcceptedConsents(e)}),e.on("click",".customerConsentAccept-js",function(e){customerProfile.customerConsentAccept(e)}),e.on("click",".customerConsentWithdraw-js",function(e){customerProfile.customerConsentWithdraw(e)}),e.on("click",".customerDeliveryAddressDelete-js",function(e){customerProfile.customerDeliveryAddressDelete(e)}),e.on("click",".customer .showSet-js",function(e){customerProfile.showSet(e),setTimeout(function(){$(".orderContent, main").removeAttr("style");var e=$(".orderContent").height();$(".orderContent").css("height",e),$("main").css("height",e+150)},500)}),e.on("change",".addAttachementInComplaint-js",function(e){customerProfile.addAttachementInComplaint(e)}),e.on("click",".orderComplaintOrReturnAdd-js",function(e){customerProfile.sendComplaint(e)}),e.on("click",".clearFileInput-js",function(e){var t=$(e.currentTarget).parent().index();$(e.currentTarget).prev().val(""),window.attachementsInComplaint.splice(t-1,1),$(e.currentTarget).hide(),$(e.currentTarget).parent().addClass("form__attachement-input-container--hidden")}),e.on("click",".js-addToCart",function(e){if(e.preventDefault(),!e.detail||1==e.detail){0==isDetailsFunctionsStarted&&(productDetailsFunctions.events(),isDetailsFunctionsStarted=!0);var t=$(this);$(".popup-dialog").remove();var o=t.parents(".wishList__productDetails").find('input[name="productId"]').val(),n=t.parents(".wishList__productDetails").find(".productUrl").val();if(t.hasClass("js-notifyAboutAvailability"))$.get(n,{__template:"partials/common/notify-about-availability-popup.html"},function(n){$(".customer__content .wishList").append(n.template);var r=t.find("div").data("popup-class");$(r).find('input[name="productId"]').val(o),ui.formLabelAnimationOnLoadPage(),$(r).show(),app.activateFocusTrap(r,e.target.closest(".wishList__product"))});else if(t.hasClass("js-askForPrice"))$.get(n,{__template:"partials/common/ask-for-price-popup.html"},function(n){$(".customer__content .wishList").append(n.template);var r=t.find("div").data("popup-class");$(r).find('input[name="productId"]').val(o),ui.formLabelAnimationOnLoadPage(),$(r).show(),app.activateFocusTrap(r,e.target.closest(".wishList__product"))});else if(t.hasClass("js-addToCart-Immediately")){if(1==app.isPlacingOrdersLockDueToTime())return void app.getOrdersUnablePopup();0==lockAddToCart&&(lockAddToCart=!0,$.get(n,{__template:"partials/common/after-adding-to-cart-popup.html"},function(t){$(".customer__content .wishList").append(t.template),addToCart(e)}))}else{if(1==app.isPlacingOrdersLockDueToTime())return void app.getOrdersUnablePopup();if("PDnewVariant"==__productDetailsVariant)var r=!0;else r=!1;$.get(n,{__collection:"product-details.Product",__template:"partials/products-list/add-to-cart-popup.html"},function(t){if($(".customer__content .wishList").append(t.template),$("body").addClass("noscroll"),1==r?$(".product-item__cartPopup--oldView").remove():$(".product-item__cartPopup--newView").remove(),addClipAndBatchToCartInPopup(!0),changeAttributesDivToSelectInPopup(),changeAttributesPolyToSelectInPopup(),initProductDetailsInPopup(!0),e&&e.target){const t=e.target.closest(".wishList__product");t&&app.activateFocusTrap(".product-item__cartPopup--container",t)}null!=t.collection.Image&&null!=t.collection.Image.Id&&-1!=t.collection.Image.Id&&t.collection.Image.Link?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="img/medium/'+t.collection.Image.Id+"/"+t.collection.Image.Link+'.jpg">'):null!=t.collection.Image&&null!=t.collection.Image.ExternalUrl&&""!=t.collection.Image.ExternalUrl?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="'+t.collection.Image.ExternalUrl+'">'):$(".product-details__detailsWrapper--productImage").append('<i><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#image-light"></use></svg></i>')})}}}
8),$("body").on("click",".customer-menu-my-card-js",function(e){if(window.innerWidth<769)if($("body").find(".my-card-popup-template-js").length>0){$("body").find(".my-card-popup-template-js").removeClass("hidden");const e=setTimeout(function(){$("body").find(".my-card-popup-js").removeClass("my-card-popup--hidden"),clearTimeout(e)},100)}else $.get("",{__template:"partials/customer/my-card.html",__include:"true"},function(e){if(e.template){$("body").append(e.template),app.getBarcode();const t=setTimeout(function(){$("body").find(".my-card-popup-js").removeClass("my-card-popup--hidden"),clearTimeout(t)},100)}})}),$("body").on("click",".my-card-popup-template-js",function(e){$(e.currentTarget).find(".my-card-popup-js").addClass("my-card-popup--hidden");const t=setTimeout(function(){$(e.currentTarget).addClass("hidden"),clearTimeout(t)},500)}),$("body").on("click",".my-card-popup-js",function(e){e.stopPropagation()}),$("body").on("mousedown touchstart",function(e){isHoldingMyCard=!0,$(e.currentTarget).find(".my-card-popup-js").addClass("my-card-popup--no-transition");let t=e.clientY;t||(t=e.changedTouches[0].clientY),myCardStartCursor=t}),$("body").on("mousemove touchmove",".my-card-popup-bar-js",function(e){if(isHoldingMyCard){const t=$(e.currentTarget).parent();t.addClass("my-card-popup--no-transition");const o=t.height();let n=e.clientY;n||(n=e.changedTouches[0].clientY);const r=o-(window.innerHeight-n);if(r>0){const e="translateY("+r+"px)";t.css("transform",e)}}}),$("body").on("mouseup touchend",function(e){if(isHoldingMyCard){isHoldingMyCard=!1;const t=$(e.currentTarget).find(".my-card-popup-js");t.removeClass("my-card-popup--no-transition");let o=e.clientY;if(o||(o=e.changedTouches[0].clientY),o>myCardStartCursor){t.css("transform","translateY(100%)");const e=setTimeout(function(){t.parent().addClass("hidden"),t.css("transform",""),t.addClass("my-card-popup--hidden"),clearTimeout(e)},500)}}}),"IndustryShop"===__ImportExportTemplateType&&$("body").on("keydown",".radioReturn-js label, .radioComplaint-js label, .showHideSection-js, .checkBoxes__container label, .customerPagination__form-js, .discountsDetails-js, .customer-focus, .customer__menuActivate-js",function(e){"Enter"===e.key&&$(e.currentTarget).click()})}}; 9 10var newsletterFunctions={init:function(){newsletterFunctions.events()},events:function(){$("body").on("focus",".showConsents-js",function(){$(".consentsContainer-js").show(200)})}}; 11 12 13 14var grayStyle=[{featureType:"water",elementType:"geometry.fill",stylers:[{color:"#d3d3d3"}]},{featureType:"transit",stylers:[{color:"#808080"},{visibility:"off"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{visibility:"on"},{color:"#b3b3b3"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#ffffff"}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{visibility:"on"},{color:"#ffffff"},{weight:1.8}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{color:"#d7d7d7"}]},{featureType:"poi",elementType:"geometry.fill",stylers:[{visibility:"on"},{color:"#ebebeb"}]},{featureType:"administrative",elementType:"geometry",stylers:[{color:"#a7a7a7"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{color:"#ffffff"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{color:"#ffffff"}]},{featureType:"landscape",elementType:"geometry.fill",stylers:[{visibility:"on"},{color:"#efefef"}]},{featureType:"road",elementType:"labels.text.fill",stylers:[{color:"#696969"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{visibility:"on"},{color:"#737373"}]},{featureType:"poi",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{color:"#d6d6d6"}]},{featureType:"road",elementType:"labels.icon",stylers:[{visibility:"off"}]},{},{featureType:"poi",elementType:"geometry.fill",stylers:[{color:"#dadada"}]}];function initMap(){var e=document.getElementById("map"),t={lat:parseFloat(e.dataset.lat),lng:parseFloat(e.dataset.lon)},l=new google.maps.Map(e,{zoom:13,center:t,styles:grayStyle});new google.maps.Marker({position:t,map:l})} 15 16let lookbookName=document.querySelector(".lookbook__nameListImg");if(null!=lookbookName){let o=lookbookName.textContent.split(" ");if(o.length>1){let t=document.createElement("span");t.textContent=o[0];let e=" ";for(let i=1;i<o.length;i++)e=e+o[i]+" ";lookbookName.textContent="",lookbookName.textContent=e,lookbookName.prepe
16nd(t)}}let newPopupDetails,img=document.querySelectorAll(".lookbook__imageContainerList");if(img.length>0)for(let s=0;s<img.length;s++){let r=img[s].children[0];if(null!=r&&(r=r.getAttribute("data-lookbook-products"),r=app.maskInnerQuotes(r),r=JSON.parse(r),null==r&&(img[s].children[0].style.display="none")),null!=r)for(let n=0;n<r.length;n++){let a=document.createElement("span");a.setAttribute("tabindex","0"),a.setAttribute("role","button"),img[s]&&1==img[s].classList.contains("lookbookPlus-js")?(a.classList.add("lookbook__imageContainerList-buyProduct"),a.classList.add("lookbook__imageContainerList-buyProduct-Plus")):img[s]&&1==img[s].classList.contains("lookbookPoint-js")&&(a.classList.add("lookbook__imageContainerList-buyProduct"),a.classList.add("lookbook__imageContainerList-buyProduct-Point")),a.classList.add("js-ShowItemLookbook"),a.classList.add("ShowItemLookbookAfter"),a.setAttribute("idProduct",r[n].id),a.setAttribute("hasAttributes",r[n].hasAttributes);let l=parseInt(r[n].left),c=parseInt(r[n].top);a.setAttribute("leftPosition",l),l<50?a.classList.add("lookbook__imageContainerList-buyProduct_right"):a.classList.add("lookbook__imageContainerList-buyProduct_left"),l<"5"&&(a.style.left="calc("+l+"% + 16px)"),l>"95"&&(a.style.left="calc("+l+"% - 16px)"),l<="95"&&l>="5"&&(a.style.left=l+"%"),c<"5"&&(a.style.top="calc("+c+"% + 16px)"),c>"95"&&(a.style.top="calc("+c+"% - 16px)"),c<="95"&&c>="5"&&(a.style.top=c+"%"),img[s].appendChild(a)}}newPopupDetails="PDnewVariant"==__productDetailsVariant;let isDetailsFunctionsStarted=!1;const lookbookProductsDetails=()=>{document.querySelectorAll(".js-ShowItemLookbook").forEach((o,t)=>{o.hasAttribute("data-loaded")||(o.addEventListener("mouseenter",function(){window.innerWidth>768&&loadProductData(this,t)}),o.addEventListener("click",function(){loadProductData(this,t)}))})},loadProductData=(o,t)=>{if(o.hasAttribute("data-loaded")||o.hasAttribute("data-loading"))return;o.setAttribute("data-loading","true");let e=o.getAttribute("idProduct");var i=$("[data-product-details-url]").data("product-details-url")+"-1-"+e;$.get(i,{__template:"partials/common/product-item-lookbook.html"},function(t){if(t.template){let e=document.createElement("div");e.setAttribute("url-Product",i),e.className="product-item-lookbook product-item-lookbook-js";let s=o.getAttribute("leftposition");e.insertAdjacentHTML("beforeend",t.template),s<50?e.classList.add("product-item-lookbook_right"):e.classList.add("product-item-lookbook_left"),o.appendChild(e),o.setAttribute("data-loaded","true")}o.removeAttribute("data-loading")}).fail(function(){o.removeAttribute("data-loading")})};lookbookProductsDetails(),$(".lookbook__imageContainer").on("keydown",".productWishListAddFirstPopup-js, .productWishListRemove-js",function(o){("Enter"===o.key||13===o.keyCode)&&(o.preventDefault(),o.stopPropagation(),$(this).trigger("click"),setTimeout(()=>{const t=document.querySelector(".wishListAddInfoPopup-lookbook-js");t&&"none"!==t.style.display&&app.activateFocusTrap(".wishListAddInfoPopup-lookbook-js",o.currentTarget)},150))}),$(".lookbook__imageContainer").on("keydown",".js-addToCart",function(o){("Enter"===o.key||13===o.keyCode)&&(o.preventDefault(),o.stopPropagation(),$(".lookbook__imageContainer").find(".js-addToCart").filter(this).trigger("click"))}),$(".lookbook__imageContainer").on("click",".js-addToCart",function(o){if(o.preventDefault(),!o.detail||1==o.detail){0==isDetailsFunctionsStarted&&(productDetailsFunctions.events(),isDetailsFunctionsStarted=!0);var t=$(this);$(".popup-dialog").remove();var e=t.parents(".product-item__new").find('input[name="currentProductId"]').val(),i=t.parents(".product-item__new").data("url");if(t.hasClass("js-notifyAboutAvailability"))$.get(i,{__template:"partials/common/notify-about-availability-popup.html"},function(o){$(".lookbookSection").append(o.template);var i=t.find("span").data("popup-class");$(i).find('input[name="productId"]').val(e),ui.formLabelAnimationOnLoadPage(),$(i).show()});else if(t.hasClass("js-askForPrice"))$.get(i,{__template:"partials/common/ask-for-price-popup.html"},function(o){$(".lookbookSection").append(o.template);var i=t.find("span").data("popup-class");$(i).find('input[name="productId"]').val(e),ui.formLabelAnimationOnLoadPage(),$(i).show()});else if(t.hasClass("js-addToCart-Immediately")){if(1==app.isPlacingOrdersLockDueToTime())return void app.getOrdersUnablePopup();if(0!=lockAddToCart)return;lockAddToCart=!0,addToCart(o)}else{if(1==app.isPlacingOrdersLockDueToTime())return void app.getOrdersUnablePopup();if("PDnewVariant"==__productDetailsVariant)var s=!0;else s=!1;
16let t=$(o.currentTarget).closest(".js-ShowItemLookbook")[0].getAttribute("idProduct");var r=(i=$("[data-product-details-url]").data("product-details-url"))+"-1-"+t;$.get(r,{__collection:"product-details.Product",__template:"partials/products-list/add-to-cart-popup.html"},function(t){$(".lookbookSection").append(t.template),$("body").addClass("noscroll"),1==s?$(".product-item__cartPopup--oldView").remove():$(".product-item__cartPopup--newView").remove(),addClipAndBatchToCartInPopup(!0),changeAttributesDivToSelectInPopup(),changeAttributesPolyToSelectInPopup(),initProductDetailsInPopup(!0),setTimeout(()=>{document.querySelector(".product-item__cartPopup--container")&&app.activateFocusTrap(".product-item__cartPopup--container",o.currentTarget)},100),null!=t.collection.Image&&null!=t.collection.Image.Id&&-1!=t.collection.Image.Id&&t.collection.Image.Link?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="img/medium/'+t.collection.Image.Id+"/"+t.collection.Image.Link+'.jpg">'):null!=t.collection.Image&&null!=t.collection.Image.ExternalUrl&&""!=t.collection.Image.ExternalUrl?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="'+t.collection.Image.ExternalUrl+'">'):$(".product-details__detailsWrapper--productImage").append('<i><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#image-light"></use></svg></i>')})}}}),$("body").on("click",".stopReloadPage-js",function(o){o.preventDefault(),o.stopPropagation()}),$("body").on("click",".lookbookGoToPage-js",function(o){o.preventDefault();const t=document.activeElement;if(t&&t.classList){const o=t.classList.contains("product-item__addToCart"),e=t.classList.contains("productWishListAddFirstPopup-js");if(o||e)return!0}let e=$(o.currentTarget).closest(".product-item-lookbook-js");if(e.length>0){let o=e[0].getAttribute("url-Product");window.location.href=o}}),$("body").on("click",".lookbook_ask_for_price_exit-js",function(){$(".product-list__cartPopup").remove(),$(".after-adding-to-cart-popup").hide()}),$("body").on("click",".lookbook_notify_about_availability_exit-js",function(){$(".product-list__cartPopup").remove(),$(".after-adding-to-cart-popup").hide()}),$("body").on("click",".lookbookSection .notify-about-availability-popup .close-button",function(o){$(".popup-dialog").remove()});let notLoggedUserCheck=document.querySelector(".notLoggedUser-js");null==notLoggedUserCheck&&$(".lookbook__imageContainer").on("click",".addToWishList-js",function(o){o.preventDefault(),lookBookMainHeartWishListCheck(o),wishListCheckLookbook()});const lookBookMainHeartWishListCheck=async o=>{let t=o.currentTarget,e=t.parentElement.parentElement.children[0].getAttribute("data-lookbook-products");if(e=JSON.parse(e),null!=e){for(let t=0;t<e.length;t++){let i=e[t].id,s=$(o.currentTarget).find("input").not('input[name="pId"]').serializeArray();s[1].value=i,s.push({name:"__csrf",value:__CSRF}),await $.post(null,s,function(o){})}t.children[0].classList.add("hidden"),t.children[1].classList.remove("hidden"),t.classList="removeFromWishList-js"}$(".wishListAddInfoPopup-lookbook-js").hide(),app.showTemporaryPopup(__translations.AddedProductsToWishList,"success")};$(".lookbook__imageContainer").on("click",".removeFromWishList-js",function(o){o.preventDefault();let t=o.currentTarget,e=t.parentElement.parentElement.children[0].getAttribute("data-lookbook-products");if(e=JSON.parse(e),null!=e){for(let t=0;t<e.length;t++){let i=e[t].id,s=$(o.currentTarget).find("input").not('input[name="pId"]').serializeArray();s[1].value=i,s[0].value="Product/WishListDelete",s.push({name:"__csrf",value:__CSRF}),$.post(null,s,function(o){})}wishListCheckLookbook(),t.children[1].classList.add("hidden"),t.children[0].classList.remove("hidden"),t.classList="addToWishList-js addToWishListOnMove-js",$(".wishListRemoveInfoPopup-lookbook-js").hide(),app.showTemporaryPopup(__translations.removedProductsFromWishList,"success")}});let addAllProductsToCart=document.querySelector(".addToCartList-js");if(null!=addAllProductsToCart){function addAllToCart(o,t){return new Promise((e,i)=>
16{$.post(null,o,function(o){if(o.action.Result){for(var s=o.action.Products,r=[],n=[],a=[],l=[],c=[],d=0,u=0,p=0;p<s.length;p++){var k={id:s[p].Id.toString(),name:s[p].NameNoHtml,price:s[p].BasicUnitTotalPrice,quantity:s[p].BasicUnitQuantity},h={item_id:s[p].Id.toString(),item_name:s[p].NameNoHtml,price:s[p].TotalPrice,quantity:s[p].Quantity},m={id:s[p].Id.toString(),content_name:s[p].NameNoHtml,value:s[p].BasicUnitTotalPrice,quantity:s[p].BasicUnitQuantity},b={content_id:s[p].Id.toString(),content_name:s[p].NameNoHtml,price:s[p].BasicUnitTotalPrice,quantity:s[p].BasicUnitQuantity};d+=s[p].BasicUnitTotalPrice*s[p].BasicUnitQuantity,u+=s[p].BasicUnitTotalPrice*s[p].BasicUnitQuantity,r.push(k),n.push(h),a.push(m),l.push(b),c.push(s[p].Id.toString())}var g={products:r};"undefined"!=typeof fbq&&fbq("track","AddToCart",{value:u,currency:__currCode,content_type:"product",contents:a}),"undefined"!=typeof ttq&&ttq.track("AddToCart",{value:u,currency:__currCode,content_type:"product",contents:l}),"undefined"!=typeof snaptr&&snaptr("track","ADD_CART",{price:u,currency:__currCode,items_ids:c,number_items:p,client_dedup_id:"ADD_CART_"+(new Date).getTime()}),dataLayer.push({event:"addToCart",ecommerce:{currencyCode:__currCode,add:g}}),"undefined"!=typeof gtag&>ag("event","add_to_cart",{currency:__currCode,value:d,items:n});let i=o.collection["customer.Cart.Count"],_=o.collection["customer.Cart.Value"],L=o.collection["customer.Cart.CurrencyExt.Symbol"];var f=JSON.parse(t);if(!1===$("#restoreCart_isAuth").val()||"false"===$("#restoreCart_isAuth").val()){let o=app.getCookie("cartProducts");app.setCookie("cartProducts",o,JSON.stringify(f),365)}ui.updateProductsInCart(i,_,L),e("Przetworzono ")}else{let t="";o.action.Message&&(t+=o.action.Message),o.action.Description&&(o.action.Message&&(t+=" "),t+=o.action.Description),i(t)}}).fail(function(o){i("Błąd : "+result.action.Code)})})}$("body").on("click",".addToCartList-js",function(o){o.preventDefault();let t=o.currentTarget.parentElement.parentElement.children[0].getAttribute("data-lookbook-products");t=JSON.parse(t);let e=[],i=[];for(let o=0;o<t.length;o++){let r=t[o].id,n=t[o].quantity;0==n&&(n="1"),t[o];let a=[];a.push({name:"quantity",value:n}),a.push({name:"productId",value:r}),a.push({name:"__action",value:"Cart/Add"}),a.push({name:"__collection",value:"customer.Cart.Count|customer.Cart.Value|customer.Cart.CurrencyExt|customer.Cart.Products|product-details"}),a.push({name:"__csrf",value:__CSRF}),e.push(a);var s=JSON.stringify(a);s=(s=(s=(s=(s=(s=(s=(s=s.replaceAll('{"name":"__action","value":"Cart/Add"},',"")).replaceAll('"name":','"_n":')).replaceAll('"value":','"_v":')).replaceAll("productId","_p")).replaceAll("unitId","_u")).replaceAll("supplyId","_s")).replaceAll("attributeId","_a")).replaceAll("quantity","_q"),i.push(s)}let r=[];for(let o=0;o<e.length;o++)r.push(addAllToCart(e[o],i[o]));Promise.all(r).then(o=>{app.showTemporaryPopup(__translations.allProductsAddToCart,"success","",4e3)}).catch(o=>{r.length>1?app.showTemporaryPopup(__translations.allProductsAddToCartError,"info","",4e3):app.showTemporaryPopup(o,"info","",4e3)});let n=$(o.currentTarget),a=n.find(".cartAdd-js"),l=n.find(".cartRemove-js");a.hasClass("hidden")||(a.addClass("hidden"),l.removeClass("hidden"))});const d=()=>{let o=document.querySelectorAll(".lookbook__imageContainerList-js");for(let t=0;t<o.length;t++){let e=$(o[t]).find(".js-ShowItemLookbook"),i=$(o[t].children).find(".addToCartList-js")[0];if(e.length>0){let o=0;for(let t=0;t<e.length;t++){let i=e[t].getAttribute("hasAttributes");"False"!=i&&"false"!=i||o++}o==e.length&&i.classList.remove("hidden")}}},u=()=>{let o=[];$.get("",{__collection:"customer.Cart"},function(t){if(t)for(let e=0;e<t.collection.Products.length;e++){let i=t.collection.Products[e];o.push(i.Id)}}).done(function(){let t=document.querySelectorAll(".lookbook__imageContainerList-js");for(let e=0;e<t.length;e++){let i=$(t[e]).find(".js-ShowItemLookbook");if(i.length>0){let s=0;for(let t=0;t<i.length;t++){let e=parseInt(i[t].getAttribute("idProduct"));o.includes(e)&&s++}let r=$(t[e]).find(".cartAdd-js"),n=$(t[e]).find(".cartRemove-js");s==i.length&&(r.hasClass("hidden")||(r.addClass("hidden"),n.removeClass("hidden")))}}})};let p=!1;function handleIntersection(o,t){o.forEach(o=>{o.isIntersecting&&!p&&(u(),d(),p=!0,t.disconnect())})}const k=new IntersectionObserver(handleIntersection,{root:null,rootMargin:"50px",threshold:.5});document.querySelectorAll(".lookbook__imageContainerList-js").forEach(o=>{k.observe(o)})}const showWishlistTooltipOnLookbook=o=>
16{let t=o.target.classList[0],e=o.clientX,i=o.clientY;$(".mouseMoving-js").css("left",e-200+"px"),$(".mouseMoving-js").css("top",i+30+"px"),"addToWishList-js-popup"!==t&&"removeFromWishList-js-popup"!==t||$(".mouseMoving-js").css("z-index",102)};function compareArrays(o,t){if(o.length!==t.length)return!1;const e=o.slice().sort(),i=t.slice().sort();for(let o=0;o<e.length;o++)if(e[o]!==i[o])return!1;return!0}null!=notLoggedUserCheck&&($(".lookbook__imageContainerList-js").on("mouseover",".addToWishListOnMove-js, .addToWishList-js-popup",function(o){$(window).width()>768&&($(".wishListInfoPopup-lookbook-js").show(),showWishlistTooltipOnLookbook(o))}),$(".lookbook__imageContainerList-js, .js-ShowItemLookbook").on("mouseleave",".addToWishListOnMove-js, .addToWishList-js-popup",function(o){$(".wishListInfoPopup-lookbook-js").hide(),showWishlistTooltipOnLookbook(o)})),$("body").on("mouseover",".addToCartOnMove-js, .addToWishList-js-popup",function(o){$(window).width()>768&&($(".wishListAddToCartInfoPopup-lookbook-js").show(),showWishlistTooltipOnLookbook(o))}),$("body").on("mouseleave",".addToCartOnMove-js, .addToWishList-js-popup",function(o){$(".wishListAddToCartInfoPopup-lookbook-js").hide(),showWishlistTooltipOnLookbook(o)}),null==notLoggedUserCheck&&($("body").on("mouseover",".addToWishListOnMove-js, .addToWishList-js-popup",function(o){$(window).width()>768&&($(".wishListAddInfoPopup-lookbook-js").show(),showWishlistTooltipOnLookbook(o))}),$("body").on("mouseleave",".addToWishListOnMove-js, .addToWishList-js-popup",function(o){$(".wishListAddInfoPopup-lookbook-js").hide(),showWishlistTooltipOnLookbook(o)})),null==notLoggedUserCheck&&($("body").on("mouseover",".removeFromWishList-js, .removeFromWishList-js-popup",function(o){$(window).width()>768&&($(".wishListRemoveInfoPopup-lookbook-js").show(),showWishlistTooltipOnLookbook(o))}),$("body").on("mouseleave",".removeFromWishList-js, .removeFromWishList-js-popup",function(o){$(".wishListRemoveInfoPopup-lookbook-js").hide(),showWishlistTooltipOnLookbook(o)})),null!=notLoggedUserCheck&&$("body").on("click",".addToWishListOnMove-js, .addToWishList-js-popup ",".removeFromWishList-js",function(){$(window).width()<=768&&app.showTemporaryPopup(__translations.loginToAddProductsToWishList,"info","",2e3)});const wishListCheckLookbook=async()=>{let o=document.querySelectorAll(".lookbookProductsContainer-js");for(let t=0;t<o.length;t++){let e=JSON.parse(app.maskInnerQuotes(o[t].getAttribute("data-lookbook-products"))),i=[];for(let o=0;o<e.length;o++)i.push(parseInt(e[o].id));let s=[...new Set(i)];await $.get(null,{__action:"Product/WishListCheck",products:JSON.stringify(s)},function(e){let i=e.action.Object;if(null!=i){let e=[];for(let o=0;o<i.length;o++)e.push(i[o].Id);let r=o[t].parentElement.children[2].children;if(compareArrays(e,s))for(let o=0;o<r.length;o++)r[o].classList.contains("addToWishList-js")&&(r[o].children[0].classList.add("hidden"),r[o].children[1].classList.remove("hidden"),r[o].classList="removeFromWishList-js"),r[o].classList.contains("addToWishList-js-popup")&&(r[o].children[0].classList.add("hidden"),r[o].children[1].classList.remove("hidden"),r[o].classList="removeFromWishList-js");else for(let o=0;o<r.length;o++)r[o].classList.contains("removeFromWishList-js")&&(r[o].children[0].classList.remove("hidden"),r[o].children[1].classList.add("hidden"),r[o].classList="addToWishList-js addToWishListOnMove-js ")}})}};$(".js-ShowItemLookbook").on("click",function(o){o.preventDefault();let t=o.currentTarget;t.classList.contains("js-ShowItemLookbook")&&(t.classList.add("lookbookFirstPopupHover"),window.innerWidth<769&&t.classList.add("lookbookFirstPopupPositionClass")),app.activateFocusTrap(".lookbookFirstPopupHover",o.currentTarget)}),$(".js-ShowItemLookbook").on("mouseenter",function(o){o.preventDefault();let t=o.target;t.classList.contains("js-ShowItemLookbook")&&t.classList.add("lookbookFirstPopupHover")}),$(".lookbook__imageContainerList-js").on("mouseover",function(o){o.stopPropagation(),o.preventDefault();let t=$(".lookbookFirstPopupPositionClass"),e=$(".lookbookFirstPopupHover");(o.target.classList.contains("lookbookPoint-js")||o.target.classList.contains("lookbookPlus-js"))&&(e.length>0&&e.removeClass("lookbookFirstPopupHover"),t.length>0&&t.removeClass("lookbookFirstPopupPositionClass"))}),$(".js-ShowItemLookbook").on("mouseout",function(o){o.stopPropagation(),o.preventDefault();
16let t=$(o.currentTarget).closest(".js-ShowItemLookbook");t[0].classList.contains("lookbookFirstPopupPositionClass")&&t[0].classList.remove("lookbookFirstPopupPositionClass")}),$(".js-ShowItemLookbook").on("click",".close-button-lookbook-popup",function(o){o.stopPropagation(),o.preventDefault();let t=$(o.currentTarget).closest(".js-ShowItemLookbook");t[0].classList.contains("lookbookFirstPopupHover")&&t[0].classList.remove("lookbookFirstPopupHover")}),$(".js-ShowItemLookbook").on("mouseenter",function(o){idProduct=parseInt(o.currentTarget.getAttribute("idproduct")),$.get(null,{__action:"Product/WishListCheck",products:JSON.stringify([idProduct])},function(t){let e=t.action.Object;if(null!=e&&void 0!==e)if(e.length>0){let t=$(o.currentTarget).find(".checkWhisListLookbbookAfterAddProduct-js");if(t.length>0){t=t[0],t.classList.remove("productWishListAdd-js"),t.classList.add("productWishListRemove-js"),t=t.children;let o=t[3],e=t[4];t[0].setAttribute("value","Product/WishListDelete"),o.classList.add("hidden"),e.classList.remove("hidden")}}else{let t=$(o.currentTarget).find(".checkWhisListLookbbookAfterAddProduct-js");if(t.length>0){t=t[0],t.classList.add("productWishListAdd-js"),t.classList.remove("productWishListRemove-js"),t=t.children;let o=t[3],e=t[4];t[0].setAttribute("value","Product/WishListAdd"),o.classList.remove("hidden"),e.classList.add("hidden")}}})});let lookbookBanerConatiner=document.querySelector(".lookbook__imageContainer-js");if(null!=lookbookBanerConatiner&&1==__customerAuthenticated&&lookbookBanerConatiner.addEventListener("load",wishListCheckLookbook()),null==notLoggedUserCheck&&$(".lookbookSection").on("click",".productWishListAdd-js",function(o){if(!o.detail||1==o.detail){if(o.preventDefault(),o.stopPropagation(),app.productWishListAdd(o),setTimeout(function(){productListFunctions.showWishListItems()},500),o.currentTarget.children[0].setAttribute("value","Product/WishListDelete"),o.currentTarget.classList.contains("productWishListAddFirstPopup-js")){let t=o.currentTarget.children[3],e=o.currentTarget.children[4];t.classList.add("hidden"),e.classList.remove("hidden")}else{let t=o.currentTarget.children[2].getAttribute("value");setTimeout(function(){productDetailsFunctions.checkWishList(t)},1e3)}setTimeout(function(){wishListCheckLookbook()},1e3),setTimeout(()=>{const t=document.querySelector(".wishListAddInfoPopup-lookbook-js");t&&"none"!==t.style.display&&app.activateFocusTrap(".wishListAddInfoPopup-lookbook-js",o.currentTarget)},100)}}),$(".lookbookSection").on("click",".productWishListRemove-js",function(o){if(!o.detail||1==o.detail){if(o.preventDefault(),o.stopPropagation(),app.productWishListRemove(o),setTimeout(function(){productListFunctions.showWishListItems()},500),o.currentTarget.children[0].setAttribute("value","Product/WishListAdd"),o.currentTarget.classList.contains("productWishListAddFirstPopup-js")){let t=o.currentTarget.children[3],e=o.currentTarget.children[4];t.classList.remove("hidden"),e.classList.add("hidden")}else{let t=o.currentTarget.children[2].getAttribute("value");setTimeout(function(){productDetailsFunctions.checkWishList(t)},1e3)}setTimeout(function(){wishListCheckLookbook()},1e3)}}),$(".lookbookImageContainer-js").length>0){var setLookbookImages=function(){$(".lookbookImageContainer-js").each(function(o){if(0==o)var t=1.13;else if(1==o){t=1.22;var e=.39}else if(2==o){t=.43,e=.25;var i=.36}else 3==o?t=1.52:4==o&&(t=1.13,e=.46);var s=$(this).width()*t;if($(this).css("height",s),$(window).width()>768){if(e){var r=s*e;$(this).css("margin-top",r)}if(i){var n=s*i;$(this).css("margin-bottom",n)}}else e&&$(this).css("margin-top",0),i&&$(this).css("margin-bottom",100)})};setLookbookImages(),$(window).resize(function(){setLookbookImages()}),$(document).ready(function(){setTimeout(function(){setLookbookImages()},1e3)});var addLookbookProducts=function(o,t){var e=$("[data-product-details-url]").data("product-details-url"),i=$("[data-check-translation]").data("check-translation");$(o.currentTarget).siblings("[data-lookbook-products]").each(function(){var o=$(this),s=JSON.stringify(o.data("lookbook-products")),r=JSON.parse(s);$.each(r,function(s,r){var n=e+t+1+t+r.id,a={__collection:"product-details.Product.Name|product-details.Product.Price|product-details.Product.PreviousPrice|product-details.Product.MinPrice"};$.ajax({url:n,async:!1,data:a,success:function(l){null==l.collection["product-details.Product.Name"]&&"-"==t?$.ajax({url:e+",1,"+r.id,async:!1,data:a,success:function(t){null!=t.collection["product-details.Product.Price"]?(o.append('<div class="lookbook__product"><div class="lookbook__productName">'+t.collection["product-details.Product.Name"]+'</div><div class="lookbook__productPrice">'+t.collection["product-details.Product.Price"].toPrice(2)+" "+__curr+'</div><a href="'+n+'" class="lookbook__checkProductLink">'+i+"</div></div>"),null!=t.collection["product-details.Product.PreviousPrice"]&&(o.find(".lookbook__product").eq(s).append('<div class="lookbook__productPreviousPrice old-price">'+t.collection["product-details.Product.PreviousPrice"].toPrice(2)+" "+__curr+"</div>"),o.find(".lookbook__product").eq(s).find(".lookbook__productPrice").addClass("red-price")),null!=t.collection["product-details.Product.MinPrice"]&&"minimalPriceYes"==__minimalPrice&&o.find(".lookbook__product").eq(s).append('<div class="lookbook__productMinPrice min-price"><span>'+__translations.Price_Omnibus+" "+t.collection["product-details.Product.MinPrice"].toPrice(2)+" "+__curr+"</span></div>")):null!=t.collection["product-details.Product.Name"]&&o.append('<div class="lookbook__product"><div class="lookbook__productName">'+t.collection["product-details.Product.Name"]+'</div><a href="'+n+'" class="lookbook__checkProductLinkNotLogged">'+i+"</div></div>")}}):null!=l.collection["product-details.Product.Price"]?(o.append('<div class="lookbook__product"><div class="lookbook__productName">'+l.collection["product-details.Product.Name"]+'</div><div class="lookbook__productPrice">'+l.collection["product-details.Product.Price"].toPrice(2)+" "+__curr+'</div><a href="'+n+'" class="lookbook__checkProductLink">'+i+"</div></div>"),null!=l.collection["product-details.Product.PreviousPrice"]&&(o.find(".lookbook__product").eq(s).append('<div class="lookbook__productPreviousPrice old-price">'+l.collection["product-details.Product.PreviousPrice"].toPrice(2)+" "+__curr+"</div>"),o.find(".lookbook__product").eq(s).find(".lookbook__productPrice").addClass("red-price")),null!=l.collection["product-details.Product.MinPrice"]&&"minimalPriceYes"==__minimalPrice&&o.find(".lookbook__product").eq(s).append('<div class="lookbook__productMinPrice min-price"><span>'+__translations.Price_Omnibus+" "+l.collection["product-details.Product.MinPrice"].toPrice(2)+" "+__curr+"</span></div>")):o.append('<div class="lookbook__product"><div class="lookbook__productName">'+l.collection["product-details.Product.Name"]+'</div><a href="'+n+'" class="lookbook__checkProductLinkNotLogged">'+i+"</div></div>")}})})}),$(o.currentTarget).addClass("used")};let h=!1;$("body").on("click",".showLookbookProducts-js",function(o){$(o.currentTarget).hasClass("used")||addLookbookProducts(o,"-"),$(o.currentTarget).hide();const t=$(o.currentTarget).siblings().show().filter(".lookbook__productsToggleButton");t.length>0&&setTimeout(()=>
16{t.first().focus()},50),h=!0,$(window).width()<=768&&$("body").addClass("noscroll")}),$("body").on("click",".hideLookbookProducts-js",function(o){$(o.currentTarget).siblings().hide(),$(o.currentTarget).next().show(),$(o.currentTarget).hide();const t=$(o.currentTarget).nextAll(".lookbook__productsToggleButton").first();t.length>0&&setTimeout(()=>{t.focus()},50),h=!1,$(window).width()<=768&&$("body").removeClass("noscroll")}),$(window).on("resize",function(){$(".lookbookImageContainer-js").index()>=0&&$("body").hasClass("noscroll")&&$(window).width()>=769&&$("body").removeClass("noscroll"),1==h&&$(window).width()<=768&&$("body").addClass("noscroll")})} 17 18var comparerFunctions={mobileSliderSet:!1,init:function(){this.events(),this.showWishListItemsOnComparer(),comparerFunctions.setSlider(),$("#amount").attr("value")>4&&$(".row > section").addClass("comparerSlider__manyItems")},events:function(){$(document).ready(function(){$(".propertyValue-js").each(function(o){var e=$(this).text();e=e.replace(/([A-Z])/g," $1").trim(),$(this).text(e)}),$(".row").each(function(){$(this).hasClass("groupInfo")||($(this).children(".property").css("box-shadow","2px 0 2px -2px #E5E5E5"),$(this).children(".topSection-info").css("box-shadow","2px 0 2px -2px #E5E5E5"))})});var o=$("#firstRow");if(o.index()>=0)var e=o.offset().top;else e=0;$(window).on("scroll",function(){if($(".frozenHeader").index()>=0)var i=parseInt($(".frozenHeader").css("height")+5);let t=Math.round(100*window.devicePixelRatio);window.pageYOffset>e&&t<=175?(o.css("position","sticky"),o.css("z-index","12"),$(".frozenHeader").index()>=0?$(window).width()>768?o.css("top",i+"px"):o.css("top","0px"):o.css("top","0")):(o.css("position","inherit"),o.css("top","none"),o.css("z-index","inherit"))}),$(".topSection-productInfo").on("click",".productWishListAdd-js",function(o){$(this).find(".favouriteIcon").hasClass("favouriteIcon-popup-js")?o.preventDefault():(app.productWishListAdd(o),$(this).find(".svgIcon").toggle(),$(this).find(".wishListCurrentAction").val("Product/WishListDelete"))}),$(".topSection-productInfo").on("click",".productWishListRemove-js",function(o){app.productWishListRemove(o),$(this).find(".svgIcon").toggle(),$(this).find(".wishListCurrentAction").val("Product/WishListAdd")}),$(".topSection-productInfo").on("click",".removeItem",function(o){app.productC
18omparisonToolDeleteItem(o)}),$("body").on("click",".removeComparer",function(o){let e=[],i=$(this).parent().find('input[name="productId"]');i.each(function(o){e.push(i.eq(o).attr("data-id"))}),app.productComparisonToolDeleteAll(e)}),$("body").on("mouseover",".favouriteIcon-popup-js, .wishListPopup-js",function(o){$(window).width()>768&&($(".wishListInfoPopup-comparer").show(),$(document).on("mousemove",comparerFunctions.showWishlistTooltipOnComparer(o)))}),$("body").on("click",".favouriteIcon-popup-js, .wishListPopup-js",function(o){$(window).width()<=768&&app.showTemporaryPopup(__translations.PrList_LogInToWishList,"info","",2e3)}),$("body").on("mouseleave",".favouriteIcon-popup-js, .wishListPopup-js",function(o){$(".wishListInfoPopup-comparer").hide(),$(document).off("mousemove",comparerFunctions.showWishlistTooltipOnComparer(o))});var i=!1;$(".comparerContainer").on("click",".js-addToCart",function(o){0==i&&(productDetailsFunctions.events(),i=!0);var e=$(this);o.preventDefault(),$(".popup-dialog").remove();var t=$(this).find('input[name="productId"]').val(),n=$(o.currentTarget).parent().find(".productUrl").val();if("PDnewVariant"==__productDetailsVariant)var s=!0;else s=!1;if(e.hasClass("js-notifyAboutAvailability"))$(".notify-about-availability-popup").remove(),$.get(n,{__template:"partials/common/notify-about-availability-popup.html"},function(o){$(".productsList").append(o.template);var i=$(e).find("span").data("popup-class");$(i).find('input[name="productId"]').val(t),$(i).removeClass("hidden"),productDetailsFunctions.checkWishList(t),$(i).show()});else if(e.hasClass("js-askForPrice"))$(".ask-for-price-popup").remove(),$.get(n,{__template:"partials/common/ask-for-price-popup.html"},function(o){$(".productsList").append(o.template);var i=$(e).find("span").data("popup-class");$(i).find('input[name="productId"]').val(t),$(i).removeClass("hidden"),productDetailsFunctions.checkWishList(t),$(i).show()});else{if(1==app.isPlacingOrdersLockDueToTime())return void app.getOrdersUnablePopup();$.get(n,{__collection:"product-details.Product",__template:"partials/products-list/add-to-cart-popup.html"},function(o){$(".comparerContainer").append(o.template),$("body").addClass("noscroll"),1==s?$(".product-item__cartPopup--oldView").remove():$(".product-item__cartPopup--newView").remove(),addClipAndBatchToCartInPopup(!0),changeAttributesDivToSelectInPopup(),changeAttributesPolyToSelectInPopup(),initProductDetailsInPopup(!0),null!=o.collection.Image&&null!=o.collection.Image.Id&&-1!=o.collection.Image.Id&&o.collection.Image.Link?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="img/medium/'+o.collection.Image.Id+"/"+o.collection.Image.Link+'.jpg">'):null!=o.collection.Image&&null!=o.collection.Image.ExternalUrl&&""!=o.collection.Image.ExternalUrl?$(".product-details__detailsWrapper--productImage").append('<img alt="product_Image" src="'+o.collection.Image.ExternalUrl+'">'):$(".product-details__detailsWrapper--productImage").append('<i><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#image-light"></use></svg></i>')})}}),$(".comparerContainer").on("click",".js-addToCart-Immediately",function(o){o.preventDefault(),1!=app.isPlacingOrdersLockDueToTime()?0==lockAddToCart&&(lockAddToCart=!0,addToCart(o)):app.getOrdersUnablePopup()}),$(".comparerContainer").on("click",".closeCartPopup-js",function(){$(".product-list__cartPopup").remove(),$(".after-adding-to-cart-popup").remove(),$("body").removeClass("noscroll")}),$(".comparerContainer").on("click",".comparerAskForPrice-js",function(o){let e=$(o.currentTarget).data("id");$(".popup-dialog.ask-for-price-popup").index()>=0?($(".popup-dialog.ask-for-price-popup").show(),$(".ask-for-price-popup").find('input[name="productId"]').val(e)):$.get(null,{__template:"partials/common/ask-for-price-popup.html"},function(o){$(".comparerContainer").append(o.template),$(".popup-dialog.ask-for-price-popup").show(),$(".ask-for-price-popup").find('input[name="productId"]').val(e)})}),$(".comparerContainer").on("click",".comparerNotifyAboutAvailability-js",function(o){let e=$(o.currentTarget).data("id");$(".popup-dialog.notify-about-availability-popup").index()>=0?($(".popup-dialog.notify-about-availability-popup").show(),$(".notify-about-availability-popup").find('input[name="productId"]').val(e)):$.get(null,{__template:"partials/common/notify-about-availability-popup.html"},function(o){$(".comparerContainer").append(o.template),$(".popup-dialog.notify-about-availability-popup").show(),$(".notify-about-availability-popup").find('input[name="productId"]').val(e)})}),$(".comparerContainer").on("click",".remember-choice",function(o){app.rememberChoice(o),app.hidePopup(o)}),$(".comparerContainer").on("click",".product-item__cartPopup .open-popup-notify-about-availability, .product-item__cartPopup .open-popup-ask-for-price",function(o){$(".product-item__cartPopup").hide(),preventScrolling()})},showSliderArrows:function(){var o=$("#amount").attr("value"),e=$(".topSection-productInfo"),i=[],t=0;e.each(function(){"false"==$(this).attr("aria-hidden")&&(i[t++]=$(this))}),o>4?$(window).width()>1300&&i[2]&&i[3]?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").addClass("hidden"),i[1].find(".itemPrev").addClass("hidden"),i[1].find(".itemNext").addClass("hidden"),i[2].find(".itemPrev").addClass("hidden"),i[2].find(".itemNext").addClass("hidden"),i[3].find(".itemPrev").addClass("hidden"),i[3].find(".itemNext").removeClass("hidden"),setTimeout(function(){comparerFunctions.showSliderArrows()},500)):$(window).width()>=768&&$(window).width()<=1300&&i[1]?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").addClass("hidden"),i[1].find(".itemNext").removeClass("hidden"),i[1].find(".itemPrev").addClass("hidden")):$(window).width()>=768&&$(window).width()<=1300&&!i[1]?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").addClass("hidden"),setTimeout(function(){comparerFunctions.showSliderArrows()},500)):$(window).width()<768?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").removeClass("hidden")):(comparerFunctions.hideSliderArrows(),setTimeout(function(){comparerFunctions.showSliderArrows()},500)):o>2&&o<=4?$(window).width()>=768&&$(window).width()<=1300&&i[1]?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").addClass("hidden"),i[1].find(".itemNext").removeClass("hidden"),i[1].find(".itemPrev").addClass("hidden")):$(window).width()>=768&&$(window).width()<=1300&&!i[1]?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").addClass("hidden"),setTimeout(function(){comparerFunctions.showSliderArrows()},500)):$(window).width()<768?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").removeClass("hidden")):comparerFunctions.hideSliderArrows():1!=o&&2!=o||($(window).width()<=768?(i[0].find(".itemPrev").removeClass("hidden"),i[0].find(".itemNext").removeClass("hidden")):comparerFunctions.hideSliderArrows())},hideSliderArrows:function(){$(".itemPrev, .itemNext").addClass("hidden")},showWishlistTooltipOnComparer:function(o){let e=o.clientX,i=o.clientY;$(".wishListInfoPopup-comparer").css("left",e-200+"px"),$(".wishListInfoPopup-comparer").css("top",i+30+"px")},showWishListItemsOnComparer:function(){if("true"===$('input[name="customerAuthenticated"]').val()){var o=[];$('.addToFavouriteButton > input[name="productId"]').each(function(e){o[e]=parseInt($(this).attr("value"))}),$.get(null,{__action:"Product/WishListCheck",products:JSON.stringify(o)},function(e){let i=e.action.Object;if(null!=i)for(let e=0;e<o.length;e++){let t=!1;for(wishListItem of i)wishListItem.Id==o[e]&&($(".topSection-productInfo").eq(e).find(".svgIcon--notOnWish").css("display","none"),$(".topSection-productInfo").eq(e).find(".svgIcon--onWish").css("display","block"),$(".topSection-productInfo").eq(e).find(".favouriteIcon").addClass("wishList"),$(".topSection-productInfo").eq(e).find(".addToFavouriteButton").removeClass("productWishListAdd-js").addClass("productWishListRemove-js"),$(".topSection-productInfo").eq(e).find(".wishListCurrentAction").val("Product/WishListDelete"),t=!0);0==t&&($(".topSection-productInfo").eq(e).find(".svgIcon--notOnWish").css("display","block"),$(".topSection-productInfo").eq(e).find(".svgIcon--onWish").css("display","none"),$(".topSection-productInfo").eq(e).find(".favouriteIcon").removeClass("wishList"),$(".topSection-productInfo").eq(e).find(".addToFavouriteButton").addClass("productWishListAdd-js").removeClass("productWishListRemove-js"),$(".topSection-productInfo").eq(e).find(".wishListCurrentAction").val("Product/WishListAdd"))}})}},setSlider:function(){const o=new Swiper(".main-comparer-slider-js",{slidesPerView:"auto",allowTouchMove:!1,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},breakpoints:{0:{slidesPerView:1,allowTouchMove:!0},768:{slidesPerView:2,allowTouchMove:!0},1300:{slidesPerView:"auto",allowTouchMove:!1}}}),e=new Swiper(".comparer-slider-js",{slidesPerView:"auto",allowTouchMove:!1,breakpoints:{0:{slidesPerView:1,allowTouchMove:!0},768:{slidesPerView:2,allowTouchMove:!0},1300:{slidesPerView:"auto",allowTouchMove:!1}},controller:{control:o}});o.controller.control=e}}; 19 20var advancedSearchFunctions={init:function(){this.events()},events:function(){$("body").on("click",".js-search-item",function(e){$(e.currentTarget).closest(".searchType").children(".selected").removeClass("selected"),$(e.currentTarget).parent().addClass("selected")}),$(window).ready(function(){$(".advancedSearch").find("input").prop("checked",!1)}),$("body").on("click",".checkboxContainer > span",function(e){e.stopPropagation();var a=$(this).children("input");-1!=$(e.currentTarget).parent().parent().find(".manufacturerorbrand").index()?$(e.currentTarget).hasClass("search-disabled")?e.preventDefault():($(e.currentTarget).addClass("search-current"),1==a.prop("checked")?(a.prop("checked",!1),$(".manufacturerorbrand").parent().find("span:not(.search-current)").removeClass("search-disabled")):(a.prop("checked",!0),$(".manufacturerorbrand").parent().find("span:not(.search-current)").addClass("search-disabled")),setTimeout(function(){$(e.currentTarget).removeClass("search-current")},200)):1==a.prop("checked")?a.prop("checked",!1):a.prop("checked",!0)}),$("body").on("click",".search-radio",function(e){$(".search-radio[value=searchAll]").is(":checked")?$(".advanced-search-input").attr("name","searchAll"):$(".search-radio[value=searchWild]").is(":checked")?$(".advanced-search-input").attr("name","searchWild"):$(".search-radio[value=searchAny]").is(":checked")?$(".advanced-search-input").attr("name","searchAny"):$(".advanced-search-input").attr("name","name")}),$("body").on("change","#priceTo, #priceFrom",function(e){var a=Number($("#priceTo").val()),r=Number($("#priceFrom").val());""!=a&&$("#priceTo").val(parseInt(a)),""!=r&&$("#priceFrom").val(parseInt(r)),r>a?($(".form__invalid-input").css("visibility","visible"),$(".searchButton").prop("disabled",!0)):($(".form__invalid-input").css("visibility","hidden"),$(".searchButton").prop("disabled",!1))}),$("body").on("keydown","#priceFrom, #priceTo",function(e){!["-","+","e",".",",","E"].includes(e.ke
20y)&&["1","2","3","4","5","6","7","8","9","0","Backspace","ArrowLeft","ArrowRight","Delete","Tab"].includes(e.key)||e.preventDefault()}),$("body").on("paste","#priceFrom, #priceTo",function(e){e.preventDefault()}),$(window).scroll(function(){let e=$(document).height()-$(window).height()-$(window).scrollTop();$(".newsletter1-wrapper")[0]?$(this).scrollTop()>300&&e>20?$(".searchButton").addClass("scrollingButton"):$(".searchButton").removeClass("scrollingButton"):$(this).scrollTop()>300?$(".searchButton").addClass("scrollingButton"):$(".searchButton").removeClass("scrollingButton")}),$(function(){$("body").on("click",".searchButton",function(e){if(!e.detail||1==e.detail){var a,r=$(this).parents(".advancedSearch"),n=$("#SearchAdvancedForm input[type!=hidden],#SearchAdvancedForm select").serializeArray(),t=r.find("input:not([disabled]), select:not([disabled]), textarea:not([disabled])").serializeArray();for(a in n)if(n[a].value)break;t.push({name:"__csrf",value:__CSRF}),$.post(null,t,function(e){e.action.Redirect302&&(location.href=e.action.Redirect302)})}})}),$(function(){$(window).on("keypress",function(e){if(!$(document.activeElement).is("span, label, input, textarea, select")&&13==e.which){var a,r=$(".searchButton").parents(".advancedSearch"),n=$("#SearchAdvancedForm input[type!=hidden],#SearchAdvancedForm select").serializeArray(),t=r.find("input:not([disabled]), select:not([disabled]), textarea:not([disabled])").serializeArray();for(a in n)if(n[a].value)break;t.push({name:"__csrf",value:__CSRF}),$.post(null,t,function(e){e.action.Redirect302&&(location.href=e.action.Redirect302)})}})})}}; 21 22$(function(){lazy.init(".banner2",e=>{if(e.querySelectorAll(".swiper-slide").length>1)return new Swiper(e,{loop:!0,watchSlidesProgress:!0,speed:500,slidesPerView:1,autoplay:{delay:8e3},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},pause:{enabled:!0,el:e.querySelector(".swiper-button-pause")}})})}); 23 24var newsletter3Functions={init:function(){newsletter3Functions.events()}
24,events:function(){var e=$(".newsletter3__wrapper"),t=$(".newsletter3");$(window).on("load",function(){var n,s=new Date(Date.now()),o=__newsletterDaysDiff?parseInt(__newsletterDaysDiff):30,l=!1;$.each(document.cookie.split(/; */),function(){var e=this.split("=");if("NewsletterShowDate"==e[0]){l=!0;var t=new Date(e[1]);n=(s.getTime()-t.getTime())/864e5}}),(0==l||n&&n>=o)&&(document.cookie="NewsletterShowDate="+s,e.fadeIn(2e3),t.show(200),t.css("display","flex"),app.activateFocusTrap(".newsletter3__wrapper",document.body)),newsletter3Functions.setNewsletterLength()}),e.on("click",".closeNewsletterPopup",function(){e.fadeOut(1e3)}),t.on("click",".newsletter3__info__consent > *",function(e){newsletter3Functions.setNewsletterLength()})},hideNewsletterPopup:function(){$(".newsletter3__wrapper").fadeOut(3e3)},setNewsletterLength:function(){var e=$(".newsletterTextInput").attr("value"),t=$(".newsletterHeadingInput").attr("value"),n=parseInt($(".newsletter3__info__consent").css("height"));e.length>80&&($(".newsletter3__info__details").addClass("longTextNewsletter"),$(".newsletter3__info__confirmButton").addClass("confirmButtonLongText")),t.length>50&&($(".newsletter3__info__title").addClass("longHeadingNewsletter"),$(".newsletter3__info__confirmButton").addClass("confirmButtonLongText")),t.length>50&&e.length>80&&n>120?($(".newsletter3__info__consent").addClass("longConsents"),$(".newsletter3__info__confirmButton").addClass("confirmButtonLongText")):n>170&&($(".newsletter3__info__consent").addClass("longConsentsSecond"),$(".newsletter3__info__confirmButton").addClass("confirmButtonLongText"))}}; 25 26$(function(){lazy.init(".manufacturer2-slider",e=>{const r=e.querySelectorAll(".swiper-slide").length;return new Swiper(e,{a11y:{enabled:!0},slidesPerView:4,slidesPerGroup:1,spaceBetween:50,centerInsufficientSlides:!0,watchSlidesProgress:!0,navigation:{nextEl:".manufacturer2-slider-next",prevEl:".manufacturer2-slider-prev"},autoplay:{delay:3e3},pause:{enabled:!0,el:".manufacturer2-slider-pause"},breakpoints:{0:{slidesPerView:1.75,centeredSlides:!0,loop:!1},551:{slidesPerView:1,loop:r>1},769:{slidesPerView:2,loop:r>2},1025:{slidesPerView:3,loop:r>3},1601:{slidesPerView:4,loop:r>4}}})})}); 27 28$(function(){lazy.init(".banner6",e=>new Swiper(e,{slidesPerView:2,slidesPerGroup:1,loop:!0,watchSlidesProgress:!0,autoplay:{delay:8e3},pause:{enabled:!0,el:e.querySelector(".swiper-button-pause")},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},breakpoints:{0:{slidesPerView:1},768:{slidesPerView:2,spaceBetween:20},1200:{slidesPerView:3,spaceBetween:20}}}))}); 29 30var recommendedTileFunctions={isDetailsFunctionsStarted:!1,init:function(){recommendedTileFunctions.showWishListItems(),recommendedTileFunctions.events()},showWishListItems:function(){let t=$('input[name="customerAuthenticated"]').val();var e=[];$(".product-item-rec > .currentProductId").each(function(t){e[t]=parseInt($(this).attr("value")),e[t]||(e[t]=-1)}),"true"===t&&e.length>0&&$.get(null,{__action:"Product/WishListCheck",products:JSON.stringify(e)},function(t){let o=t.action.Object;if(null!=o)for(let t=0;t<e.length;t++){let i=!1;for(wishListItem of o)wishListItem.Id==e[t]&&($(".product-item-rec").eq(t).find(".product-item__heartIcon__notWish").addClass("hidden"),$(".product-item-rec").eq(t).find(".product-item__heartIcon__wish").removeClass("hidden"),$(".product-item-rec").eq(t).find(".wishlistButton").removeClass("productWishListAdd-js").addClass("productWishListRemove-js"),$(".product-item-rec").eq(t).find('.wishlistButton > input[name="__action"]').val("Product/WishListDelete"),i=!0);0==i&&($(".product-item-rec").eq(t).find(".product-item__heartIcon__notWish").removeClass("hidden"),$(".product-item-rec").eq(t).find(".product-item__heartIcon__wish").addClass("hidden"),$(".product-item-rec").eq(t).find(".wishlistButton").addClass("productWishListAdd-js").removeClass("productWishListRemove-js"),$(".product-item-rec").eq(t).find('.wishlistButton > input[name="__action"]').val("Product/WishListAdd"))}})},showWishlistTooltip:function(t){let e=t.clientX,o=t.clientY;$(".wishListInfoPopup").css("left",e-200+"px"),$(".wishListInfoPopup").css("top",o+30+"px")},events:function(){let t=$(".product-item-rec");$("body").on("click keydown",".closeCartPopup-js",function(t){"click"!==t.type&&("keydown"!==t.type||"Enter"!==t.key&&" "!==t.key)||("keydown"===t.type&&t.preventDefault(),$(".tmpAddToCartForm").index()>=0&&$(".tmpAddToCartForm").attr("id","AddToCartForm").removeClass("tmpAddToCartForm"))}),t.on("click",".js-addToCart",function(t){if(t.preventDefault(),1!=app.isPlacingOrdersLockDueToTime()){if($("#AddToCartForm").addClass("tmpAddToCartForm").removeAttr("id"),!t.detail||1==t.detail){"IndustryShop"==__ImportExportTemplateType&&productListFunctions.init(),$("#isProductDetailsPage").index()<0&&0==recommendedTileFunctions.isDetail
30sFunctionsStarted&&(productDetailsFunctions.events(),recommendedTileFunctions.isDetailsFunctionsStarted=!0);var e=$(this),o=$(this).find('input[name="productId"]').val(),i=$(t.currentTarget).parents(".product-item-rec").attr("href");if(i||(i=$(t.currentTarget).closest(".product-url").attr("href")),$(".popup-dialog:not(.image-rotate-popup)").remove(),"PDnewVariant"==__productDetailsVariant)var a=!0;else a=!1;e.hasClass("js-notifyAboutAvailability")?($(".notify-about-availability-popup").remove(),$.get(i,{__template:"partials/common/notify-about-availability-popup.html"},function(i){$("main").append(i.template);var a=$(e).find("span").data("popup-class");$(a).find('input[name="productId"]').val(o),$(a).removeClass("hidden"),productDetailsFunctions.checkWishList(o),$(a).show(),ui.formLabelAnimationOnLoadPage(),app.activateFocusTrap(a,t.target.closest(".product-item"))})):e.hasClass("js-askForPrice")?($(".ask-for-price-popup").remove(),$.get(i,{__template:"partials/common/ask-for-price-popup.html"},function(i){$("main").append(i.template);var a=$(e).find("span").data("popup-class");$(a).find('input[name="productId"]').val(o),$(a).removeClass("hidden"),productDetailsFunctions.checkWishList(o),$(a).show(),ui.formLabelAnimationOnLoadPage(),app.activateFocusTrap(a,t.target.closest(".product-item"))})):e.hasClass("js-addToCart-Immediately")?0==lockAddToCart&&(lockAddToCart=!0,$(".after-adding-to-cart-popup").remove(),$.get(i,{__template:"partials/common/after-adding-to-cart-popup.html"},function(e){$("main").append(e.template),addToCart(t)})):"IndustryShop"==__ImportExportTemplateType?$.get(i,{__collection:"product-details.Product",__template:"partials/products-list/industry-add-to-cart-popup.html"},function(t){$("main").append(t.template);const e=$('input[name="go-to-cart"]').val();$.get(e,{__collection:"cart.Note"},function(t){t.collection&&$(".industryProductPopup .textareaNote").val(t.collection).data("initText",t.collection)}),$("body").addClass("noscroll"),addClipAndBatchToCartIndustry(),$("#AddToCartForm").find(".attributesContainer__attribute.active label").eq(0).click()}):$.get(i,{__collection:"product-details.Product",__template:"partials/products-list/add-to-cart-popup.html"},function(e){if($("main").append(e.template),$("body").addClass("noscroll"),1==a?$(".product-item__cartPopup--oldView").remove():$(".product-item__cartPopup--newView").remove(),addClipAndBatchToCartInPopup(!0),changeAttributesDivToSelectInPopup(),changeAttributesPolyToSelectInPopup(),initProductDetailsInPopup(!0),t&&t.target){const e=t.target.closest(".product-item");e&&app.activateFocusTrap(".product-item__cartPopup--container",e)}null!=e.collection.Image&&null!=e.collection.Image.Id&&-1!=e.collection.Image.Id&&e.collection.Image.Link?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="img/medium/'+e.collection.Image.Id+"/"+e.collection.Image.Link+'.jpg">'):null!=e.collection.Image&&null!=e.collection.Image.ExternalUrl&&""!=e.collection.Image.ExternalUrl?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="'+e.collection.Image.ExternalUrl+'">'):$(".product-details__detailsWrapper--productImage").append('<i><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#image-light"></use></svg></i>')})}}else app.getOrdersUnablePopup()}),t.on("click",".productWishListAdd-js",function(t){t.detail&&1!=t.detail||(t.preventDefault(),t.stopPropagation(),app.productWishListAdd(t),setTimeout(function(){recommendedTileFunctions.showWishListItems()},500))}),t.on("click",".productWishListRemove-js",function(t){t.detail&&1!=t.detail||(t.preventDefault(),t.stopPropagation(),app.productWishListRemove(t),setTimeout(function(){recommendedTileFunctions.showWishListItems()},500))}),t.on("mouseover",".productWishListShowPopup-js",function(t){$(window).width()>768&&($(".wishListInfoPopup").show(),$(document).on("mousemove",recommendedTileFunctions.showWishlistTooltip(t)))}),t.on("click",".productWishListShowPopup-js",function(t){t.preventDefault(),t.stopPropagation(),app.showTemporaryPopup(__translations.PrList_LogInToWishList,"info","",2e3)}),t.on("mouseleave",".productWishListShowPopup-js",function(t){$(".wishListInfoPopup").hide(),$(document).off("mousemove",recommendedTileFunctions.showWishlistTooltip(t))})}}; 31 32$(function(){lazy.init(".recommended-products1-js",e=>new Swiper(e,{slidesPerView:4,slidesPerGroup:1,navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},breakpoints:{0:{slidesPerView:1},601:{slidesPerView:2},993:{slidesPerView:3},1441:{slidesPerView:4}}}))}),$(".recommended-js").each(function(){const e=$(this).data("flag"),t=$(this).find(".recommended-title-js");$.post(null,{__csrf:__CSRF,__action:"Get/SearchAdvanced",flags:e},e=>{if(e.action.Redirect302){const i=$("<a>",{href:e.action.Redirect302,text:t.text(),class:t.attr("class")});t.replaceWith(i)}})}); 33 34$(function() { 35 lazy.init('.blog-2-js', (element) => { 36 return new Swiper(element, { 37 slidesPerView: 1, 38 slidesPerGroup: 1, 39 watchOverflow: true, 40 autoplay: { 41 delay: 8000, 42 }, 43 pause: { 44 enabled: true, 45 el: element.querySelector('.swiper-button-pause'), 46 }, 47 breakpoints: { 48 769: { 49 slidesPerView: 2, 50 slidesPerGroup: 1, 51 } 52 }, 53 navigation: { 54 nextEl: element.querySelector('.swiper-button-next'), 55 prevEl: element.querySelector('.swiper-button-prev'), 56 }, 57 }); 58 }); 59}); 60 61$(function(){lazy.init(".banner5",e=>new Swiper(e,{slidesPerView:2,slidesPerGroup:1,loop:!0,watchSlidesProgress:!0,keyboard:{enabled:!0,onlyInViewport:!0},autoplay:{delay:8e3,disableOnInteraction:!0},pause:{enabled:!0,el:e.querySelector(".swiper-button-pause")},a11y:{enabled:!0},navigation:{nextEl:e.querySelector(".swiper-button-next"),prevEl:e.querySelector(".swiper-button-prev")},breakpoints:{0:{slidesPerView:1},768:{slidesPerView:2,spaceBetween:20}}}))}); 62 63var textElement2Functions={init:function(){textElement2Functions.setTextElement(),textElement2Functions.events()},setTextElement:function(){$("div[class^='textElement-']").each(function(){let e=$(this).find("input").val();if(null==e)return null;let t=textElement2Functions.getTextElementValue(e);textElement2Functions.isTextElementEmpty(t)?$(this).css("display","none"):($(this).find(".textElement-2__header.textElementHeader").html(t.header1),$(this).find(".textElement-2__secondHeader.textElementSecondHeader").html(t.header2),$(this).find(".textElement-2__column.textElementColumn").html(t.column1),$(this).find(".textElement-2__secondColumn.textElementSecondColumn").html(t.column2),$(this).find(".textElementThirdColumn").html(t.column3),$(this).find(".textElement-2__image.textElementImage").attr("data-src",t.image),"right"===t.position&&($(this).find(".textElement-2__element-wrapper").addClass("textElement-2__element-wrapper--reverse"),$(this).find(".textElement-2__content-wrapper").addClass("textElement-2__content-wrapper--reverse")))})},getTextElementValue:function(e){const t=RegExp("<header1>(s*(?:w|[^w])*s*)</header1>"),n=RegExp("<header2>(s*(?:w|[^w])*s*)</header2>"),l=RegExp("<column1>(s*(?:w|[^w])*s*)</column1>"),o=RegExp("<column2>(s*(?:w|[^w])*s*)</column2>"),c=RegExp("<column3>(s*(?:w|[^w])*s*)</column3>"),s=RegExp("<position>(s*(?:w|[^w])*s*)</position>"),m=RegExp("<image>(s*(?:w|[^w])*s*)</image>");let i,r,a,u,d,h,E=null;return i=null!==textElement2Functions.checkMatch(e,t)?textElement2Functions.checkMatch(e,t).substring(0,50):null,r=null!==textElement2Functions.checkMatch(e,n)?textElement2Functions.checkMatch(e,n).substring(0,50):null,a=textElement2Functions.checkMatch(e,l),u=textElement2Functions.checkMatch(e,o),d=textElement2Functions.checkMatch(e,c),h=textElement2Functions.checkMatch(e,s),E=textElement2Functions.checkMatch(e,m),{header1:i,header2:r,column1:a,column2:u,column3:d,position:h,image:E}},checkMatch:function(e,t){return e&&e.match(t)&&e.match(t).hasOwnProperty(1)?e.match(t)[1]:null},isTextElementEmpty:function(e){for(const[t,n]of Object.entries(e))if(null!==n)return!1;return!0},events:function(){$(".textElement-2").on("click",".showMoreText",function(e){const t=e.target.parentElement,n=t.querySelector(".showMoreText-more"),l=t.querySelector(".showMoreText-less"),o=t.querySelector(".textElement-2__column-wrapper");"block"==window.getComputedStyle(n).display?(l.style.display="block",n.style.display="none",o.classList.remove("textElement-2__column-wrapper__mobileTextHider")):"block"==window.getComputedStyle(l).display&&(l.style.display="none",n.style.display="block",o.classList.add("textElement-2__column-wrapper__mobileTextHider"),t.scrollIntoView())}),$(window).on("resize",function(){const e=document.querySelectorAll(".showMoreText-more"),t=document.querySelectorAll(".showMoreText-less"),n=document.querySelectorAll(".textElement-2__column-wrapper");$(window).width()>
63"768"?(e.forEach(e=>{e.style.display="none"}),t.forEach(e=>{e.style.display="none"})):$(window).width()<="768"&&(e.forEach(e=>{const t=e.parentElement.querySelector(".showMoreText-less");"none"==window.getComputedStyle(t).display&&(e.style.display="block")}),n.forEach(e=>{const t=e.parentElement.parentElement.parentElement.parentElement.querySelector(".showMoreText-less");"none"==window.getComputedStyle(t).display&&(e.classList="textElement-2__column-wrapper textElement-2__column-wrapper__mobileTextHider")}))})}}; 64 65var ajax_lock=!1;let askForPriceInProgress=!1;var productListFunctions={init:function(){productListFunctions.events(),productListFunctions.itemClickableEvents(),productListFunctions.applyResetFilters(),productListFunctions.setPriceSlider(),productListFunctions.removeEmptyFilters(),productListFunctions.showWishListItems(),$(".redundant").slideToggle(),"true"==$("#showBrandOnly").val()&&productListFunctions.setBreadcrumbsLastPiece(),showAllPhantomVariants(),initSubcategoriesSlider()},setBreadcrumbsLastPiece:function(){let t=$("#showBrandOnly").attr("data-currentbrand");$(".breadcrumbs").append('<li class="breadcrumbs__piece breadcrumbs__piece--last">'+t+"</li>")},applyResetFilters:function(){$.pushObj=function(t,e){var i;for(i in e)t.push({name:i,value:e[i]})},$(".product-list__filters .filter-group-wrapper .filter-group .redundant").each(function(t,e){$(e).children().children().children().children("input[checked]").length&&($(e).toggle(),$(e.parentNode).children(".filter-more").toggle(),$(e.parentNode).children(".filter-less").toggle())}),$(".product-list__filters .filter-group-wrapper .filter-group input[checked]").each(function(t,e){$(e).parent().addClass("custom-checkbox--checked")})},resetFilters:function(){$($(".searchFilters-js").find("input:checked").prop("checked",!1)),$(".productsList__priceSlider__minPrice-js").val($(".productsList__priceSlider__minPrice-js").attr("min")),$(".productsList__priceSlider__from-js").text($(".productsList__priceSlider__minPrice-js").attr("min")),$(".productsList__priceSlider__maxPrice-js").val($(".productsList__priceSlider__maxPrice-js").attr("max")),$(".productsList__priceSlider__to-js").text($(".productsList__priceSlider__maxPrice-js").attr("max")),productListFunctions.setPriceSlider(),$(".getSearchFilters-js").click()},removeFilter:function(t,e=""){""==e&&0!=e&&(e=$(t.currentTarget).data("filter-id")),"price"===e?($(".productsList__priceSlider__minPrice-js").val($(".productsList__priceSlider__minPrice-js").attr("min")),$(".productsList__priceSlider__from-js").text($(".productsList__priceSlider__minPrice-js").attr("min")),$(".productsList__priceSlider__maxPrice-js").val($(".productsList__priceSlider__maxPrice-js").attr("max")),$(".productsList__priceSlider__to-js").text($(".productsList__priceSlider__maxPrice-js").attr("max")),productListFunctions.setPriceSlider(),$(".getSearchFilters-js").click()):($($(".searchFilters-js").find('input:checked[value="'+e+'"]')[0]).prop("checked",!1),$(".getSearchFilters-js").click())},reloadFilters:function(t){var e=t,i=0,r=[],a=__grapicalVariantsPresentationColorsData.split("|||");"false"==$("#showBrandOnly").val()&&$(".removeFilter-js").remove();var o=$(".productsList__priceSlider__minPrice-js"),n=$(".productsList__priceSlider__maxPrice-js");let s=!1;for(f in o.val()===o.attr("min")&&n.val()===n.attr("max")||(s=!0,"false"==$("#showBrandOnly").val()&&$(".selectedFilters-js").append('<div class="product-list__filtersButton sliderPriceFilter removeFilter-js" data-filter-id="price">'+o.val()+" - "+n.val()+" "+__curr+'<svg tabindex="0" role="button" class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#times-light"></use></svg></div>')),e){for(val in r[f]=!1,e[f].Values)e[f].Values[val].Selected&&(r[f]=!0);1==r[f]&&i++}if($(".filter-group").each(function(){if($(this).find("label"))for(f in e){var t=!1;if("Variants_Colors"===__graphicalVariantsPresentation)for(value in e[f].Values)for(colorValue in a)a[colorValue].split("||")[0].toLowerCase()==e[f].Values[value].Value.toString().toLowerCase()&&(t=!0);if("OTHER"==e[f].Field){var o=$(".otherFiltersLabel").find(".filter-label"),n=0;o.each(function(n){let p=-1,l=o.eq(n).text(),d=o.eq(n).data("value"),c=l.substring(0,l.lastIndexOf("(")).trim();for(let t=0;t<e[f].Values.length;t++){let i=e[f].Values[t].Text;if(c.includes(i)||d&&d.includes(i)){p=t;break}}if(-1!==p){if(o.eq(n).parent().parent().find(".filter-input").prop("disabled",!1),t){var u="",m="",_=!1;for(colorValue in a){let t=a[colorValue].split("||")[0].toLowerCase(),i=a[colorValue].split("||")[1];t==e[f].Values[p].Value.toString().toLowerCase()&&(u=i)}""==u&&(_=!0),m="#FFFFFF"!=u||u!=__primaryPageBg?u:"#000000"}"Variants_Colors"==__graphicalVariantsPresentation&&t?_?1!=i||1!=r[f]||s?o.eq(n).text(e[f].Values[p].Text+" ("+e[f].Values[p].Count+")"):o.eq(n).text(e[f].Values[p].Text+" ("+e[f].Values[p].TotalCount+")"):(1!=i||1!=r[f]||s?o.eq(n).text("       ("+e[f].Values[p].Count+")"):o.eq(n).text("       ("+e[f].Values[p].TotalCount+")"),o.eq(n).addClass("filter-label-colors"),o.eq(n).data("value",e[f].
65Values[p].Text),o.eq(n).attr("title",e[f].Values[p].Text),o.eq(n).css("background",u),o.eq(n).css("border-color",m)):1!=i||1!=r[f]||s?o.eq(n).text(e[f].Values[p].Text+" ("+e[f].Values[p].Count+")"):o.eq(n).text(e[f].Values[p].Text+" ("+e[f].Values[p].TotalCount+")");var g=$(this).text().substring($(this).text().lastIndexOf("(")+1,$(this).text().lastIndexOf(")")),h=$(this).parent().parent().find(".filter-input");0==g&&0==h.prop("checked")?h.attr("disabled","disabled"):h.removeAttr("disabled")}else{o.eq(n).parent().parent().find(".filter-input").prop("disabled",!0);let t=o.eq(n).text().substring(0,o.eq(n).text().lastIndexOf("("))+"(0)";o.eq(n).text(t)}})}else $(this).find("label").attr("for").toLowerCase().includes(e[f].Field.toLowerCase())&&(o=$(this).find(".filter-label"),n=0,o.each(function(p){if(n<e[f].Values.length&&(o.eq(p).text().includes(e[f].Values[n].Text)||o.eq(p).data("value").includes(e[f].Values[n].Text))){if(o.eq(p).parent().parent().find(".filter-input").prop("disabled",!1),t){var l="",d="",c=!1;for(colorValue in a){let t=a[colorValue].split("||")[0].toLowerCase(),i=a[colorValue].split("||")[1];t==e[f].Values[n].Value.toString().toLowerCase()&&(l=i)}""==l&&(c=!0),d="#FFFFFF"!=l||l!=__primaryPageBg?l:"#000000"}"Variants_Colors"==__graphicalVariantsPresentation&&t?c?1!=i||1!=r[f]||s?o.eq(p).text(e[f].Values[n].Text+" ("+e[f].Values[n].Count+")"):o.eq(p).text(e[f].Values[n].Text+" ("+e[f].Values[n].TotalCount+")"):(1!=i||1!=r[f]||s?o.eq(p).text("       ("+e[f].Values[n].Count+")"):o.eq(p).text("       ("+e[f].Values[n].TotalCount+")"),o.eq(p).addClass("filter-label-colors"),o.eq(p).data("value",e[f].Values[n].Text),o.eq(p).attr("title",e[f].Values[n].Text),o.eq(p).css("background",l),o.eq(p).css("border-color",d)):1!=i||1!=r[f]||s?o.eq(p).text(e[f].Values[n].Text+" ("+e[f].Values[n].Count+")"):o.eq(p).text(e[f].Values[n].Text+" ("+e[f].Values[n].TotalCount+")"),n+=1}else{o.eq(p).parent().parent().find(".filter-input").prop("disabled",!0);let t=o.eq(p).text().substring(0,o.eq(p).text().lastIndexOf("("))+"(0)";o.eq(p).text(t)}}))}}),"false"==$("#showBrandOnly").val())for(f in e)for(val in e[f].Values)1==e[f].Values[val].Selected&&$(".selectedFilters-js").append('<div class="product-list__filtersButton removeFilter-js" data-filter-id="'+e[f].Values[val].Value+'">'+e[f].Values[val].Text+'<svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#times-light"></use></svg></div>');$(".removeFilter-js").length>0?$("#reset-filters").removeClass("hidden"):$("#reset-filters").addClass("hidden"),setTimeout(function(){productListFunctions.removeEmptyFilters()},1e3)},removeEmptyFilters:function(){$(".filter-group").each(function(){$(this).find(".filter-label").each(function(){var t=$(this).text().substring($(this).text().lastIndexOf("(")+1,$(this).text().lastIndexOf(")")),e=$(this).parent().parent().find(".filter-input");0==t&&0==e.prop("checked")?e.attr("disabled","disabled"):e.removeAttr("disabled")})})},refreshPagination:function(t){var e=window.location.origin+window.location.pathname,i=t.collection,r=i.PageCount,a=i.TotalItems,o=i.SelectedSorting;if(r>1){$(".product-list__grid-wrapper").children(".product-list__pagination").length<1?($(".product-list__grid-wrapper").append('<div class="product-list__pagination"></div>'),$(".product-list__pagination").append('<ul class="pagination"></ul>')):($(".product-list__pagination > *").remove(),$(".product-list__pagination").append('<ul class="pagination"></ul>')),$(".pagination").append('<li class="pagination__link pagination__link--prev"><span aria-hidden="true" class="pagination__link--disabled"><svg class="svgIcon svgIcon--arrowLeft"><use xlink:href="css/img/icons-sprite.svg#arrow-to-right-light"></use></svg></span></li>'),$(".pagination").append('<li class="pagination__link pagination__link--active "><a aria-label="'+__translations.CurrentPage+'" href="'+e+"?sort="+o+'"><span>1</span></a></li>');for(let t=2;t<=r&&($(".pagination").append('<li class="pagination__link "><a aria-label="'+__translations.Page+'" class="" href="'+e+"?sort="+o+"&pageId="+t+'#products"><span>'+t+"</span></a></li>"),7!=t);t++);$(".pagination").append('<li class="pagination__link pagination__link--next"><a class="" href="'+e+"?sort="+o+"&pageId="+r+'#products" aria-label="'+__translations.NextPage+'"><span aria-hidden="true"><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#arrow-to-right-light"></use></svg></span></a></li>')}else $(".product-list__pagination > *").remove();if(a>12)var n=12;else n=a;$("#items-counter").text("1 - "+n+" "+__translations.Com_From+" "+a
65)},getSearchFilters:function(){var t=$(".productsList__priceSlider__minPrice-js"),e=$(".productsList__priceSlider__maxPrice-js");t.val()==t.attr("min")?t.prop("disabled",!0):t.prop("disabled",!1),e.val()==e.attr("max")?e.prop("disabled",!0):e.prop("disabled",!1);var i=$(".product-list__filters .filter-group-wrapper input").serializeArray();return $.pushObj(i,{__action:"get/SearchFilters"}),$.ajax({url:window.location.href,method:"GET",action:"get/SearchFilters",data:i,template:"elements/products-list/products-1.html",success:function(t){window.history.replaceState("","",t.action.Redirect302),"true"==$("#showBrandOnly").val()&&window.location.reload()}})},resetProductList:function(t=!0){productListFunctions.applyResetFilters();let e=$(".product-list__grid .products-container");$("#products").find(".product-item-pl, .product-item__placeholder").addClass("productitemtoremove"),$.get("",{__collection:"products",__template:__tilePath},function(i){if(i.collection.FilteringOptions){let r=i.collection.FilteringOptions.Filters;productListFunctions.refreshPagination(i),0==i.collection.Products.length?($(".product-list__no-results").remove(),$(".products-container").parent().append('<div class="product-list__no-results"><span><svg class="svgIcon svgIcon--arrowDown"><use xlink:href="css/img/icons-sprite.svg#times-light"></use></svg></span>'+__translations.Com_NoResults+"</div>")):$(".product-list__no-results").remove(),setTilesInformations(i,e),productListFunctions.reloadFilters(r),productListFunctions.itemClickableEvents(t),productListFunctions.showWishListItems(),$("#bannerInListContainer").index()>=0&&bannerInListFunctions.setBannerPosition()}else window.location.reload()})},parseQuery:function(t){var e,i,r,a={};if(t.length<=1)return{};for(e=t.substr(1).split("&"),i=0;i<e.length;i++)r=e[i].split("="),a[decodeURIComponent(r[0])]=decodeURIComponent(r[1]||"");return a},setPriceSlider:function(){if($(".productsList__priceSlider-js").length>0&&$(".productsList__priceSlider-js").not(".ui-slider")){var t=$(".productsList__priceSlider__minPrice-js").val(),e=$(".productsList__priceSlider__maxPrice-js").val(),i=$(".productsList__priceSlider__minPrice-js").attr("min"),r=$(".productsList__priceSlider__maxPrice-js").attr("max");$(".productsList__priceSlider-js").slider({range:!0,min:parseInt(i,10),max:parseInt(r,10),values:[t,e],change:function(t){$(window).width()>768&&$(".getSearchFilters-js").click()},slide:function(t,e){$(".productsList__priceSlider__minPrice-js").val(e.values[0]),$(".productsList__priceSlider__maxPrice-js").val(e.values[1]),$(".productsList__priceSlider__from-js").text(e.values[0]),$(".productsList__priceSlider__to-js").text(e.values[1])}})}},changeListView:function(t){var e=void 0!==t?t:"grid"===localStorage.getItem("productListType")?"grid":"list",i=$(".product-list__grid-js");"grid"===e?(localStorage.setItem("productListType","grid"),i.addClass("product-list__gridView-js").removeClass("product-list__listView-js"),$("#gridType").css("display","none"),$("#listType").css("display","inherit")):"list"===e&&(localStorage.setItem("productListType","list"),i.removeClass("product-list__gridView-js").addClass("product-list__listView-js"),$("#gridType").css("display","inherit"),$("#listType").css("display","none"))},putSecondImage:function(t){"yes"==$(".secondImageOnList-js").attr("value")&&setTimeout(function(){if(window.mouseOver&&1==t.find("img").length){let e=t.find(".secondImageOnList-js").attr("data-secondImgId"),i=t.find(".secondImageOnList-js").attr("data-secondImgLink"),r=t.find(".secondImageOnList-js").attr("data-secondImgExternal");(e||i||r)&&(0!=e?t.find(".product-item__image").append('<img alt="product_image" src="img/medium/'+e+"/"+i+'" data-src="img/medium/'+e+"/"+i+'"/>'):null!=r&&t.find(".product-item__image").append('<img alt="product_image" src="'+r+'"/>'),t.addClass("hover"))}},250)},showAndHideMoreCategoryDescription:function(){let t=$(".categoryDescription-js").first();t.length>0&&(t.prop("scrollHeight")<=t.prop("clientHeight")?$(".js-showCategoryDescription").css("display","none"):$(".js-showCategoryDescription").first().css("display","block"))},checkImagesInProductsListMosaic:function(){const t=document.querySelectorAll(".productsList__category-check-img-js");for(const e of t)e.width===e.height&&e.nextElementSibling.classList.add("productsList__category--icon-mosaic"),e.remove()},showInfoTooltip:function(t,e){let i=t.clientX,r=t.clientY,a="";switch($(".product-list-infoPopup").css("left",i-120+"px"),$(".product-list-infoPopup").css("top",r+30+"px"),e){case"wishlist":a=$(".product-list-infoPopup").data("wishlist"),$(".product-list-infoPopup").html(a);break;case"askforprice":a=$(".product-list-infoPopup").data("askforprice"),$(".product-list-infoPopup").html(a);break;case"buynow":a=$(".product-list-infoPopup").data("buynow"),$(".product-list-infoPopup").html(a);break;case"notify":a=$(".product-list-infoPopup").data("notify"),$(".product-list-infoPopup").html(a)}},showWishListItems:function(){var t=[];$(".product-item-pl > .currentProductId").each(function(e){t[e]=parseInt($(this).attr("value")),t[e]||(t[e]=-1)}),"true"===__customerAuthenticated&&t.length>0&&$.get(null,{__action:"Product/WishListCheck",products:JSON.stringify(t)},function(e){let i=e.action.Object;if(null!=i)for(let e=0;e<t.length;e++){let r=!1;for(wishListItem of i)wishListItem.Id==t[e]&&($(".product-item-pl").eq(e).find(".product-item__heartIcon__notWish").addClass("hidden"),$(".product-item-pl").eq(e).find(".product-item__heartIcon__wish").removeClass("hidden"),$(".product-item-pl").eq(e).find(".wishlistButton").removeClass("productWishListAdd-js").addClass("productWishListRemove-js"),$(".product-item-pl").eq(e).find('.wishlistButton > input[name="__action"]').val("Product/WishListDelete"),r=!0);0==r&&($(".product-item-pl").eq(e).find(".product-item__heartIcon__notWish").removeClass("hidden"),$(".product-item-pl").eq(e).find(".product-item__heartIcon__wish").addClass("hidden"),$(".product-item-pl").eq(e).find(".wishlistButton").addClass("productWishListAdd-js").removeClass("productWishListRemove-js"),$(".product-item-pl").eq(e).find('.wishlistButton > input[name="__action"]').val("Product/WishListAdd"))}})},showAttributesOnHover:function(t){let e=t;if("true"!==e.data("clip")&&!0!==e.data("clip")||!0===e.data("set-attrs")){if(("true"===e.data("poly")||!0===e.data("poly"))&&!0!==e.data("set-attrs")&&"Variants_Colors"==__graphicalVariantsPresentation){let t=e.data("url");e.data("set-attrs",!0);var i=__grapicalVariantsPresentationColorsData.split("|||");let r,a=e.find('input[name="currentProductId"]').val();$(".product-item__new").each(function(t){$(".product-item__new").eq(t).children('input[name="currentProductId"]').val()==a&&(r=t)}),$.get("",{__collection:"products.Products["+r+"]"},function(r){if(r.collection){let n=r.collection.AttributesList?r.collection.AttributesList.AttributesPolyvalent:null,s=r.collection.AttributesList?r.collection.AttributesList.Attributes:null,p=0,l=!1,d=!1;var a=!1;if(n)for(attr in n)if(0==a)for(value in n[attr].Values)for(colorValue in i)i[colorValue].split("||")[0].toLowerCase()==n[attr].Values[value].Value.toString().toLowerCase()&&(a=!0,l=!0,p=attr);if(0==a&&s)for(attr in s)if(0==a)for(value in s[attr].Values)for(colorValue in i)i[colorValue].split("||")[0].toLowerCase()==s[attr].Values[value].Value.toString().toLowerCase()&&(a=!0,d=!0,p=attr);
65if(a&&(l||d)){let i=e.find(".product-item__phantom");i.addClass("product-item__phantom-withColors");let r=i.find(".product-item__phantom-first");if(l)var o=n[p].Values;else d&&(o=s[p].Values);let a=0;for(attr in o){let e=[],i=__grapicalVariantsPresentationColorsData.split("|||");for(color in i)e.push(i[color]);let n="",s="";for(colorValue in e){let t=e[colorValue].split("||")[0].toLowerCase(),i=e[colorValue].split("||")[1];t===o[attr].Value.toString().toLowerCase()&&(n=i)}""==n&&(n="#FFFFFF"),"#FFFFFF"===n&&n===__primaryPageBg||(s=n);let p=t.split("?")[0]+"?attrs="+o[attr].ValueId;a<10&&r.append('<div class="product-item__phantom-colorWrapper" data-image-id="'+attr+'" data-alt="'+o[attr].Value+'" data-image="false"><a title="'+o[attr].Value+'" href="'+p+'"><div class="product-item__phantom-color" style="background: '+n+"; border-color: "+s+';"></div></a></div>'),a+=1}r.find(".product-item__phantom-colorWrapper").eq(0).data("parent","1"),r.find(".product-item__phantom-colorWrapper").eq(0).addClass("product-item__phantom-active")}else $(".product-item__phantom").remove()}else $(e).find(".product-item__phantom").remove()})}}else{let t=e.data("url");e.data("set-attrs",!0),$.get(t,{__collection:"product-details.Product.Supplies.Supplies|product-details.Product.Id|product-details.Product.ImageId|product-details.Product.Image.Link|product-details.Product.Image.ExternalUrl"},function(t){let i=t.collection["product-details.Product.Supplies.Supplies"],r=t.collection["product-details.Product.Id"],a={},o=[],n=0;for(index in i){var s=i[index].ValueId,p=i[index].Object,l=i[index].Supplies;if(n+=1,l&&l.length>0)for(sizeIndex in l){var d=l[sizeIndex],c=!1;a[s]||(c=!0,a[s]={},a[s].Sizes=[],a[s].ImageId=d.Product?d.Product.ImageId:t.collection["product-details.Product.ImageId"],a[s].Link=d.Product?d.Product.Link:t.collection["product-details.Product.Image.Link"],a[s].Key=d.Key?d.Key:d.ValueId,a[s].Parent=!1,d.Product&&d.Product.Image&&d.Product.Image.ExternalUrl?a[s].ExternalUrl=d.Product.Image.ExternalUrl:a[s].ExternalUrl=null),d.Product&&d.Product.Id==r?(a[s].Parent=!0,a[s].Sizes.push({Value:d.Value,Key:d.Key?d.Key:d.ValueId,Parent:!0})):a[s].Sizes.push({Value:d.Value,Key:d.Key?d.Key:d.ValueId,Parent:!1}),c&&o.push(a[s])}else c=!1,a[s]||(c=!0,a[s]={},a[s].Key=s,a[s].Value="",a[s].Parent=!1,a[s].Sizes=[],a[s].ImageId=i[index].Product?i[index].Product.ImageId:t.collection["product-details.Product.ImageId"],a[s].Link=i[index].Product&&i[index].Product.Image?i[index].Product.Image.Link:t.collection["product-details.Product.Image.Link"],a[s].ExternalUrl=i[index].Product&&i[index].Product.Image?i[index].Product.Image.ExternalUrl:t.collection["product-details.Product.Image.ExternalUrl"],a[s].Sizes.push({Value:a[s].Value,Key:a[s].Key,Parent:!1})),i[index].Product&&i[index].Product.Id==r&&(a[s].Parent=!0),c&&o.push(a[s]);a[s].Name=p,a[s].ExternalUrl||a[s].Link||(a[s].Link=t.collection["product-details.Product.Image.Link"])}let u=this.url.split("?")[0];for(index in o)if(o.length>1){let t="";if(o[index].Sizes)for(sizeIndex in o[index].Sizes)t=u+"?attrs="+o[index].Sizes[sizeIndex].Key,o[index].Sizes[sizeIndex].ProductUrl=t;else t=u+"?attrs="+o[index].Key,o[index].ProductUrl=t}else{let t="";if(o[index].Sizes)for(sizeIndex in o[index].Sizes)t=u+"?attrs="+o[index].Key+","+o[index].Sizes[sizeIndex].Key,o[index].Sizes[sizeIndex].ProductUrl=t;else t=u+"?attrs="+o[index].Key,o[index].ProductUrl=t}if("Variants_Colors"===__graphicalVariantsPresentation){let t=e.find(".product-item__phantom");t.addClass("product-item__phantom-withColors");let i=t.find(".product-item__phantom-first"),r=!1;for(supply in o){let t="",e=!0;o[supply].ExternalUrl?t=o[supply].ExternalUrl:o[supply].ImageId&&o[supply].Link?t="img/medium/"+o[supply].ImageId+"/"+o[supply].Link:(e=!1,t="");let a=[],n=__grapicalVariantsPresentationColorsData.split("|||");for(color in n)a.push(n[color]);let s="",p="";for(colorValue in a){let t=a[colorValue].split("||")[0].toLowerCase(),e=a[colorValue].split("||")[1];t===o[supply].Name.toString().toLowerCase()&&(s=e)}""==s&&(s="#FFFFFF"),"#FFFFFF"===s&&s===__primaryPageBg||(p=s);let l=u+"?attrs="+o[supply].Key;e?i.append('<div class="product-item__phantom-colorWrapper" data-image-id="'+supply+'" data-alt
65="'+o[supply].Name+'" data-image="'+t+'"><a title="'+o[supply].Name+'" href="'+l+'"><div class="product-item__phantom-color" style="background: '+s+"; border-color: "+p+';"></div></a></div>'):i.append('<div class="product-item__phantom-colorWrapper" data-image-id="'+supply+'" data-alt="'+o[supply].Name+'" data-image="false"><a title="'+o[supply].Name+'" href="'+l+'"><div class="product-item__phantom-color" style="background: '+s+"; border-color: "+p+';"></div></a></div>'),1==o[supply].Parent&&(r=!0,i.find(".product-item__phantom-colorWrapper").eq(supply).data("parent","1"),i.find(".product-item__phantom-colorWrapper").eq(supply).addClass("product-item__phantom-active"))}0==r&&(i.find(".product-item__phantom-colorWrapper").eq(0).data("parent","1"),i.find(".product-item__phantom-colorWrapper").eq(0).addClass("product-item__phantom-active"))}else if("Variants_Thumbnails"===__graphicalVariantsPresentation){let i=e.find(".product-item__phantom"),r=i.find(".product-item__phantom-first"),a=i.find(".product-item__phantom-second"),n=0,s=!1;for(supply in o){let e="",i=!0;o[supply].ExternalUrl?e=o[supply].ExternalUrl:o[supply].ImageId&&o[supply].Link?e="img/medium/"+o[supply].ImageId+"/"+o[supply].Link:t.collection["product-details.Product.ImageId"]&&t.collection["product-details.Product.Image.Link"]?e="img/medium/"+t.collection["product-details.Product.ImageId"]+"/"+t.collection["product-details.Product.Image.Link"]:t.collection["product-details.Product.Image.ExternalUrl"]?e=t.collection["product-details.Product.Image.ExternalUrl"]:(i=!1,e="");let p=u+"?attrs="+o[supply].Key;if(supply<4&&5!=o.length||5==o.length){i?(r.append('<div class="product-item__phantom-image" data-image-id="'+supply+'" data-alt="'+o[supply].Name+'" data-image="'+e+'"></div>'),r.find(".product-item__phantom-image").eq(supply).append('<a title="'+o[supply].Name+'" href="'+p+'"><img class="product-item__phantom-img" alt="'+o[supply].Name+'" src="'+e+'"/></a>')):(r.append('<div class="product-item__phantom-image" data-image-id="'+supply+'" data-alt="'+o[supply].Name+'" data-image="false"></div>'),r.find(".product-item__phantom-image").eq(supply).append('<a title="'+o[supply].Name+'" href="'+p+'"><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#image-light"></use></svg></a>')),a.append('<div class="product-item__phantom-attributes hidden"></div>');let t=a.find(".product-item__phantom-attributes").eq(supply);for(innerSupply in o[supply].Sizes)o[supply].Sizes[innerSupply].Value&&t.append('<div class="product-item__phantom-secondAttribute"><a href="'+o[supply].Sizes[innerSupply].ProductUrl+'">'+o[supply].Sizes[innerSupply].Value+"</a></div>")}else o.length>5&&supply>=4&&(n+=1,supply==o.length-1&&(r.append('<div class="product-item__phantom-image product-item__phantom-image-last" data-image-id="-1"></div>'),r.find(".product-item__phantom-image").eq(4).append('<div class="product-item__phantom-more">+'+n+"</div>")));1==o[supply].Parent&&(s=!0,r.find(".product-item__phantom-image").eq(supply).data("parent","1"),r.find(".product-item__phantom-image").eq(supply).addClass("product-item__phantom-active"),a.find(".product-item__phantom-attributes").eq(supply).removeClass("hidden"))}0==s&&(r.find(".product-item__phantom-image").eq(0).data("parent","1"),r.find(".product-item__phantom-image").eq(0).addClass("product-item__phantom-active"),a.find(".product-item__phantom-attributes").eq(0).removeClass("hidden"))}})}},setActiveVariant:function(t){let e=$(t.currentTarget).find(".product-item__phantom-image");e.removeClass("product-item__phantom-active");for(let t=0;t<e.length;t++)if(1===e.eq(t).data("parent")||"1"===e.eq(t).data("parent")){e.eq(t).addClass("product-item__phantom-active");let i=e.eq(t).data("image-id"),r=e.eq(t).parent().parent().find(".product-item__phantom-second");r.find(".product-item__phantom-attributes").addClass("hidden"),r.find(".product-item__phantom-attributes").eq(i).removeClass("hidden");break}},openAskForPriceInTile:function(t){if(!(askForPriceInProgress||t.detail&&1!=t.detail)){t.preventDefault(),askForPriceInProgress=!0,$(".ask-for-price-popup").remove();
65var e=$(t.currentTarget).parents(".product-item-pl").find('input[name="productId"]').val(),i=$(t.currentTarget).parents(".product-item-pl").children(".product-url").attr("href");i||(i=$(t.currentTarget).closest(".product-url").attr("href")),$.get(i,{__template:"partials/common/ask-for-price-popup.html"},function(i){$(".product-list-js").append(i.template);var r=".ask-for-price-popup";$(r).find('input[name="productId"]').val(e),$(r).removeClass("hidden"),productDetailsFunctions.checkWishList(e),$(r).show(),ui.formLabelAnimationOnLoadPage(),app.activateFocusTrap(r,t.currentTarget),setTimeout(function(){askForPriceInProgress=!1},500)})}},events:function(){$(window).on("load",function(){productListFunctions.showAndHideMoreCategoryDescription()});let t=!1;$(window).on("resize",function(){productListFunctions.showAndHideMoreCategoryDescription(),!t&&$(window).width()<=768&&(t=!0,showAllPhantomVariants())}),$("body").on("click",".product-list__filters .filter",function(t){if(ajax_lock||1==$(this).find("*").prop("disabled"))return t.preventDefault(),void t.stopPropagation();$(".filter, .productsList__priceSlider-js > *").addClass("disabled"),t.preventDefault(),t.stopPropagation(),1==$(this).find("input").prop("checked")?$(this).find("input").prop("checked",!1):$(this).find("input").prop("checked",!0),ajax_lock=!0,$(window).width()>768?($("#products").find(".product-item-pl").remove(),$.when(productListFunctions.getSearchFilters()).done(function(){$.when(productListFunctions.resetProductList()).done(function(){$(".filter, .productsList__priceSlider-js > *").removeClass("disabled")}),setTimeout(function(){ajax_lock=!1},1e3)})):($(".filter, .productsList__priceSlider-js > *").removeClass("disabled"),ajax_lock=!1)}),$("body").on("click",".productsList__filters--setValues",function(t){if(ajax_lock||1==$(this).find("*").prop("disabled"))return t.preventDefault(),void t.stopPropagation();$(".filter, .productsList__priceSlider-js > *").addClass("disabled"),t.preventDefault(),t.stopPropagation(),1==$(this).find("input").prop("checked")?$(this).find("input").prop("checked",!1):$(this).find("input").prop("checked",!0),ajax_lock=!0,$("#products").find(".product-item-pl").remove(),$(".product-list__filters-trigger").click(),$(".go-to-top__btn-js").click(),$.when(productListFunctions.getSearchFilters()).done(function(){$.when(productListFunctions.resetProductList()).done(function(){$(".filter, .productsList__priceSlider-js > *").removeClass("disabled")}),setTimeout(function(){ajax_lock=!1},1e3)})}),$("body").on("click",".product-list__filters .getSearchFilters-js",function(t){if(ajax_lock)return t.preventDefault(),void t.stopPropagation();$(".filter, .productsList__priceSlider-js > *").addClass("disabled"),t.preventDefault(),t.stopPropagation(),ajax_lock=!0,$("#products").find(".product-item-pl").remove(),$.when(productListFunctions.getSearchFilters()).done(function(){$.when(productListFunctions.resetProductList()).done(function(){$(".filter, .productsList__priceSlider-js > *").removeClass("disabled")}),setTimeout(function(){ajax_lock=!1},1e3)})}),$(".changeCategory-js").on("click",function(t){history.pushState("","",$(this).attr("data-url"));let e="elements/products-list/products-2.html|partials/common/breadcrumbs.html";$("#banner-in-list").index()>=0&&(e=e.concat("|"+$("#banner-in-list").attr("data-include"))),$.get("",{__collection:"{products}",__template:e},function(t){$(".product-list-js").replaceWith(t.template[0]),$("body").off("click",".product-list__filters .filter"),productListFunctions.init(),$(".breadcrumbs-wrapper").replaceWith(t.template[1]),$("#banner-in-list").index()>=0&&($("#banner-in-list").html(t.template[2]),bannerInListFunctions.setBannerPosition())})}),window.onpopstate=function(t){location.reload()},$(".display-details__sorting").off("click").on("click",function(t){var e=$(t.currentTarget).children(".dropdown-menu"),i=$(t.currentTarget).find(".svgIcon--arrowDown");e&&(e.stop().slideToggle(200),i.toggleClass("svgIcon--rotate"))}),$(".product-list__filters-trigger").on("click",function(t){var e=$(".product-list__filters-trigger span:first-child"),i=$(t.currentTarget).find(".svgIcon--arrowDown");$(".product-list__filters").stop().slideToggle(200,function(){app.getFirstFocusableInContainer(".product-list__filters")}
65),i.toggleClass("svgIcon--rotate"),$(".display-details__sorting").find(".svgIcon--arrowDown").removeClass("svgIcon--rotate"),e.text()===__translations.ShowFilters?e.text(__translations.HideFilters):e.text(__translations.ShowFilters)}),$(".display-details__sorting .dropdown-menu__links li").on("click",function(t){var e=$(this),i=productListFunctions.parseQuery(location.search);i.pageId&&delete i.pageId,$.get("",{__collection:"products.SortingQueryGET"},function(t){i[t.collection]=e.data("value"),location.href=location.pathname+"?"+$.param(i)})}),$(".product-list__filters .filter-group-wrapper .filter-toggle").on("click",function(t){var e=$(t.target.parentNode).children(".redundant"),i=t.target.classList.contains("filter-more")?".filter-less":".filter-more";$(t.target).toggle();var r=$(t.target.parentNode).children(i);r.toggle(),e.stop().slideToggle("slow"),r.is(":visible")&&r.focus()}),$(".product-list").on("click","#reset-filters svg",function(){"true"==$("#showBrandOnly").val()?location.href=$("#showBrandOnly").attr("data-categories"):productListFunctions.resetFilters()}),$(".product-list").on("click",".removeBrandOnlyFilter-js",function(){location.href=$("#showBrandOnly").attr("data-categories")}),$(".product-list").on("click",".removeFilter-js svg",function(t){let e=$(t.currentTarget).parent(),i=e.data("filter-id");if("true"==$("#showBrandOnly").val()){let t=$("#showBrandOnly").attr("data-currentbrand");e.text().includes(t)?location.href=$("#showBrandOnly").attr("data-categories"):productListFunctions.removeFilter(e,i)}else productListFunctions.removeFilter(e,i)}),$(".product-list").on("click",".changeListView-js",function(t){productListFunctions.changeListView(t.currentTarget.dataset.type)}),$("body").on("mouseenter",".product-item-pl",function(){if($(window).width()>768){var t=$(this);window.mouseOver=!0,productListFunctions.putSecondImage(t),"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL&&productListFunctions.showAttributesOnHover(t)}}),$("body").on("pointerenter",".product-item-pl",function(){if($(window).width()<769){var t=$(this);window.mouseOver=!0,productListFunctions.putSecondImage(t),"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL&&productListFunctions.showAttributesOnHover(t)}}),$(".productsList").on("focusin",".product-item-pl",function(){var t=$(this);$(window).width()>768&&(window.mouseOver=!0,productListFunctions.putSecondImage(t),"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL&&productListFunctions.showAttributesOnHover(t))}),$(".productsList").on("focusout",".product-item-pl",function(t){window.mouseOver=!1,"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL&&productListFunctions.setActiveVariant(t)}),$("body").on("mouseleave",".product-item-pl",function(t){window.mouseOver=!1,$(window).width()<769&&"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL&&productListFunctions.setActiveVariant(t)}),$(document).on("click",function(t){0===$(t.target).closest(".display-details__sorting").length&&0===$(t.target).closest($(".display-details__sorting").children()).length&&0===$(t.target).closest(".dropdown-menu").length&&0===$(t.target).closest($(".dropdown-menu").children()).length&&"none"!=$(".dropdown-menu").css("display")&&$(".dropdown-menu").slideToggle(200)}),$(".product-list").on("mouseenter",".product-item-pl .product-item__description > h2",function(t){let e,i=$(t.currentTarget).text(),r=$(".productListNameTooltip-js");r.children("span").text(i);let a="unset",o=t.clientX-30-t.offsetX/2;e=t.clientY-t.offsetY+80,o<0?o=10:o>$(window).width()-200&&(o="unset",a=10),r.css("top",e),r.css("right",a),r.css("left",o),r.show()}),$(".product-list").on("mouseleave",".product-item-pl .product-item__description > h2",function(t){let e=$(".productListNameTooltip-js");e.hide(),e.children("span").text("")}),$(".product-list").on("pointerenter",".product-item-pl .product-item__description > h2",function(t){let e,i=$(t.currentTarget).text(),r=$(".productListNameTooltip-js");r.children("span").text(i);let a="unset",o=t.clientX-30-t.offsetX/2;e=$(".product-list__listView-js").index()<0?t.clientY-t.offsetY+50:t.clientY-t.offsetY+80,o<0?o=10:o>$(window).width()-200&&(o="unset",a=10),r.css("top",e),r.css("right",a),r.css("left",o),r.show()}),$(".product-list").on("pointerleave",".product-item-pl .product-item__description > h2",function(t){let e=$(".productListNameTooltip-js");e.hide(),e.children("span").text("")}),$("body").on("click",".js-showCategoryDescription",function(t){$(this).hasClass("js-showCategoryDescription-less")&&$("html, body").animate({scrollTop:$(this).parent().offset().top-130},500),$(".productList__category__description").toggleClass("productList__category__description-hide"),$(".js-showCategoryDescription").toggleClass("hidden")})},itemClickableEvents:function(t=!0){if($(".product-item-pl").on("click",".productC
65omparisonToolAdd-js",function(t){if(!t.detail||1==t.detail){if(t.preventDefault(),$(this).hasClass("comparisonDisable-js"))return;$(".productComparisonToolAdd-js").addClass("comparisonDisable-js");let e=parseInt(t.currentTarget.dataset.id);$.get("",{__collection:"customer.ComparisonToolItems",__template:"partials/products-list/add-to-compare-popup.html"},function(i){$(".addToComparePopup").remove();let r=i.collection;r&&r.includes(e)?($(".addToComparePopup").remove(),app.productComparisonToolDeleteFromList(t,e),$(".productComparisonToolAdd-js").removeClass("comparisonDisable-js")):null!=r&&r.length>=__maxComparisonItems?($(".addToComparePopup").remove(),$(".product-list").append(i.template),$(".productComparisonToolAdd-js").removeClass("comparisonDisable-js")):(null==r||r.length<__maxComparisonItems)&&($(".addToComparePopup").remove(),$(".product-list").append(i.template),app.productComparisonToolAdd(t),$(".productComparisonToolAdd-js").removeClass("comparisonDisable-js"))})}}),$(".product-list").on("click",".closeComparePopup",function(t){$(".addToComparePopup").remove(),$(".productComparisonToolAdd-js").removeClass("comparisonDisable-js")}),$(".product-item-pl").on("click",".productWishListAdd-js",function(t){t.detail&&1!=t.detail||(t.preventDefault(),t.stopPropagation(),app.productWishListAdd(t),setTimeout(function(){productListFunctions.showWishListItems()},500))}),$(".product-item-pl").on("click",".productWishListRemove-js",function(t){t.detail&&1!=t.detail||(t.preventDefault(),t.stopPropagation(),app.productWishListRemove(t),setTimeout(function(){productListFunctions.showWishListItems()},500))}),$("body").on("mouseover",".productWishListShowPopup-js",function(t){$(window).width()>768&&($(".product-list-infoPopup").show(),$(document).on("mousemove",productListFunctions.showInfoTooltip(t,"wishlist")))}),$("body").on("click",".productWishListShowPopup-js",function(t){t.preventDefault(),t.stopPropagation(),$(window).width()<=768&&app.showTemporaryPopup(__translations.PrList_LogInToWishList,"info","",2e3)}),$("body").on("mouseleave",".productWishListShowPopup-js",function(t){$(".product-list-infoPopup").hide(),$(document).off("mousemove",productListFunctions.showInfoTooltip(t,"wishlist"))}),$("body").on("mouseover",".product-item__addToCart-list.js-askForPrice",function(t){$(window).width()>768&&($(".product-list-infoPopup").show(),$(document).on("mousemove",productListFunctions.showInfoTooltip(t,"askforprice")))}),$("body").on("mouseleave",".product-item__addToCart-list.js-askForPrice",function(t){$(".product-list-infoPopup").hide(),$(document).off("mousemove",productListFunctions.showInfoTooltip(t,"askforprice"))}),$("body").on("mouseover",".product-item__addToCart-list.js-notifyAboutAvailability",function(t){$(window).width()>768&&($(".product-list-infoPopup").show(),$(document).on("mousemove",productListFunctions.showInfoTooltip(t,"notify")))}),$("body").on("mouseleave",".product-item__addToCart-list.js-notifyAboutAvailability",function(t){$(".product-list-infoPopup").hide(),$(document).off("mousemove",productListFunctions.showInfoTooltip(t,"notify"))}),$("body").on("mouseover",".product-item__addToCart-list:not(.js-askForPrice):not(.js-notifyAboutAvailability)",function(t){$(window).width()>768&&($(".product-list-infoPopup").show(),$(document).on("mousemove",productListFunctions.showInfoTooltip(t,"buynow")))}),$("body").on("mouseleave",".product-item__addToCart-list:not(.js-askForPrice):not(.js-notifyAboutAvailability)",function(t){$(".product-list-infoPopup").hide(),$(document).off("mousemove",productListFunctions.showInfoTooltip(t,"buynow"))}),t)var e=!1;let i=!1;$(".product-item-pl").on("click",".js-addToCart",function(t){if(t.preventDefault(),1!=app.isPlacingOrdersLockDueToTime()){if(!i&&(i=!0,setTimeout(function(){i=!1},500),!t.detail||1==t.detail)){0==e&&(productDetailsFunctions.events(),e=!0);var r=$(this),a=$(this).find('input[name="productId"]').val(),o=$(t.currentTarget).parents(".product-item-pl").children(".product-url").attr("href");if(o||(o=$(t.currentTarget).closest(".product-url").attr("href")),$(".popup-dialog:not(.image-rotate-popup)").remove(),"PDnewVariant"==__productDetailsVariant)var n=!0;else n=!1;r.hasClass("js-notifyAboutAvailability")?($(".notify-about-availability-popup").remove(),$.get(o,{__template:"partials/common/notify-about-availability-popup.html"},function(e){$(".product-list-js").append(e.template);var i=$(r).find("span").data("popup-class");$(i).find('input[name="productId"]').val(a),$(i).removeClass("hidden"),productDetailsFunctions.checkWishList(a),$(i).show(),ui.formLabelAnimationOnLoadPage(),app.activateFocusTrap(i,t.target.closest(".product-item"))})):r.hasClass("js-askForPrice")?($(".ask-for-price-popup").remove(),$.get(o,{__template:"partials/common/ask-for-price-popup.html"},function(e){$(".product-list-js").append(e.template);var i=$(r).find("span").data("popup-class");$(i).find('input[name="productId"]').val(a),$(i).removeClass("hidden"),productDetailsFunctions.checkWishList(a),$(i).show(),ui.formLabelAnimationOnLoadPage(),app.activateFocusTrap(i,t.target.closest(".product-item"))})):r.hasClass("js-addToCart-Immediately")?0==lockAddToCart&&(lockAddToCart=!0,$(".after-adding-to-cart-popup").remove(),$.get(o,{__template:"partials/common/after-adding-to-cart-popup.html"},function(e){$(".product-list-js").append(e.template),addToCart(t)})):$.get(o,{__collection:"product-details.Product",__template:"partials/products-list/add-to-cart-popup.html"},function(e){if($(".product-list-js").append(e.template),$("body").addClass("noscroll"),1==n?$(".product-item__cartPopup--oldView").remove():$(".product-item__cartPopup--newView").remove(),addClipAndBatchToCartInPopup(!0),changeAttributesDivToSelectInPopup(),changeAttributesPolyToSelectInPopup(),initProductDetailsInPopup(!0),t&&t.target){const e=t.target.closest(".product-item");e&&app.activateFocusTrap(".product-item__cartPopup--container",e)}null!=e.collection.Image&&null!=e.collection.Image.Id&&-1!=e.collection.Image.Id&&e.collection.Image.Link?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="img/medium/'+e.collection.Image.Id+"/"+e.collection.Image.Link+'.jpg">'):null!=e.collection.Image&&null!=e.collection.Image.ExternalUrl&&""!=e.collection.Image.ExternalUrl?$(".product-details__detailsWrapper--productImage").append('<img alt="product_image" src="'+e.collection.Image.ExternalUrl+'">'):$(".product-details__detailsWrapper--productImage").append('<i><svg class="svgIcon"><use xlink:href="css/img/icons-sprite.svg#image-light"></use></svg></i>')}),$.get("",{__collection:"page"},function(t){2===t.collection.PageId&&$(".popupWithPhantom").length>0&&$(".popupWithPhantom").removeClass("hidden-js")})}}else app.getOrdersUnablePopup()}),$("body").on("click",".closeCartPopup-js",function(){$(".product-list__cartPopup").remove(),$(".after-adding-to-cart-popup").remove(),$("body").removeClass("noscroll")}),$("body").on("click",".product-item__cartPopup .open-popup-notify-about-availability, .product-item__cartPopup .open-popup-ask-for-price",function(t){$(".product-item__cartPopup").hide(),preventScrolling()}),$("body").on("click",".js-showRate",function(t){t.preventDefault(),window.open($(this).attr("data-href"),"_self")}),$(".product-item-pl").on("click",".attributes-select",function(t){t.stopPropagation()}),$(".product-item-pl").on("click",".attributes-select > span",function(t){t.stopPropagation()}),$(".product-item-pl").on("click",".attributes-select > svg",function(t){t.stopPropagation()}),$("body").on("keydown",".quantity-field",function(t){app.validateNumberInput(t)}),$("body").on("mouseover",".product-item__phantom-image",function(t){if("Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL){let e=$(t.currentTarget).data("image-id");$(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().find(".product-item__phantom-image").removeClass("product-item__phantom-active");let i=$(t.currentTarget).parent().parent().find(".product-item__phantom-second");if(-1!==e){i.find(".product-item__phantom-attributes").addClass("hidden"),i.find(".product-item__phantom-attributes").eq(e).removeClass("hidden");let r=$(t.currentTarget).data("image");if(!1!==r&&"false"!==r){let e=$(t.currentTarget).data("alt");$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").addClass("hidden"),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image").prepend('<img class="tmpImage" alt="'+e+'" src="'+r+'"/>')}}else $(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").removeClass("hidden"),i.find(".product-item__phantom-attributes").addClass("hidden")}}),$("body").on("pointerenter",".product-item__phantom-image",function(t){if($(window).width()<769&&"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL){let e=$(t.currentTarget).data("image-id");$(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().find(".product-item__phantom-image").removeClass("product-item__phantom-active");let i=$(t.currentTarget).parent().parent().find(".product-item__phantom-second");if(-1!==e){i.find(".product-item__phantom-attributes").addClass("hidden"),i.find(".product-item__phantom-attributes").eq(e).removeClass("hidden");let r=$(t.currentTarget).data("image");if(!1!==r&&"false"!==r){let e=$(t.currentTarget).data("alt");$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").addClass("hidden"),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image").prepend('<img class="tmpImage" alt="'+e+'" src="'+r+'"/>')}}else $(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").removeClass("hidden"),i.find(".product-item__phantom-attributes").addClass("hidden")}}),$("body").on("mouseover",".product-item__phantom-colorWrapper",function(t){if("Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL){let e=$(t.currentTarget).data("image-id");if($(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().find(".product-item__phantom-colorWrapper").removeClass("product-item__phantom-active"),-1!==e){let e=$(t.currentTarget).data("image");if(!1!==e&&"false"!==e){let i=$(t.currentTarget).data("alt");$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").addClass("hidden"),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image").prepend('<img class="tmpImage" alt="'+i+'" src="'+e+'"/>')}}else $(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").removeClass("hidden")}}),$("body").on("pointerenter",".product-item__phantom-colorWrapper",function(t){if($(window).width()<769&&"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL){let e=$(t.currentTarget).data("image-id");if($(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().find(".product-item__phantom-colorWrapper").removeClass("product-item__phantom-active"),-1!==e){let e=$(t.currentTarget).data("image");if(!1!==e&&"false"!==e){let i=$(t.currentTarget).data("alt");$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").addClass("hidden"),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image").prepend('<img class="tmpImage" alt="'+i+'" src="'+e+'"/>')}}else $(t.currentTarget).parent().parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().parent().find(".product-item__image img").removeClass("hidden")}}),$("body").on("mouseleave",".product-item__phantom-image",function(t){$(t.currentTarget).addClass("product-item__phantom-active")}),$("body").on("pointerleave",".product-item__phantom-image",function(t){$(window).width()<769&&$(t.currentTarget).addClass("product-item__phantom-active")}),$("body").on("mouseleave",".product-item__phantom",function(t){if($(t.currentTarget).find(".product-item__phantom-active").removeClass("product-item__phantom-active"),"Variants_Thumbnails"===__graphicalVariantsPresentation){let e=$(t.currentTarget).find(".product-item__phantom-image"),i=!1;for(let r=0;r<e.length;r++)if(1===e.eq(r).data("parent")||"1"===e.eq(r).data("parent")){i=!0,e.eq(r).addClass("product-item__phantom-active");let a=e.eq(r).data("image-id"),o=e.eq(r).parent().parent().find(".product-item__phantom-second");o.find(".product-item__phantom-attributes").addClass("hidden"),o.find(".product-item__phantom-attributes").eq(a).removeClass("hidden"),$(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden");break}0==i&&($(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden"))}
65else if("Variants_Colors"==__graphicalVariantsPresentation){let e=$(t.currentTarget).find(".product-item__phantom-colorWrapper"),i=!1;for(let r=0;r<e.length;r++)if(1===e.eq(r).data("parent")||"1"===e.eq(r).data("parent")){i=!0,e.eq(r).addClass("product-item__phantom-active"),$(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden");break}0==i&&($(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden"))}}),$("body").on("pointerleave",".product-item__phantom",function(t){if($(window).width()<769)if($(t.currentTarget).find(".product-item__phantom-active").removeClass("product-item__phantom-active"),"Variants_Thumbnails"===__graphicalVariantsPresentation){let e=$(t.currentTarget).find(".product-item__phantom-image"),i=!1;for(let r=0;r<e.length;r++)if(1===e.eq(r).data("parent")||"1"===e.eq(r).data("parent")){i=!0,e.eq(r).addClass("product-item__phantom-active");let a=e.eq(r).data("image-id"),o=e.eq(r).parent().parent().find(".product-item__phantom-second");o.find(".product-item__phantom-attributes").addClass("hidden"),o.find(".product-item__phantom-attributes").eq(a).removeClass("hidden"),$(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden");break}0==i&&($(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden"))}else if("Variants_Colors"==__graphicalVariantsPresentation){let e=$(t.currentTarget).find(".product-item__phantom-colorWrapper"),i=!1;for(let r=0;r<e.length;r++)if(1===e.eq(r).data("parent")||"1"===e.eq(r).data("parent")){i=!0,e.eq(r).addClass("product-item__phantom-active"),$(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden");break}0==i&&($(t.currentTarget).parent().parent().parent().find(".tmpImage").remove(),$(t.currentTarget).parent().parent().parent().find(".product-item__image img").removeClass("hidden"))}}),$("body").on("mouseleave",".product-item__phantom-colorWrapper",function(t){$(t.currentTarget).addClass("product-item__phantom-active")}),$("body").on("pointerleave",".product-item__phantom-colorWrapper",function(t){$(window).width()<769&&$(t.currentTarget).addClass("product-item__phantom-active")}),$("body").on("click",".ask-for-price-tile",function(t){t.detail&&1!=t.detail||productListFunctions.openAskForPriceInTile(t)})}};function initSubcategoriesSlider(){lazy.init(".subcategories-slider-js",t=>new Swiper(t,{slidesPerView:5,slidesPerGroup:1,centerInsufficientSlides:!0,loop:!0,watchSlidesProgress:!0,navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},breakpoints:{1250:{slidesPerView:5,enabled:!0},1e3:{slidesPerView:4,enabled:!0},0:{slidesPerView:3,enabled:!1}}}))} 66 67setTilesInformations=function(t,s){for(let i=0;i<t.collection.Products.length;i++)$.when($(s).append(t.template)).done(function(){var s,e=t.collection.Products[i],a=$("#products .product-item-pl:not(.productitemtoremove)").eq(i);if(a.parent(".product-item__placeholder").removeClass("hidden"),a.find(".product-item__description h2").text(e.NameNoHtml),a.find(".product-url").attr("href",e.Url),a.find(".normalPrice").removeClass("askForPrice"),a.find(".currentProductId").val(e.Id),a.attr("data-clip",!!e.AttributesList&&e.AttributesList.Clip),a.attr("data-poly",e.HasAttributes),a.attr("data-url",e.Url),a.attr("data-set-attrs",!1),null!=e.Images&&e.Images.length>1){let t=a.find(".secondImageOnList-js");t.attr("data-secondImgId",e.Images[1].Id),t.attr("data-secondImgLink",e.Images[1].Link),t.attr("data-secondImgExternal",e.Images[1].ExternalUrl)}"attr"==__additionalInfoOnProductsList?null!=e.AttributesList&&null!=e.AttributesList.Attributes&&e.AttributesList.Attributes.slice(0,4).forEach(function(t){if(!t.N
67ame.toLowerCase().includes("360photo")){var s='<span class="name">'+t.Name+'</span><span class="value">',i=1,e=t.Values.length;t.Values.forEach(function(t){s=s+" "+t.Value,i<e&&(s+=", "),i+=1}),s+="</span>",a.find(".product-item__shortDescription-attributes").append(s)}}):"shortDesc"==__additionalInfoOnProductsList&&a.find(".product-item__shortDescription-descriptionText").text(e.ShortDescription);let r=2;e.IsDigital&&(r=1,a.find(".product-flags").prepend('<span class="digital-product">'+__translations.DigitalProduct+"</span>"));for(let t=0;t<r;t++)e.Flags[t]&&a.find(".product-flags").append('<span class="'+e.Flags[t].Type+'">'+e.Flags[t].Text+"</span>");null!=e.Images&&null!=e.Images[0]&&-1!=e.Images[0].Id&&(e.Images[0].Id&&e.Images[0].Link?(a.find(".product-item__image").removeClass("product-item__noImage").html(""),a.find(".product-item__image").append('<img alt="product_image" src="img/medium/'+e.Images[0].Id+"/"+e.Images[0].Link+'" data-src="img/medium/'+e.Images[0].Id+"/"+e.Images[0].Link+'"/>')):e.Images[0].ExternalUrl&&(a.find(".product-item__image").removeClass("product-item__noImage").html(""),a.find(".product-item__image").append('<img alt="product_image" src="'+e.Images[0].ExternalUrl+'" data-src="'+e.Images[0].ExternalUrl+'"/>'))),s=null!=e.StockLevel&&1==e.StockLevel.QuantityControl&&0==e.StockLevel.Value;var n,o,p,c="",d="",l="";if(null!=e.Price&&(n=(n=Number(e.Price.toFixed(2).replace(",","."))).toPrice()),null!=e.RegularPrice&&(o=(o=Number(e.RegularPrice.toFixed(2).replace(",","."))).toPrice()),null!=e.PreviousPrice&&(p=(p=Number(e.PreviousPrice.toFixed(2).replace(",","."))).toPrice()),null!=e.DepositValue&&e.DepositValue>0&&(d=(d=Number(e.DepositValue.toFixed(2).replace(",","."))).toPrice()),null!=e.MinPrice&&(c=(c=Number(e.MinPrice.toFixed(2).replace(",","."))).toPrice()),null!=e.BasicUnit&&""!=e.BasicUnit&&(l=e.BasicUnit),null==e.Price&&1==e.AskForPrice?(a.find(".product-item__priceAndExtraButton").prepend('<button class="normalPrice"></button>'),a.find(".normalPrice").addClass("askForPrice ask-for-price-tile").text(__translations.Com_AskForPrice),a.find(".js-addToCart").remove()):1==s&&e.AttributesList&&e.AttributesList.Clip&&1==e.AttributesList.Clip?e.PreviousPrice>e.Price?("minimalPriceYes"==__minimalPrice?(a.find(".product-item__priceAndExtraButton").prepend('<span class="productsList3__prices"><span class="redPrice"></span><span class="old-and-min-price"><span class="oldPrice"></span><span class="deposit"></span><span class="min-price prodList3 recentmin"><span></span></span></span>'),a.find(".min-price.prodList3 span").text(__translations.Price_Omnibus+" "+c+" "+__curr)):a.find(".product-item__priceAndExtraButton").prepend('<span class="productsList3__prices"><span class="redPrice"></span><span class="oldPrice"></span><span class="deposit"></span></span>'),a.find(".oldPrice").text(p+" "+__curr),a.find(".redPrice").text(n+" "+__curr),null!=e.DepositValue&&e.DepositValue>0&&a.find(".deposit").text("+"+__translations.Deposit+": "+d+" "+__curr+(l?"/"+l:"")),a.find(".normalPrice").remove()):e.RegularPrice>e.Price&&__isEnterprise&&"minimalPriceNo"==__minimalPrice?(a.find(".product-item__priceAndExtraButton").prepend('<span class="productsList3__prices"><span class="redPrice"></span><span class="oldPrice"></span><span class="deposit"></span></span>'),a.find(".redPrice").text(n+" "+__curr),a.find(".oldPrice").text(o+" "+__curr),null!=e.DepositValue&&e.DepositValue>0&&a.find(".deposit").text("+"+__translations.Deposit+": "+d+" "+__curr+(l?"/"+l:"")),a.find(".normalPrice").remove()):(a.find(".product-item__priceAndExtraButton").prepend('<span class="normalPrice"></span>'),a.find(".normalPrice").text(n+" "+__curr),null!=e.DepositValue&&e.DepositValue>0&&a.find(".normalPrice").append('<span class="deposit">+ '+__translations.Deposit+": "+d+" "+__curr+(l?"/"+l:"")+"</span>")):(0==__hidePrices||"false"==__hidePrices)&&e.Price>=0?e.PreviousPrice>e.Price?("minimalPriceYes"==__minimalPrice?(a.find(".product-item__priceAndExtraButton").prepend('<span class="productsList3__prices"><span class="redPrice"></span><span class="old-and-min-price"><span class="oldPrice"></span><span class="deposit"></span><span class="min-price prodList3 recentmin"><span></span></span></span></span>'),a.find(".min-price.prodList3 span").text(__translations.Price_Omnibus+" "+c+" "+__curr)):a.find(".product-item__priceAndExtraButton").prepend('<span class="productsList3__prices"><span class="redPrice"></span><span class="oldPrice"></span><span class="deposit"></span></span>'),a.find(".oldPrice").text(p+" "+__curr),a.find(".redPrice").text(n+" "+__curr),null!=e.DepositValue&&e.DepositValue>0&&a.find(".deposit").text("+ "+__translations.Deposit+": "+d+" "+__curr+(l?"/"+l:"")),a.find(".normalPrice").remove()):e.RegularPrice>e.Price&&__isEnterprise&&"minimalPriceNo"==__minimalPrice?(a.find(".product-item__priceAndExtraButton").prepend('<span class="productsList3__prices"><span class="redPrice"></span><span class="oldPrice"></span><span class="deposit"></span></span>'),a.find(".redPrice").text(n+" "+__curr),a.find(".oldPrice").text(o+" "+__curr),null!=e.DepositValue&&e.DepositValue>0&&a.find(".deposit").text("+ "+__translations.Deposit+": "+d+" "+__curr+(l?"/"+l:"")),a.find(".normalPrice").remove()):(a.find(".product-item__priceAndExtraButton").prepend('<span class="normalPrice"></span>'),a.find(".normalPrice").text(n+" "+__curr),null!=e.DepositValue&&e.DepositValue>0&&a.find(".normalPrice").append('<span class="deposit">+ '+__translations.Deposit+": "+d+" "+__curr+(l?"/"+l:"")+"</span>")):1==__hidePrices||"true"==__hidePrices?(a.find(".product-item__priceAndExtraButton").prepend('<span class="normalPrice"></span>'),a.find(".normalPrice").addClass(".loginToSeePrice").text(__translations.Com_LogInToSeePrice)):(a.find(".product-item__priceAndExtraButton").prepend('<span class="normalPrice"></span>'),a.find(".normalPrice").text(n+" "+__curr),null!=e.DepositValue&&e.DepositValue>0&&a.find(".normalPrice").append('<span class="deposit">+ '+__translations.Deposit+": "+d+" "+__curr+(l?"/"+l:"")+"</span>")),(0==e.AskForPrice&&3==e.Availability.Status||1==s||null!=e.StockLevel&&1==e.StockLevel.Control&&null!=e.StockLevel&&0==e.StockLevel.Value)&&(a.find(".js-addToCart").find("span").remove(),a.find(".js-addToCart").find(".svgIcon").remove(),a.find(".js-addToCart").append('<span class="open-popup-with-form" data-popup-class=".notify-about-availability-popup"><svg class="svgIcon" height="20" width="20"><use xlink:href="css/img/icons-sprite.svg#bell-regular"></use></svg></span>'),a.find(".js-addToCart").addClass("js-notifyAboutAvailability")),e.AttributesList&&e.AttributesList.Attributes&&"showRotateImageOnList-yes"==__showRotateImageOnList)for(attribute in e.AttributesList.Attributes)if(e.AttributesList.Attributes[attribute].Name.toLowerCase().includes("360photo")){a.append('<input type="hidden" class="photoLink" value="'+e.AttributesList.Attributes[attribute].Values[0].Value+'">'),a.append('<button class="open360 open360-js open-popup-with-form" data-popup-class=".image-rotate-popup" data-product-list="true">360°</button>');break}"rating"==__productItemOnList?(a.find(".product-item__rating--rates").text("").append('<svg class="product-item__rating--icon svgIcon"><use xlink:href="css/img/icons-sprite.svg#star-solid"></use></svg>'+e.Rating+"/5"),a.find(".product-item__rating--counter").text(e.Rating
67Count+" "+__translations.PrList_RatingCount)):"comparer"==__productItemOnList&&a.find('.product-item__comparer input[name="productId"]').val(e.Id),"fav_yes"==__addToFavouriteFromProductList&&a.find('.productWishListAdd-js input[name="productId"]').val(e.Id),"buy_yes"==__allowToBuyFromProductsList&&a.find('.js-addToCart input[name="productId"]').val(e.Id);let u=!1;"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL&&(e.AttributesList&&e.AttributesList.Clip&&1==e.AttributesList.Clip?(u=!0,"Variants_Thumbnails"===__graphicalVariantsPresentation?a.addClass("withGraphicalVariants"):a.addClass("withColorVariants")):1==e.HasAttributes&&"Variants_Colors"===__graphicalVariantsPresentation&&(u=!0,a.addClass("withColorVariants"))),u&&a.find(".product-item__phantom").removeClass("hidden"),e.HasAttributes,("yes"===__discountsPresentation&&"yes"===__showDiscountsOnProductsLists||"yes"===__couponsPresentation&&"yes"===__showCouponsOnProductsLists)&&(e.HasDiscounts||e.HasCoupons)&&(a.find(".product-item__discounts-container").append('<div class="discounts-on-product-presentation-ui product-item__discounts discounts-on-product-presentation-js"><button class="btn-pure-ui show-more-discounts-product-list-js" data-product-id='+e.Id+" data-url="+__CustomerProfileUrl+">"+__translations.ShowDiscounts+"</button></div>"),__showDiscountsOnProductsLists?a.find(".discounts-on-product-presentation-ui").addClass("with-discounts-js"):__showCouponsOnProductsLists&&a.find(".discounts-on-product-presentation-ui").addClass("with-coupons-js"))});$(".productitemtoremove").remove(),showAllPhantomVariants()},showAllPhantomVariants=function(){"Variants_No"!==__graphicalVariantsPresentation&&"graphicalVariantsOnProductsList-yes"===__graphicalVariantsOnPL&&$(".product-item-pl").each(function(){var t=$(this);productListFunctions.showAttributesOnHover(t)})}; 68 69var cartType=2,cartFunctions={oldVal:-1,autoSaveDelay:null,hideValidationDelay:null,init:function(){this.events(),this.checkStep(),"hide"==sessionStorage.getItem("loginContent")&&cartFunctions.hideLoginContent()},checkStep:function(){var e=sessionStorage.getItem("step");"1nd"==e||"2nd"==e?(cartFunctions.show2ndStep(),$(".installmentCalculator-cart").removeClass("hidden")):"after2"==e&&($(".js-1st-step-div").addClass("hidden"),$(".js-3rd-step-div").removeClass("hidden"))},show2ndStep:function(){$(".js-1st-step-div").removeClass("hidden"),$(".js-3rd-step-div").addClass("hidden"),ui.formLabelAnimationOnLoadPage()},orderChangeValue:function(e,t=-1){t=parseFloat(t),$(".js-change-value").prop("disabled",!0);var a,n,o=$(e.currentTarget).closest(".js-product").data("id").toString(),s=$(e.currentTarget).siblings(".js-value").children("input").data("int"),r=$(e.currentTarget).closest(".js-product").attr("data-number"),i=1==s?1:.1,c=1,l=!0,d=$(e.currentTarget).siblings(".js-value").children("input").data("min"),u=!1;let p=parseFloat($(e.currentTarget).closest(".cart__qty-box").find('input[name="multiplicity"]').val());if(d&&(i=1==s?parseInt(d,10):parseFloat(d)),p&&(c=p),$(e.currentTarget).hasClass("js-change-value")){if(n=$(e.currentTarget).text(),a=$(e.currentTarget).siblings(".js-value").children("input").val().replace(",","."),a=1==s?parseInt(a,10):parseFloat(a),"-"===n||n===$("#minusValue").text()?a-=c:a+=c,p&&parseFloat(a)%p!=0)return-1!=t&&$(e.currentTarget).siblings(".js-value").children("input").val(t),$(".js-change-value").prop("disabled",!1),void app.showTemporaryPopup(__translations.Crt_QuantityMultiplicityIncorrect,"error","",5e3);if(a>=i)a=1==s?parseInt(a,10):parseFloat(a),a=1==s?a:a.toFixed(2),$(e.currentTarget).siblings(".js-value").children("input").val(a);else{$(".js-change-value").prop("disabled",!1),a=i,l=!1;var m=$(e.currentTarget).parent().parent().find(".validation-min-quantity-js");$(e.currentTarget).closest(".cart__details-box").addClass("cart__details-box--error"),m.removeClass("validation-info-js"),m.show().delay(2e3).hide(function(){$(e.currentTarget).closest(".cart__details-box").removeClass("cart__details-box--error"),m.addClass("val
69idation-info-js")})}}else{if(a=$(e.currentTarget).children("input").val(),s=$(e.currentTarget).children("input").data("int"),d=$(e.currentTarget).children("input").data("min"),i=1==s?1:.1,p&&parseFloat(a)%p!=0)return-1!=t&&$(e.currentTarget).children("input").val(t),$(".js-change-value").prop("disabled",!1),void app.showTemporaryPopup(__translations.Crt_QuantityMultiplicityIncorrect,"error","",5e3);d&&(i=1==s?parseInt(d,10):parseFloat(d)),(a<i||!a.match(/^[0-9]{1,9}([,.][0-9]{1,9})?$/g))&&($(".js-change-value").prop("disabled",!1),a=1==s?i:i.toFixed(2),$(e.currentTarget).children("input").val(a),u=!0)}if(l){if(u){let e=function(){let e=$(".js-product[data-number="+r+"]").find(".validation-min-quantity-js"),t=$(".js-product[data-number="+r+"]").find(".cart__details-box");t.addClass("cart__details-box--error"),e.removeClass("validation-info-js"),e.show().delay(2e3).hide(function(){t.removeClass("cart__details-box--error"),e.addClass("validation-info-js")})};cartFunctions.recalculate(r,a,e)}else cartFunctions.recalculate(r,a);__onePageShop||app.updateCartCookieAfterChange(o,"quantity",a)}},addMaxMinColors:function(){var e,t,a,n,o=$("main").find(".js-value input");$.each(o,function(o,s){e=$(s).closest(".cart__qty-box").find(".js-change-value")[0],t=$(s).closest(".cart__qty-box").find(".js-change-value")[1],a=+$(s).attr("min"),(n=+$(s).val())>=99999?($(t).css("color","#dddddd"),$(s).val(99999)):n<=a&&($(e).css("color","#dddddd"),$(s).val(a))})},removeFromCart:function(e){var t=$(e.currentTarget).closest(".js-product"),a=t.data("set-elements"),n="";a?$(e.currentTarget).parent().parent().nextAll("li.setElement-js").each(function(e){e<a&&(n=n+$(this).data("id")+"_")}):a=1;var o=t.data("number"),s=t.data("id"),r=t.data("name"),i=Number(t.data("price"));if(t.data("quantity"))var c=Number(t.data("quantity"));else c=t.find(".cart__quantityInput").length>0?Number(t.find(".cart__quantityInput").val()):Number(t.find(".quantity-value").eq(0).text());var l={__collection:"customer.Cart.Value|customer.Cart.Count",__csrf:__CSRF,__template:"elements/cart/cart-2.html",__action:"cart/PositionDelete",no:o};$.post(null,l,function(t){t.action.Result&&(app.dataLayerPush("removeFromCart",s),"undefined"!=typeof gtag&>ag("event","remove_from_cart",{currency:__currCode,value:i*c,items:[{item_id:s,item_name:r,price:i,quantity:c}]}),$(e.currentTarget).closest(".js-el-to-del").remove(),$(".cart-container-box-js").replaceWith(t.template),ui.decrementProductsInCart(a),ui.changeCartValueInHeader(),app.showTemporaryPopup(__translations.CartDelete,"success",null,2e3),t.collection["customer.Cart.Count"]<1&&$(".js-activeCart").removeClass("activeCart")),__onePageShop||app.updateCartCookieAfterChange(s,"delete",a,n)})},recalculate:function(e,t,a){var n;if(null==e&&null==t){n="cart/Recalculate";var o={__csrf:__CSRF,__action:n,__template:"elements/cart/cart-2.html"}}else n="cart/QuantityChange",o={__csrf:__CSRF,__action:n,__template:"elements/cart/cart-2.html",no:e,quantity:t.toString().replace(".",",")};$.post(null,o,function(e){e.action.Result?($(".cart-container-box-js").replaceWith(e.template),"cart/QuantityChange"!=e.action.Action?($(".recalculateCart").css("display","block"),setTimeout(function(){$(".recalculateCart").css("display","none")},500),$(".cartInfoContainer").removeClass("hidden")):a&&a()):102!=e.action.Code&&(1001===e.action.Code&&$(".cart-container-box-js").replaceWith(e.template),app.showTemporaryPopup(e.action.Description,"error")),cartFunctions.addMaxMinColors()})},showPayments:function(e,t=null){let a=$(document).scrollTop();var n,o=$(e.currentTarget).parent().attr("data-number");n=0!=$(".js-payment-list"+o).children(".selected").length?$(".js-payment-list"+o).children(".selected").attr("data-id"):$(".js-payment-list"+o).children().eq(0).attr("data-id");var s={__csrf:__CSRF,__template:"elements/cart/cart-2.html",__action:"Order/DeliveryChange",id:n};$.post(null,s,function(e){e.action.Result&&($(".cart-container-box-js").replaceWith(e.template),cartFunctions.checkStep(),null!=t&&$(".js-delivery-item").eq(t).focus(),cartFunctions.setSummaryTilePosition(a))})},selectPayment:function(e,t=null){let a=$(document).scrollTop();var n=$(e.currentTarget).attr("data-id"),o={__csrf:__CSRF,__collection:"cart.Products",__template:"elements/cart/cart-2.html",__action:"Order/DeliveryChange",id:n};$.post(null,o,function(n){if(n.action.Result){if($(".cart-container-box-js").replaceWith(n.template),cartFunctions.checkStep(),app.dataLayerPush("selectedPayment",e),null!=t&&$(".js-payment-item").eq(t).find("label").focus(),("none"==$(".js-ps-box").css("display")||$(".js-ps-box").length<=0)&&($(".paymentChannel__container").fadeIn(500),app.activateFocusTrap(".paymentChannel__container",e.target)),"undefined"!=typeof gtag){for(var o=n.collection,s=[],r=0,i=0;i<o.length;i++){var c={item_id:o[i].Id.toString(),item_name:o[i].NameNoHtml,price:o[i].TotalPrice,quantity:o[i].Quantity};s.push(c),r+=o[i].TotalPrice*o[i].Quantity}gtag("event","add_shipping_info",{currency:__currCode,value:r,shipping_tier:$(".deliveryAndPayment .deliveryMethod__container.selected .deliveryMethod__name").text().trim(),items:s}),gtag("event","add_payment_info",{currency:__currCode,value:r,payment_type:$(e.currentTarget).find("label span").eq(0).text().trim(),items:s})}cartFunctions.setSummaryTilePosition(a)}})},orderDeliveryDateChange:function(e){var t=$(e.currentTarget),a=t.val(),n=t.attr("min"),o=new Date(a),s=new Date(n);if("date"==t.attr("type"))var r=/^\d{4}-\d{2}-\d{2}$/;else r=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/;(!r.test(t.val())||o<s)&&t.val(n);var i=[{name:"__action",value:"Order/DeliveryDateChange"},{name:"date",value:a},{name:"__csrf",value:__CSRF}];"date"==t.attr("type")?i[1].value=i[1].value+" 00:00:00":i[1].value=i[1].value.replace("T"," ")+":00",$.post(null,i)},orderCouponAdd:function(e){sessionStorage.coupon=$('input[name="code"]').val(),app.post(e,cartFunctions.checkStep)},showCouponError:function(e){$(".cartCouponError").removeClass("hidden"),$(".cartCouponError > .cartError__message").text(e),$("html, body").animate({scrollTop:0},800)},removeCoupon:function(){var e=[{name:"__action",value:"Order/CouponDelete"},{name:"__csrf",value:__CSRF}];$.post(null,e,function(e){e.action.Result?location.reload():100!==e.action.Code&&app.showTemporaryPopup(e.action.Message,"error")})},customerDataAutoSave:function(e){let t=!0;$(e.currentTarget).parents(".js-save-address-form").find("input:not([disabled]), select:not([disabled])").each(function(){if($(this).prop("required")&&""==$(this).val())return t=!1,!1}),t&&app.post(e)},orderStepNext:function(e){if(app.post(e,function(e,t){$(".js-place-order").length>0&&t.collection["cart.SelectedDelivery.PhoneRequired"]&&!t.collection["cart.Customer.DeliveryAddress.PhoneNo"]?$(".js-place-order").data("phone-required",!0):$(".js-place-order").removeData("phone-required")}),$(e.currentTarget).hasClass("js-3rd-step")){const e=setInterval(()=>{-1==$("#deliveryData").index()&&-1==$(".summaryCart").index()||(setTimeout(ui.formLabelAnimationOnLoadPage(),500),1==$('input[name="invoice"]').prop("checked")?$(".js-4th-step").addClass("js-check-invoice"):$(".js-4th-step").removeClass("js-check-invoice"),cartFunctions.stickyCartBar(),clearInterval(e))},1e3)}else setTimeout(function(){ui.formLabelAnimationOnLoadPage()},500)},hideLoginContent:function(){$(".js-visitor-cart").hide(),$(".js-data-content").removeClass("js-hide"),$(".summaryDetails").removeClass("hidden"),$(".js-3rd-step-div").removeClass("customerData__notAuthenticated"),$(".customerData").removeClass("customerData__notAuthenticated"),ui.formLabelAnimationOnLoadPage()},cartLogin:function(e){app.post(e,app.windowReload)},toggleInvoice:function(){var e=[{name:"__csrf",value:__CSRF},{name:"__action",value:"Order/InvoiceChange"},{name:"invoice",value:$('input[name="invoice"]').prop("checked")}];$.post(null,e,function(e){e.action.Result?$(".js-4th-step").hasClass("js-check-invoice")?$(".js-4th-step").removeClass("js-check-invoice"):$(".js-4th-step").addClass("js-check-invoice"):100!==e.action.Code&&app.showTemporaryPopup(e.action.Message,"error")}),$(".cart__invoice").find(".form__validation-info, .form__invalid-input").hide(),$(".cart__invoice").find("input").removeClass("form__validation-error-js")},saveInvoice:function(e,t=!0){app.post(e,function(a){$(".js-check-invoice").addClass("js-invoice-saved").removeClass("js-check-invoice");let n=$(e.currentTarget);$(e.currentTarget).hasClass("js-save-invoice")||(n=$(".js-4th-step")),n.hasClass("js-4th-step")&&t?$(".js-3rd-step").trigger("click"):app.showTemporaryPopup(a,"success")},$(".js-invoice").attr("data-valid"))},changeInvoiceCompanyPerson:function(){$.get("",{__collection:"config.Registration|cart.SelectedDelivery.CollectionPointTypeId"},function(e){var t=e.collection["config.Registration"],a=e.collection["cart.SelectedDelivery.CollectionPointTypeId"],n=$('.js-invoice input[name="phoneNo"]'),o=n.prev().html();$(".js-invoice #person").prop("checked")?(!t.Retail.PhoneRequired&&2!=a||-1!=o.indexOf("*")?!t.Retail.PhoneRequired&&2!=a&&o.indexOf("*")>-1&&($(o).attr(o.substring(2,o.length)),n.prop("required",!1)):($(o).html("* "+o),n.prop("required",!0)),$('.js-invoice select[name="vateu"], .js-invoice input[name="tin"]').attr("disabled",!0),$(".js-tin-row").addClass("hidden"),$(".labelPersonName-js").text("* "+__translations.FullName),$(".labelPersonName2-js").text(__translations.FullName),$(".company__Country").css("margin-left","0")):(!t.Company.PhoneRequired&&2!=a||-1!=o.indexOf("*")?!t.Company.PhoneRequired&&2!=a&&o.indexOf("*")>-1&&($(o).val(o.substring(2,o.length)),n.prop("required",!1)):($(o).val("* "+o),n.prop("required",!0)),$('.js-invoice select[name="vateu"], .js-invoice input[name="tin"]').attr("disabled",!1),$(".js-tin-row").removeClass("hidden"),$(".labelPersonName-js").text("* "+__translations.CompanyName),$(".labelPersonName2-js").text(__translations.CompanyName),$(".company__Country").css("margin-left","46px"))}),$(".cart__invoice").find(".form__validation-info, .form__invalid-input").hide(),$(".cart__invoice").find("input").removeClass("form__validation-error-js")}
69,copyInvoiceData:function(){if($(".js-choose-address").index()<=-1)var e=$(".cart__receiver-address");else e=$(".js-choose-address.selected");let t=$(".cart__invoice"),a=["name","street","streetNo","unitNo","zipCode","city","phoneNo"],n=!1;for(let e=0;e<7;e++)""!==t.find('input[name="'+a[e]+'"]').val()&&(n=!0);if(0==n)for(let n=0;n<7;n++){let o=e.find('input[name="'+a[n]+'"]'),s=t.find('input[name="'+a[n]+'"]');""===o.val()||""!==s.val()||o.parent().hasClass("form__validation-error-js")||o.hasClass("form__validation-error-js")||s.val(o.val()),s.focus(),setTimeout(function(){s.blur()})}},sendNote:function(e){$(".js-note").attr("disabled",!0);var t=$(".js-note").val(),a={__csrf:__CSRF,__action:"Order/NoteAdd",note:t};$.post(null,a,function(e){0!==e.action.Code?app.showTemporaryPopup(e.action.Message,"error"):app.showTemporaryPopup(__translations.Crt_NoteAdded,"success"),$(".js-note").attr("disabled",!1)})},processFilesList:function(e,t){var a=t.pop();if(a){var n=new FormData;n.append("__CSRF",__CSRF),n.append("__action","Order/AttachmentAdd"),n.append("__template","partials/cart/cart-attachment.html"),n.append("file",a),$.ajax({data:n,processData:!1,contentType:!1,type:"POST",success:function(n){if(e.val(""),n.action.Result)$(".attachmentsAll-js").html(n.template);else{null==window.AttachementsNotAdded&&(window.AttachementsNotAdded=[]);var o=n.action.Message+": "+a.name+"<br>";window.AttachementsNotAdded.push(o)}cartFunctions.processFilesList(e,t)}})}else if(window.AttachementsNotAdded){var o=window.AttachementsNotAdded.join("");app.showTemporaryPopup(o,"error","",5e3),window.AttachementsNotAdded=void 0}},attachmentAdd:function(e){var t=$(e.currentTarget),a=Object.values(e.currentTarget.files);cartFunctions.processFilesList(t,a)},attachmentDelete:function(e){var t=e.currentTarget;$.post("",{__csrf:__CSRF,__action:"Order/AttachmentDelete",id:$(e.currentTarget).data("id")},function(){$(t).closest(".attachmentsFile-js").remove()})},orderGoTo4:function(e){var t,a,n;if(t=$(e.currentTarget).hasClass("js-save-address")?app.validationBeforePost(e,$(".js-save-address-form")):"",a=$(e.currentTarget).hasClass("js-check-invoice")?app.validationBeforePost(e,$(".js-invoice")):"","error"!==t&&"error"!==a)$("html, body").animate({scrollTop:0},600),$(e.currentTarget).hasClass("js-check-invoice")&&$(".js-invoice .cart__address-row .form__input-value-js:not([disabled])").eq(0).trigger("change",!0),$(e.currentTarget).hasClass("js-save-address")?$(e.currentTarget).hasClass("js-check-invoice")&&!$(e.currentTarget).hasClass("js-invoice-saved")?app.post(e,cartFunctions.saveInvoice,e):app.post(e,cartFunctions.triggerNextStep):-1!=$(".choosePaymentChannel-js").index()&&-1==$(".choosePaymentChannel-jss [name=channel]:checked").index()?app.showTemporaryPopup($(".choosePaymentChannel-js").data("validation"),"info"):setTimeout(function(){cartFunctions.triggerNextStep()},500);else if("error"==t||"error"==a){const e=$(".js-3rd-step-div input.form__validation-error-js");for(const t of e)if(!$(t).parent().hasClass("hidden")){n=$(t).offset().top;break}$("html, body").animate({scrollTop:n-200},300)}},triggerNextStep:function(){$(".js-3rd-step").trigger("click")},changeCountry:function(e){app.post(e,cartFunctions.show2ndStep)},updateAddress:function(e){let t={...e};app.post(e,function(e){$(e.target).parents(".cart__customer-address-item").find('input[name="__action"]').val("Customer/DeliveryAddressUpdate"),app.post(t,function(){$.get("",{__template:"partials/cart/cart-address-list.html"},function(e){e.template&&$(".cart__customer-addresses-list").replaceWith(e.template)})})},e)},selectAddress:function(e){const t=e.currentTarget,a=$(t).closest(".js-address-box").find(".js-edit-box input, .js-edit-box select").serializeArray();a.push({name:"__csrf",value:__CSRF});let n=a.findIndex(e=>"__action"==e.name);$.post(null,a,function(o){if(o.action.Result)$(".selected").removeClass("selected"),$(t).closest(".js-address-box").addClass("selected"),$(".js-3rd-step").prop("disabled",!1).removeClass("disabled"),$(e.target).hasClass("update")||(a[n].value="Customer/DeliveryAddressUpdate",$.post(null,a));else{let e=o.action.Message;o.action.Validation&&o.action.Validation.length>0&&(e+=":",o.action.Validation.forEach(function({Error:t}){e+="<br>"+t})),app.showTemporaryPopup(e,"error")}})},orderStepPrev:function(e){if($(e.currentTarget).hasClass("js-go-to-2nd"))$.post(null,{__csrf:__CSRF,__action:"Order/StepPrev",__template:"elements/cart/cart-2.html",__collection:"cart.OrderStep"},async function(e){let t=e;"CustomerData"===t.collection&&await $.post(null,{__csrf:__CSRF,__action:"Order/StepPrev",__template:"elements/cart/cart-2.html",__collection:"cart.OrderStep"},function(e){t=e}),$(".cart-container-box-js").replaceWith(t.template),sessionStorage.setItem("step","2nd"),cartFunctions.show2ndStep(),c
69artFunctions.stickyCartBar()});else if($(e.currentTarget).hasClass("js-go-to-3rd")&"hide"==sessionStorage.getItem("loginContent"))app.post(e,cartFunctions.hideLoginContent);else if(app.post(e),$(e.currentTarget).hasClass("js-go-to-3rd")){const e=setInterval(()=>{-1==$("#deliveryData").index()||(ui.formLabelAnimationOnLoadPage(),cartFunctions.stickyCartBar(),clearInterval(e))},1e3)}else setTimeout(function(){ui.formLabelAnimationOnLoadPage()},500)},toggleEdition:function(e){$(e.currentTarget).closest(".js-edit-address").toggleClass("js-edition-opened"),$(e.currentTarget).closest(".js-edit-address").children(".js-edit-box").slideToggle(400);var t=$(e.currentTarget).closest(".js-edit-address").find(".js-action-input");"Order/DeliveryAddressUpdate"!=t.val()?t.val("Customer/DeliveryAddressUpdate"):t.val("Order/DeliveryAddressUpdate")},choosePaymentChannel:function(e){e.preventDefault();var t=$(".choosePaymentChannel-js").data("id"),a=$(e.currentTarget).val();$.post(null,{__csrf:__CSRF,__action:"Order/DeliveryChange",id:t,channel:a}),$(".paymentChannel__label").removeClass("js-active"),$(e.currentTarget).parent().parent().addClass("js-active");const n=$(".js-payment-item input:checked").parent().find(".paymentMethod__name"),o=$(e.currentTarget).data("name"),s=n.find(".paymentMethod__name-channel");s.length>0?s.text(o):n.prepend('<span class="paymentMethod__name-channel">'+o+"</span>");const r=n.find(".change-payment-channel-btn-js");r.find("span").text(r.data("change-translation"))},changeCollectionPoint:function(e){var t;t=parseInt($(e.currentTarget).attr("data-id"))+""=="NaN"?$(e.currentTarget).attr("data-id"):parseInt($(e.currentTarget).attr("data-id")),$.post(null,{__csrf:__CSRF,__action:"order/DeliveryCollectionPointChange",id:t,__template:"elements/cart/cart-2.html"},function(e){e.action.Result&&(app.dataLayerPush("selectDeliveryPoint",t),$(".js-ps-box").fadeOut(400,function(){$(".cart-container-box-js").replaceWith(e.template),$(".js-close-ps-box").addClass("hidden"),$(".js-sp-title").addClass("hidden"),cartFunctions.checkStep(),$("body").removeClass("noscroll")}))})},remindCoupon:function(){sessionStorage.coupon&&($('input[name="code"]').val(sessionStorage.coupon),sessionStorage.removeItem("coupon"))},recalculatePoints:function(){var e={__csrf:__CSRF,__action:"Order/PointsUse",__template:"elements/cart/cart-2.html"};$.post(null,e,function(e){e.action.Result?location.reload():102!=e.action.Code&&(1001===e.action.Code&&$(".cart-container-box-js").replaceWith(e.template),app.showTemporaryPopup(e.action.Description,"error")),cartFunctions.addMaxMinColors()})},showPsBox:function(){$(".js-ps-box").length>0&&($(".js-ps-box").hasClass("js-map")?$(".js-ps-box").hasClass("js-choosen")||__pp.openMap(cartFunctions.setCollectionPointStyles):$(".js-ps-box").hasClass("js-list")&&!$(".js-ps-box").hasClass("js-choosen")&&($(".js-ps-box").fadeIn(400),$("body").addClass("noscroll")))},placeOrder:function(e){var t=$(e.currentTarget).closest(".cart__summary-js").find(".inputs-container-js");if("error"!==app.validationBeforePost(e,t)&&app.checkChannels($(".js-shoppingCart__orderConsents"))){for(var a=$(t).find("input").serializeArray(),n=0;n<a.length;n++)"__collection"==a[n].name&&(a[n].value+="|page.GtmDL|page.FbDL");a.push({name:"__csrf",value:__CSRF}),$.when($.post(null,a,function(e){e.action.Result?($("html, body").animate({scrollTop:0},600),sessionStorage.removeItem("loginContent"),sessionStorage.removeItem("step"),$(".cart-container-box-js").replaceWith(e.template),$(".incrementProductsInCart-js").attr("data-count",0),$(".incrementProductsInCart-js").html("0"),$(".activeCart").removeClass("activeCart")):100!==e.action.Code?1013===e.action.Code?cartFunctions.recalculate():app.showTemporaryPopup(e.action.Message,"error"):app.showTemporaryPopup(__translations.OrderErrorMessage,"error",!1,7e3)})).done(function(){app.setCookie("cartProducts","","",-1),cartFunctions.showExternalCounter()})}},showExternalCounter:function(){var e=0,t=5,a=setInterval(function(){e++,t--,$(".thankYou__counter").text(t),5==e&&(clearInterval(a),$(".externalPayment-js").click())},1e3)},setCollectionPointStyles:function(){$(".cart__iframe--map").addClass("openedMap"),$(".js-close-ps-box").removeClass("hidden"),$(".js-s
69p-title").removeClass("hidden")},setSummaryTilePosition:function(e){$(document).scrollTop(e-1),$(document).scrollTop(e)},cartBarChangeStep:async function(e){$("html, body").animate({scrollTop:0},600);const t=$(e.currentTarget).data("step"),a=$(e.currentTarget).data("set");let n,o;"Last"==t?"3rd"==a?(n=1,sessionStorage.setItem("step","after2")):(n=2,sessionStorage.setItem("step","2nd")):(n=1,sessionStorage.setItem("step","2nd"));for(let e=0;e<n;e++)await $.post(null,{__csrf:__CSRF,__action:"Order/StepPrev",__template:"elements/cart/cart-2.html"},function(e){o=e});n||await $.get(null,{__template:"elements/cart/cart-2.html"},function(e){o=e}),$(".cart-container-box-js").replaceWith(o.template),cartFunctions.checkStep()},stickyCartBar:function(){if($(window).width()<769&&"ThankYou"!=$("#orderStep").val()){const e=$(".cart-sticky-bar-js");if(e.length>0){const t=e.hasClass("fixed");t&&e.removeClass("fixed");const a=e.prev(),n=a.length>0?a.offset().top+a.outerHeight():e.offset().top,o=n+e.outerHeight(),s=$(window).scrollTop(),r=s+$(window).height();t&&e.addClass("fixed"),r<n||s>o?(e.addClass("fixed"),$(".cookie-message-opener-js").addClass("lower"),$(".go-to-top__btn-js").addClass("lower")):(e.removeClass("fixed"),$(".cookie-message-opener-js").removeClass("lower"),$(".go-to-top__btn-js").removeClass("lower"))}}},showValidationError:function(e,t,a=300,n=3e3){const o=$(e);$("html, body").animate({scrollTop:o.offset().top-a},800),o.addClass("error"),o.next(t).removeClass("hidden"),cartFunctions.hideValidationDelay=setTimeout(function(){o.removeClass("error"),o.next(t).addClass("hidden")},n)},events:function(){$("body").on("click",".js-change-value",function(e){let t=$(e.currentTarget).parent().find(".js-value input").val();cartFunctions.orderChangeValue(e,t),ui.changeCartValueInHeader()}),$(window).on("resize",function(){$(window).width()<=768&&$(".cart__summary-js").css("top","unset")}),$(window).on("load",function(){$(".cartContainer").length&&"ThankYou"==$("#orderStep").val()&&cartFunctions.showExternalCounter(),setTimeout(function(){"none"==$(".js-visitor-cart").css("display")&&$(".summaryDetails").removeClass("hidden")},1e3),1==$(".js-toggle-invoice").prop("checked")&&"none"==$(".js-invoice").css("display")&&$(".js-toggle").slideToggle(400),1==$('input[name="invoice"]').prop("checked")?$(".js-4th-step").addClass("js-check-invoice"):$(".js-4th-step").removeClass("js-check-invoice"),cartFunctions.copyInvoiceData(),cartFunctions.stickyCartBar()}),$(".js-value input").on("focusin",function(){cartFunctions.oldVal=$(this).val()}),$("body").on("change",".js-value",function(e){cartFunctions.orderChangeValue(e,cartFunctions.oldVal),ui.changeCartValueInHeader(),cartFunctions.oldVal=-1}),$("body").on("click",".js-back-to-shopping",function(){window.location.replace("")}),$("body").on("click",".js-1st-step",function(){$("html, body").animate({scrollTop:0},600),$.get(null,{__template:"elements/cart/cart-2.html"},function(e){sessionStorage.setItem("step","1nd"),$(".cart-container-box-js").replaceWith(e.template),$(".js-3rd-step-div").addClass("hidden"),$(".js-1st-step-div").removeClass("hidden")})}),$("body").on("click",".js-delete-item",function(e){cartFunctions.removeFromCart(e)}),$("body").on("click",".js-delete-all",function(e){if("undefined"!=typeof gtag)$.get("",{__collection:"cart.Products"},function(e){for(var t=e.collection,a=[],n=0,o=0;o<t.length;o++){var s={item_id:t[o].Id.toString(),item_name:t[o].NameNoHtml,price:t[o].TotalPrice,quantity:t[o].Quantity};a.push(s),n+=t[o].TotalPrice*t[o].Quantity}gtag("event","remove_from_cart",{currency:__currCode,value:n,items:a});let r=document.querySelector(".incrementProductsInCart-js").dataset.count;$.ajax({url:null,method:"post",data:{__csrf:__CSRF,__action:"cart/Delete",__template:"elements/cart/cart-2.html"},success:function(e){app.setCookie("cartProducts","","",-1),ui.decrementProductsInCart(r),ui.changeCartValueInHeader(),$(".js-activeCart").removeClass("activeCart"),$(".cart-container-box-js").replaceWith(e.template),app.showTemporaryPopup(__translations.AllCartDelete,"success",null,2e3)}})});else{let e=document.querySelector(".incrementProductsInCart-js").dataset.count;$.ajax({url:null,method:"post",data:{__csrf:__CSRF,__action:"cart/Delete",__template:"elements/cart/cart-2.html"},success:function(t){app.setCookie("cartProducts","","",-1),ui.decrementProductsInCart(e),ui.changeCartValueInHeader(),$(".js-activeCart").removeClass("activeCart"),$(".cart-container-box-js").replaceWith(t.template),app.showTemporaryPopup(__translations.AllCartDelete,"success",null,2e3)}})}}),$("body").on("click",".closeMessage",function(){$(this).parent().slideToggle(300)}),$("body").on("click",".closeCouponMessage",function(){$(this).parent().addClass("hidden")}),$("body").on("click",".js-delivery-item",function(e){$(e.currentTarget).closest(".
69js-delivery-list").children(".selected").removeClass("selected"),$(e.currentTarget).parent().addClass("selected");let t=$(".js-delivery-item").index(e.currentTarget);cartFunctions.showPayments(e,t),setTimeout(function(){$("#psbox").length&&(cartFunctions.showPsBox(),app.activateFocusTrap(".js-ps-box",e.target))},1e3)}),$("body").on("blur",".orderDeliveryDateChange-js",function(e){cartFunctions.orderDeliveryDateChange(e)}),$("body").on("click",".orderCouponAdd-js",function(e){cartFunctions.orderCouponAdd(e)}),$("body").on("click",".js-remove-coupon",function(e){cartFunctions.removeCoupon(e)}),$("body").on("click",".js-3rd-step",function(t){if(cartFunctions.hideValidationDelay&&clearTimeout(cartFunctions.hideValidationDelay),!(t.detail&&t.detail>1))if("true"!==$('input[name="changes"]').val()){if("false"!=$(t.currentTarget).attr("data-deliveryProper")){if($(this).hasClass("js-btn-chooseCp"))return void cartFunctions.showValidationError(".js-list-element.deliveryMethod__container.selected",".delivery-method-error-js");if($("#isPaymentChannel").length&&!e)return void cartFunctions.showValidationError(".js-list-element.paymentMethod__container.selected",".payment-method-error-js");$("html, body").animate({scrollTop:0},600),sessionStorage.setItem("step","after2"),cartFunctions.orderStepNext(t)}}else setTimeout(function(){cartFunctions.recalculate()},1e3)}),$("body").on("click",".js-hide-login-content",function(e){$("html, body").animate({scrollTop:0},600),sessionStorage.setItem("loginContent","hide"),cartFunctions.hideLoginContent(e),$(".summaryDetails").removeClass("hidden"),$(".customerData").removeClass("customerData__notAuthenticated")}),$("body").on("click",".js-cart-login",function(e){cartFunctions.cartLogin(e)}),$("body").on("change",".js-toggle-invoice",function(e){$(this).parent().siblings(".js-toggle").slideToggle(400,function(){$(this).toggleClass("show"),$(this).hasClass("show")&&cartFunctions.copyInvoiceData()}),cartFunctions.toggleInvoice(e)}),$("body").on("change",".js-company-person",function(){cartFunctions.changeInvoiceCompanyPerson()}),$("body").on("change",".cart__invoice-box",function(){$(".js-4th-step").hasClass("js-invoice-saved")&&$(".js-4th-step").removeClass("js-invoice-saved").addClass("js-check-invoice")}),$("body").on("change",".js-invoice input:not([disabled]), .js-invoice select:not([disabled])",function(e,t){let a=1e3;t&&(a=0),cartFunctions.autoSaveDelay&&(clearTimeout(cartFunctions.autoSaveDelay),cartFunctions.autoSaveDelay=null),cartFunctions.autoSaveDelay=setTimeout(function(e){let t=!0;$(e.currentTarget).parents(".js-invoice").find("input:not([disabled]), select:not([disabled])").each(function(){if($(this).prop("required")&&""==$(this).val()&&!$(this).parent().hasClass("hidden"))return t=!1,!1}),t&&cartFunctions.saveInvoice(e,!1)},a,{...e})}),$("body").on("change",".js-note",function(e){cartFunctions.sendNote(e)}),$("body").on("change",".attachmentAdd-js",function(e){cartFunctions.attachmentAdd(e)}),$("body").on("click",".attachmentDelete-js",function(e){cartFunctions.attachmentDelete(e)}),$("body").on("click",".js-4th-step",function(e){e.detail&&1!=e.detail||cartFunctions.orderGoTo4(e)}),$("body").on("change",".js-select-country",function(e){cartFunctions.changeCountry(e)}),$("body").on("click",".js-update-address",function(e){cartFunctions.updateAddress(e),cartFunctions.copyInvoiceData()}),$("body").on("click",".js-add-new-address",function(e){app.post(e,function(e){$.get("",{__template:"partials/cart/cart-address-list.html"},function(e){e.template&&($(".cart__customer-addresses-list").replaceWith(e.template),$(".js-choose-address.selected").addClass("update").click())})},e)}),$("body").on("click",".js-place-order",function(e){if($(e.currentTarget).data("phone-required"))app.showTemporaryPopup(__translations.PhoneRequired,"error");else if(!e.detail||1==e.detail){cartFunctions.placeOrder(e);var t=!1;$(".form__validation-required-js").each(function(){if("none"!=$(this).css("display")&&(t=!0,$("html, body").animate({scrollTop:$(this).parent().offset().top-100},500)),1==t)return!1}),0==t&&$("html, body").animate({scrollTop:0},600)}});var e=!1;$("body").on("click",".js-payment-item",function(t){t.preventDefault();let a=$(".js-payment-item").index($(t.currentTarget));cartFunctions.selectPayment(t,a),e=!1}),$(window).on("load",function(){$(".paymentChannel__label").each(function(){$(this).hasClass("js-active")&&(e=!0)})}),$("body").on("change",".choosePaymentChannel-js [name=channel]",function(e){cartFunctions.choosePaymentChannel(e)}),$("body").on("click",".js-submit-paymentChannels",function(t){$.when($(".paymentChannel__label").each(function(){$(this).hasClass("js-active")&&(e=!0)})).done(function(){1==e&&$(".paymentChannel__container").fadeOut(500)})}),$("body").on("click",".js-closePaymentChannels",function(t){$(t.currentTarget).parents(".choosePaymentChannel-js").find(".js-active").length>0&&(e=!0),$(".paymentChannel__container").fadeOut(500)}),$("body").on("click",".paymentChannel__label",function(){e=!0}),$("body").on("click",".js-prev-step",function(e){$("html, body").animate({scrollTop:0},600),$.when(cartFunctions.orderStepPrev(e)).done(function(){let t=null,a=0;"fixed"===$("header").css("position")&&(a=$("header").outerHeight()+80),$(e.currentTarget).hasClass("js-go-to-3rd")&&(setTimeout(function(){$(".summaryDetails").removeClass("hidden"),$(".customerData").removeClass("customerData__notAuthenticated")},1e3),$(e.currentTarget).hasClass("js-edit-billingaddress")?t=setInterval(()=>{-1!=$("#deliveryData").index()&&($("html, body").animate({scrollTop:0},500),clearInterval(t))},1e3):$(e.currentTarget).hasClass("js-edit-invoicedata")?t=setInterval(()=>{-1!=$("#invoiceBox").index()&&$(".js-toggle-invoice").prop("checked")?($("html, body").animate({scrollTop:$("#invoiceBox").offset().top-a}
69,500),clearInterval(t)):-1!=$("#invoiceBox").index()&&clearInterval(t)},1e3):$(e.currentTarget).hasClass("js-edit-note")&&(t=setInterval(()=>{-1!=$("#js-note").index()&&($("html, body").animate({scrollTop:$("#js-note").offset().top-a},500),$(".js-note").focus(),clearInterval(t))},1e3)))})}),$("body").on("click",".recalculate-points",function(e){$(this).hasClass("disableClick")||($(".recalculate-points").addClass("payUsingPoints"),$(".recalculatePointsPopup").slideToggle(200))}),$("body").on("click",".js-closerecalculatepointspopup",function(){$(".recalculate-points").removeClass("payUsingPoints"),$(".recalculatePointsPopup").slideToggle(200)}),$("body").on("click",".js-pay-points",function(){cartFunctions.recalculatePoints(),$(".recalculatePointsPopup").slideToggle(200)}),$("body").on("click",".remove-points",function(){cartFunctions.recalculate(),location.reload()}),$("body").on("change",".js-checkbox-switch",function(e){var t=!$(e.currentTarget).parent().siblings(".js-channels-checkbox").children("input").prop("disabled");$(e.currentTarget).parent().siblings(".js-channels-checkbox").children("input").prop("disabled",t)}),$("body").on("click",".js-2nd-step",function(e){if(!e.detail||1==e.detail)if("true"===$('input[name="changes"]').val())setTimeout(function(){cartFunctions.recalculate()},1e3);else{$("html, body").animate({scrollTop:0},600);var t=$(e.currentTarget).attr("data-passed"),a=$(e.currentTarget).attr("data-minMsg"),n=$(e.currentTarget).attr("data-curr"),o=$(e.currentTarget).attr("data-min");"false"!=t?$.get(null,{__template:"elements/cart/cart-2.html"},function(e){sessionStorage.setItem("step","2nd"),$(".cart-container-box-js").replaceWith(e.template),cartFunctions.show2ndStep(),cartFunctions.stickyCartBar()}):(a=a.replace("{0}",o).replace("{1}",n),app.showTemporaryPopup(a,"error"))}}),$("body").on("click",".js-open-ps-box",function(e){e.stopPropagation(),__pp.openMap(cartFunctions.setCollectionPointStyles),app.activateFocusTrap(".js-ps-box",e.target)}),$("#ifMap").on("load",function(){cartFunctions.setCollectionPointStyles()}),$("body").on("click",".js-ps-box",function(e){$(e.target).hasClass("js-ps-box")&&($(e.currentTarget).fadeOut(400),$("body").removeClass("noscroll"),$(".js-close-ps-box").addClass("hidden"),$(".js-sp-title").addClass("hidden"))}),$("body").on("click",".js-close-ps-box, .js-iframe",function(e){e.stopPropagation(),"ifMap"===e.target.id||e.target.classList.contains("js-sp-title")||($(".js-ps-box").fadeOut(400),$("body").removeClass("noscroll"),$(".js-close-ps-box").addClass("hidden"),$(".js-sp-title").addClass("hidden"))}),$("body").on("click",".js-select-cp",function(e){$("body").addClass("noscroll"),cartFunctions.changeCollectionPoint(e)}),$("body").on("click",".externalPayment-js",function(e){e.preventDefault(),"error"!=app.validationBeforePost(e)&&$(e.currentTarget).parents(".inputs-container-js").submit()}),$("body").on("click",".js-open-coupon",function(){$(this).siblings(".js-toggle-box").toggle().addClass("js-opened")}),$("body").on("click",".js-open-coupon",function(e){cartFunctions.remindCoupon()}),$("body").on("click",".js-close-edit-box, .js-open-edit-box",function(e){e.stopPropagation(),ui.formLabelAnimationOnLoadPage(),cartFunctions.toggleEdition(e),$(this).parent().find(".svg-edit-address").toggle()}),$("body").on("click",".js-choose-address",function(e){$(e.currentTarget).hasClass("js-edition-opened")||$(e.currentTarget).hasClass("selected")&&!$(e.currentTarget).hasClass("update")||(cartFunctions.selectAddress(e),$(".js-choose-address:not(.selected)").find(".cart__address-edit-box").hide(500),$(".js-choose-address:not(.selected)").find(".js-open-edit-box").show(),$(".js-choose-address:not(.selected)").find(".js-close-edit-box").hide())}),$("body").on("click",".js-single-address",function(e){app.post(e)}),$("body").on("change",".js-invoice-country",function(e){app.selectCountry(e.currentTarget.value,e.currentTarget)}),$("body").on("click",".js-show-products",function(){$(".finishOrder__container > .productList").slideToggle(200),$(".finishOrder__showProducts").toggleClass("arrowUp")}),$("body").on("click",".js-show-orderDetails",function(){$(".finishOrder__orderDetails__details").slideToggle(200),"block"==$(".finishOrder__orderDetails__details").css("display")&&($(".showDetail
69s").toggleClass("arrowUp"),$(".finishOrder__orderDetails__details").css("display","flex !important"))}),$("body").on("keydown",".cart__quantityInput",function(e){"true"==__decimalUnits?app.validateNumberInput(e):app.validateNumberInput(e,5)}),$("body").on("paste",".cart__quantityInput",function(e){e.preventDefault()}),$("body").on("click",".js-update-email",function(e){let t={__action:"Order/EmailSet",__csrf:__CSRF,email:$(".js-save-address-form").find('input[name="email"]').val()};$.post(null,t,function(){})}),$("body").on("change",".js-save-address-form:not(.js-edit-box) .form__input-value-js",cartFunctions.customerDataAutoSave),$("body").on("click",".js-cart-bar-step",cartFunctions.cartBarChangeStep),$("body").on("mouseenter",".delivery-method-tooltip-js svg",function(){$(window).width()>768&&$(this).siblings(".delivery-method-description-js").fadeIn(200)}),$("body").on("mouseleave",".delivery-method-tooltip-js svg",function(){$(window).width()>768&&$(this).siblings(".delivery-method-description-js").fadeOut(200)}),$("body").on("click",".delivery-method-tooltip-js svg",function(e){e.preventDefault(),e.stopPropagation(),$(window).width()<769&&$(this).siblings(".delivery-method-description-js").fadeToggle(200)}),$(window).on("scroll",function(){cartFunctions.scrollTimeout||(cartFunctions.scrollTimeout=setTimeout(function(){cartFunctions.stickyCartBar(),cartFunctions.scrollTimeout=null},100))}),$("body").on("click",".expand-coupon-js",function(e){$(e.currentTarget).toggleClass("expanded"),$(e.currentTarget).siblings(".coupon-container-js").slideToggle(200)})}};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.