1import{m as e,c as t,b as s}from"./core-3ade42d0.js";import{o as n}from"./vendors-owasp-password-strength-test-b033d8ba.js";class i extends(e(t,s)){constructor(e,t){super(e,t),this.input=this.element.querySelector(this.options.selectorInput),this.input.addEventListener("focus",(e=>this._passwordCheck(e))),this.input.addEventListener("keyup",(e=>this._passwordCheck(e))),n.exports.owasp.config({allowPassphrases:!1,maxLength:64,minLength:12,minOptionalTestsToPass:4}),n.exports.owasp.tests.required=[],n.exports.owasp.tests.optional=[],n.exports.owasp.tests.required.push((function(e){if(e.length<n.exports.owasp.configs.minLength)return"Au moins "+n.exports.owasp.configs.minLength+" caractères."})),n.exports.owasp.tests.required.push((function(e){if(e.length>n.exports.owasp.configs.maxLength)return"Moins de "+n.exports.owasp.configs.maxLength+" caractères."})),n.exports.owasp.tests.optional.push((function(e){if(!/[a-z]/.test(e))return"Au moins une lettre minuscule."})),n.exports.owasp.tests.optional.push((function(e){if(!/[A-Z]/.test(e))return"Au moins une lettre majuscule."})),n.exports.owasp.tests.optional.push((function(e){if(!/[0-9]/.test(e))return"Au moins un chiffre."})),n.exports.owasp.tests.optional.push((function(e){if(!/[^A-Za-z0-9]/.test(e))return"Au moins un caractère spécial."}))}_passwordCheck(e){let t=n.exports.owasp.test(e.target.value);!1===t.strong?(this.element.classList.remove("is--success"),this.element.classList.add("is--error"),this._appendErrors(t.errors)):(this.element.classList.remove("is--error"),this.element.classList.add("is--success"),this.element.nextElementSibling&&this.element.nextElementSibling.classList.contains("ln__a-msg")&&this.element.nextElementSibling.remove())}_appendErrors(e){let t=document.createElement("div"),s=document.createElement("span"),n=document.createElement("ul");t.className="ln__a-msg ln__body-sm",s.innerHTML="Le mot de passe doit contenir :",t.appendChild(s),t.appendChild(n),e.forEach((function(e){let t=document.createElement("li");n.appendChild(t),t.innerHTML=e})),this.element.nextElementSibling&&this.element.nextElementSibling.classList.contains("ln__a-msg")&&this.element.nextElementSibling.remove(),this.element.parentNode.insertBefore(t,this.element.nextElementSibling)}static get options(){return{selectorInit:"[data-input-password]",selectorInput:"[data-input]"}}static get coreName(){return"PasswordChecker"}}i.init();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.