var allBars=document.querySelectorAll("div.progress-bar > div"),inputPasswordField=document.querySelector("input.password");function detPasswordStrength(e){allBars.forEach(e=>{e.style.background="#e9ecef",e.style.border="1px solid #e9ecef"});e=getStrengthPercent(e);if(100==e)allBars.forEach(e=>{e.style.background="#25b865",e.style.border="1px solid #25b865"});else if(75<=e)for(var t=0;t<3;t++)allBars[t].style.background="#41b2c4",allBars[t].style.border="1px solid #41b2c4";else if(50<=e)for(t=0;t<2;t++)allBars[t].style.background="#e49e3d",allBars[t].style.border="1px solid #e49e3d";else 25<=e&&(allBars[0].style.background="#d13b4c",allBars[0].style.border="#d13b4c")}function getStrengthPercent(e){var t=0,t=0+percentByLength(e);return t=charRepitition(t=(t=(t+=percentByUppercase(e))+percentByChar(e))+percentByNum(e),e)}function percentByLength(e){return 16<=e.length?25:8<=e.length?15:0{"ABCDEFGHIJKLMNOPQRSTUVWXYZ".includes(e)&&t.push(e)}),e.length-t.length>=e.length?0:16<=e.length-t.length?25:8<=e.length-t.length?15:0{"`,.~{}()[]/+_=-!@#$%^&*|\\'\":?".includes(e)&&t.push(e)}),e.length-t.length>=e.length?0:16<=e.length-t.length?25:8<=e.length-t.length?15:0{"1234567890".includes(e)&&t.push(e)}),e.length-t.length>=e.length?0:16<=e.length-t.length?25:8<=e.length-t.length?15:0{detPasswordStrength(inputPasswordField.value)});const showPasswordBtn=document.querySelector("div.show-pass"),generatePasswordBtn=(showPasswordBtn.addEventListener("click",e=>{"password"==inputPasswordField.getAttribute("type")?(inputPasswordField.setAttribute("type","text"),showPasswordBtn.children[0].innerHTML=''):(inputPasswordField.setAttribute("type","password"),showPasswordBtn.children[0].innerHTML='')}),document.querySelector("div.gen-pass"));function charRepitition(e,t){for(var n=t.split(""),r=(console.log(n),[]),l=0;l{for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZ",n=t.toLowerCase(),r="1234567890",l="`,.~{}()[]/+_=-!@#$%^&*|\\'\":?",s=[],o=0;o<3;o++){var a=Math.floor(Math.random()*t.length);s[s.length-1]!=t[a]&&s[s.length-2]!=t[a]?(s.push(t[a]),console.log(s.length-1+" = "+t[a])):--o}for(o=0;o<13;o++){a=Math.floor(Math.random()*n.length);s[s.length-1].toLowerCase()!=n[a]&&s[s.length-2].toLowerCase()!=n[a]?(s.push(n[a]),console.log(s.length-1+" = "+n[a])):--o}for(o=0;o<2;o++){a=Math.floor(Math.random()*r.length);s[s.length-1]!=r[a]&&parseInt(s[s.length-1])+1!=r[a]&&parseInt(s[s.length-1])-1!=r[a]&&parseInt(s[s.length-1])+2!=r[a]&&parseInt(s[s.length-1])-2!=r[a]?(s.push(r[a]),console.log(s.length-1+" = "+r[a])):--o}a=Math.floor(Math.random()*l.length);s.push(l[a]),inputPasswordField.value=s.join(""),detPasswordStrength(s.join(""))}); //# sourceMappingURL=lslstrength.min.js.map