;(()=>{"use strict";(a=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})})({}),jQuery(document).ready(function(a){a(document).on("change",".eaw-va-qty-input",function(t){let e=parseFloat(a(this).val()),o=parseFloat(a(this).attr("min")),r=parseFloat(a(this).attr("max"));o>e&&(e=o),e>r&&(e=r),a(this).val(e)}),a(document).on("click",".eaw-va-change-qty",function(t){t.preventDefault(),t.stopPropagation();let e=a(this).closest(".eaw-va-qty-wrap").find(".eaw-va-qty-input"),o=parseFloat(e.val()),r=parseFloat(e.attr("step"));a(this).hasClass("eaw-va-qty-add")?o+=r:o-=r,e.val(o).trigger("change")}),a(document).on("click",".eaw-va-product-bt-atc-cancel, .eaw-va-cart-form-overlay",function(){a("html").removeClass("eaw-html-non-scroll"),a(".eaw-va-cart-form-wrap-wrap").remove()}),a(document).on("click",".eaw-loop-variable-bt-atc:not(.vicatna-loop-atc-button)",function(t){t.preventDefault(),t.stopPropagation();let e=a(this),o=a(this).data("product_id")||"";o||(e=e.closest("a.eaw-loop-variable-bt-atc"),o=e.data("product_id")||""),o||(window.location.href=e.attr("href")),a.ajax({url:eaw_va_params.wc_ajax_url.toString().replace("%%endpoint%%","ccpeawGetProductVariation"),type:"POST",data:{product_id:o,eaw_nonce:eawAtcVars.nonce},beforeSend:function(){e.addClass("eaw-atc-btn-loading")},success:function(t){if("error"===t.status)return e.attr("href")?location.href=e.attr("href"):e.closest("a").length?e.closest("a").trigger("click"):e.closest(".eaw-sidebar-cart-footer-pd").find("a").eq(0).trigger("click"),!1;a(document.body).prepend(t.html),a(".eaw-va-cart-swatches:not(.eaw-va-cart-swatches-init)").each(function(){a(this).addClass("eaw-va-cart-swatches-init eaw_variation_form").eaw_get_variations(eaw_va_params),a(this).find(".babystreet-wcs-swatches").length&&a(this).babystreet_wcs_variation_swatches_form()}),a(document.body).trigger("eaw_variation_form")},complete:function(){e.removeClass("eaw-atc-btn-loading")}})})})})();