Snippets Collections
/*Refrescador de pagina por seguridad*/
setTimeout(securityReload, 3600000);
      function securityReload() {
        location.reload();
}

/*Muestra los mensajes de error del formulario*/
function showError(inputError, subError) {
    stopSending();
    switch (inputError) {
        case 2:
            document.getElementById('documentGroup').classList.add("endesa-form__group--invalid");
            switch (subError) {
                case 1:
                    document.getElementById('documentError').innerHTML = nifErrorMessage;
                    break;
                case 2:
                    document.getElementById('documentError').innerHTML = nieErrorMessage;
                    break;
                case 3:
                    document.getElementById('documentError').innerHTML = cifErrorMessage;
                    break;
                case 4:
                    document.getElementById('documentError').innerHTML = passaportErrorMessage;
                    break;
                default:
                    document.getElementById('documentError').innerHTML = documentErrorMessage;
            }
            break;
        default:
            document.getElementById('documentGroup').classList.add("endesa-form__group--invalid");
            document.getElementById('documentError').innerHTML = documentErrorMessage;
    }
}

/*Oculta Mensajes de Error del formulario*/
function hiddenErrors(inputError) {
    switch (inputError) {
        case 2:
            document.getElementById('documentGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentError').innerHTML = "";
            document.getElementById('documentSupraGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentSupraError').innerHTML = "";
            break;
      
        default:

            document.getElementById('documentGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentError').innerHTML = "";

            document.getElementById('documentSupraGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentSupraError').innerHTML = "";
    }
};

function changeDocument() {
    validDocument();
    validFormat();
}
                                                  
/*
 * Document validation
 */
function validDocument() {
    var select = document.getElementById("documentType");
    var opc = select.options[select.selectedIndex].value;
    var userDocument = document.getElementById('document').value;
    userDocument = userDocument.replace('-','');
    userDocument = userDocument.replace('-','');
    document.getElementById("documentHidden").value = userDocument;
                      
    switch (opc) {
        case "nif":
            if (!validateDNI(userDocument)) {
                showError(2, 1);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        case "nie":
            if (!validateNIE(userDocument)) {
                showError(2, 2);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        case "cif":
            if (!validateCIF(userDocument)) {
                showError(2, 3);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        case "pasaporte":
            if (!validatePASSAPORT(userDocument)) {
                showError(2, 4);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        default:
            showError(2);
            lockButton();
            return false
    };
};

function validateDNI(dni) {
    if (dni.length == 9) {
        var letras = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z',
            'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E', 'T'
        ];
        var numero = dni.substring(0, 8);
        var letra = dni.substring(8, 9);
        letra = letra.toUpperCase();
        if (numero < 0 || numero > 99999999) {
            return false;
        } else {
            var letraCalculada = letras[numero % 23];
            if (letraCalculada != letra) {
                return false;
            } else {
                return true;
            }
        }
    } else {
        return false;
    }
};

function validateNIE(nie) {
    nie = nie.toUpperCase();
    // Basic format test
    if (!nie.match(
            '((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)')) {
        return false;
    }
    // Test NIE
    //T
    if (/^[T]{1}/.test(nie)) {
        return (nie[8] === /^[T]{1}[A-Z0-9]{8}$/.test(nie));
    }
    //XYZ
    if (/^[XYZ]{1}/.test(nie)) {
        return (
            nie[8] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt(
                nie.replace('X', '0')
                .replace('Y', '1')
                .replace('Z', '2')
                .substring(0, 8) % 23));
    }
    return false;
}

function validateCIF(cif) {
    
    var sum, num = [],
        value, controlDigit, validar, result;
    var valueCif = cif.substr(1, cif.length - 2);
    var suma = 0;
    value = cif.toUpperCase();
   
    for (var i = 1; i < valueCif.length; i = i + 2) {
        suma = suma + parseInt(valueCif.substr(i, 1));
    }
    for (var i = 0; i < 9; i++) {
        num[i] = parseInt(cif.charAt(i), 10);
    }
    var suma2 = 0;
   
    for (var i = 0; i < valueCif.length; i = i + 2) {
        result = parseInt(valueCif.substr(i, 1)) * 2;
        if (String(result).length == 1) {
         
            suma2 = suma2 + parseInt(result);
        } else {
          
            suma2 = suma2 + parseInt(String(result).substr(0, 1)) + parseInt(String(result)
                .substr(1, 1));
        }
    }
   
    suma = suma + suma2;
    var unidad = String(suma).substr(1, 1);
    unidad = 10 - parseInt(unidad);
    var primerCaracter = cif.substr(0, 1).toUpperCase();
    if (primerCaracter.match(/^[FJKNPQRSUVW]$/)) {
        suma += '';
        controlDigit = 10 - parseInt(suma.charAt(suma.length - 1), 10);
        value += controlDigit;
        validar = num[8].toString() === String.fromCharCode(64 + controlDigit) || num[8]
            .toString() === value.charAt(value.length - 1);
        if (validar == true) return true;
        if (String.fromCharCode(64 + unidad).toUpperCase() == cif.substr(cif.length - 1, 1)
            .toUpperCase()) return true;
    }
    if (primerCaracter.match(/^[ABCDEFGHLM]$/)) {
        // Se revisa que el ultimo valor coincida con el calculo 
        if (unidad == 10) unidad = 0;
        suma += '';
        controlDigit = 10 - parseInt(suma.charAt(suma.length - 1), 10);
        value += controlDigit;
        validar = num[8].toString() === String.fromCharCode(64 + controlDigit) || num[8]
            .toString() === value.charAt(value.length - 1);
        if (validar == true) return true;
        if (String.fromCharCode(64 + unidad).toUpperCase() == cif.substr(cif.length - 1, 1)
            .toUpperCase()) return true;
    }
    return false;
};

function validatePASSAPORT(passport) {
    "use strict";
    return passport.length > 6 && passport.length < 18;
}
                                                       
                                                       
function unlockButton() {
    var btnSubmit = document.getElementById('btnSubmit');
    btnSubmit.removeAttribute("disabled");
    btnSubmit.classList.remove("endesa-form__btn--disable");
}

function lockButton() {
    var btnSubmit = document.getElementById('btnSubmit');
    btnSubmit.setAttribute("disabled", true);
    btnSubmit.classList.add("endesa-form__btn--disable");
}
                                                       
                                                       
function validFormat() {
    if (validDocument()) {
        unlockButton();
        console.log("Formulario Valido");
        return true;
    } else {
        lockButton();
        console.log("Error en el formulario");
        return false;
    }
} 
                                                       
 /*Detecta si se han cambiado un check*/
function changeInput(input) {
    /*Recupera todos los inputs*/
    var documentInput = document.getElementById('document');

        if (documentInput.value) {
            validFormat();
        } else {
            switch (input) {
                case 2:
                    validDocument();
                    console.log("Con Documento");
                    break;             
                default:
                    lockButton();
                    console.log("Sin datos");
            }
        }
    
}



function stopSending() {
        var form = document.getElementById('SCForm');
        unlockButton();
        form.classList.add("no-spinner");
        form.classList.remove("endesa-form--sending");
}
 
function ajaxPass() { 

 var ajaxResponse;
    var ajax = new XMLHttpRequest();


       ajax.onreadystatechange = function () {

            if (this.readyState == 4 && this.status == 200) {
                    
                   stopSending()                                    
                                                        
                   ajaxResponse = this.responseText;
             
                    ajaxResponse = String(ajaxResponse)
              
   
              
if (ajaxResponse.indexOf('https') >= 0) {

  window.location.href = ajaxResponse
} else if (idioma == 'ES') { 
  document.getElementById('error-container').innerHTML = `
    <div class="error-banner">
      <p class="error-text">
        El documento introducido no corresponde con el titular del contrato
      </p>
    </div>
  `;                   
 } else if (idioma == 'EN') { 
  document.getElementById('error-container').innerHTML = `
    <div class="error-banner">
      <p class="error-text">
        The document submitted does not correspond to the contract holder
      </p>
    </div>
  `;                   
 } else if (idioma == 'CA') { 
  document.getElementById('error-container').innerHTML = `
    <div class="error-banner">
      <p class="error-text">
        El document introduït no correspon amb el titular del contracte
      </p>
    </div>
  `;                   
 }
          
              
                         }
               }
 
var paramsFormsToSent =  {     'Documento': document.getElementById('document').value,
                               'encDocumento': encDocumento,
                               'encFactura': encFactura                               
                             }       
          
     console.log(paramsFormsToSent);                                          
               
     var ajaxUrl = "https://cloud.dev.notificaciones.endesaclientes.com/ajax-validacion-doc-aviso"
     
                     
     ajax.open("POST", ajaxUrl, "true");
     ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
     ajax.send("data=" + encodeURIComponent(JSON.stringify(paramsFormsToSent)));;
 
 }


function visualSending() {
        if (validFormat()) {
            if (validFormat()) {
             lockButton();
             document.getElementById('SCForm').classList.add("endesa-form--sending");
             document.getElementById('SCForm').classList.remove("no-spinner");      
             ajaxPass();        


        } else {
            stopSending();
        }
    }   
} 
    * {
      box-sizing: border-box;
    }
    body {
      margin: 0;
      font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
      background-color: #ffffff;
      color: #000;
    }
    .header {
      background-color: #0066FF;
      padding: 20px;
    }
    .header img {
      height: 30px;
    }
    .container {
      padding: 40px 20px;
      max-width: 800px;
      margin: auto;
      text-align: center;
    }
    .container .title {
      font-size: 28px;
      margin-bottom: 10px;
    }
    .container > p {
      font-size: 16px;
      color: #333;
      margin-bottom: 30px;
    }
    .bold {
      font-weight: bold;
    }
   
    .error-banner {
      border-radius: 10px;
      background-color: #F6D5DD;
      display: inline-block;
}

    .error-text {
      margin: 0;
      font-weight: normal;
      font-style: normal;
      font-size: 16px;
      line-height: 1.5;
      letter-spacing: -0.2px;
      font-family: inherit;
      text-decoration: none;
      color: #000000;
      padding: 15px 40px;
      
}

.text-bold {
      font-weight: bold;
      font-size: 20px
}

.text-light {
      font-weight: 200;
      font-size: 16px
}

.image-error {
padding: 20px 0
}

    .endesa-form {
      display: inline-block;
      position: relative;
      margin: 0;
      padding: 30px;
      background: #ffffff;
      width: 100%;
      margin-bottom: 65px;
      max-width: 512px;
}

.endesa-form__group {
  display: block;
  width: 100%;
  position: relative;
  text-align: left;
  margin-bottom: 25px;
}

.endesa-form__group--invalid input {
  border: 2px solid #d42c54;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}

.endesa-form__group--invalid span {
  width: 100%;
    position: relative;
    display: block;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: normal;
    font-size: 14px;
    color: #d42c54;
    font-style: normal;
    font-stretch: normal;
    line-height: 1.29;
    letter-spacing: -0.2px;
    text-align: left;
}

      .endesa-form__group--col-2-lf {
  display: inline-block;
  width: calc(50% - 2.5px);
  margin: 0;
  position: relative;
  left: 0;
  padding-right: 10px;
  text-align: left;
  vertical-align: top;
}

.endesa-form__group--col-2-rg {
  display: inline-block;
  width: calc(50% - 2.5px);
  margin: 0;
  position: relative;
  left: 0;
  text-align: left;
  padding-left: 10px;
  vertical-align: top;
}


.endesa-form__label--visible {
  display: block;
    border: none;
    font-weight: normal;
    font-style: normal;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -0.2px;
    font-family: inherit;
    text-decoration: none;
    box-sizing: border-box;
    padding-right: 10px;
    color: #000000;
    margin-bottom: 5px;
}

.endesa-form__select {
  position: relative;
    display: block;
    width: 100%;
    height: 44px;
    font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: normal;
    font-style: normal;
    font-stretch: normal;
    line-height: 1.33;
    letter-spacing: normal;
    color: #757575;
    border-radius: 0px;
    border: none;
    border: 2px solid #dddddd;
    box-shadow: none;
    margin-bottom: 23px;
    padding: 9px 14px;
    padding-right: 35px;
    margin: 0;
    background: url(https://image.digital.endesaclientes.com/lib/fe341570756405757c1478/m/1/e7e44424-f980-4bdd-a536-3cbbfec0ab0f.png) 95% center no-repeat, linear-gradient(#ffffff, #ffffff);
    background-size: 10px 5px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select::-ms-expand {
  display: none;
}

.endesa-form__input {
  position: relative;
    display: block;
    width: 100%;
    height: 44px;
    font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: normal;
    font-style: normal;
    font-stretch: normal;
    line-height: 1.33;
    letter-spacing: normal;
    color: #000000;
    background: #ffffff;
    border-radius: 0;
    border: 2px solid #dddddd;
    box-shadow: none;
    padding: 1rem;
    margin-bottom: 5px;
}

.submit-wrapper {
  max-width: 800px;
  margin: 0 auto;
  text-align: right;
}

.endesa-form__btn {
  position: relative;
  display: inline-block;
  width: auto;
  height: 46px;
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
  font-size: 15px;
  color: #ffffff;
  letter-spacing: 1px;
  text-align: left;
  border-radius: 0;
  border: none;
  background: #d3135a;
  text-align: center;
  height: auto;
  min-height: 46px;
  overflow: hidden;
  cursor: pointer;
  text-transform: uppercase;
  margin: 23px 0;
}

.endesa-form--sending .endesa-form__btn {
  display: inline-block;
}

.endesa-form--sending .endesa-form__btn-text {
  padding-right: 10px;
}

.endesa-form--sending .endesa-form__btn:after {
content: "";
  display: inline-block;
  position: relative;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation-name: spin;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  vertical-align: middle;
}

.endesa-form__btn {
  position: relative;
  padding: 0 30px;
}

@keyframes spin {
  0% {
      transform: rotate(0deg);
  }

  100% {
      transform: rotate(360deg);
  }
}

.endesa-form__btn--disable {
  background: #FFE5EE;
  cursor: not-allowed;
}

.endesa-form--sending {
  display: block;
}

.endesa-form--sending:after {
  content: "";
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  opacity: 0.5;
}
    
    .footer {
      background-color: #000;
      color: #fff;
      padding: 40px 20px;
      font-size: 14px;
    }

.footer-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 40px; /* controla márgenes laterales */
}


.footer-title {
  font-size: 16px;
  font-weight: bold;
  margin: auto;
  margin-bottom: 20px;
}

.footer-divider {
  width: 100%;
  height: 1px;
  background-color: white;
  margin: 20px 0;
}
    .footer-columns {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start; 
  gap: 40px;
  max-width: 1000px;
  margin: auto;
}
    .footer-column {
      min-width: 200px;
      margin-bottom: 20px;
    }
    .footer-column h4 {
      font-size: 16px;
      margin-bottom: 10px;
    }
    .footer-column ul {
      list-style: none;
      padding: 0;
    }
    .footer-column ul li {
      margin-bottom: 6px;
    }
    .footer-links {
      text-align: center;
      margin-top: 20px;
    }
    .footer-links a {
      color: #00AEEF;
      text-decoration: none;
      margin: 0 10px;
    }
.footer-links .separator {
  color: #999;
}
%%[

    SET @encFactura = RequestParameter("f")
    
    SET @encDocumento =  RequestParameter("d")
    
    SET @idioma = 'ES'
    

]%%

<!DOCTYPE html>
<html lang="es">
<head>
  <meta charset="UTF-8">
  <title>Endesa Energía</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <link rel="stylesheet" type="text/css" href="https://cloud.dev.notificaciones.endesaclientes.com/css-fuente-validacion-doc-aviso"/>
    <link rel="stylesheet" type="text/css" href="https://cloud.dev.notificaciones.endesaclientes.com/css-validacion-doc-aviso-ml"/>
</head>
<body> 
  
  <div class="header">
    <a href="https://www.endesa.com" title="https://www.endesa.com" target="_blank"><span class="endesa-logo__accesible"><img src="https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/5b5b4049-ad5c-4e19-a09f-4ed2545327e9.png" alt="Endesa logo"></span>
        </a>
  </div>

  <div class="container">
    <p class="title">Descargar factura</p>
    <p>Para garantizar la seguridad de tus datos, necesitamos que nos indiques el DNI/NIE/CIF/Pasaporte del <span class="bold">titular del contrato</span> de la factura a consultar:</p>
    
    <div id="error-container">
    </div>

    <form action="" method="POST" align="left" id="SCForm" class="endesa-form" novalidate="novalidate">
     <div class="endesa-form__group endesa-form__group--col-2" id="documentSupraGroup">
              <span id="documentSupraError"></span>
              <div class="endesa-form__group--col-2-lf">
                <label class="endesa-form__label endesa-form__label--visible" for="documentType">Tipo de documento
                  </label>
                <select class="endesa-form__select" id="documentType" name="documentType" onchange="changeDocument()">
                  <option value="nif" selected="selected">
                    NIF
                    del
                    titular
                  </option>
                  <option value="nie">
                    NIE
                    del
                    titular
                  </option>
                  <option value="cif">
                    CIF
                    del
                    titular
                  </option>
                  <option value="pasaporte">
                    Pasaporte
                    del
                    titular
                  </option>
                </select>
              </div>
              <div class="endesa-form__group--col-2-rg" id="documentGroup">      
                <label class="endesa-form__label endesa-form__label--visible" for="document">Número de documento
                  </label>
                <input class="endesa-form__input" name="document" id="document" value="%%=v(@documento)=%%" placeholder="Documento" type="text" onchange="changeInput(2)" required>
                <span id="documentError"></span>
              </div>
            </div>
      <input type="hidden" name="documentHidden" id="documentHidden" data-field-type="Text">
      <div id="buttonContainer" class="submit-wrapper">
              <button type="button" class="endesa-form__btn endesa-form__btn--disable" id="btnSubmit" onclick="visualSending()"><span class="endesa-form__btn-text" disabled>ACEPTAR</span></button>
            </div>
    </form>
  </div>

  <div class="footer">
    <div class="footer-content">
    <div class="footer-title">Tu energía</div>
    <div class="footer-divider"></div>
    <div class="footer-columns">
      <div class="footer-column">
        <h4>Luz y Gas</h4>
        <ul>
          <li>Encuentra tu oferta</li>
          <li>Productos de Luz</li>
          <li>Productos de Gas</li>
          <li>Productos de Luz + Gas</li>
          <li>Ofertas Endesa</li>
          <li>Consejos de ahorro</li>
          <li>Autoconsumo</li>
        </ul>
      </div>
      <div class="footer-column">
        <h4>Otros productos</h4>
        <ul>
          <li>Ventajas para clientes endesa</li>
          <li>Mantenimiento</li>
          <li>Calefacción</li>
          <li>Aire acondicionado</li>
          <li>Diagnóstico energético</li>
          <li>infoEnergía</li>
          <li>Promociones y Ganadores</li>
          <li>Pólizas de seguros</li>
        </ul>
      </div>
    </div>
    <div class="footer-links">
  <a href="#">Aviso legal</a>
  <span class="separator">|</span>
  <a href="#">Política de Cookies</a>
  <span class="separator">|</span>
  <a href="#">Política de Protección de Datos</a>
  <span class="separator">|</span>
  <a href="#">Accesibilidad</a>
  <span class="separator">|</span>
  <a href="#">Contacto</a>
</div>

  </div>
  </div>

  <script>
  var encDocumento = "%%=v(@encDocumento)=%%";
  var encFactura = "%%=v(@encFactura)=%%";
  var idioma = "%%=v(@idioma)=%%";
</script>
<script id="js-script" src="https://cloud.dev.notificaciones.endesaclientes.com/javascript-validacion-doc-aviso"></script>
<script id="js-errores" src="https://cloud.dev.notificaciones.endesaclientes.com/javascript-validacion-doc-aviso-errores-es"></script>

</body>
</html>
.color-blue {
   color: blue;
}
.endesa-bold-text {
 font-weight: bold;
}
.endesa-padding-activation-text {
 padding-left: 25%;
}
.endesa-activation-table {
  margin-left: 3rem;
    margin-right: 3rem;
    border: 2px solid #1C78E2;
}
.endesa-activation-table th {
    width: 145px;
    background: #1C78E2;
    padding: 10px;
    color: white;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 20px;
}
.endesa-activation-table td {
  width: 145px;
    padding: 10px;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 300;
    font-size: 1rem;
    line-height: 20px;
}
.endesa-activation-table td:first-child {
  border: 2px solid #1C78E2;
}
.table-check {
 color: #00883d;
 padding-right: 5px;
}
.endesa-checkbox {
 width: 17px;
 height: 17px;
 border: 1px solid #000;
 margin-left: 3rem;
 margin-right: 10px;
}
.endesa-checkbox-label-text {
 font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 23px;
    padding: 10px 0 10px 0;
}
.endesa-activate-button {
    width: 55%;
    float: right;
    margin-right: 3rem;
    height: 46px;
    font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
    font-size: 15px;
    color: #ffffff;
    letter-spacing: 1px;
    border-radius: 0;
    border: none;
    background: #d42c54;
    padding: 10px 20px;
    overflow: hidden;
    cursor: pointer;
    text-transform: uppercase;
    margin-top: 25px;
}
.endesa-condition-checkbox-block {
    position: relative;
    display: block;
    margin-left: 11rem;
    margin-top: 1rem;
}
.endesa-condition-checkbox {
    border: 2px solid black;
    width: 17px;
    height: 17px;
    margin-right: 10px;
}
.endesa-submit-button {
    position: relative;
    display: block;
    float: right;
    margin-right: 12rem;
    padding: 0.6875rem 1.875rem;
    width: 60%;
    height: auto;
    font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
    font-size: 0.9375rem;
    color: #fff;
    letter-spacing: 1px;
    border-radius: 0;
    border: none;
    background: #d42c54;
    text-align: center;
    min-height: 2.875rem;
    overflow: hidden;
    text-transform: uppercase;
    margin-top: 25px;
}


///////////////////////////////////////////////////////////////////////
td.responsive-td{
  display: block !important;
  width: 100% !important;
}

.endesa-header {
  display: block;
  width: 100%;
  min-height:90vh;
  position: relative;
  background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: cover;
}

.endesa-logo {
  position: relative;
  display: block;
  margin: 54px 0;
}

.endesa-logo--footer {
  position: relative;
  display: inline-block;
  text-align: right;
  width: 100%;
  margin: 0;
}

.endesa-logo__link {
  display: block;
  position: relative;
  background-image: url(https://image.digital.endesaclientes.com/lib/fe3a15707564057b741078/m/1/c32833db-1fe9-457e-abc7-3311181d42fc.png);
  width: 100px;
  height: 26px;
  background-repeat: no-repeat;
  background-size: 100% auto;
}

.endesa-logo__link--footer {
  display: inline-block;
}

.endesa-logo__accesible {
  position: absolute !important;
  width: 0px;
  height: 0px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
  box-sizing: border-box;
}

.stylingblock-table-wrapper {
  min-width: 100%;
}

#fcMenu {
  display: none;
}

/* IDIOMAS */
.endesa-header-language {
    position: relative;
    display: block;
    text-align: right;
 margin: 54px 0;
}

.endesa-header-language__menu {
    position: relative;
    display: inline-block;
}

.endesa-header-language__active {
    position: relative;
    display: block;
    text-transform: uppercase;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-size: 18px;
    font-size: 1.125rem;
    font-weight: normal;
    color: black;
}

.endesa-header-language__active:after {
    content: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/6caa03fd-6376-4566-b160-faf007d85d0a.png);
    width: 10px;
    width: 0.625rem;
    height: 10px;
    height: 0.625rem;
    margin-left: 15px;
    margin-left: 0.9375rem;
}

.endesa-header-language__active:hover,
.endesa-header-language__active:active,
.endesa-header-language__active:visited,
.endesa-header-language__active:focus {
    text-decoration: none;
    color: black;
}

.endesa-header-language__active--black {
    color: black !important;
}

.endesa-header-language__active--black:after {
    content: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/6caa03fd-6376-4566-b160-faf007d85d0a.png);
    width: 10px;
    width: 0.625rem;
    height: 10px;
    height: 0.625rem;
    margin-left: 15px;
    margin-left: 0.9375rem;
}

.endesa-header-language__active--black:hover,
.endesa-header-language__active--black:active,
.endesa-header-language__active--black:visited,
.endesa-header-language__active--black:focus {
    text-decoration: none;
    color: black !important;
}


.endesa-header-language__active--black2 {
    color: black !important;
}

.endesa-header-language__active--black2:after {
    content: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/6caa03fd-6376-4566-b160-faf007d85d0a.png);
    width: 10px;
    width: 0.625rem;
    height: 10px;
    height: 0.625rem;
    margin-left: 15px;
    margin-left: 0.9375rem;
}

.endesa-header-language__active--black2:hover,
.endesa-header-language__active--black2:active,
.endesa-header-language__active--black2:visited,
.endesa-header-language__active--black2:focus {
    text-decoration: none;
    color: black !important;
}

.endesa-header-language__link {
    display: block;
    padding: 3px 30px 3px 20px;
    white-space: nowrap;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: 14px;
    font-size: 0.875rem;
    color: #262626;
    text-decoration: none;
    text-align: right;
}

.endesa-header-language__link:active,
.endesa-header-language__link:visited,
.endesa-header-language__link:focus {
    text-decoration: none;
    color: #000000;
    background: #ffffff;
}

.endesa-header-language__link:hover {
    text-decoration: none;
    color: #000000;
    background: #00000011;
    transition-delay: 0.1s;

}

.endesa-header-language__list {
    display: none;
    position: absolute !important;
    top: 25px;
    top: 1.5625rem;
    right: 0;
    padding: 5px 0;
    padding: 0.3125rem 0;
    z-index: 100;
    color: #000000;
    background: #ffffff;
    text-transform: uppercase;
}

.endesa-header-language__item {
    position: relative;
    display: block;
}

.endesa-link--clientes{ color: #d42c54; font-weight: bold;}

.endesa-title {
  position: absolute;
  bottom: 25%;
  width: 100%;
  max-width: 570px;
  margin-bottom: 50px;
  right: 25px;
}

.endesa-title__container {
  position: relative;
  display: block;
  padding-right: 40px;
}

.endesa-title__title {
  color: #ffffff;
  font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
  font-size: 40px;
  line-height: normal;
  text-align: right;
  text-transform: uppercase;
}

.endesa-title__text{
  color: #ffffff;
  font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
  font-size: 30px;
  line-height: normal;
  text-align: right;
  margin-bottom: 37px;
  margin-top: 20px;
}

.endesa-title__text--bold {
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
}

.endesa-title__title--bold {
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
}

.endesa-title__title--mobile{
  display: none;
}

.endesa-title__title--desktop{
  display: inline-block;
}

#btnSubmit:disabled {
  cursor: default;
}

.endesa-cursor {
    padding-bottom: 2.5rem;
    padding-right: 40px;
}

.endesa-cursor__content {
  text-shadow: none;
  position: relative;
  padding-left: 64px;
}

.endesa-cursor__content:before {
  content: "";
  position: absolute;
  display: inline-block;
  vertical-align: top;
  top: 11px;
  top: -0.3125rem;
  left: 0;
  width: 34px;
  width: 2.125rem;
  height: 114px;
  height: 7.125rem;
  background: #ffffff;
}

.endesa-cursor__text {
    display: inline;
    color: #ffffff;
    font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
    font-size: 2rem;
    line-height: normal;
    max-width: 20rem;
}

.endesa-bold-text {
    font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
}


.endesa-promo-info {
  display: block;
  position: relative;
  max-width: 600px;
  padding-right: 25px;
  padding-bottom: 1rem;
}

.endesa-promo-info__text-container {
  display: block;
  position: relative;
}

.endesa-promo-info__list-container {
  display: block;
  position: relative;
}

.endesa-promo-info__list-title {
  color: #000000;
  font-size: 18px;
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
  padding: 0 45px 10px;
}

.endesa-promo-info__list {
  color: #000000;
  font-size: 16px;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
}

.endesa-promo-info__list-item {
  padding-bottom: 25px;
  font-family: 'RoobertENEL Bold', Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 20px;
  color: white;
}

.endesa-promo-info__list-item:before {
  font-family: 'check-icon';
  font-weight: normal;
  font-style: normal;
  font-size: 16px;
  color: #d42c54;
  content: "\e800";
  position: relative;
  display: inline-block;
  padding: 6px;
  height: 30px;
  width: 30px;
  text-align: center;
  vertical-align: middle;
  border-radius: 50%;
  line-height: 1.2;
  margin: 0;
}

.endesa-promo-info__list-text {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 23px;
  color: white;
  padding: 0 0 0 37px;
}

.endesa-info-text {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 23px;
  color: white;
  padding: 0 0 1.8rem 0;
}


.endesa-info-campaign{
  position: relative;
  display: block;
  background: #0244c8;
  padding: 20px 0px;
}
.endesa-info-campaign__text{
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 32px;
  color: white;
}

.endesa-info-campaign__text--bold{
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
}

.endesa-form-container {
  display: block;
  position: relative;
  width: 100%;
  text-align: right;
}
.endesa-form {
  display: inline-block;
  position: relative;
  margin: 0;
  padding: 30px;
  background: #ffffff;
  width: 100%;
  margin-bottom: 65px;
  max-width: 512px;
}


.endesa-form--sending {
  display: block;
}

.endesa-form--sending:after {
  content: "";
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  opacity: 0.5;
}

.endesa-form--blocked {
  display: block;
}

.endesa-form--blocked:after {
  content: "";
  position: absolute;
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  opacity: 0.5;
}

.endesa-form__fieldset {
  position: relative;
  display: block;
}

input:disabled {
    Border: 2px solid #A3A3A3;
    background-color: #E9E9E9;
    color: #404040;
}

.endesa-form__legend {
  display: block;
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
  font-size: 24px;
  line-height: 1.64;
  color: #000000;
  text-align: center;
  padding: 20px 0;
}

.endesa-form__group {
  display: block;
  width: 100%;
  position: relative;
  text-align: left;
  margin-bottom: 25px;
}

.endesa-form__group--col-2-lf {
  display: inline-block;
  width: calc(50% - 2.5px);
  margin: 0;
  position: relative;
  left: 0;
  padding-right: 10px;
  text-align: left;
  vertical-align: top;
}


.endesa-form__group--col-2-rg {
  display: inline-block;
  width: calc(50% - 2.5px);
  margin: 0;
  position: relative;
  left: 0;
  text-align: left;
  padding-left: 10px;
  vertical-align: top;
}

.endesa-form__group--invalid input {
  border: 2px solid #d42c54;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}

.endesa-form__group--invalid span {
  width: 100%;
    position: relative;
    display: block;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: normal;
    font-size: 14px;
    color: #d42c54;
    font-style: normal;
    font-stretch: normal;
    line-height: 1.29;
    letter-spacing: -0.2px;
    text-align: left;
}

/*
.endesa-form__label {
  display: none;
}
*/

.endesa-form__label--visible {
  display: block;
    border: none;
    font-weight: normal;
    font-style: normal;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -0.2px;
    font-family: inherit;
    text-decoration: none;
    box-sizing: border-box;
    padding-right: 10px;
    color: #000000;
    margin-bottom: 5px;
}

.endesa-form__input {
  position: relative;
    display: block;
    width: 100%;
    height: 44px;
    font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: normal;
    font-style: normal;
    font-stretch: normal;
    line-height: 1.33;
    letter-spacing: normal;
    color: #000000;
    background: #ffffff;
    border-radius: 0;
    border: 2px solid #dddddd;
    box-shadow: none;
    padding: 1rem;
    margin-bottom: 5px;
}

.endesa-form__select {
  position: relative;
    display: block;
    width: 100%;
    height: 44px;
    font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: normal;
    font-style: normal;
    font-stretch: normal;
    line-height: 1.33;
    letter-spacing: normal;
    color: #757575;
    border-radius: 0px;
    border: none;
    border: 2px solid #dddddd;
    box-shadow: none;
    margin-bottom: 23px;
    padding: 9px 14px;
    padding-right: 35px;
    margin: 0;
    background: url(https://image.digital.endesaclientes.com/lib/fe341570756405757c1478/m/1/e7e44424-f980-4bdd-a536-3cbbfec0ab0f.png) 95% center no-repeat, linear-gradient(#ffffff, #ffffff);
    background-size: 10px 5px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

select::-ms-expand {
  display: none;
}

.endesa-form__btn-check {
  position: relative;
  display: block;
  width: 100%;
  font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #757575;
  border-radius: 0;
  border: none;
  border: 1px solid #757575;
  box-shadow: none;
  padding: 6px 14px;
  text-align: left;
  padding-right: 40px;
}

.endesa-form__btn-check:after {
  font-family: "Font Awesome 5 Free";
  content: "\f107";
  display: inline-block;
  padding-right: 3px;
  vertical-align: middle;
  font-weight: 900;
  position: absolute;
  right: 15px;
  top: 7px;
  color: #ffffff;
}

.endesa-form__check {
  position: relative;
  display: block;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #757575;
  font-size: 12px;
  line-height: 16px;
  text-align: left;
}

.endesa-form__check input {
  webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  position: absolute;
  display: inline-block;
  margin: 0;
  padding: 0;
  width: 0;
  height: 0;
  font-size: 0;
  line-height: 0;
  border: 0;
}

.endesa-form__check-text {
  position: relative;
  display: inline-block;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: #757575;
  text-decoration: none;
  margin-bottom: 6px;
}

.endesa-form__check-text--big {
  font-size: 18px;
  padding-top: 5px;
  margin-bottom: 12px;

}

.endesa-form__check-text--link {
  color: #d42c54;
  text-decoration: underline;
}

.endesa-form__check input+label {
  position: relative;
    display: inline-block;
    padding-left: 25px;
    min-height: 18px;
    color: #000;
}

.endesa-form__check--big {
  margin-bottom: 25px;
  line-height: 1.45;
}

.endesa-form__check--big input+label {
  padding-left: 48px;
}

.endesa-form__check input+label:before {
  content: "";
    position: absolute;
    display: inline-block;
    vertical-align: top;
    top: 0;
    left: 0;
    font-size: 8px;
    line-height: 0.95rem;
    text-align: center;
    font-weight: bold;
    border: 2px solid #cecece;
    overflow: hidden;
    width: 16px;
    height: 16px;
    font-family: 'check-icon';
    background: #ffffff;
}

.endesa-form__check--big input+label:before {
  width: 28px;
  height: 28px;
  line-height: 1.8;
  font-size: 14px;
}

.endesa-form__check input:checked+label:before {
  content: "\e800";
  color: #000;
}

.endesa-form__check-link {
  position: relative;
  display: inline-block;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 13px;
  font-size: 0.8125rem;
  color: #d42c54;
  text-decoration: underline;
  padding-right: 1px;
}

.endesa-form__link {
  position: relative;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #d42c54;
    text-decoration: none;
    text-align: left;
}

.endesa-form__link:hover {
  text-decoration: none;
    color: #b32446;
}


.endesa-form__text {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: normal;
  color: #757575;
  margin-bottom: 10px;
}

.endesa-form__text--strong {
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
  font-size: 24px;
}



.endesa-form__btn {
  position: relative;
  display: block;
  width: 100%;
  height: 46px;
  height: 2.875rem;
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-size: 0.9375rem;
  color: #ffffff;
  letter-spacing: 1px;
  text-align: left;
  border-radius: 0;
  border: none;
  background: #d42c54;
  padding: 11px 30px;
  padding: 0.6875rem 1.875rem;
  text-align: center;
  height: auto;
  min-height: 46px;
  min-height: 2.875rem;
  overflow: hidden;
  cursor: pointer;
  text-transform: uppercase;
  margin: 23px 0;
}

.endesa-form--sending .endesa-form__btn {
  display: inline-block;
}

.endesa-form--sending .endesa-form__btn-text {
  padding-right: 10px;
}

.endesa-form--sending .endesa-form__btn:after {
content: "";
  display: inline-block;
  position: relative;
  width: 20px;
  height: 20px;
  margin-left: 8px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  border-top-color: transparent;
  animation-name: spin;
  animation-duration: 1s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  vertical-align: middle;
}

.endesa-form__btn {
  position: relative;
  padding-right: 30px;
}

@keyframes spin {
  0% {
      transform: rotate(0deg);
  }

  100% {
      transform: rotate(360deg);
  }
}

.confirm__text {
  font: "Font Awesome 5 Free";
  font-weight: 900;
  color: #ffffff;
  transition: all 0.2s;
}

.endesa-form__btn--disable {
  background: #FFE5EE;
}


.endesa-banner {
  position: relative;
  display: block;
  background: #0244c8;
}

.endesa-banner .col-md-9, .endesa-banner .col-md-3, .endesa-banner .row, .endesa-banner .container-fluid {
  padding: 0;
}

.endesa-banner__wrapper {
  max-width: 1440px;
  display: block;
  position: relative;
  margin: 0 auto;
}

.endesa-banner__img-cnt {
  position: relative;
  display: inline-block;
  width: 100%;
}

.endesa-banner__figure {
  margin: 25px;
  position: relative;
  display: block;
  max-width: 209px;
  width: 100%;
}

.endesa-banner__img {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
}

.endesa-banner__text-cnt {
  position: relative;
  display: inline-block;
  min-height: 259px;
  vertical-align: middle;
  padding: 25px 56px 25px 25px;
  width: 100%;
}

.endesa-banner__text {
  font-family: "RoobertENEL Bold", Arial, Helvetica, sans-serif;
  color: #ffffff;
  font-size: 38px;
  line-height: 54px;
  vertical-align: top;
}

.endesa-banner__text--light {
  font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
}

.endesa-banner__text--small {
  font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
  font-size: 25px;
  padding-top: 48px;
}

.endesa-banner__link {
  font-family: "RoobertENEL Light", Arial, Helvetica, sans-serif;
  color: #ffffff;
  font-size: 30px;
  text-decoration: underline !important;
}

.endesa-banner__link:hover {
  color: #ffffff;
}



.endesa-main__title {
  padding: 1.5rem 0;
    color: #000000;
    position: relative;
    display: inline-block;
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    line-height: 1.4;
    letter-spacing: 1px;
    text-align: center;
    font-style: normal;
    width: 100%;
    margin: 0 auto;
}
.col-md-12 p {
   font-size: 1rem;
}

.endesa-main__title--strong {
  font-weight: 700;
}

.endesa-main__title--second {
  padding: 50px 0 98px 0;
}

.endesa-main__section {
  position: relative;
  display: block;
  padding: 0 0 50px;
}

.endesa-advantajes {
  display: block;
  position: relative;
  padding: 10px 0;
  max-width: 385px;
  margin: 0 auto;
}

.endesa-advantajes__container-img {
  display: block;
  min-height: 240px;
  position: relative;
}

.endesa-advantajes__container-img-bottom {
  position: absolute;
  display: block;
  bottom: 0;
  width: 100%;
}

.endesa-advantajes__container-text {
  display: block;
  position: relative;
  padding: 10px;
  margin: 0 auto;
}

.endesa-advantajes__figure {
  display: block;
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 300px;
}

/*
.endesa-advantajes__figure--a {
    max-width: 190px;
    max-width: 11.875rem;
}
.endesa-advantajes__figure--b {
    max-width: 186px;
    max-width: 11.625rem;
}
*/
.endesa-image-second {
   width: 70% !important;
   padding-bottom: 20px;
}
.endesa-image-down {
    width: 50% !important;
    padding-bottom: 20px;
    margin: 0 auto;
}

.endesa-advantajes__img {
  display: block;
  width: 100%;
}

.endesa-advantajes__title {
  text-align: center;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 18px;
  color: #000000;
  text-align: center;
  padding: 10px 45px;
}

.endesa-advantajes__text {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  color: #838383;
}

.endesa-container-grey {
  background: whitesmoke;
}
.endesa-container--faqs .container-fluid {
    width: 75%;
}
.endesa-container--faqs {
  position: relative;
  display: block;
  width: 100%;
  padding: 0 0 6rem;
}
.endesa-container--faqs ul {
    margin-bottom: 1rem;
    list-style-position: outside;
    line-height: 1.5;
}
.op-bullet {
    padding-left: 1rem;
}
.op-bullet li {
    position: relative;
    list-style: none;
    font-family: 'RoobertENEL';
    font-size: 1rem;
    line-height: 1.5;
    letter-spacing: normal;
    /* color: #000; */
    color: #353535;
    margin-bottom: 1.44rem;
}
.op-bullet li:before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ddd;
    left: -20px;
    top: calc(0.82em - 4px);
    position: absolute;
}
.endesa-check-container .endesa-confirmacion-text {
    width:75%;
}


.endesa-check-container .op-bullet  {
    padding-left: 6rem;
}
.endesa-check-container .op-bullet li {
    position: relative;
    list-style: none;
    font-family: 'RoobertENEL';
    font-size: 1.5rem;
    line-height: 1.5;
    letter-spacing: normal;
    /* color: #000; */
    color: #353535;
    margin-bottom: 1.44rem;
}

#contact-data-div {
    display: none;
}

#landing-idioma-div {
    display: none;
}

.e-footer {
            width: 100%;
            margin: 0 auto;
            display: flex;
            align-items: flex-start;
            background-color: #000000;
        }
.subfooter {
            max-width: 1200px;
            margin: 0 auto;
            width: 95%;
        }
.footer-in {
            max-width: 1200px;
            width: 90%;
            padding: 25px 0;
            display: flex;
            flex-direction: column;
        }
.footer-in .footerUp {
            display: flex;
            flex-wrap: wrap;
        }

.footer-in .footerUp .separate {
            padding: 0 10px;
            
        }
.footer-in .footerDown {
            padding-top: 5px;
            font-size: 15px;
            font-weight: 300;
            color: #6f7f96;
            font-family:'RoobertENEL Light';
}

#text-footer1, #text-footer2 {
            font-size: 15px;
            color: #ffffff;
            font-family:'RoobertENEL';
}


@keyframes spin {
  0% {
      transform: rotate(0deg);
  }

  100% {
      transform: rotate(360deg);
  }
}


@keyframes cross {
  0% {
      background-size: 11px 3px, 3px 3px;
      height: 43px;
      background-position: 50% calc(50% - 2px);
  }

  25% {
      background-size: 11px 3px, 3px 3px;
      height: 43px;
      background-position: 50% calc(50% - 2px);
  }

  65% {
      background-size: 11px 3px, 3px 11px;
      height: 43px;
      /*
background-position: 50% calc(50% - 2px);
*/
  }

  100% {
      background-size: 11px 3px, 3px 11px;
      height: 39px;
      background-position: 50% 50%;
  }
}

@keyframes crossReverse {
  0% {
      background-size: 11px 3px, 3px 11px;
      height: 39px;
      background-position: 50% 50%;
  }

  25% {
      background-size: 11px 3px, 3px 11px;
      height: 39px;
      background-position: 50% 50%;
  }

  65% {
      background-size: 11px 3px, 3px 3px;
      height: 39px;
      /*
background-position: 50% 50%;
*/
  }

  100% {
      background-size: 11px 3px, 3px 3px;
      height: 43px;
      background-position: 50% calc(50% - 2px);
  }
}

@keyframes closeAccordionn {
  0% {
      opacity: 0;
      display: block;
  }

  100% {
      opacity: 1;
      display: none;
  }
}

@keyframes openAccordionn {
  0% {
      opacity: 1;
      display: none;
  }

  100% {
      opacity: 0;
      display: block;
  }
}


/* COOKIES */
/*
#modalCookies .modal-dialog {
  width: 630px;
  max-width: 82%;
  margin-top: 5rem;
}

#modalCookies .modal-header {
  padding: 16px 16px 0 16px;
  border: none;
}

#modalCookies .modal-body {
  padding: 0;
}

#modalCookies .modal-content {
  border: none;
  border-radius: 0;
}

.endesa-cookies {
  display: inline-block;
  background: rgba(0, 0, 0, 0.5);
  text-align: center;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
}

.endesa-cookies--accepted {
  display: none;
}

.endesa-cookies__content {
  display: inline-block;
  max-height: calc(100vh - 120px);
  padding: 45px 40px;
  background: #ffffff;
  text-align: left;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
  top: 0;
  right: 0;
  left: 0;
}

.endesa-cookies__title {
  margin: 0 0 25px 0;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2222222222;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  color: #000000;
}

.endesa-cookies__title--small {
  display: inline-block;
  font-size: 16px;
}

.endesa-cookies__tab-nav {
  display: block;
  position: relative;
}

.endesa-cookies__tab-nav:after {
  display: block;
  border-bottom: 1px solid #C2CDDD;
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.endesa-cookies__tab-nav-content {
  display: block;
  margin: 0;
  padding: 0;
  position: relative;
}

.endesa-cookies__tab-nav-item {
  display: inline-block;
  margin: 0 32px 0 0;
  padding: 0;
  font-size: 16px;
  text-align: left;
  line-height: 1.5;
  border-bottom: 1px solid transparent;
  position: relative;
  z-index: 2;
}

.endesa-cookies__tab-nav-item--active {
  font-weight: 700;
  border-bottom: 1px solid #0E141A;
}

button.endesa-cookies__tab-nav-button {
  margin: 0;
  padding: 12px 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  font-size: inherit;
  font-weight: inherit;
  text-align: left;
  outline-offset: -1px;
  color: #000;
}

button.endesa-cookies__tab-nav-button:hover,
button.endesa-cookies__tab-nav-button:focus,
button.endesa-cookies__tab-nav-button:visited {
  background: transparent;
  color: #000;
}

.endesa-cookies__tab-nav-item--active button.endesa-cookies__tab-nav-button {
  font-weight: 700;
}

.endesa-cookies__tab {
  display: block;
  padding: 30px 0 0;
}

.endesa-cookies__tab--hidden {
  display: none;
}

.endesa-cookies__tab-content {
  display: block;
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid #C2CDDD;
  position: relative;
}

.endesa-cookies__text {
  margin: 0;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 20px;
  text-rendering: optimizeLegibility;
  color: #667790;
}

.endesa-cookies__btn {
  display: inline-block;
  width: auto;
  margin: 1px 15px 0 0;
  padding: 0 20px;
  background: #D3135A;
  appearance: none;
  box-shadow: none;
  border: 1px solid #D3135A;
  border-radius: 0.2rem;
  font-size: 16px;
  line-height: 45px;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s linear;
  position: relative;
}

.endesa-cookies__btn:hover {
  background: #ad1457;
  color: #fff;
}

.endesa-cookies__btn--save {
  background: transparent;
  border: 1px solid #C2CDDD;
  color: #0E141A;
  opacity: 0.3;
  transition: opacity 0.2s;
}

.endesa-cookies__btn--save:hover {
  background: transparent;
  border: 1px solid #C2CDDD;
  color: #0E141A;
  opacity: 1;
}

.endesa-cookies__link {
  margin-top: 2.5rem;
  box-sizing: border-box !important;
}

.endesa-cookies__link-text {
  display: inline-block;
  margin: -0.55rem 0;
  padding: 0.55rem 0;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  color: #D3135A;
  position: relative;
}

.endesa-cookies__link-text:hover {
  text-decoration: underline;
  color: #D3135A;
}

.endesa-cookies__link-text:after {
  display: inline-block;
  width: 8px;
  height: 12px;
  padding-left: 20px;
  background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
  background-repeat: no-repeat;
  background-size: 8px 12px;
  background-position: center;
  content: "";
  position: absolute;
  bottom: 10px;
}

.endesa-cookies__tab-input {
  display: inline-block;
  padding: 0;
  text-align: right;
  position: absolute;
  right: 0;
}

.endesa-cookies__tab-input-label {
  font-size: 16px;
}

.endesa-cookies__tab-input-label input[type=radio] {
  display: inline-block;
  width: 16px;
  min-width: 16px;
  height: 16px;
  vertical-align: middle;
  font-size: 0;
  cursor: pointer;
  background: transparent;
  border: 0.1rem solid #C2CDDD;
  border-radius: 50%;
  appearance: none;
  outline: 0;
  -webkit-appearance: none;
  position: relative;
}

.endesa-cookies__tab-input-label input[type=radio] {
  margin: 0 0.25rem 0 15px;
  transform: translateY(-0.1rem);
  -webkit-appearance: none;
}

.endesa-cookies__tab-input-label input[type=radio]:checked {
  background: #D3135A;
  border-color: #D3135A;
}

.endesa-cookies__tab-input-label input[type=radio]:checked:after {
  width: 5px;
  height: 5px;
  background: #ffffff;
  border-radius: 50%;
  content: "";
  visibility: visible;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
}

.endesa-cookies__close {
  display: block;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  font-size: 0;
  cursor: pointer;
  border: 0;
  position: absolute;
  right: 0;
  z-index: 1;
}

.endesa-cookies__close:before,
.endesa-cookies__close:after {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: #666;
  position: absolute;
  top: 22px;
  left: 13px;
}

.endesa-cookies__close:before {
  transform: rotate(45deg);
}

.endesa-cookies__close:after {
  transform: rotate(-45deg);
}

.endesa-cookies__accesible {
  width: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
  box-sizing: border-box;
  position: absolute !important;
}

.endesa-cookies-faldon {
  width: 100%;
  padding: 1.5rem;
  background: #0E141A;
  color: #FFFFFF;
  transform: translateY(100%);
  transition: all 0.8s ease-in-out, opacity 2s ease-out;
  transform: translateY(0);
  transition: all 0.8s ease-in-out, opacity 2ms;
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 998;
}

.endesa-cookies-faldon--close {
  display: none;
}

.endesa-cookies-faldon__container {
  display: block;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 30px 0px 0;
  position: relative;
}

.endesa-cookies-faldon__container-close {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
}

.endesa-cookies-faldon__close,
.endesa-cookies-faldon__close:hover {
  display: block;
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: center;
  position: relative;
}

.endesa-cookies-faldon__close--link {
  display: inline;
  text-decoration: underline;
  color: #ffffff;
  background: transparent;
}

.endesa-cookies-faldon__close--link:visited,
.endesa-cookies-faldon__close--link:hover,
.endesa-cookies-faldon__close--link:active,
.endesa-cookies-faldon__close--link:focus {
  color: #ffffff;
}

.endesa-cookies-faldon__accesible {
  width: 0;
  height: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
  border: 0;
  box-sizing: border-box;
  position: absolute !important;
}

.endesa-cookies-faldon__text {
  width: 100%;
  max-width: 1092px;
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.3846;
  color: #fff;
}
*/

.ui-dialog .endesa-modal {
  border: none;
  background: white;
  padding: 15px;
  padding: 0.9375rem;
}

.ui-dialog .endesa-modal__title {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400 !important;
  font-size: 24px;
  font-size: 1.5rem;
  color: #d42c54;
  padding-left: 25px;
  padding-left: 1.5625rem;
}

.ui-dialog .endesa-modal__text {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  font-size: 0.875rem;
  color: #333333;
  padding-left: 25px;
  padding-left: 1.5625rem;
  line-height: 27px;
  line-height: 1.6875rem;
}

.ui-dialog .endesa-modal__figure {
  display: inline-block;
  margin: 0 25px;
  margin: 0 1.5625rem;
}

.ui-dialog .endesa-modal__img {
  display: block;
  width: 100%;
}

.ui-dialog .ui-dialog-titlebar {
  border: none;
  background: white;
  padding: 15px;
  padding: 0.9375rem;
}

.ui-dialog .ui-dialog-title {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 24px;
  font-size: 1.5rem;
  color: #d42c54;
  padding-left: 25px;
  padding-left: 1.5625rem;
}

.ui-dialog .ui-dialog-titlebar-close {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 24px;
  font-size: 1.5rem;
  color: #c9c9c9;
  border: none;
  background: white;
  float: right;
}

.ui-widget-overlay {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
}


.modal-header,
.modal-footer {
  border: none;
}

.endesa-alert-popup {
  padding: 0 1rem 4rem 1rem;
}


.endesa-modal {
  display: none;
}

.endesa-modal__text {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  font-size: 0.875rem;
  color: #333333;
  padding-left: 25px;
  padding-left: 1.5625rem;
  line-height: 27px;
  line-height: 1.6875rem;
}

.endesa-modal__text--strong {
  font-weight: 800;
}

.endesa-modal__title {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  font-size: 0.875rem;
  color: #333333;
  padding: 15px 0 20px 25px;
  padding: 0.9375rem 0 1.25rem 1.5625rem;
  line-height: 27px;
  line-height: 1.6875rem;
  text-transform: uppercase;
}

.endesa-modal__figure {
  display: inline-block;
  margin: 0 25px;
  margin: 0 1.5625rem;
}

.endesa-modal__img {
  display: block;
  width: 100%;
}

.endesa-modal__btn-container {
  position: relative;
  display: block;
  margin: 15px 0;
  margin: 0.9375rem 0;
  text-align: center;
}

.endesa-modal__btn {
  position: relative;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 600;
  font-size: 15px;
  font-size: 0.9375rem;
  color: white;
  letter-spacing: 1px;
  letter-spacing: 0.0625rem;
  border-radius: 0.25rem;
  border: none;
  background: #f16101;
  padding: 11px 30px;
  padding: 0.6875rem 1.875rem;
  text-align: center;
  height: auto;
  min-height: 46px;
  min-height: 2.875rem;
  overflow: hidden;
  cursor: pointer;
  display: inline-block;
  width: auto;
  line-height: initial;
}



.endesa-footer {
  display: block;
  width: 100%;
  background: #000000;
  padding: 10px 10px;
  height: 10vh;
}

.endesa-footer__content {
  position: relative;
  display: block;
}

.endesa-footer__text {
  position: relative;
  display: block;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  font-size: 0.875rem;
  color: #FFFFFF;
  text-decoration: none;
  text-align: left;
}

.endesa-footer__link {
  position: relative;
  display: inline-block;
  vertical-align: bottom;
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-weight: 400;
  font-size: 14px;
  font-size: 0.875rem;
  color: #FFFFFF;
  text-decoration: underline;
  padding-bottom: 8px;
}

.endesa-footer__link:hover,
.endesa-footer__link:active,
.endesa-footer__link:focus {
  color: #757575;
}

.endesa-footer__link:visited {
  color: #FFFFFF;
}



.endesa-fixed-footer--thanks {
  padding-bottom: 220px;
  min-height: calc(100vh - 180px);
}


.endesa-header--thanks {
  background: #FFFFFF;
}

.endesa-thanks__title {
  font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 46px;
  font-size: 2.875rem;
  line-height: 50px;
  line-height: 3.125rem;
  font-weight: 700;
  color: #d42c54;
  text-align: center;
  margin-bottom: 30px;
  margin-bottom: 1.875rem;
}

.endesa-thanks__text {
  /*font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 20px;
  font-size: 1.25rem;
  line-height: 20px;
  font-weight: 400;
  color: #d42c54;
  text-align: center;*/
  width: 75%;
  margin: 0 0 1.5rem 3rem;
  font-family: RoobertENEL;
  font-size: 1.875rem;
  font-weight: normal;
  font-stretch: normal;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  color: #000000;
}

.endesa-confirmacion__list-text {
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 23px;
    padding: 10px 0 10px 0;
    margin-left: 3rem;
    width: 75%;
}
.endesa-confirmacion__list-text2 {
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 300;
    font-size: 1.125rem;
    line-height: 23px;
    padding: 10px 0 10px 0;
    margin-left: 3rem;
    width: 75%;
}
.endesa-confirmacion-text {
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 300;
    font-size: 1.4rem;
    line-height: 23px;
    margin-left: 3rem;
    padding-bottom: 1.875rem;
}
.endesa-confirmacion-text2 {
    font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
    font-weight: 300;
    font-size: 1.4rem;
    line-height: 23px;
    margin-left: 3rem;
    padding-bottom: 1.875rem;
    width: 75%;
}
  
.endesa-thanks__text_verde {
  /*font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  line-height: 20px;
  font-weight: 400;
  color: #00883d;
  text-align: left;
  padding-bottom: 0.5rem;*/
  margin: 0 0 1.5rem 3rem;
  font-family: RoobertENEL;
  font-size: 1.875rem;
  font-weight: normal;
  font-stretch: normal;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  color: #00883d;
}
.endesa-thanks__text_verde2 {
  /*font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  line-height: 20px;
  font-weight: 400;
  color: #00883d;
  text-align: left;
  padding-bottom: 0.5rem;*/
  margin: 0 0 1.5rem 3rem;
  font-family: RoobertENEL;
  font-size: 1.875rem;
  font-weight: normal;
  font-stretch: normal;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  color: #00883d;
}

.endesa-thanks__text_rojo {
  /*font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
  font-size: 1.25rem;
  line-height: 20px;
  font-weight: 400;
  color: #d42c54;
  text-align: left;
  margin-bottom: 3rem;*/
  margin: 0 0 1.5rem 3rem;
  font-family: RoobertENEL;
  font-size: 1.875rem;
  font-weight: normal;
  font-stretch: normal;
  font-style: normal;
  line-height: normal;
  letter-spacing: normal;
  color: #d42c54;
}

.check {
  color: #00883d;
  font-size: 300%;
  margin-left: 3rem;
}

.icon_check {
  background: url('https://image.digital.endesaclientes.com/lib/fe4115707564047f751d72/m/1/3b9637b1-df76-4b60-937c-24bda8fa65a2.png');
  height: 42px;
  width: 42px;
  display: block;
}

.icon_error {
  background: url('https://image.digital.endesaclientes.com/lib/fe4115707564047f751d72/m/1/6ae5e71a-1041-449f-818d-ce21cf6d2686.png');
  height: 54px;
  width: 67px;
  display: block;
  margin-bottom: 1rem;
}

.error {
  color: #d42c54;
  font-size: 300%;
  margin-left: 3rem;
}

.endesa-check-container {
  display: block;
  position: relative;
  width: 75%;
  text-align: left;
}

.endesa-btn__volver{
  width: 75%;
  margin-left: 3rem;
}

.endesa-thanks {
  position: relative;
  display: block;
  margin: 200px 0 0 0;
  padding: 0 20px;
}

.endesa-logo__link--thanks {
  display: block;
  position: relative;
  background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
  width: 200px;
  height: 52px;
  background-repeat: no-repeat;
  background-size: 100% auto;

}
.endesa-logo__link--thanks2 {
  display: block;
  position: relative;
  background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
  width: 200px;
  height: 52px;
  background-repeat: no-repeat;
  background-size: 100% auto;

}

.endesa-footer--thanks {
  bottom: 0;
}






@media only screen and (min-width: 992px) and (max-width: 1299.5px) {
  .endesa-header-language {
    margin: 0 0 54px;
  }

  .endesa-thanks {
      margin: 50px 0;
  }

  .endesa-header {
      padding: 50px;
  }

  .endesa-header--thanks {
      background: none;
  }

  .endesa-title {
      bottom: 15%;
  }

  .endesa-logo{
      margin: 0 0 54px;
  }
  .endesa-logo--footer{
      margin: 0;
  }
  .endesa-info-campaign{
    padding: 10px 50px;
  }
  .endesa-banner{
    padding: 40px;
  }
  /*.endesa-main {
      padding: 50px;
  }*/

  .endesa-footer {
      padding: 50px;
  }
  .endesa-form__label--visible {
    padding-right:0;
  }

}

@media only screen and (min-width: 768px) and (max-width: 991.5px) {
 
   /*
  .endesa-btn__volver{
    width: 40%;
    margin-left: 3rem;
    margin-top: 5rem;
    float: right;
  }
  */

  .endesa-header-language {
     margin: 10px 0;
  } 

  .endesa-thanks {
      margin: 50px 0;
  }

  .endesa-header {
      background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
      background-repeat: no-repeat;
      background-position: top center;
      background-size: cover;
  }

  .endesa-header--thanks {
      background: none;
  }

  .endesa-logo{
      margin: 0 0 54px;
  }

  .endesa-title {
      position: relative;
      width: 100%;
      max-width: 100%;
      right: 0;
      left: 0;
      bottom: 0;
  }

  .endesa-title__title {
      font-size: 40px;
  }
  .endesa-title__container{
      padding: 0;
  }
  .endesa-container--faqs {
      padding: 0 50px 30px;
  }

  .endesa-info-campaign{
    padding: 10px 50px;
  }
  .endesa-banner{
    padding: 40px;
  }
  .endesa-banner__text-cnt {
      padding: 25px 50px 25px 25px;
      width: 100%;
  }

  .endesa-banner__text {
      font-size: 28px;
      line-height: 38px;
  }

  .endesa-banner__link {
      font-size: 26px;
  }

  .endesa-header {
      padding: 50px;
  }

  /*.endesa-main {
      padding: 50px;*/
  }
  .endesa-main__title{
    padding: 0;
  }

  .endesa-main__title--second{
    padding: 50px;
  }

  .endesa-footer {
      padding: 50px;
  }

  .endesa-promo-info {
      display: block;
      position: relative;
      max-width: 100%;
      padding-right: 0;
      padding-bottom: 1rem;
  }

  .endesa-promo-info__text {
      font-size: 24px;
  }

  .endesa-promo-info__list-title {
      font-size: 26px;
  }

  .endesa-promo-info__list {
      font-size: 24px;
  }

  .endesa-logo--footer{
      margin: 0;
  }

  .endesa-form {
      max-width: 100%;
  }
}

@media only screen and (max-width: 767.5px) {
  .endesa-header-language__active--black2:focus {
      text-decoration: none;
      color: white !important;
    }
  .endesa-thanks__text_rojo { margin: 0 0 1.438rem 0;}
  .error{margin-left: 0;}
  .endesa-link--clientes{ color: #d42c54; }
  .endesa-thanks__text { margin-left: 0;  width: 100%; }
  .endesa-thanks__text_verde { margin-left: 0;  width: 100%;}
  .endesa-confirmacion-text { margin-left: 0; width: 100%;}
  .endesa-confirmacion__list-text { margin-left: 0;  width: 100%;}
  .endesa-thanks__text_verde2 { color: white; margin-left: 0;  width: 100%;}
  .endesa-confirmacion-text2 { color: white; margin-left: 0; width: 100%;}
  .endesa-confirmacion__list-text2 { color: white; margin-left: 0;  width: 100%;}
  .check { color: white; margin-left: 0;}
  .endesa-header-language__active--black2{ color: white !important; }
  .endesa-logo__link--thanks2{ background-image:url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg)}
  .endesa-body--thanks{ 
      background:#008c5a;
 }

 .endesa-btn__volver{
      width: 100%;
      margin-top: 5rem;
      margin-left: 3rem;
      float: right;
    }

    .endesa-header-language__active:after {
        content: url(https://image.digital.endesaclientes.com/lib/fe341570756405757c1478/m/1/0db5525e-25cc-40c1-a91c-6e4e7069f77d.png);
        width: 8px;
        height: 9px;
        margin-left: 7px;
    }
    .endesa-header-language__active {
        font-size: 11px;
    }

    .endesa-header-language {
     margin: 20px 15px 54px;
  }

  .endesa-title{
      right: 0;
      left: 0;
  }
  .endesa-title__container{
      padding: 0;
  }
  .endesa-thanks {
      margin: 50px 0;
  }

  .endesa-header {
      background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
      background-repeat: no-repeat;
      background-position: top center;
      background-size: cover;
  }

  .endesa-header--thanks {
      background: none;
  }

  .endesa-logo{
      margin: 10px 15px 54px;
  }

  .endesa-title {
      position: relative;
      width: 100%;
      max-width: 100%;
      margin-bottom: 50px;
  }

  .endesa-title__text{
    text-align: center;
    font-size: 24px;
  }

  .endesa-title__title {
      font-size: 28px !important;
      text-align: center;
  }
  .endesa-title__title--mobile{
    display: block;
  }
  
  .endesa-title__title--desktop{
    display: none;
  }

  .endesa-form {
      max-width: 100%;
  }
  .endesa-info-campaign{
    padding: 10px 50px;
  }

  .endesa-info-campaign__text{
    font-size: 24px;
  }

  .endesa-banner{
    display: block;
    padding: 40px;
  }

  .endesa-banner__img-cnt {
      margin: 0 auto;
      max-width: 100%;
      min-height: auto;
      width: 100%;
      height: auto;
      text-align: center;
  }

  .endesa-banner__figure {
      max-width: 100%;
      margin: 0;
  }

  .endesa-banner__text-cnt {
      padding: 20px;
  }

  .endesa-banner__text {
      font-size: 24px;
      line-height: normal;
  }

  .endesa-banner__text--small {
      font-size: 24px;
  }


  .endesa-cursor__content:before {
      top: 10px;
      width: 16px;
      height: 56px;
  }

  .endesa-cursor__content {
      padding-left: 37px;
  }

  .endesa-promo-info {
      padding-bottom: 25px;
  }

  .endesa-header {
      padding: 0;
  }

  .endesa-main {
      padding: 0;
  }

  .endesa-footer {
      padding: 25px;
  }

  .endesa-promo-info__list-container {
      padding: 0 0 25px;
  }

  .endesa-advantajes{
      padding-bottom: 50px;
  }
  .endesa-faq__title-link{
      min-height: 75px;
  }

  .endesa-form {
      margin-bottom: 25px;
  }

  .endesa-form__group {
      height: auto;
  }

  .endesa-form__group--col-2-lf {
      display: block;
      width: 100%;
      position: relative;
      text-align: center;
      margin-bottom: 25px;
      padding: 0;
  }


  .endesa-form__group--col-2-rg {
      display: block;
      width: 100%;
      position: relative;
      text-align: center;
      margin-bottom: 25px;
      padding: 0;
  }

  .endesa-footer {
      bottom: -215px;
  }

  .endesa-footer__text {
      text-align: center;
  }

  .endesa-logo--footer {
      text-align: center;
      margin: 25px 0 0;
  }

  .endesa-popUpHelp__container {
      top: 25px;
  }


  .endesa-cookies__content {
      margin: 0;
      overflow: auto;
      max-width: 100%;
      padding: 80px 40px;
      max-height: 100vh;
  }

  .endesa-cookies__container-close {
      top: 0;
      right: 0;
      left: 0;
      width: 100%;
      border-bottom: 1px solid #C2CDDD;
  }

  .endesa-cookies__close {
      background-size: 20px 20px;
  }

  .endesa-cookies__tab-input {
      width: 100%;
      text-align: left;
      position: relative;
      padding: 0 0 10px;
  }

  .endesa-cookies__tab-nav-item {
      width: 100%;
      border-bottom: 1px solid #C2CDDD;
  }

  .endesa-cookies__tab-nav-item--active {
      border-color: #0E141A;
  }

  .endesa-cookies__tab-input-label input[type=radio] {
      margin: 0 0.25rem 0 0;
  }

  .endesa-cookies__btn {
      margin: 1px 0 25px 0;
      padding: 0 20px;
      max-width: 100%;
  }

  .endesa-cookies-faldon {
      padding: 0.6rem 1rem 1.5rem;
  }

  .endesa-cookies-faldon__text {
      padding-top: 27px;
  }

  .endesa-footer {
      bottom: -164px;
  }

  .endesa-container--faqs {
      padding: 0 17px 50px;
  }

  .endesa-faq__title-link {
      padding: 16px 30px 17px 69px;
  }

  .endesa-faq__item a:first-child {
      padding-top: 16px;
  }

  .endesa-fixed-footer--thanks {
      padding-bottom: 245px;
      min-height: calc(100vh - 57px);
  }

  .endesa-thanks {
      margin: 45px 0 0 0;
  }

  .endesa-fixed-footer--thanks {
      padding-bottom: 120px;
      min-height: 0;
  }
  .col-lg-6, .col-sm-6, .col-md-6, .col-md-12{
      flex: 100%;
      -ms-flex: 100%;
      width: 100%;
  }

}


@media only screen and (max-width: 480px) {
   .endesa-header-language__active--black2:focus {
      text-decoration: none;
      color: white !important;
    }
  .endesa-thanks__text_rojo { margin: 0 0 1.438rem 0;}
  .error{margin-left: 0;}
  .endesa-header {
      background-image: url(https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/fa483f50-4a34-4275-959e-b7435a52d346.jpg);
      background-repeat: no-repeat;
      background-position: top center;
      background-size: cover;
  }

  .endesa-header--thanks {
      background: none;
  }

  .endesa-title {
      position: relative;
      width: 100%;
      max-width: 100%;
      margin-bottom: 25px;
      margin-top: 32px;
  }

  .endesa-title__title {
      text-align: center;
  }

  .endesa-title__title--mobile{
    display: block;
  }
  
  .endesa-title__title--desktop{
    display: none;
  }

  h1 {
      font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
      font-size: 18px !important;
      line-height: 1.2 !important;
  }

  H2 {
      font-family: "RoobertENEL", Arial, Helvetica, sans-serif;
      font-size: 16px !important;
      line-height: 1.2 !important;
  }

  .endesa-popUpHelp__container-text ol,
  .endesa-popUpHelp__container-text ol li .endesa-popUpHelp__title {
      font-size: 14px;
  }

  .endesa-popUpHelp__container-text ol li ol {
      margin: 0 0 50px 20px;
  }
  .endesa-link--clientes{ color: white; }
  .endesa-thanks__text { margin-left: 0;  width: 100%; }
  .endesa-thanks__text_verde { margin-left: 0;  width: 100%;}
  .endesa-confirmacion-text { margin-left: 0; width: 100%;}
  .endesa-confirmacion__list-text { margin-left: 0;  width: 100%;}
  .endesa-thanks__text_verde2 { color: white; margin-left: 0;  width: 100%;}
  .endesa-confirmacion-text2 { color: white; margin-left: 0; width: 100%;}
  .endesa-confirmacion__list-text2 { color: white; margin-left: 0;  width: 100%;}
  .check { margin-left: 0;}
  .endesa-check-container{
    display: block;
    position: relative;
    text-align: left;
 }

 
}
(function ($) {
    /*
     * Accordion jquery 
     */
    $.accordion = (function () {
        var init = function (element) {
            $('[data-toggle="expand"]').click(function (e) {
                e.preventDefault();
                if (!$(this).hasClass('collapsed')) {
                    $(this).addClass('collapsed');
                } else {
                    $(this).removeClass('collapsed');
                }
            });
        };
        return {
            init: init
        };
    })();

    $(document).ready(function () {
        if ($('[data-function="fc-accordion"]').length > 0) {
            $.accordion.init();
        }
    });
})(jQuery);

/*Refrescador de pagina por seguridad*/
setTimeout(securityReload, 3600000);
      function securityReload() {
        location.reload();
}

/*Desplegable de idiomas*/
$(document).ready(function() {
  var selectLang = 0;
  
  loadLanguageOptions();
  
  $(".endesa-header-language").click(function(e) {
    e.stopPropagation(); // Evitar que el evento se propague
    $(".endesa-header-language__list").slideToggle("fast");
    selectLang = !selectLang; // Alternar el estado
  });
  
  $(document).on("click", function() {
    $(".endesa-header-language__list").slideUp("fast");
    selectLang = 0;
  });
});

function loadLanguageOptions() {
  var languageOpt1Url = document.getElementById('landing1').value;
  var languageOpt1Name = document.getElementById('landing1name').value;
  var languageOpt2Url = document.getElementById('landing2').value;
  var languageOpt2Name = document.getElementById('landing2name').value;
  
  var languageOptionsHTML = 
    '<li class="endesa-header-language__item" data-function="fc-item">' +
      '<a class="endesa-header-language__link" data-function="fc-link" href="' + languageOpt1Url + '" title="' + languageOpt1Name + '">' + 
        languageOpt1Name + 
      '</a>' +
    '</li>' +
    '<li class="endesa-header-language__item" data-function="fc-item">' +
      '<a class="endesa-header-language__link" data-function="fc-link" href="' + languageOpt2Url + '" title="' + languageOpt2Name + '">' + 
        languageOpt2Name + 
      '</a>' +
    '</li>';
  
  document.getElementById('fcMenu').innerHTML += languageOptionsHTML;
  
  document.getElementById('fcMenu').style.display = "none";
}


/*Muestra los mensajes de error del formulario*/
function showError(inputError, subError) {
    stopSending();
    switch (inputError) {
        case 2:
            document.getElementById('documentGroup').classList.add("endesa-form__group--invalid");
            switch (subError) {
                case 1:
                    document.getElementById('documentError').innerHTML = nifErrorMessage;
                    break;
                case 2:
                    document.getElementById('documentError').innerHTML = nieErrorMessage;
                    break;
                case 3:
                    document.getElementById('documentError').innerHTML = cifErrorMessage;
                    break;
                case 4:
                    document.getElementById('documentError').innerHTML = passaportErrorMessage;
                    break;
                default:
                    document.getElementById('documentError').innerHTML = documentErrorMessage;
            }
            break;
        case 3:
            switch (subError) {
                case 1:
                    document.getElementById('emailGroup').classList.add("endesa-form__group--invalid");
                    document.getElementById('emailError').innerHTML = emailErrorMessage;
                    break;
                case 2:
                    document.getElementById('emailCGroup').classList.add("endesa-form__group--invalid");
                    document.getElementById('emailCError').innerHTML = emailErrorMessage;
                    break;
                case 3:
                    document.getElementById('emailsGroup').classList.add("endesa-form__group--invalid");
                    document.getElementById('emailsError').innerHTML = emailSameErrorMessage;
                    break;
                default:
                    document.getElementById('emailsGroup').classList.add("endesa-form__group--invalid");
                    document.getElementById('emailCError').innerHTML = emailErrorMessage;
            }
            break;
      case 4:
            break;
        default:
            document.getElementById('documentGroup').classList.add("endesa-form__group--invalid");
            document.getElementById('documentError').innerHTML = documentErrorMessage;

            document.getElementById('emailsGroup').classList.add("endesa-form__group--invalid");
            document.getElementById('emailsError').innerHTML = emailErrorMessage;
    }
}

/*Oculta Mensajes de Error del formulario*/
function hiddenErrors(inputError) {
    switch (inputError) {
        case 2:
            document.getElementById('documentGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentError').innerHTML = "";
            document.getElementById('documentSupraGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentSupraError').innerHTML = "";
            break;
        case 3:
            document.getElementById('emailGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('emailCGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('emailsGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('emailsError').innerHTML = "";
            document.getElementById('emailError').innerHTML = "";
            document.getElementById('emailCError').innerHTML = "";
            break;
        case 5:
            document.getElementById('emailCError').innerHTML = "";
        case 6: 
            document.getElementById('emailError').innerHTML = "";
        default:

            document.getElementById('documentGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentError').innerHTML = "";

            document.getElementById('documentSupraGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('documentSupraError').innerHTML = "";

            document.getElementById('emailGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('emailCGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('emailsGroup').classList.remove("endesa-form__group--invalid");
            document.getElementById('emailsError').innerHTML = "";
            document.getElementById('emailError').innerHTML = "";
            document.getElementById('emailCError').innerHTML = "";
    }
};

function changeDocument() {
    validDocument();
    validFormat();
}
                                                  
/*
 * Document validation
 */
function validDocument() {
    var select = document.getElementById("documentType");
    var opc = select.options[select.selectedIndex].value;
    var userDocument = document.getElementById('document').value;
    userDocument = userDocument.replace('-','');
    userDocument = userDocument.replace('-','');
    document.getElementById("documentHidden").value = userDocument;
                      
    switch (opc) {
        case "nif":
            if (!validateDNI(userDocument)) {
                showError(2, 1);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        case "nie":
            if (!validateNIE(userDocument)) {
                showError(2, 2);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        case "cif":
            if (!validateCIF(userDocument)) {
                showError(2, 3);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        case "pasaporte":
            if (!validatePASSAPORT(userDocument)) {
                showError(2, 4);
                lockButton();
                return false
            } else {
                hiddenErrors(2);
                return true
            }
            break;
        default:
            showError(2);
            lockButton();
            return false
    };
};

function validateDNI(dni) {
    if (dni.length == 9) {
        var letras = ['T', 'R', 'W', 'A', 'G', 'M', 'Y', 'F', 'P', 'D', 'X', 'B', 'N', 'J', 'Z',
            'S', 'Q', 'V', 'H', 'L', 'C', 'K', 'E', 'T'
        ];
        var numero = dni.substring(0, 8);
        var letra = dni.substring(8, 9);
        letra = letra.toUpperCase();
        if (numero < 0 || numero > 99999999) {
            return false;
        } else {
            var letraCalculada = letras[numero % 23];
            if (letraCalculada != letra) {
                return false;
            } else {
                return true;
            }
        }
    } else {
        return false;
    }
};

function validateNIE(nie) {
    nie = nie.toUpperCase();
    // Basic format test
    if (!nie.match(
            '((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)')) {
        return false;
    }
    // Test NIE
    //T
    if (/^[T]{1}/.test(nie)) {
        return (nie[8] === /^[T]{1}[A-Z0-9]{8}$/.test(nie));
    }
    //XYZ
    if (/^[XYZ]{1}/.test(nie)) {
        return (
            nie[8] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt(
                nie.replace('X', '0')
                .replace('Y', '1')
                .replace('Z', '2')
                .substring(0, 8) % 23));
    }
    return false;
}

function validateCIF(cif) {
    // Quitamos el primer caracter y el ultimo digito
    var sum, num = [],
        value, controlDigit, validar, result;
    var valueCif = cif.substr(1, cif.length - 2);
    var suma = 0;
    value = cif.toUpperCase();
    // Sumamos las cifras pares de la cadena 
    for (var i = 1; i < valueCif.length; i = i + 2) {
        suma = suma + parseInt(valueCif.substr(i, 1));
    }
    for (var i = 0; i < 9; i++) {
        num[i] = parseInt(cif.charAt(i), 10);
    }
    var suma2 = 0;
    // Sumamos las cifras impares de la cadena
    for (var i = 0; i < valueCif.length; i = i + 2) {
        result = parseInt(valueCif.substr(i, 1)) * 2;
        if (String(result).length == 1) {
            // Un solo caracter
            suma2 = suma2 + parseInt(result);
        } else {
            // Dos caracteres. Los sumamos... 
            suma2 = suma2 + parseInt(String(result).substr(0, 1)) + parseInt(String(result)
                .substr(1, 1));
        }
    }
    // Sumamos las dos sumas que hemos realizado
    suma = suma + suma2;
    var unidad = String(suma).substr(1, 1);
    unidad = 10 - parseInt(unidad);
    var primerCaracter = cif.substr(0, 1).toUpperCase();
    if (primerCaracter.match(/^[FJKNPQRSUVW]$/)) {
        suma += '';
        controlDigit = 10 - parseInt(suma.charAt(suma.length - 1), 10);
        value += controlDigit;
        validar = num[8].toString() === String.fromCharCode(64 + controlDigit) || num[8]
            .toString() === value.charAt(value.length - 1);
        if (validar == true) return true;
        if (String.fromCharCode(64 + unidad).toUpperCase() == cif.substr(cif.length - 1, 1)
            .toUpperCase()) return true;
    }
    if (primerCaracter.match(/^[ABCDEFGHLM]$/)) {
        // Se revisa que el ultimo valor coincida con el calculo 
        if (unidad == 10) unidad = 0;
        suma += '';
        controlDigit = 10 - parseInt(suma.charAt(suma.length - 1), 10);
        value += controlDigit;
        validar = num[8].toString() === String.fromCharCode(64 + controlDigit) || num[8]
            .toString() === value.charAt(value.length - 1);
        if (validar == true) return true;
        if (String.fromCharCode(64 + unidad).toUpperCase() == cif.substr(cif.length - 1, 1)
            .toUpperCase()) return true;
    }
    return false;
};

function validatePASSAPORT(passport) {
    "use strict";
    return passport.length > 6 && passport.length < 18;
}

/*Valida uno u otro email*/
function validEmail(emailInput) {
    var validEmailValate = false;
    if (emailInput == 2) {
        var emailToValidate = document.getElementById('emailC').value;
    } else {
        var emailToValidate = document.getElementById('email').value;
    }
    var isEmail =
        /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    validEmailValate = isEmail.test(String(emailToValidate).toLowerCase());
    if (validEmailValate) {
        return true
    } else {
        return false
    };

}

/*Valida uno u otro email*/
function validEmails(emailInput) {
    var emailCToCompare = document.getElementById('emailC').value;
    var emailToCompare = document.getElementById('email').value;
    /*Si se ha modificado un imput de los emails*/
    if (emailInput) {
        console.log("Se ha modificado un input");
        if (emailInput == 2) {
            console.log("Se ha modificado el Email C");
            if (validEmail(2)) {
                console.log("El email C es valido");
                hiddenErrors(5);
                if (emailToCompare) {
                    console.log("Hay email A");
                    if (emailToCompare == emailCToCompare) {
                        console.log("Emails C iguales");
                        hiddenErrors(3);
                        return true
                    } else {
                        console.log("Email C no iguales");
                        showError(3, 3);
                        if(!validEmail(1)){
                            showError(3, 1);
                            console.log("Email A no valido");
                        }
                        lockButton();
                        return false
                    }
                } else {
                    console.log("No hay email A");
                    hiddenErrors(3);
                    lockButton();
                    return false
                }
            } else {
                console.log("El email C no es valido");
                showError(3, 2);
                lockButton();
                return false
            }
  } else {
            console.log("Se ha modificado el Email A");
            if (validEmail(1)) {
                console.log("El email A es valido");
                document.getElementById('emailError').innerHTML = "";
                if (emailCToCompare) {
                    console.log("Hay email C");
                    if (emailToCompare == emailCToCompare) {
                        console.log("Emails A iguales");
                        hiddenErrors(3);
                        return true
                    } else {
                        console.log("Email A no iguales");
                        showError(3, 3);
                        lockButton();
                        return false
                    }
                } else {
                    console.log("No hay email C");
                    hiddenErrors(3);
                    lockButton();
                    return false
                }
            } else {
                console.log("El email A no es valido");
                showError(3, 1);
                lockButton();
                return false
            }
        }

    } else {
        console.log("No se ha pasado ningun input");
        if (validEmail(1) && validEmail(2)) {
            if (emailToCompare == emailCToCompare) {
                console.log("Emails iguales");
                hiddenErrors(3);
                return true
            } else {
                showError(3, 3);
                lockButton();
                return false
            }
        } else {
            if(!validEmail(1)) {
    showError(3,1);
   } else {
    showError(3,2);
   }
            lockButton();
            return false
        }
    }
}

function proteccionDatosCheck() {
    console.log("Valida Proteccion Datos");
    if (document.getElementById('proteccionDatos').checked == true) {
        return true;
    } else {
        lockButton();
        return false;
    }
}


function otrasComunicacionesCheck() {
    console.log("Otras Comunicaciones");
    if (document.getElementById('otrasComunicaciones').checked == true) {
        return true;
    } else {
        lockButton();
        return false;
    }
}


function validFormat() {
    if ((validDocument()) && (validEmails()) && (proteccionDatosCheck())) {
        unlockButton();
        console.log("Formulario Valido");
        return true;
    } else {
        lockButton();
        console.log("Error en el formulario");
        return false;
    }
}

function unlockButton() {
    var btnSubmit = document.getElementById('btnSubmit');
    btnSubmit.removeAttribute("disabled");
    btnSubmit.classList.remove("endesa-form__btn--disable");
}

function lockButton() {
    var btnSubmit = document.getElementById('btnSubmit');
    btnSubmit.setAttribute("disabled", true);
    btnSubmit.classList.add("endesa-form__btn--disable");
}


/*Detecta si se han cambiado un check*/
function changeInput(input) {
    /*Recupera todos los inputs*/
    var documentInput = document.getElementById('document');
    var emailInput = document.getElementById('email');
    var emailCInput = document.getElementById('emailC');

        if ((documentInput.value) && (emailInput.value) && (emailCInput.value) && (proteccionDatosCheck())) {
            console.log("Con todos los datos");
            validFormat();
        } else {
            switch (input) {
                case 2:
                    validDocument();
                    console.log("Con Documento");
                    break;
                case 3:
                    validEmails(1);
                    console.log("Con Email");
                    break;
                case 4:
                    validEmails(2);
                    console.log("Con CEmail");
                    break;
                case 6:
                    proteccionDatosCheck();
                    console.log("Con Condiciones");
                    break;
                case 7:
                    otrasComunicacionesCheck();
                    console.log("Con Otras Comunicaciones");
                    break;
                default:
                    lockButton();
                    console.log("Sin datos");
            }
        }
    
}

function stopSending() {
    document.getElementById('SCForm').classList.remove("endesa-form--sending");
}
                                       
function visualSending() {
        if (validFormat()) {
            document.getElementById('SCForm').classList.add("endesa-form--sending");          
            /*ajax();*/
        } else {
            stopSending();
        }
    }   

/*Aviso Error Contrato y Documento*/
function errorContractDoc(errorType) {
    stopSending();
/*Muestra el error*/
   
        switch (errorType) {
            case 5:
                document.getElementById('documentSupraGroup').classList.add("endesa-form__group--invalid");
                document.getElementById('documentSupraError').innerHTML = docNoFound;
                //document.getElementById('documentSupraError').innerHTML = docInvent;
                break;
            case 11:
                document.getElementById('documentSupraGroup').classList.add("endesa-form__group--invalid");
                document.getElementById('documentSupraError').innerHTML = docInvalid;
                break;
            case 17:
                document.getElementById('documentSupraGroup').classList.add("endesa-form__group--invalid");
                /*document.getElementById('documentError').innerHTML = docNoRel;*/
                document.getElementById('documentSupraError').innerHTML = docInvalid;
                break;

            default:
                showError();
        }
    }
          
          
let ajaxFunction = document.getElementById('btnSubmit').addEventListener('click', ajaxPass);

var div = document.getElementById('contact-data-div');        

function ajaxPass() { 
 var idioma = document.getElementById('idiomaLanding').value;
 var ajaxResponse;
    var ajax = new XMLHttpRequest();


       ajax.onreadystatechange = function () {

            if (this.readyState == 4 && this.status == 200) {
 
                   ajaxResponse = this.responseText;
             
                    ajaxResponse = String(ajaxResponse)
              
   
              
if (ajaxResponse.indexOf('true') >= 0) {
  if (idioma == 'EN') { window.location.href = "https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-gracias-ML-EN";
          } 
  else if (idioma == 'CA') { window.location.href = "https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-gracias-ML-CA";
          }
  else { window.location.href = "https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-gracias-ML-ES";
          }
} else { 
  if (idioma == 'EN') { window.location.href = "https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-error-ML-EN";
          } 
  else if (idioma == 'CA') { window.location.href = "https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-error-ML-CA";
          }
  else { window.location.href = "https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-error-ML-ES";
          }
 }
             
              
                         }
               }
 
var paramsFormsToSent =  {     'Email':document.getElementById('email').value,
                               'Documento':document.getElementById('document').value,
                               'AccountId': div.getAttribute('data-account-id'),
                               'ContactId': div.getAttribute('data-contact-id'),
                               'otrasComunicaciones': document.getElementById("otrasComunicaciones").checked,
                               'proteccionDatos': document.getElementById("proteccionDatos").checked
          
                             }       
     console.log(paramsFormsToSent);                                          
               
     var ajaxUrl = "https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-ML-Ajax"
     
                     
     ajax.open("POST", ajaxUrl, "true");
     ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
     ajax.send("data="+JSON.stringify(paramsFormsToSent));
 
 }

          
    <script runat="server">
        Platform.Response.SetResponseHeader("Content-Security-Policy", "default-src 'self'; img-src 'self' https://image.digital.endesaclientes.com https://image.dev.notificaciones.endesaclientes.com;style-src 'self' https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-ML-CSS https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-CSS-Fuente https://cloud.digital.endesaclientes.com/css-bootstrap-ml; font-src 'self' https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-CSS-Fuente data:; script-src 'self' 'unsafe-inline' https://code.jquery.com/jquery-3.7.1.min.js https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-ML-JS https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-JS-errores-es;")
        Platform.Response.SetResponseHeader("X-Frame-Options", "DENY");
        Platform.Response.SetResponseHeader("X-Content-Type-Options", "nosniff");
        Platform.Response.SetResponseHeader("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload");
        Platform.Response.SetResponseHeader("Referrer-Policy", "no-referrer");
        Platform.Response.SetResponseHeader("Permissions-Policy", "geolocation=(), microphone=()");
  </script>

<script runat="server">

  Platform.Load("Core", "1.1.1")
  try {
    var data = Request.GetFormField("data");

    JSON = Platform.Function.ParseJSON(data);

    Email = JSON.Email;
    nDocumento = JSON.Documento;
    AccountId = JSON.AccountId;
    ContactId = JSON.ContactId;  
    otrasComunicaciones = JSON.otrasComunicaciones;
    proteccionDatos = JSON.proteccionDatos;
    today = new Date();
 
    
    Variable.SetValue("@accountIdAmpscript", AccountId);
    Variable.SetValue("@contactIdAmpscript", ContactId);
    Variable.SetValue("@emailAmpscript", Email);

</script>

%%[

SET @retrieveAcc = RetrieveSalesforceObjects('Account', 'Id, Identifier_Type__c, NIF_CIF_Customer_NIE__c', 'Id', '=', @accountIdAmpscript)
SET @accountId = Field(Row(@retrieveAcc, 1), 'Id')
SET @tipoDocumento = Field(Row(@retrieveAcc, 1), 'Identifier_Type__c')
SET @numDocumento = Field(Row(@retrieveAcc, 1), 'NIF_CIF_Customer_NIE__c')
SET @responseAcc = Concat(@accountId, ',', @tipoDocumento, ',', @numDocumento)

SET @retrieveCont = RetrieveSalesforceObjects('Contact', 'Id, NIF_CIF_Customer_NIE__c', 'Id', '=', @contactIdAmpscript)
SET @contactId = Field(Row(@retrieveCont, 1), 'Id')
SET @contactDocumento = Field(Row(@retrieveCont, 1), 'NIF_CIF_Customer_NIE__c')
SET @responseCont = Concat(@contactId, ',', @contactDocumento)

]%%

<script runat="server">

    var responseAcc = Variable.GetValue("@responseAcc");
    var responseCont = Variable.GetValue("@responseCont");

    if (responseAcc && responseCont) {
      var responseAccRowData = responseAcc.split(',');
      var accountData = {
        id: responseAccRowData[0],
        tipoDocumento: responseAccRowData[1],
        numDocumento: responseAccRowData[2]
      };
      var responseContRowData = responseCont.split(',');
      var contactData = {
        id: responseContRowData[0],
        contactDocumento: responseContRowData[1]
      };      


      if (accountData.id == AccountId && accountData.numDocumento == nDocumento && contactData.id == ContactId && contactData.contactDocumento == nDocumento) {

</script>

%%[

SET @updateEmailAcc = UpdateSingleSalesforceObject('Account', @accountIdAmpscript, 'Email_con__c', @emailAmpscript, 'No_Email_flg__c', 'false')
SET @updateEmailCon = UpdateSingleSalesforceObject('Contact', @contactIdAmpscript, 'Email', @emailAmpscript, 'Validate_email__c', 'false', 'No_Email_flg__c', 'false')
SET @updateResponse = Concat(@updateEmailAcc, ',', @updateEmailCon)

]%%

<script runat="server">

          var updateResponse = Variable.GetValue("@updateResponse")


          var updateResponseRowData = updateResponse.split(',');
          var updateResponseData = {
            AccEmail: updateResponseRowData[0],
            ContEmail: updateResponseRowData[1]
          };


          if (updateResponseData.AccEmail == 1 && updateResponseData.ContEmail == 1) {

</script>

%%[

SET @createCase = CreateSalesforceObject('Case', 4, 'Subject', 'Modificación de cliente', 'AccountId', @accountIdAmpscript, 'RecordTypeId', '0121r000000Vl8IAAS', 'Status', 'New')


]%%

<script runat="server">

             var createCase = Variable.GetValue("@createCase") //Devuelve el ID

             if (createCase) {

</script>

%%[

SET @createTask = CreateSalesforceObject('Task', 6, 'RecordTypeId', '0121r000000Vl90AAC', 'Type', 'Action', 'Subject','Modificación de cliente', 'Status', 'Completed', 'WhatId', @createCase, 'FII_ACT_LKP_RelatedClient__c', @accountIdAmpscript)


]%%

<script runat="server">

            var createTask = Variable.GetValue("@createTask") //Devuelve el ID

            if (createTask) {

              if (otrasComunicaciones) {


</script>

%%[

SET @retrieveIndividual = RetrieveSalesforceObjects('Individual', 'Id', 'Contact__c', '=', @contactIdAmpscript)

IF RowCount(@retrieveIndividual) > 0 THEN

SET @individualId = Field(Row(@retrieveIndividual, 1), 'Id')
SET @updateIndividual = UpdateSingleSalesforceObject('Individual', @individualId, 'FII_IND_SEL_Molestar__c', 'No Ofertas', 'FII_IND_SEL_Iden_Evi__c', 'Landing SFMC')

ELSE

SET @retrieveNames = RetrieveSalesforceObjects('Contact', 'FirstName, LastName', 'Id', '=', @contactIdAmpscript)
SET @firstName = Field(Row(@retrieveNames, 1), 'FirstName')
SET @lastName = Field(Row(@retrieveNames, 1), 'LastName')
SET @createIndividual = CreateSalesforceObject('Individual', 5, 'Contact__c', @contactIdAmpscript, 'FII_IND_SEL_Molestar__c', 'No Ofertas', 'FII_IND_SEL_Iden_Evi__c', 'Landing SFMC', 'FirstName', @firstName, 'LastName', @lastName)

ENDIF

]%%

<script runat="server">

                var individualId = Variable.GetValue("@individualId")
                var updateIndividual = Variable.GetValue("@updateIndividual")
                var createIndividual = Variable.GetValue("@createIndividual")

                var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "Tipo_Documento", "Numero_Documento", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "CaseId", "TaskId", "IndividualId", "NewIndividualId"], [Email, AccountId, accountData.tipoDocumento, nDocumento, today, proteccionDatos, otrasComunicaciones, createCase, createTask, individualId, createIndividual]);
                Write('true')

              } else {
                var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "Tipo_Documento", "Numero_Documento", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "CaseId", "TaskId"], [Email, AccountId, accountData.tipoDocumento, nDocumento, today, proteccionDatos, otrasComunicaciones, createCase, createTask]);
                Write('true');
              }

            } else {
              var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "Tipo_Documento", "Numero_Documento", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "Error", "CaseId"], [Email, AccountId, accountData.tipoDocumento, nDocumento, today, proteccionDatos, otrasComunicaciones, 'La Task no ha podido crearse', createCase]);
              Write('false')
            }

          } else {
            var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "Tipo_Documento", "Numero_Documento", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "Error"], [Email, AccountId, accountData.tipoDocumento, nDocumento, today, proteccionDatos, otrasComunicaciones, 'El Case no ha podido crearse']);
            Write('false')
          }

        } else {
          var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "Tipo_Documento", "Numero_Documento", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "Error"], [Email, AccountId, accountData.tipoDocumento, nDocumento, today, proteccionDatos, otrasComunicaciones, 'Ha habido un error al modificar el email']);
          Write('false');
        }

      } else {
        var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "Tipo_Documento", "Numero_Documento", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "Error"], [Email, AccountId, accountData.tipoDocumento, nDocumento, today, proteccionDatos, otrasComunicaciones, 'El número de documento no coincide']);
        Write('false');
      }
    } else {
      var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "Error"], [Email, AccountId, today, proteccionDatos, otrasComunicaciones, 'No se pudo recuperar información de la cuenta.']);
      Write('false');
    }

  }

  catch (error) {
    var rows = Platform.Function.UpsertData("DE_S010528_ATC_CAM_DIG_ML_Captacion_Email_Registros_Landing", ["SubscriberKey"], [ContactId], ["Email", "AccountId", "CurrentDate", "CheckboxPolProtDatos", "CheckboxOtrasCom", "Error"], [Email, AccountId, today, proteccionDatos, otrasComunicaciones, 'Se ha producido un error en el proceso'])
    Write('false')    
  }
</script>
<!--%%[
  VAR @widthQS, @uriSMS
]%%-->
 <script language="javascript" runat="server">
    Platform.Load("Core", "1.1");
   
    var url = String(Request.URL());
    var widthQS;
    var uriSMS;
    var uri = url.split("?qs=");
    var qs = uri[1];

    if (qs) {
      widthQS = 1;
    } else {
      widthQS = 0;
      uriSMS = url.split("?")[1];
    }
    Variable.SetValue("@widthQS", widthQS);
    Variable.SetValue("@uriSMS", uriSMS);
  </script>

<script runat="server">
Platform.Load("Core","1.1.1");
try{
</script>
<!--%%[
   VAR @contactId, @accountId, @fechaEnvio

   IF (@widthQS == 0) AND (NOT EMPTY(@uriSMS)) THEN
   SET @password = "C0BAE23DF8B51807"

   SET @regSubscriberKey = '.*SubscriberKey=([^&]*)'
   SET @regAccountId = '.*AccountId=([^&]*)'
   SET @regFechaEnvio = '.*Fecha_Envio=([^&]*)'


   SET @decodedStr = DecryptSymmetric(@uriSMS,'des;mode=cbc;padding=pkcs7','',@password,'','','','')

   SET @contactId = RegExMatch(@decodedStr, @regSubscriberKey, 1)
   SET @accountId = RegExMatch(@decodedStr, @regAccountId, 1)
   SET @fechaEnvio = RegExMatch(@decodedStr, @regFechaEnvio, 1)

ENDIF
]%%-->
<script runat="server">
}catch(e){
  //Write(Stringify(e));
}
</script>


%%[
var @facturaDigital, @firstName, @name, @idioma, @landing1, @landing2

SET @currentDate = SystemDateToLocalDate(Now())
SET @diasDesdeEnvio = dateDiff(@fechaEnvio, @currentDate, "D")

IF @diasDesdeEnvio > 15 THEN
    Redirect("https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-expirado-ML-ES")

ELSE

SET @retrieveValidateEmail = RetrieveSalesforceObjects('Contact', 'Validate_email__c', 'Id', '=', @contactId)

SET @validateEmail = Field(Row(@retrieveValidateEmail, 1), 'Validate_email__c')

IF @retrieveValidateEmail == 'true' THEN 
    Redirect("https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-expirado-ML-ES")
ELSE

SET @idioma = 'ES'

SET @landing1 = CloudPagesUrl(5950, 'SubscriberKey', @contactId, 'AccountId', @accountId)
SET @landing1name = 'Català'
SET @landing2 = CloudPagesUrl(5949, 'SubscriberKey', @contactId, 'AccountId', @accountId)
SET @landing2name = 'English'



SET @facturaDigital = LookUp('DE_S010528_ATC_CAM_DIG_ML_Captacion_Email', 'Factura_Digital', 'SubscriberKey', @contactId)

SET @firstName = ProperCase(LookUp('DE_S010528_ATC_CAM_DIG_ML_Captacion_Email', 'FirstName', 'SubscriberKey', @contactId))

IF Length(@firstName) > 1 THEN 
SET @name = @firstName
ELSE 
SET @name = ProperCase(LookUp('DE_S010528_ATC_CAM_DIG_ML_Captacion_Email', 'LastName', 'SubscriberKey', @contactId))
ENDIF
]%%

<!DOCTYPE html>
<html lang="es" dir="ltr">
  <head>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
    <title>Endesa Energía</title>
  
    <link rel="icon" type="image/png" href=" https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/f2aba635-8483-40bc-8475-fac5e8280efc.png" sizes="32x32"/>
    <link rel="icon" type="image/png" href=" https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/368c288a-7f51-42b6-8fee-07387bbf0349.png" sizes="192x192"/>
    <link rel="apple-touch-icon-precomposed" type="image/png" href="https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/589cd57f-33a0-417b-a820-004c3798ad0a.png"/>
    <meta name="msapplication-TileImage" content=" https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/935d83f7-1300-4e4a-b237-46a71f331d82.png"/>

    <link id="fd-simple-bootstrap-css-ml" rel="stylesheet" type="text/css" href="https://cloud.digital.endesaclientes.com/css-bootstrap-ml"/>
    <link id="fd-simple-import-fonts-ml" rel="stylesheet" type="text/css" href="https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-CSS-Fuente"/>
    <link id="fd-simple-css-ml" rel="stylesheet" type="text/css" href="https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-ML-CSS"/>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
    <script runat="server">
        Platform.Response.SetResponseHeader("Content-Security-Policy", "default-src 'self'; img-src 'self' https://image.digital.endesaclientes.com https://image.dev.notificaciones.endesaclientes.com;style-src 'self' https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-ML-CSS https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-CSS-Fuente https://cloud.digital.endesaclientes.com/css-bootstrap-ml; font-src 'self' https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-CSS-Fuente data:; script-src 'self' 'unsafe-inline' https://code.jquery.com/jquery-3.7.1.min.js https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-ML-JS https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-JS-errores-es;")
        Platform.Response.SetResponseHeader("X-Frame-Options", "DENY");
        Platform.Response.SetResponseHeader("X-Content-Type-Options", "nosniff");
        Platform.Response.SetResponseHeader("Strict-Transport-Security", "max-age=31536000; includeSubDomains; preload");
        Platform.Response.SetResponseHeader("Referrer-Policy", "no-referrer");
        Platform.Response.SetResponseHeader("Permissions-Policy", "geolocation=(), microphone=()");
  </script>
   
  </head>
  <body id="bodyCookie" class="endesa-body" data-function="fc-body">
    <div id="consent_blackbar">
    </div>

    <div class="endesa-header">
      <div class="wrapper">
        <table cellpadding="0" cellspacing="0" width="100%" role="presentation" class="stylingblock-table-wrapper"><tr><td class="stylingblock-content-wrapper camarker-inner">
  <div class="container container-fluid">
  <div class="row">
    <div class="col-sm-6 col-xs-6">

      <div class="endesa-logo">
        <a class="endesa-logo__link" href="https://www.endesa.com" title="https://www.endesa.com" target="_blank"><span class="endesa-logo__accesible"> endesa.com</span>
        </a>
      </div>
    </div>
    
    <div class="col-sm-6 col-xs-6">
      <div class="endesa-header-language">
        <span class="endesa-header-language__menu">
          <a class="endesa-header-language__active" href="javascript:void(0);" data-function="fc-select" title="Español">Español</a></span>
        <ul class="endesa-header-language__list" id="fcMenu" data-function="fc-menu">
         <input id="landing1" type="hidden" value="%%=v(@landing1)=%%">
         <input id="landing1name" type="hidden" value="%%=v(@landing1name)=%%">
         <input id="landing2" type="hidden" value="%%=v(@landing2)=%%">
         <input id="landing2name" type="hidden" value="%%=v(@landing2name)=%%">
         <input id="idiomaLanding" type="hidden" value="%%=v(@idioma)=%%">
        </ul>
      </div>
    </div>
    
  </div>
</div>
</td></tr></table><table cellpadding="0" cellspacing="0" width="100%" role="presentation" class="stylingblock-table-wrapper"><tr><td class="stylingblock-content-wrapper camarker-inner">
<div class="container">
  <div class="row">
    <div class="col-md-6 order-12">
      <div class="endesa-form-container">
        <form action="" method="POST" align="left" id="SCForm" class="endesa-form" novalidate="novalidate">
          <fieldset id="fieldsetForm" class="endesa-form__fieldset">
            <legend class="endesa-form__legend">
              Actualiza y confirma tu dirección de email
            </legend>
             
            <div class="endesa-form__group endesa-form__group--col-2" id="documentSupraGroup">
              <span id="documentSupraError"></span>
              <div class="endesa-form__group--col-2-lf">
                <label class="endesa-form__label endesa-form__label--visible" for="documentType">Documento
                  </label>
                <select class="endesa-form__select" id="documentType" name="documentType" onchange="changeDocument()">
                  <option value="nif" selected="selected">
                    NIF
                    del
                    titular
                  </option>
                  <option value="nie">
                    NIE
                    del
                    titular
                  </option>
                  <option value="cif">
                    CIF
                    del
                    titular
                  </option>
                  <option value="pasaporte">
                    Pasaporte
                    del
                    titular
                  </option>
                </select>
              </div>
              <div class="endesa-form__group--col-2-rg" id="documentGroup">      
                <label class="endesa-form__label endesa-form__label--visible" for="document">Número de Documento
                  </label>
                <input class="endesa-form__input" name="document" id="document" value="%%=v(@documento)=%%" placeholder="Documento" type="text" onchange="changeInput(2)" required>
                <span id="documentError"></span>
              </div>
            </div>
            <div class="endesa-form__group endesa-form__group--col-2" id="emailsGroup">
              <span id="emailsError"></span>
              <div class="endesa-form__group--col-2-lf" id="emailGroup">
                
                <label class="endesa-form__label endesa-form__label--visible" for="email">E-mail
                  </label>
                <input class="endesa-form__input" name="email" id="email" value="%%=v(@email)=%%" placeholder="E-mail" type="email" onchange="changeInput(3)" required>
                <span id="emailError"></span>
              </div>
              <div class="endesa-form__group--col-2-rg" id="emailCGroup">
               
                <label class="endesa-form__label endesa-form__label--visible" for="emailC">E-mail
                  </label>
                <input class="endesa-form__input" name="emailC" id="emailC" value="%%=v(@email)=%%" placeholder="Confirma E-mail" type="email" onchange="changeInput(4)" onpaste="return false" required>
                 <span id="emailCError"></span>
              </div>
            </div>
            
           <div class="endesa-form__check endesa-form__check">
      <input type="checkbox" id="proteccionDatos" name="proteccionDatos" data-field-type="Text" onchange="changeInput(6)" required>
      <label class="endesa-form__text" for="proteccionDatos">Acepto
        la        
        <a id="conditions" class="endesa-form__link" href="https://www.endesa.com/es/proteccion-datos-endesa" data-toggle="modal" data-target="#endesa-popUpFacturaDigital" title="Condiciones de la Factura Digital">política</a> de protección de datos
      </label>
    </div>
    <div class="endesa-form__check endesa-form__check">
      <input type="checkbox" id="otrasComunicaciones" name="otrasComunicaciones" data-field-type="Text" onchange="changeInput(7)">
      <label class="endesa-form__text" for="otrasComunicaciones">No quiero recibir otras comunicaciones de asesoramiento comercial
      </label>
    </div>
            <input type="hidden" name="documentHidden" id="documentHidden" data-field-type="Text">
            <div id="buttonContainer">
              <button type="button" class="endesa-form__btn endesa-form__btn--disable" id="btnSubmit" onclick="visualSending()"><span class="endesa-form__btn-text">Actualizar dirección de email</span></button>
            </div>
          </fieldset>
          <div id="contact-data-div" data-account-id="%%=v(@accountId)=%%" data-contact-id="%%=v(@contactId)=%%"></div>
        </form>
      </div>
      

    </div>
 <div class="col-md-6 order-1">
  <div class="endesa-cursor">
    
   <p class="endesa-cursor__text">
     <b>Por tu seguridad y comodidad, actualiza y confirma tu dirección de email.</b>
   </p>
   
  </div>
 
 
  <div class="endesa-promo-info">
  
   <p class="endesa-info-text">
     Hola %%=v(@name)=%%,
   </p>
      <p class="endesa-info-text">
        En Endesa hemos identificado que, <span class="endesa-bold-text"> la dirección de email que tenemos tuya puede ser errónea.</span>
   </p>
    %%[IF @facturaDigital == true THEN]%%
      <p class="endesa-info-text">
     Por este motivo, hemos detectado que<span class="endesa-bold-text"> no estás recibiendo el aviso de tu factura </span> cuando está disponible.
   </p>
      <p class="endesa-info-text">
     Por favor, para que te podamos enviar tu factura por correo electrónico, es necesario que <span class="endesa-bold-text"> nos facilites una dirección de email correcta.</span>
   </p>
    %%[ELSE]%%
    <p class="endesa-info-text">
     Por este motivo, hemos detectado que<span class="endesa-bold-text"> no estás recibiendo las comunicaciones informativas sobre tu contrato:</span> modificaciones de contrato, novedades, actualizaciones de precios, etc.
   </p>
      <p class="endesa-info-text">
     Por favor, para que te podamos enviar este tipo de comunicaciones, es importante que <span class="endesa-bold-text"> nos facilites una dirección de email correcta.</span>
   </p>
    %%[ENDIF]%%
     <p class="endesa-info-text">
     Para tu seguridad, <span class="endesa-bold-text"> una vez cumplimentes el formulario</span> facilitándonos el NIF y la nueva dirección de email, <span class="endesa-bold-text"> te enviaremos un correo a la dirección facilitada, para tu verificación.</span> 
   </p>
   </div>
  </div>

    </div>
  </div>

</td></tr></table>
      </div>
    </div>    
      <footer class="e-footer">
        <div class="subfooter">
            <div class="footer-in">
                <div class="footerUp">
                    <div>
                        <a id="text-footer1" href="https://www.endesa.com/es/accesibilidad" target="_blank">
                      <img src="https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/73214472-4f2f-42b8-8f9a-5f1d7f7a4996.png" alt="Accesibilidad">  Accesibilidad </a>&nbsp;&nbsp;|&nbsp;&nbsp;
                    </div>
                    <div>
                        <a id="text-footer2" href="https://www.endesa.com/es/politica-cookies" target="_blank"><img src="https://image.dev.notificaciones.endesaclientes.com/lib/fe3111737364047c711778/m/1/73214472-4f2f-42b8-8f9a-5f1d7f7a4996.png" alt="Política de Cookies">  Política de Cookies </a>
                    </div>
                </div>
                <div class="footerDown">
                    &copy; %%xtyear%% Endesa Energ&iacute;a, Endesa&nbsp;S.A.
                </div>
            </div>
        </div>
    </footer>
    <script id="js-script" src="https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-ML-JS"></script>
    <script id="js-errores" src="https://cloud.dev.notificaciones.endesaclientes.com/Captacion-email-JS-errores-es"></script>


  </body>
</html>
%%[ENDIF]%%
%%[ENDIF]%%
{
	"blocks": [
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": ":star: What's on in Melbourne this week! :star:"
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n Hey Melbourne, happy Monday and hope you all had a great weekend! Please see below for what's on this week. "
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Xero Café :coffee:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n :new-thing: *This week we are offering:* \n\n :caramel-slice: *Sweet Treats*: Lamingtons \n\n :coffee: *Weekly Café Special*: Andrew's Vanilla Chai Mocha"
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": " Wednesday, 13th August :calendar-date-13:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": "\n\n:lunch: :flag-jp: Join us for an Japanese lunch From *12pm* in the L3 kitchen + Wominjeka breakout space! Menu in the:thread: "
			}
		},
		{
			"type": "header",
			"text": {
				"type": "plain_text",
				"text": "Thursday, 14th August :calendar-date-14:",
				"emoji": true
			}
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": ":breakfast: *Breakfast*: Join us for our Breakfast Buffet from *8:30am - 10:30am* in the Wominjeka Breakout Space. Menu in the :thread: \n\n *What Else? :green_heart:*"
			}
		},
		{
			"type": "divider"
		},
		{
			"type": "section",
			"text": {
				"type": "mrkdwn",
				"text": " Feedback on our Boost Offerings? We want to hear more. Let us know what you love by filling out our form <https://docs.google.com/forms/d/e/1FAIpQLScGOSeS5zUI8WXEl0K4WGoQUkmpIHzAjLlEKWBob4sMPhDXmA/viewform|here.>  \n\n Stay tuned to this channel, and make sure you're subscribed to the <https://calendar.google.com/calendar/u/0?cid=Y19xczkyMjk5ZGlsODJzMjA4aGt1b3RnM2t1MEBncm91cC5jYWxlbmRhci5nb29nbGUuY29t|*Melbourne Social Calendar*> :party-wx:"
			}
		}
	]
}
 Looking to enter the crypto market? Our advanced Kraken Clone Script offers a ready-made, customizable solution to build your own cryptocurrency exchange platform. Packed with features like multi-currency support, robust trading engine, high-level security, and KYC/AML integration — it's the perfect choice for startups and enterprises alike. Fast deployment, full source code, and ongoing technical support included. Save time, cut costs, and go live quickly with a proven solution.



Unlock the potential of your business with our cutting-edge crypto payment gateway development services! Seamlessly integrate cryptocurrency transactions into your platform and provide customers with a secure, fast, and cost-effective payment solution. Our expert team specializes in creating customized gateways that support multiple cryptocurrencies, ensuring a smooth user experience. With advanced security features, fraud detection, and real-time analytics, you can enhance customer trust and streamline your payment processes. Don’t miss out on the crypto revolution—partner with us to elevate your business and cater to the growing demand for digital currency transactions today!
Get Started:
Contact Us: +91 9384587998 | sales@maticz.com

Looking to start your own digital bank? Maticz offers cutting-edge White Label Crypto Bank Software designed to help you launch quickly and securely. Our ready-to-deploy solution includes features like crypto wallets, KYC/AML, fiat integration, real-time payments, and secure transaction management. Fully customizable, scalable, and compliant, it’s perfect for fintech startups, exchanges, and financial institutions.
Get to market faster without compromising on quality or security. Partner with Maticz and bring your crypto banking vision to life.
  
Contact Us: +91 9384587998 | sales@maticz.com
-- RISK316	oc_120_p2m_intent_non_verified_offline_2k
DROP TABLE team_kingkong.tpap_risk316_breaches;
 
CREATE TABLE team_kingkong.tpap_risk316_breaches AS
-- INSERT INTO team_kingkong.tpap_risk316_breaches
SELECT DISTINCT B.*, C.category, C.initiationMode, C.isVerifiedMerchant, C.merchantGenre
, D.payerType, D.payeeType
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, 'upi_oc141_mcc7995_betting_v3' AS rule_name
, 'Breached: initmode in (04,05) & IsverifiedMerchant = False & MerchantGenre = Offline & amt > 2k' AS breach_reason
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE'2025-07-01' AND DATE'2025-08-06'
    AND DATE(created_on) BETWEEN DATE'2025-07-01' AND DATE'2025-08-06'
    GROUP BY 1
    HAVING MAX(amount) > 2000)B
inner join
    (select txn_id, category
    , json_extract_scalar(extended_info, '$.initiationMode') as initiationMode
    , json_extract_scalar(extended_info, '$.isVerifiedMerchant') as isVerifiedMerchant
    , json_extract_scalar(extended_info, '$.merchantGenre') as merchantGenre
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE'2025-07-01' AND DATE'2025-08-06'
    and DATE(created_on) BETWEEN DATE'2025-07-01' AND DATE'2025-08-06'
    AND json_extract_scalar(extended_info, '$.initiationMode') IN ('04', '05')
    AND json_extract_scalar(extended_info, '$.merchantGenre') = 'OFFLINE'
    AND json_extract_scalar(extended_info, '$.isVerifiedMerchant') = 'false'
    and upper(status) = 'SUCCESS'
    AND category = 'VPA2MERCHANT') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') AS payerType
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payeeType') AS varchar),'"','') AS payeeType
    , JSON_EXTRACT_SCALAR(request, '$.requestPayload.initiationMode') AS initiationMode
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE'2025-07-01' AND DATE'2025-08-06'
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND  JSON_EXTRACT_SCALAR(request, '$.requestPayload.initiationMode') IN ('04', '05')
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid;
/* ************************************ Cron ************************************* */

/**
 * Cron complete deactivation + wp-config + crontab-ehtibnm
 */
add_filter( 'pre_update_option_cron', 'override_cron',99,3);
add_filter( 'default_option_cron', 'override_cron',99,3);
add_filter( 'pre_option_cron', 'override_cron',99,3);
add_filter( 'option_cron', 'override_cron', 99, 3);

function override_cron($one, $two, $three) : string
{
    return '';
}
-- RISK198	oc141b_decline_collect_android_mcc5412
-- decline all collect on android for mcc 5412
 
-- DROP TABLE team_kingkong.tpap_risk198_breaches;
 
-- CREATE TABLE team_kingkong.tpap_risk198_breaches AS
INSERT INTO team_kingkong.tpap_risk198_breaches
SELECT DISTINCT B.*, C.category, C.txn_type, D.payerType
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, 'oc141b_decline_collect_android_mcc5412' AS rule_name
, 'collect txn on android for mcc 5412' AS breach_reason
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN mcc END) AS payeeMccCode,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    AND DATE(created_on) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    GROUP BY 1
    HAVING MAX(CASE WHEN participant_type = 'PAYEE' THEN mcc END) = '5412')B
inner join
    (select txn_id, category, "type" AS txn_type
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    and DATE(created_on) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    and upper(status) = 'SUCCESS' AND "type" = 'COLLECT' AND category = 'VPA2MERCHANT') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') AS payerType
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN DATE'2025-01-01' AND DATE'2025-01-31'
    -- AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    -- or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') IS NOT NULL
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') IS NOT NULL
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') <> ''
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') <> ''
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid;
-- RISK120	
-- decline all collect on android for mcc 5413
 
-- DROP TABLE team_kingkong.tpap_risk120_breaches;
 
-- CREATE TABLE team_kingkong.tpap_risk120_breaches AS
INSERT INTO team_kingkong.tpap_risk120_breaches
SELECT DISTINCT B.*, C.category, C.txn_type, D.payerType
, IF(D.upi_subtype IS NOT NULL, D.upi_subtype, IF(C.category = 'LITE_MANDATE', 'UPI_LITE_MANDATE', '')) AS upi_subtype
, 'oc141b_decline_collect_android_mcc5413' AS rule_name
, 'collect txn on android for mcc 5413' AS breach_reason
FROM
    (SELECT txn_id,
    MAX(CASE WHEN participant_type = 'PAYER' THEN vpa END) AS payer_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN vpa END) AS payee_vpa,
    MAX(CASE WHEN participant_type = 'PAYEE' THEN mcc END) AS payeeMccCode,
    MAX(DATE(created_on)) as txn_date,
    MAX(amount) AS txn_amount,
    MAX(created_on) AS txn_time
    FROM switch.txn_participants_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN '2025-07-01' AND DATE'2025-07-31'
    AND DATE(created_on) BETWEEN '2025-07-01' AND DATE'2025-07-31'
    GROUP BY 1
    HAVING MAX(CASE WHEN participant_type = 'PAYEE' THEN mcc END) = '5413'
    )B
inner join
    (select txn_id, category, "type" AS txn_type
    from switch.txn_info_snapshot_v3
    where DATE(dl_last_updated) BETWEEN '2025-07-01' AND DATE'2025-07-31'
    and DATE(created_on) BETWEEN '2025-07-01' AND DATE'2025-07-31'
    and upper(status) = 'SUCCESS' AND "type" = 'COLLECT'
    AND category = 'VPA2MERCHANT') C
on B.txn_id = C.txn_id
INNER JOIN
    (SELECT txnid
    , regexp_replace(cast(json_extract(request, '$.requestPayload.payerType') AS varchar),'"','') AS payerType
    , regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') AS upi_subtype
    FROM tpap_hss.upi_switchv2_dwh_risk_data_snapshot_v3
    WHERE DATE(dl_last_updated) BETWEEN '2025-07-01' AND DATE'2025-07-31'
    -- AND (lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) LIKE '%@paytm%'
    -- or lower(regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '')) like '%@pt%')
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') IS NOT NULL
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') IS NOT NULL
    AND regexp_replace(cast(json_extract(request, '$.requestPayload.payeeVpa') as varchar), '"', '') <> ''
    -- AND regexp_replace(cast(json_extract(request, '$.requestPayload.payerVpa') as varchar), '"', '') <> ''
    AND json_extract_scalar(response, '$.action_recommended') <> 'BLOCK'
    AND regexp_replace(cast(json_extract(request, '$.evaluationType') as varchar), '"', '') = 'UPI_TRANSACTION')D
ON B.txn_id = D.txnid;
#include <bits/stdc++.h>
using namespace std;

class Solution {
public:
    vector<int> segTree;
    vector<int> arr;

    void build(int p, int l, int r) {
        if (l == r) {
            segTree[p] = arr[l];
            return;
        }
        int mid = (l + r) >> 1;
        build(p << 1, l, mid);
        build(p << 1 | 1, mid + 1, r);
        segTree[p] = min(segTree[p << 1], segTree[p << 1 | 1]);
    }

    int query(int p, int l, int r, int ql, int qr) {
        if (qr < l || ql > r) return INT_MAX;
        if (ql <= l && r <= qr) return segTree[p];
        int mid = (l + r) >> 1;
        return min(
            query(p << 1, l, mid, ql, qr),
            query(p << 1 | 1, mid + 1, r, ql, qr)
        );
    }

    void update(int p, int l, int r, int pos, int val) {
        if (l == r) {
            segTree[p] = val;
            return;
        }
        int mid = (l + r) >> 1;
        if (pos <= mid) update(p << 1, l, mid, pos, val);
        else update(p << 1 | 1, mid + 1, r, pos, val);
        segTree[p] = min(segTree[p << 1], segTree[p << 1 | 1]);
    }

    void solve(vector<int>& input) {
        arr = input;
        int n = arr.size();
        segTree.assign(4 * n, 0);
        build(1, 0, n - 1);
    }
};
class Solution {
public:
    int segTree[400007];
    vector<int>baskets;
    void build(int p,int l,int r){
        if(l == r){
            segTree[p] = baskets[l];
            return ;
        }
        int mid = (l + r)>>1;
        build(p<<1,l,mid);
        build(p<<1|1,mid+1,r);
        segTree[p] = max(segTree[p<<1],segTree[p<<1|1]);
    }
    int query(int p,int l,int r,int ql,int qr){
        if(ql > r || qr < l)
        return INT_MIN;
        if(ql <= l && r <= qr)
        return segTree[p];
        int mid = (l + r)>>1;
        return max(query(p<<1,l,mid,ql,qr),query(p<<1|1,mid+1,r,ql,qr));
    }
    void update(int p,int l,int r,int pos,int val){
        if(l==r){
            segTree[p] = val;
            return ;
        }
        int mid = (l + r)>>1;
        if(pos <= mid){
            update(p<<1,l,mid,pos,val);
        }
        else{
            update(p<<1|1,mid+1,r,pos,val);
        }
        segTree[p] = max(segTree[p<<1],segTree[p<<1|1]);
    }
    int numOfUnplacedFruits(vector<int>& fruits, vector<int>& baskets) {
        this->baskets = baskets;
        int m = baskets.size();
        int count = 0;
        if(m == 0)
        return fruits.size();
        build(1,0,m-1);
        for(int i = 0;i<m;i++){
            int l= 0, r = m-1,res = -1;
            while(l<= r){
                int mid = (l + r)>>1;
                if(query(1,0,m-1,0,mid)>=fruits[i])
                {
                    res = mid;
                    r = mid - 1;
                }
                else{
                    l = mid +1;
                }
            }
            if(res!=-1 && baskets[res] >= fruits[i]){
                update(1,0,m-1,res,INT_MIN);
            }
            else count++;
        }
        return count;
    }
};
 public function crear(Request $request)
    {

        if ($request->isMethod('post')) {
            
            DB::beginTransaction();

            try {
                // Primero crea la persona
                $persona = \App\Models\Personas::create([
                    'cedula' => $request->documento,
                    'nombres' => mb_strtoupper($request->nombres, 'UTF-8'),
                    'apellidos' => mb_strtoupper($request->apellidos, 'UTF-8'),
                    'telefono' => $request->telefono,
                    'email' => $request->email,
                    'fecha_nacimiento' => $request->fecha_nacimiento ?: null,
                    'genero_id' => $request->genero_id,
                ]);

                // Luego crea el usuario, asignando el persona_id recién creado
                $usuario = User::create([
                    'activo' => true,
                    'role_id' => 3,
                    'username' => $request->username,
                    'password' => Hash::make($request->contrasena),
                    'fecha_registro' => now(),
                    'persona_id' => $persona->id,
                    'user_id' => Auth::id(), // equivalente a Auth::user()->id y más seguro
                    'ip' => $request->ip(),
                ]);

                // Finalmente crea la relación con el ente/instituto
                $user_ente = \App\Models\UserInstituto::create([
                    'user_id' => $usuario->id,
                    'instituto_id' => $request->instituto_id,
                    'activo' => true,
                ]);

                DB::commit();

                return redirect()->route('usuarios.index')->with('success', 'Usuario creado exitosamente');
            } catch (\Exception $e) {
                DB::rollback();
                return redirect()->back()->withErrors(['error' => 'Error al crear el usuario: ' . $e->getMessage()]);
            }
            // return redirect()->route('usuarios.crear', ['success' => 'Usuario creado exitosamente.']);
            return redirect()->route('usuarios.index')->with('success', 'Usuario creado exitosamente.');

        } else {
            $Genero = \App\Models\Genero::get()->pluck("nombre", "id");
            $Instituto = \App\Models\Instituto::get()->pluck("nombre", "id");

            //  dd($Ente);
            return view('users.crear', compact('Instituto', 'Genero'));
           


        }
    }
sudo apt install libayatana-appindicator3-1 gir1.2-ayatanaappindicator3-0.1 gnome-shell-extension-appindicator
echo "0b14e71586b22e498eb20926c48c7b434b751149b1f2af9902ef1cfe6b03e180 protonvpn-stable-release_1.0.8_all.deb" | sha256sum --check -
sudo dpkg -i ./protonvpn-stable-release_1.0.8_all.deb && sudo apt update
wget https://repo.protonvpn.com/debian/dists/stable/main/binary-all/protonvpn-stable-release_1.0.8_all.deb
class DataviewUtils {
	static async loadScript(source, args={}){
		const promise = (this._isURL(source)) ?
			this._fetch(source) : app.vault.adapter.read(source)
		return promise.then(str => {
			return new Promise((resolve, reject) => {
				try {
					const argNames = Object.keys(args)
					const argValues = Object.values(args)
					const fn = new Function(...argNames, str)
					fn(...argValues)
					resolve()
				} catch (error) {
					reject(error)
				}
			})
		})
	}
	static async loadCSS(source) {
		const promise = (this._isURL(source)) ?
			this._fetch(source) : app.vault.adapter.read(source)
		return promise.then(str => {
			return new Promise((resolve) => {
				const elm = document.createElement('style')
				elm.textContent = str
				dv.container.appendChild(elm)
				resolve()
			})
		})
	}
	static _isURL(str) {
		return /^https?:\/\/[^\s/$.?#].[^\s]*$/i.test(str)
	}
	static async _fetch(url){
		return fetch(url).then(response => {
			if (!response.ok)
				throw new Error(`Failed to fetch file from ${url}: ${response.statusText}`)
			console.log(`loaded: ${url}`)
			return response.text()
		})
	}
}
We offer end-to-end Web3 development services for startups, enterprises, and blockchain-based platforms. Our expertise includes dApp development, smart contracts, NFT marketplaces, DeFi solutions, and blockchain integration. Based in Seattle, we help businesses adopt decentralized technology with secure, scalable, and future-ready systems. Custom solutions available across Ethereum, Binance Smart Chain, Polygon, and more.
📩 Reach out for a free consultation or project quote today >>>> 
Looking to Launch Your Own Stablecoin? We Can Help!
We are a leading Stablecoin Development Company offering end-to-end solutions to build secure, scalable, and regulation-compliant stablecoins. Whether you're a startup, fintech company, or crypto entrepreneur, we make stablecoin creation simple and reliable.

Our services include:
Fiat or crypto-collateralized stablecoin development
Smart contract creation and auditing
Wallet integration and KYC/AML compliance
Private or public blockchain deployment

Why choose us?
We offer customizable solutions, fast delivery, and ongoing support—perfect for both beginners and experienced blockchain users.Bring stability to the crypto market—start your stablecoin journey today!
  
Contact us now for a free consultation >>> sales@maticz.com 

A1: ID       B1: Name         C1: Department
A2: 1        B2: Aamir        C2: Admin
A3: 2        B3: Priya        C3: HR
A4: 3        B4: John         C4: IT

Sub SearchFilter()
    Dim ws As Worksheet
    Dim searchValue As String
    Set ws = ThisWorkbook.Sheets("Sheet1") ' Change sheet name if needed
    searchValue = ws.Range("E3").Value

    ' Clear any previous filter
    On Error Resume Next
    ws.Range("A1").AutoFilter Field:=1
    ws.Range("A1").AutoFilter Field:=2
    ws.Range("A1").AutoFilter Field:=3
    On Error GoTo 0

    ' Apply filter if searchValue is not blank
    If searchValue <> "" Then
        ws.Range("A1:C100").AutoFilter Field:=2, Criteria1:="*" & searchValue & "*"
    Else
        ws.Range("A1:C100").AutoFilter
    End If
End Sub

In Excel, press Alt + F11 to open the VBA Editor.
If the Project Explorer is not visible, press Ctrl + R
Find your sheet name (e.g., "DataSheet"), you might see
Sheet1 (DataSheet)

Paste the below code

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Me.Range("E3")) Is Nothing Then
        Application.EnableEvents = False
        Call SearchFilter
        Application.EnableEvents = True
    End If
End Sub
kill $(ps -ef | grep "airflow scheduler" | awk '{print $2}')

kill $(ps -ef | grep "airflow worker" | awk '{print $2}')

sudo lsof -i :8080
For startups entering the crypto space, automated trading bots offer a scalable way to operate with fewer resources. Crypto trading bot development helps reduce manual workload and makes trading more consistent. Entrepreneurs can use bots to test strategies, manage risks, and stay active in volatile markets. A crypto trading bot development company can build solutions that work across multiple exchanges with custom logic. This gives startups an edge in both speed and decision-making. Bots are not just a tech upgrade—they're a core part of how lean teams stay competitive. With clear goals, automation becomes an asset from day one.
Looking for a trusted Polygon zkEVM development company? We specialize in building scalable, secure, and high-performance dApps using Polygon’s zkEVM technology. Whether you're launching DeFi, NFT, or enterprise-grade solutions, our experts deliver end-to-end development from smart contracts to full-stack integration. Get EVM compatibility with lower gas fees and faster throughput. Perfect for startups and enterprises aiming to scale on Layer 2. Partner with us for reliable and future-ready Polygon zkEVM development services. Contact now to kickstart your blockchain journey!

Contact Us: +91 9384587998 | sales@maticz.com
Social Media Links: @MaticzTech
<!--%%[  
 
SET @SubscriberKey = AttributeValue("FII_ContactContractRoleRelationship__c:ContactId__r:Id")  
 
SET @Nombre = AttributeValue("FII_ContactContractRoleRelationship__c:ContactId__r:FirstName")
 
SET @Apellido = AttributeValue("FII_ContactContractRoleRelationship__c:ContactId__r:LastName") 


SET @patternNombre = "^(?=.*[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ])[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ' -]+$" 
SET @patternApellido = "^(?=.*[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ])[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ' ., -]+$" 
 
SET @matchNombre = RegExMatch(@Nombre, @patternNombre, 0) 
SET @matchApellido = RegExMatch(@Apellido, @patternApellido, 0) 
 
IF Length(@matchNombre) > 0 THEN 
  SET @NombreSaludo = ProperCase(@Nombre) 
ELSEIF Length(@matchApellido) > 0 THEN 
  SET @NombreSaludo = ProperCase(@Apellido) 
ELSE 
  SET @NombreSaludo = '' 
ENDIF


IF Length(@NombreSaludo) >= 1 THEN 

  SET @Saludo = Concat(" ", @NombreSaludo, ",") 

ELSE 

  SET @Saludo = Concat(",") 

ENDIF 


IF Length(@matchNombre) > 0 AND Length(@matchApellido) > 0 THEN 

  SET @NombreCompleto = Concat(ProperCase(@Nombre), " ", ProperCase(@Apellido)) 

ELSEIF Length(@matchApellido) > 0 THEN 

  SET @NombreCompleto = ProperCase(@Apellido) 

ELSE 

  SET @NombreCompleto = '' 

ENDIF 


SET @SubscriberKey2 = AttributeValue("FII_ContactContractRoleRelationship__c:FII_CCR_LKP_ContactoTitularMKT__r:Id")  
 
SET @Nombre2 = AttributeValue("FII_ContactContractRoleRelationship__c:FII_CCR_LKP_ContactoTitularMKT__r:FirstName")  
 
SET @Apellido2 = AttributeValue("FII_ContactContractRoleRelationship__c:FII_CCR_LKP_ContactoTitularMKT__r:LastName")


SET @patternNombre2 = "^(?=.*[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ])[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ' -]+$" 
SET @patternApellido2 = "^(?=.*[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ])[a-zA-ZñÑáéíóúÁÉÍÓÚàèìòùÀÈÌÒÙ' ., -]+$"

SET @matchNombre2 = RegExMatch(@Nombre2, @patternNombre2, 0) 
SET @matchApellido2 = RegExMatch(@Apellido2, @patternApellido2, 0) 
  

IF Length(@matchNombre2) > 0 AND Length(@matchApellido2) > 0 THEN 

  SET @NombreCompleto2 = Concat(ProperCase(@Nombre2), " ", ProperCase(@Apellido2)) 

ELSEIF Length(@matchApellido2) > 0 THEN 

  SET @NombreCompleto2 = ProperCase(@Apellido2) 
  
ELSEIF Length(@matchNombre2) > 0 THEN 

  SET @NombreCompleto2 = ProperCase(@Nombre2) 

ELSE 

  SET @NombreCompleto2 = '' 

ENDIF 

 
]%% -->
<p>Absolutely loved how well this article was structured—insightful and fresh. I recently came across a piece that beautifully channels Carrie Bradshaw’s essence with her signature fashion. If you’re into chic knitwear inspired by the show, the <a href="https://www.vansonjackets.com/product/and-just-like-that-s03-carrie-bradshaw-blue-knit-cardigan/" rel="dofollow">And Just Like That S03 Carrie Bradshaw Blue Knit Cardigan</a> is a real standout.</p>
Wechseln Sie oben zur Registerkarte "Ansicht" und wählen Sie links als Darstellungsform das "Seitenlayout".
Markieren Sie die gewünschten Zeilen oder Spalten und klicken Sie mit der rechten Maustaste auf deren Buchstaben oder Zahlen.
Wählen Sie anschließend im Kontextmenü die Option "Zeilenhöhe" oder "Spaltenbreite".
Hier können Sie die gewünschte genaue Höhe oder Breite in Zentimetern eingeben. So sparen Sie sich die ständigen Umrechnungen.
const tx = db.transaction("books", "readwrite");
const store = tx.objectStore("books");

store.put({title: "Quarry Memories", author: "Fred", isbn: 123456});
store.put({title: "Water Buffaloes", author: "Fred", isbn: 234567});
store.put({title: "Bedrock Nights", author: "Barney", isbn: 345678});

tx.oncomplete = function() {
  // All requests have succeeded and the transaction has committed.
};
const tx = db.transaction("books", "readonly");
const store = tx.objectStore("books");
const index = store.index("by_author");

const request = index.openCursor(IDBKeyRange.only("Fred"));
request.onsuccess = function() {
  const cursor = request.result;
  if (cursor) {
    // Called for each matching record.
    report(cursor.value.isbn, cursor.value.title, cursor.value.author);
    cursor.continue();
  } else {
    // No more matching records.
    report(null);
  }
};
const tx = db.transaction("books", "readwrite");
const store = tx.objectStore("books");
const request = store.put({title: "Water Buffaloes", author: "Slate", isbn: 987654});
request.onerror = function(event) {
  // The uniqueness constraint of the "by_title" index failed.
  report(request.error);
  // Could call event.preventDefault() to prevent the transaction from aborting.
};
tx.onabort = function() {
  // Otherwise the transaction will automatically abort due the failed request.
  report(tx.error);
};
const request = indexedDB.open("library", 3); // Request version 3.
let db;

request.onupgradeneeded = function(event) {
  const db = request.result;
  if (event.oldVersion < 1) {
    // Version 1 is the first version of the database.
    const store = db.createObjectStore("books", {keyPath: "isbn"});
    const titleIndex = store.createIndex("by_title", "title", {unique: true});
    const authorIndex = store.createIndex("by_author", "author");
  }
  if (event.oldVersion < 2) {
    // Version 2 introduces a new index of books by year.
    const bookStore = request.transaction.objectStore("books");
    const yearIndex = bookStore.createIndex("by_year", "year");
  }
  if (event.oldVersion < 3) {
    // Version 3 introduces a new object store for magazines with two indexes.
    const magazines = db.createObjectStore("magazines");
    const publisherIndex = magazines.createIndex("by_publisher", "publisher");
    const frequencyIndex = magazines.createIndex("by_frequency", "frequency");
  }
};

request.onsuccess = function() {
  db = request.result; // db.version will be 3.
};
star

Fri Aug 08 2025 07:42:30 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Fri Aug 08 2025 07:42:00 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Fri Aug 08 2025 07:41:42 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Fri Aug 08 2025 07:40:10 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Fri Aug 08 2025 07:39:38 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Fri Aug 08 2025 07:36:41 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Fri Aug 08 2025 07:35:58 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Fri Aug 08 2025 07:24:26 GMT+0000 (Coordinated Universal Time) https://www.nyamericanjacket.com/product-category/fur-jackets-and-coats-collection/

@MarkJohnson

star

Fri Aug 08 2025 07:23:17 GMT+0000 (Coordinated Universal Time) https://www.thecryptoape.com/cryptocurrency-exchange-script

@Davidbrevis

star

Fri Aug 08 2025 07:22:28 GMT+0000 (Coordinated Universal Time) https://www.thecryptoape.com/ico-development-company

@Davidbrevis

star

Fri Aug 08 2025 07:22:03 GMT+0000 (Coordinated Universal Time) https://www.leatherjacketblack.com/category/halloween-sales-and-discounts/

@MarkJohnson

star

Fri Aug 08 2025 07:20:50 GMT+0000 (Coordinated Universal Time) https://www.thecryptoape.com/coinpayments-clone-script

@Davidbrevis

star

Fri Aug 08 2025 01:24:32 GMT+0000 (Coordinated Universal Time)

@FOHWellington

star

Thu Aug 07 2025 12:27:26 GMT+0000 (Coordinated Universal Time) https://maticz.com/kraken-clone-script

@Maeve43 #blockchain #web3 #crypto

star

Thu Aug 07 2025 12:26:12 GMT+0000 (Coordinated Universal Time) https://maticz.com/cryptocurrency-payment-gateway-development

@Maeve43 #blockchain #web3 #crypto

star

Thu Aug 07 2025 12:24:43 GMT+0000 (Coordinated Universal Time) https://maticz.com/crypto-banking-software

@Maeve43 #blockchain #web3 #crypto

star

Thu Aug 07 2025 08:20:28 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu Aug 07 2025 08:07:50 GMT+0000 (Coordinated Universal Time)

@mastaklance

star

Thu Aug 07 2025 07:41:58 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu Aug 07 2025 07:31:03 GMT+0000 (Coordinated Universal Time)

@shubhangi.b

star

Thu Aug 07 2025 06:59:04 GMT+0000 (Coordinated Universal Time) https://www.flyproxy.com/

@Flyproxy

star

Thu Aug 07 2025 06:28:47 GMT+0000 (Coordinated Universal Time) https://croxy.com/

@croxymini

star

Thu Aug 07 2025 04:52:37 GMT+0000 (Coordinated Universal Time)

@piyushpar7 #c++

star

Thu Aug 07 2025 04:24:34 GMT+0000 (Coordinated Universal Time) https://leetcode.com/problems/fruits-into-baskets-iii/?envType=daily-question&envId=2025-08-06

@piyushpar7 #c++

star

Wed Aug 06 2025 13:35:49 GMT+0000 (Coordinated Universal Time)

@jrg_300i #php #laravel

star

Wed Aug 06 2025 09:22:36 GMT+0000 (Coordinated Universal Time) https://www.addustechnologies.com/binance-clone-script

@Seraphina

star

Wed Aug 06 2025 05:42:09 GMT+0000 (Coordinated Universal Time) https://protonvpn.com/support/official-linux-vpn-ubuntu?srsltid

@v1ral_ITS

star

Wed Aug 06 2025 05:42:00 GMT+0000 (Coordinated Universal Time) https://protonvpn.com/support/official-linux-vpn-ubuntu?srsltid

@v1ral_ITS

star

Wed Aug 06 2025 05:41:57 GMT+0000 (Coordinated Universal Time) https://protonvpn.com/support/official-linux-vpn-ubuntu?srsltid

@v1ral_ITS

star

Wed Aug 06 2025 05:41:54 GMT+0000 (Coordinated Universal Time) https://protonvpn.com/support/official-linux-vpn-ubuntu?srsltid

@v1ral_ITS

star

Wed Aug 06 2025 05:41:46 GMT+0000 (Coordinated Universal Time) https://protonvpn.com/support/official-linux-vpn-ubuntu?srsltid

@v1ral_ITS

star

Tue Aug 05 2025 15:15:32 GMT+0000 (Coordinated Universal Time)

@touchSort

star

Tue Aug 05 2025 12:24:46 GMT+0000 (Coordinated Universal Time) https://maticz.com/web3-development-company

@Maeve43 #blockchain #web3

star

Tue Aug 05 2025 12:15:48 GMT+0000 (Coordinated Universal Time) https://maticz.com/stablecoin-development-company

@Maeve43 #blockchain #stablecoin

star

Tue Aug 05 2025 11:05:26 GMT+0000 (Coordinated Universal Time)

@Aamir #vba

star

Tue Aug 05 2025 08:46:19 GMT+0000 (Coordinated Universal Time) https://www.kryptobees.com/blog/coindcx-clone-script

@Franklinclas

star

Tue Aug 05 2025 07:47:14 GMT+0000 (Coordinated Universal Time)

@Saravana_Kumar #bash

star

Tue Aug 05 2025 07:33:20 GMT+0000 (Coordinated Universal Time) https://www.b2bcert.com/soc-1-certification-in-texas/

@b2bcert #soc1 consultants in texas

star

Tue Aug 05 2025 07:32:23 GMT+0000 (Coordinated Universal Time) https://www.b2bcert.com/iso-27001-certification-in-texas/

@b2bcert #iso27001 consultants in texas

star

Mon Aug 04 2025 11:53:32 GMT+0000 (Coordinated Universal Time) https://maticz.com/polygon-zkevm-development

@Maeve43 #polygon #zkevm #blockchain

star

Mon Aug 04 2025 11:26:25 GMT+0000 (Coordinated Universal Time)

@andresrivera #ampscript

star

Mon Aug 04 2025 10:05:26 GMT+0000 (Coordinated Universal Time) https://www.vansonjackets.com/product/and-just-like-that-s03-carrie-bradshaw-blue-knit-cardigan/

@mikestallion #html

star

Sun Aug 03 2025 18:38:37 GMT+0000 (Coordinated Universal Time) https://praxistipps.chip.de/excel-zellen-von-pixel-in-cm-umrechnen_29771

@2late #excel

star

Sat Aug 02 2025 19:47:38 GMT+0000 (Coordinated Universal Time) https://www.w3.org/TR/2025/WD-IndexedDB-3-20250731/

@Asneedarazali #javascript

star

Sat Aug 02 2025 19:47:29 GMT+0000 (Coordinated Universal Time) https://www.w3.org/TR/2025/WD-IndexedDB-3-20250731/

@Asneedarazali #javascript

star

Sat Aug 02 2025 19:47:25 GMT+0000 (Coordinated Universal Time) https://www.w3.org/TR/2025/WD-IndexedDB-3-20250731/

@Asneedarazali #javascript

star

Sat Aug 02 2025 19:47:20 GMT+0000 (Coordinated Universal Time) https://www.w3.org/TR/2025/WD-IndexedDB-3-20250731/

@Asneedarazali #javascript

star

Sat Aug 02 2025 19:47:15 GMT+0000 (Coordinated Universal Time) https://www.w3.org/TR/2025/WD-IndexedDB-3-20250731/

@Asneedarazali #javascript

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension