text: const resultEl=document.getElementById("result"),lengthEl=document.getElementById("length"),uppercaseEl=document.getElementById("uppercase"),lowercaseEl=document.getElementById("lowercase"),numbersEl=document.getElementById("numbers"),symbolsEl=document.getElementById("symbols"),generateEl=document.getElementById("generate"),clipboardEl=document.getElementById("clipboard"),randomFunc={lower:getRandomLower,upper:getRandomUpper,number:getRandomNumber,symbol:getRandomSymbol};function generatePassword(e,t,n,o,r){let l="";const d=e+t+n+o,a=[{lower:e},{upper:t},{number:n},{symbol:o}].filter(e=>Object.values(e)[0]);if(0==d)return"🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡🤡";for(let e=0;e<r;e++){const e=Math.floor(Math.random()*a.length);l+=randomFunc[Object.keys(a[e])[0]]()}return l}function getRandomLower(){return String.fromCharCode(Math.floor(26*Math.random())+97)}function getRandomUpper(){return String.fromCharCode(Math.floor(26*Math.random())+65)}function getRandomNumber(){return Math.floor(10*Math.random())}function getRandomSymbol(){const e='!@#$%^&*(){}[]=<>/,.|+-?´`~¤€£";:§';return e[Math.floor(Math.random()*e.length)]}function createAlert(){document.getElementById("alert").classList.remove("d-none"),setTimeout(()=>{document.getElementById("alert").classList.add("d-none")},2e3)}generateEl.addEventListener("click",()=>{const e=+lengthEl.value,t=lowercaseEl.checked,n=uppercaseEl.checked,o=numbersEl.checked,r=symbolsEl.checked;resultEl.innerText=generatePassword(t,n,o,r,e)}),clipboardEl.addEventListener("click",()=>{const e=document.createElement("textarea"),t=resultEl.innerText;t&&(e.value=t,document.body.appendChild(e),e.select(),document.execCommand("copy"),e.remove(),createAlert())});