!function(t){t(document).ready((function(){var a;t("body").on("click",".woocommerce-mini-cart .dina-item-quantity-btn",(function(){var i=t(this);void 0!==a&&clearTimeout(a),a=setTimeout((function(){var a,o,e,c,r,m;a=i,n&&(n=!1,(o=a.closest(".woocommerce-mini-cart-item")).block({message:null}),e=o.find(".qty"),c=o.data("key"),m=parseInt(e.val()),r=parseInt(e.attr("min")),(a=parseInt(e.attr("max")))<m&&(m=a),(!m||m<r)&&(m=r),e.val(m),m={action:"dina_mini_qty_update",key:c,number:m,security:dina_mini_cart_ajax_object.nonce},t.post(dina_mini_cart_ajax_object.ajax_url,m,(function(a){a=JSON.parse(a),t(".dina-side-cart p.woocommerce-mini-cart__total.total .amount").html(a.total),o.find(".dina-quantity-count").html(a.item_count),n=!0,o.unblock(),t(".dina-cart-amount").html(a.count),t(document.body).trigger("wc_fragment_refresh")})))}),1e3)})),t("body").on("blur",".woocommerce-mini-cart input.qty",(function(){!function(a){n=!1;var i=a.closest(".woocommerce-mini-cart-item");i.block({message:null});var o=i.data("key"),e=parseInt(a.val()),c=parseInt(a.attr("min")),r=parseInt(a.attr("max")),m=parseInt(a.attr("step"));e%m!=0&&(e-=e%m),r<e&&(e=r),(!e||e<c)&&(e=c),a.val(e),e={action:"dina_mini_qty_update",key:o,number:e,security:dina_mini_cart_ajax_object.nonce},t.post(dina_mini_cart_ajax_object.ajax_url,e,(function(a){a=JSON.parse(a),t(".dina-side-cart  p.woocommerce-mini-cart__total.total .amount").html(a.total),i.find(".dina-quantity-count").html(a.item_count),n=!0,i.unblock(),t(".dina-cart-amount").html(a.count),t(document.body).trigger("wc_fragment_refresh")}))}(t(this))}));var n=!0}))}(jQuery);