(function(e){let a=`<svg  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" style="shape-rendering: auto; display: block; background: transparent;" width="20" height="20" xmlns:xlink="http://www.w3.org/1999/xlink"><g><circle stroke-dasharray="164.93361431346415 56.97787143782138" r="35" stroke-width="9" stroke="#ffffff" fill="none" cy="50" cx="50">
    <animateTransform keyTimes="0;1" values="0 50 50;360 50 50" dur="1s" repeatCount="indefinite" type="rotate" attributeName="transform"></animateTransform>
</circle><g></g></g><!-- [ldio] generated by https://loading.io --></svg>`;e(document).on("click",".tfhb-show-password",function(o){let i='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye-off"><path d="M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"/><path d="M14.084 14.158a3 3 0 0 1-4.242-4.242"/><path d="M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"/><path d="m2 2 20 20"/></svg>';$this=e(this);let s='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-eye"><path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/></svg>',t=$this.closest(".tfhb-frontend-from__field-item__inner").find("input");t.attr("type")==="password"?(t.attr("type","text"),$this.html(i)):(t.attr("type","password"),$this.html(s))}),e(document).ready(function(){e(document).on("submit","#tfhb-reg-from",function(o){o.preventDefault(),$this=e(this);var i=new FormData(this),s=$this.find(".tfhb-submit-icon").html();$this.find(".tfhb-submit-icon svg").remove(),$this.find(".tfhb-submit-icon").append(a),$this.find(".tfhb-error").removeClass("tfhb-error"),$this.find(".tfhb-error-text").remove(),$this.find(".tfhb-notice").remove(),i.append("action","tfhb_registration"),e.ajax({url:tfhb_app_booking.ajax_url,type:"POST",data:i,processData:!1,contentType:!1,success:function(t){if(t.success)$this.find(".tfhb-submit-icon svg").remove(),$this.find(".tfhb-submit-icon").append(s),$this.html(""),$this.append(`<div class="tfhb-notice tfhb-success">${t.message}</div>`);else{$this.find(".tfhb-submit-icon svg").remove(),$this.find(".tfhb-submit-icon").append(s);let n=t.fieldErrors;for(let r in n){let h='<small class="tfhb-error-text">'+n[r]+"</small>";$this.find(`[name="${r}"]`).addClass("tfhb-error"),$this.find(`[name="${r}"]`).after(h)}t.message&&$this.append(`<div class="tfhb-notice tfhb-error">${t.message}</div>`)}},error:function(t){console.log(t)}})})})})(jQuery);
