(()=>{"use strict";document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".ablocks-form-builder__field").forEach(e=>{!function(e){const t=e?.querySelector(".ablocks-form-builder__input"),s=e?.querySelector(".ablocks-form-builder__input-toggle--show-password"),r=e?.querySelector(".ablocks-form-builder__input-toggle--hide-password"),o=e?.getAttribute("data-required");function i(e){(r||s)&&(e?(t.type="password",s?.classList.add("ablocks-form-builder__input-toggle--show-password--active"),r?.classList.remove("ablocks-form-builder__input-toggle--hide-password--active")):(t.type="text",s?.classList.remove("ablocks-form-builder__input-toggle--show-password--active"),r?.classList.add("ablocks-form-builder__input-toggle--hide-password--active")))}t&&"true"===o&&t?.addEventListener("focusout",()=>{""===t?.value.trim()&&e?.classList.add("error-msg")}),t?.addEventListener("input",()=>{""!==t.value.trim()&&e?.classList.remove("error-msg")}),s&&s.addEventListener("click",()=>i(!1)),r&&r.addEventListener("click",()=>i(!0)),i(!0)}(e)})})})();