(function ($) {
  "use strict";

  $(function () {
    $("#polanger-shield-select-all").on("change", function () {
      var checked = $(this).is(":checked");
      $('input[name="rule_ids[]"]').prop("checked", checked);
    });

    var focusedRow = $(".polanger-shield-row-focus").first();
    if (focusedRow.length) {
      focusedRow[0].scrollIntoView({ behavior: "smooth", block: "center" });
    }
  });
})(jQuery);
