jQuery(document).ready((function(t){"undefined"!=typeof wc_add_to_cart_params&&t("body").on("submit","form.cart",(function(a){const r=t(this).parents(".type-product");if(!r||!r.is(".product-type-simple, .product-type-variable"))return;const d=t(this),o=d.find(".single_add_to_cart_button"),n=d.find('input[name="variation_id"]').val()||o.val()||0,e=d.find('input[name="quantity"]').val();if(!o||!n||!e)return;a.preventDefault();const _={product_id:n,quantity:e};if(o.addClass("loading"),!1===t(document.body).triggerHandler("should_send_ajax_request.adding_to_cart",[o]))return t(document.body).trigger("ajax_request_not_sent.adding_to_cart",[!1,!1,o]),!0;t(document.body).trigger("adding_to_cart",[o,_]),t.ajax({url:wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),data:_,method:"POST",success:function(a){a&&(a.error&&a.product_url?window.location=a.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?(o.removeClass("loading"),t(document.body).trigger("added_to_cart",[a.fragments,a.cart_hash,o])):window.location=wc_add_to_cart_params.cart_url)}})}))}));