<?php
namespace AcademyProDeviceLoginRestrictions;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Assets {
	public static function init() {
		add_action( 'login_enqueue_scripts', function() {
			wp_enqueue_script( 'academy_pro_device_login_restrictions', ACADEMY_PRO_PLUGIN_ROOT_URI . 'addons/device-login-restrictions/assets/script.js', array( 'jquery' ), wp_rand( 100, 1000 ), true );
			wp_localize_script(
				'academy_pro_device_login_restrictions',
				'academy_pro_device_login_restrictions',
				[
					'ajax_url' => admin_url( 'admin-ajax.php' ),
					'nonce'    => wp_create_nonce( 'academy_nonce' ),
				]
			);
		} );
	}
}
