From 0e9f573d888ba1bac31365c08a3408e5f57c5c1b Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 10 Oct 2024 19:54:20 +0300 Subject: [PATCH 01/24] Add "consent-tracking" step --- .../FrmOnboardingWizardController.php | 3 +- classes/helpers/FrmOnboardingWizardHelper.php | 4 +- classes/views/onboarding-wizard/footer.php | 2 +- classes/views/onboarding-wizard/index.php | 8 +--- .../steps/consent-tracking-step.php | 35 ++++++++++++++ .../onboarding-wizard/steps/welcome-step.php | 2 +- css/admin/onboarding-wizard.css | 46 +++++-------------- css/frm_admin.css | 20 +++++--- images/logo.svg | 8 ++-- images/onboarding-wizard/onboarding-bg.svg | 1 - js/src/onboarding-wizard/elements/elements.js | 1 - .../onboarding-wizard/ui/setupInitialView.js | 3 +- 12 files changed, 72 insertions(+), 61 deletions(-) create mode 100644 classes/views/onboarding-wizard/steps/consent-tracking-step.php delete mode 100644 images/onboarding-wizard/onboarding-bg.svg diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 320f317124..c80a9a4479 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -70,7 +70,7 @@ class FrmOnboardingWizardController { * * @var string */ - const INITIAL_STEP = 'welcome'; + const INITIAL_STEP = 'consent-tracking'; /** * Option name to store usage data. @@ -250,6 +250,7 @@ public static function render() { // Note: Add step parts in order. $step_parts = array( + 'consent-tracking' => 'steps/consent-tracking-step.php', 'welcome' => 'steps/welcome-step.php', 'install-formidable-pro' => 'steps/install-formidable-pro-step.php', 'license-management' => 'steps/license-management-step.php', diff --git a/classes/helpers/FrmOnboardingWizardHelper.php b/classes/helpers/FrmOnboardingWizardHelper.php index f3fdcfccf3..2b17c0ab5c 100644 --- a/classes/helpers/FrmOnboardingWizardHelper.php +++ b/classes/helpers/FrmOnboardingWizardHelper.php @@ -106,7 +106,7 @@ public static function print_footer( $args = array() ) { $primary_button_attributes = array( 'href' => $args['primary-button-href'], ); - $primary_button_attributes['class'] = trim( 'button button-primary frm-button-primary ' . $args['primary-button-class'] ); + $primary_button_attributes['class'] = trim( 'button button-primary frm-button-primary frm-sharp frm_large ' . $args['primary-button-class'] ); if ( ! empty( $args['primary-button-id'] ) ) { $primary_button_attributes['id'] = $args['primary-button-id']; } @@ -121,7 +121,7 @@ public static function print_footer( $args = array() ) { $secondary_button_attributes = array( 'href' => $args['secondary-button-href'], ); - $secondary_button_attributes['class'] = trim( 'button button-secondary frm-button-secondary ' . $args['secondary-button-class'] ); + $secondary_button_attributes['class'] = trim( 'button button-secondary frm-button-secondary frm-sharp frm_large ' . $args['secondary-button-class'] ); if ( $args['secondary-button-skip-step'] ) { $secondary_button_attributes['class'] .= ' frm-onboarding-skip-step'; } diff --git a/classes/views/onboarding-wizard/footer.php b/classes/views/onboarding-wizard/footer.php index 4287fc057e..4bfb265d78 100644 --- a/classes/views/onboarding-wizard/footer.php +++ b/classes/views/onboarding-wizard/footer.php @@ -11,7 +11,7 @@ ?>
- + diff --git a/classes/views/onboarding-wizard/index.php b/classes/views/onboarding-wizard/index.php index 4df9005152..8b61142400 100644 --- a/classes/views/onboarding-wizard/index.php +++ b/classes/views/onboarding-wizard/index.php @@ -9,11 +9,7 @@ die( 'You are not allowed to call this page directly.' ); } ?> -
-
- <?php esc_attr_e( 'Onboarding Wizard Background', 'formidable' ); ?> -
- +
$file ) { @@ -22,7 +18,7 @@ ?> - +
diff --git a/classes/views/onboarding-wizard/steps/consent-tracking-step.php b/classes/views/onboarding-wizard/steps/consent-tracking-step.php new file mode 100644 index 0000000000..f1e6991882 --- /dev/null +++ b/classes/views/onboarding-wizard/steps/consent-tracking-step.php @@ -0,0 +1,35 @@ + + diff --git a/classes/views/onboarding-wizard/steps/welcome-step.php b/classes/views/onboarding-wizard/steps/welcome-step.php index 002ce842de..9142a47a2f 100644 --- a/classes/views/onboarding-wizard/steps/welcome-step.php +++ b/classes/views/onboarding-wizard/steps/welcome-step.php @@ -9,7 +9,7 @@ die( 'You are not allowed to call this page directly.' ); } ?> -
+
diff --git a/css/admin/onboarding-wizard.css b/css/admin/onboarding-wizard.css index 4fa7f2cb6e..474da0331c 100644 --- a/css/admin/onboarding-wizard.css +++ b/css/admin/onboarding-wizard.css @@ -15,6 +15,7 @@ html.wp-toolbar { #frm-onboarding-wizard-page { position: relative; + background-color: var(--grey-50); overflow: hidden; } @@ -22,24 +23,6 @@ html.wp-toolbar { box-sizing: border-box; } -#frm-onboarding-bg { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - display: flex; - justify-content: center; - align-items: center; - opacity: 0; - z-index: 1; -} - -#frm-onboarding-bg img { - min-height: 80%; - max-height: 1200px; -} - #frm-onboarding-container { position: relative; min-height: 100vh; @@ -50,40 +33,33 @@ html.wp-toolbar { #frm-onboarding-return-dashboard { color: var(--grey-400); font-weight: 500; - margin-top: var(--gap-xl); + margin-top: var(--gap-lg); } #frm-onboarding-return-dashboard:hover { color: var(--grey-500); } -#frm-onboarding-wizard-page[data-current-step="success"] #frm-onboarding-return-dashboard { +#frm-onboarding-wizard-page[data-current-step="success"] + #frm-onboarding-return-dashboard { display: none; } +.frm-onboarding-logo { + width: 60px; + height: auto; +} + /* NOTE: The changes below were implemented to align with the distinct tooltip style observed in the "Install Formidable Add-ons" step */ .tooltip-inner { max-width: 295px; - background-color: #545F6E; + background-color: #545f6e; padding: var(--gap-xs) var(--gap-sm); border-radius: var(--small-radius); } .bs-tooltip-top .arrow::before { - border-top-color: #545F6E; -} - -/** - * Welcome Step Styles - * - * Provides styles for when the Onboarding Wizard page is displayed Welcome step. - */ -#frm-onboarding-welcome-step { - max-width: 445px; -} - -.frm-onboarding-logo { - max-width: 185px; + border-top-color: #545f6e; } /** diff --git a/css/frm_admin.css b/css/frm_admin.css index 0eb8b36b2f..740ec1283f 100644 --- a/css/frm_admin.css +++ b/css/frm_admin.css @@ -1316,6 +1316,11 @@ body.frm-hidden-overflow { display: inline-block; } +.frm-button-primary.frm-sharp, +.frm-button-secondary.frm-sharp { + border-radius: 12px !important; +} + .no-js.wp-core-ui .frm-search .button.hide-if-no-js, .js.wp-core-ui .frm-search .button.hide-if-js { display: none; @@ -1411,10 +1416,10 @@ body.frm-hidden-overflow { color: #fff !important; } -.frm-button-primary.frm_large{ - font-size: var(--text-md) !important; +.frm-button-primary.frm_large, +.frm-button-secondary.frm_large { height: auto !important; - padding: 9px 18px !important; + padding: 12px 16px !important; } .frm-button-secondary.frm-small, @@ -2428,11 +2433,12 @@ h2.frm-h2 + .howto { } .frm-card-box { - max-width: 500px; + max-width: 524px; background-color: #fff; - border-radius: var(--small-radius); - padding: var(--gap-lg); - box-shadow: var(--box-shadow-sm); + border-radius: var(--medium-radius); + padding: var(--gap-xl); + border: 1px solid var(--grey-200); + box-shadow: var(--box-shadow-md); } .frm-card-box.frm-has-progress-bar { diff --git a/images/logo.svg b/images/logo.svg index ba46ca618b..ef3e9a82b2 100644 --- a/images/logo.svg +++ b/images/logo.svg @@ -1,7 +1,7 @@ - - - - + + + + diff --git a/images/onboarding-wizard/onboarding-bg.svg b/images/onboarding-wizard/onboarding-bg.svg deleted file mode 100644 index d22cc893bb..0000000000 --- a/images/onboarding-wizard/onboarding-bg.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/js/src/onboarding-wizard/elements/elements.js b/js/src/onboarding-wizard/elements/elements.js index 17f5bc1142..bc5a2fb284 100644 --- a/js/src/onboarding-wizard/elements/elements.js +++ b/js/src/onboarding-wizard/elements/elements.js @@ -11,7 +11,6 @@ import { PREFIX, WELCOME_STEP_ID } from '../shared'; export const { getElements, addElements } = createPageElements({ // Body Elements onboardingWizardPage: document.getElementById( `${PREFIX}-wizard-page` ), - pageBackground: document.getElementById( `${PREFIX}-bg` ), container: document.getElementById( `${PREFIX}-container` ), steps: document.querySelectorAll( `.${PREFIX}-step` ), skipStepButtons: document.querySelectorAll( `.${PREFIX}-skip-step` ), diff --git a/js/src/onboarding-wizard/ui/setupInitialView.js b/js/src/onboarding-wizard/ui/setupInitialView.js index 338288a83c..49a4d33668 100644 --- a/js/src/onboarding-wizard/ui/setupInitialView.js +++ b/js/src/onboarding-wizard/ui/setupInitialView.js @@ -128,8 +128,7 @@ function enhanceStepsWithProgress() { * @return {void} */ function fadeInPageElements() { - const { pageBackground, container } = getElements(); - new frmAnimate( pageBackground ).fadeIn(); + const { container } = getElements(); new frmAnimate( container ).fadeIn(); } From 2eee772fb47c0be245ade138c1b7d9b384477d56 Mon Sep 17 00:00:00 2001 From: Sherv Date: Fri, 11 Oct 2024 14:15:28 +0300 Subject: [PATCH 02/24] Add "primary-button-with-icon" option --- classes/helpers/FrmOnboardingWizardHelper.php | 1 + classes/views/onboarding-wizard/footer.php | 8 +++++++- .../onboarding-wizard/steps/consent-tracking-step.php | 11 ++++++----- css/frm_admin.css | 8 ++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/classes/helpers/FrmOnboardingWizardHelper.php b/classes/helpers/FrmOnboardingWizardHelper.php index 2b17c0ab5c..7238e27eab 100644 --- a/classes/helpers/FrmOnboardingWizardHelper.php +++ b/classes/helpers/FrmOnboardingWizardHelper.php @@ -93,6 +93,7 @@ public static function print_footer( $args = array() ) { 'primary-button-class' => '', 'primary-button-href' => '#', 'primary-button-role' => 'button', + 'primary-button-with-icon' => false, // Secondary Button Args. 'secondary-button-text' => esc_html__( 'Skip', 'formidable' ), 'secondary-button-class' => '', diff --git a/classes/views/onboarding-wizard/footer.php b/classes/views/onboarding-wizard/footer.php index 4bfb265d78..9abace1bd9 100644 --- a/classes/views/onboarding-wizard/footer.php +++ b/classes/views/onboarding-wizard/footer.php @@ -20,6 +20,12 @@ > - +
diff --git a/classes/views/onboarding-wizard/steps/consent-tracking-step.php b/classes/views/onboarding-wizard/steps/consent-tracking-step.php index f1e6991882..b68996bcca 100644 --- a/classes/views/onboarding-wizard/steps/consent-tracking-step.php +++ b/classes/views/onboarding-wizard/steps/consent-tracking-step.php @@ -24,11 +24,12 @@ esc_html__( 'Allow & Continue', 'formidable' ), - 'primary-button-id' => 'frm-onboarding-consent-tracking', - 'secondary-button-text' => esc_html__( 'Skip', 'formidable' ), - 'footer-class' => 'frm-justify-center', - 'display-back-button' => false, + 'primary-button-text' => esc_html__( 'Allow & Continue', 'formidable' ), + 'primary-button-id' => 'frm-onboarding-consent-tracking', + 'primary-button-with-icon' => true, + 'secondary-button-text' => esc_html__( 'Skip', 'formidable' ), + 'footer-class' => 'frm-justify-center', + 'display-back-button' => false, ) ); ?> diff --git a/css/frm_admin.css b/css/frm_admin.css index 740ec1283f..46aac3f1df 100644 --- a/css/frm_admin.css +++ b/css/frm_admin.css @@ -1687,6 +1687,10 @@ input.frm_insert_in_template { margin-bottom: var(--gap-lg) !important; } +.frm-ml-xs { + margin-left: var(--gap-xs) !important; +} + .frm-ml-auto { margin-left: auto; } @@ -1946,6 +1950,10 @@ input.frm_insert_in_template { z-index: -1; } +.frm-rotate-90 { + transform: rotate(90deg); +} + /* End Generic Classes, Start Forced Generic Classes */ .frm-fields p > label.frm_hidden, From 97bdcb4707b7ae828bc2e63b7a52ed8c42aeacbb Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 14 Oct 2024 12:56:46 +0300 Subject: [PATCH 03/24] Add consent tracking dropdown --- classes/views/onboarding-wizard/footer.php | 2 +- .../steps/consent-tracking-step.php | 21 +++++++++++++++++++ css/admin/onboarding-wizard.css | 18 +++++++++++++--- css/frm_admin.css | 16 ++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) diff --git a/classes/views/onboarding-wizard/footer.php b/classes/views/onboarding-wizard/footer.php index 9abace1bd9..e671286273 100644 --- a/classes/views/onboarding-wizard/footer.php +++ b/classes/views/onboarding-wizard/footer.php @@ -24,7 +24,7 @@ echo esc_html( $args['primary-button-text'] ); if ( $args['primary-button-with-icon'] === true ) { - FrmAppHelper::icon_by_class( 'frmfont frm_arrowup6_icon frm_svg13 frm_inline_block frm-rotate-90 frm-ml-xs' ); + FrmAppHelper::icon_by_class( 'frmfont frm_arrowup6_icon frm_svg13 frm_inline_block frm-rotate-90 frm-ml-xs', array( 'aria-hidden' => 'true' ) ); } ?> diff --git a/classes/views/onboarding-wizard/steps/consent-tracking-step.php b/classes/views/onboarding-wizard/steps/consent-tracking-step.php index b68996bcca..923d80994f 100644 --- a/classes/views/onboarding-wizard/steps/consent-tracking-step.php +++ b/classes/views/onboarding-wizard/steps/consent-tracking-step.php @@ -33,4 +33,25 @@ ) ); ?> + + diff --git a/css/admin/onboarding-wizard.css b/css/admin/onboarding-wizard.css index 474da0331c..b2b6d4ee1c 100644 --- a/css/admin/onboarding-wizard.css +++ b/css/admin/onboarding-wizard.css @@ -40,16 +40,28 @@ html.wp-toolbar { color: var(--grey-500); } -#frm-onboarding-wizard-page[data-current-step="success"] - #frm-onboarding-return-dashboard { +#frm-onboarding-wizard-page[data-current-step="success"] #frm-onboarding-return-dashboard { display: none; } -.frm-onboarding-logo { +#frm-onboarding-wizard-page .frm-onboarding-logo { width: 60px; height: auto; } +#frm-onboarding-wizard-page .frm-dropdown-menu { + position: static !important; + transform: none !important; + border: 0; + box-shadow: none; + width: 100%; + padding: var(--gap-sm) 0; +} + +.dropdown.show .frm-dropdown-toggle .frmsvg { + transform: rotate(180deg); +} + /* NOTE: The changes below were implemented to align with the distinct tooltip style observed in the "Install Formidable Add-ons" step */ .tooltip-inner { max-width: 295px; diff --git a/css/frm_admin.css b/css/frm_admin.css index 46aac3f1df..f881c12e34 100644 --- a/css/frm_admin.css +++ b/css/frm_admin.css @@ -1612,6 +1612,10 @@ input.frm_insert_in_template { } /* Generic Classes */ +.frm-text-grey-500 { + color: var(--grey-500); +} + .frm-text-grey-700 { color: var(--grey-700); } @@ -1687,6 +1691,10 @@ input.frm_insert_in_template { margin-bottom: var(--gap-lg) !important; } +.frm-ml-2xs { + margin-left: var(--gap-2xs) !important; +} + .frm-ml-xs { margin-left: var(--gap-xs) !important; } @@ -1885,6 +1893,10 @@ input.frm_insert_in_template { gap: 0 !important; } +.frm-gap-2xs { + gap: var(--gap-2xs); +} + .frm-gap-xs { gap: var(--gap-xs); } @@ -1954,6 +1966,10 @@ input.frm_insert_in_template { transform: rotate(90deg); } +.frm-cursor-pointer { + cursor: pointer; +} + /* End Generic Classes, Start Forced Generic Classes */ .frm-fields p > label.frm_hidden, From 9ef1d1d337d6bccea6e1e0cb6de6797c8273f172 Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 14 Oct 2024 17:45:15 +0300 Subject: [PATCH 04/24] Finish consent tracking step --- .../steps/consent-tracking-step.php | 70 +++++++++++++++++-- css/admin/onboarding-wizard.css | 6 +- css/frm_admin.css | 9 +++ images/icons.svg | 1 + 4 files changed, 81 insertions(+), 5 deletions(-) diff --git a/classes/views/onboarding-wizard/steps/consent-tracking-step.php b/classes/views/onboarding-wizard/steps/consent-tracking-step.php index 923d80994f..7b394f34b2 100644 --- a/classes/views/onboarding-wizard/steps/consent-tracking-step.php +++ b/classes/views/onboarding-wizard/steps/consent-tracking-step.php @@ -44,12 +44,74 @@
-
- 'true' ) ); ?> +
+ 'true' ) ); ?>
-

- Your WordPress user’s: first & last name and email address +

+ 'frm-inline-flex', + ) + ); + ?> +

+ +
+
+ +
+ 'true' ) ); ?> + +
+

+ 'frm-inline-flex', + ) + ); + ?> +

+ +
+
+ +
+ 'true' ) ); ?> + +
+

+ +

+ +
+
+ +
+ 'true' ) ); ?> + +
+

+ 'frm-inline-flex', + ) + ); + ?> +

+
diff --git a/css/admin/onboarding-wizard.css b/css/admin/onboarding-wizard.css index b2b6d4ee1c..a55fc8eddd 100644 --- a/css/admin/onboarding-wizard.css +++ b/css/admin/onboarding-wizard.css @@ -55,7 +55,7 @@ html.wp-toolbar { border: 0; box-shadow: none; width: 100%; - padding: var(--gap-sm) 0; + max-height: unset; } .dropdown.show .frm-dropdown-toggle .frmsvg { @@ -74,6 +74,10 @@ html.wp-toolbar { border-top-color: #545f6e; } +.bs-tooltip-bottom .arrow::before { + border-bottom-color: #545f6e; +} + /** * Install Formidable Add-ons Step Styles * diff --git a/css/frm_admin.css b/css/frm_admin.css index f881c12e34..b96ba21d2d 100644 --- a/css/frm_admin.css +++ b/css/frm_admin.css @@ -1763,6 +1763,11 @@ input.frm_insert_in_template { padding-bottom: var(--gap-2xs) !important; } +.frm-py-sm { + padding-top: var(--gap-sm) !important; + padding-bottom: var(--gap-sm) !important; +} + .frm-pt-sm { padding-top: var(--gap-sm) !important; } @@ -1855,6 +1860,10 @@ input.frm_insert_in_template { display: inline-block !important; } +.frm-inline-flex { + display: inline-flex; +} + .frm-flex { display: flex; } diff --git a/images/icons.svg b/images/icons.svg index cf3b0d6502..eaee2ebec1 100755 --- a/images/icons.svg +++ b/images/icons.svg @@ -793,6 +793,7 @@ + From 5d1fe32bec9baa0682f40afae516c2cfe8d35c83 Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 14 Oct 2024 22:08:15 +0300 Subject: [PATCH 05/24] Add routline --- classes/views/onboarding-wizard/index.php | 6 ++++ css/admin/onboarding-wizard.css | 43 +++++++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/classes/views/onboarding-wizard/index.php b/classes/views/onboarding-wizard/index.php index 8b61142400..0fcff94a90 100644 --- a/classes/views/onboarding-wizard/index.php +++ b/classes/views/onboarding-wizard/index.php @@ -11,6 +11,12 @@ ?>
+
    +
  • +
  • +
  • +
+ $file ) { require $view_path . $file; diff --git a/css/admin/onboarding-wizard.css b/css/admin/onboarding-wizard.css index a55fc8eddd..e26b9f959b 100644 --- a/css/admin/onboarding-wizard.css +++ b/css/admin/onboarding-wizard.css @@ -78,6 +78,48 @@ html.wp-toolbar { border-bottom-color: #545f6e; } +/* Rootline */ +.frm-rootline { + position: relative; + display: flex; + justify-content: center; + align-items: center; + gap: calc(3 * var(--gap-xl)); + padding: 0; + margin: 0 0 var(--gap-lg); +} + +.frm-rootline::before { + content: ''; + position: absolute; + width: calc(100% - 32px); + border: 1px solid var(--grey-300); + z-index: 1; +} + +.frm-rootline-item { + position: relative; + display: flex; + justify-content: center; + align-items: center; + width: 16px; + height: 16px; + background-color: var(--grey-50); + border: 2px solid var(--grey-300); + outline: 4px solid var(--grey-50); + border-radius: 100%; + padding: 0; + margin: 0; + z-index: 2; +} + +#frm-onboarding-wizard-page[data-current-step="consent-tracking"] .frm-rootline-item[data-step="consent-tracking"], +#frm-onboarding-wizard-page[data-current-step="install-addons"] .frm-rootline-item[data-step="install-addons"], +#frm-onboarding-wizard-page[data-current-step="success"] .frm-rootline-item[data-step="success"] { + background-color: #fff; + border-color: var(--primary-500); +} + /** * Install Formidable Add-ons Step Styles * @@ -95,3 +137,4 @@ html.wp-toolbar { .frm-cta-green .frm-banner-text a { text-decoration: underline; } + From 3506b35e465bfb211bfc6e21fc040431d217b4af Mon Sep 17 00:00:00 2001 From: Sherv Date: Tue, 15 Oct 2024 14:59:06 +0300 Subject: [PATCH 06/24] Remove old steps --- .../FrmOnboardingWizardController.php | 11 +-- .../steps/default-email-address-step.php | 80 ------------------ .../steps/install-formidable-pro-step.php | 82 ------------------- .../onboarding-wizard/steps/welcome-step.php | 37 --------- .../dataUtils/setupUsageData.js | 11 --- js/src/onboarding-wizard/elements/elements.js | 6 +- .../events/saveLicenseButtonListener.js | 32 -------- .../skipProInstallationButtonListener.js | 27 ------ js/src/onboarding-wizard/shared/constants.js | 3 - .../onboarding-wizard/ui/setupInitialView.js | 54 ++---------- 10 files changed, 13 insertions(+), 330 deletions(-) delete mode 100644 classes/views/onboarding-wizard/steps/default-email-address-step.php delete mode 100644 classes/views/onboarding-wizard/steps/install-formidable-pro-step.php delete mode 100644 classes/views/onboarding-wizard/steps/welcome-step.php diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index c80a9a4479..0796b90d99 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -250,13 +250,10 @@ public static function render() { // Note: Add step parts in order. $step_parts = array( - 'consent-tracking' => 'steps/consent-tracking-step.php', - 'welcome' => 'steps/welcome-step.php', - 'install-formidable-pro' => 'steps/install-formidable-pro-step.php', - 'license-management' => 'steps/license-management-step.php', - 'default-email-address' => 'steps/default-email-address-step.php', - 'install-addons' => 'steps/install-addons-step.php', - 'success' => 'steps/success-step.php', + 'consent-tracking' => 'steps/consent-tracking-step.php', + 'license-management' => 'steps/license-management-step.php', + 'install-addons' => 'steps/install-addons-step.php', + 'success' => 'steps/success-step.php', ); include $view_path . 'index.php'; diff --git a/classes/views/onboarding-wizard/steps/default-email-address-step.php b/classes/views/onboarding-wizard/steps/default-email-address-step.php deleted file mode 100644 index f25ddd1651..0000000000 --- a/classes/views/onboarding-wizard/steps/default-email-address-step.php +++ /dev/null @@ -1,80 +0,0 @@ - -
-
-
- -
-
- -
-

-

- -

- -
-

- - - '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' ), - ), - ) - ); - ?> -

- - - - - - - - -
- - -
- - 'frm-onboarding-setup-email-step-button' ) ); ?> -
diff --git a/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php b/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php deleted file mode 100644 index d604df42b3..0000000000 --- a/classes/views/onboarding-wizard/steps/install-formidable-pro-step.php +++ /dev/null @@ -1,82 +0,0 @@ - -
-
-
- -
-
- -
-

-

- -
- - - - - -
- -
- - - - - -
- - - 'frm-onboarding-check-pro-installation-error', - 'errors' => __( 'Formidable Pro is currently inactive!', 'formidable' ), - ) - ); - ?> - -
- - - - - ', - '' - ); - ?> - -
-
- - esc_html__( 'Continue', 'formidable' ), - 'primary-button-id' => 'frm-onboarding-check-pro-installation-button', - 'secondary-button-id' => 'frm-onboarding-skip-pro-installation-button', - 'secondary-button-skip-step' => false, - ) - ); - ?> -
diff --git a/classes/views/onboarding-wizard/steps/welcome-step.php b/classes/views/onboarding-wizard/steps/welcome-step.php deleted file mode 100644 index 9142a47a2f..0000000000 --- a/classes/views/onboarding-wizard/steps/welcome-step.php +++ /dev/null @@ -1,37 +0,0 @@ - -
-
- -
- -
-

-

- -

-
- - 'frm-justify-center', - 'display-back-button' => false, - 'primary-button-text' => esc_html__( 'Connect Account', 'formidable' ), - 'primary-button-id' => 'frm-onboarding-connect-account', - 'primary-button-href' => FrmAddonsController::connect_link(), - 'primary-button-role' => false, - 'secondary-button-text' => esc_html__( 'Proceed without Account', 'formidable' ), - ) - ); - ?> -
diff --git a/js/src/onboarding-wizard/dataUtils/setupUsageData.js b/js/src/onboarding-wizard/dataUtils/setupUsageData.js index efe65c4c90..3d2a3d1408 100644 --- a/js/src/onboarding-wizard/dataUtils/setupUsageData.js +++ b/js/src/onboarding-wizard/dataUtils/setupUsageData.js @@ -50,17 +50,6 @@ function processDataForStep( processedStep, nextStepName ) { } } - // Append email step data for the email step - if ( STEPS.DEFAULT_EMAIL_ADDRESS === processedStep ) { - const { emailStepData } = getState(); - if ( ! isEmptyObject( emailStepData ) ) { - formData = formData ?? new FormData(); - for ( const [ key, value ] of Object.entries( emailStepData ) ) { - formData.append( key, value ); - } - } - } - // Append installed addons for the addon installation step if ( STEPS.INSTALL_ADDONS === processedStep ) { const { installedAddons } = getState(); diff --git a/js/src/onboarding-wizard/elements/elements.js b/js/src/onboarding-wizard/elements/elements.js index bc5a2fb284..23cdfb055f 100644 --- a/js/src/onboarding-wizard/elements/elements.js +++ b/js/src/onboarding-wizard/elements/elements.js @@ -6,7 +6,7 @@ import { createPageElements } from 'core/factory'; /** * Internal dependencies */ -import { PREFIX, WELCOME_STEP_ID } from '../shared'; +import { PREFIX } from '../shared'; export const { getElements, addElements } = createPageElements({ // Body Elements @@ -18,7 +18,6 @@ export const { getElements, addElements } = createPageElements({ hiddenLicenseKeyInput: document.getElementById( 'frm-license-key' ), // Install Formidable Pro Step Elements - installFormidableProStep: document.getElementById( `${PREFIX}-install-formidable-pro-step` ), checkProInstallationButton: document.getElementById( `${PREFIX}-check-pro-installation-button` ), skipProInstallationButton: document.getElementById( `${PREFIX}-skip-pro-installation-button` ), checkProInstallationError: document.getElementById( `${PREFIX}-check-pro-installation-error` ), @@ -28,9 +27,6 @@ export const { getElements, addElements } = createPageElements({ licenseKeyInput: document.getElementById( 'edd_formidable_pro_license_key' ), saveLicenseButton: document.getElementById( `${PREFIX}-save-license-button` ), - // Welcome Step Elements - welcomeStep: document.getElementById( WELCOME_STEP_ID ), - // Default Email Address Step Elements setupEmailStepButton: document.getElementById( `${PREFIX}-setup-email-step-button` ), defaultEmailField: document.getElementById( `${PREFIX}-default-email-field` ), diff --git a/js/src/onboarding-wizard/events/saveLicenseButtonListener.js b/js/src/onboarding-wizard/events/saveLicenseButtonListener.js index a3b81df048..152e324212 100644 --- a/js/src/onboarding-wizard/events/saveLicenseButtonListener.js +++ b/js/src/onboarding-wizard/events/saveLicenseButtonListener.js @@ -1,42 +1,10 @@ -/** - * External dependencies - */ -import { onClickPreventDefault, setQueryParam } from 'core/utils'; - -/** - * Internal dependencies - */ -import { getElements } from '../elements'; -import { STEPS } from '../shared'; - /** * Manages event handling for the "Active & continue" button in the "License Management" step. * * @return {void} */ function addSaveLicenseButtonEvents() { - const { saveLicenseButton } = getElements(); - - // Attach click event listener - onClickPreventDefault( saveLicenseButton, onSaveLicenseButtonClick ); } -/** - * Handles the click event on the "Active & continue" button in the "License Management" step. - * - * @private - * @param {Event} event The click event object. - * @return {void} - */ -const onSaveLicenseButtonClick = async() => { - wp.hooks.addAction( 'frm_after_authorize', 'frmOnboardingWizard', data => { - if ( true === data.success ) { - // After authorization, update URL to "Default Email Address" step and reload the page - window.location.href = setQueryParam( 'step', STEPS.DEFAULT_EMAIL_ADDRESS, 'replaceState' ); - } - - return data; - }); -}; export default addSaveLicenseButtonEvents; diff --git a/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js b/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js index f8f81a2cb2..51c398af73 100644 --- a/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js +++ b/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js @@ -1,36 +1,9 @@ -/** - * External dependencies - */ -import { onClickPreventDefault } from 'core/utils'; - -/** - * Internal dependencies - */ -import { getElements } from '../elements'; -import { STEPS } from '../shared'; -import { navigateToStep } from '../utils'; - /** * Manages event handling for the "Skip" button in the "Install Formidable Pro" step. * * @return {void} */ function addSkipProInstallationButtonEvents() { - const { skipProInstallationButton } = getElements(); - - // Attach click event listener - onClickPreventDefault( skipProInstallationButton, onSkipProInstallationButtonClick ); } -/** - * Handles the click event on the "Skip" button in the "Install Formidable Pro" setup. - * - * @private - * @param {Event} event The click event object. - * @return {void} - */ -const onSkipProInstallationButtonClick = async() => { - navigateToStep( STEPS.DEFAULT_EMAIL_ADDRESS ); -}; - export default addSkipProInstallationButtonEvents; diff --git a/js/src/onboarding-wizard/shared/constants.js b/js/src/onboarding-wizard/shared/constants.js index 686db848bb..514600c834 100644 --- a/js/src/onboarding-wizard/shared/constants.js +++ b/js/src/onboarding-wizard/shared/constants.js @@ -1,12 +1,9 @@ export const { INITIAL_STEP, proIsIncluded } = window.frmOnboardingWizardVars; export const PREFIX = 'frm-onboarding'; -export const WELCOME_STEP_ID = `${PREFIX}-welcome-step`; export const STEPS = { INITIAL: INITIAL_STEP, - DEFAULT_EMAIL_ADDRESS: 'default-email-address', - INSTALL_FORMIDABLE_PRO: 'install-formidable-pro', LICENSE_MANAGEMENT: 'license-management', INSTALL_ADDONS: 'install-addons', SUCCESS: 'success' diff --git a/js/src/onboarding-wizard/ui/setupInitialView.js b/js/src/onboarding-wizard/ui/setupInitialView.js index 49a4d33668..1335bc4594 100644 --- a/js/src/onboarding-wizard/ui/setupInitialView.js +++ b/js/src/onboarding-wizard/ui/setupInitialView.js @@ -2,13 +2,12 @@ * External dependencies */ import { frmAnimate, getQueryParam, removeQueryParam, hasQueryParam } from 'core/utils'; -import { addProgressToCardBoxes } from 'core/ui'; /** * Internal dependencies */ import { getElements } from '../elements'; -import { STEPS, WELCOME_STEP_ID, proIsIncluded } from '../shared'; +import { STEPS, proIsIncluded } from '../shared'; import { navigateToStep } from '../utils'; /** @@ -19,11 +18,7 @@ import { navigateToStep } from '../utils'; */ export default function setupInitialView() { navigateToInitialStep(); - enhanceStepsWithProgress(); fadeInPageElements(); - - // Load the email form from the server for the "Default Email Address" step - loadApiEmailForm(); } /** @@ -47,30 +42,25 @@ function navigateToInitialStep() { * @return {string} The name of the initial step to navigate to. */ function determineInitialStep() { - const { hiddenLicenseKeyInput, installFormidableProStep, licenseManagementStep } = getElements(); + const { hiddenLicenseKeyInput, licenseManagementStep } = getElements(); if ( hiddenLicenseKeyInput ) { - return handleLicenseKeyInput( hiddenLicenseKeyInput, installFormidableProStep, licenseManagementStep ); // Steps are conditionally removed inside handleLicenseKeyInput based on proIsIncluded + return handleLicenseKeyInput( hiddenLicenseKeyInput, licenseManagementStep ); // Steps are conditionally removed inside handleLicenseKeyInput based on proIsIncluded } if ( hasQueryParam( 'success' ) ) { // Handle the case where 'success' query parameter is present - installFormidableProStep.remove(); licenseManagementStep.remove(); - return STEPS.DEFAULT_EMAIL_ADDRESS; + // return STEPS.DEFAULT_EMAIL_ADDRESS; } const stepQueryParam = getQueryParam( 'step' ) || STEPS.INITIAL; switch ( stepQueryParam ) { case STEPS.LICENSE_MANAGEMENT: - installFormidableProStep.remove(); - break; - case STEPS.INSTALL_FORMIDABLE_PRO: break; default: // Remove both steps as they are not needed - installFormidableProStep.remove(); licenseManagementStep.remove(); } @@ -82,21 +72,15 @@ function determineInitialStep() { * Removes unnecessary steps based on the determined next step. * * @private - * @param {HTMLElement} hiddenLicenseKeyInput The hidden input element containing the license key. - * @param {HTMLElement} installFormidableProStep The step element for installing Formidable Pro. - * @param {HTMLElement} licenseManagementStep The step element for license management. + * @param {HTMLElement} hiddenLicenseKeyInput The hidden input element containing the license key. + * @param {HTMLElement} licenseManagementStep The step element for license management. * @return {string} The name of the next step to navigate to. */ -function handleLicenseKeyInput( hiddenLicenseKeyInput, installFormidableProStep, licenseManagementStep ) { +function handleLicenseKeyInput( hiddenLicenseKeyInput, licenseManagementStep ) { const { licenseKeyInput } = getElements(); licenseKeyInput.value = hiddenLicenseKeyInput.value; - if ( proIsIncluded ) { - installFormidableProStep.remove(); // Remove install Pro step if Pro is installed - return STEPS.LICENSE_MANAGEMENT; - } - - return STEPS.INSTALL_FORMIDABLE_PRO; + return STEPS.LICENSE_MANAGEMENT; } /** @@ -110,17 +94,6 @@ function clearOnboardingQueryParams() { removeQueryParam( 'success' ); } -/** - * Adds a progress bar to each step except the welcome step. - * - * @private - * @return {void} - */ -function enhanceStepsWithProgress() { - const { steps } = getElements(); - addProgressToCardBoxes([ ...steps ].filter( step => step.id !== WELCOME_STEP_ID ) ); -} - /** * Smoothly fades in the background and container elements of the page for a more pleasant user experience. * @@ -131,14 +104,3 @@ function fadeInPageElements() { const { container } = getElements(); new frmAnimate( container ).fadeIn(); } - -/** - * Loads the email form from the server for the "Default Email Address" step in the Onboarding Wizard. - * This involves making a server request to fetch the form and then injecting it into the appropriate part of the DOM. - * - * @private - * @return {void} - */ -function loadApiEmailForm() { - frmAdminBuild.loadApiEmailForm(); -} From 5fc11265c39cc8be67973c11797c273de9786ace Mon Sep 17 00:00:00 2001 From: Sherv Date: Tue, 15 Oct 2024 20:00:06 +0300 Subject: [PATCH 07/24] Remove "license-management" --- .../FrmOnboardingWizardController.php | 7 ++- classes/helpers/FrmOnboardingWizardHelper.php | 2 +- .../steps/license-management-step.php | 43 ------------------ js/src/onboarding-wizard/elements/elements.js | 1 - js/src/onboarding-wizard/shared/constants.js | 1 - .../onboarding-wizard/ui/setupInitialView.js | 44 +++---------------- 6 files changed, 11 insertions(+), 87 deletions(-) delete mode 100644 classes/views/onboarding-wizard/steps/license-management-step.php diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 0796b90d99..8176d36ebd 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -250,10 +250,9 @@ public static function render() { // Note: Add step parts in order. $step_parts = array( - 'consent-tracking' => 'steps/consent-tracking-step.php', - 'license-management' => 'steps/license-management-step.php', - 'install-addons' => 'steps/install-addons-step.php', - 'success' => 'steps/success-step.php', + 'consent-tracking' => 'steps/consent-tracking-step.php', + 'install-addons' => 'steps/install-addons-step.php', + 'success' => 'steps/success-step.php', ); include $view_path . 'index.php'; diff --git a/classes/helpers/FrmOnboardingWizardHelper.php b/classes/helpers/FrmOnboardingWizardHelper.php index 7238e27eab..d919086707 100644 --- a/classes/helpers/FrmOnboardingWizardHelper.php +++ b/classes/helpers/FrmOnboardingWizardHelper.php @@ -87,7 +87,7 @@ public static function add_addon_input_attributes( $addon_key, $addon ) { public static function print_footer( $args = array() ) { $defaults = array( 'footer-class' => '', - 'display-back-button' => true, + 'display-back-button' => false, // Primary Button Args. 'primary-button-text' => esc_html__( 'Next Step', 'formidable' ), 'primary-button-class' => '', diff --git a/classes/views/onboarding-wizard/steps/license-management-step.php b/classes/views/onboarding-wizard/steps/license-management-step.php deleted file mode 100644 index 925f496bdc..0000000000 --- a/classes/views/onboarding-wizard/steps/license-management-step.php +++ /dev/null @@ -1,43 +0,0 @@ - -
-
-
- -
-
- -
-

-

- -
-

- - -

-
-
- - esc_html__( 'Activate & Continue', 'formidable' ), - 'primary-button-id' => 'frm-onboarding-save-license-button', - 'primary-button-class' => 'frm_authorize_link', - 'primary-button-plugin' => 'formidable_pro', - ) - ); - ?> - -
-
diff --git a/js/src/onboarding-wizard/elements/elements.js b/js/src/onboarding-wizard/elements/elements.js index 23cdfb055f..1f1d2c3b74 100644 --- a/js/src/onboarding-wizard/elements/elements.js +++ b/js/src/onboarding-wizard/elements/elements.js @@ -23,7 +23,6 @@ export const { getElements, addElements } = createPageElements({ checkProInstallationError: document.getElementById( `${PREFIX}-check-pro-installation-error` ), // License Management Step Elements - licenseManagementStep: document.getElementById( `${PREFIX}-license-management-step` ), licenseKeyInput: document.getElementById( 'edd_formidable_pro_license_key' ), saveLicenseButton: document.getElementById( `${PREFIX}-save-license-button` ), diff --git a/js/src/onboarding-wizard/shared/constants.js b/js/src/onboarding-wizard/shared/constants.js index 514600c834..819dc8d51d 100644 --- a/js/src/onboarding-wizard/shared/constants.js +++ b/js/src/onboarding-wizard/shared/constants.js @@ -4,7 +4,6 @@ export const PREFIX = 'frm-onboarding'; export const STEPS = { INITIAL: INITIAL_STEP, - LICENSE_MANAGEMENT: 'license-management', INSTALL_ADDONS: 'install-addons', SUCCESS: 'success' }; diff --git a/js/src/onboarding-wizard/ui/setupInitialView.js b/js/src/onboarding-wizard/ui/setupInitialView.js index 1335bc4594..7b57b21774 100644 --- a/js/src/onboarding-wizard/ui/setupInitialView.js +++ b/js/src/onboarding-wizard/ui/setupInitialView.js @@ -7,7 +7,7 @@ import { frmAnimate, getQueryParam, removeQueryParam, hasQueryParam } from 'core * Internal dependencies */ import { getElements } from '../elements'; -import { STEPS, proIsIncluded } from '../shared'; +import { STEPS } from '../shared'; import { navigateToStep } from '../utils'; /** @@ -30,6 +30,7 @@ export default function setupInitialView() { */ function navigateToInitialStep() { const initialStepName = determineInitialStep(); + clearOnboardingQueryParams(); navigateToStep( initialStepName, 'replaceState' ); } @@ -42,45 +43,13 @@ function navigateToInitialStep() { * @return {string} The name of the initial step to navigate to. */ function determineInitialStep() { - const { hiddenLicenseKeyInput, licenseManagementStep } = getElements(); - - if ( hiddenLicenseKeyInput ) { - return handleLicenseKeyInput( hiddenLicenseKeyInput, licenseManagementStep ); // Steps are conditionally removed inside handleLicenseKeyInput based on proIsIncluded - } + const { hiddenLicenseKeyInput } = getElements(); - if ( hasQueryParam( 'success' ) ) { - // Handle the case where 'success' query parameter is present - licenseManagementStep.remove(); - // return STEPS.DEFAULT_EMAIL_ADDRESS; + if ( hiddenLicenseKeyInput || hasQueryParam( 'success' ) ) { + return STEPS.SUCCESS; } - const stepQueryParam = getQueryParam( 'step' ) || STEPS.INITIAL; - - switch ( stepQueryParam ) { - case STEPS.LICENSE_MANAGEMENT: - break; - default: - // Remove both steps as they are not needed - licenseManagementStep.remove(); - } - - return stepQueryParam; -} - -/** - * Handles the presence of a hidden license key input, determining the next step based on whether Formidable Pro is installed. - * Removes unnecessary steps based on the determined next step. - * - * @private - * @param {HTMLElement} hiddenLicenseKeyInput The hidden input element containing the license key. - * @param {HTMLElement} licenseManagementStep The step element for license management. - * @return {string} The name of the next step to navigate to. - */ -function handleLicenseKeyInput( hiddenLicenseKeyInput, licenseManagementStep ) { - const { licenseKeyInput } = getElements(); - licenseKeyInput.value = hiddenLicenseKeyInput.value; - - return STEPS.LICENSE_MANAGEMENT; + return getQueryParam( 'step' ) || STEPS.INITIAL; } /** @@ -102,5 +71,6 @@ function clearOnboardingQueryParams() { */ function fadeInPageElements() { const { container } = getElements(); + new frmAnimate( container ).fadeIn(); } From 9f7246b177517db34b6c27dcefcb1dfbbe00346a Mon Sep 17 00:00:00 2001 From: Sherv Date: Tue, 15 Oct 2024 20:01:03 +0300 Subject: [PATCH 08/24] Finish rootline --- classes/views/onboarding-wizard/index.php | 12 +++-- .../steps/install-addons-step.php | 4 +- css/admin/onboarding-wizard.css | 17 +++++-- css/frm_admin.css | 5 +++ js/src/onboarding-wizard/elements/elements.js | 1 + js/src/onboarding-wizard/ui/index.js | 1 + js/src/onboarding-wizard/ui/rootline.js | 45 +++++++++++++++++++ .../onboarding-wizard/utils/navigateToStep.js | 3 ++ 8 files changed, 79 insertions(+), 9 deletions(-) create mode 100644 js/src/onboarding-wizard/ui/rootline.js diff --git a/classes/views/onboarding-wizard/index.php b/classes/views/onboarding-wizard/index.php index 0fcff94a90..ca01580c9e 100644 --- a/classes/views/onboarding-wizard/index.php +++ b/classes/views/onboarding-wizard/index.php @@ -12,9 +12,15 @@
    -
  • -
  • -
  • +
  • + 'true' ) ); ?> +
  • +
  • + 'true' ) ); ?> +
  • +
  • + 'true' ) ); ?> +
-
- -
+
diff --git a/css/admin/onboarding-wizard.css b/css/admin/onboarding-wizard.css index e26b9f959b..837ce2f368 100644 --- a/css/admin/onboarding-wizard.css +++ b/css/admin/onboarding-wizard.css @@ -113,13 +113,24 @@ html.wp-toolbar { z-index: 2; } -#frm-onboarding-wizard-page[data-current-step="consent-tracking"] .frm-rootline-item[data-step="consent-tracking"], -#frm-onboarding-wizard-page[data-current-step="install-addons"] .frm-rootline-item[data-step="install-addons"], -#frm-onboarding-wizard-page[data-current-step="success"] .frm-rootline-item[data-step="success"] { +.frm-rootline-item.frm-completed-step { + background-color: var(--grey-500); + border-color: var(--grey-500); +} + +.frm-rootline-item.frm-current { background-color: #fff; border-color: var(--primary-500); } +.frm-rootline-item .frmsvg { + color: #fff; +} + +.frm-rootline-item:not(.frm-completed-step) .frmsvg { + display: none; +} + /** * Install Formidable Add-ons Step Styles * diff --git a/css/frm_admin.css b/css/frm_admin.css index b96ba21d2d..e8272a4e4f 100644 --- a/css/frm_admin.css +++ b/css/frm_admin.css @@ -7781,6 +7781,11 @@ input[disabled], height: 13px; } +.frmsvg.frm_svg9 { + width: 9px; + height: 9px; +} + .frmbutton.ui-sortable-helper .frmsvg, .field_type_list li.frmbutton .frmsvg, .frmbutton.ui-sortable-helper i, diff --git a/js/src/onboarding-wizard/elements/elements.js b/js/src/onboarding-wizard/elements/elements.js index 1f1d2c3b74..98c9168d0a 100644 --- a/js/src/onboarding-wizard/elements/elements.js +++ b/js/src/onboarding-wizard/elements/elements.js @@ -12,6 +12,7 @@ export const { getElements, addElements } = createPageElements({ // Body Elements onboardingWizardPage: document.getElementById( `${PREFIX}-wizard-page` ), container: document.getElementById( `${PREFIX}-container` ), + rootline: document.getElementById( `${PREFIX}-rootline` ), steps: document.querySelectorAll( `.${PREFIX}-step` ), skipStepButtons: document.querySelectorAll( `.${PREFIX}-skip-step` ), backButtons: document.querySelectorAll( `.${PREFIX}-back-button` ), diff --git a/js/src/onboarding-wizard/ui/index.js b/js/src/onboarding-wizard/ui/index.js index fbf18552a5..2acbeabeb9 100644 --- a/js/src/onboarding-wizard/ui/index.js +++ b/js/src/onboarding-wizard/ui/index.js @@ -1,2 +1,3 @@ export { default as setupInitialView } from './setupInitialView'; export * from './showError'; +export * from './rootline'; diff --git a/js/src/onboarding-wizard/ui/rootline.js b/js/src/onboarding-wizard/ui/rootline.js new file mode 100644 index 0000000000..aaaf648921 --- /dev/null +++ b/js/src/onboarding-wizard/ui/rootline.js @@ -0,0 +1,45 @@ +/** + * External dependencies + */ +import { CURRENT_CLASS } from 'core/constants'; + +/** + * Internal dependencies + */ +import { getElements } from "../elements"; +import { STEPS } from '../shared'; + +const COMPLETED_STEP_CLASS = 'frm-completed-step'; + +/** + * Updates the rootline to reflect the current and completed steps. + * + * - Applies COMPLETED_STEP_CLASS to steps before the current one. + * - Applies CURRENT_CLASS to the current step, unless it is the success step. + * + * @param {string} currentStep The current step in the process. + * @return {void} + */ +export function updateRootline( currentStep ) { + const { rootline } = getElements(); + const currentItem = rootline.querySelector( `.frm-rootline-item[data-step="${currentStep}"]` ); + + rootline.querySelectorAll( '.frm-rootline-item' ).forEach( item => { + item.classList.remove( COMPLETED_STEP_CLASS ); + item.classList.remove( CURRENT_CLASS ); + }); + + let prevItem = currentItem.previousElementSibling; + if ( prevItem ) { + while ( prevItem ) { + prevItem.classList.add( COMPLETED_STEP_CLASS ); + prevItem = prevItem.previousElementSibling; // move to the previous sibling + } + } + + if ( currentStep === STEPS.SUCCESS ) { + currentItem.classList.add( COMPLETED_STEP_CLASS ); + } else { + currentItem.classList.add( CURRENT_CLASS ); + } +} diff --git a/js/src/onboarding-wizard/utils/navigateToStep.js b/js/src/onboarding-wizard/utils/navigateToStep.js index 38858bbd49..455f23d136 100644 --- a/js/src/onboarding-wizard/utils/navigateToStep.js +++ b/js/src/onboarding-wizard/utils/navigateToStep.js @@ -10,6 +10,7 @@ import { frmAnimate, setQueryParam, hide, show } from 'core/utils'; import { setupUsageData } from '../dataUtils'; import { getElements } from '../elements'; import { getState, PREFIX, setSingleState } from '../shared'; +import { updateRootline } from '../ui'; /** * Navigates to the given step in the onboarding sequence. @@ -44,6 +45,8 @@ export const navigateToStep = ( stepName, updateMethod = 'pushState' ) => { // Update the URL query parameter, with control over history update method setQueryParam( 'step', stepName, updateMethod ); + + updateRootline( stepName ); }; /** From 0b5107021a87b09d816d084948aca7d5c4650391 Mon Sep 17 00:00:00 2001 From: Sherv Date: Wed, 16 Oct 2024 13:07:47 +0300 Subject: [PATCH 09/24] Add "frm-cta-footer" --- .../steps/install-addons-step.php | 14 +++++++++++++- css/frm_admin.css | 16 ++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/classes/views/onboarding-wizard/steps/install-addons-step.php b/classes/views/onboarding-wizard/steps/install-addons-step.php index dbe322cb84..e52d9cc15a 100644 --- a/classes/views/onboarding-wizard/steps/install-addons-step.php +++ b/classes/views/onboarding-wizard/steps/install-addons-step.php @@ -43,7 +43,7 @@
- + + + + + +
diff --git a/css/frm_admin.css b/css/frm_admin.css index e8272a4e4f..28a95aa34a 100644 --- a/css/frm_admin.css +++ b/css/frm_admin.css @@ -9482,6 +9482,18 @@ Responsive Design border: 1px solid var(--primary-200); } +.frm-cta.frm-cta-border .frm-cta-footer { + background-color: #fff; + padding: 12px var(--gap-sm); + border-top: 1px solid var(--primary-200); + border-bottom-left-radius: var(--small-radius); + border-bottom-right-radius: var(--small-radius); + margin-top: 12px; + margin-bottom: calc(-1 * var(--gap-sm)); + margin-left: calc(-1 * var(--gap-sm)); + margin-right: calc(-1 * var(--gap-sm)); +} + .frm-cta h4 { font-weight: 600; margin-top: 0; @@ -9501,6 +9513,10 @@ Responsive Design border-color: var(--success-100) } +.frm-cta-green.frm-cta-border .frm-cta-footer { + border-color: var(--success-100) +} + .frm-cta-red { background-color: var(--error-25); } From 11bedec6aa18610421b3acb6bb9cc7e509ae922e Mon Sep 17 00:00:00 2001 From: Sherv Date: Wed, 16 Oct 2024 16:37:48 +0300 Subject: [PATCH 10/24] Add unsuccess --- .../FrmOnboardingWizardController.php | 1 + .../steps/consent-tracking-step.php | 4 +- .../steps/install-addons-step.php | 2 +- .../onboarding-wizard/steps/success-step.php | 23 +++++------ .../steps/unsuccess-step.php | 38 +++++++++++++++++++ css/admin/onboarding-wizard.css | 1 + js/src/onboarding-wizard/shared/constants.js | 3 +- js/src/onboarding-wizard/ui/rootline.js | 4 ++ 8 files changed, 59 insertions(+), 17 deletions(-) create mode 100644 classes/views/onboarding-wizard/steps/unsuccess-step.php diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 8176d36ebd..26968706ee 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -253,6 +253,7 @@ public static function render() { 'consent-tracking' => 'steps/consent-tracking-step.php', 'install-addons' => 'steps/install-addons-step.php', 'success' => 'steps/success-step.php', + 'unsuccess' => 'steps/unsuccess-step.php', ); include $view_path . 'index.php'; diff --git a/classes/views/onboarding-wizard/steps/consent-tracking-step.php b/classes/views/onboarding-wizard/steps/consent-tracking-step.php index 7b394f34b2..9d3c3e30af 100644 --- a/classes/views/onboarding-wizard/steps/consent-tracking-step.php +++ b/classes/views/onboarding-wizard/steps/consent-tracking-step.php @@ -24,10 +24,10 @@ esc_html__( 'Allow & Continue', 'formidable' ), + 'primary-button-text' => __( 'Allow & Continue', 'formidable' ), 'primary-button-id' => 'frm-onboarding-consent-tracking', 'primary-button-with-icon' => true, - 'secondary-button-text' => esc_html__( 'Skip', 'formidable' ), + 'secondary-button-text' => __( 'Skip', 'formidable' ), 'footer-class' => 'frm-justify-center', 'display-back-button' => false, ) diff --git a/classes/views/onboarding-wizard/steps/install-addons-step.php b/classes/views/onboarding-wizard/steps/install-addons-step.php index e52d9cc15a..955e677bb5 100644 --- a/classes/views/onboarding-wizard/steps/install-addons-step.php +++ b/classes/views/onboarding-wizard/steps/install-addons-step.php @@ -89,7 +89,7 @@ esc_html__( 'Install & Finish Setup', 'formidable' ), + 'primary-button-text' => __( 'Install & Finish Setup', 'formidable' ), 'primary-button-id' => 'frm-onboarding-install-addons-button', ) ); diff --git a/classes/views/onboarding-wizard/steps/success-step.php b/classes/views/onboarding-wizard/steps/success-step.php index 295273bdd7..28d0d23bad 100644 --- a/classes/views/onboarding-wizard/steps/success-step.php +++ b/classes/views/onboarding-wizard/steps/success-step.php @@ -11,30 +11,27 @@ ?>
-
- -
+

- +

'frm-justify-center frm-mt-2xl', - 'display-back-button' => false, - 'primary-button-text' => esc_html__( 'Go to Dashboard', 'formidable' ), - 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), - 'primary-button-role' => false, - 'secondary-button-text' => esc_html__( 'Create a Form', 'formidable' ), - 'secondary-button-href' => admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG ), - 'secondary-button-role' => false, - 'secondary-button-skip-step' => false, + 'footer-class' => 'frm-justify-center frm-mt-2xl', + 'display-back-button' => false, + 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), + 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), + 'primary-button-role' => false, + 'secondary-button-text' => __( 'Create a Form', 'formidable' ), + 'secondary-button-href' => admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG ), + 'secondary-button-role' => false, ) ); ?> diff --git a/classes/views/onboarding-wizard/steps/unsuccess-step.php b/classes/views/onboarding-wizard/steps/unsuccess-step.php new file mode 100644 index 0000000000..16b3e23816 --- /dev/null +++ b/classes/views/onboarding-wizard/steps/unsuccess-step.php @@ -0,0 +1,38 @@ + +
+
+ +
+ +
+

+

+ +

+
+ + 'frm-justify-center frm-mt-2xl', + 'display-back-button' => false, + 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), + 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), + 'primary-button-role' => false, + 'secondary-button-text' => __( 'Install Manually', 'formidable' ), + 'secondary-button-href' => admin_url( 'plugin-install.php' ), + 'secondary-button-role' => false, + ) + ); + ?> +
diff --git a/css/admin/onboarding-wizard.css b/css/admin/onboarding-wizard.css index 837ce2f368..291d65e3d3 100644 --- a/css/admin/onboarding-wizard.css +++ b/css/admin/onboarding-wizard.css @@ -26,6 +26,7 @@ html.wp-toolbar { #frm-onboarding-container { position: relative; min-height: 100vh; + padding: var(--gap-xl); opacity: 0; z-index: 2; } diff --git a/js/src/onboarding-wizard/shared/constants.js b/js/src/onboarding-wizard/shared/constants.js index 819dc8d51d..41465a1c42 100644 --- a/js/src/onboarding-wizard/shared/constants.js +++ b/js/src/onboarding-wizard/shared/constants.js @@ -5,5 +5,6 @@ export const PREFIX = 'frm-onboarding'; export const STEPS = { INITIAL: INITIAL_STEP, INSTALL_ADDONS: 'install-addons', - SUCCESS: 'success' + SUCCESS: 'success', + UNSUCCESS: 'unsuccess' }; diff --git a/js/src/onboarding-wizard/ui/rootline.js b/js/src/onboarding-wizard/ui/rootline.js index aaaf648921..d4b7db318c 100644 --- a/js/src/onboarding-wizard/ui/rootline.js +++ b/js/src/onboarding-wizard/ui/rootline.js @@ -21,6 +21,10 @@ const COMPLETED_STEP_CLASS = 'frm-completed-step'; * @return {void} */ export function updateRootline( currentStep ) { + if (currentStep === STEPS.UNSUCCESS) { + currentStep = STEPS.SUCCESS; + } + const { rootline } = getElements(); const currentItem = rootline.querySelector( `.frm-rootline-item[data-step="${currentStep}"]` ); From efa8d8194922eed4cfdeb6efcfb437668d4b775a Mon Sep 17 00:00:00 2001 From: Sherv Date: Wed, 16 Oct 2024 18:55:11 +0300 Subject: [PATCH 11/24] Fix typo checks error --- classes/controllers/FrmOnboardingWizardController.php | 2 +- .../steps/{unsuccess-step.php => unsuccessful-step.php} | 4 ++-- js/src/onboarding-wizard/shared/constants.js | 2 +- js/src/onboarding-wizard/ui/rootline.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename classes/views/onboarding-wizard/steps/{unsuccess-step.php => unsuccessful-step.php} (85%) diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index b3e8b7ffbd..733fd0299a 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -282,7 +282,7 @@ public static function render() { 'consent-tracking' => 'steps/consent-tracking-step.php', 'install-addons' => 'steps/install-addons-step.php', 'success' => 'steps/success-step.php', - 'unsuccess' => 'steps/unsuccess-step.php', + 'unsuccessful' => 'steps/unsuccessful-step.php', ); include $view_path . 'index.php'; diff --git a/classes/views/onboarding-wizard/steps/unsuccess-step.php b/classes/views/onboarding-wizard/steps/unsuccessful-step.php similarity index 85% rename from classes/views/onboarding-wizard/steps/unsuccess-step.php rename to classes/views/onboarding-wizard/steps/unsuccessful-step.php index 16b3e23816..1a4164f8b6 100644 --- a/classes/views/onboarding-wizard/steps/unsuccess-step.php +++ b/classes/views/onboarding-wizard/steps/unsuccessful-step.php @@ -1,6 +1,6 @@ -
+
diff --git a/js/src/onboarding-wizard/shared/constants.js b/js/src/onboarding-wizard/shared/constants.js index 41465a1c42..05ea545b62 100644 --- a/js/src/onboarding-wizard/shared/constants.js +++ b/js/src/onboarding-wizard/shared/constants.js @@ -6,5 +6,5 @@ export const STEPS = { INITIAL: INITIAL_STEP, INSTALL_ADDONS: 'install-addons', SUCCESS: 'success', - UNSUCCESS: 'unsuccess' + UNSUCCESSFUL: 'unsuccessful' }; diff --git a/js/src/onboarding-wizard/ui/rootline.js b/js/src/onboarding-wizard/ui/rootline.js index d4b7db318c..5b05b3974a 100644 --- a/js/src/onboarding-wizard/ui/rootline.js +++ b/js/src/onboarding-wizard/ui/rootline.js @@ -21,7 +21,7 @@ const COMPLETED_STEP_CLASS = 'frm-completed-step'; * @return {void} */ export function updateRootline( currentStep ) { - if (currentStep === STEPS.UNSUCCESS) { + if (currentStep === STEPS.UNSUCCESSFUL) { currentStep = STEPS.SUCCESS; } From 363f7d0f21ba8dd1e12a1f13fd3e4429d8e44eab Mon Sep 17 00:00:00 2001 From: Sherv Date: Wed, 16 Oct 2024 20:32:14 +0300 Subject: [PATCH 12/24] Remove old codes and clean up --- .../FrmOnboardingWizardController.php | 6 +- classes/views/onboarding-wizard/footer.php | 1 + .../onboarding-wizard/steps/success-step.php | 17 ++-- .../steps/unsuccessful-step.php | 17 ++-- .../dataUtils/setupUsageData.js | 14 ++- js/src/onboarding-wizard/elements/elements.js | 25 +---- .../events/backButtonListener.js | 1 - .../checkProInstallationButtonListener.js | 61 ------------ js/src/onboarding-wizard/events/index.js | 14 --- .../events/saveLicenseButtonListener.js | 10 -- .../events/setupEmailStepButtonListener.js | 92 ------------------- .../skipProInstallationButtonListener.js | 9 -- .../events/skipStepButtonListener.js | 1 - js/src/onboarding-wizard/index.js | 1 - js/src/onboarding-wizard/shared/constants.js | 2 +- js/src/onboarding-wizard/shared/pageState.js | 1 - js/src/onboarding-wizard/ui/index.js | 1 - .../onboarding-wizard/ui/setupInitialView.js | 8 +- js/src/onboarding-wizard/ui/showError.js | 17 ---- .../onboarding-wizard/utils/navigateToStep.js | 4 +- 20 files changed, 37 insertions(+), 265 deletions(-) delete mode 100644 js/src/onboarding-wizard/events/checkProInstallationButtonListener.js delete mode 100644 js/src/onboarding-wizard/events/saveLicenseButtonListener.js delete mode 100644 js/src/onboarding-wizard/events/setupEmailStepButtonListener.js delete mode 100644 js/src/onboarding-wizard/events/skipProInstallationButtonListener.js delete mode 100644 js/src/onboarding-wizard/ui/showError.js diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 733fd0299a..753ce76a6a 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -336,10 +336,7 @@ public static function setup_usage_data() { $usage_data = self::get_usage_data(); $fields_to_update = array( - 'default_email' => 'sanitize_email', - 'is_subscribed' => 'rest_sanitize_boolean', 'allows_tracking' => 'rest_sanitize_boolean', - 'summary_emails' => 'rest_sanitize_boolean', 'installed_addons' => 'sanitize_text_field', 'processed_steps' => 'sanitize_text_field', 'completed_steps' => 'rest_sanitize_boolean', @@ -404,8 +401,7 @@ public static function enqueue_assets() { */ private static function get_js_variables() { return array( - 'INITIAL_STEP' => self::INITIAL_STEP, - 'proIsIncluded' => FrmAppHelper::pro_is_included(), + 'INITIAL_STEP' => self::INITIAL_STEP, ); } diff --git a/classes/views/onboarding-wizard/footer.php b/classes/views/onboarding-wizard/footer.php index e671286273..4cd7566235 100644 --- a/classes/views/onboarding-wizard/footer.php +++ b/classes/views/onboarding-wizard/footer.php @@ -19,6 +19,7 @@ > + > 'frm-justify-center frm-mt-2xl', - 'display-back-button' => false, - 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), - 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), - 'primary-button-role' => false, - 'secondary-button-text' => __( 'Create a Form', 'formidable' ), - 'secondary-button-href' => admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG ), - 'secondary-button-role' => false, + 'footer-class' => 'frm-justify-center frm-mt-2xl', + 'display-back-button' => false, + 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), + 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), + 'primary-button-role' => false, + 'secondary-button-text' => __( 'Create a Form', 'formidable' ), + 'secondary-button-href' => admin_url( 'admin.php?page=' . FrmFormTemplatesController::PAGE_SLUG ), + 'secondary-button-role' => false, + 'secondary-button-skip-step' => false, ) ); ?> diff --git a/classes/views/onboarding-wizard/steps/unsuccessful-step.php b/classes/views/onboarding-wizard/steps/unsuccessful-step.php index 1a4164f8b6..6307547f19 100644 --- a/classes/views/onboarding-wizard/steps/unsuccessful-step.php +++ b/classes/views/onboarding-wizard/steps/unsuccessful-step.php @@ -24,14 +24,15 @@ 'frm-justify-center frm-mt-2xl', - 'display-back-button' => false, - 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), - 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), - 'primary-button-role' => false, - 'secondary-button-text' => __( 'Install Manually', 'formidable' ), - 'secondary-button-href' => admin_url( 'plugin-install.php' ), - 'secondary-button-role' => false, + 'footer-class' => 'frm-justify-center frm-mt-2xl', + 'display-back-button' => false, + 'primary-button-text' => __( 'Go to Dashboard', 'formidable' ), + 'primary-button-href' => admin_url( 'admin.php?page=' . FrmDashboardController::PAGE_SLUG ), + 'primary-button-role' => false, + 'secondary-button-text' => __( 'Install Manually', 'formidable' ), + 'secondary-button-href' => admin_url( 'plugin-install.php' ), + 'secondary-button-role' => false, + 'secondary-button-skip-step' => false, ) ); ?> diff --git a/js/src/onboarding-wizard/dataUtils/setupUsageData.js b/js/src/onboarding-wizard/dataUtils/setupUsageData.js index 3d2a3d1408..f9ea16c205 100644 --- a/js/src/onboarding-wizard/dataUtils/setupUsageData.js +++ b/js/src/onboarding-wizard/dataUtils/setupUsageData.js @@ -1,8 +1,3 @@ -/** - * External dependencies - */ -import { isEmptyObject } from 'core/utils'; - /** * Internal Dependencies */ @@ -38,12 +33,14 @@ function processDataForStep( processedStep, nextStepName ) { let formData; // Append completed steps if moving to the success step - if ( STEPS.SUCCESS === nextStepName ) { + if ( STEPS.SUCCESS === nextStepName || STEPS.UNSUCCESSFUL === nextStepName ) { const { processedSteps } = getState(); + if ( processedSteps.length > 1 ) { - if ( ! processedSteps.includes( STEPS.SUCCESS ) ) { - processedSteps.push( STEPS.SUCCESS ); + if ( ! processedSteps.includes( nextStepName ) ) { + processedSteps.push( nextStepName ); } + formData = new FormData(); formData.append( 'processed_steps', processedSteps.join( ',' ) ); formData.append( 'completed_steps', true ); @@ -53,6 +50,7 @@ function processDataForStep( processedStep, nextStepName ) { // Append installed addons for the addon installation step if ( STEPS.INSTALL_ADDONS === processedStep ) { const { installedAddons } = getState(); + if ( installedAddons.length > 0 ) { formData = formData ?? new FormData(); formData.append( 'installed_addons', installedAddons.join( ',' ) ); diff --git a/js/src/onboarding-wizard/elements/elements.js b/js/src/onboarding-wizard/elements/elements.js index 98c9168d0a..9e518400aa 100644 --- a/js/src/onboarding-wizard/elements/elements.js +++ b/js/src/onboarding-wizard/elements/elements.js @@ -9,35 +9,12 @@ import { createPageElements } from 'core/factory'; import { PREFIX } from '../shared'; export const { getElements, addElements } = createPageElements({ - // Body Elements onboardingWizardPage: document.getElementById( `${PREFIX}-wizard-page` ), container: document.getElementById( `${PREFIX}-container` ), rootline: document.getElementById( `${PREFIX}-rootline` ), steps: document.querySelectorAll( `.${PREFIX}-step` ), skipStepButtons: document.querySelectorAll( `.${PREFIX}-skip-step` ), backButtons: document.querySelectorAll( `.${PREFIX}-back-button` ), - hiddenLicenseKeyInput: document.getElementById( 'frm-license-key' ), - - // Install Formidable Pro Step Elements - checkProInstallationButton: document.getElementById( `${PREFIX}-check-pro-installation-button` ), - skipProInstallationButton: document.getElementById( `${PREFIX}-skip-pro-installation-button` ), - checkProInstallationError: document.getElementById( `${PREFIX}-check-pro-installation-error` ), - - // License Management Step Elements - licenseKeyInput: document.getElementById( 'edd_formidable_pro_license_key' ), - saveLicenseButton: document.getElementById( `${PREFIX}-save-license-button` ), - - // Default Email Address Step Elements - 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` ), - - // Install Formidable Add-ons Step Elements installAddonsButton: document.getElementById( `${PREFIX}-install-addons-button` ), - - // Success Step Elements - successStep: document.getElementById( `${PREFIX}-success-step` ) + hiddenLicenseKeyInput: document.getElementById( 'frm-license-key' ), }); diff --git a/js/src/onboarding-wizard/events/backButtonListener.js b/js/src/onboarding-wizard/events/backButtonListener.js index 3d16a487df..93d941b5b2 100644 --- a/js/src/onboarding-wizard/events/backButtonListener.js +++ b/js/src/onboarding-wizard/events/backButtonListener.js @@ -27,7 +27,6 @@ function addBackButtonEvents() { * Handles the click event on a "Back" button. * * @private - * @param {Event} event The click event object. * @return {void} */ const onBackButtonClick = () => { diff --git a/js/src/onboarding-wizard/events/checkProInstallationButtonListener.js b/js/src/onboarding-wizard/events/checkProInstallationButtonListener.js deleted file mode 100644 index 3e572dfe7b..0000000000 --- a/js/src/onboarding-wizard/events/checkProInstallationButtonListener.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * External dependencies - */ -import { nonce } from 'core/constants'; -import { onClickPreventDefault, show } from 'core/utils'; - -/** - * Internal dependencies - */ -import { getElements } from '../elements'; -import { navigateToNextStep } from '../utils'; - -/** - * Manages event handling for the "Continue" button in the "Install Formidable Pro" step. - * - * @return {void} - */ -function addCheckProInstallationButtonEvents() { - const { checkProInstallationButton } = getElements(); - - // Attach click event listener - onClickPreventDefault( checkProInstallationButton, onCheckProInstallationButtonClick ); -} - -/** - * Handles the click event on the "Continue" button in the "Install Formidable Pro" setup. - * - * @private - * @param {Event} event The click event object. - * @return {void} - */ -const onCheckProInstallationButtonClick = async() => { - // Prepare FormData for the POST request - const formData = new FormData(); - formData.append( 'action', 'frm_check_plugin_activation' ); - formData.append( 'nonce', nonce ); - formData.append( 'plugin_path', 'formidable-pro/formidable-pro.php' ); - - let data; - - try { - const response = await fetch( ajaxurl, { - method: 'POST', - body: formData - }); - data = await response.json(); - } catch ( error ) { - console.error( 'An error occurred:', error ); - return; - } - - if ( data.success ) { - navigateToNextStep(); - return; - } - - const { checkProInstallationError } = getElements(); - show( checkProInstallationError ); -}; - -export default addCheckProInstallationButtonEvents; diff --git a/js/src/onboarding-wizard/events/index.js b/js/src/onboarding-wizard/events/index.js index e50528382f..63170fd454 100644 --- a/js/src/onboarding-wizard/events/index.js +++ b/js/src/onboarding-wizard/events/index.js @@ -9,11 +9,7 @@ import { getQueryParam } from 'core/utils'; */ import addSkipStepButtonEvents from './skipStepButtonListener'; import addBackButtonEvents from './backButtonListener'; -import addSetupEmailStepButtonEvents from './setupEmailStepButtonListener'; import addInstallAddonsButtonEvents from './installAddonsButtonListener'; -import addCheckProInstallationButtonEvents from './checkProInstallationButtonListener'; -import addSkipProInstallationButtonEvents from './skipProInstallationButtonListener'; -import addSaveLicenseButtonEvents from './saveLicenseButtonListener'; import { navigateToStep } from '../utils'; /** @@ -26,20 +22,10 @@ export function addEventListeners() { addSkipStepButtonEvents(); addBackButtonEvents(); - // Add event handling for the "Next Step" button in the "Default Email Address" step - addSetupEmailStepButtonEvents(); - - // Add event handling for the "Active & continue" button in the "License Management" step. - addSaveLicenseButtonEvents(); - // Add event handling for the "Install & Finish Setup" button in the "Install Formidable Add-ons" step addInstallAddonsButtonEvents(); // Add event handling for an option-box addOptionBoxEvents(); - - // Add event handling for the "Continue" and "Skip" buttons in the "Install Formidable Pro" step - addCheckProInstallationButtonEvents(); - addSkipProInstallationButtonEvents(); } /** diff --git a/js/src/onboarding-wizard/events/saveLicenseButtonListener.js b/js/src/onboarding-wizard/events/saveLicenseButtonListener.js deleted file mode 100644 index 152e324212..0000000000 --- a/js/src/onboarding-wizard/events/saveLicenseButtonListener.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Manages event handling for the "Active & continue" button in the "License Management" step. - * - * @return {void} - */ -function addSaveLicenseButtonEvents() { -} - - -export default addSaveLicenseButtonEvents; diff --git a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js b/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js deleted file mode 100644 index a8b0fdb659..0000000000 --- a/js/src/onboarding-wizard/events/setupEmailStepButtonListener.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * External dependencies - */ -import { onClickPreventDefault, isValidEmail } from 'core/utils'; - -/** - * Internal dependencies - */ -import { getElements } from '../elements'; -import { getState, setSingleState } from '../shared'; -import { showEmailAddressError } from '../ui'; -import { navigateToNextStep } from '../utils'; - -/** - * Manages event handling for the "Next Step" button in the "Default Email Address" step. - * - * @return {void} - */ -function addSetupEmailStepButtonEvents() { - const { setupEmailStepButton } = getElements(); - - // Attach click event listener - onClickPreventDefault( setupEmailStepButton, onSetupEmailStepButtonClick ); -} - -const validateEmails = emailInputs => { - let isValid = true; - emailInputs.forEach( input => { - const emailAddress = input.value.trim(); - if ( ! isValidEmail( emailAddress ) ) { - showEmailAddressError( 'invalid', input ); - isValid = false; - } - }); - return isValid; -}; - -/** - * Handles the click event on the "Next Step" button in the "Default Email Address" step. - * - * @private - * - * @return {void} - */ -const onSetupEmailStepButtonClick = async() => { - const { defaultEmailField, defaultFromEmailField } = getElements(); - - // Check if the emails are valid - if ( ! validateEmails( [ defaultFromEmailField, defaultEmailField ] ) ) { - return; - } - - 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 ) { - // Assign default email to 'leave email' input if provided; otherwise, use administrator's email - if ( email ) { - const emailInput = document.getElementById( 'frm_leave_email' ); - emailInput.value = email; - } - - frmAdminBuild.addMyEmailAddress(); - // Avoid replacing `#frm_leave_email_wrapper` content with a success message after email setup to prevent errors during modifications. - wp.hooks.addFilter( 'frm_thank_you_on_signup', 'frmOnboardingWizard', () => false ); - } - - // Capture usage data - const { emailStepData } = getState(); - emailStepData.default_email = email; - emailStepData.from_email = defaultFromEmailField.value.trim(); - emailStepData.allows_tracking = allowTrackingCheckbox.checked; - emailStepData.summary_emails = summaryEmailsCheckbox.checked; - if ( subscribeCheckbox ) { - emailStepData.is_subscribed = subscribeCheckbox.checked; - } - setSingleState( 'emailStepData', emailStepData ); - - // 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 ); - - // Send the POST request - const { doJsonPost } = frmDom.ajax; - doJsonPost( 'onboarding_setup_email_step', formData ).then( navigateToNextStep ); -}; - -export default addSetupEmailStepButtonEvents; diff --git a/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js b/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js deleted file mode 100644 index 51c398af73..0000000000 --- a/js/src/onboarding-wizard/events/skipProInstallationButtonListener.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Manages event handling for the "Skip" button in the "Install Formidable Pro" step. - * - * @return {void} - */ -function addSkipProInstallationButtonEvents() { -} - -export default addSkipProInstallationButtonEvents; diff --git a/js/src/onboarding-wizard/events/skipStepButtonListener.js b/js/src/onboarding-wizard/events/skipStepButtonListener.js index 6294f685b5..b4e11eb1b8 100644 --- a/js/src/onboarding-wizard/events/skipStepButtonListener.js +++ b/js/src/onboarding-wizard/events/skipStepButtonListener.js @@ -27,7 +27,6 @@ function addSkipStepButtonEvents() { * Handles the click event on a "Skip" step button. * * @private - * @param {Event} event The click event object. * @return {void} */ const onSkipStepButtonClick = () => { diff --git a/js/src/onboarding-wizard/index.js b/js/src/onboarding-wizard/index.js index eb33d0e833..ac4f5a113b 100644 --- a/js/src/onboarding-wizard/index.js +++ b/js/src/onboarding-wizard/index.js @@ -9,6 +9,5 @@ import domReady from '@wordpress/dom-ready'; import initializeOnboardingWizard from './initializeOnboardingWizard'; domReady( () => { - // Initialize the Onboarding Wizard initializeOnboardingWizard(); }); diff --git a/js/src/onboarding-wizard/shared/constants.js b/js/src/onboarding-wizard/shared/constants.js index 05ea545b62..50ccbf3e4c 100644 --- a/js/src/onboarding-wizard/shared/constants.js +++ b/js/src/onboarding-wizard/shared/constants.js @@ -1,4 +1,4 @@ -export const { INITIAL_STEP, proIsIncluded } = window.frmOnboardingWizardVars; +export const { INITIAL_STEP } = window.frmOnboardingWizardVars; export const PREFIX = 'frm-onboarding'; diff --git a/js/src/onboarding-wizard/shared/pageState.js b/js/src/onboarding-wizard/shared/pageState.js index 9df38b9a69..b1b221270c 100644 --- a/js/src/onboarding-wizard/shared/pageState.js +++ b/js/src/onboarding-wizard/shared/pageState.js @@ -6,5 +6,4 @@ import { createPageState } from 'core/factory'; export const { getState, getSingleState, setState, setSingleState } = createPageState({ processedSteps: [], installedAddons: [], - emailStepData: {}, }); diff --git a/js/src/onboarding-wizard/ui/index.js b/js/src/onboarding-wizard/ui/index.js index 2acbeabeb9..e54a5688f1 100644 --- a/js/src/onboarding-wizard/ui/index.js +++ b/js/src/onboarding-wizard/ui/index.js @@ -1,3 +1,2 @@ export { default as setupInitialView } from './setupInitialView'; -export * from './showError'; export * from './rootline'; diff --git a/js/src/onboarding-wizard/ui/setupInitialView.js b/js/src/onboarding-wizard/ui/setupInitialView.js index 7b57b21774..4c5bf27483 100644 --- a/js/src/onboarding-wizard/ui/setupInitialView.js +++ b/js/src/onboarding-wizard/ui/setupInitialView.js @@ -43,9 +43,15 @@ function navigateToInitialStep() { * @return {string} The name of the initial step to navigate to. */ function determineInitialStep() { + const isConnectedAccount = getQueryParam( 'success' ); + + if ( isConnectedAccount === '0' ) { + return STEPS.UNSUCCESSFUL; + } + const { hiddenLicenseKeyInput } = getElements(); - if ( hiddenLicenseKeyInput || hasQueryParam( 'success' ) ) { + if ( hiddenLicenseKeyInput || isConnectedAccount ) { return STEPS.SUCCESS; } diff --git a/js/src/onboarding-wizard/ui/showError.js b/js/src/onboarding-wizard/ui/showError.js deleted file mode 100644 index 78a47b8fd4..0000000000 --- a/js/src/onboarding-wizard/ui/showError.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * External dependencies - */ -import { showFormError } from 'core/utils'; - -/** - * Displays errors related to the email address field. - * - * @since 6.15 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 ) => { - showFormError( `#${input.id}`, `#${input.nextElementSibling.id}`, type ); -}; diff --git a/js/src/onboarding-wizard/utils/navigateToStep.js b/js/src/onboarding-wizard/utils/navigateToStep.js index 455f23d136..3fb4379bb8 100644 --- a/js/src/onboarding-wizard/utils/navigateToStep.js +++ b/js/src/onboarding-wizard/utils/navigateToStep.js @@ -39,8 +39,8 @@ export const navigateToStep = ( stepName, updateMethod = 'pushState' ) => { show( targetStep ); new frmAnimate( targetStep ).fadeIn(); - const { onboardingWizardPage } = getElements(); // Update the onboarding wizard's current step attribute + const { onboardingWizardPage } = getElements(); onboardingWizardPage.setAttribute( 'data-current-step', stepName ); // Update the URL query parameter, with control over history update method @@ -73,8 +73,8 @@ export const navigateToNextStep = () => { processedSteps.push( processedStep ); setSingleState( 'processedSteps', processedSteps ); } - setupUsageData( processedStep, nextStepName ); + navigateToStep( nextStepName ); }; From 71505111557b4de9fa61b9e1ef6add795711b13d Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 17 Oct 2024 16:41:33 +0300 Subject: [PATCH 13/24] Add "ajax_consent_tracking" --- classes/controllers/FrmHooksController.php | 2 +- .../FrmOnboardingWizardController.php | 16 +++------ js/src/onboarding-wizard/elements/elements.js | 4 +++ .../events/consentTrackingButtonListener.js | 35 +++++++++++++++++++ js/src/onboarding-wizard/events/index.js | 3 ++ .../onboarding-wizard/ui/setupInitialView.js | 2 +- 6 files changed, 48 insertions(+), 14 deletions(-) create mode 100644 js/src/onboarding-wizard/events/consentTrackingButtonListener.js diff --git a/classes/controllers/FrmHooksController.php b/classes/controllers/FrmHooksController.php index ac9c3ed118..e11b496219 100644 --- a/classes/controllers/FrmHooksController.php +++ b/classes/controllers/FrmHooksController.php @@ -218,7 +218,7 @@ public static function load_ajax_hooks() { add_action( 'wp_ajax_frm_deauthorize', 'FrmAppController::deauthorize' ); // Onboarding Wizard Controller. - add_action( 'wp_ajax_frm_onboarding_setup_email_step', 'FrmOnboardingWizardController::ajax_setup_email_step' ); + add_action( 'wp_ajax_frm_onboarding_consent_tracking', 'FrmOnboardingWizardController::ajax_consent_tracking' ); add_action( 'wp_ajax_frm_onboarding_setup_usage_data', 'FrmOnboardingWizardController::setup_usage_data' ); // Addons. diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 753ce76a6a..bc765774ea 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -289,29 +289,21 @@ public static function render() { } /** - * Handle AJAX request to setup the "Default Email Address" step. + * Handle AJAX request to setup the "Never miss an important update" step. * * @since 6.9 * * @return void */ - public static function ajax_setup_email_step() { + public static function ajax_consent_tracking() { // Check permission and nonce. FrmAppHelper::permission_check( self::REQUIRED_CAPABILITY ); check_ajax_referer( 'frm_ajax', 'nonce' ); - // Get posted data. - $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' ); - // 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' ); + $frm_settings->update_setting( 'tracking', true, 'rest_sanitize_boolean' ); + // Remove the 'FrmProSettingsController::store' action to avoid PHP errors during AJAX call. remove_action( 'frm_store_settings', 'FrmProSettingsController::store' ); $frm_settings->store(); diff --git a/js/src/onboarding-wizard/elements/elements.js b/js/src/onboarding-wizard/elements/elements.js index 9e518400aa..5bd720b3a3 100644 --- a/js/src/onboarding-wizard/elements/elements.js +++ b/js/src/onboarding-wizard/elements/elements.js @@ -11,10 +11,14 @@ import { PREFIX } from '../shared'; export const { getElements, addElements } = createPageElements({ onboardingWizardPage: document.getElementById( `${PREFIX}-wizard-page` ), container: document.getElementById( `${PREFIX}-container` ), + rootline: document.getElementById( `${PREFIX}-rootline` ), steps: document.querySelectorAll( `.${PREFIX}-step` ), skipStepButtons: document.querySelectorAll( `.${PREFIX}-skip-step` ), backButtons: document.querySelectorAll( `.${PREFIX}-back-button` ), + + consentTrackingButton: document.getElementById( `${PREFIX}-consent-tracking` ), installAddonsButton: document.getElementById( `${PREFIX}-install-addons-button` ), + hiddenLicenseKeyInput: document.getElementById( 'frm-license-key' ), }); diff --git a/js/src/onboarding-wizard/events/consentTrackingButtonListener.js b/js/src/onboarding-wizard/events/consentTrackingButtonListener.js new file mode 100644 index 0000000000..f96c602ed9 --- /dev/null +++ b/js/src/onboarding-wizard/events/consentTrackingButtonListener.js @@ -0,0 +1,35 @@ +/** + * External dependencies + */ +import { onClickPreventDefault } from 'core/utils'; + +/** + * Internal dependencies + */ +import { getElements } from '../elements'; +import { navigateToNextStep } from '../utils'; + +/** + * Manages event handling for the "Allow & Continue" button in the "Never miss an important update" step. + * + * @return {void} + */ +function addConsentTrackingButtonEvents() { + const { consentTrackingButton } = getElements(); + + // Attach click event listener + onClickPreventDefault( consentTrackingButton, onConsentTrackingButtonClick ); +} + +/** + * Handles the click event on the "Allow & Continue" button in the "Never miss an important update" step. + * + * @private + * @return {void} + */ +const onConsentTrackingButtonClick = async() => { + const { doJsonPost } = frmDom.ajax; + doJsonPost( 'onboarding_consent_tracking', new FormData() ).then( navigateToNextStep ); +}; + +export default addConsentTrackingButtonEvents; diff --git a/js/src/onboarding-wizard/events/index.js b/js/src/onboarding-wizard/events/index.js index 63170fd454..4f0fe84be0 100644 --- a/js/src/onboarding-wizard/events/index.js +++ b/js/src/onboarding-wizard/events/index.js @@ -9,6 +9,7 @@ import { getQueryParam } from 'core/utils'; */ import addSkipStepButtonEvents from './skipStepButtonListener'; import addBackButtonEvents from './backButtonListener'; +import addConsentTrackingButtonEvents from './consentTrackingButtonListener'; import addInstallAddonsButtonEvents from './installAddonsButtonListener'; import { navigateToStep } from '../utils'; @@ -22,6 +23,8 @@ export function addEventListeners() { addSkipStepButtonEvents(); addBackButtonEvents(); + addConsentTrackingButtonEvents(); + // Add event handling for the "Install & Finish Setup" button in the "Install Formidable Add-ons" step addInstallAddonsButtonEvents(); // Add event handling for an option-box diff --git a/js/src/onboarding-wizard/ui/setupInitialView.js b/js/src/onboarding-wizard/ui/setupInitialView.js index 4c5bf27483..73c9f42ed5 100644 --- a/js/src/onboarding-wizard/ui/setupInitialView.js +++ b/js/src/onboarding-wizard/ui/setupInitialView.js @@ -52,7 +52,7 @@ function determineInitialStep() { const { hiddenLicenseKeyInput } = getElements(); if ( hiddenLicenseKeyInput || isConnectedAccount ) { - return STEPS.SUCCESS; + return STEPS.INSTALL_ADDONS; } return getQueryParam( 'step' ) || STEPS.INITIAL; From 0fb2f1aabb8026c8eca8deb26ad3cb5bbcce2493 Mon Sep 17 00:00:00 2001 From: Sherv Date: Thu, 17 Oct 2024 16:45:07 +0300 Subject: [PATCH 14/24] Add auto-generated js file --- js/onboarding-wizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/onboarding-wizard.js b/js/onboarding-wizard.js index 7cc97877f3..1215ceb9f9 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";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n1&&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 r,n;return r=t,n=[{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(u.set(t,e),c.search=u.toString(),["pushState","replaceState"].includes(l)){var s=(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[l](s,"",c)}return c.toString()},h=window.frmGlobal,p=(h.url,h.nonce),y="frm_hidden",d="frm-current",v="frm-checked",m=function(t){return null==t?void 0:t.classList.remove(y)},g=function(t){return null==t?void 0:t.classList.add(y)},b=window.frmDom.span;function w(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 E(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==I(t)||null===t)throw new Error("createPageState: initialState must be a non-null object");var e=t;return{getState:function(){return e},getSingleState:function(t){var r=Reflect.get(e,t);return void 0===r?null:r},setState:function(t){if("object"!==I(t)||null===t)throw new Error("setState: newState must be a non-null object");e=A(A({},e),t)},setSingleState:function(t,r){Reflect.has(e,t)&&Reflect.set(e,t,r)}}}({processedSteps:[],installedAddons:[],emailStepData:{}}),N=T.getState,F=(T.getSingleState,T.setState,T.setSingleState),D=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==S(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==S(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=E(E({},e),t)}}}({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"),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")),licenseManagementStep:document.getElementById("".concat(O,"-license-management-step")),licenseKeyInput:document.getElementById("edd_formidable_pro_license_key"),saveLicenseButton:document.getElementById("".concat(O,"-save-license-button")),welcomeStep:document.getElementById(j),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")),installAddonsButton:document.getElementById("".concat(O,"-install-addons-button")),successStep:document.getElementById("".concat(O,"-success-step"))}),B=D.getElements;function G(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(a.includes(k.SUCCESS)||a.push(k.SUCCESS),(r=new FormData).append("processed_steps",a.join(",")),r.append("completed_steps",!0))}if(k.DEFAULT_EMAIL_ADDRESS===t){var c=N().emailStepData;if(i=c,0!==Object.keys(i).length||i.constructor!==Object){var u;r=null!==(u=r)&&void 0!==u?u:new FormData;for(var l=0,s=Object.entries(c);l0&&(r=null!==(y=r)&&void 0!==y?y:new FormData).append("installed_addons",d.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 o=document.querySelector(".".concat(O,"-step.").concat(d));o&&(o.classList.remove(d),g(o)),r.classList.add(d),m(r),new n(r).fadeIn(),B().onboardingWizardPage.setAttribute("data-current-step",t),f("step",t,e)}},R=function(){var t=document.querySelector(".".concat(O,"-step.").concat(d)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,o=N().processedSteps;o.includes(r)||(o.push(r),F("processedSteps",o)),C(r,n),M(n)}};function U(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),P(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;P(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(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),m(i),o.addEventListener("keyup",(function(){g(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},H=function(){var t,e=(t=J().mark((function t(){var e,r,n,o,i,a,c,u,l,s,f;return J().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=B(),r=e.defaultEmailField,n=e.defaultFromEmailField,Z([n,r])){t.next=3;break}return t.abrupt("return");case 3:o=B(),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=N(),(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),F("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(R);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){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 Q(t){return Q="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},Q(t)}function X(){X=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 A(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"==Q(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(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),P(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;P(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 tt(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 et(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)?et(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 et(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),P(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;P(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 lt(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 st=function(){var t,e=(t=ut().mark((function t(){var e,r,n,o,i;return ut().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=new FormData).append("action","frm_check_plugin_activation"),e.append("nonce",p),e.append("plugin_path","formidable-pro/formidable-pro.php"),t.prev=4,t.next=7,fetch(ajaxurl,{method:"POST",body:e});case 7:return n=t.sent,t.next=10,n.json();case 10:r=t.sent,t.next=17;break;case 13:return t.prev=13,t.t0=t.catch(4),console.error("An error occurred:",t.t0),t.abrupt("return");case 17:if(!r.success){t.next=20;break}return R(),t.abrupt("return");case 20:o=B(),i=o.checkProInstallationError,m(i);case 22:case"end":return t.stop()}}),t,null,[[4,13]])})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){lt(i,n,o,a,c,"next",t)}function c(t){lt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function ft(t){return ft="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},ft(t)}function ht(){ht=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 A(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"==ft(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(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),P(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;P(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 pt(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 yt=function(){var t,e=(t=ht().mark((function t(){return ht().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:M(k.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){pt(i,n,o,a,c,"next",t)}function c(t){pt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function dt(t){return dt="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},dt(t)}function vt(){vt=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 A(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"==dt(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(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),P(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;P(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 mt(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 gt=function(){var t,e=(t=vt().mark((function t(){return vt().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",k.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){mt(i,n,o,a,c,"next",t)}function c(t){mt(i,n,o,a,c,"throw",t)}a(void 0)}))});return function(){return e.apply(this,arguments)}}();function bt(){var t,e,r,n,o;B().skipStepButtons.forEach((function(t){i(t,W)})),B().backButtons.forEach((function(t){i(t,K)})),o=B().setupEmailStepButton,i(o,H),n=B().saveLicenseButton,i(n,gt),r=B().installAddonsButton,i(r,ot),document.querySelectorAll(Y).forEach((function(t){t.addEventListener("click",z)})),e=B().checkProInstallationButton,i(e,st),t=B().skipProInstallationButton,i(t,yt)}window.addEventListener("popstate",(function(t){var e,r=(null===(e=t.state)||void 0===e?void 0:e.step)||l("step");M(r,"replaceState")}));var wt;wt=function(){q(),bt()},"undefined"!=typeof document&&("complete"!==document.readyState&&"interactive"!==document.readyState?document.addEventListener("DOMContentLoaded",wt):wt())}(); \ No newline at end of file +!function(){"use strict";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n1&&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()},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):00&&void 0!==arguments[0]?arguments[0]:{};if("object"!==O(t)||null===t)throw new Error("createPageState: initialState must be a non-null object");var e=t;return{getState:function(){return e},getSingleState:function(t){var r=Reflect.get(e,t);return void 0===r?null:r},setState:function(t){if("object"!==O(t)||null===t)throw new Error("setState: newState must be a non-null object");e=L(L({},e),t)},setSingleState:function(t,r){Reflect.has(e,t)&&Reflect.set(e,t,r)}}}({processedSteps:[],installedAddons:[]}),P=x.getState,_=(x.getSingleState,x.setState,x.setSingleState),k=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==g(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==g(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=v(v({},e),t)}}}({onboardingWizardPage:document.getElementById("".concat(w,"-wizard-page")),container:document.getElementById("".concat(w,"-container")),rootline:document.getElementById("".concat(w,"-rootline")),steps:document.querySelectorAll(".".concat(w,"-step")),skipStepButtons:document.querySelectorAll(".".concat(w,"-skip-step")),backButtons:document.querySelectorAll(".".concat(w,"-back-button")),consentTrackingButton:document.getElementById("".concat(w,"-consent-tracking")),installAddonsButton:document.getElementById("".concat(w,"-install-addons-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")}),T=k.getElements;k.addElements;var A=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",o=document.querySelector(".".concat(w,'-step[data-step-name="').concat(t,'"]'));if(o){var i=document.querySelector(".".concat(w,"-step.").concat(y));i&&(i.classList.remove(y),null==(e=i)||e.classList.add(h)),o.classList.add(y),function(t){null==t||t.classList.remove(h)}(o),new n(o).fadeIn(),T().onboardingWizardPage.setAttribute("data-current-step",t),function(t,e){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pushState";if(u.set(t,e),c.search=u.toString(),["pushState","replaceState"].includes(i)){var l=(r={},o=e,(n=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(n=t))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[i](l,"",c)}c.toString()}("step",t,r),function(t){t===S.UNSUCCESSFUL&&(t=S.SUCCESS);var e=T().rootline,r=e.querySelector('.frm-rootline-item[data-step="'.concat(t,'"]'));e.querySelectorAll(".frm-rootline-item").forEach((function(t){t.classList.remove(N),t.classList.remove(y)}));var n=r.previousElementSibling;if(n)for(;n;)n.classList.add(N),n=n.previousElementSibling;t===S.SUCCESS?r.classList.add(N):r.classList.add(y)}(t)}},I=function(){var t=document.querySelector(".".concat(w,"-step.").concat(y)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,o=P().processedSteps;o.includes(r)||(o.push(r),_("processedSteps",o)),function(t,e){var r=function(t,e){var r;if(S.SUCCESS===e||S.UNSUCCESSFUL===e){var n=P().processedSteps;n.length>1&&(n.includes(e)||n.push(e),(r=new FormData).append("processed_steps",n.join(",")),r.append("completed_steps",!0))}if(S.INSTALL_ADDONS===t){var o,i=P().installedAddons;i.length>0&&(r=null!==(o=r)&&void 0!==o?o:new FormData).append("installed_addons",i.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)}(r,n),A(n)}};var N="frm-completed-step",D=".frm-option-box";function C(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(D).classList.toggle("frm-checked")}var F=function(){I()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(w,"-step.").concat(y)))?void 0:t.previousElementSibling)&&A(e.dataset.stepName)};function G(t){return G="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},G(t)}function B(){B=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 T(n||[]);return o(a,"_invoke",{value:x(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 p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(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"==G(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 x(e,r,n){var o=p;return function(i,a){if(o===y)throw 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=P(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===p)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:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(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,P(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 _(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(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),k(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;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function q(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 Y=function(){var t,e=(t=B().mark((function t(){return B().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(0,frmDom.ajax.doJsonPost)("onboarding_consent_tracking",new FormData).then(I);case 2: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){q(i,n,o,a,c,"next",t)}function c(t){q(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 R(){R=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 T(n||[]);return o(a,"_invoke",{value:x(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 p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(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 x(e,r,n){var o=p;return function(i,a){if(o===y)throw 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=P(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===p)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:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(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,P(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 _(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(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),k(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;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function W(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 J(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(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 J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r Date: Thu, 17 Oct 2024 19:36:15 +0300 Subject: [PATCH 15/24] Add missed semicolon after border-color property --- css/frm_admin.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/frm_admin.css b/css/frm_admin.css index 7509e76d04..ba79fb987d 100644 --- a/css/frm_admin.css +++ b/css/frm_admin.css @@ -9515,7 +9515,7 @@ Responsive Design } .frm-cta-green.frm-cta-border .frm-cta-footer { - border-color: var(--success-100) + border-color: var(--success-100); } .frm-cta-red { From f3eebb74d69008961509a8159dabc1adfcbb31c3 Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Fri, 18 Oct 2024 10:54:53 -0300 Subject: [PATCH 16/24] Add active campaign subscribe --- .../FrmOnboardingWizardController.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index bc765774ea..2fc9d6aace 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -308,10 +308,42 @@ public static function ajax_consent_tracking() { remove_action( 'frm_store_settings', 'FrmProSettingsController::store' ); $frm_settings->store(); + self::subscribe_to_active_campaign(); + // Send response. wp_send_json_success(); } + /** + * When the user consents to receiving news of updates, subscribe their email to ActiveCampaign. + * + * @since x.x + * + * @return void + */ + private static function subscribe_to_active_campaign() { + $user = wp_get_current_user(); + if ( empty( $user->user_email ) ) { + return; + } + + wp_remote_post( + 'https://sandbox.formidableforms.com/api/wp-admin/admin-ajax.php?action=frm_forms_preview&form=subscribe-onboarding', + array( + 'body' => http_build_query( + array( + 'form_key' => 'subscribe-onboarding', + 'frm_action' => 'create', + 'form_id' => 5, + 'item_key' => '', + 'item_meta[0]' => '', + 'item_meta[15]' => $user->user_email, + ) + ) + ) + ); + } + /** * Handle AJAX request to set up usage data for the Onboarding Wizard. * From 4a403cf952df280862c4a1c9e4ae6c117346bfff Mon Sep 17 00:00:00 2001 From: Sherv Date: Fri, 18 Oct 2024 16:56:49 +0300 Subject: [PATCH 17/24] Tweak: Fix lint error and enhance a condition --- classes/views/onboarding-wizard/footer.php | 2 +- js/src/onboarding-wizard/ui/rootline.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/views/onboarding-wizard/footer.php b/classes/views/onboarding-wizard/footer.php index 4cd7566235..0f6100bc2a 100644 --- a/classes/views/onboarding-wizard/footer.php +++ b/classes/views/onboarding-wizard/footer.php @@ -24,7 +24,7 @@ 'true' ) ); } ?> diff --git a/js/src/onboarding-wizard/ui/rootline.js b/js/src/onboarding-wizard/ui/rootline.js index 5b05b3974a..fe9f4fe6fa 100644 --- a/js/src/onboarding-wizard/ui/rootline.js +++ b/js/src/onboarding-wizard/ui/rootline.js @@ -21,7 +21,7 @@ const COMPLETED_STEP_CLASS = 'frm-completed-step'; * @return {void} */ export function updateRootline( currentStep ) { - if (currentStep === STEPS.UNSUCCESSFUL) { + if ( currentStep === STEPS.UNSUCCESSFUL ) { currentStep = STEPS.SUCCESS; } From 0b301cb1acd6157a753dfeda7166bb74985d7c7f Mon Sep 17 00:00:00 2001 From: Sherv Date: Fri, 18 Oct 2024 16:59:41 +0300 Subject: [PATCH 18/24] Tweak: fix PHPCS error --- classes/controllers/FrmOnboardingWizardController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 2fc9d6aace..e24b097f99 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -339,7 +339,7 @@ private static function subscribe_to_active_campaign() { 'item_meta[0]' => '', 'item_meta[15]' => $user->user_email, ) - ) + ), ) ); } From 4a956d3b3f3fcf5adf08b68cd56d5918baa88cae Mon Sep 17 00:00:00 2001 From: Mike Letellier Date: Mon, 21 Oct 2024 10:29:06 -0300 Subject: [PATCH 19/24] Also pass the Active Campaign tag --- classes/controllers/FrmOnboardingWizardController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index e24b097f99..9d5be6dc94 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -338,6 +338,7 @@ private static function subscribe_to_active_campaign() { 'item_key' => '', 'item_meta[0]' => '', 'item_meta[15]' => $user->user_email, + 'item_meta[17]' => 'Source - FF Lite Plugin Onboarding', ) ), ) From 5493c921764ce0650625747f6b14e498d71887e1 Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 21 Oct 2024 22:20:29 +0300 Subject: [PATCH 20/24] Update "set_available_addons" method --- .../FrmOnboardingWizardController.php | 142 ++++++++++-------- 1 file changed, 79 insertions(+), 63 deletions(-) diff --git a/classes/controllers/FrmOnboardingWizardController.php b/classes/controllers/FrmOnboardingWizardController.php index 9d5be6dc94..5ad5cd5c86 100644 --- a/classes/controllers/FrmOnboardingWizardController.php +++ b/classes/controllers/FrmOnboardingWizardController.php @@ -564,7 +564,9 @@ public static function get_available_addons() { */ private static function set_available_addons() { $pro_is_installed = FrmAppHelper::pro_is_installed(); + $plugins = get_plugins(); + // Base add-ons always included. self::$available_addons['spam-protection'] = array( 'title' => esc_html__( 'Spam Protection', 'formidable' ), 'is-checked' => true, @@ -577,6 +579,8 @@ private static function set_available_addons() { 'is-disabled' => true, 'help-text' => esc_html__( 'Collect donations and payments with your forms. Offer physical products, digital goods, services, and more.', 'formidable' ), ); + + // Add-ons included when Pro is not installed. if ( ! $pro_is_installed ) { self::$available_addons['visual-styler'] = array( 'title' => esc_html__( 'Visual Styler', 'formidable' ), @@ -591,79 +595,91 @@ private static function set_available_addons() { 'help-text' => esc_html__( 'Save form submissions to your database for future reference and analysis.', 'formidable' ), ); } + + // SMTP add-on if wp_mail_smtp is not installed. if ( ! function_exists( 'wp_mail_smtp' ) ) { + $wp_mail_smtp_plugin = 'wp-mail-smtp/wp_mail_smtp.php'; + $is_installed_wp_mail_smtp = array_key_exists( $wp_mail_smtp_plugin, $plugins ); + self::$available_addons['wp-mail-smtp'] = array( - 'title' => esc_html__( 'SMTP', 'formidable' ), - 'rel' => 'wp-mail-smtp', - 'is-checked' => false, - 'is-vendor' => true, - 'help-text' => esc_html__( 'Improve email deliverability by routing WordPress emails through SMTP.', 'formidable' ), + 'title' => esc_html__( 'SMTP', 'formidable' ), + 'rel' => $is_installed_wp_mail_smtp ? $wp_mail_smtp_plugin : 'wp-mail-smtp', + 'is-checked' => false, + 'is-vendor' => true, + 'is-installed' => $is_installed_wp_mail_smtp, + 'help-text' => esc_html__( 'Improve email deliverability by routing WordPress emails through SMTP.', 'formidable' ), ); } + + // Add-ons available when Pro is installed. if ( $pro_is_installed ) { - $views_addon = FrmAddonsController::get_addon( 'views' ); - $mailchimp_addon = FrmAddonsController::get_addon( 'mailchimp' ); - $registration_addon = FrmAddonsController::get_addon( 'registration' ); - $api_addon = FrmAddonsController::get_addon( 'api' ); - $acf_addon = FrmAddonsController::get_addon( 'acf' ); - $signature_addon = FrmAddonsController::get_addon( 'signature' ); - - if ( ! is_plugin_active( 'formidable-views/formidable-views.php' ) && isset( $views_addon['url'] ) ) { - self::$available_addons['formidable-views'] = array( - 'title' => esc_html__( 'Views', 'formidable' ), - 'rel' => $views_addon['url'], - 'is-checked' => false, - 'help-text' => $views_addon['excerpt'], - ); - } - if ( ! is_plugin_active( 'formidable-mailchimp/formidable-mailchimp.php' ) && isset( $mailchimp_addon['url'] ) ) { - self::$available_addons['formidable-mailchimp'] = array( - 'title' => esc_html__( 'Mailchimp', 'formidable' ), - 'rel' => $mailchimp_addon['url'], - 'is-checked' => false, - 'help-text' => $mailchimp_addon['excerpt'], - ); - } - if ( ! is_plugin_active( 'formidable-registration/formidable-registration.php' ) && isset( $registration_addon['url'] ) ) { - self::$available_addons['formidable-registration'] = array( - 'title' => esc_html__( 'User Registration', 'formidable' ), - 'rel' => $registration_addon['url'], - 'is-checked' => false, - 'help-text' => $registration_addon['excerpt'], - ); - } - if ( ! is_plugin_active( 'formidable-api/formidable-api.php' ) && isset( $api_addon['url'] ) ) { - self::$available_addons['formidable-api'] = array( - 'title' => esc_html__( 'Form Rest API', 'formidable' ), - 'rel' => $api_addon['url'], - 'is-checked' => false, - 'help-text' => $api_addon['excerpt'], - ); - } - if ( class_exists( 'ACF' ) && ! is_plugin_active( 'formidable-acf/formidable-acf.php' ) && isset( $acf_addon['url'] ) ) { - self::$available_addons['formidable-acf'] = array( - 'title' => esc_html__( 'ACF Forms', 'formidable' ), - 'rel' => $acf_addon['url'], - 'is-checked' => false, - 'help-text' => $acf_addon['excerpt'], + $available_pro_addons = array( + 'formidable-views' => array( + 'addon_key' => 'views', + 'title' => __( 'Views', 'formidable' ), + 'plugin_file' => 'formidable-views/formidable-views.php', + ), + 'formidable-mailchimp' => array( + 'addon_key' => 'mailchimp', + 'title' => __( 'Mailchimp', 'formidable' ), + 'plugin_file' => 'formidable-mailchimp/formidable-mailchimp.php', + ), + 'formidable-registration' => array( + 'addon_key' => 'registration', + 'title' => __( 'User Registration', 'formidable' ), + 'plugin_file' => 'formidable-registration/formidable-registration.php', + ), + 'formidable-api' => array( + 'addon_key' => 'api', + 'title' => __( 'Form Rest API', 'formidable' ), + 'plugin_file' => 'formidable-api/formidable-api.php', + ), + 'formidable-signature' => array( + 'addon_key' => 'signature', + 'title' => __( 'Signature Forms', 'formidable' ), + 'plugin_file' => 'formidable-signature/signature.php', + ), + ); + + // Include ACF Forms add-on if ACF is installed. + if ( class_exists( 'ACF' ) ) { + $available_pro_addons['formidable-acf'] = array( + 'addon_key' => 'acf', + 'title' => __( 'ACF Forms', 'formidable' ), + 'plugin_file' => 'formidable-acf/formidable-acf.php', ); } - if ( ! is_plugin_active( 'formidable-signature/signature.php' ) && isset( $signature_addon['url'] ) ) { - self::$available_addons['formidable-signature'] = array( - 'title' => esc_html__( 'Signature Forms', 'formidable' ), - 'rel' => $signature_addon['url'], - 'is-checked' => false, - 'help-text' => $signature_addon['excerpt'], - ); + + foreach ( $available_pro_addons as $key => $data ) { + $addon = FrmAddonsController::get_addon( $data['addon_key'] ); + $plugin_file = $data['plugin_file']; + + if ( ! is_plugin_active( $plugin_file ) && isset( $addon['url'] ) ) { + $is_installed = array_key_exists( $plugin_file, $plugins ); + + self::$available_addons[ $key ] = array( + 'title' => $data['title'], + 'rel' => $is_installed ? $plugin_file : $addon['url'], + 'is-checked' => false, + 'is-installed' => $is_installed, + 'help-text' => $addon['excerpt'], + ); + } } }//end if - if ( class_exists( 'GFForms' ) && ! is_plugin_active( 'formidable-gravity-forms-importer/formidable-gravity-forms-importer.php' ) ) { + + // Gravity Forms Migrator add-on. + $gravity_forms_plugin = 'formidable-gravity-forms-importer/formidable-gravity-forms-importer.php'; + if ( class_exists( 'GFForms' ) && ! is_plugin_active( $gravity_forms_plugin ) ) { + $is_installed_gravity_forms = array_key_exists( $gravity_forms_plugin, $plugins ); + self::$available_addons['formidable-gravity-forms-importer'] = array( - 'title' => esc_html__( 'Gravity Forms Migrator', 'formidable' ), - 'rel' => 'formidable-gravity-forms-importer', - 'is-checked' => false, - 'is-vendor' => true, - 'help-text' => esc_html__( 'Easily migrate your forms from Gravity Forms to Formidable.', 'formidable' ), + 'title' => esc_html__( 'Gravity Forms Migrator', 'formidable' ), + 'rel' => $is_installed_gravity_forms ? $gravity_forms_plugin : 'formidable-gravity-forms-importer', + 'is-checked' => false, + 'is-vendor' => true, + 'is-installed' => $is_installed_gravity_forms, + 'help-text' => esc_html__( 'Easily migrate your forms from Gravity Forms to Formidable.', 'formidable' ), ); } } From 4be675e979268c1af02773f095c39dcab4ec47d2 Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 21 Oct 2024 22:21:11 +0300 Subject: [PATCH 21/24] Add "data-is-installed" to add-ons --- classes/helpers/FrmOnboardingWizardHelper.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/classes/helpers/FrmOnboardingWizardHelper.php b/classes/helpers/FrmOnboardingWizardHelper.php index d919086707..dc5f49be42 100644 --- a/classes/helpers/FrmOnboardingWizardHelper.php +++ b/classes/helpers/FrmOnboardingWizardHelper.php @@ -45,6 +45,9 @@ public static function add_addon_label_attributes( $addon_key, $addon ) { if ( ! empty( $addon['is-vendor'] ) ) { $attributes['data-is-vendor'] = 'true'; } + if ( ! empty( $addon['is-installed'] ) ) { + $attributes['data-is-installed'] = 'true'; + } FrmAppHelper::array_to_html_params( $attributes, true ); } From 8a34c3c9e779d6429064422fb3415aa7b80d9165 Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 21 Oct 2024 22:21:30 +0300 Subject: [PATCH 22/24] Update "ajax_install_plugin" method --- classes/models/FrmInstallPlugin.php | 79 ++++++++++++++++++----------- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/classes/models/FrmInstallPlugin.php b/classes/models/FrmInstallPlugin.php index c8e7bdc581..43efc0f6f5 100644 --- a/classes/models/FrmInstallPlugin.php +++ b/classes/models/FrmInstallPlugin.php @@ -82,38 +82,43 @@ public static function ajax_install_plugin() { // Get posted data. $plugin_slug = FrmAppHelper::get_post_param( 'plugin', '', 'sanitize_text_field' ); - // Include necessary files for plugin installation. - require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; - require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; - - // Get the plugin information. - $api = plugins_api( - 'plugin_information', - array( - 'slug' => $plugin_slug, - 'fields' => array( - 'sections' => false, - ), - ) - ); - if ( is_wp_error( $api ) ) { - wp_send_json_error( $api->get_error_message() ); - } - if ( ! FrmAddonsController::url_is_allowed( $api->versions['trunk'] ) ) { - wp_send_json_error( 'This download is not allowed' ); - } - - // Set up the Plugin Upgrader. - $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); - - // Install the plugin. - $result = $upgrader->install( $api->versions['trunk'] ); - if ( is_wp_error( $result ) ) { - wp_send_json_error( $result->get_error_message() ); - } + if ( ! empty( get_plugins()[ $plugin_slug ] ) ) { + $activate = activate_plugin( $plugin_slug ); + } else { + // Include necessary files for plugin installation. + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; + + // Get the plugin information. + $api = plugins_api( + 'plugin_information', + array( + 'slug' => $plugin_slug, + 'fields' => array( + 'sections' => false, + ), + ) + ); + if ( is_wp_error( $api ) ) { + wp_send_json_error( $api->get_error_message() ); + } + if ( ! FrmAddonsController::url_is_allowed( $api->versions['trunk'] ) ) { + wp_send_json_error( 'This download is not allowed' ); + } + + // Set up the Plugin Upgrader. + $upgrader = new Plugin_Upgrader( new WP_Ajax_Upgrader_Skin() ); + + // Install the plugin. + $result = $upgrader->install( $api->versions['trunk'] ); + if ( is_wp_error( $result ) ) { + wp_send_json_error( $result->get_error_message() ); + } + + // Activate the plugin. + $activate = activate_plugin( $upgrader->plugin_info() ); + }//end if - // Activate the plugin. - $activate = activate_plugin( $upgrader->plugin_info() ); if ( is_wp_error( $activate ) ) { wp_send_json_error( $activate->get_error_message() ); } @@ -148,4 +153,16 @@ public static function ajax_check_plugin_activation() { wp_send_json_error(); } } + + /** + * Check if a plugin is installed. + * + * @since x.x + * + * @param string $plugin_file + * @return bool + */ + private static function is_plugin_installed( $plugin_file ) { + return isset( get_plugins()[ $plugin_file ] ); + } } From 5d0b28fa50d31533867e181fede16718be7bc245 Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 21 Oct 2024 22:21:59 +0300 Subject: [PATCH 23/24] Update "installAddon" function --- .../events/installAddonsButtonListener.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/js/src/onboarding-wizard/events/installAddonsButtonListener.js b/js/src/onboarding-wizard/events/installAddonsButtonListener.js index e7fbd6215b..ce8b7b0f5a 100644 --- a/js/src/onboarding-wizard/events/installAddonsButtonListener.js +++ b/js/src/onboarding-wizard/events/installAddonsButtonListener.js @@ -61,18 +61,21 @@ const onInstallAddonsButtonClick = async( event ) => { * Installs an add-on or plugin based on the provided plugin name and vendor status. * * @private - * @param {string} plugin The unique identifier or name of the plugin or add-on to be installed. - * @param {Object} options An object containing additional options for the installation. - * @param {boolean} options.isVendor Indicates whether the plugin is a vendor plugin (true) or a regular add-on (false). + * @param {string} plugin The unique identifier or name of the plugin or add-on to be installed. + * @param {Object} options An object containing additional options for the installation. + * @param {boolean} options.isInstalled Indicates whether the plugin is already installed. + * @param {boolean} options.isVendor Indicates whether the plugin is a vendor plugin (true) or a regular add-on (false). * @return {Promise} A promise that resolves with the JSON response from the server after the installation request is completed. */ -async function installAddon( plugin, {isVendor}) { +async function installAddon( plugin, {isVendor, isInstalled}) { // Prepare FormData for the POST request const formData = new FormData(); - formData.append( 'action', isVendor ? 'frm_install_plugin' : 'frm_install_addon' ); formData.append( 'nonce', nonce ); formData.append( 'plugin', plugin ); + const addonAction = isInstalled ? 'frm_activate_addon' : 'frm_install_addon'; + formData.append( 'action', isVendor ? 'frm_install_plugin' : addonAction ); + try { // Perform the POST request const response = await fetch( ajaxurl, { From 119f3f06e6dbedd849b38dcbbb1dbd3430aac613 Mon Sep 17 00:00:00 2001 From: Sherv Date: Mon, 21 Oct 2024 22:22:48 +0300 Subject: [PATCH 24/24] Add auo-generated js file --- js/onboarding-wizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/onboarding-wizard.js b/js/onboarding-wizard.js index 1215ceb9f9..5db5b96d93 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";function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t,e){for(var n=0;n1&&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()},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):00&&void 0!==arguments[0]?arguments[0]:{};if("object"!==O(t)||null===t)throw new Error("createPageState: initialState must be a non-null object");var e=t;return{getState:function(){return e},getSingleState:function(t){var r=Reflect.get(e,t);return void 0===r?null:r},setState:function(t){if("object"!==O(t)||null===t)throw new Error("setState: newState must be a non-null object");e=L(L({},e),t)},setSingleState:function(t,r){Reflect.has(e,t)&&Reflect.set(e,t,r)}}}({processedSteps:[],installedAddons:[]}),P=x.getState,_=(x.getSingleState,x.setState,x.setSingleState),k=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==g(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==g(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=v(v({},e),t)}}}({onboardingWizardPage:document.getElementById("".concat(w,"-wizard-page")),container:document.getElementById("".concat(w,"-container")),rootline:document.getElementById("".concat(w,"-rootline")),steps:document.querySelectorAll(".".concat(w,"-step")),skipStepButtons:document.querySelectorAll(".".concat(w,"-skip-step")),backButtons:document.querySelectorAll(".".concat(w,"-back-button")),consentTrackingButton:document.getElementById("".concat(w,"-consent-tracking")),installAddonsButton:document.getElementById("".concat(w,"-install-addons-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")}),T=k.getElements;k.addElements;var A=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",o=document.querySelector(".".concat(w,'-step[data-step-name="').concat(t,'"]'));if(o){var i=document.querySelector(".".concat(w,"-step.").concat(y));i&&(i.classList.remove(y),null==(e=i)||e.classList.add(h)),o.classList.add(y),function(t){null==t||t.classList.remove(h)}(o),new n(o).fadeIn(),T().onboardingWizardPage.setAttribute("data-current-step",t),function(t,e){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pushState";if(u.set(t,e),c.search=u.toString(),["pushState","replaceState"].includes(i)){var l=(r={},o=e,(n=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(n=t))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[i](l,"",c)}c.toString()}("step",t,r),function(t){t===S.UNSUCCESSFUL&&(t=S.SUCCESS);var e=T().rootline,r=e.querySelector('.frm-rootline-item[data-step="'.concat(t,'"]'));e.querySelectorAll(".frm-rootline-item").forEach((function(t){t.classList.remove(N),t.classList.remove(y)}));var n=r.previousElementSibling;if(n)for(;n;)n.classList.add(N),n=n.previousElementSibling;t===S.SUCCESS?r.classList.add(N):r.classList.add(y)}(t)}},I=function(){var t=document.querySelector(".".concat(w,"-step.").concat(y)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,o=P().processedSteps;o.includes(r)||(o.push(r),_("processedSteps",o)),function(t,e){var r=function(t,e){var r;if(S.SUCCESS===e||S.UNSUCCESSFUL===e){var n=P().processedSteps;n.length>1&&(n.includes(e)||n.push(e),(r=new FormData).append("processed_steps",n.join(",")),r.append("completed_steps",!0))}if(S.INSTALL_ADDONS===t){var o,i=P().installedAddons;i.length>0&&(r=null!==(o=r)&&void 0!==o?o:new FormData).append("installed_addons",i.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)}(r,n),A(n)}};var N="frm-completed-step",D=".frm-option-box";function C(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(D).classList.toggle("frm-checked")}var F=function(){I()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(w,"-step.").concat(y)))?void 0:t.previousElementSibling)&&A(e.dataset.stepName)};function G(t){return G="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},G(t)}function B(){B=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 T(n||[]);return o(a,"_invoke",{value:x(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 p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(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"==G(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 x(e,r,n){var o=p;return function(i,a){if(o===y)throw 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=P(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===p)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:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(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,P(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 _(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(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),k(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;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function q(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 Y=function(){var t,e=(t=B().mark((function t(){return B().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(0,frmDom.ajax.doJsonPost)("onboarding_consent_tracking",new FormData).then(I);case 2: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){q(i,n,o,a,c,"next",t)}function c(t){q(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 R(){R=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 T(n||[]);return o(a,"_invoke",{value:x(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 p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(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 x(e,r,n){var o=p;return function(i,a){if(o===y)throw 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=P(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===p)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:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(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,P(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 _(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(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),k(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;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function W(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 J(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(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 J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);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()},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):00&&void 0!==arguments[0]?arguments[0]:{};if("object"!==O(t)||null===t)throw new Error("createPageState: initialState must be a non-null object");var e=t;return{getState:function(){return e},getSingleState:function(t){var r=Reflect.get(e,t);return void 0===r?null:r},setState:function(t){if("object"!==O(t)||null===t)throw new Error("setState: newState must be a non-null object");e=L(L({},e),t)},setSingleState:function(t,r){Reflect.has(e,t)&&Reflect.set(e,t,r)}}}({processedSteps:[],installedAddons:[]}),P=x.getState,_=(x.getSingleState,x.setState,x.setSingleState),k=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!==g(t)||null===t)throw new Error("createPageElements: initialElements must be a non-null object");var e=t;return{getElements:function(){return e},addElements:function(t){if("object"!==g(t)||null===t)throw new Error("addElements: newElements must be a non-null object");e=v(v({},e),t)}}}({onboardingWizardPage:document.getElementById("".concat(w,"-wizard-page")),container:document.getElementById("".concat(w,"-container")),rootline:document.getElementById("".concat(w,"-rootline")),steps:document.querySelectorAll(".".concat(w,"-step")),skipStepButtons:document.querySelectorAll(".".concat(w,"-skip-step")),backButtons:document.querySelectorAll(".".concat(w,"-back-button")),consentTrackingButton:document.getElementById("".concat(w,"-consent-tracking")),installAddonsButton:document.getElementById("".concat(w,"-install-addons-button")),hiddenLicenseKeyInput:document.getElementById("frm-license-key")}),T=k.getElements;k.addElements;var A=function(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"pushState",o=document.querySelector(".".concat(w,'-step[data-step-name="').concat(t,'"]'));if(o){var i=document.querySelector(".".concat(w,"-step.").concat(y));i&&(i.classList.remove(y),null==(e=i)||e.classList.add(h)),o.classList.add(y),function(t){null==t||t.classList.remove(h)}(o),new n(o).fadeIn(),T().onboardingWizardPage.setAttribute("data-current-step",t),function(t,e){var r,n,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"pushState";if(u.set(t,e),c.search=u.toString(),["pushState","replaceState"].includes(i)){var l=(r={},o=e,(n=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=a(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(n=t))in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,r);window.history[i](l,"",c)}c.toString()}("step",t,r),function(t){t===S.UNSUCCESSFUL&&(t=S.SUCCESS);var e=T().rootline,r=e.querySelector('.frm-rootline-item[data-step="'.concat(t,'"]'));e.querySelectorAll(".frm-rootline-item").forEach((function(t){t.classList.remove(N),t.classList.remove(y)}));var n=r.previousElementSibling;if(n)for(;n;)n.classList.add(N),n=n.previousElementSibling;t===S.SUCCESS?r.classList.add(N):r.classList.add(y)}(t)}},I=function(){var t=document.querySelector(".".concat(w,"-step.").concat(y)),e=null==t?void 0:t.nextElementSibling;if(e){var r=t.dataset.stepName,n=e.dataset.stepName,o=P().processedSteps;o.includes(r)||(o.push(r),_("processedSteps",o)),function(t,e){var r=function(t,e){var r;if(S.SUCCESS===e||S.UNSUCCESSFUL===e){var n=P().processedSteps;n.length>1&&(n.includes(e)||n.push(e),(r=new FormData).append("processed_steps",n.join(",")),r.append("completed_steps",!0))}if(S.INSTALL_ADDONS===t){var o,i=P().installedAddons;i.length>0&&(r=null!==(o=r)&&void 0!==o?o:new FormData).append("installed_addons",i.join(","))}return r}(t,e);r&&(0,frmDom.ajax.doJsonPost)("onboarding_setup_usage_data",r)}(r,n),A(n)}};var N="frm-completed-step",D=".frm-option-box";function C(t){"input"===t.target.tagName.toLowerCase()&&t.currentTarget.closest(D).classList.toggle("frm-checked")}var F=function(){I()},U=function(){var t,e;(e=null==(t=document.querySelector(".".concat(w,"-step.").concat(y)))?void 0:t.previousElementSibling)&&A(e.dataset.stepName)};function G(t){return G="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},G(t)}function B(){B=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 T(n||[]);return o(a,"_invoke",{value:x(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 p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(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"==G(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 x(e,r,n){var o=p;return function(i,a){if(o===y)throw 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=P(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===p)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:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(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,P(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 _(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(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),k(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;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function q(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 Y=function(){var t,e=(t=B().mark((function t(){return B().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:(0,frmDom.ajax.doJsonPost)("onboarding_consent_tracking",new FormData).then(I);case 2: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){q(i,n,o,a,c,"next",t)}function c(t){q(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 R(){R=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 T(n||[]);return o(a,"_invoke",{value:x(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 p="suspendedStart",h="suspendedYield",y="executing",d="completed",v={};function m(){}function g(){}function b(){}var w={};l(w,a,(function(){return this}));var S=Object.getPrototypeOf,E=S&&S(S(A([])));E&&E!==r&&n.call(E,a)&&(w=E);var L=b.prototype=m.prototype=Object.create(w);function j(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function O(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 x(e,r,n){var o=p;return function(i,a){if(o===y)throw 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=P(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===p)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:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=d,n.method="throw",n.arg=l.arg)}}}function P(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,P(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 _(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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function A(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),k(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;k(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function W(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 J(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(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 J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r