| Current Path : /home/ereika83/www/wp-content/plugins/sfwd-lms/src/assets/dist/js/modules/forms/ |
| Current File : /home/ereika83/www/wp-content/plugins/sfwd-lms/src/assets/dist/js/modules/forms/password.js |
learndash.forms=learndash.forms||{},learndash.forms.password=learndash.forms.password||{},((t,e,o)=>{o.initPasswordToggle=(t,e)=>{t.style.minWidth=e,t.addEventListener("click",(e=>{const n=e.target.closest(".ld-form__field-wrapper").querySelector("input");n&&("password"===n.type?(t.textContent=o.i18n.shownButtonText,t.setAttribute("aria-label",o.i18n.shownButtonLabel),n.type="text"):(t.textContent=o.i18n.hiddenButtonText,t.setAttribute("aria-label",o.i18n.hiddenButtonLabel),n.type="password"))}))},e.addEventListener("DOMContentLoaded",(()=>{const t=e.querySelectorAll(".ld-button__password-visibility-toggle");let n="";if(t.length>0)if(n=t[0].offsetWidth,t[0].closest(".ld-breakpoint--mobile")){const e=t[0].cloneNode(!0);e.textContent=o.i18n.shownButtonText,e.id="ld-field-size-calculation",e.style.visibility="hidden",e.style.position="absolute",t[0].insertAdjacentElement("afterend",e),e.offsetWidth>n&&(n=e.offsetWidth),e.textContent=o.i18n.hiddenButtonText,e.offsetWidth>n&&(n=e.offsetWidth),e.remove()}else n="auto";n&&"auto"!==n&&(n+="px"),t.forEach((t=>{o.initPasswordToggle(t,n)}))}))})(window,document,learndash.forms.password);