<?php
/**
 * Scripts.
 *
 * @package MadeByAura\Prime\Hooks
 * @author  MadeByAura.com
 */

namespace MadeByAura\Prime\Hooks;

use MadeByAura\Prime\Helpers\SingletonTrait;
use MadeByAura\Prime\Helpers\Vite;

defined( 'ABSPATH' ) || die();

/**
 * Scripts.
 */
class Scripts {
	use SingletonTrait;

	/**
	 * Constructor.
	 */
	protected function __construct() {
		// Enqueue main scripts.
		add_action( 'wp_enqueue_scripts', [ __CLASS__, 'enqueue_main_scripts' ], 200 );

		// Change type attribute.
		add_action( 'script_loader_tag', [ '\MadeByAura\Prime\Helpers\Vite', 'script_change_type_attr' ], 10, 3 );
	}

	/**
	 * Enqueue main scripts.
	 */
	public static function enqueue_main_scripts() {
		Vite::enqueue_scripts( 'main' );
	}
}
