"use strict";class WebSpecialRotatorTs{constructor(){this.getSearchTypeForProductList=function(){let n="";const t=$("div.product-results");return t.length>0&&(n=t.data().searchtype),n};this.loadWebSpecialsSlider()}clickItem(n){if(eciCommonUtility.isGa4Enabled()){const i=$(n.target),r=i.data().sku,t=i.parents(".product-info").data(),u=ga4FunctionsTs.convertFormattedPriceToNumber(t.sell_price),f={creative_name:"Web Special",creative_slot:"WebSpecial",items:[{item_id:r,item_name:t.description,item_brand:t.manufacturer,price:u}]};ga4FunctionsTs.sendSelectPromotionEvent(f)}}loadWebSpecialsSlider(){const t=$("#WebSpecialsContentUrl").val(),n=$("div#webspecialrotatorUI2022");if(n!=undefined&&n.length>0&&t!=undefined&&t.length>0){const i=n.data(),u=i.controller,f=i.action,r=$("#WebSpecial-container");jQuery.ajax({url:t,type:"GET",cache:!1,data:{PromotionAction:f,promotionPage:u,searchType:this.getSearchTypeForProductList()}}).done(function(t){try{n.html(t);const i=$("#webspecialcarousel");if(i.length==0)r.hide();else{r.show();const u={Container:n,SerializedRequest:$("#WebSpecialsQuantityOnHandSKUs").val()};getQuantityOnHandTs.fetchQuantityOnHand(u);const t=".webspecial-slider";if(productSliderTs.attachProductSlider(t),addToCartTs.setProductListCartQuantities($(""+t+"div.slick-slide:not(.slick-cloned) div.cart-qty")),quantityBoxTs.validateAndUpdateQuantityBoxInList(n),productSliderTs.handleFocusOnSlickSlider("webspecialrotatorUI2022"),sprAnalyticsTs.isEnabled()&&i.length){const n=JSON.stringify(i.data().spr_digital_data_product_impression_event);sprAnalyticsSetupTs.triggerProductImpressionEvent(eciCommonUtility.parseJSON(n))}}}catch(i){n.hide();console.log('WebSpecialRotator - "'+i.toString()+'"')}}).always(()=>{$(".webspecial-product-name").on("click",webSpecialRotatorTs.clickItem)})}}}const webSpecialRotatorTs=new WebSpecialRotatorTs