FileMaster
Search
Toggle Dark Mode
Home
/
.
/
wp-content
/
plugins
/
sureforms
/
assets
/
build
Edit File: formSubmit.js
/*! For license information please see formSubmit.js.LICENSE.txt */ (()=>{"use strict";const t=window.wp.hooks;function e(t){return e="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},e(t)}function r(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 n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(t,r,n){return(r=function(t){var r=function(t){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==e(r)?r:r+""}(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function i(){i=function(){return r};var t,r={},n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function c(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function f(e,r,n,o){var i=r&&r.prototype instanceof v?r:v,a=Object.create(i.prototype);return c(a,"_invoke",function(e,r,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===d)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var l=m(e,r,n);if("normal"===l.type){if(o=n.done?4:2,l.arg===d)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=4,n.method="throw",n.arg=l.arg)}}}(e,n,new A(o||[])),!0),a}function m(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var d={};function v(){}function p(){}function h(){}var y={};c(y,s,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(O([])));b&&b!==n&&o.call(b,s)&&(y=b);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(t,r){function n(i,a,s,u){var l=m(t[i],t,a);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==e(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,s,u)}),(function(t){n("throw",t,s,u)})):r.resolve(f).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,u)}))}u(l.arg)}var i;c(this,"_invoke",(function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return i=i?i.then(o,o):o()}),!0)}function k(e,r){var n=r.method,o=e.i[n];if(o===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),d;var i=m(o,e.i,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,d;var a=i.arg;return a?a.done?(r[e.r]=a.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,d):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,d)}function x(t){this.tryEntries.push(t)}function _(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function A(t){this.tryEntries=[[-1]],t.forEach(x,this),this.reset(!0)}function O(r){if(null!=r){var n=r[s];if(n)return n.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var i=-1,a=function e(){for(;++i<r.length;)if(o.call(r,i))return e.value=r[i],e.done=!1,e;return e.value=t,e.done=!0,e};return a.next=a}}throw new TypeError(e(r)+" is not iterable")}return p.prototype=h,c(w,"constructor",h),c(h,"constructor",p),p.displayName=c(h,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===p||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,c(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},S(E.prototype),c(E.prototype,u,(function(){return this})),r.AsyncIterator=E,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new E(f(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(w),c(w,l,"Generator"),c(w,s,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},r.values=O,A.prototype={constructor:A,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){a.type="throw",a.arg=e,r.next=t}for(var o=r.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],s=this.prev,u=i[1],l=i[2];if(-1===i[0])return n("end"),!1;if(!u&&!l)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<u)return this.method="next",this.arg=t,n(u),!0;if(s<l)return n(l),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],d):this.complete(i)},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),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[2]===t)return this.complete(r[4],r[3]),_(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var o=n.arg;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:O(e),r,n},"next"===this.method&&(this.arg=t),d}},r}function a(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 s(t,e);var r={}.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}}(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,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function l(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){u(i,n,o,a,s,"next",t)}function s(t){u(i,n,o,a,s,"throw",t)}a(void 0)}))}}function c(t,e,r,n){return f.apply(this,arguments)}function f(){return(f=l(i().mark((function t(e,r,n,o){var a,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a="action=validation_ajax_action&token="+encodeURIComponent(o)+"&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(!(s=t.sent).ok){t.next=11;break}return t.next=9,s.json();case 9:return u=t.sent,t.abrupt("return",u.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 m(t,e,r,n){return d.apply(this,arguments)}function d(){return d=l(i().mark((function e(r,o,s,u){var l,f,m,d,v,p,h,y,g,b,w,S,E,k,x,_,A,O,q=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(l=q.length>4&&void 0!==q[4]&&q[4],f=!1,m=null,d=null,v={},p=function(t,e){m||(m=t,d=e,v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},h=null,0===(y=u.querySelectorAll('input[data-unique="true"]')).length){e.next=15;break}g={},b=a(y);try{for(b.s();!(w=b.n()).done;)S=w.value,E=S.name,k=S.value,g[E]=k}catch(t){b.e(t)}finally{b.f()}return e.next=14,c(g,r,o,s);case 14:h=e.sent;case 15:x=l?[u]:Array.from(u.querySelectorAll(".srfm-block-single")),_=a(x),e.prev=17,O=i().mark((function e(){var n,o,a,s,u,l,c,m,d,v,y,g,b,w,S,E,k,x,_,O,q,P,j,L,C,T,F,I,N,U,G,D,R,M,V,B,H,z,K,Y,$,W,J,Z,X,Q,tt,et,rt,nt,ot,it,at,st,ut,lt,ct,ft,mt,dt,vt,pt,ht,yt,gt,bt,wt,St,Et,kt,xt,_t,At,Ot,qt;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=A.value,s=!1,Array.isArray(null===(n=window.sureforms)||void 0===n?void 0:n.skipValidationCallbacks)&&window.sureforms.skipValidationCallbacks.forEach((function(t){"function"==typeof t&&(s=s||t(a))})),!s){e.next=5;break}return e.abrupt("return",0);case 5:if(a.closest("form").getAttribute("form-id")===r){e.next=9;break}return e.abrupt("return",0);case 9:e.t0=!0,e.next=e.t0===a.classList.contains("srfm-phone-block")?12:15;break;case 12:return u=a.querySelector(".srfm-input-phone"),l=null===(o=u)||void 0===o||null===(o=o.nextElementSibling)||void 0===o?void 0:o.value,e.abrupt("break",18);case 15:return u=a.querySelector("input, textarea, select"),l=u.value,e.abrupt("break",18);case 18:if(c=u.getAttribute("data-required"),m=u.getAttribute("data-unique"),d=u.getAttribute("name"),v=a.querySelector(".srfm-error-message"),d&&(d=d.replace(/_/g," ")),c&&"hidden"!==u.type&&("true"!==c||l?u&&(null===(g=window)||void 0===g||null===(g=g.srfm)||void 0===g||g.toggleErrorState(u.closest(".srfm-block"),!1)):(u&&(null===(y=window)||void 0===y||null===(y=y.srfm)||void 0===y||y.toggleErrorState(u.closest(".srfm-block"),!0)),v&&(v.textContent=v.getAttribute("data-error-msg")),f=!0,p(u,u.closest(".srfm-block"))),u.addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(u.closest(".srfm-block"),!1)}))),"true"===m&&""!==l&&((null===(b=h)||void 0===b?void 0:b.some((function(t){return"not unique"===t[d]})))?(u&&(null===(w=window)||void 0===w||null===(w=w.srfm)||void 0===w||w.toggleErrorState(u.closest(".srfm-block"),!0)),v.style.display="block",v.textContent=v.getAttribute("data-unique-msg"),f=!0,p(u,u.closest(".srfm-block"))):u&&(null===(S=window)||void 0===S||null===(S=S.srfm)||void 0===S||S.toggleErrorState(u.closest(".srfm-block"),!1),v.style.display="none")),!(a.classList.contains("srfm-multi-choice-block")||a.classList.contains("srfm-checkbox-block")||a.classList.contains("srfm-gdpr-block"))){e.next=41;break}E=a.querySelectorAll("input"),k=E[0].getAttribute("data-required"),x=!1,_=null,O=0;case 31:if(!(O<E.length)){e.next=39;break}if(_||"hidden"===E[O].type||(_=E[O]),!E[O].checked){e.next=36;break}return x=!0,e.abrupt("break",39);case 36:O++,e.next=31;break;case 39:"true"!==k||x?v&&(null===(P=window)||void 0===P||null===(P=P.srfm)||void 0===P||P.toggleErrorState(a,!1)):(v&&(v.textContent=a.querySelector(".srfm-error-message").getAttribute("data-error-msg"),null===(q=window)||void 0===q||null===(q=q.srfm)||void 0===q||q.toggleErrorState(a,!0)),f=!0,p(_,a)),E.forEach((function(t){t.addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(a,!1)}))}));case 41:if(a.classList.contains("srfm-url-block")&&(j=a.querySelector("input"),a.classList.contains("srfm-url-error")&&(null===(L=window)||void 0===L||null===(L=L.srfm)||void 0===L||L.toggleErrorState(a,!0),f=!0,p(j,a)),j.addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(a,!1)}))),a.classList.contains("srfm-phone-block")&&(C=a.querySelectorAll("input")[1],a.classList.contains("srfm-phone-error")&&(null===(T=window)||void 0===T||null===(T=T.srfm)||void 0===T||T.toggleErrorState(a,!0),f=!0,p(C,a)),a.querySelectorAll("input").forEach((function(t){t.addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(a,!1)}))}))),a.classList.contains("srfm-email-block-wrap")&&(F=a)&&(I=F.querySelector(".srfm-email-confirm-block"),F.classList.contains("srfm-valid-email-error")&&(p(u,F),f=!0),I&&(N=I.querySelector(".srfm-input-email-confirm"),U=I.querySelector(".srfm-input-email-confirm").value,G=I.querySelector(".srfm-error-message"),!U&&G&&"true"===c?(G.textContent=G.getAttribute("data-error-msg"),null===(D=window)||void 0===D||null===(D=D.srfm)||void 0===D||D.toggleErrorState(I,!0),p(N,I),f=!0):U!==l?(null===(R=window)||void 0===R||null===(R=R.srfm)||void 0===R||R.toggleErrorState(I,!0),G.textContent=null===(M=window)||void 0===M||null===(M=M.srfm_submit)||void 0===M||null===(M=M.messages)||void 0===M?void 0:M.srfm_confirm_email_same,p(N,I),f=!0):null===(V=window)||void 0===V||null===(V=V.srfm)||void 0===V||V.toggleErrorState(I,!1),N.addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(I,!1)}))),F.querySelector(".srfm-input-email").addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(F,!1)}))),a.classList.contains("srfm-upload-block")&&(B=a.querySelector(".srfm-input-upload"),"true"!==(H=B.getAttribute("data-required"))||B.value?u&&(null===(K=window)||void 0===K||null===(K=K.srfm)||void 0===K||K.toggleErrorState(u.closest(".srfm-block"),!1)):("true"===H&&v&&(v.textContent=v.getAttribute("data-error-msg")),u&&(null===(z=window)||void 0===z||null===(z=z.srfm)||void 0===z||z.toggleErrorState(u.closest(".srfm-block"),!0)),f=!0,p(B,a)),B.addEventListener("input",(function(){var t;u&&(null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(u.closest(".srfm-block"),!1))}))),a.classList.contains("srfm-number-block")&&(Y=u.getAttribute("min"),$=u.getAttribute("max"),W=u.getAttribute("format-type"),l&&(J="eu-style"===W?parseFloat(l.replace(/\./g,"").replace(",",".")):parseFloat(l.replace(/,/g,"")),(Y||$)&&(X=!1,Q="",Y&&""!==Y&&Number(J)<Number(Y)?(X=!0,Q=null===(tt=window)||void 0===tt||null===(tt=tt.srfm)||void 0===tt?void 0:tt.srfmSprintfString(null===(et=window)||void 0===et||null===(et=et.srfm_submit)||void 0===et||null===(et=et.messages)||void 0===et?void 0:et.srfm_input_min_value,Y)):$&&""!==$&&Number(J)>Number($)&&(X=!0,Q=null===(rt=window)||void 0===rt||null===(rt=rt.srfm)||void 0===rt?void 0:rt.srfmSprintfString(null===(nt=window)||void 0===nt||null===(nt=nt.srfm_submit)||void 0===nt||null===(nt=nt.messages)||void 0===nt?void 0:nt.srfm_input_max_value,$)),null===(Z=window)||void 0===Z||null===(Z=Z.srfm)||void 0===Z||Z.toggleErrorState(u.closest(".srfm-block"),X),v&&(v.textContent=X?Q:"",X&&(f=!0,p(u,a)))))),a.classList.contains("srfm-rating-block")&&("true"!==(ot=a.querySelector(".srfm-input-rating")).getAttribute("data-required")||ot.value?null===(at=window)||void 0===at||null===(at=at.srfm)||void 0===at||at.toggleErrorState(ot.closest(".srfm-block"),!1):(null===(it=window)||void 0===it||null===(it=it.srfm)||void 0===it||it.toggleErrorState(ot.closest(".srfm-block"),!0),f=!0,p(a.querySelector(".srfm-icon"),a))),a.classList.contains("srfm-slider-block")&&(st=a.getAttribute("data-required"),ut=a.querySelector(".srfm-input-slider"),lt=a.querySelector(".srfm-text-slider"),ct=a.getAttribute("data-default"),"true"===st&&(ft=!1,(!ut||ut.dataset.interacted||ct&&"false"!==ct)&&(!lt||lt.dataset.interacted||ct&&"false"!==ct)||(ft=!0),ft?(null===(mt=window)||void 0===mt||null===(mt=mt.srfm)||void 0===mt||mt.toggleErrorState(a,!0),f=!0,p(ut,a)):null===(dt=window)||void 0===dt||null===(dt=dt.srfm)||void 0===dt||dt.toggleErrorState(a,!1))),a.classList.contains("srfm-dropdown-block")&&(vt=a.querySelectorAll(".srfm-input-dropdown-hidden"),pt=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,vt.forEach((function(t){var e,r=t.getAttribute("data-required"),n=t.getAttribute("name");if("true"!==r||t.value)if(t.value){var o=t.getAttribute("data-min-selection"),i=t.getAttribute("data-max-selection");if(o||i){var a,s,u,l=window.srfm.srfmUtility.extractValue(t.value);if(o&&l.length<o)v.textContent=null===(a=window)||void 0===a||null===(a=a.srfm)||void 0===a?void 0:a.srfmSprintfString(null===(s=window)||void 0===s||null===(s=s.srfm_submit)||void 0===s||null===(s=s.messages)||void 0===s?void 0:s.srfm_dropdown_min_selections,o),null===(u=window)||void 0===u||null===(u=u.srfm)||void 0===u||u.toggleErrorState(t.closest(".srfm-block"),!0),f=!0;else if(i&&l.length>i){var c,m,d;v.textContent=null===(c=window)||void 0===c||null===(c=c.srfm)||void 0===c?void 0:c.srfmSprintfString(null===(m=window)||void 0===m||null===(m=m.srfm_submit)||void 0===m||null===(m=m.messages)||void 0===m?void 0:m.srfm_dropdown_max_selections,i),null===(d=window)||void 0===d||null===(d=d.srfm)||void 0===d||d.toggleErrorState(t.closest(".srfm-block"),!0),f=!0}}}else{var h;null===(h=window)||void 0===h||null===(h=h.srfm)||void 0===h||h.toggleErrorState(t.closest(".srfm-block"),!1)}else v.textContent=v.getAttribute("data-error-msg"),null===(e=window)||void 0===e||null===(e=e.srfm)||void 0===e||e.toggleErrorState(t.closest(".srfm-block"),!0),f=!0;if(f){var y,g=(null===(y=window)||void 0===y||null===(y=y.srfm)||void 0===y?void 0:y[n])||t;p(g,t.closest(".srfm-block"),{shouldDelayOnFocus:!0})}new pt((function(){var e;if(t.value)null===(e=window)||void 0===e||null===(e=e.srfm)||void 0===e||e.toggleErrorState(t.closest(".srfm-block"),!1);else if("true"===r){var n;null===(n=window)||void 0===n||null===(n=n.srfm)||void 0===n||n.toggleErrorState(t.closest(".srfm-block"),!0)}})).observe(t,{attributes:!0,attributeFilter:["value"]})}))),a.classList.contains("srfm-multi-choice-block")){for(ht=a.querySelectorAll("input"),yt=ht[0].getAttribute("data-min-selection"),gt=ht[0].getAttribute("data-max-selection"),bt=null,wt=0,St=!1,Et=0;Et<ht.length;Et++)bt||"hidden"===ht[Et].type||(bt=ht[Et]),ht[Et].checked&&wt++;(yt||gt)&&wt>0&&(!St&&yt>0&&(c&&yt>1||!c)&&wt<yt&&(v.textContent=null===(kt=window)||void 0===kt||null===(kt=kt.srfm)||void 0===kt?void 0:kt.srfmSprintfString(null===(xt=window)||void 0===xt||null===(xt=xt.srfm_submit)||void 0===xt||null===(xt=xt.messages)||void 0===xt?void 0:xt.srfm_multi_choice_min_selections,yt),St=!0),!St&>>0&&wt>gt&&(v.textContent=null===(_t=window)||void 0===_t||null===(_t=_t.srfm)||void 0===_t?void 0:_t.srfmSprintfString(null===(At=window)||void 0===At||null===(At=At.srfm_submit)||void 0===At||null===(At=At.messages)||void 0===At?void 0:At.srfm_multi_choice_max_selections,gt),St=!0),St?(null===(Ot=window)||void 0===Ot||null===(Ot=Ot.srfm)||void 0===Ot||Ot.toggleErrorState(a,!0),p(bt,a),f=!0):c||null===(qt=window)||void 0===qt||null===(qt=qt.srfm)||void 0===qt||qt.toggleErrorState(a,!1))}f=(0,t.applyFilters)("srfm.modifyFieldValidationResult",f,a,p);case 51:case"end":return e.stop()}}),e)})),_.s();case 20:if((A=_.n()).done){e.next=27;break}return e.delegateYield(O(),"t0",22);case 22:if(0!==e.t0){e.next=25;break}return e.abrupt("continue",25);case 25:e.next=20;break;case 27:e.next=32;break;case 29:e.prev=29,e.t1=e.catch(17),_.e(e.t1);case 32:return e.prev=32,_.f(),e.finish(32);case 35:return e.abrupt("return",!!f&&n({validateResult:f,firstErrorInput:m,scrollElement:d},v));case 36:case"end":return e.stop()}}),e,null,[[17,29,32,35]])}))),d.apply(this,arguments)}function v(){return(0,t.applyFilters)("srfm.srfmFields",["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","srfm-password-block"])}function p(){((arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||v()).forEach((function(t){return function(t,e){var r=Array.from(document.getElementsByClassName(t));if(r){var n,o=a(r);try{var s=function(){var r=n.value,o=r.querySelector("input")||r.querySelector("textarea")||r.querySelector("select");if("srfm-upload-block"===t&&(o=r.querySelector('input[type="file"]')),"srfm-rating-block"===t&&function(t,e,r){e.querySelectorAll(".srfm-icon").forEach((function(t){t.addEventListener("blur",l(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h(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",l(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:h(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",l(i().mark((function e(){var r,o,a,s,u,l,c,f,m,d;return i().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),o=t.classList.contains("srfm-input-email-confirm")?n.querySelector(".srfm-email-confirm-block"):n.querySelector(".srfm-email-block"),a=o.querySelector(".srfm-error-message"),t.value||(a.style.display="none",o.classList.remove("srfm-valid-email-error")),!t.classList.contains("srfm-input-email-confirm")){e.next=20;break}if(u=n.querySelector(".srfm-input-email"),l=n.querySelector(".srfm-email-confirm-block"),c=l.querySelector(".srfm-error-message"),u.value===t.value){e.next=17;break}return c.style.display="block",c.textContent=null===(f=window)||void 0===f||null===(f=f.srfm_submit)||void 0===f||null===(f=f.messages)||void 0===f?void 0:f.srfm_confirm_email_same,null===(m=window)||void 0===m||null===(m=m.srfm)||void 0===m||m.toggleErrorState(n,!0),e.abrupt("return");case 17:null===(s=window)||void 0===s||null===(s=s.srfm)||void 0===s||s.toggleErrorState(n,!1),c.textContent="",c.style.display="none";case 20:""===(null==t?void 0:t.value)||r?(a.style.display="none",o.parentElement.classList.remove("srfm-valid-email-error"),a.removeAttribute("id")):(o.parentElement.classList.add("srfm-valid-email-error"),a.style.display="block",a.innerHTML=null===(d=window)||void 0===d||null===(d=d.srfm_submit)||void 0===d||null===(d=d.messages)||void 0===d?void 0:d.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){var r=t.querySelector(".srfm-input-slider"),n=t.querySelector(".srfm-text-slider");if(r&&r.addEventListener("blur",l(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h(r,e);case 1:case"end":return t.stop()}}),t)})))),n){var o=n.querySelector(".srfm-slider-thumb");o&&o.addEventListener("blur",l(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h(o,e);case 1:case"end":return t.stop()}}),t)}))))}}(r,e),"srfm-dropdown-block"===t){var a=o.getAttribute("name");setTimeout((function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||null===(t=t[a])||void 0===t||t.on("blur",(function(){h(o,e)}))}),500)}if("srfm-textarea-block"===t&&r.classList.contains("srfm-richtext")){var s=(o=r.querySelector("textarea.srfm-input-textarea")).getAttribute("id");setTimeout((function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||null===(t=t[s])||void 0===t||t.on("editor-change",(function(){var t;(null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||null===(t=t[s])||void 0===t?void 0:t.hasFocus())||h(o,e)}))}),500)}"srfm-phone-block"===t&&(o=r.querySelector(".srfm-input-phone")),o&&o.addEventListener("blur",l(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:h(o,e);case 1:case"end":return t.stop()}}),t)}))))};for(o.s();!(n=o.n()).done;)s()}catch(t){o.e(t)}finally{o.f()}}}(t,".srfm-form .".concat(t))})),document.querySelectorAll(".srfm-multi-choice-block").forEach((function(t){var e,r=t.querySelector(".srfm-input-multi-choice-hidden");if(r){var n=r.getAttribute("data-min-selection"),o=r.getAttribute("data-max-selection");if(n||o){var i=t.querySelector(".srfm-error-message"),a=(null===(e=window)||void 0===e||null===(e=e.srfm_submit)||void 0===e?void 0:e.messages)||{};t.addEventListener("input",(function(){var e,s=window.srfm.srfmUtility.extractValue(r.value).filter(Boolean).length;if(0!==s){var u,l=r.closest(".srfm-block"),c="";if(n&&s<n)c=null===(u=window)||void 0===u||null===(u=u.srfm)||void 0===u?void 0:u.srfmSprintfString(a.srfm_multi_choice_min_selections,n);else if(o&&s>o){var f;c=null===(f=window)||void 0===f||null===(f=f.srfm)||void 0===f?void 0:f.srfmSprintfString(a.srfm_multi_choice_max_selections,o)}i.textContent=c,null===(e=window)||void 0===e||null===(e=e.srfm)||void 0===e||e.toggleErrorState(l,Boolean(c))}else{var m;null===(m=window)||void 0===m||null===(m=m.srfm)||void 0===m||m.toggleErrorState(t,!1)}}))}}}))}var h=function(){var t=l(i().mark((function t(e,r){var n,o,a,s,u;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.closest(r),o=n.closest("form"),a=o.getAttribute("form-id"),s=o.getAttribute("ajaxurl"),u=o.getAttribute("data-submit-token"),t.next=8,m(a,s,u,n,!0);case 8:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),y=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})}},g=function(t,e,r,n){if(!(t||e||r||n))return!0;var o;"v2-checkbox"===t?o=grecaptcha.getResponse():e?o=hcaptcha.getResponse():r&&(o=turnstile.getResponse());var i=o.length>0;return n.style.display=i?"none":"block",i};function b(t){return b="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},b(t)}function w(){w=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(e,r,n,o){var i=r&&r.prototype instanceof m?r:m,a=Object.create(i.prototype);return u(a,"_invoke",function(e,r,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=k(s,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var l=c(e,r,n);if("normal"===l.type){if(o=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=4,n.method="throw",n.arg=l.arg)}}}(e,n,new A(o||[])),!0),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f={};function m(){}function d(){}function v(){}var p={};u(p,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(O([])));y&&y!==r&&n.call(y,i)&&(p=y);var g=v.prototype=m.prototype=Object.create(p);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function r(o,i,a,s){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==b(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;u(this,"_invoke",(function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}),!0)}function k(e,r){var n=r.method,o=e.i[n];if(o===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,k(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=c(o,e.i,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,f;var a=i.arg;return a?a.done?(r[e.r]=a.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,f):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function x(t){this.tryEntries.push(t)}function _(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function A(t){this.tryEntries=[[-1]],t.forEach(x,this),this.reset(!0)}function O(e){if(null!=e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(b(e)+" is not iterable")}return d.prototype=v,u(g,"constructor",v),u(v,"constructor",d),d.displayName=u(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},S(E.prototype),u(E.prototype,a,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new E(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},S(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=O,A.prototype={constructor:A,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(_),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){a.type="throw",a.arg=e,r.next=t}for(var o=r.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],s=this.prev,u=i[1],l=i[2];if(-1===i[0])return n("end"),!1;if(!u&&!l)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<u)return this.method="next",this.arg=t,n(u),!0;if(s<l)return n(l),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],f):this.complete(i)},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[2]===t)return this.complete(r[4],r[3]),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var o=n.arg;_(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:O(e),r,n},"next"===this.method&&(this.arg=t),f}},e}function S(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function E(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){S(i,n,o,a,s,"next",t)}function s(t){S(i,n,o,a,s,"throw",t)}a(void 0)}))}}function k(t){var e=t.querySelector(".srfm-block.srfm-payment-block:not(.hide-element)");if(!e)return{valid:!0,slug:"no-payment-block",message:""};var r,n,o,i=e.querySelector(".srfm-payment-input"),a=i.getAttribute("data-amount-type")||"fixed";if("fixed"===a){var s,u=parseFloat(i.getAttribute("data-fixed-amount"));if(!u||isNaN(u)||u<=0)return{valid:!1,slug:"invalid-fixed-amount",message:null===(s=window.srfmPaymentUtility)||void 0===s?void 0:s.getStripeStrings("payment_amount_not_configured","Payment is currently unavailable. Please contact the site administrator to configure the payment amount.")}}else if("variable"===a){var l,c=parseFloat(i.dataset.currentAmount||0);if(isNaN(c)||c<=0)return{valid:!1,slug:"invalid-variable-amount",message:null===(l=window.srfmPaymentUtility)||void 0===l?void 0:l.getStripeStrings("invalid_variable_amount","Invalid payment amount")};var f=parseFloat(i.getAttribute("data-minimum-amount")||0);if(f>0&&c<f){var m,d=(r=i.getAttribute("data-currency")||"usd",(null==(o=((null===(n=window.srfmStripe)||void 0===n?void 0:n.currenciesData)||{})[null==r?void 0:r.toUpperCase()])?void 0:o.symbol)||r.toUpperCase()+" ");return{valid:!1,slug:"amount-below-minimum",message:(null===(m=window.srfmPaymentUtility)||void 0===m?void 0:m.getStripeStrings("amount_below_minimum","Payment amount must be at least {symbol}{amount}.")).replace("{symbol}",d).replace("{amount}",f.toFixed(2))}}}var v,p=i.getAttribute("data-customer-name-field"),h="subscription"===(i.getAttribute("data-payment-type")||"one-time");if(h&&(!p||""===p.trim()))return{valid:!1,slug:"payment-name-not-mapped",message:null===(v=window.srfmPaymentUtility)||void 0===v?void 0:v.getStripeStrings("payment_name_not_mapped","Payment is currently unavailable. Please contact the site administrator to configure the customer name field.")};var y,g=i.getAttribute("data-customer-email-field");if(!g||""===g.trim())return{valid:!1,slug:"payment-email-not-mapped",message:null===(y=window.srfmPaymentUtility)||void 0===y?void 0:y.getStripeStrings("payment_email_not_mapped","Payment is currently unavailable. Please contact the site administrator to configure the customer email field.")};if(h&&p&&""!==p.trim()){var b,w=t.querySelector(".srfm-input-block.srfm-slug-".concat(p," .srfm-input-common")),S=w?w.value.trim():"";if(!w||""===S)return{valid:!1,slug:"payment-name-required",message:null===(b=window.srfmPaymentUtility)||void 0===b?void 0:b.getStripeStrings("payment_name_required","Please enter your name.")}}var E,k=t.querySelector(".srfm-email-block.srfm-slug-".concat(g," .srfm-input-common")),x=k?k.value.trim():"";return k&&""!==x?{valid:!0,slug:"payment-valid",message:""}:{valid:!1,slug:"payment-email-required",message:null===(E=window.srfmPaymentUtility)||void 0===E?void 0:E.getStripeStrings("payment_email_required","Please enter your email.")}}function x(t){return _.apply(this,arguments)}function _(){return(_=E(w().mark((function t(e){var r,n,o,i;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,!(r=k(e)).valid||"no-payment-block"!==r.slug){t.next=4;break}return t.abrupt("return",{valid:!0,message:""});case 4:if(r.valid){t.next=6;break}return t.abrupt("return",{valid:!1,message:r.message});case 6:return n=e.querySelector(".srfm-block.srfm-payment-block"),t.next=9,A(e,n);case 9:return o=t.sent,t.abrupt("return",o);case 13:return t.prev=13,t.t0=t.catch(0),t.abrupt("return",{valid:!1,message:null===(i=window.srfmPaymentUtility)||void 0===i?void 0:i.getStripeStrings("payment_failed","Payment failed"),paymentResultOnCreateIntent:null});case 16:case"end":return t.stop()}}),t,null,[[0,13]])})))).apply(this,arguments)}function A(t,e){return O.apply(this,arguments)}function O(){return(O=E(w().mark((function t(e,r){var n,o,i,a,s;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.prev=0,o=r.getAttribute("data-block-id"),i=window.srfmGetPaymentKey?window.srfmGetPaymentKey(e,o):o,a=null===(n=window.srfmPaymentManagers)||void 0===n?void 0:n[i]){t.next=8;break}return t.next=7,q(e,r,i);case 7:case 10:return t.abrupt("return",t.sent);case 8:return t.next=10,a.processPayment(e);case 13:return t.prev=13,t.t0=t.catch(0),t.abrupt("return",{valid:!1,message:null===(s=window.srfmPaymentUtility)||void 0===s?void 0:s.getStripeStrings("payment_failed","Payment failed")});case 16:case"end":return t.stop()}}),t,null,[[0,13]])})))).apply(this,arguments)}function q(t,e,r){return P.apply(this,arguments)}function P(){return(P=E(w().mark((function t(e,r,n){var o,i,a,s,u;return w().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,window.StripePayment.createPaymentIntentsForForm(e,r);case 2:if(null!=(i=t.sent)&&i.valid){t.next=5;break}return t.abrupt("return",{valid:!1,message:i.message});case 5:if(!(a=null===(o=window.srfmPaymentElements)||void 0===o?void 0:o[n])||!a.clientSecret){t.next=13;break}return t.next=9,window.StripePayment.srfmConfirmPayment(n,a,e).catch((function(){return null}));case 9:if(null!=(u=t.sent)&&u.valid){t.next=12;break}return t.abrupt("return",{valid:!1,message:(null==u?void 0:u.message)||"",paymentResult:null});case 12:return t.abrupt("return",{valid:!0,message:null===(s=window.srfmPaymentUtility)||void 0===s?void 0:s.getStripeStrings("payment_successful","Payment successful"),paymentResult:u});case 13:return t.abrupt("return",{valid:!1,message:"Payment data not found"});case 14:case"end":return t.stop()}}),t)})))).apply(this,arguments)}"undefined"!=typeof window&&(window.srfmValidation||(window.srfmValidation={}),window.srfmValidation.fieldValidation=m,window.srfmValidation.handleScrollAndFocusOnError=y);const j=window.wp.i18n;function L(t){return L="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},L(t)}function C(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 T(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?C(Object(r),!0).forEach((function(e){F(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):C(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function F(t,e,r){return(e=function(t){var e=function(t){if("object"!=L(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=L(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==L(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=N(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,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function N(t,e){if(t){if("string"==typeof t)return U(t,e);var r={}.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)?U(t,e):void 0}}function U(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function G(){G=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function u(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function l(e,r,n,o){var i=r&&r.prototype instanceof m?r:m,a=Object.create(i.prototype);return u(a,"_invoke",function(e,r,n){var o=1;return function(i,a){if(3===o)throw Error("Generator is already running");if(4===o){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=S(s,n);if(u){if(u===f)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(1===o)throw o=4,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=3;var l=c(e,r,n);if("normal"===l.type){if(o=n.done?4:2,l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=4,n.method="throw",n.arg=l.arg)}}}(e,n,new x(o||[])),!0),a}function c(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var f={};function m(){}function d(){}function v(){}var p={};u(p,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(_([])));y&&y!==r&&n.call(y,i)&&(p=y);var g=v.prototype=m.prototype=Object.create(p);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(o,i,a,s){var u=c(t[o],t,i);if("throw"!==u.type){var l=u.arg,f=l.value;return f&&"object"==L(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var o;u(this,"_invoke",(function(t,n){function i(){return new e((function(e,o){r(t,n,e,o)}))}return o=o?o.then(i,i):i()}),!0)}function S(e,r){var n=r.method,o=e.i[n];if(o===t)return r.delegate=null,"throw"===n&&e.i.return&&(r.method="return",r.arg=t,S(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=c(o,e.i,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,f;var a=i.arg;return a?a.done?(r[e.r]=a.value,r.next=e.n,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,f):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,f)}function E(t){this.tryEntries.push(t)}function k(e){var r=e[4]||{};r.type="normal",r.arg=t,e[4]=r}function x(t){this.tryEntries=[[-1]],t.forEach(E,this),this.reset(!0)}function _(e){if(null!=e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(L(e)+" is not iterable")}return d.prototype=v,u(g,"constructor",v),u(v,"constructor",d),d.displayName=u(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},b(w.prototype),u(w.prototype,a,(function(){return this})),e.AsyncIterator=w,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new w(l(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),u(g,s,"Generator"),u(g,i,(function(){return this})),u(g,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.unshift(n);return function t(){for(;r.length;)if((n=r.pop())in e)return t.value=n,t.done=!1,t;return t.done=!0,t}},e.values=_,x.prototype={constructor:x,reset:function(e){if(this.prev=this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(k),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0][4];if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(t){a.type="throw",a.arg=e,r.next=t}for(var o=r.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i[4],s=this.prev,u=i[1],l=i[2];if(-1===i[0])return n("end"),!1;if(!u&&!l)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<u)return this.method="next",this.arg=t,n(u),!0;if(s<l)return n(l),!1}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n[0]>-1&&n[0]<=this.prev&&this.prev<n[2]){var o=n;break}}o&&("break"===t||"continue"===t)&&o[0]<=e&&e<=o[2]&&(o=null);var i=o?o[4]:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o[2],f):this.complete(i)},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[2]===t)return this.complete(r[4],r[3]),k(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r[0]===t){var n=r[4];if("throw"===n.type){var o=n.arg;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={i:_(e),r,n},"next"===this.method&&(this.arg=t),f}},e}function D(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function R(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){D(i,n,o,a,s,"next",t)}function s(t){D(i,n,o,a,s,"throw",t)}a(void 0)}))}}var M=null;document.addEventListener("srfm_initialize_validation",(function(t){var e,r=null==t||null===(e=t.detail)||void 0===e?void 0:e.fields;r&&Array.isArray(r)?p(r.filter((function(t){return v().includes(t)}))):p()}));var V=0;function B(){p();for(var e=Array.from(document.querySelectorAll(".srfm-form")),r=function(){var e=o[n];e.hasAttribute("data-srfm-instance")||e.setAttribute("data-srfm-instance",String(++V)),document.dispatchEvent(new CustomEvent("srfm_form_before_submission",{detail:{form:e}}));var r=et(e),i=r.formId,a=r.submitType,s=r.successUrl,u=r.ajaxUrl,l=r.submitToken,c=r.loader,f=r.successContainer,m=r.successElement,d=r.recaptchaType,v=r.afterSubmission,p=r.captchaErrorElement,h=r.hCaptchaDiv,y=r.turnstileDiv,g=r.hasLoginBlock,b="v2-checkbox"===d||!!h||!!y;"v3-reCAPTCHA"!==d||e.hasAttribute("data-srfm-v3-click-handler")||(e.setAttribute("data-srfm-v3-click-handler","true"),e.addEventListener("click",(function(t){var r=t.target.closest("#srfm-submit-btn, .srfm-custom-button");r&&r.classList.contains("g-recaptcha")&&(M=e)}),!0)),e.addEventListener("submit",function(){var r=R(G().mark((function r(n){var o,w,S,E,k;return G().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.preventDefault(),"FORM"!==(null==(o=n.target)?void 0:o.tagName)){r.next=9;break}if(w=null==o?void 0:o.closest(".srfm-form-container"),S=null==w?void 0:w.classList.contains("srfm-submit-button-hidden"),E=null==o?void 0:o.querySelector("button.srfm-custom-button"),!S||E){r.next=9;break}return console.warn("Form submission is disabled because the submit button is hidden."),r.abrupt("return");case 9:if(!g||e.__loginSuccess){r.next=13;break}return k=new CustomEvent("srfm_login_request",{cancelable:!0,detail:{form:e}}),e.dispatchEvent(k),r.abrupt("return");case 13:if((0,t.applyFilters)("srfm.handleCustomFormSubmission",!0,{form:e})){r.next=16;break}return r.abrupt("return");case 16:Q(e,i,u,l,c,s,f,m,a,v,b?d:void 0,b?h:void 0,b?y:void 0,b?p:void 0),e.__loginSuccess=!0;case 18:case"end":return r.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}()),document.dispatchEvent(new CustomEvent("srfm_form_after_initialization",{detail:{form:e}}))},n=0,o=e;n<o.length;n++)r()}function H(t){var e=t.querySelectorAll(".srfm-address-block");if(!e)return null;var r={};return e.forEach((function(t){var e=t.getAttribute("data-slug");if(e){var n=t.querySelectorAll(".srfm-input-input, .srfm-dropdown-input"),o=Array.from(n).map((function(t){var e;return null==t||null===(e=t.value)||void 0===e?void 0:e.trim()})).filter(Boolean).join(", ");r[e]=o}})),Object.keys(r).length>0?r:null}function z(t){return K.apply(this,arguments)}function K(){return(K=R(G().mark((function e(r){var n,o,i,a,s,u,l,c,f,m,d,v,p;return G().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new FormData(r),o=new FormData,i=r.getAttribute("data-submit-token"),a=["srfm-email-confirm","srfm-password-confirm"],s=I(n.entries()),e.prev=5,s.s();case 7:if((u=s.n()).done){e.next=18;break}if(h=u.value,y=2,l=function(t){if(Array.isArray(t))return t}(h)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(h,y)||N(h,y)||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.")}(),c=l[0],f=l[1],!a.includes(c)){e.next=11;break}return e.abrupt("continue",16);case 11:if(""!==f&&(m=r.querySelector('[name="'.concat(c,'"]')),null!=(d=null==m?void 0:m.closest(".srfm-block-single"))&&d.classList.contains("hide-element")&&(f=""),f=(0,t.applyFilters)("srfm.filterFieldValue",f,{key:c,form:r})),!(0,t.applyFilters)("srfm.shouldSkipField",!1,{key:c,value:f,form:r})){e.next=15;break}return e.abrupt("continue",16);case 15:o.append(c,f);case 16:e.next=7;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(5),s.e(e.t0);case 23:return e.prev=23,s.f(),e.finish(23);case 26:return(v=H(r))&&o.append("srfm_addresses",JSON.stringify(v)),p=(0,t.applyFilters)("srfm.prepareAdditionalFormData",{},r),Object.keys(p).forEach((function(t){null!==p[t]&&void 0!==p[t]&&o.append(t,JSON.stringify(p[t]))})),e.prev=30,e.next=33,wp.apiFetch({path:"sureforms/v1/submit-form",method:"POST",body:o,headers:{"X-WP-Submit-Token":i}});case 33:return e.abrupt("return",e.sent);case 36:e.prev=36,e.t1=e.catch(30),console.error(e.t1);case 39:case"end":return e.stop()}var h,y}),e,null,[[5,20,23,26],[30,36]])})))).apply(this,arguments)}function Y(t){return $.apply(this,arguments)}function $(){return($=R(G().mark((function t(e){var r,n;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.data.submission_id,n=e.data.after_submit_nonce,t.prev=2,t.next=5,wp.apiFetch({path:"/sureforms/v1/after-submission/".concat(r,"?after_submit_nonce=").concat(encodeURIComponent(n)),method:"GET"});case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),console.error(t.t0);case 10:case"end":return t.stop()}}),t,null,[[2,7]])})))).apply(this,arguments)}function W(e,r,n,o,i,a,s){var u,l=new CustomEvent("srfm_on_show_success_message",{cancelable:!0,detail:{form:o,element:r,message:n,submitType:a,container:e,loader:s}});document.dispatchEvent(l)&&(X(o),"hide form"===i?(o.style.opacity=1,o.style.display="none",setTimeout((function(){r.style.opacity=1}),500)):"reset form"===i&&o.reset(),r.innerHTML=n,e.classList.add("srfm-active"),null===(u=window)||void 0===u||null===(u=u.srfm)||void 0===u||u.handleInstantFormWrapperHeight(),(0,t.applyFilters)("srfm.enableScrollOnSuccess",!0)&&o.parentElement.scrollIntoView({behavior:"smooth"}))}function J(t){var e=t.form,r=t.message,n=void 0===r?"":r,o=t.position,i=void 0===o?"footer":o,a=t.log_message,s=new CustomEvent("srfm_show_common_form_error",{detail:{form:e,message:n,position:i,log_message:void 0===a?null:a}});document.dispatchEvent(s)}function Z(t){t.querySelectorAll(".srfm-common-error-message").forEach((function(t){t.setAttribute("hidden","")}))}function X(t){var e=t.querySelector('#srfm-submit-btn, button[type="submit"], .srfm-custom-button');e&&(e.disabled=!1,e.style.pointerEvents="");var r=new CustomEvent("srfm_form_submission_stop",{cancelable:!0,detail:{form:t}});document.dispatchEvent(r)}function Q(t,e,r,n,o,i,a,s,u,l,c,f,m,d){return tt.apply(this,arguments)}function tt(){return(tt=R(G().mark((function t(e,r,n,o,i,a,s,u,l,c,f,d,v,p){var h,b,w,S,E,k,_,A,O,q,P,j,L,C,F,I;return G().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i.classList.add("srfm-active"),h=new CustomEvent("srfm_form_submission_start",{cancelable:!0,detail:{form:e,loader:i,formId:r,submitType:l,successElement:u,successContainer:s}}),document.dispatchEvent(h),(b=e.querySelector('#srfm-submit-btn, button[type="submit"], .srfm-custom-button'))&&(b.disabled=!0,b.style.pointerEvents="none"),Z(e),t.next=9,m(r,n,o,e);case 9:if(w=t.sent,S=g(f,d,v,p),(null==w||!w.validateResult)&&S){t.next=16;break}return i.classList.remove("srfm-active"),X(e),null!=w&&w.validateResult?y(w):S||y({firstErrorInput:p,scrollElement:p}),t.abrupt("return");case 16:if(E=new CustomEvent("srfm_on_trigger_form_submission",{cancelable:!0,detail:{form:e,loader:i,formId:r,submitType:l,successElement:u,successContainer:s}}),document.dispatchEvent(E)){t.next=21;break}return i.classList.remove("srfm-active"),X(e),t.abrupt("return");case 21:return t.next=23,x(e);case 23:if(null!=(k=t.sent)&&k.valid){t.next=29;break}return J({form:e,message:null==k?void 0:k.message}),i.classList.remove("srfm-active"),X(e),t.abrupt("return");case 29:return t.next=31,z(e);case 31:null!=(_=t.sent)&&_.success?(rt(T(T({},_),{},{formId:r})),P=l,l=(null==_||null===(A=_.data)||void 0===A||null===(A=A.submission_settings)||void 0===A?void 0:A.submission_mode)||P,j=c,c=(null==_||null===(O=_.data)||void 0===O||null===(O=O.submission_settings)||void 0===O?void 0:O.after_submission)||j,"same page"===l?(W(s,u,null!==(L=null==_?void 0:_.message)&&void 0!==L?L:"",e,c,l),i.classList.remove("srfm-active"),X(e)):["different page","custom url"].includes(l)?(null!=_&&_.redirect_url&&(a=null==_?void 0:_.redirect_url,window.location.assign(a)),i.classList.remove("srfm-active"),X(e)):W(s,u,null!==(C=null==_?void 0:_.message)&&void 0!==C?C:"",e,c,l,i),null!=_&&null!==(q=_.data)&&void 0!==q&&q.after_submit&&Y(_)):(F=(null==_?void 0:_.data)||{},J(T({form:e},F)),i.classList.remove("srfm-active"),X(e)),t.next=42;break;case 35:t.prev=35,t.t0=t.catch(0),I=new CustomEvent("srfm_on_trigger_form_submission_failure",{detail:{form:e,error:t.t0,loader:i,formId:r,submitType:l,successElement:u,successContainer:s}}),document.dispatchEvent(I),i.classList.remove("srfm-active"),X(e),J({form:e});case 42:case"end":return t.stop()}var a}),t,null,[[0,35]])})))).apply(this,arguments)}function et(t){var e=t.getAttribute("form-id"),r=t.getAttribute("message-type"),n=t.getAttribute("success-url"),o=t.getAttribute("ajaxurl"),i=t.getAttribute("data-submit-token"),a=t.querySelector(".srfm-loader"),s=t.parentElement.querySelector(".srfm-single-form.srfm-success-box"),u=null==s?void 0:s.querySelector(".srfm-success-box-description"),l=t.querySelector("#srfm-submit-btn"),c=t.getAttribute("after-submission"),f=t.querySelector(".g-recaptcha");return{formId:e,submitType:r,successUrl:n,ajaxUrl:o,submitToken:i,loader:a,successContainer:s,successElement:u,submitBtn:l,siteKey:null==f?void 0:f.getAttribute("data-sitekey"),recaptchaType:null==f?void 0:f.getAttribute("recaptcha-type"),afterSubmission:c,captchaErrorElement:t.querySelector("#captcha-error"),hCaptchaDiv:t.querySelector(".h-captcha"),turnstileDiv:t.querySelector(".cf-turnstile"),hasLoginBlock:t.querySelector(".srfm-login-block")}}function rt(t){var e=new CustomEvent("srfm_form_submission_success",{detail:{formId:"srfm-form-".concat(t.formId)}});document.dispatchEvent(e)}document.addEventListener("DOMContentLoaded",(function(){B()})),document.addEventListener("srfm_show_common_form_error",(function(t){var e=t.detail||{},r=e.form,n=e.message,o=void 0===n?"":n,i=e.position,a=void 0===i?"footer":i,s=e.log_message,u=void 0===s?null:s;if(r){u&&console.warn(u);var l=o||(0,j.__)("An error occurred while submitting your form. Please try again.","sureforms"),c="header"===a?"srfm-head-error":"srfm-footer-error",f=r.querySelector(".srfm-common-error-message.".concat(c));f&&(f.querySelector(".srfm-error-content").innerHTML=l,f.removeAttribute("hidden"),y({firstErrorInput:f,scrollElement:f}))}})),window.recaptchaCallback=function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&M){var t=M;M=null;var e=et(t),r=e.formId,n=e.submitType,o=e.ajaxUrl,i=e.submitToken,a=e.loader,s=e.successUrl,u=e.successContainer,l=e.successElement,c=e.recaptchaType,f=e.afterSubmission;if("v3-reCAPTCHA"===c)return a.classList.add("srfm-active"),void Q(t,r,o,i,a,s,u,l,n,f)}Array.from(document.querySelectorAll(".srfm-form")).forEach((function(t){var e=et(t),r=e.formId,n=e.submitType,o=e.successUrl,i=e.ajaxUrl,a=e.submitToken,s=e.loader,u=e.successContainer,l=e.successElement,c=e.submitBtn,f=e.siteKey,m=e.recaptchaType,d=e.afterSubmission,v=!1;"v2-invisible"===m&&(grecaptcha.render(c,{sitekey:f,callback:function(){Q(t,r,i,a,s,o,u,l,n,d),v=!0},"error-callback":function(){var t,e,r,n,o,i;e={containerSelector:'.g-recaptcha[recaptcha-type="v2-invisible"]:not(.captcha-error-added)',message:null===(t=srfm_submit)||void 0===t||null===(t=t.messages)||void 0===t?void 0:t.srfm_google_captcha_error_message},r=e.containerSelector,o=void 0===(n=e.message)?"":n,(i=document.querySelectorAll(r))&&i.forEach((function(t){var e=t.closest(".srfm-form");e&&(J({form:e,message:o}),t.classList.add("captcha-error-added"))}))}}),c.addEventListener("click",(function(){s.classList.add("srfm-active"),v&&Q(t,r,i,a,s,o,u,l,n,d)})))}))},window.showErrorMessage=J,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=R(G().mark((function t(e){return G().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)}}())},window.addEventListener("elementor/popup/show",(function(t){var e;(null==t||null===(e=t.detail)||void 0===e||null===(e=e.instance)||void 0===e||null===(e=e.$element)||void 0===e||null===(e=e[0])||void 0===e?void 0:e.querySelector(".srfm-form-container"))&&B()})),document.addEventListener("srfm_form_initialize",(function(){B()}))})();
Save
Back