jQuery(function($) {

     const items = [
        '.affiliate_applied_admin_enable',
        '.request_payout_admin_enable',
        '.add_credit_admin_enable',
        '.affiliate_applied_enable',
        '.affiliate_approved_enable',
        '.account_reject_enable',
        '.request_payout_enable',
        '.add_credit_enable',
        '.payout_process_enable'
    ];

    // Hide and handle hover for the first group
    items.forEach(selector => {
        const spanSelector = 'span' + selector;
        $(spanSelector).hide();

        $(selector).hover(
            function () {
                const spanItems = items.map(sel => 'span' + sel);
                $(spanItems.join(',')).hide();
                $(spanSelector).show();
            },
            function () {
                $(spanSelector).hide();
            }
        );
    });

    // Tooltip-style hover handlers
    const hoverPairs = [
        { trigger: '.affiliate_commission_base_icon', target: '.affiliate_commission_based_enable' },
        { trigger: '.commission_rate_icon', target: '.commission_rate_enable' },
        { trigger: '.cookie_expiry_icon', target: '.cookie_expiry_enable' }
    ];

    hoverPairs.forEach(pair => {
        $(pair.target).hide();

        $(pair.trigger).hover(
            function () {
                $(pair.target).show();
            },
            function () {
                $(pair.target).hide();
            }
        );
    });    
  
});
