/**
 * WS Agree Terms | (c) 2025 whmcsservices.com
 * Created By WHMCSServices      http://www.whmcsservices.com
 * License: You must have a valid license purchased in order to legally use the module for your project.
 * Author - WHMCSServices
 */

$(document).ready(function () {
    
   
    
    if (template === 'lagom2') {
        
        if ($('#dpa_agreement-checkbox').find('.icheck-control').length > 0) {
            $('#dpa_agreement-checkbox').iCheck('disable');
        } else {
            $('#dpa_agreement-checkbox').prop('disabled', 'disabled');
        }
        $(document).on('click', '#dpa_iagreeterms', function(e) {
            if ($('#dpa_agreement-checkbox').find('.checkbox-styled').length > 0) {
                $('#dpa_agreement-checkbox').iCheck('enable');
                $('#dpa_agreement-checkbox').iCheck('check');
            } else {
                $('#dpa_agreement-checkbox').removeProp('disabled');
            }
        });
        
    } else {
    
    
        $('#dpa_agreement').prop('disabled', 'disabled');



        $('#dpa_iagreeterms').click(function (e) {
            $('#dpa_agreement').removeProp('disabled');

            if ($('#iCheck-dpa_agreement').length > 0) {
                $('#dpa_agreement').iCheck('enable');
                $('#dpa_agreement').iCheck('check');
            } else {
                $('#dpa_agreement').removeProp('disabled');
            }
        });
        
    }
    
    $('#read_dpa_policy').click(function (e) {
        e.preventDefault;
        $('#dpa_Modal').modal('show');
        return false;
    });    
        
});
