From f465a3b1fdf679a9e4515581872987d55996b704 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Thu, 29 Aug 2024 19:16:03 +0700 Subject: [PATCH 01/13] Temp commit --- .../onboarding-wizard/steps/default-email-address-step.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/views/onboarding-wizard/steps/default-email-address-step.php b/classes/views/onboarding-wizard/steps/default-email-address-step.php index 2c493ce778..7bd9dd0627 100644 --- a/classes/views/onboarding-wizard/steps/default-email-address-step.php +++ b/classes/views/onboarding-wizard/steps/default-email-address-step.php @@ -17,14 +17,14 @@
-

+

- +

- + From b9f07a12e9247ae3a1224b6468d8ffc795abcc33 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Mon, 2 Sep 2024 10:06:31 +0700 Subject: [PATCH 02/13] Add From Address setting --- classes/helpers/FrmOnboardingWizardHelper.php | 17 ++++++++++ classes/models/FrmSettings.php | 2 ++ classes/views/frm-settings/general.php | 8 +++++ .../steps/default-email-address-step.php | 32 ++++++++++++++++--- 4 files changed, 54 insertions(+), 5 deletions(-) diff --git a/classes/helpers/FrmOnboardingWizardHelper.php b/classes/helpers/FrmOnboardingWizardHelper.php index f3fdcfccf3..309492df7c 100644 --- a/classes/helpers/FrmOnboardingWizardHelper.php +++ b/classes/helpers/FrmOnboardingWizardHelper.php @@ -134,4 +134,21 @@ public static function print_footer( $args = array() ) { require FrmOnboardingWizardController::get_view_path() . 'footer.php'; } + + public static function print_setting_error( $args ) { + $args = wp_parse_args( + $args, + array( + 'id' => '', + 'errors' => array(), + ) + ); + ?> + + $msg ) : ?> + + + + load_style = $params['frm_load_style']; $this->custom_css = $params['frm_custom_css']; $this->default_email = $params['frm_default_email']; + $this->from_email = $params['frm_from_email']; $this->currency = $params['frm_currency']; $checkboxes = array( 'mu_menu', 're_multi', 'use_html', 'jquery_css', 'accordion_js', 'fade_form', 'no_ips', 'custom_header_ip', 'tracking', 'admin_bar', 'summary_emails' ); diff --git a/classes/views/frm-settings/general.php b/classes/views/frm-settings/general.php index 29a6669dd0..1faf717104 100644 --- a/classes/views/frm-settings/general.php +++ b/classes/views/frm-settings/general.php @@ -43,6 +43,14 @@

+

+ + +

+
+

+ + + 'frm-onboarding-from-email-error', + 'errors' => array( + 'invalid' => __( 'Email is invalid', 'formidable' ), + 'empty' => __( 'Email is empty', 'formidable' ), + ), + ) + ); + ?> +

- + - - - - + 'frm-onboarding-email-step-error', + 'errors' => array( + 'invalid' => __( 'Email is invalid', 'formidable' ), + 'empty' => __( 'Email is empty', 'formidable' ), + ), + ) + ); + ?>

From e1e460e1dd49f13a0b962997027ac10b736625eb Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Thu, 5 Sep 2024 16:54:43 +0700 Subject: [PATCH 03/13] Apply From email address to email header --- classes/helpers/FrmEmailHelper.php | 15 +++++++++++++++ classes/models/FrmEmail.php | 2 +- classes/models/FrmEmailSummary.php | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/classes/helpers/FrmEmailHelper.php b/classes/helpers/FrmEmailHelper.php index b663971a74..bb31f35d47 100644 --- a/classes/helpers/FrmEmailHelper.php +++ b/classes/helpers/FrmEmailHelper.php @@ -40,4 +40,19 @@ public static function get_user_id_field_for_form( $form_id ) { public static function remove_mandrill_br() { return false; } + + /** + * Gets default from email address in header for emails. + * + * @since x.x + * + * @return string + */ + public static function get_default_from_email() { + $settings = new FrmSettings(); + if ( $settings->from_email && is_email( $settings->from_email ) ) { + return $settings->from_email; + } + return get_option( 'admin_email' ); + } } diff --git a/classes/models/FrmEmail.php b/classes/models/FrmEmail.php index 2b571f247e..a734470ce8 100644 --- a/classes/models/FrmEmail.php +++ b/classes/models/FrmEmail.php @@ -241,7 +241,7 @@ private function prepare_additional_recipients( $recipients, $user_id_args ) { */ private function set_from( $user_id_args ) { if ( empty( $this->settings['from'] ) ) { - $from = get_option( 'admin_email' ); + $from = FrmEmailHelper::get_default_from_email(); } else { $from = $this->prepare_email_setting( $this->settings['from'], $user_id_args ); } diff --git a/classes/models/FrmEmailSummary.php b/classes/models/FrmEmailSummary.php index dfb434321e..c942d60edf 100644 --- a/classes/models/FrmEmailSummary.php +++ b/classes/models/FrmEmailSummary.php @@ -67,7 +67,7 @@ protected function get_recipients() { protected function get_headers() { return array( 'Content-Type: ' . ( $this->is_html ? 'text/html; charset=UTF-8' : 'text/plain' ), - 'From: ' . get_bloginfo( 'name' ) . ' <' . get_bloginfo( 'admin_email' ) . '>', + 'From: ' . get_bloginfo( 'name' ) . ' <' . FrmEmailHelper::get_default_from_email() . '>', ); } From 9edf3f359a7945290a6fc9d908f09e72a946eb60 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Thu, 5 Sep 2024 17:58:15 +0700 Subject: [PATCH 04/13] Handle from email validation --- .../FrmOnboardingWizardController.php | 2 ++ classes/helpers/FrmEmailHelper.php | 2 +- .../steps/default-email-address-step.php | 2 +- js/formidable_blocks.js | 2 +- js/onboarding-wizard.js | 2 +- .../elements/getDOMElements.js | 1 + .../events/setupEmailStepButtonListener.js | 17 +++++++++++++---- js/src/onboarding-wizard/ui/showError.js | 4 ++-- 8 files changed, 22 insertions(+), 10 deletions(-) diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 1981348694..38c73b065d 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -274,12 +274,14 @@ public static function ajax_setup_email_step() { check_ajax_referer( 'frm_ajax', 'nonce' ); // Get posted data. + $from_email = FrmAppHelper::get_post_param( 'from_email', '', 'sanitize_text_field' ); $default_email = FrmAppHelper::get_post_param( 'default_email', '', 'sanitize_text_field' ); $allows_tracking = FrmAppHelper::get_post_param( 'allows_tracking', '', 'rest_sanitize_boolean' ); $summary_emails = FrmAppHelper::get_post_param( 'summary_emails', '', 'rest_sanitize_boolean' ); // Update Settings. $frm_settings = FrmAppHelper::get_settings(); + $frm_settings->update_setting( 'from_email', $from_email, 'sanitize_text_field' ); $frm_settings->update_setting( 'default_email', $default_email, 'sanitize_text_field' ); $frm_settings->update_setting( 'tracking', $allows_tracking, 'rest_sanitize_boolean' ); $frm_settings->update_setting( 'summary_emails', $summary_emails, 'rest_sanitize_boolean' ); diff --git a/classes/helpers/FrmEmailHelper.php b/classes/helpers/FrmEmailHelper.php index bb31f35d47..86faadbb38 100644 --- a/classes/helpers/FrmEmailHelper.php +++ b/classes/helpers/FrmEmailHelper.php @@ -49,7 +49,7 @@ public static function remove_mandrill_br() { * @return string */ public static function get_default_from_email() { - $settings = new FrmSettings(); + $settings = FrmAppHelper::get_settings(); if ( $settings->from_email && is_email( $settings->from_email ) ) { return $settings->from_email; } diff --git a/classes/views/onboarding-wizard/steps/default-email-address-step.php b/classes/views/onboarding-wizard/steps/default-email-address-step.php index b89e8b1420..1927f2eed1 100644 --- a/classes/views/onboarding-wizard/steps/default-email-address-step.php +++ b/classes/views/onboarding-wizard/steps/default-email-address-step.php @@ -25,7 +25,7 @@

- + 0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var l=0;l0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},46:function(e){"use strict";e.exports=function(e){return e[1]}},703:function(e,t,r){"use strict";var n=r(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},697:function(e,t,r){e.exports=r(703)()},414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},379:function(e){"use strict";var t=[];function r(e){for(var r=-1,n=0;n0?" ".concat(r.layer):""," {")),n+=r.css,o&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var i=r.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.nc=void 0,function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,r,n){var o,i,a,l;n((o={},a=r,l=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i=t),(i="symbol"==e(l)?l:String(l))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o))}function n(e,t){return e?" ".concat(t,'="').concat(e,'"'):""}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r-1&&(n=e.substr(0,r)),n+"wp-admin/admin.php?page=formidable&frm_action=edit&id=".concat(c))},M("Go to form","formidable")))),wp.element.createElement(V,{title:M("Options","formidable"),initialOpen:!1},wp.element.createElement(Q,{label:M("Show Form Title","formidable"),checked:u,onChange:function(e){t("title",e?"1":"",i)}}),wp.element.createElement(Q,{label:M("Show Form Description","formidable"),checked:f,onChange:function(e){t("description",e?"1":"",i)}}),wp.element.createElement(Q,{label:M("Minimize HTML","formidable"),checked:m,onChange:function(e){t("minimize",e?"1":"",i)}})),wp.element.createElement(V,{title:M("Shortcode","formidable"),initialOpen:!1},wp.element.createElement(B,null,wp.element.createElement(s,this.props.attributes))))}}])&&R(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(z);function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function Y(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?" ".concat(r.layer):""," {")),n+=r.css,o&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var i=r.sourceMap;i&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(i))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},589:function(e){"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},62:function(e,t,r){"use strict";var n=r(46),o=r.n(n),i=r(758),a=r.n(i)()(o());a.push([e.id,"button.t3RQZV1ZQbHGYyQUnhIY {\n\tcursor: progress;\n\topacity: 0.7;\n\tposition: relative;\n\ttext-indent: -999px;\n\tmin-width: 70px;\n\toverflow: hidden;\n}\nbutton.t3RQZV1ZQbHGYyQUnhIY:before {\n\tcontent: '';\n\tdisplay: inline-block;\n\tposition: absolute;\n\tbackground: transparent;\n\tborder: 1px solid #fff;\n\tborder-top-color: transparent;\n\tborder-left-color: transparent;\n\tborder-radius: 50%;\n\n\tbox-sizing: border-box;\n\ttop: 50%;\n\tleft: 50%;\n\tmargin-top: -10px;\n\tmargin-left: -10px;\n\twidth: 20px;\n\theight: 20px;\n\n\t-webkit-animation: Ts7haRQUDk0YMfLiQW00 2s linear infinite;\n\t-moz-animation: Ts7haRQUDk0YMfLiQW00 2s linear infinite;\n\t-o-animation: Ts7haRQUDk0YMfLiQW00 2s linear infinite;\n\tanimation: Ts7haRQUDk0YMfLiQW00 2s linear infinite;\n}",""]),a.locals={"frm-loading":"t3RQZV1ZQbHGYyQUnhIY",spin:"Ts7haRQUDk0YMfLiQW00"},t.Z=a},758:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r})).join("")},t.i=function(e,r,n,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var l=0;l0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),r&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=r):u[2]=r),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},46:function(e){"use strict";e.exports=function(e){return e[1]}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={id:n,exports:{}};return e[n](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.nc=void 0,function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,r,n){var o,i,a,l;n((o={},a=r,l=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,"string");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(i=t),(i="symbol"==e(l)?l:String(l))in o?Object.defineProperty(o,i,{value:a,enumerable:!0,configurable:!0,writable:!0}):o[i]=a,o))}function n(e,t){return e?" ".concat(t,'="').concat(e,'"'):""}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r-1&&(n=e.substr(0,r)),n+"wp-admin/admin.php?page=formidable&frm_action=edit&id=".concat(c))},M("Go to form","formidable")))),wp.element.createElement(V,{title:M("Options","formidable"),initialOpen:!1},wp.element.createElement(Q,{label:M("Show Form Title","formidable"),checked:u,onChange:function(e){t("title",e?"1":"",i)}}),wp.element.createElement(Q,{label:M("Show Form Description","formidable"),checked:f,onChange:function(e){t("description",e?"1":"",i)}}),wp.element.createElement(Q,{label:M("Minimize HTML","formidable"),checked:m,onChange:function(e){t("minimize",e?"1":"",i)}})),wp.element.createElement(V,{title:M("Shortcode","formidable"),initialOpen:!1},wp.element.createElement(B,null,wp.element.createElement(s,this.props.attributes))))}}])&&R(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),l}(z);function W(e){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(e)}function Y(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):0()\[\]\\.,;:\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,}))$/i.test(t)};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}var I=new URL(window.location.href),T=I.searchParams,N=function(t){return T.get(t)},D=function(t){return T.delete(t),I.search=T.toString(),I.toString()},F=function(t,e){var r,n,o,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pushState";if(T.set(t,e),I.search=T.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=P(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==P(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",I)}return I.toString()},G=window.frmDom.util.onClickPreventDefault;function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},M=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),F("step",t,e)}},R=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),C(r,n),M(n)}},U=function(){R()},q=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&M(e.dataset.stepName)},z=window.frmDom.span;function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function J(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var V=function(){var t,e=(t=$().mark((function t(){var e,r,n,i,a,c,u,l,s,f;return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,n=r.value.trim(),A(n)){t.next=5;break}return h="invalid",function(t,e,r,n){var o=document.querySelector(t),i=document.querySelector(e);o&&i?(i.setAttribute("frm-error",r),S(i),o.addEventListener("keyup",(function(){L(i)}),{once:!0})):console.warn("showFormError: Unable to find input or error element.")}("#".concat(o,"-default-email-field"),"#".concat(o,"-email-step-error"),h),t.abrupt("return");case 5:i=w(),a=i.subscribeCheckbox,c=i.summaryEmailsCheckbox,u=i.allowTrackingCheckbox,null!=a&&a.checked&&(n&&(document.getElementById("frm_leave_email").value=n),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),l=y(),(s=l.emailStepData).default_email=n,s.allows_tracking=u.checked,s.summary_emails=c.checked,a&&(s.is_subscribed=a.checked),d("emailStepData",s),(f=new FormData).append("default_email",n),f.append("allows_tracking",u.checked),f.append("summary_emails",c.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",f).then(R);case 19:case"end":return t.stop()}var h}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){J(i,n,o,a,c,"next",t)}function c(t){J(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function Z(t){return Z="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},Z(t)}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q(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 X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ut=function(){var e,r=(e=at().mark((function e(){var r,n,o,i,a;return at().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return R(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ct(i,n,o,a,c,"next",t)}function c(t){ct(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function lt(t){return lt="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},lt(t)}function st(){st=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==lt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ht=function(){var t,e=(t=st().mark((function t(){return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function pt(t){return pt="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},pt(t)}function yt(){yt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function dt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var vt=function(){var t,e=(t=yt().mark((function t(){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=F("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,c,"next",t)}function c(t){dt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function mt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||N("step");M(r,"replaceState")}));var gt,bt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),W(),w().skipStepButtons.forEach((function(t){G(t,U)})),w().backButtons.forEach((function(t){G(t,q)})),i=w().setupEmailStepButton,G(i,V),n=w().saveLicenseButton,G(n,vt),r=w().installAddonsButton,G(r,rt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",mt)})),e=w().checkProInstallationButton,G(e,ut),t=w().skipProInstallationButton,G(t,ht)};gt=function(){bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",gt):gt())}(); \ No newline at end of file +!function(){"use strict";var t=window.frmGlobal.nonce,e=window.frmOnboardingWizardVars,r=e.INITIAL_STEP,n=e.proIsIncluded,o="frm-onboarding",i="frm-current",a="".concat(o,"-welcome-step"),c={INITIAL:r,DEFAULT_EMAIL_ADDRESS:"default-email-address",INSTALL_FORMIDABLE_PRO:"install-formidable-pro",LICENSE_MANAGEMENT:"license-management",INSTALL_ADDONS:"install-addons",SUCCESS:"success"};function u(t){return u="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},u(t)}function l(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 s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):0()\[\]\\.,;:\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,}))$/i.test(t)};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}var I=new URL(window.location.href),T=I.searchParams,N=function(t){return T.get(t)},F=function(t){return T.delete(t),I.search=T.toString(),I.toString()},D=function(t,e){var r,n,o,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pushState";if(T.set(t,e),I.search=T.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=P(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==P(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",I)}return I.toString()},B=window.frmDom.util.onClickPreventDefault;function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},M=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),D("step",t,e)}},R=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),C(r,n),M(n)}},U=function(){R()},q=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&M(e.dataset.stepName)},z=window.frmDom.span;function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function V(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var Z=function(){var t,e=(t=J().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f,h;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,n=e.defaultFromEmailField,o=r.value.trim(),i=!1,[n,r].forEach((function(t){var e=t.value.trim();A(e)||(K("invalid",t),i=!0)})),!i){t.next=6;break}return t.abrupt("return");case 6:a=w(),c=a.subscribeCheckbox,u=a.summaryEmailsCheckbox,l=a.allowTrackingCheckbox,null!=c&&c.checked&&(o&&(document.getElementById("frm_leave_email").value=o),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),s=y(),(f=s.emailStepData).default_email=o,f.allows_tracking=l.checked,f.summary_emails=u.checked,c&&(f.is_subscribed=c.checked),d("emailStepData",f),(h=new FormData).append("default_email",o),h.append("from_email",n.value.trim()),h.append("allows_tracking",l.checked),h.append("summary_emails",u.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",h).then(R);case 21:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){V(i,n,o,a,c,"next",t)}function c(t){V(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function H(t){return H="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},H(t)}function Q(){Q=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==H(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function X(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 tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ut(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var lt=function(){var e,r=(e=ct().mark((function e(){var r,n,o,i,a;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return R(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ut(i,n,o,a,c,"next",t)}function c(t){ut(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function st(t){return st="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},st(t)}function ft(){ft=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==st(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ht(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var pt=function(){var t,e=(t=ft().mark((function t(){return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ht(i,n,o,a,c,"next",t)}function c(t){ht(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function yt(t){return yt="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},yt(t)}function dt(){dt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==yt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function vt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var mt=function(){var t,e=(t=dt().mark((function t(){return dt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=D("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){vt(i,n,o,a,c,"next",t)}function c(t){vt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function gt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||N("step");M(r,"replaceState")}));var bt,wt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(o,"-from-email")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),W(),w().skipStepButtons.forEach((function(t){B(t,U)})),w().backButtons.forEach((function(t){B(t,q)})),i=w().setupEmailStepButton,B(i,Z),n=w().saveLicenseButton,B(n,mt),r=w().installAddonsButton,B(r,nt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",gt)})),e=w().checkProInstallationButton,B(e,lt),t=w().skipProInstallationButton,B(t,pt)};bt=function(){wt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",bt):bt())}(); \ No newline at end of file diff --git a/js/src/onboarding-wizard/elements/getDOMElements.js b/js/src/onboarding-wizard/elements/getDOMElements.js index be469858ed..a4f56bf17c 100644 --- a/js/src/onboarding-wizard/elements/getDOMElements.js +++ b/js/src/onboarding-wizard/elements/getDOMElements.js @@ -44,6 +44,7 @@ function getDOMElements() { const emailStep = { setupEmailStepButton: document.getElementById( `${PREFIX}-setup-email-step-button` ), defaultEmailField: document.getElementById( `${PREFIX}-default-email-field` ), + defaultFromEmailField: document.getElementById( `${PREFIX}-from-email` ), subscribeCheckbox: document.getElementById( `${PREFIX}-subscribe` ), summaryEmailsCheckbox: document.getElementById( `${PREFIX}-summary-emails` ), allowTrackingCheckbox: document.getElementById( `${PREFIX}-allow-tracking` ) diff --git a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js index cddf2c36c1..ad2096f96d 100644 --- a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js +++ b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js @@ -26,12 +26,20 @@ function addSetupEmailStepButtonEvents() { * @return {void} */ const onSetupEmailStepButtonClick = async() => { - const { defaultEmailField } = getElements(); + const { defaultEmailField, defaultFromEmailField } = getElements(); const email = defaultEmailField.value.trim(); + let hasError = false; - // Check if the email is valid - if ( ! isValidEmail( email ) ) { - showEmailAddressError( 'invalid' ); + // Check if the emails are valid + [ defaultFromEmailField, defaultEmailField ].forEach( input => { + const emailAddress = input.value.trim(); + if ( ! isValidEmail( emailAddress ) ) { + showEmailAddressError( 'invalid', input ); + hasError = true; + } + }); + + if ( hasError ) { return; } @@ -63,6 +71,7 @@ const onSetupEmailStepButtonClick = async() => { // Prepare FormData for the POST request const formData = new FormData(); formData.append( 'default_email', email ); + formData.append( 'from_email', defaultFromEmailField.value.trim() ); formData.append( 'allows_tracking', allowTrackingCheckbox.checked ); formData.append( 'summary_emails', summaryEmailsCheckbox.checked ); diff --git a/js/src/onboarding-wizard/ui/showError.js b/js/src/onboarding-wizard/ui/showError.js index 5cf4d2aa5f..5a56ee9c78 100644 --- a/js/src/onboarding-wizard/ui/showError.js +++ b/js/src/onboarding-wizard/ui/showError.js @@ -10,6 +10,6 @@ import { showFormError } from '../utils'; * @param {string} type The categorization of the error (e.g., "invalid", "empty"). * @return {void} */ -export const showEmailAddressError = type => { - showFormError( `#${PREFIX}-default-email-field`, `#${PREFIX}-email-step-error`, type ); +export const showEmailAddressError = ( type, input ) => { + showFormError( '#' + input.id, '#' + input.nextElementSibling.id, type ); }; From b42ed9d34990d9986395f1de0ef19ddb28341ecc Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:12:55 +0700 Subject: [PATCH 05/13] Use sanitize_email() for email --- classes/controllers/FrmOnboardingWizardController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 38c73b065d..320f317124 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -274,8 +274,8 @@ public static function ajax_setup_email_step() { check_ajax_referer( 'frm_ajax', 'nonce' ); // Get posted data. - $from_email = FrmAppHelper::get_post_param( 'from_email', '', 'sanitize_text_field' ); - $default_email = FrmAppHelper::get_post_param( 'default_email', '', 'sanitize_text_field' ); + $from_email = FrmAppHelper::get_post_param( 'from_email', '', 'sanitize_email' ); + $default_email = FrmAppHelper::get_post_param( 'default_email', '', 'sanitize_email' ); $allows_tracking = FrmAppHelper::get_post_param( 'allows_tracking', '', 'rest_sanitize_boolean' ); $summary_emails = FrmAppHelper::get_post_param( 'summary_emails', '', 'rest_sanitize_boolean' ); From 0f5c29a1b4cb8bd88e974a522f96c688741e075a Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:15:05 +0700 Subject: [PATCH 06/13] Use tab for indentation --- .../steps/default-email-address-step.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/classes/views/onboarding-wizard/steps/default-email-address-step.php b/classes/views/onboarding-wizard/steps/default-email-address-step.php index 1927f2eed1..d2c5b2341e 100644 --- a/classes/views/onboarding-wizard/steps/default-email-address-step.php +++ b/classes/views/onboarding-wizard/steps/default-email-address-step.php @@ -23,9 +23,9 @@

-

- - +

+ + -

+

- 'frm-onboarding-email-step-error', 'errors' => array( @@ -51,8 +51,8 @@ 'empty' => __( 'Email is empty', 'formidable' ), ), ) - ); - ?> + ); + ?>

From 6d827d54ea429c6f024f5218ac9a04aa59aecf0f Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:20:50 +0700 Subject: [PATCH 07/13] Move some JS code --- .../onboarding-wizard/events/setupEmailStepButtonListener.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js index ad2096f96d..4db201508f 100644 --- a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js +++ b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js @@ -22,12 +22,11 @@ function addSetupEmailStepButtonEvents() { * Handles the click event on the "Next Step" button in the "Default Email Address" step. * * @private - * @param {Event} event The click event object. + * * @return {void} */ const onSetupEmailStepButtonClick = async() => { const { defaultEmailField, defaultFromEmailField } = getElements(); - const email = defaultEmailField.value.trim(); let hasError = false; // Check if the emails are valid @@ -44,6 +43,7 @@ const onSetupEmailStepButtonClick = async() => { } const { subscribeCheckbox, summaryEmailsCheckbox, allowTrackingCheckbox } = getElements(); + const email = defaultEmailField.value.trim(); // Check if the 'subscribe' checkbox is selected. If so, proceed to add the user's email to the active campaign if ( subscribeCheckbox?.checked ) { From 5b981302f31d53d215466bedfc0230780fe54be7 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:26:58 +0700 Subject: [PATCH 08/13] Refactor validate emails code in onboarding wizard --- .../events/setupEmailStepButtonListener.js | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js index 4db201508f..49fb4d68bc 100644 --- a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js +++ b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js @@ -18,6 +18,17 @@ function addSetupEmailStepButtonEvents() { onClickPreventDefault( setupEmailStepButton, onSetupEmailStepButtonClick ); } +const validateEmails = emailInputs => { + return emailInputs.every( input => { + const emailAddress = input.value.trim(); + if ( ! isValidEmail( emailAddress ) ) { + showEmailAddressError( 'invalid', input ); + return false; + } + return true; + }); +}; + /** * Handles the click event on the "Next Step" button in the "Default Email Address" step. * @@ -27,18 +38,9 @@ function addSetupEmailStepButtonEvents() { */ const onSetupEmailStepButtonClick = async() => { const { defaultEmailField, defaultFromEmailField } = getElements(); - let hasError = false; // Check if the emails are valid - [ defaultFromEmailField, defaultEmailField ].forEach( input => { - const emailAddress = input.value.trim(); - if ( ! isValidEmail( emailAddress ) ) { - showEmailAddressError( 'invalid', input ); - hasError = true; - } - }); - - if ( hasError ) { + if ( ! validateEmails( [ defaultFromEmailField, defaultEmailField ] ) ) { return; } From 994138c336d2fbc9fccf606e60c977e2909adaef Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:28:35 +0700 Subject: [PATCH 09/13] Add from_email to onboarding app state --- js/src/onboarding-wizard/events/setupEmailStepButtonListener.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js index 49fb4d68bc..fe46b3a5b7 100644 --- a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js +++ b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js @@ -63,6 +63,7 @@ const onSetupEmailStepButtonClick = async() => { // Capture usage data const { emailStepData } = getAppState(); emailStepData.default_email = email; + emailStepData.from_email = defaultFromEmailField.value.trim(); emailStepData.allows_tracking = allowTrackingCheckbox.checked; emailStepData.summary_emails = summaryEmailsCheckbox.checked; if ( subscribeCheckbox ) { From 0d253ec79a9049f817c5e0c7a53f8fdc654e38fb Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:30:26 +0700 Subject: [PATCH 10/13] Add doc comment --- js/onboarding-wizard.js | 2 +- js/src/onboarding-wizard/ui/showError.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/onboarding-wizard.js b/js/onboarding-wizard.js index 328e3b37f7..d5c87d8ddd 100644 --- a/js/onboarding-wizard.js +++ b/js/onboarding-wizard.js @@ -1,2 +1,2 @@ /*! For license information please see onboarding-wizard.js.LICENSE.txt */ -!function(){"use strict";var t=window.frmGlobal.nonce,e=window.frmOnboardingWizardVars,r=e.INITIAL_STEP,n=e.proIsIncluded,o="frm-onboarding",i="frm-current",a="".concat(o,"-welcome-step"),c={INITIAL:r,DEFAULT_EMAIL_ADDRESS:"default-email-address",INSTALL_FORMIDABLE_PRO:"install-formidable-pro",LICENSE_MANAGEMENT:"license-management",INSTALL_ADDONS:"install-addons",SUCCESS:"success"};function u(t){return u="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},u(t)}function l(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 s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):0()\[\]\\.,;:\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,}))$/i.test(t)};function P(t){return P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},P(t)}var I=new URL(window.location.href),T=I.searchParams,N=function(t){return T.get(t)},F=function(t){return T.delete(t),I.search=T.toString(),I.toString()},D=function(t,e){var r,n,o,i,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pushState";if(T.set(t,e),I.search=T.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=P(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=P(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==P(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",I)}return I.toString()},B=window.frmDom.util.onClickPreventDefault;function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},M=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),D("step",t,e)}},R=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),C(r,n),M(n)}},U=function(){R()},q=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&M(e.dataset.stepName)},z=window.frmDom.span;function Y(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function V(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var Z=function(){var t,e=(t=J().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f,h;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,n=e.defaultFromEmailField,o=r.value.trim(),i=!1,[n,r].forEach((function(t){var e=t.value.trim();A(e)||(K("invalid",t),i=!0)})),!i){t.next=6;break}return t.abrupt("return");case 6:a=w(),c=a.subscribeCheckbox,u=a.summaryEmailsCheckbox,l=a.allowTrackingCheckbox,null!=c&&c.checked&&(o&&(document.getElementById("frm_leave_email").value=o),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),s=y(),(f=s.emailStepData).default_email=o,f.allows_tracking=l.checked,f.summary_emails=u.checked,c&&(f.is_subscribed=c.checked),d("emailStepData",f),(h=new FormData).append("default_email",o),h.append("from_email",n.value.trim()),h.append("allows_tracking",l.checked),h.append("summary_emails",u.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",h).then(R);case 21:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){V(i,n,o,a,c,"next",t)}function c(t){V(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function H(t){return H="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},H(t)}function Q(){Q=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==H(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function X(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 tt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tt(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function tt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ut(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var lt=function(){var e,r=(e=ct().mark((function e(){var r,n,o,i,a;return ct().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return R(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ut(i,n,o,a,c,"next",t)}function c(t){ut(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function st(t){return st="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},st(t)}function ft(){ft=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==st(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ht(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var pt=function(){var t,e=(t=ft().mark((function t(){return ft().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ht(i,n,o,a,c,"next",t)}function c(t){ht(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function yt(t){return yt="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},yt(t)}function dt(){dt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==yt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function vt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var mt=function(){var t,e=(t=dt().mark((function t(){return dt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=D("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){vt(i,n,o,a,c,"next",t)}function c(t){vt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function gt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||N("step");M(r,"replaceState")}));var bt,wt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(o,"-from-email")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),W(),w().skipStepButtons.forEach((function(t){B(t,U)})),w().backButtons.forEach((function(t){B(t,q)})),i=w().setupEmailStepButton,B(i,Z),n=w().saveLicenseButton,B(n,mt),r=w().installAddonsButton,B(r,nt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",gt)})),e=w().checkProInstallationButton,B(e,lt),t=w().skipProInstallationButton,B(t,pt)};bt=function(){wt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",bt):bt())}(); \ No newline at end of file +!function(){"use strict";var t=window.frmGlobal.nonce,e=window.frmOnboardingWizardVars,r=e.INITIAL_STEP,n=e.proIsIncluded,o="frm-onboarding",i="frm-current",a="".concat(o,"-welcome-step"),c={INITIAL:r,DEFAULT_EMAIL_ADDRESS:"default-email-address",INSTALL_FORMIDABLE_PRO:"install-formidable-pro",LICENSE_MANAGEMENT:"license-management",INSTALL_ADDONS:"install-addons",SUCCESS:"success"};function u(t){return u="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},u(t)}function l(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 s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):02&&void 0!==arguments[2]?arguments[2]:"pushState";if(I.set(t,e),P.search=I.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==A(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",P)}return P.toString()},D=window.frmDom.util.onClickPreventDefault;function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),F("step",t,e)}},M=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),G(r,n),C(n)}},R=function(){M()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&C(e.dataset.stepName)},q=window.frmDom.span;function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function J(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var V=function(){var t,e=(t=$().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f;return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,[n=e.defaultFromEmailField,r].every((function(t){var e;return!("string"!=typeof(e=t.value.trim())||!/^(([^<>()\[\]\\.,;:\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,}))$/i.test(e))||(W("invalid",t),!1)}))){t.next=3;break}return t.abrupt("return");case 3:o=w(),i=o.subscribeCheckbox,a=o.summaryEmailsCheckbox,c=o.allowTrackingCheckbox,u=r.value.trim(),null!=i&&i.checked&&(u&&(document.getElementById("frm_leave_email").value=u),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),l=y(),(s=l.emailStepData).default_email=u,s.from_email=n.value.trim(),s.allows_tracking=c.checked,s.summary_emails=a.checked,i&&(s.is_subscribed=i.checked),d("emailStepData",s),(f=new FormData).append("default_email",u),f.append("from_email",n.value.trim()),f.append("allows_tracking",c.checked),f.append("summary_emails",a.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",f).then(M);case 20:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){J(i,n,o,a,c,"next",t)}function c(t){J(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function Z(t){return Z="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},Z(t)}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q(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 X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ut=function(){var e,r=(e=at().mark((function e(){var r,n,o,i,a;return at().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return M(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ct(i,n,o,a,c,"next",t)}function c(t){ct(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function lt(t){return lt="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},lt(t)}function st(){st=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==lt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ht=function(){var t,e=(t=st().mark((function t(){return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function pt(t){return pt="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},pt(t)}function yt(){yt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function dt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var vt=function(){var t,e=(t=yt().mark((function t(){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=F("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,c,"next",t)}function c(t){dt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function mt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||T("step");C(r,"replaceState")}));var gt,bt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(o,"-from-email")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),Y(),w().skipStepButtons.forEach((function(t){D(t,R)})),w().backButtons.forEach((function(t){D(t,U)})),i=w().setupEmailStepButton,D(i,V),n=w().saveLicenseButton,D(n,vt),r=w().installAddonsButton,D(r,rt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",mt)})),e=w().checkProInstallationButton,D(e,ut),t=w().skipProInstallationButton,D(t,ht)};gt=function(){bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",gt):gt())}(); \ No newline at end of file diff --git a/js/src/onboarding-wizard/ui/showError.js b/js/src/onboarding-wizard/ui/showError.js index 5a56ee9c78..2d0adafe99 100644 --- a/js/src/onboarding-wizard/ui/showError.js +++ b/js/src/onboarding-wizard/ui/showError.js @@ -1,13 +1,15 @@ /** * Internal dependencies */ -import { PREFIX } from '../shared'; import { showFormError } from '../utils'; /** * Displays errors related to the email address field. * - * @param {string} type The categorization of the error (e.g., "invalid", "empty"). + * @since x.x Added the `input` param. + * + * @param {string} type The categorization of the error (e.g., "invalid", "empty"). + * @param {HTMLInputElement} input The input element to which the error is related. * @return {void} */ export const showEmailAddressError = ( type, input ) => { From be99f68e9df6c62f396915c05de0873af6c24825 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:33:16 +0700 Subject: [PATCH 11/13] Improve onboarding emails validation --- js/onboarding-wizard.js | 2 +- .../events/setupEmailStepButtonListener.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/js/onboarding-wizard.js b/js/onboarding-wizard.js index d5c87d8ddd..104e11fb27 100644 --- a/js/onboarding-wizard.js +++ b/js/onboarding-wizard.js @@ -1,2 +1,2 @@ /*! For license information please see onboarding-wizard.js.LICENSE.txt */ -!function(){"use strict";var t=window.frmGlobal.nonce,e=window.frmOnboardingWizardVars,r=e.INITIAL_STEP,n=e.proIsIncluded,o="frm-onboarding",i="frm-current",a="".concat(o,"-welcome-step"),c={INITIAL:r,DEFAULT_EMAIL_ADDRESS:"default-email-address",INSTALL_FORMIDABLE_PRO:"install-formidable-pro",LICENSE_MANAGEMENT:"license-management",INSTALL_ADDONS:"install-addons",SUCCESS:"success"};function u(t){return u="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},u(t)}function l(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 s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):02&&void 0!==arguments[2]?arguments[2]:"pushState";if(I.set(t,e),P.search=I.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==A(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",P)}return P.toString()},D=window.frmDom.util.onClickPreventDefault;function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),F("step",t,e)}},M=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),G(r,n),C(n)}},R=function(){M()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&C(e.dataset.stepName)},q=window.frmDom.span;function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function J(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var V=function(){var t,e=(t=$().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f;return $().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,[n=e.defaultFromEmailField,r].every((function(t){var e;return!("string"!=typeof(e=t.value.trim())||!/^(([^<>()\[\]\\.,;:\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,}))$/i.test(e))||(W("invalid",t),!1)}))){t.next=3;break}return t.abrupt("return");case 3:o=w(),i=o.subscribeCheckbox,a=o.summaryEmailsCheckbox,c=o.allowTrackingCheckbox,u=r.value.trim(),null!=i&&i.checked&&(u&&(document.getElementById("frm_leave_email").value=u),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),l=y(),(s=l.emailStepData).default_email=u,s.from_email=n.value.trim(),s.allows_tracking=c.checked,s.summary_emails=a.checked,i&&(s.is_subscribed=i.checked),d("emailStepData",s),(f=new FormData).append("default_email",u),f.append("from_email",n.value.trim()),f.append("allows_tracking",c.checked),f.append("summary_emails",a.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",f).then(M);case 20:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){J(i,n,o,a,c,"next",t)}function c(t){J(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function Z(t){return Z="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},Z(t)}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q(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 X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ut=function(){var e,r=(e=at().mark((function e(){var r,n,o,i,a;return at().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return M(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ct(i,n,o,a,c,"next",t)}function c(t){ct(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function lt(t){return lt="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},lt(t)}function st(){st=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==lt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ht=function(){var t,e=(t=st().mark((function t(){return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function pt(t){return pt="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},pt(t)}function yt(){yt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function dt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var vt=function(){var t,e=(t=yt().mark((function t(){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=F("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,c,"next",t)}function c(t){dt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function mt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||T("step");C(r,"replaceState")}));var gt,bt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(o,"-from-email")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),Y(),w().skipStepButtons.forEach((function(t){D(t,R)})),w().backButtons.forEach((function(t){D(t,U)})),i=w().setupEmailStepButton,D(i,V),n=w().saveLicenseButton,D(n,vt),r=w().installAddonsButton,D(r,rt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",mt)})),e=w().checkProInstallationButton,D(e,ut),t=w().skipProInstallationButton,D(t,ht)};gt=function(){bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",gt):gt())}(); \ No newline at end of file +!function(){"use strict";var t=window.frmGlobal.nonce,e=window.frmOnboardingWizardVars,r=e.INITIAL_STEP,n=e.proIsIncluded,o="frm-onboarding",i="frm-current",a="".concat(o,"-welcome-step"),c={INITIAL:r,DEFAULT_EMAIL_ADDRESS:"default-email-address",INSTALL_FORMIDABLE_PRO:"install-formidable-pro",LICENSE_MANAGEMENT:"license-management",INSTALL_ADDONS:"install-addons",SUCCESS:"success"};function u(t){return u="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},u(t)}function l(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 s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):02&&void 0!==arguments[2]?arguments[2]:"pushState";if(I.set(t,e),P.search=I.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==A(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",P)}return P.toString()},D=window.frmDom.util.onClickPreventDefault;function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),F("step",t,e)}},M=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),G(r,n),C(n)}},R=function(){M()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&C(e.dataset.stepName)},q=window.frmDom.span;function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function $(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var J=function(t){var e=!0;return t.forEach((function(t){var r;"string"==typeof(r=t.value.trim())&&/^(([^<>()\[\]\\.,;:\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,}))$/i.test(r)||(function(t,e){!function(t,e,r,n){var o=document.querySelector(t),i=document.querySelector(e);o&&i?(i.setAttribute("frm-error",r),S(i),o.addEventListener("keyup",(function(){L(i)}),{once:!0})):console.warn("showFormError: Unable to find input or error element.")}("#"+e.id,"#"+e.nextElementSibling.id,t)}("invalid",t),e=!1)})),e},V=function(){var t,e=(t=K().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,n=e.defaultFromEmailField,J([n,r])){t.next=3;break}return t.abrupt("return");case 3:o=w(),i=o.subscribeCheckbox,a=o.summaryEmailsCheckbox,c=o.allowTrackingCheckbox,u=r.value.trim(),null!=i&&i.checked&&(u&&(document.getElementById("frm_leave_email").value=u),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),l=y(),(s=l.emailStepData).default_email=u,s.from_email=n.value.trim(),s.allows_tracking=c.checked,s.summary_emails=a.checked,i&&(s.is_subscribed=i.checked),d("emailStepData",s),(f=new FormData).append("default_email",u),f.append("from_email",n.value.trim()),f.append("allows_tracking",c.checked),f.append("summary_emails",a.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",f).then(M);case 20:case"end":return t.stop()}}),t)})),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,c,"next",t)}function c(t){$(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function Z(t){return Z="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},Z(t)}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q(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 X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ut=function(){var e,r=(e=at().mark((function e(){var r,n,o,i,a;return at().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return M(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ct(i,n,o,a,c,"next",t)}function c(t){ct(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function lt(t){return lt="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},lt(t)}function st(){st=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==lt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ht=function(){var t,e=(t=st().mark((function t(){return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function pt(t){return pt="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},pt(t)}function yt(){yt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function dt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var vt=function(){var t,e=(t=yt().mark((function t(){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=F("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,c,"next",t)}function c(t){dt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function mt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||T("step");C(r,"replaceState")}));var gt,bt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(o,"-from-email")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),Y(),w().skipStepButtons.forEach((function(t){D(t,R)})),w().backButtons.forEach((function(t){D(t,U)})),i=w().setupEmailStepButton,D(i,V),n=w().saveLicenseButton,D(n,vt),r=w().installAddonsButton,D(r,rt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",mt)})),e=w().checkProInstallationButton,D(e,ut),t=w().skipProInstallationButton,D(t,ht)};gt=function(){bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",gt):gt())}(); \ No newline at end of file diff --git a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js index fe46b3a5b7..5ac10d756f 100644 --- a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js +++ b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js @@ -19,14 +19,15 @@ function addSetupEmailStepButtonEvents() { } const validateEmails = emailInputs => { - return emailInputs.every( input => { + let isValid = true; + emailInputs.forEach( input => { const emailAddress = input.value.trim(); if ( ! isValidEmail( emailAddress ) ) { showEmailAddressError( 'invalid', input ); - return false; + isValid = false; } - return true; }); + return isValid; }; /** From ed98bb64b3163d58456dd83fc2050eb880ce2f17 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 17:35:21 +0700 Subject: [PATCH 12/13] Use template literal --- js/onboarding-wizard.js | 2 +- js/src/onboarding-wizard/ui/showError.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/onboarding-wizard.js b/js/onboarding-wizard.js index 104e11fb27..974f233f5a 100644 --- a/js/onboarding-wizard.js +++ b/js/onboarding-wizard.js @@ -1,2 +1,2 @@ /*! For license information please see onboarding-wizard.js.LICENSE.txt */ -!function(){"use strict";var t=window.frmGlobal.nonce,e=window.frmOnboardingWizardVars,r=e.INITIAL_STEP,n=e.proIsIncluded,o="frm-onboarding",i="frm-current",a="".concat(o,"-welcome-step"),c={INITIAL:r,DEFAULT_EMAIL_ADDRESS:"default-email-address",INSTALL_FORMIDABLE_PRO:"install-formidable-pro",LICENSE_MANAGEMENT:"license-management",INSTALL_ADDONS:"install-addons",SUCCESS:"success"};function u(t){return u="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},u(t)}function l(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 s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):02&&void 0!==arguments[2]?arguments[2]:"pushState";if(I.set(t,e),P.search=I.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==A(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",P)}return P.toString()},D=window.frmDom.util.onClickPreventDefault;function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),F("step",t,e)}},M=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),G(r,n),C(n)}},R=function(){M()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&C(e.dataset.stepName)},q=window.frmDom.span;function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function $(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var J=function(t){var e=!0;return t.forEach((function(t){var r;"string"==typeof(r=t.value.trim())&&/^(([^<>()\[\]\\.,;:\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,}))$/i.test(r)||(function(t,e){!function(t,e,r,n){var o=document.querySelector(t),i=document.querySelector(e);o&&i?(i.setAttribute("frm-error",r),S(i),o.addEventListener("keyup",(function(){L(i)}),{once:!0})):console.warn("showFormError: Unable to find input or error element.")}("#"+e.id,"#"+e.nextElementSibling.id,t)}("invalid",t),e=!1)})),e},V=function(){var t,e=(t=K().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,n=e.defaultFromEmailField,J([n,r])){t.next=3;break}return t.abrupt("return");case 3:o=w(),i=o.subscribeCheckbox,a=o.summaryEmailsCheckbox,c=o.allowTrackingCheckbox,u=r.value.trim(),null!=i&&i.checked&&(u&&(document.getElementById("frm_leave_email").value=u),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),l=y(),(s=l.emailStepData).default_email=u,s.from_email=n.value.trim(),s.allows_tracking=c.checked,s.summary_emails=a.checked,i&&(s.is_subscribed=i.checked),d("emailStepData",s),(f=new FormData).append("default_email",u),f.append("from_email",n.value.trim()),f.append("allows_tracking",c.checked),f.append("summary_emails",a.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",f).then(M);case 20:case"end":return t.stop()}}),t)})),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,c,"next",t)}function c(t){$(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function Z(t){return Z="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},Z(t)}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q(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 X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ut=function(){var e,r=(e=at().mark((function e(){var r,n,o,i,a;return at().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return M(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ct(i,n,o,a,c,"next",t)}function c(t){ct(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function lt(t){return lt="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},lt(t)}function st(){st=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==lt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ht=function(){var t,e=(t=st().mark((function t(){return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function pt(t){return pt="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},pt(t)}function yt(){yt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function dt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var vt=function(){var t,e=(t=yt().mark((function t(){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=F("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,c,"next",t)}function c(t){dt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function mt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||T("step");C(r,"replaceState")}));var gt,bt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(o,"-from-email")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),Y(),w().skipStepButtons.forEach((function(t){D(t,R)})),w().backButtons.forEach((function(t){D(t,U)})),i=w().setupEmailStepButton,D(i,V),n=w().saveLicenseButton,D(n,vt),r=w().installAddonsButton,D(r,rt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",mt)})),e=w().checkProInstallationButton,D(e,ut),t=w().skipProInstallationButton,D(t,ht)};gt=function(){bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",gt):gt())}(); \ No newline at end of file +!function(){"use strict";var t=window.frmGlobal.nonce,e=window.frmOnboardingWizardVars,r=e.INITIAL_STEP,n=e.proIsIncluded,o="frm-onboarding",i="frm-current",a="".concat(o,"-welcome-step"),c={INITIAL:r,DEFAULT_EMAIL_ADDRESS:"default-email-address",INSTALL_FORMIDABLE_PRO:"install-formidable-pro",LICENSE_MANAGEMENT:"license-management",INSTALL_ADDONS:"install-addons",SUCCESS:"success"};function u(t){return u="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},u(t)}function l(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 s(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"default";!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.elements=e,this.type=r,this.prepareElements()}var e,r;return e=t,r=[{key:"fadeIn",value:function(){var t=this;this.applyStyleToElements((function(e){e.classList.add("frm-fadein-up"),e.addEventListener("animationend",(function(){t.resetOpacity(),e.classList.remove("frm-fadein-up")}),{once:!0})}))}},{key:"cascadeFadeIn",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.03;setTimeout((function(){t.applyStyleToElements((function(t,r){t.classList.remove("frm-animate"),t.style.transitionDelay=(r+1)*e+"s"}))}),200)}},{key:"prepareElements",value:function(){var t=this;this.applyStyleToElements((function(e){"default"===t.type&&(e.style.opacity="0.0"),"cascade"===t.type&&e.classList.add("frm-init-cascade-animation"),"cascade-3d"===t.type&&e.classList.add("frm-init-fadein-3d"),e.classList.add("frm-animate")}))}},{key:"resetOpacity",value:function(){this.applyStyleToElements((function(t){return t.style.opacity="1.0"}))}},{key:"applyStyleToElements",value:function(t){this.elements instanceof Element?t(this.elements,0):02&&void 0!==arguments[2]?arguments[2]:"pushState";if(I.set(t,e),P.search=I.toString(),["pushState","replaceState"].includes(a)){var c=(r={},o=e,i=function(t,e){if("object"!=A(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,"string");if("object"!=A(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(n=t),(n="symbol"==A(i)?i:String(i))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[a](c,"",P)}return P.toString()},D=window.frmDom.util.onClickPreventDefault;function B(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(c.SUCCESS)||a.push(c.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(c.DEFAULT_EMAIL_ADDRESS===t){var u=y().emailStepData;if(i=u,0!==Object.keys(i).length||i.constructor!==Object){var l;r=null!==(l=r)&&void 0!==l?l:new FormData;for(var s=0,f=Object.entries(u);s0&&(r=null!==(v=r)&&void 0!==v?v:new FormData).append("installed_addons",m.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)},C=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",r=document.querySelector(".".concat(o,'-step[data-step-name="').concat(t,'"]'));if(r){var n=document.querySelector(".".concat(o,"-step.").concat(i));n&&(n.classList.remove(i),L(n)),r.classList.add(i),S(r),new j(r).fadeIn(),w().onboardingWizardPage.setAttribute("data-current-step",t),F("step",t,e)}},M=function(){var t=document.querySelector(".".concat(o,"-step.").concat(i)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,a=y().processedSteps;a.includes(r)||(a.push(r),d("processedSteps",a)),G(r,n),C(n)}},R=function(){M()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(o,"-step.").concat(i)))?void 0:t.previousElementSibling)&&C(e.dataset.stepName)},q=window.frmDom.span;function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function $(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var J=function(t){var e=!0;return t.forEach((function(t){var r;"string"==typeof(r=t.value.trim())&&/^(([^<>()\[\]\\.,;:\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,}))$/i.test(r)||(function(t,e){!function(t,e,r,n){var o=document.querySelector(t),i=document.querySelector(e);o&&i?(i.setAttribute("frm-error",r),S(i),o.addEventListener("keyup",(function(){L(i)}),{once:!0})):console.warn("showFormError: Unable to find input or error element.")}("#".concat(e.id),"#".concat(e.nextElementSibling.id),t)}("invalid",t),e=!1)})),e},V=function(){var t,e=(t=K().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f;return K().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=w(),r=e.defaultEmailField,n=e.defaultFromEmailField,J([n,r])){t.next=3;break}return t.abrupt("return");case 3:o=w(),i=o.subscribeCheckbox,a=o.summaryEmailsCheckbox,c=o.allowTrackingCheckbox,u=r.value.trim(),null!=i&&i.checked&&(u&&(document.getElementById("frm_leave_email").value=u),frmAdminBuild.addMyEmailAddress(),wp.hooks.addFilter("frm_thank_you_on_signup","frmOnboardingWizard",(function(){return!1}))),l=y(),(s=l.emailStepData).default_email=u,s.from_email=n.value.trim(),s.allows_tracking=c.checked,s.summary_emails=a.checked,i&&(s.is_subscribed=i.checked),d("emailStepData",s),(f=new FormData).append("default_email",u),f.append("from_email",n.value.trim()),f.append("allows_tracking",c.checked),f.append("summary_emails",a.checked),(0,frmDom.ajax.doJsonPost)("onboarding_setup_email_step",f).then(M);case 20:case"end":return t.stop()}}),t)})),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,c,"next",t)}function c(t){$(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function Z(t){return Z="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},Z(t)}function H(){H=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==Z(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function Q(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 X(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?X(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,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw i}}}}function X(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ct(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ut=function(){var e,r=(e=at().mark((function e(){var r,n,o,i,a;return at().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("action","frm_check_plugin_activation"),r.append("nonce",t),r.append("plugin_path","formidable-pro/formidable-pro.php"),e.prev=4,e.next=7,fetch(ajaxurl,{method:"POST",body:r});case 7:return o=e.sent,e.next=10,o.json();case 10:n=e.sent,e.next=17;break;case 13:return e.prev=13,e.t0=e.catch(4),console.error("An error occurred:",e.t0),e.abrupt("return");case 17:if(!n.success){e.next=20;break}return M(),e.abrupt("return");case 20:i=w(),a=i.checkProInstallationError,S(a);case 22:case"end":return e.stop()}}),e,null,[[4,13]])})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){ct(i,n,o,a,c,"next",t)}function c(t){ct(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return r.apply(this,arguments)}}();function lt(t){return lt="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},lt(t)}function st(){st=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==lt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function ft(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var ht=function(){var t,e=(t=st().mark((function t(){return st().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:C(c.DEFAULT_EMAIL_ADDRESS);case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ft(i,n,o,a,c,"next",t)}function c(t){ft(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function pt(t){return pt="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},pt(t)}function yt(){yt=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),c=new P(n||[]);return o(a,"_invoke",{value:O(t,r,c)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=s;var h="suspendedStart",p="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var E=Object.getPrototypeOf,S=E&&E(E(I([])));S&&S!==r&&n.call(S,a)&&(w=S);var L=b.prototype=m.prototype=Object.create(w);function x(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,c){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,s=l.value;return s&&"object"==pt(s)&&n.call(s,"__await")?e.resolve(s.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(s).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var o=h;return function(i,a){if(o===y)throw new Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===h)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?d:p,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function j(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,j(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function I(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:I(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function dt(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}var vt=function(){var t,e=(t=yt().mark((function t(){return yt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:wp.hooks.addAction("frm_after_authorize","frmOnboardingWizard",(function(t){return!0===t.success&&(window.location.href=F("step",c.DEFAULT_EMAIL_ADDRESS,"replaceState")),t}));case 1:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,c,"next",t)}function c(t){dt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function mt(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(".frm-option-box").classList.toggle("frm-checked")}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||T("step");C(r,"replaceState")}));var gt,bt=function(){var t,e,r,n,i,c,u,l,s,f,h,y;c={onboardingWizardPage:document.getElementById("".concat(o,"-wizard-page")),pageBackground:document.getElementById("".concat(o,"-bg")),container:document.getElementById("".concat(o,"-container")),steps:document.querySelectorAll(".".concat(o,"-step")),skipStepButtons:document.querySelectorAll(".".concat(o,"-skip-step")),backButtons:document.querySelectorAll(".".concat(o,"-back-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")},u={welcomeStep:document.getElementById(a)},l={installFormidableProStep:document.getElementById("".concat(o,"-install-formidable-pro-step")),checkProInstallationButton:document.getElementById("".concat(o,"-check-pro-installation-button")),skipProInstallationButton:document.getElementById("".concat(o,"-skip-pro-installation-button")),checkProInstallationError:document.getElementById("".concat(o,"-check-pro-installation-error"))},s={licenseManagementStep:document.getElementById("".concat(o,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(o,"-save-license-button"))},f={setupEmailStepButton:document.getElementById("".concat(o,"-setup-email-step-button")),defaultEmailField:document.getElementById("".concat(o,"-default-email-field")),defaultFromEmailField:document.getElementById("".concat(o,"-from-email")),subscribeCheckbox:document.getElementById("".concat(o,"-subscribe")),summaryEmailsCheckbox:document.getElementById("".concat(o,"-summary-emails")),allowTrackingCheckbox:document.getElementById("".concat(o,"-allow-tracking"))},h={installAddonsButton:document.getElementById("".concat(o,"-install-addons-button"))},y={successStep:document.getElementById("".concat(o,"-success-step"))},b=g(g(g(g(g(g(g({},c),l),s),u),f),h),y),p(),Y(),w().skipStepButtons.forEach((function(t){D(t,R)})),w().backButtons.forEach((function(t){D(t,U)})),i=w().setupEmailStepButton,D(i,V),n=w().saveLicenseButton,D(n,vt),r=w().installAddonsButton,D(r,rt),document.querySelectorAll(".frm-option-box").forEach((function(t){t.addEventListener("click",mt)})),e=w().checkProInstallationButton,D(e,ut),t=w().skipProInstallationButton,D(t,ht)};gt=function(){bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",gt):gt())}(); \ No newline at end of file diff --git a/js/src/onboarding-wizard/ui/showError.js b/js/src/onboarding-wizard/ui/showError.js index 2d0adafe99..267bba13d4 100644 --- a/js/src/onboarding-wizard/ui/showError.js +++ b/js/src/onboarding-wizard/ui/showError.js @@ -13,5 +13,5 @@ import { showFormError } from '../utils'; * @return {void} */ export const showEmailAddressError = ( type, input ) => { - showFormError( '#' + input.id, '#' + input.nextElementSibling.id, type ); + showFormError( `#${input.id}`, `#${input.nextElementSibling.id}`, type ); }; From ccde00c5efbb9761d2cb78fd8fc9d5997ec50233 Mon Sep 17 00:00:00 2001 From: Truong Giang Date: Fri, 13 Sep 2024 23:05:47 +0700 Subject: [PATCH 13/13] Reuse print_setting_error() method and move it to FrmAppHelper --- classes/helpers/FrmAppHelper.php | 37 +++++++++++++++++++ classes/helpers/FrmOnboardingWizardHelper.php | 17 --------- .../modals/code-from-email-modal.php | 18 ++++++--- .../modals/leave-email-modal.php | 16 ++++++-- .../steps/default-email-address-step.php | 4 +- .../steps/install-formidable-pro-step.php | 11 ++++-- 6 files changed, 72 insertions(+), 31 deletions(-) diff --git a/classes/helpers/FrmAppHelper.php b/classes/helpers/FrmAppHelper.php index 6dc5ee6ee8..ce7106db4a 100644 --- a/classes/helpers/FrmAppHelper.php +++ b/classes/helpers/FrmAppHelper.php @@ -4325,4 +4325,41 @@ public static function tooltip_icon( $tooltip_text, $atts = array() ) { '', + 'errors' => array(), + 'class' => '', + ) + ); + + $args['class'] .= ' frm-validation-error frm-mt-xs frm_hidden'; + ?> + + $msg ) { + ?> + + ' . esc_html( $args['errors'] ) . ''; + } + ?> + + '', - 'errors' => array(), - ) - ); - ?> - - $msg ) : ?> - - - - - - - - - + 'frm_code_from_email_error', + 'errors' => array( + 'custom' => '', + 'invalid' => __( 'Verification code is wrong', 'formidable' ), + 'empty' => __( 'Verification code is empty', 'formidable' ), + ), + 'class' => 'frm-justify-center frm-items-center', + ) + ); + ?>
diff --git a/classes/views/form-templates/modals/leave-email-modal.php b/classes/views/form-templates/modals/leave-email-modal.php index ad849fcf97..15447f6ed4 100644 --- a/classes/views/form-templates/modals/leave-email-modal.php +++ b/classes/views/form-templates/modals/leave-email-modal.php @@ -50,10 +50,18 @@ - - - - + 'frm_leave_email_error', + 'errors' => array( + 'invalid' => __( 'Email is invalid', 'formidable' ), + 'empty' => __( 'Email is empty', 'formidable' ), + ), + 'class' => 'frm-justify-center frm-items-center', + ) + ); + ?>
diff --git a/classes/views/onboarding-wizard/steps/default-email-address-step.php b/classes/views/onboarding-wizard/steps/default-email-address-step.php index d2c5b2341e..f25ddd1651 100644 --- a/classes/views/onboarding-wizard/steps/default-email-address-step.php +++ b/classes/views/onboarding-wizard/steps/default-email-address-step.php @@ -27,7 +27,7 @@ 'frm-onboarding-from-email-error', 'errors' => array( @@ -43,7 +43,7 @@ 'frm-onboarding-email-step-error', 'errors' => array( diff --git a/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php b/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php index bd5206a79a..d604df42b3 100644 --- a/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php +++ b/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php @@ -37,9 +37,14 @@
- - - + 'frm-onboarding-check-pro-installation-error', + 'errors' => __( 'Formidable Pro is currently inactive!', 'formidable' ), + ) + ); + ?>