function registerPricingPanelToggler() {
  const checkbox = document.querySelector(
    `input[type="checkbox"][id$="id_free"]`
  );
  const specificPricingPanel = document.querySelector(
    `div#specific_pricing_panel`
  );

  function onChange() {
    specificPricingPanel.style.display = checkbox.checked ? "none" : "block";
  }

  if (checkbox && specificPricingPanel) {
    checkbox.addEventListener("change", () => onChange());
    onChange();
  }
}

document.addEventListener("DOMContentLoaded", () => {
  registerPricingPanelToggler();
});
