<?php

add_action('wp_enqueue_scripts', function () {

    wp_deregister_script('jquery-core');
    wp_deregister_script('jquery-migrate');
    wp_deregister_style('wp-block-library');
    // wp_deregister_style('dashicons');

    wp_enqueue_style('style', get_template_directory_uri() . '/assets/css/support.css', false, _S_VERSION,'all');
    wp_enqueue_style( 'style');

    // wp_enqueue_script('newsletter-ajax-script', get_template_directory_uri() . '/js/newsletter-ajax.js', array('jquery'), null, true);
    wp_localize_script('newsletter-ajax-script', 'ajaxurl', admin_url('admin-ajax.php'));

    // Enqueue the intl-tel-input CSS
    // wp_enqueue_style('intl-tel-input-css', get_template_directory_uri() . '/assets/css/intlTelInput.css');

    // Enqueue the intl-tel-input JS
    // wp_enqueue_script('intl-tel-input-js', get_template_directory_uri() . '/assets/js/intlTelInput.min.js', array('jquery'), null, true);

	
    // Enqueue the utils script for intl-tel-input
    // wp_enqueue_script('intl-tel-input-utils-js', get_template_directory_uri() . '/assets/js/utils.js', array('intl-tel-input-js'), null, true);


    // Enqueue custom script to initialize intl-tel-input
    // wp_enqueue_script('custom-intl-tel-input', get_template_directory_uri() . '/js/custom-intl-tel-input.js', array('intl-tel-input-js'), null, true);

    // Add 'in_footer' => false, if need to load specific script in <head>
    $scripts = [
        [
            'handle'    => 'jQuery',
            'file'      => 'jquery-3.6.0.min.js',
        ],
        [
            'handle'    => 'popper',
            'file'      => 'popper.min.js',
        ],
        [
            'handle'    => 'bootstrap',
            'file'      => 'bootstrap.min.js',
        ],
        [
            'handle'    => 'gsap',
            'file'      => 'gsap-latest-beta.min.js',
        ],
        [
            'handle'    => 'ScrollTrigger',
            'file'      => 'ScrollTrigger.min.js',
        ],
        [
            'handle'    => 'owl-carousel',
            'file'      => 'owl.carousel.min.js',
        ],
        [
            'handle'    =>'app',
            'file'      => 'app.js',
            'deps'      => ['jQuery'],
        ],
        [
            'handle'    =>'custom',
            'file'      => 'custom.js',
            'deps'      => ['jQuery'],
            'version'   => _S_VERSION,
        ]
    ];

    foreach ($scripts as $script) {
        wp_enqueue_script(
            $script['handle'], get_template_directory_uri() . '/assets/js/' . $script['file'],
            (isset($script['deps']) ? $script['deps'] : []),
            (isset($script['version']) ? $script['version'] : false),
            ['in_footer' => (isset($script['in_footer']) ? $script['in_footer'] : true)] );
    }
});

function add_css()
{

}
// add_action('wp_enqueue_scripts', 'add_css');


function enqueue_ajax_newsletter_script() {

 }
//  add_action('wp_enqueue_scripts', 'enqueue_ajax_newsletter_script');

 
