{"version":3,"file":"site.js","names":["document","addEventListener","$navbarBurgers","Array","prototype","slice","call","querySelectorAll","length","forEach","el","target","dataset","$target","getElementById","classList","toggle","inicializarSmooth","validateNIF","value","substitucion","letra","substr","test","numero","letraNumero","substring","reemplazar","por","i","replace","toUpperCase","smoothScrolls","getElementsByClassName","smooth","e","preventDefault","querySelector","getAttribute","scrollIntoView","behavior","onFileChange","files","parentElement","innerHTML","name","addLoader","add"],"sources":["site.js"],"sourcesContent":["document.addEventListener('DOMContentLoaded', () => {\r\n // Get all \"navbar-burger\" elements\r\n const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);\r\n\r\n // Check if there are any navbar burgers\r\n if ($navbarBurgers.length > 0) {\r\n // Add a click event on each of them\r\n $navbarBurgers.forEach(el => {\r\n el.addEventListener('click', () => {\r\n // Get the target from the \"data-target\" attribute\r\n const target = el.dataset.target;\r\n const $target = document.getElementById(target);\r\n\r\n // Toggle the \"is-active\" class on both the \"navbar-burger\" and the \"navbar-menu\"\r\n el.classList.toggle('is-active');\r\n $target.classList.toggle('is-active');\r\n });\r\n });\r\n }\r\n\r\n inicializarSmooth();\r\n});\r\n\r\nfunction validateNIF(value) {\r\n let substitucion = \"TRWAGMYFPDXBNJZSQVHLCKET\";\r\n\r\n let letra = value.substr(value.length - 1, 1);\r\n\r\n if (/^[0-9]{1,8}[a-zA-Z]$/.test(value)) {\r\n let numero = value.substr(0, value.length - 1) % 23;\r\n\r\n let letraNumero = substitucion.substring(numero, numero + 1);\r\n if (letra == letraNumero)\r\n return true;\r\n return false;\r\n } else if (/^[XYZ]{1}/.test(value)) {\r\n let reemplazar = new Array(\"X\", \"Y\", \"Z\")\r\n let por = new Array(\"0\", \"1\", \"2\");\r\n numero = value\r\n for (var i = 0; i < reemplazar.length; i++) {\r\n numero = numero.replace(reemplazar[i].toUpperCase(), por[i]);\r\n }\r\n let numero = numero.substr(0, value.length - 1) % 23;\r\n let letraNumero = substitucion.substring(numero, numero + 1);\r\n if (letra == letraNumero)\r\n return true;\r\n return false;\r\n }\r\n return false;\r\n}\r\n\r\nfunction inicializarSmooth() {\r\n var smoothScrolls = document.getElementsByClassName(\"smooth-scroll\");\r\n\r\n for (var smooth of smoothScrolls) {\r\n smooth.addEventListener(\"click\", e => {\r\n e.preventDefault();\r\n\r\n document.querySelector(e.target.getAttribute('href')).scrollIntoView({\r\n behavior: 'smooth'\r\n });\r\n });\r\n }\r\n}\r\n\r\nfunction onFileChange(e) {\r\n if (e.target.files.length > 0) {\r\n e.target.parentElement.getElementsByClassName('file-name')[0].innerHTML = e.target.files[0].name;\r\n }\r\n};\r\n\r\nfunction addLoader(e) {\r\n e.target.classList.add(\"is-loading\");\r\n}\r\n/*\r\nfunction toggleHelpClick(e) {\r\n e.target.parentElement.getElementsByClassName(\"collapsible\")[0].classList.toggle(\"collapsed\");\r\n}\r\nlet labels = document.getElementsByTagName(\"label\")\r\nfor (var label of labels) {\r\n console.log(label);\r\n label.addEventListener(\"click\", toggleHelpClick);\r\n label.click();\r\n}*/"],"mappings":"m3CAAAA,QAAQ,CAACC,gBAAT,CAA0B,kBAA1B,CAA8C,UAAM,CAEhD,GAAMC,eAAc,CAAGC,KAAK,CAACC,SAAN,CAAgBC,KAAhB,CAAsBC,IAAtB,CAA2BN,QAAQ,CAACO,gBAAT,CAA0B,gBAA1B,CAA3B,CAAwE,CAAxE,CAAvB,CAGA,GAAIL,cAAc,CAACM,MAAf,CAAwB,CAA5B,CAA+B,CAE3BN,cAAc,CAACO,OAAf,CAAuB,SAAAC,EAAE,CAAI,CACzBA,EAAE,CAACT,gBAAH,CAAoB,OAApB,CAA6B,UAAM,CAE/B,GAAMU,OAAM,CAAGD,EAAE,CAACE,OAAH,CAAWD,MAA1B,CACA,GAAME,QAAO,CAAGb,QAAQ,CAACc,cAAT,CAAwBH,MAAxB,CAAhB,CAGAD,EAAE,CAACK,SAAH,CAAaC,MAAb,CAAoB,WAApB,EACAH,OAAO,CAACE,SAAR,CAAkBC,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