jQuery(document).ready(function ($) {
  let DSPILOTPUBLIC = {
    updateDiscountTable: function (event, variation) {
      const variation_id = variation.variation_id;
      console.log(variation_id);
      
      if(variation_id) {
        $(".discountpilot-dynamic-pricing-table-container").hide();
        $("#discountpilot-dynamic-pricing-table-container-"+variation_id).show();
      }
    },
  };

  // event binding
  $(document).on(
    "found_variation",
    "form.variations_form",
    DSPILOTPUBLIC.updateDiscountTable
  );
});
