// DNS Shield ISP - interações do painel
// Desenvolvedor: Euquias Junior <junior@jbinfo.com.br>
(function () {
  "use strict";

  document.addEventListener("submit", function (event) {
    var form = event.target;
    var message = form.getAttribute("data-confirm");
    if (message && !window.confirm(message)) {
      event.preventDefault();
      return;
    }
    var button = form.querySelector('button[type="submit"]');
    if (button) {
      window.setTimeout(function () {
        button.disabled = true;
        button.textContent = "Processando...";
      }, 0);
    }
  });

  window.setTimeout(function () {
    document.querySelectorAll(".flash-success").forEach(function (el) {
      el.style.transition = "opacity .4s";
      el.style.opacity = "0";
      window.setTimeout(function () { el.remove(); }, 400);
    });
  }, 6000);
})();
