;(()=>{"use strict";(e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})({}),function(e){function a(){let a=e(".eaw-sb-container:not(.eaw-sb-container-init)");if(!a.length)return!1;a.addClass("eaw-sb-container-init"),"hidden"===e('.eaw-sb-container-popup input[name="quantity"]').attr("type")&&e(".eaw-sb-container-popup .eaw-sb-cart-form-content-qty").addClass("eaw-disabled").prev(".eaw-sb-cart-form-content").addClass("eaw-sb-cart-form-content-border-none"),a.find(".eaw-sb-cart-swatches:not(.eaw-sb-cart-swatches-init)").each(function(){e(this).addClass("eaw-sb-cart-swatches-init eaw_variation_form").eaw_get_variations(eawStickyBarVars),e(this).find(".babystreet-wcs-swatches").length&&e(this).babystreet_wcs_variation_swatches_form()}),e(document.body).trigger("eaw_variation_form"),t(),eawStickyBarVars.pvEnable&&e(".eaw-sb-container select.ccpeaw-select").each(function(){e(this).addClass("eaw-disabled1")})}function s(a=!1){let s=e(".eaw-sb-container.eaw-sb-container-popup"),t=e(".eaw-sb-container:not(.eaw-sb-container-popup)");a?(t.hasClass("eaw-sb-container-always_appear")&&t.removeClass("eaw-sb-container-always_appear").addClass("eaw-sb-container-always_appear-disabled"),s.hasClass("eaw-sb-container-ps-0")?(s.addClass("eaw-slide_in_up eaw-sb-container-popup-show"),s.removeClass("eaw-slide_out_down eaw-sb-container-hide"),t.removeClass("eaw-slide_in_up"),t.addClass("eaw-slide_out_down")):(s.addClass("eaw-slide_in_dowm eaw-sb-container-popup-show"),s.removeClass("eaw-slide_out_up eaw-sb-container-hide"),t.removeClass("eaw-slide_in_dowm"),t.addClass("eaw-slide_out_up"))):(s.hasClass("eaw-sb-container-ps-0")?(s.removeClass("eaw-slide_in_up eaw-sb-container-popup-show"),s.addClass("eaw-slide_out_down"),t.addClass("eaw-slide_in_up"),t.removeClass("eaw-slide_out_down eaw-sb-container-hide")):(s.removeClass("eaw-slide_in_dowm eaw-sb-container-popup-show"),s.addClass("eaw-slide_out_up"),t.addClass("eaw-slide_in_dowm"),t.removeClass("eaw-slide_out_up eaw-sb-container-hide")),t.hasClass("eaw-sb-container-always_appear-disabled")&&setTimeout(function(e){e.removeClass("eaw-sb-container-always_appear-disabled").addClass("eaw-sb-container-always_appear")},500,t)),e(".eaw-sidebar-cart-icon-wrap").length&&eaw_sc_icon_toggle(!a)}function t(){let a=e("form.cart"),s=e(".eaw-sb-container:not(.eaw-sb-container-popup)");if(!a.length||void 0===a[0].getBoundingClientRect())return!1;let t=a[0].getBoundingClientRect().top+a[0].scrollHeight;s.hasClass("eaw-sb-container-ps-0")?t<0?(s.addClass("eaw-slide_in_up"),s.removeClass("eaw-slide_out_down eaw-sb-container-hide"),setTimeout(function(){e("html").css({marginBottom:s.outerHeight()+"px"})},100)):s.hasClass("eaw-slide_in_up")&&(s.removeClass("eaw-slide_in_up"),s.addClass("eaw-slide_out_down")):t<0?(s.addClass("eaw-slide_in_dowm"),s.removeClass("eaw-slide_out_up eaw-sb-container-hide")):s.hasClass("eaw-slide_in_dowm")&&(s.removeClass("eaw-slide_in_dowm"),s.addClass("eaw-slide_out_up"))}e(document).ready(function(){e(document).on("click",".eaw-product-bt-atc.eaw-product-bt-external",function(){return e(this).attr("type","submit").trigger("click"),!1}),e(document).on("click",".eaw-product-bt-atc.eaw-product-bt-select",function(){return e("form.cart")[0].scrollIntoView(),!1}),e(document).on("click",".eaw-sb-product-bt-popup",function(){e(".eaw-sb-container-popup .eaw-sb-cart-form").length?s(!0):e("form.cart")[0].scrollIntoView()}),e(document).on("click",".eaw-sb-container-popup-overlay, .eaw-sb-container-popup-cancel",function(){s()}),e(document.body).on("click",".eaw-sb-container .quantity-trigger",function(a){a.preventDefault(),a.stopPropagation();let s=e(".eaw-sb-container input.eaw-sb-product-qty"),t=parseFloat(s.val()),n=parseFloat(s.attr("step"));e(this).hasClass("eaw-plus")?t+=n:t-=n,s.val(t).trigger("change")}),e(document.body).on("change",".eaw-sb-container input.eaw-sb-product-qty",function(a){a.preventDefault(),a.stopPropagation();let s=parseFloat(e(this).val()),t=parseFloat(e(this).attr("min")),n=parseFloat(e(this).attr("max"));t>s&&(s=t),s>n&&(s=n),e(this).val(s)})}),e(window).on("load",function(){a()}).scroll(function(){t()}),window.eaw_sb_design=a,window.eaw_sb_toggle=t,window.eaw_sb_popup_toggle=s}(jQuery)})();