jQuery(document).ready(function ($) {
    // Register the filter
    elementor.hooks.addFilter('elementor_pro/forms/content_template/item', function (field, item, form) {
        // Check the field type and custom control setting
        if ((field.field_type == "radio" || field.field_type === "checkbox") && field['cr-style'] !== "cfkef-default") {
            // Initialize variables
            let size = '';
            let style = '';
            let styleColor = '';
            let styleDefaultColor = '';
            let customId = '';
            let uniqueId = '';
            let fieldType = '';
        
            style = field['cr-style'] ? field['cr-style'] : '';
            size = field['cr-style-size']['size'] ? field['cr-style-size']['size'] : '';
            styleColor = field['cr-style-color'] ? field['cr-style-color'] : '';
            styleDefaultColor = field['cr-style-default-color'] ? field['cr-style-default-color'] : '';
            customId = field['custom_id'] ? field['custom_id'] : '';
            uniqueId = field['_id'] ? field['_id'] : '';
            fieldType = field['field_type'] ? field['field_type'] : '';
            field.css_classes += 'editor_data_js';
            field.css_classes += ' ';
            field.css_classes += `cfefuniqueId_${uniqueId} cfefstyle_${style} cfefsize_${size} cfefstyleColor_${styleColor} cfefcustomId_${customId} cfeffieldType_${fieldType} cfefstyleDefaultColor_${styleDefaultColor}`;
        }
        return field;
    }, 10, 4);
  });
  
  