PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | assets/build/formSubmit.js +1 -1 2.10.0 → 2.12.8 View file →
@@ -1,2 +1,2 @@
1 1 /*! For license information please see formSubmit.js.LICENSE.txt */
2 -(()=>{"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,Pt,jt,Lt,Ct,Tt,Ft,It,Nt;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&&(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-textarea-block")&&!a.classList.contains("srfm-richtext")&&(ot=a.querySelector("textarea"))&&(it=ot.getAttribute("data-minlength"),at=ot.getAttribute("maxlength"),st=Number(it),ut=Number(at),it&&st>0&&(!at||ut<=0||st<=ut)&&""!==l&&l.length<st&&(null===(lt=window)||void 0===lt||null===(lt=lt.srfm)||void 0===lt||lt.toggleErrorState(ot.closest(".srfm-block"),!0),v&&(v.textContent=null===(ct=window)||void 0===ct||null===(ct=ct.srfm)||void 0===ct?void 0:ct.srfmSprintfString(null===(ft=window)||void 0===ft||null===(ft=ft.srfm_submit)||void 0===ft||null===(ft=ft.messages)||void 0===ft?void 0:ft.srfm_textarea_min_chars,it)),f=!0,p(ot,a))),a.classList.contains("srfm-rating-block")&&("true"!==(mt=a.querySelector(".srfm-input-rating")).getAttribute("data-required")||mt.value?null===(vt=window)||void 0===vt||null===(vt=vt.srfm)||void 0===vt||vt.toggleErrorState(mt.closest(".srfm-block"),!1):(null===(dt=window)||void 0===dt||null===(dt=dt.srfm)||void 0===dt||dt.toggleErrorState(mt.closest(".srfm-block"),!0),f=!0,p(a.querySelector(".srfm-icon"),a))),a.classList.contains("srfm-slider-block")&&(pt=a.getAttribute("data-required"),ht=a.querySelector(".srfm-input-slider"),yt=a.querySelector(".srfm-text-slider"),gt=a.getAttribute("data-default"),"true"===pt&&(bt=!1,(!ht||ht.dataset.interacted||gt&&"false"!==gt)&&(!yt||yt.dataset.interacted||gt&&"false"!==gt)||(bt=!0),bt?(null===(wt=window)||void 0===wt||null===(wt=wt.srfm)||void 0===wt||wt.toggleErrorState(a,!0),f=!0,p(ht,a)):null===(St=window)||void 0===St||null===(St=St.srfm)||void 0===St||St.toggleErrorState(a,!1))),a.classList.contains("srfm-dropdown-block")&&(Et=a.querySelectorAll(".srfm-input-dropdown-hidden"),kt=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,Et.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 kt((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(xt=a.querySelectorAll("input"),_t=xt[0].getAttribute("data-min-selection"),At=xt[0].getAttribute("data-max-selection"),Ot=null,qt=0,Pt=!1,jt=0;jt<xt.length;jt++)Ot||"hidden"===xt[jt].type||(Ot=xt[jt]),xt[jt].checked&&qt++;(_t||At)&&qt>0&&(!Pt&&_t>0&&(c&&_t>1||!c)&&qt<_t&&(v.textContent=null===(Lt=window)||void 0===Lt||null===(Lt=Lt.srfm)||void 0===Lt?void 0:Lt.srfmSprintfString(null===(Ct=window)||void 0===Ct||null===(Ct=Ct.srfm_submit)||void 0===Ct||null===(Ct=Ct.messages)||void 0===Ct?void 0:Ct.srfm_multi_choice_min_selections,_t),Pt=!0),!Pt&&At>0&&qt>At&&(v.textContent=null===(Tt=window)||void 0===Tt||null===(Tt=Tt.srfm)||void 0===Tt?void 0:Tt.srfmSprintfString(null===(Ft=window)||void 0===Ft||null===(Ft=Ft.srfm_submit)||void 0===Ft||null===(Ft=Ft.messages)||void 0===Ft?void 0:Ft.srfm_multi_choice_max_selections,At),Pt=!0),Pt?(null===(It=window)||void 0===It||null===(It=It.srfm)||void 0===It||It.toggleErrorState(a,!0),p(Ot,a),f=!0):c||null===(Nt=window)||void 0===Nt||null===(Nt=Nt.srfm)||void 0===Nt||Nt.toggleErrorState(a,!1))}f=(0,t.applyFilters)("srfm.modifyFieldValidationResult",f,a,p);case 52: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(e.dataset.srfmPaymentInFlight="true",t.prev=1,!(r=k(e)).valid||"no-payment-block"!==r.slug){t.next=5;break}return t.abrupt("return",{valid:!0,message:""});case 5:if(r.valid){t.next=7;break}return t.abrupt("return",{valid:!1,message:r.message});case 7:return n=e.querySelector(".srfm-block.srfm-payment-block"),t.next=10,A(e,n);case 10:return o=t.sent,t.abrupt("return",o);case 14:return t.prev=14,t.t0=t.catch(1),t.abrupt("return",{valid:!1,message:null===(i=window.srfmPaymentUtility)||void 0===i?void 0:i.getStripeStrings("payment_failed","Payment failed"),paymentResultOnCreateIntent:null});case 17:return t.prev=17,delete e.dataset.srfmPaymentInFlight,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[1,14,17,20]])})))).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()}))})();
2 +(()=>{"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",l=a.asyncIterator||"@@asyncIterator",u=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 l=k(s,n);if(l){if(l===m)continue;return l}}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 u=d(e,r,n);if("normal"===u.type){if(o=n.done?4:2,u.arg===m)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=4,n.method="throw",n.arg=u.arg)}}}(e,n,new A(o||[])),!0),a}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=f;var m={};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 _(t,r){function n(i,a,s,l){var u=d(t[i],t,a);if("throw"!==u.type){var c=u.arg,f=c.value;return f&&"object"==e(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,s,l)}),(function(t){n("throw",t,s,l)})):r.resolve(f).then((function(t){c.value=t,s(c)}),(function(t){return n("throw",t,s,l)}))}l(u.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")),m;var i=d(o,e.i,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,m;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,m):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,m)}function x(t){this.tryEntries.push(t)}function E(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,u,"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,u,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},S(_.prototype),c(_.prototype,l,(function(){return this})),r.AsyncIterator=_,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new _(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,u,"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),!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,l=i[1],u=i[2];if(-1===i[0])return n("end"),!1;if(!l&&!u)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<l)return this.method="next",this.arg=t,n(l),!0;if(s<u)return n(u),!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],m):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),m},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]),E(r),m}},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;E(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),m}},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,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 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 l(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}function u(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 c(){var t,e,r,n=null===(t=window)||void 0===t||null===(t=t.srfm_submit)||void 0===t?void 0:t.email_char_limits;return{local:null!==(e=null==n?void 0:n.local)&&void 0!==e?e:64,domain:null!==(r=null==n?void 0:n.domain)&&void 0!==r?r:255}}function f(t,e,r,n){return d.apply(this,arguments)}function d(){return(d=u(i().mark((function t(e,r,n,o){var a,s,l;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 l=t.sent,t.abrupt("return",l.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 v.apply(this,arguments)}function v(){return v=u(i().mark((function e(r,o,s,l){var u,d,m,v,p,h,y,g,b,w,S,_,k,x,E,A,O,P,j=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=j.length>4&&void 0!==j[4]&&j[4],d=!1,m=null,v=null,p={},h=function(t,e){m||(m=t,v=e,p=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})},y=null,0===(g=l.querySelectorAll('input[data-unique="true"]')).length){e.next=15;break}b={},w=a(g);try{for(w.s();!(S=w.n()).done;)_=S.value,k=_.name,x=_.value,b[k]=x}catch(t){w.e(t)}finally{w.f()}return e.next=14,f(b,r,o,s);case 14:y=e.sent;case 15:E=u?[l]:Array.from(l.querySelectorAll(".srfm-block-single")),A=a(E),e.prev=17,P=i().mark((function e(){var n,o,a,s,l,u,f,m,v,p,g,b,w,S,_,k,x,E,A,P,j,q,L,C,T,I,F,N,U,G,D,R,M,V,B,H,z,J,K,W,Y,$,X,Z,Q,tt,et,rt,nt,ot,it,at,st,lt,ut,ct,ft,dt,mt,vt,pt,ht,yt,gt,bt,wt,St,_t,kt,xt,Et,At,Ot,Pt,jt,qt,Lt,Ct,Tt,It,Ft,Nt,Ut,Gt,Dt,Rt,Mt,Vt;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=O.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 l=a.querySelector(".srfm-input-phone"),u=null===(o=l)||void 0===o||null===(o=o.nextElementSibling)||void 0===o?void 0:o.value,e.abrupt("break",18);case 15:return l=a.querySelector("input, textarea, select"),u=l.value,e.abrupt("break",18);case 18:if(f=l.getAttribute("data-required"),m=l.getAttribute("data-unique"),v=l.getAttribute("name"),p=a.querySelector(".srfm-error-message"),v&&(v=v.replace(/_/g," ")),f&&"hidden"!==l.type&&("true"!==f||u?l&&(null===(b=window)||void 0===b||null===(b=b.srfm)||void 0===b||b.toggleErrorState(l.closest(".srfm-block"),!1)):(l&&(null===(g=window)||void 0===g||null===(g=g.srfm)||void 0===g||g.toggleErrorState(l.closest(".srfm-block"),!0)),p&&(p.textContent=p.getAttribute("data-error-msg")),d=!0,h(l,l.closest(".srfm-block"))),l.addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(l.closest(".srfm-block"),!1)}))),"true"===m&&""!==u&&((null===(w=y)||void 0===w?void 0:w.some((function(t){return"not unique"===t[v]})))?(l&&(null===(S=window)||void 0===S||null===(S=S.srfm)||void 0===S||S.toggleErrorState(l.closest(".srfm-block"),!0)),p.style.display="block",p.textContent=p.getAttribute("data-unique-msg"),d=!0,h(l,l.closest(".srfm-block"))):l&&(null===(_=window)||void 0===_||null===(_=_.srfm)||void 0===_||_.toggleErrorState(l.closest(".srfm-block"),!1),p.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}k=a.querySelectorAll("input"),x=k[0].getAttribute("data-required"),E=!1,A=null,P=0;case 31:if(!(P<k.length)){e.next=39;break}if(A||"hidden"===k[P].type||(A=k[P]),!k[P].checked){e.next=36;break}return E=!0,e.abrupt("break",39);case 36:P++,e.next=31;break;case 39:"true"!==x||E?p&&(null===(q=window)||void 0===q||null===(q=q.srfm)||void 0===q||q.toggleErrorState(a,!1)):(p&&(p.textContent=a.querySelector(".srfm-error-message").getAttribute("data-error-msg"),null===(j=window)||void 0===j||null===(j=j.srfm)||void 0===j||j.toggleErrorState(a,!0)),d=!0,h(A,a)),k.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")&&(L=a.querySelector("input"),a.classList.contains("srfm-url-error")&&(null===(C=window)||void 0===C||null===(C=C.srfm)||void 0===C||C.toggleErrorState(a,!0),d=!0,h(L,a)),L.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")&&(T=a.querySelectorAll("input")[1],a.classList.contains("srfm-phone-error")&&(null===(I=window)||void 0===I||null===(I=I.srfm)||void 0===I||I.toggleErrorState(a,!0),d=!0,h(T,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)&&(N=F.querySelector(".srfm-email-confirm-block"),F.classList.contains("srfm-valid-email-error")&&(h(l,F),d=!0),U=function(t){if("string"!=typeof t||!t.includes("@"))return"";var e,r,n,o,i=c(),a=i.local,s=i.domain,l=t.lastIndexOf("@");return a>0&&t.slice(0,l).length>a?null===(e=window)||void 0===e||null===(e=e.srfm)||void 0===e?void 0:e.srfmSprintfString(null===(r=window)||void 0===r||null===(r=r.srfm_submit)||void 0===r||null===(r=r.messages)||void 0===r?void 0:r.srfm_email_local_max_length,a):s>0&&t.slice(l+1).length>s?null===(n=window)||void 0===n||null===(n=n.srfm)||void 0===n?void 0:n.srfmSprintfString(null===(o=window)||void 0===o||null===(o=o.srfm_submit)||void 0===o||null===(o=o.messages)||void 0===o?void 0:o.srfm_email_domain_max_length,s):""},(G=u?U(u):"")&&(p&&(p.textContent=G,p.style.display="block"),null===(D=window)||void 0===D||null===(D=D.srfm)||void 0===D||D.toggleErrorState(F,!0),h(l,F),d=!0),N&&(R=N.querySelector(".srfm-input-email-confirm"),M=N.querySelector(".srfm-input-email-confirm").value,V=N.querySelector(".srfm-error-message"),!M&&V&&"true"===f?(V.textContent=V.getAttribute("data-error-msg"),null===(B=window)||void 0===B||null===(B=B.srfm)||void 0===B||B.toggleErrorState(N,!0),h(R,N),d=!0):M!==u?(null===(H=window)||void 0===H||null===(H=H.srfm)||void 0===H||H.toggleErrorState(N,!0),V&&(V.textContent=null===(z=window)||void 0===z||null===(z=z.srfm_submit)||void 0===z||null===(z=z.messages)||void 0===z?void 0:z.srfm_confirm_email_same),h(R,N),d=!0):null===(J=window)||void 0===J||null===(J=J.srfm)||void 0===J||J.toggleErrorState(N,!1),(K=M?U(M):"")&&(V&&(V.textContent=K,V.style.display="block"),null===(W=window)||void 0===W||null===(W=W.srfm)||void 0===W||W.toggleErrorState(N,!0),h(R,N),d=!0),R.addEventListener("input",(function(){var t;null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(N,!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")&&(Y=a.querySelector(".srfm-input-upload"),"true"!==($=Y.getAttribute("data-required"))||Y.value?l&&(null===(Z=window)||void 0===Z||null===(Z=Z.srfm)||void 0===Z||Z.toggleErrorState(l.closest(".srfm-block"),!1)):("true"===$&&p&&(p.textContent=p.getAttribute("data-error-msg")),l&&(null===(X=window)||void 0===X||null===(X=X.srfm)||void 0===X||X.toggleErrorState(l.closest(".srfm-block"),!0)),d=!0,h(Y,a)),Y.addEventListener("input",(function(){var t;l&&(null===(t=window)||void 0===t||null===(t=t.srfm)||void 0===t||t.toggleErrorState(l.closest(".srfm-block"),!1))}))),a.classList.contains("srfm-number-block")&&(Q=l.getAttribute("min"),tt=l.getAttribute("max"),et=l.getAttribute("format-type"),u&&(rt="eu-style"===et?parseFloat(u.replace(/\./g,"").replace(",",".")):parseFloat(u.replace(/,/g,"")),(Q||tt)&&(ot=!1,it="",Q&&""!==Q&&Number(rt)<Number(Q)?(ot=!0,it=null===(at=window)||void 0===at||null===(at=at.srfm)||void 0===at?void 0:at.srfmSprintfString(null===(st=window)||void 0===st||null===(st=st.srfm_submit)||void 0===st||null===(st=st.messages)||void 0===st?void 0:st.srfm_input_min_value,Q)):tt&&""!==tt&&Number(rt)>Number(tt)&&(ot=!0,it=null===(lt=window)||void 0===lt||null===(lt=lt.srfm)||void 0===lt?void 0:lt.srfmSprintfString(null===(ut=window)||void 0===ut||null===(ut=ut.srfm_submit)||void 0===ut||null===(ut=ut.messages)||void 0===ut?void 0:ut.srfm_input_max_value,tt)),null===(nt=window)||void 0===nt||null===(nt=nt.srfm)||void 0===nt||nt.toggleErrorState(l.closest(".srfm-block"),ot),p&&(p.textContent=ot?it:"",ot&&(d=!0,h(l,a)))))),a.classList.contains("srfm-textarea-block")&&!a.classList.contains("srfm-richtext")&&(ct=a.querySelector("textarea"))&&(ft=ct.getAttribute("data-minlength"),dt=ct.getAttribute("maxlength"),mt=Number(ft),vt=Number(dt),ft&&mt>0&&(!dt||vt<=0||mt<=vt)&&""!==u&&u.length<mt&&(null===(pt=window)||void 0===pt||null===(pt=pt.srfm)||void 0===pt||pt.toggleErrorState(ct.closest(".srfm-block"),!0),p&&(p.textContent=null===(ht=window)||void 0===ht||null===(ht=ht.srfm)||void 0===ht?void 0:ht.srfmSprintfString(null===(yt=window)||void 0===yt||null===(yt=yt.srfm_submit)||void 0===yt||null===(yt=yt.messages)||void 0===yt?void 0:yt.srfm_textarea_min_chars,ft)),d=!0,h(ct,a))),a.classList.contains("srfm-rating-block")&&("true"!==(gt=a.querySelector(".srfm-input-rating")).getAttribute("data-required")||gt.value?null===(wt=window)||void 0===wt||null===(wt=wt.srfm)||void 0===wt||wt.toggleErrorState(gt.closest(".srfm-block"),!1):(null===(bt=window)||void 0===bt||null===(bt=bt.srfm)||void 0===bt||bt.toggleErrorState(gt.closest(".srfm-block"),!0),d=!0,h(a.querySelector(".srfm-icon"),a))),a.classList.contains("srfm-slider-block")&&(St=a.getAttribute("data-required"),_t=a.querySelector(".srfm-input-slider"),kt=a.querySelector(".srfm-text-slider"),xt=a.getAttribute("data-default"),"true"===St&&(Et=!1,(!_t||_t.dataset.interacted||xt&&"false"!==xt)&&(!kt||kt.dataset.interacted||xt&&"false"!==xt)||(Et=!0),Et?(null===(At=window)||void 0===At||null===(At=At.srfm)||void 0===At||At.toggleErrorState(a,!0),d=!0,h(_t,a)):null===(Ot=window)||void 0===Ot||null===(Ot=Ot.srfm)||void 0===Ot||Ot.toggleErrorState(a,!1))),a.classList.contains("srfm-dropdown-block")&&(Pt=a.querySelectorAll(".srfm-input-dropdown-hidden"),jt=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,Pt.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,l,u=window.srfm.srfmUtility.extractValue(t.value);if(o&&u.length<o)p.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===(l=window)||void 0===l||null===(l=l.srfm)||void 0===l||l.toggleErrorState(t.closest(".srfm-block"),!0),d=!0;else if(i&&u.length>i){var c,f,m;p.textContent=null===(c=window)||void 0===c||null===(c=c.srfm)||void 0===c?void 0:c.srfmSprintfString(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_dropdown_max_selections,i),null===(m=window)||void 0===m||null===(m=m.srfm)||void 0===m||m.toggleErrorState(t.closest(".srfm-block"),!0),d=!0}}}else{var v;null===(v=window)||void 0===v||null===(v=v.srfm)||void 0===v||v.toggleErrorState(t.closest(".srfm-block"),!1)}else p.textContent=p.getAttribute("data-error-msg"),null===(e=window)||void 0===e||null===(e=e.srfm)||void 0===e||e.toggleErrorState(t.closest(".srfm-block"),!0),d=!0;if(d){var y,g=(null===(y=window)||void 0===y||null===(y=y.srfm)||void 0===y?void 0:y[n])||t;h(g,t.closest(".srfm-block"),{shouldDelayOnFocus:!0})}new jt((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(qt=a.querySelectorAll("input"),Lt=qt[0].getAttribute("data-min-selection"),Ct=qt[0].getAttribute("data-max-selection"),Tt=null,It=0,Ft=!1,Nt=0;Nt<qt.length;Nt++)Tt||"hidden"===qt[Nt].type||(Tt=qt[Nt]),qt[Nt].checked&&It++;(Lt||Ct)&&It>0&&(!Ft&&Lt>0&&(f&&Lt>1||!f)&&It<Lt&&(p.textContent=null===(Ut=window)||void 0===Ut||null===(Ut=Ut.srfm)||void 0===Ut?void 0:Ut.srfmSprintfString(null===(Gt=window)||void 0===Gt||null===(Gt=Gt.srfm_submit)||void 0===Gt||null===(Gt=Gt.messages)||void 0===Gt?void 0:Gt.srfm_multi_choice_min_selections,Lt),Ft=!0),!Ft&&Ct>0&&It>Ct&&(p.textContent=null===(Dt=window)||void 0===Dt||null===(Dt=Dt.srfm)||void 0===Dt?void 0:Dt.srfmSprintfString(null===(Rt=window)||void 0===Rt||null===(Rt=Rt.srfm_submit)||void 0===Rt||null===(Rt=Rt.messages)||void 0===Rt?void 0:Rt.srfm_multi_choice_max_selections,Ct),Ft=!0),Ft?(null===(Mt=window)||void 0===Mt||null===(Mt=Mt.srfm)||void 0===Mt||Mt.toggleErrorState(a,!0),h(Tt,a),d=!0):f||null===(Vt=window)||void 0===Vt||null===(Vt=Vt.srfm)||void 0===Vt||Vt.toggleErrorState(a,!1))}d=(0,t.applyFilters)("srfm.modifyFieldValidationResult",d,a,h);case 52:case"end":return e.stop()}}),e)})),A.s();case 20:if((O=A.n()).done){e.next=27;break}return e.delegateYield(P(),"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),A.e(e.t1);case 32:return e.prev=32,A.f(),e.finish(32);case 35:return e.abrupt("return",!!d&&n({validateResult:d,firstErrorInput:m,scrollElement:v},p));case 36:case"end":return e.stop()}}),e,null,[[17,29,32,35]])}))),v.apply(this,arguments)}function p(){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 h(){((arguments.length>0&&void 0!==arguments[0]?arguments[0]:null)||p()).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",u(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y(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",u(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:y(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",u(i().mark((function e(){var r,o,a,s,l,u,f,d,m,v,p,h,y,g,b,w,S,_,k;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(l=n.querySelector(".srfm-input-email"),u=n.querySelector(".srfm-email-confirm-block"),f=u.querySelector(".srfm-error-message"),l.value===t.value){e.next=17;break}return f.style.display="block",f.textContent=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_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),f.textContent="",f.style.display="none";case 20:v=c(),p=v.local,h=v.domain,y=t.value.lastIndexOf("@"),g="",-1!==y&&(p>0&&t.value.slice(0,y).length>p?g=null===(b=window)||void 0===b||null===(b=b.srfm)||void 0===b?void 0:b.srfmSprintfString(null===(w=window)||void 0===w||null===(w=w.srfm_submit)||void 0===w||null===(w=w.messages)||void 0===w?void 0:w.srfm_email_local_max_length,p):h>0&&t.value.slice(y+1).length>h&&(g=null===(S=window)||void 0===S||null===(S=S.srfm)||void 0===S?void 0:S.srfmSprintfString(null===(_=window)||void 0===_||null===(_=_.srfm_submit)||void 0===_||null===(_=_.messages)||void 0===_?void 0:_.srfm_email_domain_max_length,h))),""===(null==t?void 0:t.value)||r&&!g?(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=g||(null===(k=window)||void 0===k||null===(k=k.srfm_submit)||void 0===k||null===(k=k.messages)||void 0===k?void 0:k.srfm_valid_email),a.id=a.getAttribute("data-srfm-id"));case 25: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",u(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:y(r,e);case 1:case"end":return t.stop()}}),t)})))),n){var o=n.querySelector(".srfm-slider-thumb");o&&o.addEventListener("blur",u(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:y(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(){y(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())||y(o,e)}))}),500)}"srfm-phone-block"===t&&(o=r.querySelector(".srfm-input-phone")),o&&o.addEventListener("blur",u(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:y(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 l,u=r.closest(".srfm-block"),c="";if(n&&s<n)c=null===(l=window)||void 0===l||null===(l=l.srfm)||void 0===l?void 0:l.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(u,Boolean(c))}else{var d;null===(d=window)||void 0===d||null===(d=d.srfm)||void 0===d||d.toggleErrorState(t,!1)}}))}}}))}var y=function(){var t=u(i().mark((function t(e,r){var n,o,a,s,l;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"),l=o.getAttribute("data-submit-token"),t.next=8,m(a,s,l,n,!0);case 8:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),g=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})}},b=function(t,e,r,n){if(!(t||e||r||n))return!0;var o;if("v2-checkbox"===t)o=grecaptcha.getResponse();else if(e)o=hcaptcha.getResponse();else if(r){var i=r.querySelector('[name="cf-turnstile-response"]');o=(null==i?void 0:i.value)||turnstile.getResponse()}var a=(o||"").length>0;return n.style.display=a?"none":"block",a};function w(t){return w="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},w(t)}function S(){S=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 l(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(e,r,n,o){var i=r&&r.prototype instanceof d?r:d,a=Object.create(i.prototype);return l(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 l=k(s,n);if(l){if(l===f)continue;return l}}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 u=c(e,r,n);if("normal"===u.type){if(o=n.done?4:2,u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=4,n.method="throw",n.arg=u.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=u;var f={};function d(){}function m(){}function v(){}var p={};l(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=d.prototype=Object.create(p);function b(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function _(t,e){function r(o,i,a,s){var l=c(t[o],t,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==w(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){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}var o;l(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(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(w(e)+" is not iterable")}return m.prototype=v,l(g,"constructor",v),l(v,"constructor",m),m.displayName=l(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},b(_.prototype),l(_.prototype,a,(function(){return this})),e.AsyncIterator=_,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new _(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),l(g,s,"Generator"),l(g,i,(function(){return this})),l(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),!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,l=i[1],u=i[2];if(-1===i[0])return n("end"),!1;if(!l&&!u)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<l)return this.method="next",this.arg=t,n(l),!0;if(s<u)return n(u),!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]),E(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;E(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 _(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}function k(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){_(i,n,o,a,s,"next",t)}function s(t){_(i,n,o,a,s,"throw",t)}a(void 0)}))}}function x(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,l=parseFloat(i.getAttribute("data-fixed-amount"));if(!l||isNaN(l)||l<=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 u,c=parseFloat(i.dataset.currentAmount||0);if(isNaN(c)||c<=0)return{valid:!1,slug:"invalid-variable-amount",message:null===(u=window.srfmPaymentUtility)||void 0===u?void 0:u.getStripeStrings("invalid_variable_amount","Invalid payment amount")};var f=parseFloat(i.getAttribute("data-minimum-amount")||0);if(f>0&&c<f){var d,m=(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===(d=window.srfmPaymentUtility)||void 0===d?void 0:d.getStripeStrings("amount_below_minimum","Payment amount must be at least {symbol}{amount}.")).replace("{symbol}",m).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 _,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===(_=window.srfmPaymentUtility)||void 0===_?void 0:_.getStripeStrings("payment_email_required","Please enter your email.")}}function E(t){return A.apply(this,arguments)}function A(){return(A=k(S().mark((function t(e){var r,n,o,i;return S().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.dataset.srfmPaymentInFlight="true",t.prev=1,!(r=x(e)).valid||"no-payment-block"!==r.slug){t.next=5;break}return t.abrupt("return",{valid:!0,message:""});case 5:if(r.valid){t.next=7;break}return t.abrupt("return",{valid:!1,message:r.message});case 7:return n=e.querySelector(".srfm-block.srfm-payment-block"),t.next=10,O(e,n);case 10:return o=t.sent,t.abrupt("return",o);case 14:return t.prev=14,t.t0=t.catch(1),t.abrupt("return",{valid:!1,message:null===(i=window.srfmPaymentUtility)||void 0===i?void 0:i.getStripeStrings("payment_failed","Payment failed"),paymentResultOnCreateIntent:null});case 17:return t.prev=17,delete e.dataset.srfmPaymentInFlight,t.finish(17);case 20:case"end":return t.stop()}}),t,null,[[1,14,17,20]])})))).apply(this,arguments)}function O(t,e){return P.apply(this,arguments)}function P(){return(P=k(S().mark((function t(e,r){var n,o,i,a,s;return S().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,j(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 j(t,e,r){return q.apply(this,arguments)}function q(){return(q=k(S().mark((function t(e,r,n){var o,i,a,s,l;return S().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!=(l=t.sent)&&l.valid){t.next=12;break}return t.abrupt("return",{valid:!1,message:(null==l?void 0:l.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:l});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=g);const L=window.wp.i18n;function C(t){return C="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},C(t)}function T(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 I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?T(Object(r),!0).forEach((function(e){F(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):T(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"!=C(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=C(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==C(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function N(t){return function(t){if(Array.isArray(t))return D(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||G(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=G(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 G(t,e){if(t){if("string"==typeof t)return D(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)?D(t,e):void 0}}function D(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 R(){R=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 l(t,e,r,n){return Object.defineProperty(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n})}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(e,r,n,o){var i=r&&r.prototype instanceof d?r:d,a=Object.create(i.prototype);return l(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 l=S(s,n);if(l){if(l===f)continue;return l}}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 u=c(e,r,n);if("normal"===u.type){if(o=n.done?4:2,u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(o=4,n.method="throw",n.arg=u.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=u;var f={};function d(){}function m(){}function v(){}var p={};l(p,i,(function(){return this}));var h=Object.getPrototypeOf,y=h&&h(h(E([])));y&&y!==r&&n.call(y,i)&&(p=y);var g=v.prototype=d.prototype=Object.create(p);function b(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function r(o,i,a,s){var l=c(t[o],t,i);if("throw"!==l.type){var u=l.arg,f=u.value;return f&&"object"==C(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){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(l.arg)}var o;l(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 _(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(_,this),this.reset(!0)}function E(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(C(e)+" is not iterable")}return m.prototype=v,l(g,"constructor",v),l(v,"constructor",m),m.displayName=l(v,s,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},e.awrap=function(t){return{__await:t}},b(w.prototype),l(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(u(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(g),l(g,s,"Generator"),l(g,i,(function(){return this})),l(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=E,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,l=i[1],u=i[2];if(-1===i[0])return n("end"),!1;if(!l&&!u)throw Error("try statement without catch or finally");if(null!=i[0]&&i[0]<=s){if(s<l)return this.method="next",this.arg=t,n(l),!0;if(s<u)return n(u),!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(e),r,n},"next"===this.method&&(this.arg=t),f}},e}function M(t,e,r,n,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void r(t)}s.done?e(l):Promise.resolve(l).then(n,o)}function V(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){M(i,n,o,a,s,"next",t)}function s(t){M(i,n,o,a,s,"throw",t)}a(void 0)}))}}var B=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)?h(r.filter((function(t){return p().includes(t)}))):h()}));var H=0;function z(){h();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(++H)),document.dispatchEvent(new CustomEvent("srfm_form_before_submission",{detail:{form:e}}));var r=ut(e),i=r.formId,a=r.submitType,s=r.successUrl,l=r.ajaxUrl,u=r.submitToken,c=r.loader,f=r.successContainer,d=r.successElement,m=r.recaptchaType,v=r.afterSubmission,p=r.captchaErrorElement,h=r.hCaptchaDiv,y=r.turnstileDiv,g=r.hasLoginBlock,b="v2-checkbox"===m||!!h||!!y;"v3-reCAPTCHA"!==m||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")&&(B=e)}),!0)),e.addEventListener("submit",function(){var r=V(R().mark((function r(n){var o,w,S,_,k,x,E;return R().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=10;break}if(S=null==o?void 0:o.closest(".srfm-form-container"),_=null==S?void 0:S.classList.contains("srfm-submit-button-hidden"),k=null==o?void 0:o.querySelector("button.srfm-custom-button"),x=null==k||null===(w=k.closest(".srfm-custom-button-ctn"))||void 0===w?void 0:w.classList.contains("hide-element"),!_||k&&!x){r.next=10;break}return console.warn("Form submission is disabled because the submit button is hidden."),r.abrupt("return");case 10:if(!g||e.__loginSuccess){r.next=14;break}return E=new CustomEvent("srfm_login_request",{cancelable:!0,detail:{form:e}}),e.dispatchEvent(E),r.abrupt("return");case 14:if((0,t.applyFilters)("srfm.handleCustomFormSubmission",!0,{form:e})){r.next=17;break}return r.abrupt("return");case 17:st(e,i,l,u,c,s,f,d,a,v,b?m:void 0,b?h:void 0,b?y:void 0,b?p:void 0),e.__loginSuccess=!0;case 19: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(t){var e,r;if("1"===String(null!==(e=null===(r=window.srfm_view_beacon)||void 0===r?void 0:r.enabled)&&void 0!==e?e:"0")&&void 0!==window.IntersectionObserver){J||(J=new window.IntersectionObserver((function(t){var e,r=U(t);try{for(r.s();!(e=r.n()).done;){var n=e.value;if(n.isIntersecting){var o=n.intersectionRect;if(!(!o||o.width<=0||o.height<=0)){J.unobserve(n.target);var i=Number(n.target.getAttribute("form-id")),a=n.target.getAttribute("data-view-token");!K.has(i)&&a&&W(i,a)}}}}catch(t){r.e(t)}finally{r.f()}}),{threshold:0}));var n,o=U(t);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(!i.hasAttribute("data-srfm-view-observed")){var a=Number(i.getAttribute("form-id"));!Number.isInteger(a)||a<1||!i.getAttribute("data-view-token")||(i.setAttribute("data-srfm-view-observed","1"),J.observe(i))}}}catch(t){o.e(t)}finally{o.f()}}}(e)}var J=null,K=new Set;function W(t,e){var r,n=null===(r=window.srfm_view_beacon)||void 0===r?void 0:r.url;if(n){K.add(t);var o=new URLSearchParams(window.location.search).has("live_mode")?"1":"0";fetch(n,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-WP-Submit-Token":e},body:JSON.stringify({form_id:t,live_preview:o})}).catch((function(){}))}}function Y(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}document.addEventListener("DOMContentLoaded",(function(){z()}));var $={entries:[],isOn:function(){var t;return!(null===(t=window.srfm_submit)||void 0===t||!t.logging_enabled)},add:function(t){this.isOn()&&this.entries.length<10&&this.entries.push(t)},flush:function(t){var e,r;if(this.isOn()&&this.entries.length){var n=null===(e=window.srfm_submit)||void 0===e?void 0:e.log_error_url,o=null!==(r=null==t?void 0:t.getAttribute("data-submit-token"))&&void 0!==r?r:"",i=Number(null==t?void 0:t.getAttribute("form-id"))||0;if(n){var a=JSON.stringify({form_id:i,entries:this.entries});this.entries=[],fetch(n,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json","X-WP-Submit-Token":o||""},body:a}).catch((function(){}))}else this.entries=[]}}};function X(t){return Z.apply(this,arguments)}function Z(){return(Z=V(R().mark((function t(e){var r,n,o,i;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=null,t.prev=1,n=$.isOn()?e.clone():null,t.prev=3,t.next=6,e.json();case 6:r=t.sent,t.next=17;break;case 9:if(t.prev=9,t.t0=t.catch(3),!n){t.next=16;break}return t.next=14,n.text().catch((function(){return""}));case 14:i=t.sent,$.add({type:"response",status:e.status,message:"Response was not JSON: ".concat(null!==(o=null===t.t0||void 0===t.t0?void 0:t.t0.message)&&void 0!==o?o:""),body:String(i).slice(0,500)});case 16:throw t.t0;case 17:t.next=24;break;case 19:if(t.prev=19,t.t1=t.catch(1),!e.ok){t.next=23;break}return t.abrupt("return",null);case 23:throw t.t1;case 24:if(e.ok){t.next=26;break}throw r;case 26:return t.abrupt("return",r);case 27:case"end":return t.stop()}}),t,null,[[1,19],[3,9]])})))).apply(this,arguments)}function Q(t){return tt.apply(this,arguments)}function tt(){return(tt=V(R().mark((function e(r){var n,o,i,a,s,l,u,c,f,d,m,v,p,h,y,g,b,w,S,_,k,x,E,A,O,P,j,q,C,T,I,F,D,M,V,B,H;return R().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null===(n=window.srfm_submit)||void 0===n?void 0:n.submit_form_url){e.next=3;break}return e.abrupt("return",{success:!1,data:{message:(0,L.__)("This form could not be submitted. Please refresh the page and try again.","sureforms"),log_message:"SureForms: srfm_submit.submit_form_url is unavailable, so the submission was never sent."}});case 3:i=new FormData(r),a=new FormData,s=r.getAttribute("data-submit-token"),l=["srfm-email-confirm","srfm-password-confirm"],u=U(i.entries()),e.prev=8,u.s();case 10:if((c=u.n()).done){e.next=21;break}if(R=c.value,z=2,f=function(t){if(Array.isArray(t))return t}(R)||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=[],l=!0,u=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);l=!0);}catch(t){u=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(R,z)||G(R,z)||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.")}(),d=f[0],m=f[1],!l.includes(d)){e.next=14;break}return e.abrupt("continue",19);case 14:if(""!==m&&(v=r.querySelector('[name="'.concat(d,'"]')),null!=(p=null==v?void 0:v.closest(".srfm-block-single"))&&p.classList.contains("hide-element")&&(m=""),m=(0,t.applyFilters)("srfm.filterFieldValue",m,{key:d,form:r})),!(0,t.applyFilters)("srfm.shouldSkipField",!1,{key:d,value:m,form:r})){e.next=18;break}return e.abrupt("continue",19);case 18:a.append(d,m);case 19:e.next=10;break;case 21:e.next=26;break;case 23:e.prev=23,e.t0=e.catch(8),u.e(e.t0);case 26:return e.prev=26,u.f(),e.finish(26);case 29:return(h=Y(r))&&a.append("srfm_addresses",JSON.stringify(h)),y=(0,t.applyFilters)("srfm.prepareAdditionalFormData",{},r),Object.keys(y).forEach((function(t){null!==y[t]&&void 0!==y[t]&&a.append(t,JSON.stringify(y[t]))})),g=performance.now(),e.prev=34,e.next=37,fetch(o,{method:"POST",body:a,headers:{"X-WP-Submit-Token":s}});case 37:return w=e.sent,S=w.status,_=null!==(b=w.headers.get("content-type"))&&void 0!==b?b:"",k=Math.round(performance.now()-g),e.next=43,X(w);case 43:if(x=e.sent,w.ok&&!1!==(null==x?void 0:x.success)){e.next=53;break}if(F=Object.keys(null!==(E=null==x||null===(A=x.data)||void 0===A?void 0:A.field_errors)&&void 0!==E?E:{}),D=null!==(O=null!==(P=null!==(j=null==x||null===(q=x.data)||void 0===q?void 0:q.log_message)&&void 0!==j?j:null==x||null===(C=x.data)||void 0===C?void 0:C.message)&&void 0!==P?P:null==x?void 0:x.message)&&void 0!==O?O:"",M=null==x||null===(T=x.data)||void 0===T||null===(T=T.api_response)||void 0===T?void 0:T["error-codes"],V=Array.isArray(M)?" [".concat(M.join(", "),"]"):"",B=null!=x&&null!==(I=x.data)&&void 0!==I&&I.code?" (".concat(x.data.code,")"):"",!F.length){e.next=52;break}return e.abrupt("return",x);case 52:$.add({type:"network",status:S,duration_ms:k,message:"Submission responded ".concat(S," (").concat(_,")").concat(B,": ").concat(D).concat(V),body:function(){try{return JSON.stringify(x).slice(0,500)}catch(t){return""}}(),field_keys:N(a.keys())});case 53:return e.abrupt("return",x);case 56:return e.prev=56,e.t1=e.catch(34),console.error(e.t1),$.add({type:"error",duration_ms:Math.round(performance.now()-g),message:"".concat(null!==(H=null===e.t1||void 0===e.t1?void 0:e.t1.name)&&void 0!==H?H:"Error",": ").concat("string"==typeof(null===e.t1||void 0===e.t1?void 0:e.t1.message)?e.t1.message:"").concat(null!==e.t1&&void 0!==e.t1&&e.t1.code?" (".concat(e.t1.code,")"):"")}),e.abrupt("return",{success:!1,data:{message:"string"==typeof(null===e.t1||void 0===e.t1?void 0:e.t1.message)?e.t1.message:"",log_message:null!==e.t1&&void 0!==e.t1&&e.t1.code?"SureForms submission failed (".concat(e.t1.code,")."):null}});case 61:case"end":return e.stop()}var R,z}),e,null,[[8,23,26,29],[34,56]])})))).apply(this,arguments)}function et(t,e){return rt.apply(this,arguments)}function rt(){return(rt=V(R().mark((function t(e,r){var n,o,i,a,s,l,u;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=null==e||null===(n=e.data)||void 0===n?void 0:n.after_submit_url){t.next=3;break}return t.abrupt("return");case 3:return i=performance.now(),t.prev=4,t.next=7,fetch(o,{method:"GET",keepalive:!0});case 7:return a=t.sent,s=a.status,l=Math.round(performance.now()-i),t.next=12,X(a);case 12:if(a.ok){t.next=23;break}return t.t0=$,t.t1=s,t.t2=l,t.t3="After-submission step responded ".concat(s),t.next=19,a.clone().text().then((function(t){return String(t).slice(0,500)})).catch((function(){return""}));case 19:t.t4=t.sent,t.t5={type:"after_submission",status:t.t1,duration_ms:t.t2,message:t.t3,body:t.t4},t.t0.add.call(t.t0,t.t5),$.flush(r);case 23:t.next=30;break;case 25:t.prev=25,t.t6=t.catch(4),console.error(t.t6),$.add({type:"after_submission",duration_ms:Math.round(performance.now()-i),message:"After-submission step failed: ".concat(null!==(u=null===t.t6||void 0===t.t6?void 0:t.t6.name)&&void 0!==u?u:"Error",": ").concat("string"==typeof(null===t.t6||void 0===t.t6?void 0:t.t6.message)?t.t6.message:"")}),$.flush(r);case 30:case"end":return t.stop()}}),t,null,[[4,25]])})))).apply(this,arguments)}function nt(e,r,n,o,i,a,s){var l,u=new CustomEvent("srfm_on_show_success_message",{cancelable:!0,detail:{form:o,element:r,message:n,submitType:a,container:e,loader:s}});document.dispatchEvent(u)&&(at(o),"hide form"===i?(o.style.opacity=1,o.style.display="none",setTimeout((function(){r.style.opacity=1}),500)):"reset form"===i&&(o.reset(),document.dispatchEvent(new CustomEvent("srfm_form_reset",{detail:{form:o}}))),r.innerHTML=n,e.classList.add("srfm-active"),null===(l=window)||void 0===l||null===(l=l.srfm)||void 0===l||l.handleInstantFormWrapperHeight(),(0,t.applyFilters)("srfm.enableScrollOnSuccess",!0)&&o.parentElement.scrollIntoView({behavior:"smooth"}))}function ot(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 it(t){t.querySelectorAll(".srfm-common-error-message").forEach((function(t){t.setAttribute("hidden","")}))}function at(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 st(t,e,r,n,o,i,a,s,l,u,c,f,d,m){return lt.apply(this,arguments)}function lt(){return(lt=V(R().mark((function t(e,r,n,o,i,a,s,l,u,c,f,d,v,p){var h,y,w,S,_,k,x,A,O,P,j,q,L,C,T,F,N,U,G;return R().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:u,successElement:l,successContainer:s}}),document.dispatchEvent(h),(y=e.querySelector('#srfm-submit-btn, button[type="submit"], .srfm-custom-button'))&&(y.disabled=!0,y.style.pointerEvents="none"),it(e),t.next=9,m(r,n,o,e);case 9:if(w=t.sent,S=b(f,d,v,p),(null==w||!w.validateResult)&&S){t.next=16;break}return i.classList.remove("srfm-active"),at(e),null!=w&&w.validateResult?g(w):S||g({firstErrorInput:p,scrollElement:p}),t.abrupt("return");case 16:if(_=new CustomEvent("srfm_on_trigger_form_submission",{cancelable:!0,detail:{form:e,loader:i,formId:r,submitType:u,successElement:l,successContainer:s}}),document.dispatchEvent(_)){t.next=21;break}return i.classList.remove("srfm-active"),at(e),t.abrupt("return");case 21:return t.next=23,E(e);case 23:if(null!=(k=t.sent)&&k.valid){t.next=29;break}return ot({form:e,message:null==k?void 0:k.message}),i.classList.remove("srfm-active"),at(e),t.abrupt("return");case 29:return t.next=31,Q(e);case 31:null!=(x=t.sent)&&x.success?(null!=x&&null!==(A=x.data)&&void 0!==A&&A.after_submit&&et(x,e),ct(I(I({},x),{},{formId:r})),j=u,u=(null==x||null===(O=x.data)||void 0===O||null===(O=O.submission_settings)||void 0===O?void 0:O.submission_mode)||j,q=c,c=(null==x||null===(P=x.data)||void 0===P||null===(P=P.submission_settings)||void 0===P?void 0:P.after_submission)||q,"same page"===u?(nt(s,l,null!==(L=null==x?void 0:x.message)&&void 0!==L?L:"",e,c,u),i.classList.remove("srfm-active"),at(e)):["different page","custom url"].includes(u)?(null!=x&&x.redirect_url&&(a=null==x?void 0:x.redirect_url,window.location.assign(a)),i.classList.remove("srfm-active"),at(e)):nt(s,l,null!==(C=null==x?void 0:x.message)&&void 0!==C?C:"",e,c,u,i)):(T=(null==x?void 0:x.data)||{},ot(I({form:e},T)),i.classList.remove("srfm-active"),$.flush(e),at(e)),t.next=44;break;case 35:t.prev=35,t.t0=t.catch(0),$.add({type:"error",message:"Submission aborted: ".concat(null!==(F=null===t.t0||void 0===t.t0?void 0:t.t0.name)&&void 0!==F?F:"Error",": ").concat("string"==typeof(null===t.t0||void 0===t.t0?void 0:t.t0.message)?t.t0.message:""),source:null===(N=String(null!==(U=null===t.t0||void 0===t.t0?void 0:t.t0.stack)&&void 0!==U?U:"").split("\n")[1])||void 0===N||null===(N=N.trim())||void 0===N?void 0:N.slice(0,200)}),$.flush(e),G=new CustomEvent("srfm_on_trigger_form_submission_failure",{detail:{form:e,error:t.t0,loader:i,formId:r,submitType:u,successElement:l,successContainer:s}}),document.dispatchEvent(G),i.classList.remove("srfm-active"),at(e),ot({form:e});case 44:case"end":return t.stop()}var a}),t,null,[[0,35]])})))).apply(this,arguments)}function ut(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"),l=null==s?void 0:s.querySelector(".srfm-success-box-description"),u=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:l,submitBtn:u,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 ct(t){var e=new CustomEvent("srfm_form_submission_success",{detail:{formId:"srfm-form-".concat(t.formId)}});document.dispatchEvent(e)}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,l=void 0===s?null:s;if(r){l&&console.warn(l);var u=o||(0,L.__)("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=u,f.removeAttribute("hidden"),g({firstErrorInput:f,scrollElement:f}))}})),window.recaptchaCallback=function(){if(arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&B){var t=B;B=null;var e=ut(t),r=e.formId,n=e.submitType,o=e.ajaxUrl,i=e.submitToken,a=e.loader,s=e.successUrl,l=e.successContainer,u=e.successElement,c=e.recaptchaType,f=e.afterSubmission;if("v3-reCAPTCHA"===c)return a.classList.add("srfm-active"),void st(t,r,o,i,a,s,l,u,n,f)}Array.from(document.querySelectorAll(".srfm-form")).forEach((function(t){var e=ut(t),r=e.formId,n=e.submitType,o=e.successUrl,i=e.ajaxUrl,a=e.submitToken,s=e.loader,l=e.successContainer,u=e.successElement,c=e.submitBtn,f=e.siteKey,d=e.recaptchaType,m=e.afterSubmission,v=!1;"v2-invisible"===d&&(grecaptcha.render(c,{sitekey:f,callback:function(){st(t,r,i,a,s,o,l,u,n,m),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&&(ot({form:e,message:o}),t.classList.add("captcha-error-added"))}))}}),c.addEventListener("click",(function(){s.classList.add("srfm-active"),v&&st(t,r,i,a,s,o,l,u,n,m)})))}))},window.showErrorMessage=ot,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=V(R().mark((function t(e){return R().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"))&&z()})),document.addEventListener("srfm_form_initialize",(function(){z()}))})();