(function ($) {
  "use strict";

  function dismissNoticePermanently() {
    var data = window.polangerShieldNotice || {};
    if (!data.ajaxUrl || !data.nonce) {
      return;
    }

    $.post(data.ajaxUrl, {
      action: "polanger_shield_dismiss_notice",
      nonce: data.nonce
    });
  }

  $(function () {
    $(document).on("click", ".polanger-shield-config-notice .notice-dismiss", function () {
      dismissNoticePermanently();
    });
  });
})(jQuery);
