(function ($) {
	'use strict';

	$(document).on('click', '.nova-autocare-notice-wrapper .notice-dismiss', function () {
		var $notice = $(this).closest('.nova-autocare-notice-wrapper');
		var noticeId = $notice.data('notice');

		$.ajax({
			type: 'POST',
			url: nova_autocare_localize.ajax_url,
			data: {
				action: 'nova_autocare_dismiss_admin_notice',
				notice: noticeId,
				nonce: nova_autocare_localize.nonce,
			},
			success: function () {
				$notice.fadeOut(300, function () {
					$(this).remove();
				});
			},
		});
	});

	$(document).on('click', '.quick-start-guide-dismiss', function () {
		var $guide = $(this).closest('.quick-start-guide');

		$.ajax({
			type: 'POST',
			url: nova_autocare_localize.ajax_url,
			data: {
				action: 'nova_autocare_dismiss_quick_start_guide',
				nonce: nova_autocare_localize.nonce,
			},
			success: function () {
				$guide.fadeOut(300, function () {
					$(this).remove();
				});
			},
		});
	});
})(jQuery);

