Your IP : 3.133.113.101


Current Path : /home/e/p/h/ephorei/www/wp-content/plugins/sureforms/assets/build/
Upload File :
Current File : /home/e/p/h/ephorei/www/wp-content/plugins/sureforms/assets/build/formSubmit.js

/*! For license information please see formSubmit.js.LICENSE.txt */
(()=>{"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function r(t){for(var r=1;r<arguments.length;r++){var o=null!=arguments[r]?arguments[r]:{};r%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function o(){o=function(){return e};var e={},r=Object.prototype,n=r.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),l=new A(n||[]);return i(a,"_invoke",{value:k(t,r,l)}),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var m={};function v(){}function p(){}function h(){}var y={};c(y,l,(function(){return this}));var b=Object.getPrototypeOf,g=b&&b(b(O([])));g&&g!==r&&n.call(g,l)&&(y=g);var w=h.prototype=v.prototype=Object.create(y);function S(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function E(e,r){function o(i,a,l,s){var u=d(e[i],e,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==t(f)&&n.call(f,"__await")?r.resolve(f.__await).then((function(t){o("next",t,l,s)}),(function(t){o("throw",t,l,s)})):r.resolve(f).then((function(t){c.value=t,l(c)}),(function(t){return o("throw",t,l,s)}))}s(u.arg)}var a;i(this,"_invoke",{value:function(t,e){function n(){return new r((function(r,n){o(t,e,r,n)}))}return a=a?a.then(n,n):n()}})}function k(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=x(a,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=d(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===m)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var o=d(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,m;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,m):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function O(t){if(t){var e=t[l];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return p.prototype=h,i(w,"constructor",{value:h,configurable:!0}),i(h,"constructor",{value:p,configurable:!0}),p.displayName=c(h,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},e.awrap=function(t){return{__await:t}},S(E.prototype),c(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(f(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(w),c(w,u,"Generator"),c(w,l,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),m}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),m}},e}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return l=t.done,t},e:function(t){s=!0,i=t},f:function(){try{l||null==r.return||r.return()}finally{if(s)throw i}}}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function l(t,e,r,n,o,i,a){try{var l=t[i](a),s=l.value}catch(t){return void r(t)}l.done?e(s):Promise.resolve(s).then(n,o)}function s(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){l(i,n,o,a,s,"next",t)}function s(t){l(i,n,o,a,s,"throw",t)}a(void 0)}))}}function u(t,e,r,n){return c.apply(this,arguments)}function c(){return(c=s(o().mark((function t(e,r,n,i){var a,l,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="action=validation_ajax_action&nonce="+encodeURIComponent(i)+"&id="+encodeURIComponent(r),Object.keys(e).forEach((function(t){a+="&"+encodeURIComponent(t)+"="+encodeURIComponent(e[t])})),t.prev=2,t.next=5,fetch(n,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a});case 5:if(!(l=t.sent).ok){t.next=11;break}return t.next=9,l.json();case 9:return s=t.sent,t.abrupt("return",s.data);case 11:t.next=16;break;case 13:t.prev=13,t.t0=t.catch(2),console.error(t.t0);case 16:case"end":return t.stop()}}),t,null,[[2,13]])})))).apply(this,arguments)}function f(t,e,r,n){return d.apply(this,arguments)}function d(){return d=s(o().mark((function t(e,n,a,l){var s,c,f,d,m,v,p,h,y,b,g,w,S,E,k,x,L,_,A=arguments;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s=A.length>4&&void 0!==A[4]&&A[4],c=!1,f=null,d=null,m={},v=function(t,e){f||(f=t,d=e,m=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},p=null,0===(h=document.querySelectorAll('input[data-unique="true"]')).length){t.next=15;break}y={},b=i(h);try{for(b.s();!(g=b.n()).done;)w=g.value,S=w.name,E=w.value,y[S]=E}catch(t){b.e(t)}finally{b.f()}return t.next=14,u(y,e,n,a);case 14:p=t.sent;case 15:k=s?[l]:Array.from(l.querySelectorAll(".srfm-block-single")),x=i(k),t.prev=17,_=o().mark((function t(){var r,n,i,a,l,s,u,f,d,m,h,y,b,g,w,S,E,k,x,_,A,O,j,q,C,P,T,I,N,D,F,G,U,R,M,B,Y,H,K,z,V,$,W,Z,J,Q,X,tt,et,rt,nt,ot,it,at,lt,st,ut,ct,ft,dt,mt,vt,pt,ht,yt,bt,gt,wt,St,Et,kt,xt,Lt,_t,At,Ot,jt,qt,Ct,Pt,Tt,It,Nt,Dt,Ft,Gt,Ut,Rt,Mt,Bt,Yt,Ht,Kt,zt,Vt,$t,Wt,Zt,Jt,Qt,Xt,te,ee,re,ne,oe,ie,ae,le,se,ue,ce,fe,de,me,ve,pe,he,ye,be,ge,we,Se,Ee,ke,xe,Le;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=L.value,l=!1,Array.isArray(null===(r=window.sureforms)||void 0===r?void 0:r.skipValidationCallbacks)&&window.sureforms.skipValidationCallbacks.forEach((function(t){"function"==typeof t&&(l=l||t(a))})),!l){t.next=5;break}return t.abrupt("return","continue");case 5:if(a.closest("form").getAttribute("form-id")===e){t.next=9;break}return t.abrupt("return","continue");case 9:t.t0=!0,t.next=t.t0===a.classList.contains("srfm-phone-block")?12:15;break;case 12:return s=a.querySelector(".srfm-input-phone"),u=null===(n=s)||void 0===n||null===(i=n.nextElementSibling)||void 0===i?void 0:i.value,t.abrupt("break",18);case 15:return s=a.querySelector("input, textarea, select"),u=s.value,t.abrupt("break",18);case 18:if(f=s.getAttribute("data-required"),d=s.getAttribute("data-unique"),m=s.getAttribute("name"),h=a.querySelector(".srfm-error-message"),m&&(m=m.replace(/_/g," ")),f&&"hidden"!==s.type&&("true"!==f||u?s&&(null===(g=window)||void 0===g||null===(w=g.srfm)||void 0===w||w.toggleErrorState(s.closest(".srfm-block"),!1)):(s&&(null===(y=window)||void 0===y||null===(b=y.srfm)||void 0===b||b.toggleErrorState(s.closest(".srfm-block"),!0)),h&&(h.textContent=h.getAttribute("data-error-msg")),c=!0,v(s,s.closest(".srfm-block"))),s.addEventListener("input",(function(){var t,e;null===(t=window)||void 0===t||null===(e=t.srfm)||void 0===e||e.toggleErrorState(s.closest(".srfm-block"),!1)}))),"true"===d&&""!==u&&((null===(S=p)||void 0===S?void 0:S.some((function(t){return"not unique"===t[m]})))?(s&&(null===(E=window)||void 0===E||null===(k=E.srfm)||void 0===k||k.toggleErrorState(s.closest(".srfm-block"),!0)),h.style.display="block",h.textContent=h.getAttribute("data-unique-msg"),c=!0,v(s,s.closest(".srfm-block"))):s&&(null===(x=window)||void 0===x||null===(_=x.srfm)||void 0===_||_.toggleErrorState(s.closest(".srfm-block"),!1),h.style.display="none")),!(a.classList.contains("srfm-multi-choice-block")||a.classList.contains("srfm-checkbox-block")||a.classList.contains("srfm-gdpr-block"))){t.next=41;break}A=a.querySelectorAll("input"),O=A[0].getAttribute("data-required"),j=!1,q=null,C=0;case 31:if(!(C<A.length)){t.next=39;break}if(q||"hidden"===A[C].type||(q=A[C]),!A[C].checked){t.next=36;break}return j=!0,t.abrupt("break",39);case 36:C++,t.next=31;break;case 39:"true"!==O||j?h&&(null===(I=window)||void 0===I||null===(N=I.srfm)||void 0===N||N.toggleErrorState(a,!1)):(h&&(h.textContent=a.querySelector(".srfm-error-message").getAttribute("data-error-msg"),null===(P=window)||void 0===P||null===(T=P.srfm)||void 0===T||T.toggleErrorState(a,!0)),c=!0,v(q,a)),A.forEach((function(t){t.addEventListener("input",(function(){var t,e;null===(t=window)||void 0===t||null===(e=t.srfm)||void 0===e||e.toggleErrorState(a,!1)}))}));case 41:if(a.classList.contains("srfm-url-block")&&(D=a.querySelector("input"),a.classList.contains("srfm-url-error")&&(null===(F=window)||void 0===F||null===(G=F.srfm)||void 0===G||G.toggleErrorState(a,!0),c=!0,v(D,a)),D.addEventListener("input",(function(){var t,e;null===(t=window)||void 0===t||null===(e=t.srfm)||void 0===e||e.toggleErrorState(a,!1)}))),a.classList.contains("srfm-phone-block")&&(U=a.querySelectorAll("input")[1],a.classList.contains("srfm-phone-error")&&(null===(R=window)||void 0===R||null===(M=R.srfm)||void 0===M||M.toggleErrorState(a,!0),c=!0,v(U,a)),a.querySelectorAll("input").forEach((function(t){t.addEventListener("input",(function(){var t,e;null===(t=window)||void 0===t||null===(e=t.srfm)||void 0===e||e.toggleErrorState(a,!1)}))}))),a.classList.contains("srfm-password-block-wrap")&&(B=a)&&(Y=B.querySelector(".srfm-password-confirm-block"))&&(H=Y.querySelector(".srfm-input-password-confirm").value,K=Y.querySelector(".srfm-error-message"),!H&&K&&"true"===f?(K.textContent=K.getAttribute("data-error-msg"),null===(z=window)||void 0===z||null===(V=z.srfm)||void 0===V||V.toggleErrorState(Y,!0),v(H,Y),c=!0):H!==u?(null===($=window)||void 0===$||null===(W=$.srfm)||void 0===W||W.toggleErrorState(Y,!0),K.textContent=null===(Z=window)||void 0===Z||null===(J=Z.srfm_submit)||void 0===J||null===(Q=J.messages)||void 0===Q?void 0:Q.srfm_confirm_password_same,v(H,Y),c=!0):null===(X=window)||void 0===X||null===(tt=X.srfm)||void 0===tt||tt.toggleErrorState(Y,!1)),a.classList.contains("srfm-email-block-wrap")&&(et=a)&&(rt=et.querySelector(".srfm-email-confirm-block"),et.classList.contains("srfm-valid-email-error")&&(v(s,et),c=!0),rt&&(nt=rt.querySelector(".srfm-input-email-confirm"),ot=rt.querySelector(".srfm-input-email-confirm").value,it=rt.querySelector(".srfm-error-message"),!ot&&it&&"true"===f?(it.textContent=it.getAttribute("data-error-msg"),null===(at=window)||void 0===at||null===(lt=at.srfm)||void 0===lt||lt.toggleErrorState(rt,!0),v(nt,rt),c=!0):ot!==u?(null===(st=window)||void 0===st||null===(ut=st.srfm)||void 0===ut||ut.toggleErrorState(rt,!0),it.textContent=null===(ct=window)||void 0===ct||null===(ft=ct.srfm_submit)||void 0===ft||null===(dt=ft.messages)||void 0===dt?void 0:dt.srfm_confirm_email_same,v(nt,rt),c=!0):null===(mt=window)||void 0===mt||null===(vt=mt.srfm)||void 0===vt||vt.toggleErrorState(rt,!1),nt.addEventListener("input",(function(){var t,e;null===(t=window)||void 0===t||null===(e=t.srfm)||void 0===e||e.toggleErrorState(rt,!1)}))),et.querySelector(".srfm-input-email").addEventListener("input",(function(){var t,e;null===(t=window)||void 0===t||null===(e=t.srfm)||void 0===e||e.toggleErrorState(et,!1)}))),a.classList.contains("srfm-upload-block")&&(pt=a.querySelector(".srfm-input-upload"),"true"!==(ht=pt.getAttribute("data-required"))||pt.value?s&&(null===(gt=window)||void 0===gt||null===(wt=gt.srfm)||void 0===wt||wt.toggleErrorState(s.closest(".srfm-block"),!1)):("true"===ht&&h&&(h.textContent=h.getAttribute("data-error-msg")),s&&(null===(yt=window)||void 0===yt||null===(bt=yt.srfm)||void 0===bt||bt.toggleErrorState(s.closest(".srfm-block"),!0)),c=!0,v(pt,a)),pt.addEventListener("input",(function(){var t,e;s&&(null===(t=window)||void 0===t||null===(e=t.srfm)||void 0===e||e.toggleErrorState(s.closest(".srfm-block"),!1))}))),a.classList.contains("srfm-number-block")&&(St=s.getAttribute("min"),Et=s.getAttribute("max"),kt=s.getAttribute("format-type"),u&&(xt="eu-style"===kt?parseFloat(u.replace(/\./g,"").replace(",",".")):parseFloat(u.replace(/,/g,"")),St&&(""!==St&&Number(xt)<Number(St)?(null===(Lt=window)||void 0===Lt||null===(_t=Lt.srfm)||void 0===_t||_t.toggleErrorState(s.closest(".srfm-block"),!0),h&&(h.textContent=null===(At=window)||void 0===At||null===(Ot=At.srfm)||void 0===Ot?void 0:Ot.srfmSprintfString(null===(jt=window)||void 0===jt||null===(qt=jt.srfm_submit)||void 0===qt||null===(Ct=qt.messages)||void 0===Ct?void 0:Ct.srfm_input_min_value,St))):null===(Pt=window)||void 0===Pt||null===(Tt=Pt.srfm)||void 0===Tt||Tt.toggleErrorState(s.closest(".srfm-block"),!1)),Et&&(""!==Et&&Number(xt)>Number(Et)?(null===(It=window)||void 0===It||null===(Nt=It.srfm)||void 0===Nt||Nt.toggleErrorState(s.closest(".srfm-block"),!0),h&&(h.textContent=null===(Dt=window)||void 0===Dt||null===(Ft=Dt.srfm)||void 0===Ft?void 0:Ft.srfmSprintfString(null===(Gt=window)||void 0===Gt||null===(Ut=Gt.srfm_submit)||void 0===Ut||null===(Rt=Ut.messages)||void 0===Rt?void 0:Rt.srfm_input_max_value,Et))):null===(Mt=window)||void 0===Mt||null===(Bt=Mt.srfm)||void 0===Bt||Bt.toggleErrorState(s.closest(".srfm-block"),!1)))),a.classList.contains("srfm-rating-block")&&("true"!==(Yt=a.querySelector(".srfm-input-rating")).getAttribute("data-required")||Yt.value?null===(zt=window)||void 0===zt||null===(Vt=zt.srfm)||void 0===Vt||Vt.toggleErrorState(Yt.closest(".srfm-block"),!1):(null===(Ht=window)||void 0===Ht||null===(Kt=Ht.srfm)||void 0===Kt||Kt.toggleErrorState(Yt.closest(".srfm-block"),!0),c=!0,v(a.querySelector(".srfm-icon"),a))),a.classList.contains("srfm-slider-block")&&($t=a.getAttribute("data-required"),Wt=a.querySelector(".srfm-input-slider"),Zt=a.querySelector(".srfm-text-slider"),Jt=a.getAttribute("data-default"),"true"===$t&&(Qt=!1,(!Wt||Wt.dataset.interacted||Jt&&"false"!==Jt)&&(!Zt||Zt.dataset.interacted||Jt&&"false"!==Jt)||(Qt=!0),Qt?(null===(Xt=window)||void 0===Xt||null===(te=Xt.srfm)||void 0===te||te.toggleErrorState(a,!0),c=!0,v(Wt,a)):null===(ee=window)||void 0===ee||null===(re=ee.srfm)||void 0===re||re.toggleErrorState(a,!1))),a.classList.contains("srfm-dropdown-block")&&(ne=a.querySelectorAll(".srfm-input-dropdown-hidden"),oe=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,ne.forEach((function(t){var e,r,n=t.getAttribute("data-required"),o=t.getAttribute("name");if("true"!==n||t.value)if(t.value){var i=t.getAttribute("data-min-selection"),a=t.getAttribute("data-max-selection");if(i||a){var l,s,u,f,d,m,p,y=t.value.split(",");if(i&&y.length<i)h.textContent=null===(l=window)||void 0===l||null===(s=l.srfm)||void 0===s?void 0:s.srfmSprintfString(null===(u=window)||void 0===u||null===(f=u.srfm_submit)||void 0===f||null===(d=f.messages)||void 0===d?void 0:d.srfm_dropdown_min_selections,i),null===(m=window)||void 0===m||null===(p=m.srfm)||void 0===p||p.toggleErrorState(t.closest(".srfm-block"),!0),c=!0;else if(a&&y.length>a){var b,g,w,S,E,k,x;h.textContent=null===(b=window)||void 0===b||null===(g=b.srfm)||void 0===g?void 0:g.srfmSprintfString(null===(w=window)||void 0===w||null===(S=w.srfm_submit)||void 0===S||null===(E=S.messages)||void 0===E?void 0:E.srfm_dropdown_max_selections,a),null===(k=window)||void 0===k||null===(x=k.srfm)||void 0===x||x.toggleErrorState(t.closest(".srfm-block"),!0),c=!0}}}else{var L,_;null===(L=window)||void 0===L||null===(_=L.srfm)||void 0===_||_.toggleErrorState(t.closest(".srfm-block"),!1)}else h.textContent=h.getAttribute("data-error-msg"),null===(e=window)||void 0===e||null===(r=e.srfm)||void 0===r||r.toggleErrorState(t.closest(".srfm-block"),!0),c=!0;if(c){var A,O,j=(null===(A=window)||void 0===A||null===(O=A.srfm)||void 0===O?void 0:O[o])||t;v(j,t.closest(".srfm-block"),{shouldDelayOnFocus:!0})}new oe((function(){var e,r;if(t.value)null===(e=window)||void 0===e||null===(r=e.srfm)||void 0===r||r.toggleErrorState(t.closest(".srfm-block"),!1);else if("true"===n){var o,i;null===(o=window)||void 0===o||null===(i=o.srfm)||void 0===i||i.toggleErrorState(t.closest(".srfm-block"),!0)}})).observe(t,{attributes:!0,attributeFilter:["value"]})}))),a.classList.contains("srfm-multi-choice-block")){for(ie=a.querySelectorAll("input"),ae=ie[0].getAttribute("data-min-selection"),le=ie[0].getAttribute("data-max-selection"),se=null,ue=0,ce=!1,fe=0;fe<ie.length;fe++)se||"hidden"===ie[fe].type||(se=ie[fe]),ie[fe].checked&&ue++;(ae||le)&&ue>0&&(!ce&&ae>0&&(f&&ae>1||!f)&&ue<ae&&(h.textContent=null===(de=window)||void 0===de||null===(me=de.srfm)||void 0===me?void 0:me.srfmSprintfString(null===(ve=window)||void 0===ve||null===(pe=ve.srfm_submit)||void 0===pe||null===(he=pe.messages)||void 0===he?void 0:he.srfm_multi_choice_min_selections,ae),ce=!0),!ce&&le>0&&ue>le&&(h.textContent=null===(ye=window)||void 0===ye||null===(be=ye.srfm)||void 0===be?void 0:be.srfmSprintfString(null===(ge=window)||void 0===ge||null===(we=ge.srfm_submit)||void 0===we||null===(Se=we.messages)||void 0===Se?void 0:Se.srfm_multi_choice_max_selections,le),ce=!0),ce?(null===(Ee=window)||void 0===Ee||null===(ke=Ee.srfm)||void 0===ke||ke.toggleErrorState(a,!0),v(se,a),c=!0):f||null===(xe=window)||void 0===xe||null===(Le=xe.srfm)||void 0===Le||Le.toggleErrorState(a,!1))}case 51:case"end":return t.stop()}}),t)})),x.s();case 20:if((L=x.n()).done){t.next=27;break}return t.delegateYield(_(),"t0",22);case 22:if("continue"!==t.t0){t.next=25;break}return t.abrupt("continue",25);case 25:t.next=20;break;case 27:t.next=32;break;case 29:t.prev=29,t.t1=t.catch(17),x.e(t.t1);case 32:return t.prev=32,x.f(),t.finish(32);case 35:return t.abrupt("return",!!c&&r({validateResult:c,firstErrorInput:f,scrollElement:d},m));case 36:case"end":return t.stop()}}),t,null,[[17,29,32,35]])}))),d.apply(this,arguments)}var m=function(){var t=s(o().mark((function t(e,r){var n,i,a,l,s;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.closest(r),i=n.closest("form"),a=i.getAttribute("form-id"),l=i.getAttribute("ajaxurl"),s=i.getAttribute("nonce"),t.next=8,f(a,l,s,n,!0);case 8:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),v=function(t){if(null!=t&&t.firstErrorInput){if(null!=t&&t.scrollElement){var e=t.scrollElement.getBoundingClientRect().top+window.pageYOffset-window.innerHeight/2;window.scroll({top:e,behavior:"smooth"})}null!=t&&t.shouldDelayOnFocus?setTimeout((function(){t.firstErrorInput.focus({preventScroll:!0})}),500):t.firstErrorInput.focus({preventScroll:!0})}};function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function y(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){b(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function b(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==p(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!==p(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===p(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function g(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=w(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw i}}}}function w(t,e){if(t){if("string"==typeof t)return S(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function E(){E=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",l=o.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),l=new A(o||[]);return n(a,"_invoke",{value:k(t,r,l)}),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function d(){}function m(){}function v(){}var h={};s(h,i,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(O([])));b&&b!==e&&r.call(b,i)&&(h=b);var g=v.prototype=d.prototype=Object.create(h);function w(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function S(t,e){function o(n,i,a,l){var s=c(t[n],t,i);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==p(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,l)}),(function(t){o("throw",t,a,l)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,l)}))}l(s.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function k(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var l=x(a,r);if(l){if(l===f)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var s=c(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=c(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:j}}function j(){return{value:void 0,done:!0}}return m.prototype=v,n(g,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:m,configurable:!0}),m.displayName=s(v,l,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,s(t,l,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},w(S.prototype),s(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new S(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},w(g),s(g,l,"Generator"),s(g,i,(function(){return this})),s(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(l&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function k(t,e,r,n,o,i,a){try{var l=t[i](a),s=l.value}catch(t){return void r(t)}l.done?e(s):Promise.resolve(s).then(n,o)}function x(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){k(i,n,o,a,l,"next",t)}function l(t){k(i,n,o,a,l,"throw",t)}a(void 0)}))}}function L(t){return _.apply(this,arguments)}function _(){return(_=x(E().mark((function t(e){var r,n,o,i,a,l,s,u,c,f;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=new FormData(e),n=new FormData,o=["srfm-email-confirm","srfm-password-confirm"],i=g(r.entries()),t.prev=4,i.s();case 6:if((a=i.n()).done){t.next=14;break}if(d=a.value,m=2,l=function(t){if(Array.isArray(t))return t}(d)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,l=[],s=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);s=!0);}catch(t){u=!0,o=t}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return l}}(d,m)||w(d,m)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=l[0],u=l[1],!o.includes(s)){t.next=10;break}return t.abrupt("continue",12);case 10:""!==u&&(c=e.querySelector('[name="'.concat(s,'"]')),null!=(f=null==c?void 0:c.closest(".srfm-block-single"))&&f.classList.contains("hide-element")&&(u="")),n.append(s,u);case 12:t.next=6;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(4),i.e(t.t0);case 19:return t.prev=19,i.f(),t.finish(19);case 22:return t.prev=22,t.next=25,wp.apiFetch({path:"sureforms/v1/submit-form",method:"POST",body:n});case 25:return t.abrupt("return",t.sent);case 28:t.prev=28,t.t1=t.catch(22),console.log(t.t1);case 31:case"end":return t.stop()}var d,m}),t,null,[[4,16,19,22],[22,28]])})))).apply(this,arguments)}function A(t){return O.apply(this,arguments)}function O(){return(O=x(E().mark((function t(e){var r;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.data.submission_id,t.prev=1,t.next=4,wp.apiFetch({path:"/sureforms/v1/after-submission/".concat(r),method:"GET"});case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),console.error(t.t0);case 9:case"end":return t.stop()}}),t,null,[[1,6]])})))).apply(this,arguments)}function j(t,e,r,n,o,i,a){var l,s,u=new CustomEvent("srfm_on_show_success_message",{cancelable:!0,detail:{form:n,element:e,message:r,submitType:i,container:t,loader:a}});document.dispatchEvent(u)&&("hide form"===o?(n.style.opacity=1,n.style.display="none",setTimeout((function(){e.style.opacity=1}),500)):"reset form"===o&&n.reset(),e.innerHTML=r,t.classList.add("srfm-active"),null===(l=window)||void 0===l||null===(s=l.srfm)||void 0===s||s.handleInstantFormWrapperHeight(),n.parentElement.scrollIntoView({behavior:"smooth"}))}function q(t){t.removeAttribute("hidden"),console.error("Network Error")}function C(t,e,r,n,o,i,a,l,s,u,c){return P.apply(this,arguments)}function P(){return(P=x(E().mark((function t(e,r,n,o,i,a,l,s,u,c,d){var m,p,h,b,g,w,S;return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i.classList.add("srfm-active"),t.next=4,f(r,n,o,e);case 4:if(null==(m=t.sent)||!m.validateResult){t.next=9;break}return i.classList.remove("srfm-active"),v(m),t.abrupt("return");case 9:if(p=new CustomEvent("srfm_on_trigger_form_submission",{cancelable:!0,detail:{form:e,loader:i,formId:r,submitType:c,successElement:s,successContainer:l}}),document.dispatchEvent(p)){t.next=13;break}return i.classList.remove("srfm-active"),t.abrupt("return");case 13:return t.next=15,L(e);case 15:null!=(h=t.sent)&&h.success?(I(y(y({},h),{},{formId:r})),"same page"===c?(j(l,s,null!==(g=null==h?void 0:h.message)&&void 0!==g?g:"",e,d,c),i.classList.remove("srfm-active")):["different page","custom url"].includes(c)?(null!=h&&h.redirect_url&&(a=null==h?void 0:h.redirect_url,window.location.assign(a)),i.classList.remove("srfm-active")):j(l,s,null!==(w=null==h?void 0:h.message)&&void 0!==w?w:"",e,d,c,i),null!=h&&null!==(b=h.data)&&void 0!==b&&b.after_submit&&A(h)):(i.classList.remove("srfm-active"),q(u),i.classList.remove("srfm-active")),t.next=25;break;case 19:t.prev=19,t.t0=t.catch(0),S=new CustomEvent("srfm_on_trigger_form_submission_failure",{detail:{form:e,error:t.t0,loader:i,formId:r,submitType:c,successElement:s,successContainer:l}}),document.dispatchEvent(S),i.classList.remove("srfm-active"),q(u);case 25:case"end":return t.stop()}var a}),t,null,[[0,19]])})))).apply(this,arguments)}function T(t){var e=t.getAttribute("form-id"),r=t.getAttribute("message-type"),n=t.getAttribute("success-url"),o=t.getAttribute("ajaxurl"),i=t.getAttribute("nonce"),a=t.querySelector(".srfm-loader"),l=t.parentElement.querySelector(".srfm-single-form.srfm-success-box"),s=null==l?void 0:l.querySelector(".srfm-success-box-description"),u=t.querySelector(".srfm-error-message"),c=t.querySelector("#srfm-submit-btn"),f=t.getAttribute("after-submission"),d=t.querySelector(".g-recaptcha");return{formId:e,submitType:r,successUrl:n,ajaxUrl:o,nonce:i,loader:a,successContainer:l,successElement:s,errorElement:u,submitBtn:c,siteKey:null==d?void 0:d.getAttribute("data-sitekey"),recaptchaType:null==d?void 0:d.getAttribute("recaptcha-type"),afterSubmission:f,captchaErrorElement:t.querySelector("#captcha-error"),hCaptchaDiv:t.querySelector(".h-captcha"),turnstileDiv:t.querySelector(".cf-turnstile")}}function I(t){var e=new CustomEvent("srfm_form_submission_success",{detail:{formId:"srfm-form-".concat(t.formId)}});document.dispatchEvent(e)}document.addEventListener("DOMContentLoaded",(function(){["srfm-input-block","srfm-email-block-wrap","srfm-url-block","srfm-phone-block","srfm-checkbox-block","srfm-gdpr-block","srfm-number-block","srfm-multi-choice-block","srfm-datepicker-block","srfm-upload-block","srfm-rating-block","srfm-textarea-block","srfm-dropdown-block","srfm-slider-block"].forEach((function(t){return function(t,e){var r=Array.from(document.getElementsByClassName(t));if(r){var n,a=i(r);try{var l=function(){var r=n.value,i=r.querySelector("input")||r.querySelector("textarea")||r.querySelector("select");if("srfm-upload-block"===t&&(i=r.querySelector('input[type="file"]')),"srfm-rating-block"===t&&function(t,e,r){e.querySelectorAll(".srfm-icon").forEach((function(t){t.addEventListener("blur",s(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(t,r);case 1:case"end":return e.stop()}}),e)}))))}))}(0,r,e),"srfm-multi-choice-block"===t&&function(t,e,r){e.querySelectorAll(".srfm-input-multi-choice-single").forEach((function(t){t.addEventListener("blur",s(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:m(t,r);case 1:case"end":return e.stop()}}),e)}))))}))}(0,r,e),"srfm-email-block-wrap"===t&&function(t,e){var r=t.querySelectorAll("input"),n=t.closest(e);r.forEach((function(t){t.addEventListener("input",s(o().mark((function e(){var r,i,a,l,s,u,c,f,d,m,v,p,h,y,b,g;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.value=t.value.trim().toLowerCase(),r=!1,/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t.value)&&(r=!0),i=t.classList.contains("srfm-input-email-confirm")?n.querySelector(".srfm-email-confirm-block"):n.querySelector(".srfm-email-block"),a=i.querySelector(".srfm-error-message"),t.value||(a.style.display="none",i.classList.remove("srfm-valid-email-error")),!t.classList.contains("srfm-input-email-confirm")){e.next=20;break}if(u=n.querySelector(".srfm-input-email"),c=n.querySelector(".srfm-email-confirm-block"),f=c.querySelector(".srfm-error-message"),u.value===t.value){e.next=17;break}return f.style.display="block",f.textContent=null===(d=window)||void 0===d||null===(m=d.srfm_submit)||void 0===m||null===(v=m.messages)||void 0===v?void 0:v.srfm_confirm_email_same,null===(p=window)||void 0===p||null===(h=p.srfm)||void 0===h||h.toggleErrorState(n,!0),e.abrupt("return");case 17:null===(l=window)||void 0===l||null===(s=l.srfm)||void 0===s||s.toggleErrorState(n,!1),f.textContent="",f.style.display="none";case 20:r?(a.style.display="none",i.parentElement.classList.remove("srfm-valid-email-error"),a.removeAttribute("id")):(i.parentElement.classList.add("srfm-valid-email-error"),a.style.display="block",a.innerHTML=null===(y=window)||void 0===y||null===(b=y.srfm_submit)||void 0===b||null===(g=b.messages)||void 0===g?void 0:g.srfm_valid_email,a.id=a.getAttribute("data-srfm-id"));case 21:case"end":return e.stop()}}),e)}))))}))}(r,e),"srfm-slider-block"===t&&function(t,e,r){var n=e.querySelector(".srfm-input-slider"),i=e.querySelector(".srfm-text-slider");if(n&&n.addEventListener("blur",s(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:m(n,r);case 1:case"end":return t.stop()}}),t)})))),i){var a=i.querySelector(".srfm-slider-thumb");a&&a.addEventListener("blur",s(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:m(a,r);case 1:case"end":return t.stop()}}),t)}))))}}(0,r,e),"srfm-dropdown-block"===t){var a=i.getAttribute("name");setTimeout((function(){var t,r,n;null===(t=window)||void 0===t||null===(r=t.srfm)||void 0===r||null===(n=r[a])||void 0===n||n.on("blur",(function(){m(i,e)}))}),500)}"srfm-phone-block"===t&&(i=r.querySelector(".srfm-input-phone")),i&&i.addEventListener("blur",s(o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:m(i,e);case 1:case"end":return t.stop()}}),t)}))))};for(a.s();!(n=a.n()).done;)l()}catch(t){a.e(t)}finally{a.f()}}}(t,".".concat(t))}));for(var t=Array.from(document.querySelectorAll(".srfm-form")),e=function(){var t=n[r],e=T(t),o=e.formId,i=e.submitType,a=e.successUrl,l=e.ajaxUrl,s=e.nonce,u=e.loader,c=e.successContainer,f=e.successElement,d=e.errorElement,m=e.submitBtn,v=e.siteKey,p=e.recaptchaType,h=e.afterSubmission,y=e.captchaErrorElement,b=e.hCaptchaDiv,g=e.turnstileDiv;"v3-reCAPTCHA"===p?m.addEventListener("click",(function(e){e.preventDefault(),grecaptcha.ready((function(){grecaptcha.execute(v,{action:"submit"}).then(function(){var e=x(E().mark((function e(r){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r&&C(t,o,l,s,u,a,c,f,d,i,h);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}))})):"v2-checkbox"===p||b||g?t.addEventListener("submit",(function(e){var r;e.preventDefault(),"v2-checkbox"===p?r=grecaptcha.getResponse():b?r=hcaptcha.getResponse():g&&(r=turnstile.getResponse()),0!==r.length?(y.style.display="none",C(t,o,l,s,u,a,c,f,d,i,h)):y.style.display="block"})):t.addEventListener("submit",function(){var e=x(E().mark((function e(r){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r.preventDefault(),C(t,o,l,s,u,a,c,f,d,i,h);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},r=0,n=t;r<n.length;r++)e()})),window.onloadCallback=function(){Array.from(document.querySelectorAll(".srfm-form")).forEach((function(t){var e=T(t),r=e.formId,n=e.submitType,o=e.successUrl,i=e.ajaxUrl,a=e.nonce,l=e.loader,s=e.successContainer,u=e.successElement,c=e.errorElement,f=e.submitBtn,d=e.siteKey,m=e.recaptchaType,v=e.afterSubmission,p=!1;"v2-invisible"===m&&(grecaptcha.render(f,{sitekey:d,callback:function(){C(t,r,i,a,l,o,s,u,c,n,v),p=!0}}),f.addEventListener("click",(function(){l.classList.add("srfm-active"),p&&C(t,r,i,a,l,o,s,u,c,n,v)})))}))},window.handleBricksPreviewFormSubmission=function(){for(var t=0,e=Array.from(document.querySelectorAll(".srfm-form"));t<e.length;t++)e[t].addEventListener("submit",function(){var t=x(E().mark((function t(e){return E().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.preventDefault();case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}())}})();