{"id":363,"date":"2026-03-19T12:21:52","date_gmt":"2026-03-19T11:21:52","guid":{"rendered":"https:\/\/tresgebackoffice.es\/work-with-us\/"},"modified":"2026-04-08T17:33:13","modified_gmt":"2026-04-08T15:33:13","slug":"work-with-us","status":"publish","type":"page","link":"https:\/\/tresgebackoffice.es\/en\/work-with-us\/","title":{"rendered":"Work with us"},"content":{"rendered":"<div class=\"et_pb_section_0 et_pb_section et_section_regular et_flex_section\">\n<div class=\"et_pb_row_0 et_pb_row et_flex_row\">\n<div class=\"et_pb_column_0 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone\">\n<div class=\"et_pb_text_0 et_pb_text et_pb_bg_layout_dark et_pb_module et_flex_module\"><div class=\"et_pb_text_inner\"><h1>Work with us<\/h1>\n<\/div><\/div>\n<\/div>\n<\/div>\n<\/div>\n\n<div class=\"et_pb_section_1 et_pb_section et_section_regular et_flex_section\">\n<div class=\"et_pb_row_1 et_pb_row et_flex_row\">\n<div class=\"et_pb_column_1 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone\">\n<div class=\"de_form_builder_form_0 de_form_builder_form de_fb_form et_pb_contact de_fb_mid_de-form-builderform-0 has-hide-until-loaded et_pb_module et_flex_module\"><form method=\"POST\" enctype=\"multipart\/form-data\" action=\"\" id=\"fb_form_363-1\" class=\"et_pb_contact fb_form   hide_until_loaded \"  data-ajax-btn=\"Submitting...\" data-ajax-hide-sub=\"off\" data-reset-form-on-submit=\"false\" data-scrollto-form-after-submit=\"on\" data-scrollto-form-offset=\"100\" data-form-key=\"363-1\" data-form-id=\"363-1\" data-form-type=\"contact\" data-auto-login=\"off\" data-unique-id=\"de-form-builder\/form-0\" data-page-id=\"363\" style=\"display: none;\"><div class=\"divi-form-wrapper\"><div class=\"dfb-form-fields et_flex_row\" style=\"flex-wrap:wrap;\">\n<div class=\"de_form_builder_form_field_0 de_form_builder_form_field de_fb_form_field clearfix et_pb_column_1_2 et_flex_column_12_24 et_pb_column grid_et_pb_column_1_2_12 et_flex_column_24_24_tablet et_flex_column_24_24_phone file_align_left et_pb_module et_flex_column_24_24\"><div class=\"et_pb_module_inner\">        <div id=\"de_fb_nombre_wrapper\" class=\"field_wrapper search_filter_cont\" data-count=\"50\" role=\"group\" >\n                                    <p class=\"et_pb_contact_field\" data-type=\"input\">\n                    <input type=\"hidden\" name=\"field_title[]\" value=\"Nombre y Apellidos\"\/><input type=\"hidden\" name=\"field_name[]\" value=\"de_fb_nombre\"\/><input type=\"hidden\" name=\"field_id[]\" value=\"de_fb_nombre\"\/>                    \t\t\n\n\t\t<input type=\"text\"  name=\"de_fb_nombre\" id=\"de_fb_nombre\" data-calc_default=\"0\" placeholder=\"Nombre y Apellidos *\"   class=\"divi-form-builder-field input-field \" required value=\"\"  data-msg-required=\"This field is required.\" data-required_position=\"bottom\" autocomplete=\"on\" aria-label=\"Nombre y Apellidos\" aria-required=\"true\" \/>\n\t\t                <\/p>\n                                <\/div>\n        <\/div><\/div>\n\n<div class=\"de_form_builder_form_field_1 de_form_builder_form_field de_fb_form_field clearfix et_pb_column_1_2 et_flex_column_12_24 et_pb_column grid_et_pb_column_1_2_12 et_flex_column_24_24_tablet et_flex_column_24_24_phone file_align_left et_pb_module et_flex_column_24_24\"><div class=\"et_pb_module_inner\">        <div id=\"de_fb_email_wrapper\" class=\"field_wrapper search_filter_cont\" data-count=\"50\" role=\"group\" >\n                                    <p class=\"et_pb_contact_field\" data-type=\"email\">\n                    <input type=\"hidden\" name=\"field_title[]\" value=\"Email\"\/><input type=\"hidden\" name=\"field_name[]\" value=\"de_fb_email\"\/><input type=\"hidden\" name=\"field_id[]\" value=\"de_fb_email\"\/>                    \t\t\n\n\t\t<input type=\"email\"  name=\"de_fb_email\" id=\"de_fb_email\"  placeholder=\"Email *\"   class=\"divi-form-builder-field input-field \" required value=\"\"  data-msg-required=\"This field is required.\" data-required_position=\"bottom\" data-msg-email=\"Please input correct email address.\" autocomplete=\"on\" aria-label=\"Email\" aria-required=\"true\" \/>\n\t\t                <\/p>\n                                <\/div>\n        <\/div><\/div>\n\n<div class=\"de_form_builder_form_field_2 de_form_builder_form_field de_fb_form_field clearfix et_pb_column_4_4 et_flex_column_24_24 et_pb_column grid_et_pb_column_4_4_12 et_flex_column_24_24_tablet et_flex_column_24_24_phone file_align_left et_pb_module\"><div class=\"et_pb_module_inner\">        <div id=\"de_fb_telefono_wrapper\" class=\"field_wrapper search_filter_cont\" data-count=\"100\" role=\"group\" >\n                                    <p class=\"et_pb_contact_field\" data-type=\"input\">\n                    <input type=\"hidden\" name=\"field_title[]\" value=\"Tel\u00e9fono\"\/><input type=\"hidden\" name=\"field_name[]\" value=\"de_fb_telefono\"\/><input type=\"hidden\" name=\"field_id[]\" value=\"de_fb_telefono\"\/>                    \t\t\n\n\t\t<input type=\"text\"  name=\"de_fb_telefono\" id=\"de_fb_telefono\" data-calc_default=\"0\" placeholder=\"Tel\u00e9fono *\"   class=\"divi-form-builder-field input-field \" required value=\"\"  data-msg-required=\"This field is required.\" data-required_position=\"bottom\" autocomplete=\"on\" aria-label=\"Tel\u00e9fono\" aria-required=\"true\" \/>\n\t\t                <\/p>\n                                <\/div>\n        <\/div><\/div>\n\n<div class=\"de_form_builder_form_field_3 de_form_builder_form_field de_fb_form_field clearfix et_pb_column_4_4 et_flex_column_24_24 et_pb_column grid_et_pb_column_4_4_12 et_flex_column_24_24_tablet et_flex_column_24_24_phone file_align_left et_pb_module\"><div class=\"et_pb_module_inner\">        <div id=\"de_fb_archivos_wrapper\" class=\"field_wrapper search_filter_cont\" data-count=\"100\" role=\"group\" >\n                                    <p class=\"et_pb_contact_field\" data-type=\"file\">\n                    <input type=\"hidden\" name=\"field_title[]\" value=\"Archivo CV\"\/><input type=\"hidden\" name=\"field_name[]\" value=\"de_fb_archivos\"\/><input type=\"hidden\" name=\"field_id[]\" value=\"de_fb_archivos\"\/>                    <span id=\"de_fb_archivos_fileupload\" class=\"dfb_file_upload_container required\"  data-required_message=\"This field is required.\" data-required_position=\"bottom\" data-single=\"off\">\n\t<span class=\"dropzone fade well upload_field file_upload_wrapper\" id=\"dropzone_de_fb_archivos\">\n\t\t<span id=\"de_fb_archivos_result\" class=\"image_upload_result\">\n\t\t\t<span class=\"upload_icon\">\n\n\t\t<svg id=\"file_upload\" enable-background=\"new 0 0 483.246 483.246\" viewBox=\"0 0 483.246 483.246\" width=\"0\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><g><g id=\"icon_68_\"><path class=\"primary\" d=\"m424.914 143.074v249.748c.008 1.697-.174 3.389-.542 5.045l-1.621 5.404c-4.026 9.237-13.167 15.189-23.243 15.134h-374.098c-11.723-.033-21.911-8.059-24.687-19.448-.516-2.003-.758-4.067-.719-6.135v-306.177c-.023-12.02 9.703-21.783 21.723-21.805h.083 111.249c7.769.027 14.952 4.133 18.918 10.814l26.308 45.591h224.995c12 .052 21.686 9.822 21.634 21.823z\" \/><path class=\"secondary\" d=\"m461.206 180.939c12.173.001 22.041 9.869 22.04 22.042 0 2.193-.328 4.373-.971 6.47l-57.915 188.416-1.621 5.404c-4.026 9.237-13.167 15.189-23.243 15.134h-374.086c-11.723-.033-21.911-8.059-24.687-19.448l60.701-202.33c2.801-9.306 11.368-15.68 21.086-15.688z\" \/><\/g><\/g><\/svg>\n\t\t\t<\/span>\n\t\t<\/span>\n\t\t<span class=\"upload_desc drop-description\">Por favor, adjunta tu CV y tu carta de presentaci\u00f3n (m\u00e1ximo 4 archivos)<\/span>\n\t\t\t\t<input name=\"file_de_fb_archivos[]\" id=\"de_fb_archivos\" type=\"file\" class=\"upload_field df-image divi-form-builder-field\" title=\"No file chosen\" aria-label=\"Archivo CV\" multiple\/>\n\t<\/span>\n\t\t<input name=\"de_fb_archivos\" type=\"hidden\" id=\"de_fb_archivos_value\" value=\"\"\/>\n\t<span class=\"file_preview_container files\"><\/span>\t\t          \t\n<\/span>\n\n\t<script id=\"template-upload-de_fb_archivos\" type=\"text\/x-tmpl\">\n      \t{% for (var i=0, file; file=o.files[i]; i++) { %}\n          \t<div class=\"file_upload_item template-upload fade{%=o.options.loadImageFileTypes.test(file.type)?' image':''%}\">\n\t\t\t\t<div class=\"file_upload_item_cont\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"preview_image_cont\">\n\t\t\t\t\t\t<span class=\"preview preview_image\"><\/span>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t<div class=\"preview_content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"name preview_name\">{%=file.name%}<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"upload_size size\">Processing...<\/span>\n\t\t\t\t\t\t\t\t\t\t\t\t<strong class=\"error text-danger\"><\/strong>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"progress progress-striped active\" role=\"progressbar\" aria-valuemin=\"0\" aria-valuemax=\"100\" aria-valuenow=\"0\"><span class=\"progress-bar progress-bar-success\" style=\"width:0%;\"><\/span><\/span>\n\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<button class=\"btn btn-primary start\" style=\"display:none;\"><\/button>\n\t\t\t\t\t<a class=\"btn btn-warning cancel remove_upload\">\n\t\t\t\t\t\t<i class=\"\"><\/i>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t<\/div>\n      {% } %}\n    <\/script>\n<script>\njQuery(document).ready(function($){\n\tfunction deFbAppendUploadIds_de_fb_archivos(newIds) {\n\t\tvar $input = jQuery('#de_fb_archivos_value');\n\t\tvar ids = $input.val() ? $input.val().split(',') : [];\n\t\tids = ids.map(function(id) { return String(id).trim(); }).filter(Boolean);\n\t\tjQuery.each(newIds, function(i, id) {\n\t\t\tid = String(id).trim();\n\t\t\tif (id && ids.indexOf(id) === -1) {\n\t\t\t\tids.push(id);\n\t\t\t}\n\t\t});\n\t\t$input.val(ids.join(','));\n\t}\n\n\tfunction deFbResetUploadBatchIfComplete_de_fb_archivos($uploadParent) {\n\t\tvar prevFilecnt = parseInt($uploadParent.attr('data-filecnt'), 10) || 0;\n\t\tvar prevUploaded = parseInt($uploadParent.attr('data-uploadedcnt'), 10) || 0;\n\t\tvar prevFailed = parseInt($uploadParent.attr('data-uploadfailcnt'), 10) || 0;\n\t\tif (prevFilecnt > 0 && (prevUploaded + prevFailed) >= prevFilecnt) {\n\t\t\t$uploadParent.attr('data-filecnt', 0);\n\t\t\t$uploadParent.attr('data-uploadedcnt', 0);\n\t\t\t$uploadParent.attr('data-uploadfailcnt', 0);\n\t\t}\n\t}\n\n\tfunction deFbFinalizeUploadBatch_de_fb_archivos($fileuploadSpan) {\n\t\tvar $parent = $fileuploadSpan.parent();\n\t\tvar filecnt = parseInt($parent.attr('data-filecnt'), 10) || 0;\n\t\tvar uploadedcnt = parseInt($parent.attr('data-uploadedcnt'), 10) || 0;\n\t\tvar failcnt = parseInt($parent.attr('data-uploadfailcnt'), 10) || 0;\n\n\t\tif ((uploadedcnt + failcnt) < filecnt) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar $form = $fileuploadSpan.closest('form');\n\t\t$form.removeClass('submitting');\n\n\t\tif (failcnt > 0) {\n\t\t\t$parent.attr('data-uploaded', 'false');\n\t\t\t$form.find('.divi-form-submit').prop('disabled', false).removeAttr('disabled');\n\t\t\treturn;\n\t\t}\n\n\t\t$parent.attr('data-uploaded', 'true');\n\n\t\tvar all_uploaded = true;\n\t\t$form.find('.et_pb_contact_field[data-type=\"image\"], .et_pb_contact_field[data-type=\"file\"]').each(function(){\n\t\t\tif (jQuery(this).attr('data-uploaded') == \"false\"){\n\t\t\t\tall_uploaded = false;\n\t\t\t}\n\t\t});\n\n\t\tif (all_uploaded == true){\n\t\t\tif ($form.find('.divi-form-submit').hasClass('de_fb_ajax_submit')) {\n\t\t\t\tde_fb_ajax_form_submit($form[0]);\n\t\t\t} else {\n\t\t\t\tde_fb_submit_with_fresh_nonce($form[0]);\n\t\t\t}\n\t\t}\n\t}\n\n\tjQuery('#de_fb_archivos_fileupload').fileupload({\n        url: 'https:\/\/tresgebackoffice.es\/wp-admin\/admin-ajax.php',\n        dataType: 'json',\n        dropZone: jQuery('#dropzone_de_fb_archivos'),\n        autoUpload: false,\n        acceptFileTypes: \/(\\.|\\\/)(pdf|docx|doc)$\/i,\n        maxFileSize: 10485760,\n        disableImageResize: \/Android(?!.*Chrome)|Opera\/\n            .test(window.navigator.userAgent),\n        previewMaxWidth: 100,\n        previewMaxHeight: 100,\n\t\timageMaxWidth: null,\n\t\timageMaxHeight: null,\n        sequentialUploads: true,\n        singleFileUploads:true,\n        previewCanvas: false,\t\n\t\tmaxNumberOfFiles:2,\t\tloadImageFileTypes: \/^image\\\/(gif|jpeg|png|webp)$\/,\n        uploadTemplateId: 'template-upload-de_fb_archivos',\n        downloadTemplateId:'',\n        done: function(e, data) {\n        \t\/\/ Keep upload previews visible; an empty download template would remove them.\n        \tvar files = (data.result && data.result.files) ? data.result.files : [];\n        \tif (data.context) {\n        \t\tdata.context.each(function(index) {\n        \t\t\tvar $row = jQuery(this);\n        \t\t\tvar file = files[index] || {};\n        \t\t\t$row.removeClass('processing');\n        \t\t\t$row.find('.progress').removeClass('active');\n        \t\t\tif (file.error) {\n        \t\t\t\t$row.addClass('error');\n        \t\t\t\t$row.find('.error.text-danger').text(file.error);\n        \t\t\t} else {\n        \t\t\t\t$row.addClass('upload-complete');\n        \t\t\t}\n        \t\t});\n        \t}\n        },\n        messages: {\n\t        maxNumberOfFiles: \"Maximum number of files exceeded.\",\n\t        acceptFileTypes: \"The file uploaded is not one of our accepted file types, please another version.\",\n\t        maxFileSize: \"The file uploaded exceeds the maximum file size allowed, please upload a smaller version.\",\n\t        minFileSize: \"File is too small\"\t    },\n        previewCrop: true,\n        formData: {'action':'de_fb_image_upload', 'fb_nonce': de_fb_obj.fb_nonce, 'uploadPolicy': 'eyJleHQiOiJwZGZ8ZG9jeHxkb2MiLCJtYXgiOjEwNDg1NzYwLCJleHAiOjE3ODY3MTYzMjF9.ce52ae7970c8fedf282827dbe2d45c50485934c38a763beb220608d5a6037802' },\n    }).on('fileuploadadd', function (e, data) {\n\t\tvar field_type = jQuery(this).closest('.et_pb_contact_field').data('type');\n\t\tvar $fileuploadSpan = jQuery(this);\n\n\t\tvar allowedMimeTypes = ['image\/jpeg', 'image\/png', 'image\/gif', 'image\/webp'];\n\t\tvar allowedExtensions = ['jpg', 'jpeg', 'png', 'gif', 'webp'];\n\t\tvar file = data.files[0];\n\t\tvar fileExtension = file.name.split('.').pop().toLowerCase();\n\n\t\t\/\/ Block dangerous double extensions (e.g. image.jpg.php), not dots in the base name (e.g. receipt.18.05.pdf).\n\t\tif (field_type == 'image' || field_type == 'file') {\n\t\t\tvar deFbDangerousExtensions = ['php','php3','php4','php5','php7','php8','phtml','phar','cgi','pl','asp','aspx','jsp','exe','sh','bash','htaccess'];\n\t\t\tvar deFbBaseName = file.name.split(\/[\/\\\\]\/).pop().toLowerCase();\n\t\t\tvar deFbLastDot = deFbBaseName.lastIndexOf('.');\n\t\t\tvar deFbHasDangerousDoubleExt = false;\n\t\t\tif (deFbLastDot !== -1) {\n\t\t\t\tvar deFbFinalExt = deFbBaseName.substring(deFbLastDot + 1);\n\t\t\t\tif (deFbDangerousExtensions.indexOf(deFbFinalExt) !== -1) {\n\t\t\t\t\tdeFbHasDangerousDoubleExt = true;\n\t\t\t\t} else {\n\t\t\t\t\tvar deFbDoubleExtPattern = new RegExp('\\\\.([a-z0-9]{1,8})\\\\.(' + deFbDangerousExtensions.join('|') + ')$', 'i');\n\t\t\t\t\tdeFbHasDangerousDoubleExt = deFbDoubleExtPattern.test(deFbBaseName);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (deFbHasDangerousDoubleExt) {\n\t\t\t\t\/\/ Reject the file and show error\n\t\t\t\tvar doubleExtMsg = \"File with double extension is not allowed for security reasons.\";\n\t\t\t\tfile.error = doubleExtMsg;\n\t\t\t\t\/\/ Prevent the file from being processed\n\t\t\t\tdata.files = [];\n\t\t\t\t\/\/ Show error message in the UI\n\t\t\t\tvar $fieldWrapper = jQuery(this).closest('.field_wrapper');\n\t\t\t\t$fieldWrapper.find('.upload-error').remove();\n\t\t\t\t$fieldWrapper.find('.dropzone').after('<div class=\"upload-error\" style=\"font-weight: bold; color: #dc3232; padding: 10px; margin-top: 10px;\">' + jQuery('<span\/>').text(doubleExtMsg).html() + '<\/div>');\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t$fieldWrapper.find('.upload-error').fadeOut(function() {\n\t\t\t\t\t\tjQuery(this).remove();\n\t\t\t\t\t});\n\t\t\t\t}, 4000);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif(field_type == 'image' || (field_type === 'file' && allowedExtensions.includes(fileExtension))){\n\t\t\t$(this).closest('.field_wrapper').find('.upload-error').remove();\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onloadend = function () {\n\t\t\t\tvar arr = (new Uint8Array(reader.result)).subarray(0, 4);\n\t\t\t\tvar header = \"\";\n\t\t\t\tfor (var i = 0; i < arr.length; i++) {\n\t\t\t\t\theader += arr[i].toString(16);\n\t\t\t\t}\n\n\t\t\t\tvar realMime = \"unknown\";\n\t\t\t\tswitch (header) {\n\t\t\t\t\tcase \"89504e47\": realMime = \"image\/png\"; break;\n\t\t\t\t\tcase \"ffd8ffe0\":\n\t\t\t\t\tcase \"ffd8ffe1\":\n\t\t\t\t\tcase \"ffd8ffe2\":\n\t\t\t\t\tcase \"ffd8ffe3\":\n\t\t\t\t\tcase \"ffd8ffe8\": realMime = \"image\/jpeg\"; break;\n\t\t\t\t\tcase \"47494638\": realMime = \"image\/gif\"; break;\n\t\t\t\t\tcase \"52494646\": realMime = \"image\/webp\"; break;\n\t\t\t\t\tdefault: realMime = \"invalid\"; break;\n\t\t\t\t}\n\n\t\t\t\tif (!allowedMimeTypes.includes(realMime)) {\n\t\t\t\t\tdata.files[0] = [];\n\t\t\t\t\treturn false; \n\t\t\t\t}\n\t\t\t};\n\t\t\treader.readAsArrayBuffer(file.slice(0, 4));\n\t\t}\n\n    \tjQuery(this).parent().attr('data-uploaded', 'false');\n    \tvar $uploadParent = jQuery(this).parent();\n    \tdeFbResetUploadBatchIfComplete_de_fb_archivos($uploadParent);\n    \tvar current_cnt = $uploadParent.attr('data-filecnt');\n    \tif (typeof current_cnt == 'undefined') {\n    \t\tcurrent_cnt = 1;\n    \t} else {\n    \t\tcurrent_cnt = parseInt(current_cnt) + 1;\n    \t}\n    \t$uploadParent.attr('data-filecnt', current_cnt);\n\n    \tvar _target = jQuery(e.target);\n    \tlet form_obj = _target.closest('.de_fb_form');\n    \tif (form_obj.find('form').hasClass('disable_submit_for_required')) {\n    \t\tlet required_fields= form_obj.find('.required');\n\t        let required_check = true;\n\t        let submit_btn = form_obj.find('.divi-form-submit');\n\t        if(required_fields.length > 0){\n\t            jQuery.each(required_fields,function (index,required_field){\n\t                if (!$(this).closest('.de_fb_form_field').hasClass('condition-hide')) {\n\t                    var field_type = jQuery(this).closest('.et_pb_contact_field').data('type');\n\t                    if ((field_type == 'checkbox' || field_type == 'radio') &&  jQuery(this).find('input:checked').length == 0) {\n\t                        required_check = false;\n\t                    }\n\n\t                    if ((field_type == 'file' || field_type == 'image') && ((typeof jQuery(this).parent().attr('data-filecnt') == 'undefined') || jQuery(this).parent().attr('data-filecnt') == \"0\" || jQuery(this).parent().attr('data-filecnt') == \"\")) {\n\t                        required_check = false;\n\t                    }\n\t                }\n\t            });\n\t        }\n\t        let form_el = form_obj.find('form');\n\t        let hide_submit = form_el.hasClass('hide_submit_for_required');\n\t        if (hide_submit) {\n\t            if (required_check == true) {\n\t                form_el.addClass('required-fields-complete');\n\t            } else {\n\t                form_el.removeClass('required-fields-complete');\n\t            }\n\t        } else if (required_check == true) {\n\t            submit_btn.removeAttr('disabled');\n\t        } else {\n\t            submit_btn.attr('disabled', true);\n\t        }\n    \t}\n\n\t\t\/\/ Clear required validation error when a valid file is selected (error disappears immediately).\n\t\tvar $contactField = $fileuploadSpan.closest('.et_pb_contact_field');\n\t\t$contactField.siblings('.error').each(function() {\n\t\t\tvar errId = jQuery(this).attr('id');\n\t\t\tif (errId) { $fileuploadSpan.closest('.et_pb_contact_field').parent().find('[aria-describedby=\"' + errId + '\"]').removeAttr('aria-describedby'); }\n\t\t});\n\t\t$contactField.siblings('.error').remove();\n\t\t$fileuploadSpan.removeAttr('aria-describedby');\n\n    \tjQuery(window).trigger('resize');\n\t\n\t\tif (typeof setFormHeight == 'function') {\n\t\t\tsetFormHeight();\n\t\t}\n\n\t}).on('fileuploaddone', function (e, data) {\n\t\n\tif (typeof setFormHeight == 'function') {\n\t\tsetFormHeight();\n\t}\n\n    \tvar $fileuploadSpan = jQuery(this);\n    \tvar $parent = $fileuploadSpan.parent();\n    \tvar $fieldWrapper = $fileuploadSpan.closest('.field_wrapper');\n    \tvar uploadHasError = false;\n    \tvar uploadErrorMessage = '';\n    \tif (!data.result || !data.result.files || !data.result.files.length) {\n    \t\tuploadHasError = true;\n    \t\tuploadErrorMessage = \"The file uploaded is not one of our accepted file types, please another version.\";\n    \t} else {\n    \t\tjQuery.each(data.result.files, function(inx, file) {\n    \t\t\tif (file && file.error) {\n    \t\t\t\tuploadHasError = true;\n    \t\t\t\tuploadErrorMessage = file.error;\n    \t\t\t}\n    \t\t});\n    \t}\n\n    \tif (uploadHasError) {\n    \t\tvar failcnt = parseInt($parent.attr('data-uploadfailcnt'), 10) || 0;\n    \t\t$parent.attr('data-uploadfailcnt', failcnt + 1);\n    \t\t$parent.attr('data-uploaded', 'false');\n    \t\tif (data.context) {\n    \t\t\tjQuery(data.context).addClass('error');\n    \t\t\tjQuery(data.context).find('.error.text-danger').text(uploadErrorMessage);\n    \t\t}\n    \t\t$fieldWrapper.find('.upload-error').remove();\n    \t\t$fieldWrapper.find('.dropzone').after('<div class=\"upload-error\" style=\"font-weight: bold; color: #dc3232; padding: 10px; margin-top: 10px;\">' + jQuery('<span\/>').text(uploadErrorMessage).html() + '<\/div>');\n    \t\tdeFbFinalizeUploadBatch_de_fb_archivos($fileuploadSpan);\n    \t\tjQuery(window).trigger('resize');\n    \t\treturn;\n    \t}\n\n    \tvar uploaded_cnt = parseInt($parent.attr('data-uploadedcnt'), 10) || 0;\n    \tuploaded_cnt += 1;\n    \t$parent.attr('data-uploadedcnt', uploaded_cnt);\n\n    \tvar inserted_elem = jQuery(data.context);\n    \tvar inserted_num = inserted_elem.find('canvas').attr('data-insertnum');\n    \tif (jQuery(this).closest('.field_wrapper').find('.existing_image_preview').length > 0) {\n    \t\tjQuery(this).closest('.field_wrapper').find('.inserted_' + inserted_num).attr('data-id', data.result.files[0].attachment_id);\n    \t}\n    \tif (data.result && data.result.files && data.result.files[0] && data.result.files[0].uploadRemovalToken) {\n    \t\tjQuery(this).attr('data-upload-removal-token', data.result.files[0].uploadRemovalToken);\n    \t}\n\n    \tvar file_ids = [];\n    \tjQuery.each(data.result.files, function(inx, file) {\n    \t\tvar attId = '';\n    \t\tif (file) {\n    \t\t\tattId = (file.attachment_id != null ? file.attachment_id :\n    \t\t\t\t(file.attachmentId != null ? file.attachmentId :\n    \t\t\t\t(file.attachmentID != null ? file.attachmentID :\n    \t\t\t\t(file.id != null ? file.id :\n    \t\t\t\t(file.file_id != null ? file.file_id :\n    \t\t\t\t(file.media_id != null ? file.media_id : ''))))));\n    \t\t}\n    \t\tif (attId !== '' && attId !== null && typeof attId !== 'undefined') {\n    \t\t\tfile_ids.push(attId);\n    \t\t}\n    \t});\n\n    \t\/\/ Clear the native file input so AJAX submit does not re-post the binary file.\n    \t$fileuploadSpan.find( 'input[type=\"file\"]' ).val( '' );\n\n    \tif (jQuery(this).attr('data-single') == 'on') {\n    \t\tdeFbAppendUploadIds_de_fb_archivos(file_ids);\n    \t} else if (file_ids.length > 0) {\n    \t\tdeFbAppendUploadIds_de_fb_archivos(file_ids);\n\n\t    \tif (jQuery(this).closest('.field_wrapper').find('.existing_image_preview').length > 0) {\n\t    \t\tvar current_file_ids = [];\n\t    \t\tjQuery(this).closest('.field_wrapper').find('.existing_image_preview a.existing_image_preview_link').each(function(){\n\t    \t\t\tcurrent_file_ids.push(jQuery(this).attr('data-id'));\n\t    \t\t});\n\t    \t\tif (current_file_ids.length > 0) {\n\t    \t\t\tjQuery('#de_fb_archivos_value').val(current_file_ids.join(','));\n\t    \t\t}\n\t    \t}\n    \t}\n\n        jQuery('#de_fb_archivos_value').trigger('change');\n        if (typeof window.handle_fb_conditional_fields === 'function') {\n            window.handle_fb_conditional_fields();\n        }\n\n\t\tvar $contactFieldDone = $fileuploadSpan.closest('.et_pb_contact_field');\n\t\t$contactFieldDone.siblings('.error').each(function() {\n\t\t\tvar errId = jQuery(this).attr('id');\n\t\t\tif (errId) { $fileuploadSpan.closest('.et_pb_contact_field').parent().find('[aria-describedby=\"' + errId + '\"]').removeAttr('aria-describedby'); }\n\t\t});\n\t\t$contactFieldDone.siblings('.error').remove();\n\t\t$fileuploadSpan.removeAttr('aria-describedby');\n\n    \tdeFbFinalizeUploadBatch_de_fb_archivos($fileuploadSpan);\n    \tjQuery(window).trigger('resize');\n\t\t\n    }).on('fileuploadprocessfail', function(e, data) {\n\n    \tvar _target = jQuery(e.target);\n\t\tlet form_obj = _target.closest('.de_fb_form');\n    \tif (data.files.error == true) {\n    \t\tvar error_elem = _target.find('.template-upload.processing');\n    \t\terror_elem.addClass('error');\n    \t\t\n    \t\t\/\/ Display the error message from the file object\n    \t\tif (data.files && data.files.length > 0) {\n    \t\t\t\/\/ Find the file with an error\n    \t\t\tfor (var i = 0; i < data.files.length; i++) {\n    \t\t\t\tif (data.files[i].error) {\n    \t\t\t\t\tvar error_msg_elem = error_elem.find('.error.text-danger');\n    \t\t\t\t\tif (error_msg_elem.length > 0) {\n    \t\t\t\t\t\terror_msg_elem.text(data.files[i].error);\n    \t\t\t\t\t}\n    \t\t\t\t\tbreak;\n    \t\t\t\t}\n    \t\t\t}\n    \t\t}\n    \t\t\n    \t\tjQuery(this).parent().attr('data-uploaded', 'false');\n\t    \tvar current_cnt = jQuery(this).parent().attr('data-filecnt');\n\t    \tcurrent_cnt = parseInt(current_cnt) - 1;\n\t    \tjQuery(this).parent().attr('data-filecnt', current_cnt);\n    \t\tsetTimeout(function() {\n    \t\t\terror_elem.remove();\n    \t\t\tif (_target.find('.files  .template-upload').length == 0) {\n    \t\t\t\t_target.closest('.et_pb_contact_field').removeAttr('data-uploaded');\n    \t\t\t\t\/\/ Re-show required error when last file is removed due to process failure.\n    \t\t\t\tvar $fileupload = _target;\n    \t\t\t\tif ($fileupload.hasClass('required')) {\n    \t\t\t\t\tvar $contactField = $fileupload.closest('.et_pb_contact_field');\n    \t\t\t\t\tvar valueVal = jQuery('#de_fb_archivos_value').val();\n    \t\t\t\t\tif (!valueVal || valueVal === '') {\n    \t\t\t\t\t\tvar required_message = $fileupload.attr('data-required_message') || 'This field is required.';\n    \t\t\t\t\t\tvar required_message_pos = $fileupload.attr('data-required_position') || 'bottom';\n    \t\t\t\t\t\tvar inputId = $fileupload.attr('id');\n    \t\t\t\t\t\tvar errorId = inputId ? inputId + '_error' : null;\n    \t\t\t\t\t\tvar errorAttrs = errorId ? ' id=\"' + errorId + '\" role=\"alert\" aria-live=\"polite\"' : '';\n    \t\t\t\t\t\tif (errorId) { $fileupload.attr('aria-describedby', errorId); }\n    \t\t\t\t\t\tif (required_message_pos === 'top') {\n    \t\t\t\t\t\t\t$contactField.before('<p class=\"error\"' + errorAttrs + '>' + required_message + '<\/p>');\n    \t\t\t\t\t\t} else {\n    \t\t\t\t\t\t\t$contactField.after('<p class=\"error\"' + errorAttrs + '>' + required_message + '<\/p>');\n    \t\t\t\t\t\t}\n    \t\t\t\t\t}\n    \t\t\t\t}\n    \t\t\t}\n    \t\t}, 4000);\n\n\t\t\tif (form_obj.find('form').hasClass('disable_submit_for_required')) {\n\t\t\t\tlet required_fields = form_obj.find('.required');\n\t\t\t\tlet required_check = true;\n\t\t\t\tlet submit_btn = form_obj.find('.divi-form-submit');\n\t\t\t\tif (required_fields.length > 0) {\n\t\t\t\t\tjQuery.each(required_fields, function(index, required_field) {\n\t\t\t\t\t\tif (!$(this).closest('.de_fb_form_field').hasClass('condition-hide')) {\n\t\t\t\t\t\t\tvar field_type = jQuery(this).closest('.et_pb_contact_field').data('type');\n\t\t\t\t\t\t\tif ((field_type == 'checkbox' || field_type == 'radio') && jQuery(this).find('input:checked').length == 0) {\n\t\t\t\t\t\t\t\trequired_check = false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ((field_type == 'file' || field_type == 'image') && ((typeof jQuery(this).parent().attr('data-filecnt') == 'undefined') || jQuery(this).parent().attr('data-filecnt') == \"0\" || jQuery(this).parent().attr('data-filecnt') == \"\")) {\n\t\t\t\t\t\t\t\trequired_check = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tlet form_el = form_obj.find('form');\n\t\t\t\tlet hide_submit = form_el.hasClass('hide_submit_for_required');\n\t\t\t\tif (hide_submit) {\n\t\t\t\t\tif (required_check == true) {\n\t\t\t\t\t\tform_el.addClass('required-fields-complete');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tform_el.removeClass('required-fields-complete');\n\t\t\t\t\t}\n\t\t\t\t} else if (required_check == true) {\n\t\t\t\t\tsubmit_btn.removeAttr('disabled');\n\t\t\t\t} else {\n\t\t\t\t\tsubmit_btn.attr('disabled', true);\n\t\t\t\t}\n\t\t\t}\n    \t}\n    \t\n    \tjQuery(window).trigger('resize');\n    }).on('fileuploadfail', function(e, data){\n    \tvar _target = jQuery(e.target);\n    \tvar _clicked_elem = jQuery(data.context);\n    \tlet form_obj = _target.closest('.de_fb_form');\n    \tvar current_cnt = jQuery(this).parent().attr('data-filecnt');\n    \tcurrent_cnt = parseInt(current_cnt) - 1;\n    \tjQuery(this).parent().attr('data-filecnt', current_cnt);\n\n    \tif (jQuery(this).closest('.field_wrapper').find('.existing_image_preview').length > 0) {\n    \t\tvar insertedNum = _clicked_elem.find('canvas').attr('data-insertnum');\n    \t\tif (jQuery(this).attr('data-single') == 'on') {\n    \t\t\tjQuery(this).closest('.field_wrapper').find('.image-preview-cont img').each(function(){\n    \t\t\t\tjQuery(this).attr('src', jQuery(this).attr('data-src'));\n    \t\t\t});\n\t    \t} else {\n\t    \t\tjQuery(this).closest('.field_wrapper').find('.existing_image_preview a.inserted_' + insertedNum).remove();\n\t    \t}\n    \t}\n\n    \tif (form_obj.find('form').hasClass('disable_submit_for_required')) {\n    \t\tlet required_fields= form_obj.find('.required');\n\t        let required_check = true;\n\t        let submit_btn = form_obj.find('.divi-form-submit');\n\t        if(required_fields.length > 0){\n\t            jQuery.each(required_fields,function (index,required_field){\n\t                if (!$(this).closest('.de_fb_form_field').hasClass('condition-hide')) {\n\t                    var field_type = jQuery(this).closest('.et_pb_contact_field').data('type');\n\t                    if ((field_type == 'checkbox' || field_type == 'radio') &&  jQuery(this).find('input:checked').length == 0) {\n\t                        required_check = false;\n\t                    }\n\n\t                    if ((field_type == 'file' || field_type == 'image') && ((typeof jQuery(this).parent().attr('data-filecnt') == 'undefined') || jQuery(this).parent().attr('data-filecnt') == \"0\" || jQuery(this).parent().attr('data-filecnt') == \"\")) {\n\t                        required_check = false;\n\t                    }\n\t                }\n\t            });\n\t        }\n\t        let form_el = form_obj.find('form');\n\t        let hide_submit = form_el.hasClass('hide_submit_for_required');\n\t        if (hide_submit) {\n\t            if (required_check == true) {\n\t                form_el.addClass('required-fields-complete');\n\t            } else {\n\t                form_el.removeClass('required-fields-complete');\n\t            }\n\t        } else if (required_check == true) {\n\t            submit_btn.removeAttr('disabled');\n\t        } else {\n\t            submit_btn.attr('disabled', true);\n\t        }\n    \t}\n\n    \tjQuery(window).trigger('resize');\n    }).on('fileuploadprocessalways', function(e, data) {\n    \tvar _this = jQuery(this);\n    \tvar field_type = jQuery(this).closest('.et_pb_contact_field').data('type');\n    \tvar preview_image_width = '100px';\n    \tvar preview_image_height = '100px';\n    \t\/\/ var preview_bg_color = '';\n    \t\n    \t\/\/ Create file extension preview for file fields when file is not an image\n    \tif (field_type === 'file' && data.files && data.files.length > 0) {\n    \t\tjQuery.each(data.files, function(ind, file) {\n    \t\t\t\/\/ Check if this is not an image file\n    \t\t\tvar isImage = \/^image\\\/(gif|jpeg|png|jpg|webp|bmp|svg)\/i.test(file.type);\n    \t\t\tif (!isImage && !file.preview) {\n    \t\t\t\t\/\/ Function to create preview image\n    \t\t\t\tvar createFilePreview = function($previewImage) {\n    \t\t\t\t\tif (!$previewImage || $previewImage.length === 0) return;\n    \t\t\t\t\tif ($previewImage.find('img, canvas').length > 0 || !$previewImage.is('span')) return;\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Get file extension\n    \t\t\t\t\tvar fileExtension = file.name.split('.').pop().toLowerCase();\n    \t\t\t\t\tif (!fileExtension) fileExtension = 'file';\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Create canvas for file extension preview\n    \t\t\t\t\tvar canvas = document.createElement('canvas');\n    \t\t\t\t\tvar ctx = canvas.getContext('2d');\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Parse width and height, handle units like \"px\", \"em\", etc.\n    \t\t\t\t\tvar widthStr = preview_image_width.toString().replace(\/[^\\d.]\/g, '');\n    \t\t\t\t\tvar heightStr = preview_image_height.toString().replace(\/[^\\d.]\/g, '');\n    \t\t\t\t\tvar width = parseFloat(widthStr) || 100;\n    \t\t\t\t\tvar height = parseFloat(heightStr) || 100;\n    \t\t\t\t\t\n    \t\t\t\t\tcanvas.width = width;\n    \t\t\t\t\tcanvas.height = height;\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Set background color\n    \t\t\t\t\tctx.fillStyle = '#f0f0f0';\n    \t\t\t\t\tctx.fillRect(0, 0, width, height);\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Draw border\n    \t\t\t\t\tctx.strokeStyle = '#ddd';\n    \t\t\t\t\tctx.lineWidth = 1;\n    \t\t\t\t\tctx.strokeRect(0, 0, width, height);\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Draw file extension text\n    \t\t\t\t\tctx.fillStyle = '#666';\n    \t\t\t\t\tvar fontSize = Math.max(12, Math.min(width, height) * 0.2);\n    \t\t\t\t\tctx.font = 'bold ' + fontSize + 'px Arial';\n    \t\t\t\t\tctx.textAlign = 'center';\n    \t\t\t\t\tctx.textBaseline = 'middle';\n    \t\t\t\t\tctx.fillText(fileExtension.toUpperCase(), width \/ 2, height \/ 2);\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Apply styles to canvas (similar to how plugin handles image previews)\n    \t\t\t\t\tcanvas.style.width = preview_image_width;\n    \t\t\t\t\tcanvas.style.height = preview_image_height;\n    \t\t\t\t\tcanvas.style.maxWidth = '100%';\n    \t\t\t\t\tcanvas.style.display = 'block';\n    \t\t\t\t\tcanvas.className = 'preview preview_image';\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Append canvas directly to span (like image previews do)\n    \t\t\t\t\t$previewImage.append(canvas);\n    \t\t\t\t\t\n    \t\t\t\t\t\/\/ Store preview in file object for consistency (same as image previews)\n    \t\t\t\t\tfile.preview = canvas;\n    \t\t\t\t};\n    \t\t\t\t\n    \t\t\t\t\/\/ Try to use data.context first (more reliable)\n    \t\t\t\tif (data.context && jQuery(data.context).length > 0) {\n    \t\t\t\t\tvar $template = jQuery(data.context);\n    \t\t\t\t\tvar $previewImage = $template.find('.preview_image_cont .preview_image');\n    \t\t\t\t\tcreateFilePreview($previewImage);\n    \t\t\t\t} else {\n    \t\t\t\t\t\/\/ Fallback: Use setTimeout to ensure the template is rendered, then find by file name\n    \t\t\t\t\tsetTimeout(function() {\n    \t\t\t\t\t\t\/\/ Find all template-upload elements and match by file name\n    \t\t\t\t\t\tvar $fileUploadContainer = jQuery('#de_fb_archivos_fileupload');\n    \t\t\t\t\t\tvar $templates = $fileUploadContainer.find('.template-upload');\n    \t\t\t\t\t\tvar fileProcessed = false;\n    \t\t\t\t\t\t\n    \t\t\t\t\t\t$templates.each(function() {\n    \t\t\t\t\t\t\tif (fileProcessed) return;\n    \t\t\t\t\t\t\t\n    \t\t\t\t\t\t\tvar $template = jQuery(this);\n    \t\t\t\t\t\t\tvar $previewName = $template.find('.preview_name');\n    \t\t\t\t\t\t\t\n    \t\t\t\t\t\t\t\/\/ Match template by file name (handle potential HTML encoding)\n    \t\t\t\t\t\t\tvar templateFileName = $previewName.length > 0 ? $previewName.text().trim() : '';\n    \t\t\t\t\t\t\tif (templateFileName === file.name || (templateFileName !== '' && file.name.indexOf(templateFileName) !== -1)) {\n    \t\t\t\t\t\t\t\tvar $previewImage = $template.find('.preview_image_cont .preview_image');\n    \t\t\t\t\t\t\t\tcreateFilePreview($previewImage);\n    \t\t\t\t\t\t\t\tif ($previewImage.find('img, canvas').length > 0) {\n    \t\t\t\t\t\t\t\t\tfileProcessed = true;\n    \t\t\t\t\t\t\t\t}\n    \t\t\t\t\t\t\t}\n    \t\t\t\t\t\t});\n    \t\t\t\t\t}, 100);\n    \t\t\t\t}\n    \t\t\t}\n    \t\t});\n    \t}\n    \t\n    \tif (jQuery(this).closest('.field_wrapper').find('.existing_image_preview').length > 0) {\n    \t\tif (jQuery(this).attr('data-single') == 'on') {\n    \t\t\tif (data.files[0].preview) {\n\t    \t\t\tvar canvas = data.files[0].preview;\n\t    \t\t\tvar random_num = Math.floor(Math.random() * 100) + 1;\n\t    \t\t\tjQuery(data.files[0].preview).attr('data-insertnum', random_num);\n\t    \t\t\tvar dataURL = canvas.toDataURL();\n\t    \t\t\tjQuery(this).closest('.field_wrapper').find('.image-preview-cont img').each(function(){\n\t    \t\t\t\tjQuery(this).attr('data-src', jQuery(this).attr('src'));\n\t    \t\t\t\tjQuery(this).attr('src', dataURL);\n\t    \t\t\t});\n    \t\t\t}    \t\t\t\n\t    \t} else {\n\t    \t\tif (data.files.length > 0) {\n\t    \t\t\tjQuery.each(data.files, function(ind, file){\n\t    \t\t\t\tif (data.files[ind].preview) {\n\t\t\t    \t\t\tvar canvas = data.files[ind].preview;\n\t\t\t    \t\t\tif (typeof jQuery(data.files[ind].preview).attr('data-insertnum') == 'undefined') {\n\t\t\t    \t\t\t\tvar random_num = Math.floor(Math.random() * 100) + 1;\n\t\t\t\t    \t\t\tjQuery(data.files[ind].preview).attr('data-insertnum', random_num);\n\t\t\t\t    \t\t\tvar dataURL = canvas.toDataURL();\n\t\t\t\t    \t\t\tvar t_width = _this.closest('.field_wrapper').find('.image-preview-cont').find('img').eq(0).width();\n\t\t\t\t    \t\t\t_this.closest('.field_wrapper').find('.image-preview-cont').append('<a class=\"existing_image_preview_link existing_file_link ui-sortable-handle inserted inserted_' + random_num + '\" href=\"' + dataURL + '\" target=\"_blank\"><img decoding=\"async\" class=\"no-lazy\" style=\"max-width: 200px;width:' + t_width + 'px;\" src=\"' + dataURL + '\" title=\"Uploaded Image Preview\"><\/a>');\n\t\t\t    \t\t\t}\n\t\t    \t\t\t}\n\t    \t\t\t});\n\t    \t\t}\n\t    \t}\n    \t}\n\n\t\tsetTimeout(function() {\n\t\t\tif (typeof setFormHeight == 'function') {\n\t\t\t\tsetFormHeight();\n\t\t\t}\n\t\t}, 1000);\n\n    });\n\n\t\/\/ Re-show required validation error when user removes all files (cancel\/remove_upload).\n\tjQuery('#de_fb_archivos_fileupload').on('click', '.remove_upload, .cancel', function() {\n\t\tvar $fileupload = jQuery('#de_fb_archivos_fileupload');\n\t\tsetTimeout(function() {\n\t\t\tif (!$fileupload.hasClass('required')) return;\n\t\t\tif ($fileupload.find('.files .template-upload').length > 0) return;\n\t\t\tif (jQuery('#de_fb_archivos_value').val() !== '') return;\n\t\t\tvar $contactField = $fileupload.closest('.et_pb_contact_field');\n\t\t\tif ($contactField.siblings('.error').length > 0) return;\n\t\t\tvar required_message = $fileupload.attr('data-required_message') || 'This field is required.';\n\t\t\tvar required_message_pos = $fileupload.attr('data-required_position') || 'bottom';\n\t\t\tvar inputId = $fileupload.attr('id');\n\t\t\tvar errorId = inputId ? inputId + '_error' : null;\n\t\t\tvar errorAttrs = errorId ? ' id=\"' + errorId + '\" role=\"alert\" aria-live=\"polite\"' : '';\n\t\t\tif (errorId) { $fileupload.attr('aria-describedby', errorId); }\n\t\t\tif (required_message_pos === 'top') {\n\t\t\t\t$contactField.before('<p class=\"error\"' + errorAttrs + '>' + required_message + '<\/p>');\n\t\t\t} else {\n\t\t\t\t$contactField.after('<p class=\"error\"' + errorAttrs + '>' + required_message + '<\/p>');\n\t\t\t}\n\t\t}, 150);\n\t});\n});\n<\/script>\n\n                <\/p>\n                                <\/div>\n        <\/div><\/div>\n\n<div class=\"de_form_builder_form_field_4 de_form_builder_form_field de_fb_form_field clearfix et_pb_column_4_4 et_flex_column_24_24 et_pb_column grid_et_pb_column_4_4_12 et_flex_column_24_24_tablet et_flex_column_24_24_phone dfb_radio_default file_align_left et_pb_module\"><div class=\"et_pb_module_inner\">        <div id=\"de_fb_privacidad_wrapper\" class=\"field_wrapper search_filter_cont\" data-count=\"100\" role=\"group\" >\n        <span class=\"df_field_description_text\">Tratamiento de datos personales<\/span>                            <p class=\"et_pb_contact_field\" data-type=\"checkbox\">\n                    <input type=\"hidden\" name=\"field_title[]\" value=\"Tratamiento de datos personales\"\/><input type=\"hidden\" name=\"field_name[]\" value=\"de_fb_privacidad\"\/><input type=\"hidden\" name=\"field_id[]\" value=\"de_fb_privacidad\"\/>                    <span class=\"et_pb_contact_field_options_wrapper\">\n\t\t\t<span class=\"et_pb_contact_field_options_list required\"  data-required_message=\"This field is required.\" data-required_position=\"bottom\"><span class=\"et_pb_contact_field_checkbox\">\n\t\t\t\t\t<input type=\"checkbox\" id=\"et_pb_contact_de_fb_privacidad_1_0\" class=\"divi-form-builder-field checkbox-field\" name=\"de_fb_privacidad[]\" value=\"He le\u00eddo y acepto la\" data-id=\"He le\u00eddo y acepto la \" required aria-required=\"true\">\n\t\t\t\t\t<label class=\"\" for=\"et_pb_contact_de_fb_privacidad_1_0\">\n\t\t\t\t\t\t<i><\/i>\n\t\t\t\t\t\t<span class=\"label_wrapper\">\n\t\t\t\t\t\t\t<span>He le\u00eddo y acepto la<\/span>\n\t\t\t\t\t\t\t <a href=\"\/en\/privacy-policy\/\" target=\"_blank\">Privacy Policy<\/a>\n\t\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/label>\n\t\t\t\t<\/span><\/span>\n\t\t<\/span>                <\/p>\n                                <\/div>\n        <\/div><\/div>\n<\/div><\/div><input type=\"hidden\" value=\"363-1\" name=\"form_key\"><input type=\"hidden\" value=\"de-form-builder\/form-0\" name=\"unique_id\"><input type=\"hidden\" value=\"off\" name=\"enable_payment\"><input type=\"hidden\" value=\"363\" name=\"dfb_page_id\"><input type=\"hidden\" name=\"fb_nonce\" class=\"fb_nonce\" value=\"4cb139e5d7\"><div class=\"et_contact_bottom_container\"><div class=\"submit-container\"><input type=\"text\" name=\"form_type_confirm\" style=\"display:none!important;\" tabindex=\"-1\" autocomplete=\"off\"><div class=\"de_fb_submit_container\"><div class=\"divi-form-submit-container\"><button class=\"divi-form-submit et_pb_button\" type=\"submit\" aria-label=\"Enviar\">Enviar<\/button><\/div><input type=\"hidden\" name=\"form_type\" value=\"contact\"><input type=\"hidden\" name=\"divi-form-submit\" value=\"yes\"><input type=\"hidden\" name=\"form_id\" value=\"\"><input type=\"hidden\" name=\"form_display_type\" value=\"in_page\"><\/div><\/div><\/div><\/form><script>\njQuery(document).ready(function($) {\n    \/\/ Wait for jQuery validation plugin to be loaded\n    if (typeof $.validator === 'undefined') {\n        console.error('jQuery Validation plugin not loaded');\n        return;\n    }\n    \n    let old_url = jQuery.validator.methods.url;\n    \n    jQuery.validator.addMethod('url', function(value, element) {\n        if (old_url.call(this, value, element)) {\n            return true;\n        }\n        \n        if (value && !value.startsWith('http:\/\/') && !value.startsWith('https:\/\/')) {\n            return old_url.call(this, 'http:\/\/' + value, element);\n        }\n        \n        return false;\n    }, \"Please enter a valid URL\");\n\n    (function($){\n    var trim = function(s){ return (s || '').trim(); };\n    $.validator.methods.email = function (value, element) {\n        if (this.optional(element)) return true;\n        var v = trim(value);\n        return \/^[^\\s@]+@([^\\s@]+\\.)+[^\\s@]{2,}$\/.test(v);\n    };\n    })(jQuery);\n\n    $.validator.setDefaults({\n        highlight: function(element) {\n            $(element).addClass('input-error');\n            $(element).closest('.et_pb_contact_field').addClass('input-field-error');\n        },\n        unhighlight: function(element) {\n            $(element).removeClass('input-error');\n            $(element).removeAttr('aria-describedby');\n            $(element).closest('.et_pb_contact_field').removeClass('input-field-error');\n            $(element).closest('.et_pb_contact_field').find('label.error').remove();\n        }\n    });\n\n    $('#fb_form_363-1').validate({\n        normalizer: function(value) {\n            return String(value ?? '').trim();\n        },\n        errorPlacement: function(error, element) {\n            var inputType = String(element.attr('type') || '').toLowerCase();\n            if (inputType === 'checkbox' || inputType === 'radio') {\n                \/\/ Checkbox\/radio required messaging is rendered by the wrapper-based custom flow.\n                \/\/ Skip jQuery Validate's inline label to avoid duplicate default messages.\n                return;\n            }\n            var fieldId = element.attr('id');\n            var errorId = fieldId ? fieldId + '_error' : null;\n            if (errorId) {\n                error.attr('id', errorId).attr('role', 'alert').attr('aria-live', 'polite');\n                element.attr('aria-describedby', errorId);\n            }\n            var message_position = element.attr('data-required_position');\n            if ( message_position == 'top' ) {\n                element.before(error);\n            } else {\n                element.after(error);\n            }\n        }\n    });\n\n    if ($('.de_fb_autocomplete').length > 0 && typeof init_autocomplete_fields == 'function') {\n        init_autocomplete_fields();\n    }\n});\n\nif ( window.history.replaceState ) {\n  window.history.replaceState( null, null, window.location.href );\n}\n\nif ( typeof form_grid_columns === 'function' ) {\n    form_grid_columns();\n}\n<\/script>\n        <\/div>\n\n<div class=\"et_pb_text_1 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module\"><div class=\"et_pb_text_inner\"><p>Data controller: TRESGE BACK OFFICE SERVICES SLU. Purpose: To send the requested information. Legal basis: Consent of the data subject. Recipients: No data will be disclosed to third parties, unless expressly authorized or required by law. Rights: The right to access, correct, and delete data, as well as the other rights detailed in the privacy policy.<\/p>\n<\/div><\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-363","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/pages\/363","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/comments?post=363"}],"version-history":[{"count":9,"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/pages\/363\/revisions"}],"predecessor-version":[{"id":398,"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/pages\/363\/revisions\/398"}],"wp:attachment":[{"href":"https:\/\/tresgebackoffice.es\/en\/wp-json\/wp\/v2\/media?parent=363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}