(function($) {
    function resetColorsToDefault() {
        // Define default values for your color settings
        const defaultColors = {
            'background_color': '#ffffff',
            'air_conditioning_services_primary_color': '#DF6160',
            'air_conditioning_services_primary_light': '#ffeaea',
            'air_conditioning_services_secondary_color': '#5999d9',
            'air_conditioning_services_heading_color': '#000',
            'air_conditioning_services_text_color' :'#000',
            'air_conditioning_services_slider_bg_color': '#F6F6F6',
            'air_conditioning_services_footer_bg': '#000',
            'air_conditioning_services_post_bg': '#ffffff',
        };

        // Iterate over each setting and set it to its default value
        for (let settingId in defaultColors) {
            wp.customize(settingId).set(defaultColors[settingId]);
        }

        // Optionally refresh the preview
        wp.customize.previewer.refresh();
    }

    // Attach reset function to global scope
    window.resetColorsToDefault = resetColorsToDefault;

    $(document).ready(function() {
        $('.color-reset-btn').val('RESET'); // This adds the 'RESET' text inside the button
    });
})(jQuery);