diff --git a/assets/css/dist/admin.css b/assets/css/dist/admin.css index 42c2cc7..75ede64 100644 --- a/assets/css/dist/admin.css +++ b/assets/css/dist/admin.css @@ -7,7 +7,7 @@ For the Stripe Add-On https://www.gravityforms.com Gravity Forms is a Rocketgenius project -copyright 2008-2023 Rocketgenius Inc. +copyright 2008-2024 Rocketgenius Inc. https://www.rocketgenius.com this may not be re-distributed without the express written permission of the author. diff --git a/assets/css/dist/theme-foundation.css b/assets/css/dist/theme-foundation.css index bf8273a..820f4db 100644 --- a/assets/css/dist/theme-foundation.css +++ b/assets/css/dist/theme-foundation.css @@ -14,7 +14,7 @@ Theme dependencies: - Gravity Forms Theme Foundation: gravity-forms-theme-foundation.css Gravity Forms is a Rocketgenius project -copyright 2008-2023 Rocketgenius Inc. +copyright 2008-2024 Rocketgenius Inc. https://www.rocketgenius.com this may not be re-distributed without the express written permission of the author. @@ -55,10 +55,8 @@ Deprecated version (stripe): 5.2.2 /* Stripe Payment Element */ .gform-theme--foundation .gfield--type-stripe_creditcard-payment-element .StripeElement--link { - -webkit-margin-after: var(--gform-theme-field-row-gap); - margin-block-end: var(--gform-theme-field-row-gap); - -webkit-margin-after: var(--gf-field-gap-y, var(--gform-theme-field-row-gap)); - margin-block-end: var(--gf-field-gap-y, var(--gform-theme-field-row-gap)); + margin-block-end: var(--gform-theme-field-row-gap); + margin-block-end: var(--gf-field-gap-y, var(--gform-theme-field-row-gap)); } .gform-theme--foundation .gfield--type-stripe_creditcard-payment-element #stripe-payment-link:not(.visible) { diff --git a/assets/css/dist/theme-framework.css b/assets/css/dist/theme-framework.css index b0a39e2..4252bae 100644 --- a/assets/css/dist/theme-framework.css +++ b/assets/css/dist/theme-framework.css @@ -12,7 +12,7 @@ Theme dependencies: - Gravity Forms Theme Foundation for the Stripe Add-On: theme-foundation.css Gravity Forms is a Rocketgenius project -copyright 2008-2023 Rocketgenius Inc. +copyright 2008-2024 Rocketgenius Inc. https://www.rocketgenius.com this may not be re-distributed without the express written permission of the author. diff --git a/assets/css/dist/theme.css b/assets/css/dist/theme.css index 47fe810..449427d 100644 --- a/assets/css/dist/theme.css +++ b/assets/css/dist/theme.css @@ -12,7 +12,7 @@ Theme dependencies: - Gravity Forms Basic Theme: basic.css Gravity Forms is a Rocketgenius project -copyright 2008-2023 Rocketgenius Inc. +copyright 2008-2024 Rocketgenius Inc. https://www.rocketgenius.com this may not be re-distributed without the express written permission of the author. diff --git a/assets/css/dist/theme.min.css b/assets/css/dist/theme.min.css index e6d6ae8..8c9998b 100644 --- a/assets/css/dist/theme.min.css +++ b/assets/css/dist/theme.min.css @@ -1 +1 @@ -.gform_legacy_markup_wrapper .ginput_full[data-payment-element=false] .StripeElement,.gravity-theme .ginput_full[data-payment-element=false] .StripeElement{background-color:#fff;border:1px solid #bbb;border-radius:2px;box-shadow:none;height:40px;padding:10px}.gform_legacy_markup_wrapper .StripeElement--focus,.gravity-theme .StripeElement--focus{border:2px solid #8bc1fc}.gform_legacy_markup_wrapper .StripeElement--invalid,.gravity-theme .StripeElement--invalid{border-color:#fa755a}.gform_legacy_markup_wrapper .StripeElement--webkit-autofill,.gravity-theme .StripeElement--webkit-autofill{background-color:#fefde5!important}.gform_legacy_markup_wrapper div.gform_stripe_requires_action,.gravity-theme div.gform_stripe_requires_action{display:none}.gform_legacy_markup_wrapper .ginput_stripe_creditcard input,.gravity-theme .ginput_stripe_creditcard input{padding:8px}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container,.gravity-theme .ginput_stripe_creditcard .cc-details-container{align-items:center;display:flex;justify-content:center;position:relative}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::-moz-placeholder,.gravity-theme .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::-moz-placeholder{color:#9092b0}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::placeholder,.gravity-theme .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::placeholder{color:#9092b0}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber,.gravity-theme .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber{background:url(data:image/svg+xml;charset=utf8,%3Csvg width='22px' height='14px' viewBox='0 0 22 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg%3E%3Crect fill='%23DCDFE6' x='0' y='0' width='22' height='14' rx='2'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='3' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='7' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='11' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='15' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23FFFFFF' x='3' y='4' width='5' height='3'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E) 16px 50%/auto 20px no-repeat;background-color:hsla(0,0%,100%,.5);padding-left:56px}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-placeholders,.gravity-theme .ginput_stripe_creditcard .cc-placeholders{align-items:center;display:flex;flex-wrap:nowrap;height:100%;position:absolute;right:24px;top:0;width:auto;z-index:2}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-placeholders span,.gravity-theme .ginput_stripe_creditcard .cc-placeholders span{color:#9092b0;display:inline-block}.gform_legacy_markup_wrapper #stripe-payment-link,.gravity-theme #stripe-payment-link{margin-bottom:12px}.gform_legacy_markup_wrapper #stripe-payment-link:before,.gravity-theme #stripe-payment-link:before{content:var(--link-login-string);display:inline-block;font-size:14.88px;font-weight:400;margin-bottom:12px}.gform_legacy_markup_wrapper #stripe-payment-link:not(.visible),.gravity-theme #stripe-payment-link:not(.visible){display:none}html[dir=rtl] .gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container .cc-cardnumber,html[dir=rtl] .gravity-theme .ginput_stripe_creditcard .cc-details-container .cc-cardnumber{background-position:calc(100% - 16px) 50%;padding-left:8px;padding-right:56px}html[dir=rtl] .gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-placeholders,html[dir=rtl] .gravity-theme .ginput_stripe_creditcard .cc-placeholders{left:24px;right:auto}html[dir=rtl] .gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-cvc-placeholder,html[dir=rtl] .gravity-theme .ginput_stripe_creditcard .cc-cvc-placeholder{padding-left:0!important;padding-right:16px} \ No newline at end of file +.gform_legacy_markup_wrapper .ginput_full[data-payment-element=false] .StripeElement,.gravity-theme .ginput_full[data-payment-element=false] .StripeElement{background-color:#fff;border:1px solid #bbb;border-radius:2px;box-shadow:none;height:40px;padding:10px 10px}.gform_legacy_markup_wrapper .StripeElement--focus,.gravity-theme .StripeElement--focus{border:2px solid #8bc1fc}.gform_legacy_markup_wrapper .StripeElement--invalid,.gravity-theme .StripeElement--invalid{border-color:#fa755a}.gform_legacy_markup_wrapper .StripeElement--webkit-autofill,.gravity-theme .StripeElement--webkit-autofill{background-color:#fefde5!important}.gform_legacy_markup_wrapper div.gform_stripe_requires_action,.gravity-theme div.gform_stripe_requires_action{display:none}.gform_legacy_markup_wrapper .ginput_stripe_creditcard input,.gravity-theme .ginput_stripe_creditcard input{padding:8px}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container,.gravity-theme .ginput_stripe_creditcard .cc-details-container{align-items:center;display:flex;justify-content:center;position:relative}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::-moz-placeholder,.gravity-theme .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::-moz-placeholder{color:#9092b0}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::placeholder,.gravity-theme .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber::placeholder{color:#9092b0}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber,.gravity-theme .ginput_stripe_creditcard .cc-details-container input.cc-cardnumber{background:url("data:image/svg+xml;charset=utf8,%3Csvg width='22px' height='14px' viewBox='0 0 22 14' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cg%3E%3Crect fill='%23DCDFE6' x='0' y='0' width='22' height='14' rx='2'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='3' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='7' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='11' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23B2B8C6' x='15' y='10' width='3' height='1'%3E%3C/rect%3E%3Crect fill='%23FFFFFF' x='3' y='4' width='5' height='3'%3E%3C/rect%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 16px 50%/auto 20px no-repeat;background-color:rgba(255,255,255,.5);padding-left:56px}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-placeholders,.gravity-theme .ginput_stripe_creditcard .cc-placeholders{align-items:center;display:flex;flex-wrap:nowrap;height:100%;position:absolute;right:24px;top:0;width:auto;z-index:2}.gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-placeholders span,.gravity-theme .ginput_stripe_creditcard .cc-placeholders span{color:#9092b0;display:inline-block}.gform_legacy_markup_wrapper #stripe-payment-link,.gravity-theme #stripe-payment-link{margin-bottom:12px}.gform_legacy_markup_wrapper #stripe-payment-link::before,.gravity-theme #stripe-payment-link::before{content:var(--link-login-string);display:inline-block;font-size:14.88px;font-weight:400;margin-bottom:12px}.gform_legacy_markup_wrapper #stripe-payment-link:not(.visible),.gravity-theme #stripe-payment-link:not(.visible){display:none}html[dir=rtl] .gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-details-container .cc-cardnumber,html[dir=rtl] .gravity-theme .ginput_stripe_creditcard .cc-details-container .cc-cardnumber{background-position:calc(100% - 16px) 50%;padding-left:8px;padding-right:56px}html[dir=rtl] .gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-placeholders,html[dir=rtl] .gravity-theme .ginput_stripe_creditcard .cc-placeholders{left:24px;right:auto}html[dir=rtl] .gform_legacy_markup_wrapper .ginput_stripe_creditcard .cc-cvc-placeholder,html[dir=rtl] .gravity-theme .ginput_stripe_creditcard .cc-cvc-placeholder{padding-left:0!important;padding-right:16px} \ No newline at end of file diff --git a/change_log.txt b/change_log.txt index 1b30f02..735167f 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +### 5.7.0 | 2024-06-17 +- Fixed a typo that can cause a fatal error when using the gform_stripe_payment_element_authorization_only filter. + ### 5.6.0 | 2024-04-29 - Added a new [`gform_stripe_payment_element_updated_payment_information`](https://docs.gravityforms.com/gform_stripe_payment_element_updated_payment_information/) JavaScript filter to allow modifying the payment element payment information when the form total changes. - Updated logging to decrease the log file size and make it easier to track issues. diff --git a/class-gf-stripe.php b/class-gf-stripe.php index af89394..c58339b 100644 --- a/class-gf-stripe.php +++ b/class-gf-stripe.php @@ -327,12 +327,15 @@ public function pre_init() { * @return array The scripts to be enqueued. */ public function scripts() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; + $base_url = $this->get_base_url(); + $version = $this->_version; + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; + $scripts = array( array( 'handle' => 'stripe.js', 'src' => 'https://js.stripe.com/v2/', - 'version' => $this->_version, + 'version' => $version, 'deps' => array(), 'in_footer' => false, 'enqueue' => array( @@ -342,7 +345,7 @@ public function scripts() { array( 'handle' => 'stripe_v3', 'src' => 'https://js.stripe.com/v3/', - 'version' => $this->_version, + 'version' => $version, 'deps' => array(), 'in_footer' => false, 'enqueue' => array( @@ -351,8 +354,8 @@ public function scripts() { ), array( 'handle' => 'gforms_stripe_frontend', - 'src' => $this->get_base_url() . "/js/frontend{$min}.js", - 'version' => $this->_version, + 'src' => $base_url . "/js/frontend{$min}.js", + 'version' => $version, 'deps' => array( 'jquery', 'gform_json', 'gform_gravityforms', 'wp-a11y' ), 'in_footer' => false, 'enqueue' => array( @@ -381,8 +384,8 @@ public function scripts() { ), array( 'handle' => 'gforms_stripe_admin', - 'src' => $this->get_base_url() . "/js/admin{$min}.js", - 'version' => $this->_version, + 'src' => $base_url . "/js/admin{$min}.js", + 'version' => $version, 'deps' => array( 'jquery', 'thickbox', 'stripe.js', 'wp-a11y' ), 'in_footer' => false, 'enqueue' => array( @@ -417,8 +420,8 @@ public function scripts() { ), array( 'handle' => 'gform_stripe_payment_element_form_editor', - 'src' => $this->get_base_url() . "/js/payment_element_form_editor{$min}.js", - 'version' => $this->_version, + 'src' => $base_url . "/js/payment_element_form_editor{$min}.js", + 'version' => $version, 'deps' => array( 'jquery', 'stripe_v3' ), 'in_footer' => false, 'enqueue' => array( @@ -454,13 +457,15 @@ public function scripts() { * @return array Returns an array of styles and when to enqueue them */ public function styles() { - $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; + $base_url = $this->get_base_url(); + $version = $this->_version; + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; $styles = array( array( 'handle' => 'gforms_stripe_frontend', - 'src' => $this->get_base_url() . "/assets/css/dist/theme{$min}.css", - 'version' => $this->_version, + 'src' => $base_url . "/assets/css/dist/theme{$min}.css", + 'version' => $version, 'in_footer' => false, 'enqueue' => array( array( $this, 'frontend_style_callback' ), @@ -468,8 +473,8 @@ public function styles() { ), array( 'handle' => 'gform_stripe_pluginsettings', - 'src' => $this->get_base_url() . "/assets/css/dist/admin{$min}.css", - 'version' => $this->_version, + 'src' => $base_url . "/assets/css/dist/admin{$min}.css", + 'version' => $version, 'deps' => array( 'thickbox' ), 'enqueue' => array( array( @@ -504,13 +509,14 @@ public function theme_layer_styles( $form, $ajax, $settings, $block_settings = a } $base_url = plugins_url( '', __FILE__ ); + $min = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG || isset( $_GET['gform_debug'] ) ? '' : '.min'; return array( 'foundation' => array( - array( 'gravity_forms_stripe_theme_foundation', "$base_url/assets/css/dist/theme-foundation.css" ), + array( 'gravity_forms_stripe_theme_foundation', $base_url . "/assets/css/dist/theme-foundation{$min}.css" ), ), 'framework' => array( - array( 'gravity_forms_stripe_theme_framework', "$base_url/assets/css/dist/theme-framework.css" ), + array( 'gravity_forms_stripe_theme_framework', $base_url . "/assets/css/dist/theme-framework{$min}.css" ), ), ); } @@ -7199,7 +7205,7 @@ public function get_payment_element_capture_method( $form, $feed ) { $authorization_only = apply_filters( 'gform_stripe_payment_element_authorization_only', false, $form, $feed ); if ( $authorization_only ) { - $this->log_debug( __METHOD__ . '(): The gform_stripe_payment_element_authorization_only filter was used to prevent capture tracking id:' . md5( rggpost( 'state_' . rgar( $form, 'id' ) ) ) ); + $this->log_debug( __METHOD__ . '(): The gform_stripe_payment_element_authorization_only filter was used to prevent capture tracking id:' . md5( rgpost( 'state_' . rgar( $form, 'id' ) ) ) ); return 'manual'; } diff --git a/custom.cnf b/custom.cnf deleted file mode 100644 index 42bccb3..0000000 --- a/custom.cnf +++ /dev/null @@ -1,9 +0,0 @@ -[client] -default-character-set=utf8 - -[mysql] -default-character-set=utf8 - -[mysqld] -collation-server = utf8_unicode_ci -character-set-server = utf8 diff --git a/js/admin.min.js b/js/admin.min.js index 8afd09d..feb990a 100644 --- a/js/admin.min.js +++ b/js/admin.min.js @@ -1 +1 @@ -!function(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)}([,function(e,t){var i,n;window.GFStripeAdmin=null,i=jQuery,n=function(){var e=this;this.accountSettingsLocked=!1,this.deauthActionable=!1,this.inputContainerPrefix=gforms_stripe_admin_strings.input_container_prefix,this.inputPrefix=gforms_stripe_admin_strings.input_prefix,this.liveDependencySupported=gforms_stripe_admin_strings.liveDependencySupported,this.apiMode=gforms_stripe_admin_strings.apiMode,this.init=function(){this.initKeyStatus("live_publishable_key"),this.initKeyStatus("live_secret_key"),this.initKeyStatus("test_publishable_key"),this.initKeyStatus("test_secret_key"),this.bindDeauthorize(),this.liveDependencySupported||this.bindAPIModeChange(),this.maybeLockAccountSettings(),this.bindWebhookAlert(),this.bindRefund(),this.bindCapture()},this.validateKey=function(e,t){0!=t.length?(i("#"+e).val(t.trim()),this.setKeyStatusIcon(e,""),"live_publishable_key"==e||"test_publishable_key"==e?this.validatePublishableKey(e,t):this.validateSecretKey(e,t)):this.setKeyStatus(e,"")},this.validateSecretKey=function(t,n){i.post(ajaxurl,{action:"gf_validate_secret_key",keyName:t,key:n,nonce:gforms_stripe_admin_strings.ajax_nonce},(function(i){"valid"==(i=i.trim())?e.setKeyStatus(t,"1"):"invalid"==i?e.setKeyStatus(t,"0"):e.setKeyStatusIcon(t,gforms_stripe_admin_strings.validation_error)}))},this.validatePublishableKey=function(t,i){this.setKeyStatusIcon(t,""),cc={number:"4916433572511762",exp_month:"01",exp_year:(new Date).getFullYear()+1,cvc:"111",name:"Test Card"},Stripe.setPublishableKey(i),Stripe.card.createToken(cc,(function(i,n){200==i?e.setKeyStatus(t,"1"):400!=i&&402!=i||"live_publishable_key"!=t?e.setKeyStatus(t,"0"):e.setKeyStatus(t,"1")}))},this.initKeyStatus=function(e){var t=i("#"+e+"_is_valid"),n=i("#"+e);t.length>0?this.setKeyStatus(e,t.val()):n.length>0&&this.validateKey(e,n.val())},this.setKeyStatus=function(e,t){i("#"+e+"_is_valid").val(t);var n="";"1"==t?n='':"0"==t&&(n=''),this.setKeyStatusIcon(e,n)},this.setKeyStatusIcon=function(e,t){var n=i("#"+e+"_status_icon");n.length>0&&n.remove(),i("#"+e).after("  "+t+"")},this.bindDeauthorize=function(){i(".gform_stripe_deauth_button").on("click",(function(t){if(t.preventDefault(),e.accountSettingsLocked)return window.location.reload(),!1;var n=i("#gform_stripe_deauth_button"),a=i("#deauth_scope"),s=gforms_stripe_admin_strings.disconnect,r=i(this).data("mode"),o=i(this).data("fid");if(e.deauthActionable){var d=i("#"+r+"_deauth_scope0").is(":checked")?"site":"account",c="site"===d&&""!==o?s.feed:s[d];if(!confirm(c))return!1;n.attr("disabled","disabled"),i.ajax({async:!1,url:ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_deauthorize",scope:d,fid:o,id:i(this).data("id"),mode:r,nonce:gforms_stripe_admin_strings.ajax_nonce},success:function(e){e.success?window.location.reload():alert(e.data.message),n.removeAttr("disabled")}})}else i(".gform_stripe_deauth_button").eq(0).hide(),""!==o&&i(".connected_to_stripe_text").hide(),a.show(0,(function(){e.deauthActionable=!0}))}))},this.bindAPIModeChange=function(){""!==this.apiMode&&void 0!==this.apiMode||(this.apiMode="live",i("#api_mode0").prop("checked",!0));var t="live"===this.apiMode?"test":"live";i("#"+this.inputContainerPrefix+this.apiMode+"_auth_token").show(),i("#"+this.inputContainerPrefix+t+"_auth_token").hide(),i('#tab_gravityformsstripe input[name="'+this.inputPrefix+'_api_mode"]').on("click",(function(n){e.apiMode=i(this).val(),t="live"===e.apiMode?"test":"live",i("#"+e.inputContainerPrefix+t+"_auth_token").hide(),i("#"+e.inputContainerPrefix+e.apiMode+"_auth_token").show()}))},this.maybeLockAccountSettings=function(){i("#"+this.inputContainerPrefix+"connected_to").siblings("#"+this.inputContainerPrefix+"api_mode, #"+this.inputContainerPrefix+"live_auth_token, #"+this.inputContainerPrefix+"test_auth_token").hide(),i("#gform_stripe_change_account").on("click",(function(){if(i(this).data("disabled"))alert(gforms_stripe_admin_strings.switch_account_disabled_message);else{i("#"+e.inputContainerPrefix+"api_mode").show();var t="live"===e.apiMode?"test":"live";i("#"+e.inputContainerPrefix+t+"_auth_token").hide(),i("#"+e.inputContainerPrefix+e.apiMode+"_auth_token").show(),i(this).off("click").addClass("disabled")}})),i("table.gforms_form_settings").on("change","input, select",(function(){var t=i(this).attr("name");t!==e.inputPrefix+"_api_mode"&&"deauth_scope"!==t&&t!==e.inputPrefix+"_transactionType"&&(e.accountSettingsLocked=!0)})),i("#gform-settings-save").on("click",(function(){i(".error.below-h2").remove(),e.accountSettingsLocked=!1})),window.addEventListener("beforeunload",(function(t){e.accountSettingsLocked&&(t.preventDefault(),t.returnValue="")}))},this.bindWebhookAlert=function(){i("#gform_stripe_change_account").length&&""===i("#"+this.apiMode+"_signing_secret").val()&&(i("#webhooks_enabled").focus(),i([document.documentElement,document.body]).animate({scrollTop:i("#"+e.inputContainerPrefix+"api_mode").offset().top+20},1e3))},this.bindRefund=function(){i(".stripe-refund").on("click",(function(e){e.preventDefault();var t=i(".stripe_refund"),n=i("#refund_wait_container"),a=i(this).data("tid");if(entryId=i(this).data("lid"),!window.confirm(gforms_stripe_admin_strings.refund))return!1;t.prop("disabled",!0),n.fadeIn(),wp.a11y.speak(gforms_stripe_admin_strings.refund_processing,"assertive"),i.ajax({async:!0,url:ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_refund",transaction_id:a,entry_id:entryId,nonce:gforms_stripe_admin_strings.refund_nonce},success:function(e){e.success?window.location.reload():(wp.a11y.speak(e.data.message,"assertive"),i(".gform_stripe_refund_alert").show().html(e.data.message))},complete:function(){wp.a11y.speak(gforms_stripe_admin_strings.refund_complete,"assertive"),t.prop("disabled",!1),n.hide()}}).fail((function(e,i,a){window.alert(a),t.prop("disabled",!1),n.hide()}))}))},this.bindCapture=function(){i(".stripe-capture").on("click keypress",(function(e){e.preventDefault();var t=i(".stripe-capture"),n=i("#capture_wait_container");if(errorContainer=i(".gform_stripe_capture_alert"),!window.confirm(gforms_stripe_admin_strings.capture_confirm))return!1;n.fadeIn(),t.prop("disabled",!0),errorContainer.hide(),wp.a11y.speak(gforms_stripe_admin_strings.capture_processing,"assertive");var a=t.data("ajax");i.ajax({url:ajaxurl,method:"POST",data:{action:"gfstripe_capture_action",transaction_id:a.transaction_id,entry_id:a.entry_id,nonce:a.nonce},success:function(e){e.success?(wp.a11y.speak(gforms_stripe_admin_strings.capture_complete,"assertive"),window.location.reload()):(wp.a11y.speak(e.data,"assertive"),errorContainer.show().html(e.data),t.prop("disabled",!1),n.hide())}}).fail((function(e,i,a){wp.a11y.speak(a,"assertive"),errorContainer.show().html(a),t.prop("disabled",!1),n.hide()}))}))},this.init()},i(document).ready((function(){GFStripeAdmin=new n}))}]); \ No newline at end of file +!function(e){var t={};function i(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,i),a.l=!0,a.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)i.d(n,a,function(t){return e[t]}.bind(null,a));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=2)}({2:function(e,t){var i,n;window.GFStripeAdmin=null,i=jQuery,n=function(){var e=this;this.accountSettingsLocked=!1,this.deauthActionable=!1,this.inputContainerPrefix=gforms_stripe_admin_strings.input_container_prefix,this.inputPrefix=gforms_stripe_admin_strings.input_prefix,this.liveDependencySupported=gforms_stripe_admin_strings.liveDependencySupported,this.apiMode=gforms_stripe_admin_strings.apiMode,this.init=function(){this.initKeyStatus("live_publishable_key"),this.initKeyStatus("live_secret_key"),this.initKeyStatus("test_publishable_key"),this.initKeyStatus("test_secret_key"),this.bindDeauthorize(),this.liveDependencySupported||this.bindAPIModeChange(),this.maybeLockAccountSettings(),this.bindWebhookAlert(),this.bindRefund(),this.bindCapture()},this.validateKey=function(e,t){0!=t.length?(i("#"+e).val(t.trim()),this.setKeyStatusIcon(e,""),"live_publishable_key"==e||"test_publishable_key"==e?this.validatePublishableKey(e,t):this.validateSecretKey(e,t)):this.setKeyStatus(e,"")},this.validateSecretKey=function(t,n){i.post(ajaxurl,{action:"gf_validate_secret_key",keyName:t,key:n,nonce:gforms_stripe_admin_strings.ajax_nonce},(function(i){"valid"==(i=i.trim())?e.setKeyStatus(t,"1"):"invalid"==i?e.setKeyStatus(t,"0"):e.setKeyStatusIcon(t,gforms_stripe_admin_strings.validation_error)}))},this.validatePublishableKey=function(t,i){this.setKeyStatusIcon(t,""),cc={number:"4916433572511762",exp_month:"01",exp_year:(new Date).getFullYear()+1,cvc:"111",name:"Test Card"},Stripe.setPublishableKey(i),Stripe.card.createToken(cc,(function(i,n){200==i?e.setKeyStatus(t,"1"):400!=i&&402!=i||"live_publishable_key"!=t?e.setKeyStatus(t,"0"):e.setKeyStatus(t,"1")}))},this.initKeyStatus=function(e){var t=i("#"+e+"_is_valid"),n=i("#"+e);t.length>0?this.setKeyStatus(e,t.val()):n.length>0&&this.validateKey(e,n.val())},this.setKeyStatus=function(e,t){i("#"+e+"_is_valid").val(t);var n="";"1"==t?n='':"0"==t&&(n=''),this.setKeyStatusIcon(e,n)},this.setKeyStatusIcon=function(e,t){var n=i("#"+e+"_status_icon");n.length>0&&n.remove(),i("#"+e).after("  "+t+"")},this.bindDeauthorize=function(){i(".gform_stripe_deauth_button").on("click",(function(t){if(t.preventDefault(),e.accountSettingsLocked)return window.location.reload(),!1;var n=i("#gform_stripe_deauth_button"),a=i("#deauth_scope"),s=gforms_stripe_admin_strings.disconnect,r=i(this).data("mode"),o=i(this).data("fid");if(e.deauthActionable){var d=i("#"+r+"_deauth_scope0").is(":checked")?"site":"account",c="site"===d&&""!==o?s.feed:s[d];if(!confirm(c))return!1;n.attr("disabled","disabled"),i.ajax({async:!1,url:ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_deauthorize",scope:d,fid:o,id:i(this).data("id"),mode:r,nonce:gforms_stripe_admin_strings.ajax_nonce},success:function(e){e.success?window.location.reload():alert(e.data.message),n.removeAttr("disabled")}})}else i(".gform_stripe_deauth_button").eq(0).hide(),""!==o&&i(".connected_to_stripe_text").hide(),a.show(0,(function(){e.deauthActionable=!0}))}))},this.bindAPIModeChange=function(){""!==this.apiMode&&void 0!==this.apiMode||(this.apiMode="live",i("#api_mode0").prop("checked",!0));var t="live"===this.apiMode?"test":"live";i("#"+this.inputContainerPrefix+this.apiMode+"_auth_token").show(),i("#"+this.inputContainerPrefix+t+"_auth_token").hide(),i('#tab_gravityformsstripe input[name="'+this.inputPrefix+'_api_mode"]').on("click",(function(n){e.apiMode=i(this).val(),t="live"===e.apiMode?"test":"live",i("#"+e.inputContainerPrefix+t+"_auth_token").hide(),i("#"+e.inputContainerPrefix+e.apiMode+"_auth_token").show()}))},this.maybeLockAccountSettings=function(){i("#"+this.inputContainerPrefix+"connected_to").siblings("#"+this.inputContainerPrefix+"api_mode, #"+this.inputContainerPrefix+"live_auth_token, #"+this.inputContainerPrefix+"test_auth_token").hide(),i("#gform_stripe_change_account").on("click",(function(){if(i(this).data("disabled"))alert(gforms_stripe_admin_strings.switch_account_disabled_message);else{i("#"+e.inputContainerPrefix+"api_mode").show();var t="live"===e.apiMode?"test":"live";i("#"+e.inputContainerPrefix+t+"_auth_token").hide(),i("#"+e.inputContainerPrefix+e.apiMode+"_auth_token").show(),i(this).off("click").addClass("disabled")}})),i("table.gforms_form_settings").on("change","input, select",(function(){var t=i(this).attr("name");t!==e.inputPrefix+"_api_mode"&&"deauth_scope"!==t&&t!==e.inputPrefix+"_transactionType"&&(e.accountSettingsLocked=!0)})),i("#gform-settings-save").on("click",(function(){i(".error.below-h2").remove(),e.accountSettingsLocked=!1})),window.addEventListener("beforeunload",(function(t){e.accountSettingsLocked&&(t.preventDefault(),t.returnValue="")}))},this.bindWebhookAlert=function(){i("#gform_stripe_change_account").length&&""===i("#"+this.apiMode+"_signing_secret").val()&&(i("#webhooks_enabled").focus(),i([document.documentElement,document.body]).animate({scrollTop:i("#"+e.inputContainerPrefix+"api_mode").offset().top+20},1e3))},this.bindRefund=function(){i(".stripe-refund").on("click",(function(e){e.preventDefault();var t=i(".stripe_refund"),n=i("#refund_wait_container"),a=i(this).data("tid");if(entryId=i(this).data("lid"),!window.confirm(gforms_stripe_admin_strings.refund))return!1;t.prop("disabled",!0),n.fadeIn(),wp.a11y.speak(gforms_stripe_admin_strings.refund_processing,"assertive"),i.ajax({async:!0,url:ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_refund",transaction_id:a,entry_id:entryId,nonce:gforms_stripe_admin_strings.refund_nonce},success:function(e){e.success?window.location.reload():(wp.a11y.speak(e.data.message,"assertive"),i(".gform_stripe_refund_alert").show().html(e.data.message))},complete:function(){wp.a11y.speak(gforms_stripe_admin_strings.refund_complete,"assertive"),t.prop("disabled",!1),n.hide()}}).fail((function(e,i,a){window.alert(a),t.prop("disabled",!1),n.hide()}))}))},this.bindCapture=function(){i(".stripe-capture").on("click keypress",(function(e){e.preventDefault();var t=i(".stripe-capture"),n=i("#capture_wait_container");if(errorContainer=i(".gform_stripe_capture_alert"),!window.confirm(gforms_stripe_admin_strings.capture_confirm))return!1;n.fadeIn(),t.prop("disabled",!0),errorContainer.hide(),wp.a11y.speak(gforms_stripe_admin_strings.capture_processing,"assertive");var a=t.data("ajax");i.ajax({url:ajaxurl,method:"POST",data:{action:"gfstripe_capture_action",transaction_id:a.transaction_id,entry_id:a.entry_id,nonce:a.nonce},success:function(e){e.success?(wp.a11y.speak(gforms_stripe_admin_strings.capture_complete,"assertive"),window.location.reload()):(wp.a11y.speak(e.data,"assertive"),errorContainer.show().html(e.data),t.prop("disabled",!1),n.hide())}}).fail((function(e,i,a){wp.a11y.speak(a,"assertive"),errorContainer.show().html(a),t.prop("disabled",!1),n.hide()}))}))},this.init()},i(document).ready((function(){GFStripeAdmin=new n}))}}); \ No newline at end of file diff --git a/js/frontend.js b/js/frontend.js index edd3c63..599f59d 100644 --- a/js/frontend.js +++ b/js/frontend.js @@ -1921,6 +1921,37 @@ class StripePaymentsHandler { } } +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + /***/ }), /***/ "./node_modules/whatwg-fetch/fetch.js": @@ -1932,22 +1963,25 @@ class StripePaymentsHandler { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Headers", function() { return Headers; }); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Headers", function() { return Headers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Request", function() { return Request; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Response", function() { return Response; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMException", function() { return DOMException; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetch", function() { return fetch; }); -var global = +/* eslint-disable no-prototype-builtins */ +var g = (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || - (typeof global !== 'undefined' && global) + // eslint-disable-next-line no-undef + (typeof global !== 'undefined' && global) || + {} var support = { - searchParams: 'URLSearchParams' in global, - iterable: 'Symbol' in global && 'iterator' in Symbol, + searchParams: 'URLSearchParams' in g, + iterable: 'Symbol' in g && 'iterator' in Symbol, blob: - 'FileReader' in global && - 'Blob' in global && + 'FileReader' in g && + 'Blob' in g && (function() { try { new Blob() @@ -1956,8 +1990,8 @@ var support = { return false } })(), - formData: 'FormData' in global, - arrayBuffer: 'ArrayBuffer' in global + formData: 'FormData' in g, + arrayBuffer: 'ArrayBuffer' in g } function isDataView(obj) { @@ -2028,6 +2062,9 @@ function Headers(headers) { }, this) } else if (Array.isArray(headers)) { headers.forEach(function(header) { + if (header.length != 2) { + throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length) + } this.append(header[0], header[1]) }, this) } else if (headers) { @@ -2098,6 +2135,7 @@ if (support.iterable) { } function consumed(body) { + if (body._noBody) return if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')) } @@ -2125,7 +2163,9 @@ function readBlobAsArrayBuffer(blob) { function readBlobAsText(blob) { var reader = new FileReader() var promise = fileReaderReady(reader) - reader.readAsText(blob) + var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type) + var encoding = match ? match[1] : 'utf-8' + reader.readAsText(blob, encoding) return promise } @@ -2163,9 +2203,11 @@ function Body() { semantic of setting Request.bodyUsed in the constructor before _initBody is called. */ + // eslint-disable-next-line no-self-assign this.bodyUsed = this.bodyUsed this._bodyInit = body if (!body) { + this._noBody = true; this._bodyText = '' } else if (typeof body === 'string') { this._bodyText = body @@ -2213,26 +2255,27 @@ function Body() { return Promise.resolve(new Blob([this._bodyText])) } } + } - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - var isConsumed = consumed(this) - if (isConsumed) { - return isConsumed - } - if (ArrayBuffer.isView(this._bodyArrayBuffer)) { - return Promise.resolve( - this._bodyArrayBuffer.buffer.slice( - this._bodyArrayBuffer.byteOffset, - this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength - ) + this.arrayBuffer = function() { + if (this._bodyArrayBuffer) { + var isConsumed = consumed(this) + if (isConsumed) { + return isConsumed + } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) { + return Promise.resolve( + this._bodyArrayBuffer.buffer.slice( + this._bodyArrayBuffer.byteOffset, + this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength ) - } else { - return Promise.resolve(this._bodyArrayBuffer) - } + ) } else { - return this.blob().then(readBlobAsArrayBuffer) + return Promise.resolve(this._bodyArrayBuffer) } + } else if (support.blob) { + return this.blob().then(readBlobAsArrayBuffer) + } else { + throw new Error('could not read as ArrayBuffer') } } @@ -2267,7 +2310,7 @@ function Body() { } // HTTP methods whose capitalization should be normalized -var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] +var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'] function normalizeMethod(method) { var upcased = method.toUpperCase() @@ -2308,7 +2351,12 @@ function Request(input, options) { } this.method = normalizeMethod(options.method || this.method || 'GET') this.mode = options.mode || this.mode || null - this.signal = options.signal || this.signal + this.signal = options.signal || this.signal || (function () { + if ('AbortController' in g) { + var ctrl = new AbortController(); + return ctrl.signal; + } + }()); this.referrer = null if ((this.method === 'GET' || this.method === 'HEAD') && body) { @@ -2370,7 +2418,11 @@ function parseHeaders(rawHeaders) { var key = parts.shift().trim() if (key) { var value = parts.join(':').trim() - headers.append(key, value) + try { + headers.append(key, value) + } catch (error) { + console.warn('Response ' + error.message) + } } }) return headers @@ -2388,6 +2440,9 @@ function Response(bodyInit, options) { this.type = 'default' this.status = options.status === undefined ? 200 : options.status + if (this.status < 200 || this.status > 599) { + throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].") + } this.ok = this.status >= 200 && this.status < 300 this.statusText = options.statusText === undefined ? '' : '' + options.statusText this.headers = new Headers(options.headers) @@ -2407,7 +2462,9 @@ Response.prototype.clone = function() { } Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}) + var response = new Response(null, {status: 200, statusText: ''}) + response.ok = false + response.status = 0 response.type = 'error' return response } @@ -2422,7 +2479,7 @@ Response.redirect = function(url, status) { return new Response(null, {status: status, headers: {location: url}}) } -var DOMException = global.DOMException +var DOMException = g.DOMException try { new DOMException() } catch (err) { @@ -2452,10 +2509,16 @@ function fetch(input, init) { xhr.onload = function() { var options = { - status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') } + // This check if specifically for when a user fetches a file locally from the file system + // Only if the status is out of a normal range + if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { + options.status = 200; + } else { + options.status = xhr.status; + } options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL') var body = 'response' in xhr ? xhr.response : xhr.responseText setTimeout(function() { @@ -2471,7 +2534,7 @@ function fetch(input, init) { xhr.ontimeout = function() { setTimeout(function() { - reject(new TypeError('Network request failed')) + reject(new TypeError('Network request timed out')) }, 0) } @@ -2483,7 +2546,7 @@ function fetch(input, init) { function fixUrl(url) { try { - return url === '' && global.location.href ? global.location.href : url + return url === '' && g.location.href ? g.location.href : url } catch (e) { return url } @@ -2501,18 +2564,23 @@ function fetch(input, init) { if (support.blob) { xhr.responseType = 'blob' } else if ( - support.arrayBuffer && - request.headers.get('Content-Type') && - request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1 + support.arrayBuffer ) { xhr.responseType = 'arraybuffer' } } - if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) { + if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) { + var names = []; Object.getOwnPropertyNames(init.headers).forEach(function(name) { + names.push(normalizeName(name)) xhr.setRequestHeader(name, normalizeValue(init.headers[name])) }) + request.headers.forEach(function(value, name) { + if (names.indexOf(name) === -1) { + xhr.setRequestHeader(name, value) + } + }) } else { request.headers.forEach(function(value, name) { xhr.setRequestHeader(name, value) @@ -2536,13 +2604,14 @@ function fetch(input, init) { fetch.polyfill = true -if (!global.fetch) { - global.fetch = fetch - global.Headers = Headers - global.Request = Request - global.Response = Response +if (!g.fetch) { + g.fetch = fetch + g.Headers = Headers + g.Request = Request + g.Response = Response } +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) /***/ }), diff --git a/js/frontend.js.map b/js/frontend.js.map index 4205acc..43b7a20 100644 --- a/js/frontend.js.map +++ b/js/frontend.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/src/frontend.js","webpack:///./js/src/payment-element/request.js","webpack:///./js/src/payment-element/stripe-payments-handler.js","webpack:///./node_modules/whatwg-fetch/fetch.js"],"names":["window","GFStripe","gform","extensions","styles","gravityformsstripe","$","args","prop","hasOwnProperty","form","activeFeed","GFCCField","stripeResponse","hasPaymentIntent","stripePaymentHandlers","cardStyle","formId","componentStyles","Object","keys","length","JSON","parse","stringify","pageInstance","setComponentStyleValue","key","value","themeFrameworkStyles","manualElement","resolvedValue","indexOf","computedValue","getPropertyValue","selector","getComputedStyle","resolvedKey","replace","toLowerCase","trim","setComponentStyles","obj","objKey","parentKey","document","getElementById","firstFormControl","querySelector","forEach","objPath","init","isCreditCardOnPage","stripe_payment","GFStripeObj","feedActivated","hidePostalCode","apiKey","ccFieldId","addAction","feeds","i","addonSlug","isActivated","j","feedId","gformCalculateTotalPrice","StripePaymentsHandler","stripe","Stripe","elements","address_zip","card","_destroyed","destroy","next","remove","create","classes","cardClasses","style","hide","html","gforms_stripe_frontend_strings","requires_action","jQuery","append","gf_global","spinnerUrl","$iconSpan","isThemeFrameWork","console","log","removeClass","addClass","scaActionHandler","mount","attr","on","event","displayStripeCardError","setPublishableKey","getElement","isStripePaymentHandlerInitiated","after","no_active_frontend_feed","wp","a11y","speak","resetStripeStatus","isLastPage","addFilter","total","getOrderData","paymentAmount","paymentAmountInfo","getProductFieldPrice","price","qty","setupFeeInfo","setupFee","stripe_connect_enabled","updatePaymentAmount","order","skipElementsHandler","val","sourcePage","parseInt","targetPage","data","gformIsHidden","maybeHitRateLimits","invisibleCaptchaPending","recaptchav3Pending","preventDefault","maybeAddSpinner","injectHoneypot","validate","submit","type","createPaymentMethod","createToken","ccInputPrefix","cc","number","find","exp_month","exp_year","cvc","name","status","response","responseHandler","payment_element_intent_failure","validationMessage","prepend","fieldId","GFMergeTag","getMergeTagValue","getBillingAddressMergeTag","field","ccInputSuffixes","input","ccNumber","cardType","gformFindCardType","cardLabels","slice","toJSON","elementsResponseHandler","currency","applyFilters","amount","gf_currency_config","decimals","gformRoundPrice","error","paymentMethod","last4","brand","ajax","async","url","ajaxurl","dataType","method","action","nonce","create_payment_intent_nonce","payment_method","feed_id","success","token","payment_intent","id","currentResponse","updatedToken","retrievePaymentIntent","client_secret","then","result","paymentIntent","handleCardAction","scaSuccess","handleCardPayment","trigger","targetPageInput","isConversationalForm","convoForm","currentPage","getCurrentPageNumber","ccPage","currentPageInput","isAjax","gformAddSpinner","$spinnerTarget","spinnerNodes","querySelectorAll","node","cardErrors","message","cardholderName","tokenData","address_line1","replaceMergeTags","address_line2","address_city","address_state","address_country","country","countryFieldValue","code","line1","line2","city","state","postal_code","billing_details","address","cardErrorCount","reCaptcha","reCaptchaResponse","recaptchaField","recaptchaResponse","target","shouldInjectHoneypot","isFormSubmission","isSaveContinue","isHeadlessBrowser","hashInput","version_hash","insertAdjacentHTML","dataset","formid","nodes","getNodes","targetEl","_phantom","callPhantom","__phantomas","Buffer","emit","spawn","webdriver","_selenium","_Selenium_IDE_Recorder","callSelenium","__nightmare","domAutomation","domAutomationController","__webdriver_evaluate","__selenium_evaluate","__webdriver_script_function","__webdriver_script_func","__webdriver_script_fn","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__driver_evaluate","__selenium_unwrapped","__fxdriver_unwrapped","documentElement","getAttribute","convert","custom","selectorString","convertElements","converted","unshift","undefined","request","isJson","has","set","get","delete","options","credentials","body","headers","URL","searchParams","is_preview","fetch","toString","json","constructor","draftId","validateForm","bind","handlelinkEmailFieldChange","reInitiateLinkWithEmailAddress","clearErrors","initStripe","link_email_field_id","emailField","email","link","mountCard","bindEvents","getStripeCoupon","coupons","stripeCoupons","currentCoupon","getStripeCouponCode","foundCoupon","coupon","localeCompare","sensitivity","getStripeCouponInput","couponField","couponInput","className","couponCode","bindStripeCoupon","addEventListener","handleCouponChange","setAttribute","classList","contains","toUpperCase","updateStripeCoupon","coupon_code","get_stripe_coupon_nonce","initialPaymentInformation","initial_payment_information","appearance","payment_method_types","values","mountLink","linkDiv","createElement","add","before","String","match","destroyLink","emailAddress","defaultValues","siblings","complete","failWithMessage","payment_incomplete","getFormData","invalid_nonce","failed_to_confirm_intent","invoice_id","redirect_url","location","href","resume_token","tracking_id","is_valid_intent","intent","is_valid_submission","is_valid","is_spam","resetFormValidationErrors","hasTrial","isValidCoupon","coupon_invalid","handleRedirect","getRedirectUrl","confirm","payment_amount","formData","FormData","appendParams","Math","random","validate_form_nonce","newAmount","mode","round","updatedPaymentInformation","update","applyStripeCoupon","percentage_off","amount_off","confirmData","submitError","paymentData","clientSecret","confirmParams","return_url","payment_method_data","redirect","paymentResult","isSetupIntent","confirmSetup","confirmPayment","e","handlePaymentRedirect","handleFailedPayment","setupIntent","intentTypeString","isAjaxEmbed","errorMessage","delete_draft_nonce","rate_limiting_nonce","error_count","linkContainer","el","failed_to_process_payment","_gformPriceFields","setUpFieldId","productTotal","isTrial","recurringAmount","isTextCoupon","gformCalculateProductPrice"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAAA;;;;AAIA;;AAEAA,OAAOC,QAAP,GAAkB,IAAlB;;AAEAC,MAAMC,UAAN,GAAmBD,MAAMC,UAAN,IAAoB,EAAvC;AACAD,MAAMC,UAAN,CAAiBC,MAAjB,GAA0BF,MAAMC,UAAN,CAAiBC,MAAjB,IAA2B,EAArD;AACAF,MAAMC,UAAN,CAAiBC,MAAjB,CAAwBC,kBAAxB,GAA6CH,MAAMC,UAAN,CAAiBC,MAAjB,CAAwBC,kBAAxB,IAA8C,EAA3F;;AAEA,CAAC,UAAUC,CAAV,EAAa;;AAEbL,YAAW,UAAUM,IAAV,EAAgB;;AAE1B,OAAM,IAAIC,IAAV,IAAkBD,IAAlB,EAAyB;AACxB,OAAKA,KAAKE,cAAL,CAAqBD,IAAr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,GAA6BpT,QAAxD;AACA;;AAED,SAAO,KAAKG,KAAZ;AACA;;AAEDkT,gBAAe;AACd,QAAMvG,SAAS,KAAKG,oBAAL,EAAf;AACA,MAAK,CAAEH,MAAP,EAAgB;AACf,UAAO,KAAP;AACA;;AAED,SAAO,CAAEA,OAAOY,SAAP,CAAiBC,QAAjB,CAA2B,gBAA3B,CAAT;AACA;;AAED;;;;;;;;AAQA6E,aAAa/Y,MAAb,EAAsB;AACrB,SAAOoE,OAAQ,uBAAuBpE,MAA/B,EAAwCI,MAAxC,IAAkD,CAAzD;AACA;AAr0ByC,C;;;;;;;;;;;;ACD3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,qDAAqD;AACrD,OAAO;AACP;AACA,OAAO;AACP,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,qBAAqB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,qCAAqC,0BAA0B;AAC/D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,6BAA6B,0BAA0B,eAAe;AACtE;;AAEO;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"./js/frontend.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * Front-end Script\n */\n\nimport StripePaymentsHandler from \"./payment-element/stripe-payments-handler\";\n\nwindow.GFStripe = null;\n\ngform.extensions = gform.extensions || {};\ngform.extensions.styles = gform.extensions.styles || {};\ngform.extensions.styles.gravityformsstripe = gform.extensions.styles.gravityformsstripe || {};\n\n(function ($) {\n\n\tGFStripe = function (args) {\n\n\t\tfor ( var prop in args ) {\n\t\t\tif ( args.hasOwnProperty( prop ) )\n\t\t\t\tthis[ prop ] = args[ prop ];\n\t\t}\n\n\t\tthis.form = null;\n\n\t\tthis.activeFeed = null;\n\n\t\tthis.GFCCField = null;\n\n\t\tthis.stripeResponse = null;\n\n\t\tthis.hasPaymentIntent = false;\n\n\t\tthis.stripePaymentHandlers = {};\n\n\t\tthis.cardStyle = this.cardStyle || {};\n\n\t\tgform.extensions.styles.gravityformsstripe[ this.formId ] = gform.extensions.styles.gravityformsstripe[ this.formId ] || {};\n\n\t\tconst componentStyles = Object.keys( this.cardStyle ).length > 0 ? JSON.parse( JSON.stringify( this.cardStyle ) ) : gform.extensions.styles.gravityformsstripe[ this.formId ][ this.pageInstance ] || {};\n\n\t\tthis.setComponentStyleValue = function ( key, value, themeFrameworkStyles, manualElement ) {\n\t\t\tlet resolvedValue = '';\n\n\t\t\t// If the value provided is a custom property let's begin\n\t\t\tif ( value.indexOf( '--' ) === 0 ) {\n\t\t\t\tconst computedValue = themeFrameworkStyles.getPropertyValue( value );\n\n\t\t\t\t// If we have a computed end value from the custom property, let's use that\n\t\t\t\tif ( computedValue ) {\n\t\t\t\t\tresolvedValue = computedValue;\n\t\t\t\t}\n\t\t\t\t\t// Otherwise, let's use a provided element or the form wrapper\n\t\t\t\t// along with the key to nab the computed end value for the CSS property\n\t\t\t\telse {\n\t\t\t\t\tconst selector = manualElement ? getComputedStyle( manualElement ) : themeFrameworkStyles;\n\t\t\t\t\tconst resolvedKey = key === 'fontSmoothing' ? '-webkit-font-smoothing' : key;\n\t\t\t\t\tresolvedValue = selector.getPropertyValue( resolvedKey.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase() );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise let's treat the provided value as the actual CSS value wanted\n\t\t\telse {\n\t\t\t\tresolvedValue = value;\n\t\t\t}\n\n\t\t\treturn resolvedValue.trim();\n\t\t};\n\n\t\tthis.setComponentStyles = function ( obj, objKey, parentKey ) {\n\t\t\t// If our object doesn't have any styles specified, let's bail here\n\t\t\tif ( Object.keys( obj ).length === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Grab the computed styles for the form, which the global CSS API and theme framework are scoped to\n\t\t\tconst form = document.getElementById( 'gform_' + this.formId );\n\t\t\tconst themeFrameworkStyles = getComputedStyle( form );\n\n\t\t\t// Grab the first form control in the form for fallback CSS property value computation\n\t\t\tconst firstFormControl = form.querySelector( '.gfield input' )\n\n\t\t\t// Note, this currently only supports three levels deep of object nesting.\n\t\t\tObject.keys( obj ).forEach( ( key ) => {\n\t\t\t\t// Handling of keys that are objects with additional key/value pairs\n\t\t\t\tif ( typeof obj[ key ] === 'object' ) {\n\n\t\t\t\t\t// Create object for top level key\n\t\t\t\t\tif ( !parentKey ) {\n\t\t\t\t\t\tthis.cardStyle[ key ] = {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create object for second level key\n\t\t\t\t\tif ( parentKey ) {\n\t\t\t\t\t\tthis.cardStyle[ parentKey ][ key ] = {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst objPath = parentKey ? parentKey : key;\n\n\t\t\t\t\t// Recursively pass each key's object through our method for continued processing\n\t\t\t\t\tthis.setComponentStyles( obj[ key ], key, objPath );\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Handling of keys that are not objects and need their value to be set\n\t\t\t\tif ( typeof obj[ key ] !== 'object' ) {\n\t\t\t\t\tlet value = '';\n\t\t\t\t\t// Handling of nested keys\n\t\t\t\t\tif ( parentKey ) {\n\t\t\t\t\t\tif ( objKey && objKey !== parentKey ) {\n\t\t\t\t\t\t\t// Setting value for a key three levels into the object\n\t\t\t\t\t\t\tvalue = this.setComponentStyleValue( key, componentStyles[ parentKey ][ objKey ][ key ], themeFrameworkStyles, firstFormControl );\n\t\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\t\tthis.cardStyle[ parentKey ][ objKey ][ key ] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Setting value for a key two levels into the object\n\t\t\t\t\t\t\tvalue = this.setComponentStyleValue( key, componentStyles[ parentKey ][ key ], themeFrameworkStyles, firstFormControl );\n\t\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\t\tthis.cardStyle[ parentKey ][ key ] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Setting value for a key one level into the object\n\t\t\t\t\t\tvalue = this.setComponentStyleValue( key, componentStyles[ key ], themeFrameworkStyles, firstFormControl );\n\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\tthis.cardStyle[ key ] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\n\t\tthis.init = async function () {\n\n\t\t\tthis.setComponentStyles( componentStyles );\n\n\t\t\tif ( !this.isCreditCardOnPage() ) {\n\t\t\t\tif ( this.stripe_payment === 'stripe.js' || ( this.stripe_payment === 'elements' && !$( '#gf_stripe_response' ).length ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar GFStripeObj = this, activeFeed = null, feedActivated = false,\n\t\t\t\thidePostalCode = false, apiKey = this.apiKey;\n\n\t\t\tthis.form = $( '#gform_' + this.formId );\n\t\t\tthis.GFCCField = $( '#input_' + this.formId + '_' + this.ccFieldId + '_1' );\n\n\t\t\tgform.addAction( 'gform_frontend_feeds_evaluated', async function ( feeds, formId ) {\n\t\t\t\tif ( formId !== GFStripeObj.formId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tactiveFeed = null;\n\t\t\t\tfeedActivated = false;\n\t\t\t\thidePostalCode = false;\n\n\t\t\t\tfor ( var i = 0; i < Object.keys( feeds ).length; i++ ) {\n\t\t\t\t\tif ( feeds[ i ].addonSlug === 'gravityformsstripe' && feeds[ i ].isActivated ) {\n\t\t\t\t\t\tfeedActivated = true;\n\n\t\t\t\t\t\tfor ( var j = 0; j < Object.keys( GFStripeObj.feeds ).length; j++ ) {\n\t\t\t\t\t\t\tif ( GFStripeObj.feeds[ j ].feedId === feeds[ i ].feedId ) {\n\t\t\t\t\t\t\t\tactiveFeed = GFStripeObj.feeds[ j ];\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapiKey = activeFeed.hasOwnProperty( 'apiKey' ) ? activeFeed.apiKey : GFStripeObj.apiKey;\n\t\t\t\t\t\tGFStripeObj.activeFeed = activeFeed;\n\n\t\t\t\t\t\tgformCalculateTotalPrice( formId );\n\n\t\t\t\t\t\tif ( GFStripeObj.stripe_payment == 'payment_element' ) {\n\t\t\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ] = new StripePaymentsHandler( apiKey, GFStripeObj );\n\t\t\t\t\t\t} else if ( GFStripeObj.stripe_payment === 'elements' ) {\n\t\t\t\t\t\t\tstripe = Stripe( apiKey );\n\t\t\t\t\t\t\telements = stripe.elements();\n\n\t\t\t\t\t\t\thidePostalCode = activeFeed.address_zip !== '';\n\n\t\t\t\t\t\t\t// If Stripe Card is already on the page (AJAX failed validation, or switch frontend feeds),\n\t\t\t\t\t\t\t// Destroy the card field so we can re-initiate it.\n\t\t\t\t\t\t\tif ( card != null && card.hasOwnProperty( '_destroyed' ) && card._destroyed === false ) {\n\t\t\t\t\t\t\t\tcard.destroy();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Clear card field errors before initiate it.\n\t\t\t\t\t\t\tif ( GFStripeObj.GFCCField.next( '.validation_message' ).length ) {\n\t\t\t\t\t\t\t\tGFStripeObj.GFCCField.next( '.validation_message' ).remove();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcard = elements.create(\n\t\t\t\t\t\t\t\t'card',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tclasses: GFStripeObj.cardClasses,\n\t\t\t\t\t\t\t\t\tstyle: GFStripeObj.cardStyle,\n\t\t\t\t\t\t\t\t\thidePostalCode: hidePostalCode\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( $( '.gform_stripe_requires_action' ).length ) {\n\t\t\t\t\t\t\t\tif ( $( '.ginput_container_creditcard > div' ).length === 2 ) {\n\t\t\t\t\t\t\t\t\t// Cardholder name enabled.\n\t\t\t\t\t\t\t\t\t$( '.ginput_container_creditcard > div:last' ).hide();\n\t\t\t\t\t\t\t\t\t$( '.ginput_container_creditcard > div:first' ).html( '

' + gforms_stripe_frontend_strings.requires_action + '

' );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$( '.ginput_container_creditcard' ).html( '

' + gforms_stripe_frontend_strings.requires_action + '

' );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Add a spinner next to the validation message and disable the submit button until we are over with 3D Secure.\n\t\t\t\t\t\t\t\tif ( jQuery( '#gform_' + formId + '_validation_container h2 .gform_ajax_spinner').length <= 0 ) {\n\t\t\t\t\t\t\t\t\tjQuery( '#gform_' + formId + '_validation_container h2' ).append( '\"\"');\n\t\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , true );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Update legacy close icon to an info icon.\n\t\t\t\t\t\t\t\tconst $iconSpan = jQuery( '#gform_' + formId + '_validation_container h2 .gform-icon.gform-icon--close' );\n\t\t\t\t\t\t\t\tconst isThemeFrameWork = jQuery( '.gform-theme--framework' ).length;\n\t\t\t\t\t\t\t\tconsole.log( isThemeFrameWork );\n\t\t\t\t\t\t\t\tconsole.log( $iconSpan );\n\t\t\t\t\t\t\t\tif ( $iconSpan.length && ! isThemeFrameWork ) {\n\t\t\t\t\t\t\t\t\t$iconSpan.removeClass( 'gform-icon--close' ).addClass( 'gform-icon--info' );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tGFStripeObj.scaActionHandler( stripe, formId );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcard.mount( '#' + GFStripeObj.GFCCField.attr( 'id' ) );\n\n\t\t\t\t\t\t\t\tcard.on( 'change', function ( event ) {\n\t\t\t\t\t\t\t\t\tGFStripeObj.displayStripeCardError( event );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( GFStripeObj.stripe_payment == 'stripe.js' ) {\n\t\t\t\t\t\t\tStripe.setPublishableKey( apiKey );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak; // allow only one active feed.\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !feedActivated ) {\n\t\t\t\t\tif ( GFStripeObj.stripe_payment === 'elements' || GFStripeObj.stripe_payment === 'payment_element' ) {\n\t\t\t\t\t\tif ( elements != null && card === elements.getElement( 'card' ) ) {\n\t\t\t\t\t\t\tcard.destroy();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( GFStripeObj.isStripePaymentHandlerInitiated( formId ) ) {\n\t\t\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].destroy();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( !GFStripeObj.GFCCField.next( '.validation_message' ).length ) {\n\t\t\t\t\t\t\tGFStripeObj.GFCCField.after( '
' + gforms_stripe_frontend_strings.no_active_frontend_feed + '
' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twp.a11y.speak( gforms_stripe_frontend_strings.no_active_frontend_feed );\n\t\t\t\t\t}\n\n\t\t\t\t\t// remove Stripe fields and form status when Stripe feed deactivated\n\t\t\t\t\tGFStripeObj.resetStripeStatus( GFStripeObj.form, formId, GFStripeObj.isLastPage() );\n\t\t\t\t\tapiKey = GFStripeObj.apiKey;\n\t\t\t\t\tGFStripeObj.activeFeed = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Set priority to 51 so it will be triggered after the coupons add-on\n\t\t\tgform.addFilter( 'gform_product_total', function ( total, formId ) {\n\n\t\t\t\tif (\n\t\t\t\t\tGFStripeObj.stripe_payment == 'payment_element' &&\n\t\t\t\t\tGFStripeObj.isStripePaymentHandlerInitiated( formId )\n\t\t\t\t) {\n\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].getOrderData( total, formId );\n\t\t\t\t}\n\n\t\t\t\tif ( ! GFStripeObj.activeFeed ) {\n\t\t\t\t\twindow['gform_stripe_amount_' + formId] = 0;\n\t\t\t\t\treturn total;\n\t\t\t\t}\n\n\t\t\t\tif ( GFStripeObj.activeFeed.paymentAmount !== 'form_total' ) {\n\n\t\t\t\t\tconst paymentAmountInfo = GFStripeObj.getProductFieldPrice( formId, GFStripeObj.activeFeed.paymentAmount );\n\t\t\t\t\twindow[ 'gform_stripe_amount_' + formId ] = paymentAmountInfo.price * paymentAmountInfo.qty;\n\n\t\t\t\t\tif ( GFStripeObj.activeFeed.hasOwnProperty('setupFee') ) {\n\t\t\t\t\t\tconst setupFeeInfo = GFStripeObj.getProductFieldPrice( formId, GFStripeObj.activeFeed.setupFee );\n\t\t\t\t\t\twindow['gform_stripe_amount_' + formId] += setupFeeInfo.price * setupFeeInfo.qty;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\twindow[ 'gform_stripe_amount_' + formId ] = total;\n\t\t\t\t}\n\n\t\t\t\t// Update elements payment amount if payment element is enabled.\n\t\t\t\tif (\n\t\t\t\t\tGFStripeObj.stripe_payment == 'payment_element' &&\n\t\t\t\t\tGFStripeObj.isStripePaymentHandlerInitiated( formId ) &&\n\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].elements !== null &&\n\t\t\t\t\tgforms_stripe_frontend_strings.stripe_connect_enabled === \"1\"\n\t\t\t\t) {\n\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].updatePaymentAmount( GFStripeObj.stripePaymentHandlers[ formId ].order.paymentAmount )\n\t\t\t\t}\n\n\t\t\t\treturn total;\n\n\t\t\t}, 51 );\n\n\t\t\tswitch ( this.stripe_payment ) {\n\t\t\t\tcase 'elements':\n\t\t\t\t\tvar stripe = null,\n\t\t\t\t\t\telements = null,\n\t\t\t\t\t\tcard = null,\n\t\t\t\t\t\tskipElementsHandler = false;\n\n\t\t\t\t\tif ( $( '#gf_stripe_response' ).length ) {\n\t\t\t\t\t\tthis.stripeResponse = JSON.parse( $( '#gf_stripe_response' ).val() );\n\n\t\t\t\t\t\tif ( this.stripeResponse.hasOwnProperty( 'client_secret' ) ) {\n\t\t\t\t\t\t\tthis.hasPaymentIntent = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// bind Stripe functionality to submit event\n\t\t\t$( '#gform_' + this.formId ).on( 'submit', function ( event ) {\n\n\t\t\t\t// Don't proceed with payment logic if clicking on the Previous button.\n\t\t\t\tlet skipElementsHandler = false;\n\t\t\t\tconst sourcePage = parseInt( $( '#gform_source_page_number_' + GFStripeObj.formId ).val(), 10 )\n\t\t\t\tconst targetPage = parseInt( $( '#gform_target_page_number_' + GFStripeObj.formId ).val(), 10 );\n\t\t\t\tif ( ( sourcePage > targetPage && targetPage !== 0 ) ) {\n\t\t\t\t\tskipElementsHandler = true;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tskipElementsHandler\n\t\t\t\t\t|| !feedActivated\n\t\t\t\t\t|| $( this ).data( 'gfstripesubmitting' )\n\t\t\t\t\t|| $( '#gform_save_' + GFStripeObj.formId ).val() == 1\n\t\t\t\t\t|| ( !GFStripeObj.isLastPage() && 'elements' !== GFStripeObj.stripe_payment )\n\t\t\t\t\t|| gformIsHidden( GFStripeObj.GFCCField )\n\t\t\t\t\t|| GFStripeObj.maybeHitRateLimits()\n\t\t\t\t\t|| GFStripeObj.invisibleCaptchaPending()\n\t\t\t\t\t|| GFStripeObj.recaptchav3Pending()\n\t\t\t\t\t|| 'payment_element' === GFStripeObj.stripe_payment && window[ 'gform_stripe_amount_' + GFStripeObj.formId ] === 0\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t$( this ).data( 'gfstripesubmitting', true );\n\t\t\t\t\tGFStripeObj.maybeAddSpinner();\n\t\t\t\t}\n\n\t\t\t\tswitch ( GFStripeObj.stripe_payment ) {\n\t\t\t\t\tcase 'payment_element':\n\t\t\t\t\t\tGFStripeObj.injectHoneypot( event );\n\t\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ GFStripeObj.formId ].validate( event );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'elements':\n\t\t\t\t\t\tGFStripeObj.form = $( this );\n\n\t\t\t\t\t\tif ( ( GFStripeObj.isLastPage() && !GFStripeObj.isCreditCardOnPage() ) || gformIsHidden( GFStripeObj.GFCCField ) || skipElementsHandler ) {\n\t\t\t\t\t\t\t$( this ).submit();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( activeFeed.type === 'product' ) {\n\t\t\t\t\t\t\t// Create a new payment method when every time the Stripe Elements is resubmitted.\n\t\t\t\t\t\t\tGFStripeObj.createPaymentMethod( stripe, card );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tGFStripeObj.createToken( stripe, card );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'stripe.js':\n\t\t\t\t\t\tvar form = $( this ),\n\t\t\t\t\t\t\tccInputPrefix = 'input_' + GFStripeObj.formId + '_' + GFStripeObj.ccFieldId + '_',\n\t\t\t\t\t\t\tcc = {\n\t\t\t\t\t\t\t\tnumber: form.find( '#' + ccInputPrefix + '1' ).val(),\n\t\t\t\t\t\t\t\texp_month: form.find( '#' + ccInputPrefix + '2_month' ).val(),\n\t\t\t\t\t\t\t\texp_year: form.find( '#' + ccInputPrefix + '2_year' ).val(),\n\t\t\t\t\t\t\t\tcvc: form.find( '#' + ccInputPrefix + '3' ).val(),\n\t\t\t\t\t\t\t\tname: form.find( '#' + ccInputPrefix + '5' ).val()\n\t\t\t\t\t\t\t};\n\n\n\t\t\t\t\t\tGFStripeObj.form = form;\n\n\t\t\t\t\t\tStripe.card.createToken( cc, function ( status, response ) {\n\t\t\t\t\t\t\tGFStripeObj.responseHandler( status, response );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t// Show validation message if a payment element payment intent failed and we coulnd't tell until the page has been reloaded\n\t\t\tif ( 'payment_element_intent_failure' in GFStripeObj && GFStripeObj.payment_element_intent_failure ) {\n\t\t\t\tconst validationMessage = jQuery( '

' + gforms_stripe_frontend_strings.payment_element_intent_failure + '

' );\n\t\t\t\tjQuery( '#gform_wrapper_' + GFStripeObj.formId ).prepend( validationMessage );\n\t\t\t}\n\t\t};\n\n\t\tthis.getProductFieldPrice = function ( formId, fieldId ) {\n\n\t\t\tvar price = GFMergeTag.getMergeTagValue( formId, fieldId, ':price' ),\n\t\t\t\tqty = GFMergeTag.getMergeTagValue( formId, fieldId, ':qty' );\n\n\t\t\tif ( typeof price === 'string' ) {\n\t\t\t\tprice = GFMergeTag.getMergeTagValue( formId, fieldId + '.2', ':price' );\n\t\t\t\tqty = GFMergeTag.getMergeTagValue( formId, fieldId + '.3', ':qty' );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tprice: price,\n\t\t\t\tqty: qty\n\t\t\t};\n\t\t}\n\n\t\tthis.getBillingAddressMergeTag = function (field) {\n\t\t\tif (field === '') {\n\t\t\t\treturn '';\n\t\t\t} else {\n\t\t\t\treturn '{:' + field + ':value}';\n\t\t\t}\n\t\t};\n\n\t\tthis.responseHandler = function (status, response) {\n\n\t\t\tvar form = this.form,\n\t\t\t\tccInputPrefix = 'input_' + this.formId + '_' + this.ccFieldId + '_',\n\t\t\t\tccInputSuffixes = ['1', '2_month', '2_year', '3', '5'];\n\n\t\t\t// remove \"name\" attribute from credit card inputs\n\t\t\tfor (var i = 0; i < ccInputSuffixes.length; i++) {\n\n\t\t\t\tvar input = form.find('#' + ccInputPrefix + ccInputSuffixes[i]);\n\n\t\t\t\tif (ccInputSuffixes[i] == '1') {\n\n\t\t\t\t\tvar ccNumber = $.trim(input.val()),\n\t\t\t\t\t\tcardType = gformFindCardType(ccNumber);\n\n\t\t\t\t\tif (typeof this.cardLabels[cardType] != 'undefined')\n\t\t\t\t\t\tcardType = this.cardLabels[cardType];\n\n\t\t\t\t\tform.append($('').val(ccNumber.slice(-4)));\n\t\t\t\t\tform.append($('').val(cardType));\n\n\t\t\t\t}\n\n\t\t\t\t// name attribute is now removed from markup in GFStripe::add_stripe_inputs()\n\t\t\t\t//input.attr( 'name', null );\n\n\t\t\t}\n\n\t\t\t// append stripe.js response\n\t\t\tform.append($('').val($.toJSON(response)));\n\n\t\t\t// submit the form\n\t\t\tform.submit();\n\n\t\t};\n\n\t\tthis.elementsResponseHandler = function (response) {\n\n\t\t\tvar form = this.form,\n\t\t\t\tGFStripeObj = this,\n\t\t\t\tactiveFeed = this.activeFeed,\n\t\t\t currency = gform.applyFilters( 'gform_stripe_currency', this.currency, this.formId ),\n\t\t\t\tamount = (0 === gf_global.gf_currency_config.decimals) ? window['gform_stripe_amount_' + this.formId] : gformRoundPrice( window['gform_stripe_amount_' + this.formId] * 100 );\n\n\t\t\tif (response.error) {\n\t\t\t\t// display error below the card field.\n\t\t\t\tthis.displayStripeCardError(response);\n\t\t\t\t// when Stripe response contains errors, stay on page\n\t\t\t\t// but remove some elements so the form can be submitted again\n\t\t\t\t// also remove last_4 and card type if that already exists (this happens when people navigate back to previous page and submit an empty CC field)\n\t\t\t\tthis.resetStripeStatus(form, this.formId, this.isLastPage());\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this.hasPaymentIntent) {\n\t\t\t\t// append stripe.js response\n\t\t\t\tif (!$('#gf_stripe_response').length) {\n\t\t\t\t\tform.append($('').val($.toJSON(response)));\n\t\t\t\t} else {\n\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(response));\n\t\t\t\t}\n\n\t\t\t\tif (activeFeed.type === 'product') {\n\t\t\t\t\t//set last 4\n\t\t\t\t\tform.append($('').val(response.paymentMethod.card.last4));\n\n\t\t\t\t\t// set card type\n\t\t\t\t\tform.append($('').val(response.paymentMethod.card.brand));\n\t\t\t\t\t// Create server side payment intent.\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\turl: gforms_stripe_frontend_strings.ajaxurl,\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\taction: \"gfstripe_create_payment_intent\",\n\t\t\t\t\t\t\tnonce: gforms_stripe_frontend_strings.create_payment_intent_nonce,\n\t\t\t\t\t\t\tpayment_method: response.paymentMethod,\n\t\t\t\t\t\t\tcurrency: currency,\n\t\t\t\t\t\t\tamount: amount,\n\t\t\t\t\t\t\tfeed_id: activeFeed.feedId\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t\t\t// populate the stripe_response field again.\n\t\t\t\t\t\t\t\tif (!$('#gf_stripe_response').length) {\n\t\t\t\t\t\t\t\t\tform.append($('').val($.toJSON(response.data)));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(response.data));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// submit the form\n\t\t\t\t\t\t\t\tform.submit();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresponse.error = response.data;\n\t\t\t\t\t\t\t\tdelete response.data;\n\t\t\t\t\t\t\t\tGFStripeObj.displayStripeCardError(response);\n\t\t\t\t\t\t\t\tGFStripeObj.resetStripeStatus(form, GFStripeObj.formId, GFStripeObj.isLastPage());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tform.append($('').val(response.token.card.last4));\n\t\t\t\t\tform.append($('').val(response.token.card.brand));\n\t\t\t\t\tform.submit();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (activeFeed.type === 'product') {\n\t\t\t\t\tif (response.hasOwnProperty('paymentMethod')) {\n\t\t\t\t\t\t$('#gf_stripe_credit_card_last_four').val(response.paymentMethod.card.last4);\n\t\t\t\t\t\t$('#stripe_credit_card_type').val(response.paymentMethod.card.brand);\n\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\turl: gforms_stripe_frontend_strings.ajaxurl,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\taction: \"gfstripe_update_payment_intent\",\n\t\t\t\t\t\t\t\tnonce: gforms_stripe_frontend_strings.create_payment_intent_nonce,\n\t\t\t\t\t\t\t\tpayment_intent: response.id,\n\t\t\t\t\t\t\t\tpayment_method: response.paymentMethod,\n\t\t\t\t\t\t\t\tcurrency: currency,\n\t\t\t\t\t\t\t\tamount: amount,\n\t\t\t\t\t\t\t\tfeed_id: activeFeed.feedId\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(response.data));\n\t\t\t\t\t\t\t\t\tform.submit();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresponse.error = response.data;\n\t\t\t\t\t\t\t\t\tdelete response.data;\n\t\t\t\t\t\t\t\t\tGFStripeObj.displayStripeCardError(response);\n\t\t\t\t\t\t\t\t\tGFStripeObj.resetStripeStatus(form, GFStripeObj.formId, GFStripeObj.isLastPage());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (response.hasOwnProperty('amount')) {\n\t\t\t\t\t\tform.submit();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar currentResponse = JSON.parse($('#gf_stripe_response').val());\n\t\t\t\t\tcurrentResponse.updatedToken = response.token.id;\n\n\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(currentResponse));\n\n\t\t\t\t\tform.append($('').val(response.token.card.last4));\n\t\t\t\t\tform.append($('').val(response.token.card.brand));\n\t\t\t\t\tform.submit();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.scaActionHandler = function (stripe, formId) {\n\t\t\tif ( ! $('#gform_' + formId).data('gfstripescaauth') ) {\n\t\t\t\t$('#gform_' + formId).data('gfstripescaauth', true);\n\n\t\t\t\tvar GFStripeObj = this, response = JSON.parse($('#gf_stripe_response').val());\n\t\t\t\tif (this.activeFeed.type === 'product') {\n\t\t\t\t\t// Prevent the 3D secure auth from appearing twice, so we need to check if the intent status first.\n\t\t\t\t\tstripe.retrievePaymentIntent(\n\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\tif ( result.paymentIntent.status === 'requires_action' ) {\n\t\t\t\t\t\t\tstripe.handleCardAction(\n\t\t\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\t\t\tvar currentResponse = JSON.parse($('#gf_stripe_response').val());\n\t\t\t\t\t\t\t\tcurrentResponse.scaSuccess = true;\n\n\t\t\t\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(currentResponse));\n\n\t\t\t\t\t\t\t\tGFStripeObj.maybeAddSpinner();\n\t\t\t\t\t\t\t\t// Enable the submit button, which was disabled before displaying the SCA warning message, so we can submit the form.\n\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , false );\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripescaauth', false);\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripesubmitting', true).submit();\n\t\t\t\t\t\t\t\t// There are a couple of seconds delay where the button is available for clicking before the thank you page is displayed,\n\t\t\t\t\t\t\t\t// Disable the button so the user will not think it needs to be clicked again.\n\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , true );\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tstripe.retrievePaymentIntent(\n\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\tif ( result.paymentIntent.status === 'requires_action' ) {\n\t\t\t\t\t\t\tstripe.handleCardPayment(\n\t\t\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\t\t\tGFStripeObj.maybeAddSpinner();\n\t\t\t\t\t\t\t\t// Enable the submit button, which was disabled before displaying the SCA warning message, so we can submit the form.\n\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , false );\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripescaauth', false);\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripesubmitting', true).trigger( 'submit' );\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.isLastPage = function () {\n\n\t\t\tvar targetPageInput = $('#gform_target_page_number_' + this.formId);\n\t\t\tif (targetPageInput.length > 0)\n\t\t\t\treturn targetPageInput.val() == 0;\n\n\t\t\treturn true;\n\t\t};\n\n\t\t/**\n\t\t * @function isConversationalForm\n\t\t * @description Determines if we are on conversational form mode\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @returns {boolean}\n\t\t */\n\t\tthis.isConversationalForm = function () {\n\t\t\tconst convoForm = $('[data-js=\"gform-conversational-form\"]');\n\n\t\t\treturn convoForm.length > 0;\n\t\t}\n\n\t\t/**\n\t\t * @function isCreditCardOnPage\n\t\t * @description Determines if the credit card field is on the current page\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @returns {boolean}\n\t\t */\n\t\tthis.isCreditCardOnPage = function () {\n\n\t\t\tvar currentPage = this.getCurrentPageNumber();\n\n\t\t\t// if current page is false or no credit card page number or this is a convo form, assume this is not a multi-page form\n\t\t\tif ( ! this.ccPage || ! currentPage || this.isConversationalForm() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn this.ccPage == currentPage;\n\t\t};\n\n\t\tthis.getCurrentPageNumber = function () {\n\t\t\tvar currentPageInput = $('#gform_source_page_number_' + this.formId);\n\t\t\treturn currentPageInput.length > 0 ? currentPageInput.val() : false;\n\t\t};\n\n\t\tthis.maybeAddSpinner = function () {\n\t\t\tif (this.isAjax)\n\t\t\t\treturn;\n\n\t\t\tif (typeof gformAddSpinner === 'function') {\n\t\t\t\tgformAddSpinner(this.formId);\n\t\t\t} else {\n\t\t\t\t// Can be removed after min Gravity Forms version passes 2.1.3.2.\n\t\t\t\tvar formId = this.formId;\n\n\t\t\t\tif (jQuery('#gform_ajax_spinner_' + formId).length == 0) {\n\t\t\t\t\tvar spinnerUrl = gform.applyFilters('gform_spinner_url', gf_global.spinnerUrl, formId),\n\t\t\t\t\t\t$spinnerTarget = gform.applyFilters('gform_spinner_target_elem', jQuery('#gform_submit_button_' + formId + ', #gform_wrapper_' + formId + ' .gform_next_button, #gform_send_resume_link_button_' + formId), formId);\n\t\t\t\t\t$spinnerTarget.after('\"\"');\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tthis.resetStripeStatus = function(form, formId, isLastPage) {\n\t\t\t$('#gf_stripe_response, #gf_stripe_credit_card_last_four, #stripe_credit_card_type').remove();\n\t\t\tform.data('gfstripesubmitting', false);\n\t\t\tconst spinnerNodes = document.querySelectorAll( '#gform_ajax_spinner_' + formId );\n\t\t\tspinnerNodes.forEach( function( node ) {\n\t\t\t\tnode.remove();\n\t\t\t} );\n\t\t\t// must do this or the form cannot be submitted again\n\t\t\tif (isLastPage) {\n\t\t\t\twindow[\"gf_submitting_\" + formId] = false;\n\t\t\t}\n\t\t};\n\n\t\tthis.displayStripeCardError = function (event) {\n\t\t\tif (event.error && !this.GFCCField.next('.validation_message').length) {\n\t\t\t\tthis.GFCCField.after('
');\n\t\t\t}\n\n\t\t\tvar cardErrors = this.GFCCField.next('.validation_message');\n\n\t\t\tif (event.error) {\n\t\t\t\tcardErrors.html(event.error.message);\n\n\t\t\t\twp.a11y.speak( event.error.message, 'assertive' );\n\t\t\t\t// Hide spinner.\n\t\t\t\tif ( $('#gform_ajax_spinner_' + this.formId).length > 0 ) {\n\t\t\t\t\t$('#gform_ajax_spinner_' + this.formId).remove();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcardErrors.remove();\n\t\t\t}\n\t\t};\n\n\t\tthis.createToken = function (stripe, card) {\n\n\t\t\tconst GFStripeObj = this;\n\t\t\tconst activeFeed = this.activeFeed;\n\t\t\tconst cardholderName = $( '#input_' + GFStripeObj.formId + '_' + GFStripeObj.ccFieldId + '_5' ).val();\n\t\t\tconst tokenData = {\n\t\t\t\t\tname: cardholderName,\n\t\t\t\t\taddress_line1: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line1)),\n\t\t\t\t\taddress_line2: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line2)),\n\t\t\t\t\taddress_city: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_city)),\n\t\t\t\t\taddress_state: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_state)),\n\t\t\t\t\taddress_zip: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_zip)),\n\t\t\t\t\taddress_country: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_country)),\n\t\t\t\t\tcurrency: gform.applyFilters( 'gform_stripe_currency', this.currency, this.formId )\n\t\t\t\t};\n\t\t\tstripe.createToken(card, tokenData).then(function (response) {\n\t\t\t\tGFStripeObj.elementsResponseHandler(response);\n\t\t\t});\n\t\t}\n\n\t\tthis.createPaymentMethod = function (stripe, card, country) {\n\t\t\tvar GFStripeObj = this, activeFeed = this.activeFeed, countryFieldValue = '';\n\n\t\t\tif ( activeFeed.address_country !== '' ) {\n\t\t\t\tcountryFieldValue = GFMergeTag.replaceMergeTags(GFStripeObj.formId, GFStripeObj.getBillingAddressMergeTag(activeFeed.address_country));\n\t\t\t}\n\n\t\t\tif (countryFieldValue !== '' && ( typeof country === 'undefined' || country === '' )) {\n $.ajax({\n async: false,\n url: gforms_stripe_frontend_strings.ajaxurl,\n dataType: 'json',\n method: 'POST',\n data: {\n action: \"gfstripe_get_country_code\",\n nonce: gforms_stripe_frontend_strings.create_payment_intent_nonce,\n country: countryFieldValue,\n feed_id: activeFeed.feedId\n },\n success: function (response) {\n if (response.success) {\n GFStripeObj.createPaymentMethod(stripe, card, response.data.code);\n }\n }\n });\n } else {\n var cardholderName = $('#input_' + this.formId + '_' + this.ccFieldId + '_5').val(),\n\t\t\t\t\tline1 = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line1)),\n\t\t\t\t\tline2 = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line2)),\n\t\t\t\t\tcity = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_city)),\n\t\t\t\t\tstate = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_state)),\n\t\t\t\t\tpostal_code = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_zip)),\n data = { billing_details: { name: null, address: {} } };\n\n if (cardholderName !== '') {\n \tdata.billing_details.name = cardholderName;\n\t\t\t\t}\n\t\t\t\tif (line1 !== '') {\n\t\t\t\t\tdata.billing_details.address.line1 = line1;\n\t\t\t\t}\n\t\t\t\tif (line2 !== '') {\n\t\t\t\t\tdata.billing_details.address.line2 = line2;\n\t\t\t\t}\n\t\t\t\tif (city !== '') {\n\t\t\t\t\tdata.billing_details.address.city = city;\n\t\t\t\t}\n\t\t\t\tif (state !== '') {\n\t\t\t\t\tdata.billing_details.address.state = state;\n\t\t\t\t}\n\t\t\t\tif (postal_code !== '') {\n\t\t\t\t\tdata.billing_details.address.postal_code = postal_code;\n\t\t\t\t}\n\t\t\t\tif (country !== '') {\n\t\t\t\t\tdata.billing_details.address.country = country;\n\t\t\t\t}\n\n\t\t\t\tif (data.billing_details.name === null) {\n\t\t\t\t\tdelete data.billing_details.name;\n\t\t\t\t}\n\t\t\t\tif (data.billing_details.address === {}) {\n\t\t\t\t\tdelete data.billing_details.address;\n\t\t\t\t}\n\n\t\t\t\tstripe.createPaymentMethod('card', card, data).then(function (response) {\n\t\t\t\t\tif (GFStripeObj.stripeResponse !== null) {\n\t\t\t\t\t\tresponse.id = GFStripeObj.stripeResponse.id;\n\t\t\t\t\t\tresponse.client_secret = GFStripeObj.stripeResponse.client_secret;\n\t\t\t\t\t}\n\n\t\t\t\t\tGFStripeObj.elementsResponseHandler(response);\n\t\t\t\t});\n }\n\t\t};\n\n\t\tthis.maybeHitRateLimits = function() {\n\t\t\tif (this.hasOwnProperty('cardErrorCount')) {\n\t\t\t\tif (this.cardErrorCount >= 5) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tthis.invisibleCaptchaPending = function () {\n\t\t\tvar form = this.form,\n\t\t\t\treCaptcha = form.find('.ginput_recaptcha');\n\n\t\t\tif (!reCaptcha.length || reCaptcha.data('size') !== 'invisible') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar reCaptchaResponse = reCaptcha.find('.g-recaptcha-response');\n\n\t\t\treturn !(reCaptchaResponse.length && reCaptchaResponse.val());\n\t\t}\n\n\t\t/**\n\t\t * @function recaptchav3Pending\n\t\t * @description Check if recaptcha v3 is enabled and pending a response.\n\t\t *\n\t\t * @since 5.5.0\n\t\t */\n\t\tthis.recaptchav3Pending = function () {\n\t\t\tconst form = this.form;\n\t\t\tconst recaptchaField = form.find( '.ginput_recaptchav3' );\n\t\t\tif ( ! recaptchaField.length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst recaptchaResponse = recaptchaField.find( '.gfield_recaptcha_response' );\n\n\t\t\treturn ! ( recaptchaResponse && recaptchaResponse.val() );\n\t\t};\n\n\t\t/**\n\t\t * This is duplicated honeypot logic from core that can be removed once Stripe can consume the core honeypot js.\n\t\t */\n\n\n\t\t/**\n\t\t * @function injectHoneypot\n\t\t * @description Duplicated from core. Injects the honeypot field when appropriate.\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @param {jQuery.Event} event Form submission event.\n\t\t */\n\t\tthis.injectHoneypot = ( event ) => {\n\t\t\tconst form = event.target;\n\t\t\tconst shouldInjectHoneypot = ( this.isFormSubmission( form ) || this.isSaveContinue( form ) ) && ! this.isHeadlessBrowser();\n\n\t\t\tif ( shouldInjectHoneypot ) {\n\t\t\t\tconst hashInput = ``;\n\t\t\t\tform.insertAdjacentHTML( 'beforeend', hashInput );\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * @function isSaveContinue\n\t\t * @description Duplicated from core. Determines if this submission is from a Save and Continue click.\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @param {HTMLFormElement} form The form that was submitted.\n\t\t *\n\t\t * @return {boolean} Returns true if this submission was initiated via a Save a Continue button click. Returns false otherwise.\n\t\t */\n\t\tthis.isSaveContinue = ( form ) => {\n\t\t\tconst formId = form.dataset.formid;\n\t\t\tconst nodes = this.getNodes( `#gform_save_${ formId }`, true, form, true );\n\t\t\treturn nodes.length > 0 && nodes[ 0 ].value === '1';\n\t\t};\n\n\t\t/**\n\t\t * @function isFormSubmission\n\t\t * @description Duplicated from core. Determines if this is a standard form submission (ie. not a next or previous page submission, and not a save and continue submission).\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @param {HTMLFormElement} form The form that was submitted.\n\t\t *\n\t\t * @return {boolean} Returns true if this is a standard form submission. Returns false otherwise.\n\t\t */\n\t\tthis.isFormSubmission = ( form ) => {\n\t\t\tconst formId = form.dataset.formid;\n\t\t\tconst targetEl = this.getNodes( `input[name = \"gform_target_page_number_${ formId }\"]`, true, form, true )[ 0 ];\n\t\t\tif ( 'undefined' === typeof targetEl ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst targetPage = parseInt( targetEl.value );\n\t\t\treturn targetPage === 0;\n\t\t};\n\n\t\t/**\n\t\t * @function isHeadlessBrowser.\n\t\t * @description Determines if the currently browser is headless.\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @return {boolean} Returns true for headless browsers. Returns false otherwise.\n\t\t */\n\t\tthis.isHeadlessBrowser = () => {\n\t\t\treturn window._phantom || window.callPhantom || // phantomjs.\n\t\t\t\twindow.__phantomas || // PhantomJS-based web perf metrics + monitoring tool.\n\t\t\t\twindow.Buffer || // nodejs.\n\t\t\t\twindow.emit || // couchjs.\n\t\t\t\twindow.spawn || // rhino.\n\t\t\t\twindow.webdriver || window._selenium || window._Selenium_IDE_Recorder || window.callSelenium || // selenium.\n\t\t\t\twindow.__nightmare ||\n\t\t\t\twindow.domAutomation ||\n\t\t\t\twindow.domAutomationController || // chromium based automation driver.\n\t\t\t\twindow.document.__webdriver_evaluate || window.document.__selenium_evaluate ||\n\t\t\t\twindow.document.__webdriver_script_function || window.document.__webdriver_script_func || window.document.__webdriver_script_fn ||\n\t\t\t\twindow.document.__fxdriver_evaluate ||\n\t\t\t\twindow.document.__driver_unwrapped ||\n\t\t\t\twindow.document.__webdriver_unwrapped ||\n\t\t\t\twindow.document.__driver_evaluate ||\n\t\t\t\twindow.document.__selenium_unwrapped ||\n\t\t\t\twindow.document.__fxdriver_unwrapped ||\n\t\t\t\twindow.document.documentElement.getAttribute( 'selenium' ) ||\n\t\t\t\twindow.document.documentElement.getAttribute( 'webdriver' ) ||\n\t\t\t\twindow.document.documentElement.getAttribute( 'driver' );\n\t\t};\n\n\t\t/**\n\t\t * @function getNodes.\n\t\t * @description Duplicated from core until the build system can use Gravity Forms utilities.\n\t\t *\n\t\t * @since 5.\n\t\t */\n\t\tthis.getNodes = (\n\t\tselector = '',\n\t\tconvert = false,\n\t\tnode = document,\n\t\tcustom = false\n\t\t) => {\n\t\t\tconst selectorString = custom ? selector : `[data-js=\"${ selector }\"]`;\n\t\t\tlet nodes = node.querySelectorAll( selectorString );\n\t\t\tif ( convert ) {\n\t\t\t\tnodes = this.convertElements( nodes );\n\t\t\t}\n\t\t\treturn nodes;\n\t\t}\n\n\t\t/**\n\t\t * @function convertElements.\n\t\t * @description Duplicated from core until the build system can use Gravity Forms utilities.\n\t\t *\n\t\t * @since 5.0\n\t\t */\n\t\tthis.convertElements = ( elements = [] ) => {\n\t\t\tconst converted = [];\n\t\t\tlet i = elements.length;\n\t\t\tfor ( i; i--; converted.unshift( elements[ i ] ) ); // eslint-disable-line\n\n\t\t\treturn converted;\n\t\t}\n\n\t\t/**\n\t\t * @function isStripePaymentHandlerInitiated.\n\t\t * @description Checks if a Stripe payment handler has been initiated for a form.\n\t\t *\n\t\t * @since 5.4\n\t\t */\n\t\tthis.isStripePaymentHandlerInitiated = function ( formId ) {\n\t\t\treturn (\n\t\t\t\tformId in this.stripePaymentHandlers &&\n\t\t\t\tthis.stripePaymentHandlers[ formId ] !== null &&\n\t\t\t\tthis.stripePaymentHandlers[ formId ] !== undefined\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * End duplicated honeypot logic.\n\t\t */\n\n\t\tthis.init();\n\n\t}\n\n})(jQuery);\n","const request = async( data, isJson = false, action = false, nonce = false ) => {\n\n\t// Delete gform_ajax if it exists in the FormData object\n\tif ( typeof data.has === 'function' && data.has( 'gform_ajax' ) ) {\n\n\t\t// Saves a temp gform_ajax so that it can be reset later during form processing.\n\t\tdata.set( 'gform_ajax--stripe-temp', data.get( 'gform_ajax' ) );\n\n\t\t// Remove the ajax input to prevent Gravity Forms ajax submission handler from handling the submission in the backend during Stripe's validation.\n\t\tdata.delete( 'gform_ajax' );\n\t}\n\n\tconst options = {\n\t\tmethod: 'POST',\n\t\tcredentials: 'same-origin',\n\t\tbody: data,\n\t};\n\n\tif ( isJson ) {\n\t\toptions.headers = { 'Accept': 'application/json', 'content-type': 'application/json' }\n\t}\n\n\tconst url = new URL( gforms_stripe_frontend_strings.ajaxurl )\n\n\tif ( action ) {\n\t\turl.searchParams.set( 'action', action )\n\t}\n\n\tif ( nonce ) {\n\t\turl.searchParams.set( 'nonce', nonce )\n\t}\n\n\tif ( gforms_stripe_frontend_strings.is_preview ) {\n\t\turl.searchParams.set( 'preview', '1' )\n\t}\n\n\treturn await fetch(\n\t\turl.toString(),\n\t\toptions\n\t).then(\n\t\tresponse => response.json()\n\t);\n}\n\nexport default request;\n","import request from './request';\nexport default class StripePaymentsHandler {\n\n\t/**\n\t * StripePaymentsHandler constructor\n\t *\n\t * @since 5.0\n\t *\n\t * @param {String} apiKey The stripe API key.\n\t * @param {Object} GFStripeObj The stripe addon JS object.\n\t */\n\tconstructor( apiKey, GFStripeObj ) {\n\t\tthis.GFStripeObj = GFStripeObj;\n\t\tthis.apiKey = apiKey;\n\t\tthis.stripe = null;\n\t\tthis.elements = null;\n\t\tthis.card = null;\n\t\tthis.paymentMethod = null;\n\t\tthis.draftId = null;\n\t\t// A workaround so we can call validate method from outside this class while still accessing the correct scope.\n\t\tthis.validateForm = this.validate.bind( this );\n\t\tthis.handlelinkEmailFieldChange = this.reInitiateLinkWithEmailAddress.bind( this );\n\t\tthis.order = {\n\t\t\t'recurringAmount': 0,\n\t\t\t'paymentAmount': 0,\n\t\t};\n\t\t// The object gets initialized everytime frontend feeds are evaluated so we need to clear any previous errors.\n\t\tthis.clearErrors();\n\n\t\tif ( ! this.initStripe() || gforms_stripe_frontend_strings.stripe_connect_enabled !== \"1\" ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create the payment element and mount it.\n\t\tthis.card = this.elements.create( 'payment' );\n\n\t\t// If an email field is mapped to link, bind it to initiate link on change.\n\t\tif ( GFStripeObj.activeFeed.link_email_field_id ) {\n\t\t\tconst emailField = document.querySelector( '#input_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.link_email_field_id );\n\t\t\tconst email = emailField ? emailField.value : '';\n\t\t\tthis.handlelinkEmailFieldChange( { target: { value: email } } );\n\t\t} else {\n\t\t\tthis.link = null;\n\t\t}\n\n\t\tthis.mountCard();\n\t\tthis.bindEvents();\n\t}\n\n\t/**\n\t * @function getStripeCoupon\n\t * @description Retrieves the cached coupon associated with the entered coupon code.\n\t *\n\t * @since 5.1\n\t * @returns {object} Returns the cached coupon object or undefined if the coupon is not found.\n\t */\n\tgetStripeCoupon\t() {\n\t\tconst coupons = window.stripeCoupons || {};\n\t\tconst currentCoupon = this.getStripeCouponCode();\n\t\tconst foundCoupon = Object.keys(coupons).find(coupon => {\n\t\t\treturn coupon.localeCompare(currentCoupon, undefined, { sensitivity: 'accent' }) === 0;\n\t\t});\n\n\t\treturn foundCoupon ? coupons[foundCoupon] : undefined;\n\t}\n\n\t/**\n\t * @function getStripeCouponInput\n\t * @description Retrieves the coupon input associated with the active feed.\n\t *\n\t * @since 5.1\n\t *\n\t * @returns {HTMLInputElement} Returns the coupon input or null if the coupon input is not found.\n\t */\n\tgetStripeCouponInput() {\n\t\tconst couponField = document.querySelector( '#field_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.coupon );\n\t\treturn couponField ? couponField.querySelector( 'input' ) : null;\n\t}\n\n\t/**\n\t * @function getStripeCouponCode\n\t * @description Retrieves the coupon code from the coupon input associated with the active feed.\n\t *\n\t * @since 5.1\n\t *\n\t * @returns {string} Returns the coupon code or an empty string if the coupon input is not found.\n\t */\n\tgetStripeCouponCode() {\n\t\tconst couponInput = this.getStripeCouponInput();\n\t\tif ( ! couponInput ) {\n\t\t\treturn '';\n\t\t}\n\t\tif ( couponInput.className === 'gf_coupon_code' ) {\n\t\t\tconst couponCode = couponInput ? document.querySelector( '#gf_coupon_codes_' + this.GFStripeObj.formId ).value : null;\n\t\t\treturn couponCode;\n\t\t}\n\n\t\treturn couponInput ? couponInput.value : '';\n\t}\n\n\t/**\n\t * @function bindStripeCoupon\n\t * @description Binds the coupon input change event.\n\t *\n\t * @since 5.1\n\t *\n\t * @returns {void}\n\t */\n\tbindStripeCoupon() {\n\n\t\t// Binding coupon input event if it has not been bound before.\n\t\tconst couponInput = this.getStripeCouponInput();\n\t\tif ( couponInput && ! couponInput.getAttribute( 'data-listener-added' ) ) {\n\t\t\tcouponInput.addEventListener( 'blur', this.handleCouponChange.bind( this ) );\n\t\t\tcouponInput.setAttribute( 'data-listener-added', true );\n\t\t}\n\t}\n\n\t/**\n\t * @function handleCouponChange\n\t * @description Handles the coupon input change event.\n\t *\n\t * @since 5.1\n\t *\n\t * @param event The event object.\n\t * @returns {Promise}\n\t */\n\tasync handleCouponChange( event ) {\n\n\t\tif( this.getStripeCouponInput() !== event.target ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.target.classList.contains( 'gf_coupon_code' ) ) {\n\t\t\tevent.target.value = event.target.value.toUpperCase();\n\t\t}\n\n\t\tawait this.updateStripeCoupon( event.target.value );\n\n\t\tgformCalculateTotalPrice( this.GFStripeObj.formId );\n\t}\n\n\t/**\n\t * @function updateStripeCoupon\n\t * @description Retrieves a coupon from Stripe based on the coupon_code specified and caches it in the window object.\n\t *\n\t * @since 5.1\n\t *\n\t * @param {string} coupon_code The coupon code\n\t * @returns {Promise}\n\t */\n\tasync updateStripeCoupon( coupon_code ) {\n\n\t\t// If the coupon code is empty, we don't need to do anything.\n\t\tif ( ! coupon_code ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initializing stripeCoupons object if it doesn't exist.\n\t\tif( ! window.stripeCoupons ){\n\t\t\twindow.stripeCoupons = {};\n\t\t}\n\n\t\t// If coupon has already been retrieved from Stripe, abort.\n\t\tif ( window.stripeCoupons[ coupon_code ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Retreive coupon from Stripe and store it in the window object.\n\t\tconst response = await request(\n\t\t\tJSON.stringify( {\n\t\t\t\t'coupon' : coupon_code,\n\t\t\t\t'feed_id' : this.GFStripeObj.activeFeed.feedId,\n\t\t\t} ),\n\t\t\ttrue,\n\t\t\t'gfstripe_get_stripe_coupon',\n\t\t\tgforms_stripe_frontend_strings.get_stripe_coupon_nonce,\n\t\t);\n\n\t\twindow.stripeCoupons[ coupon_code ] = response.data;\n\t}\n\n\t/**\n\t * Creates the Stripe object with the given API key.\n\t *\n\t * @since 5.0\n\t *\n\t * @return {boolean}\n\t */\n\tasync initStripe() {\n\t\tthis.stripe = Stripe( this.apiKey );\n\n\t\tconst initialPaymentInformation = this.GFStripeObj.activeFeed.initial_payment_information;\n\t\tconst appearance = this.GFStripeObj.cardStyle;\n\n\t\tif ( 'payment_method_types' in initialPaymentInformation ) {\n\t\t\tinitialPaymentInformation.payment_method_types = Object.values( initialPaymentInformation.payment_method_types );\n\t\t}\n\n\t\tthis.elements = this.stripe.elements( { ...initialPaymentInformation, appearance } );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Mounts the card element to the field node.\n\t *\n\t * @since 5.0\n\t */\n\tmountCard() {\n\t\tthis.card.mount( '#' + this.GFStripeObj.GFCCField.attr('id') );\n\t}\n\n\t/**\n\t * Creates a container node for the link element and mounts it.\n\t *\n\t * @since 5.0\n\t */\n\tmountLink() {\n\t\tif ( this.link === null ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( document.querySelectorAll( '.stripe-payment-link' ).length <= 0 ) {\n\t\t\tconst linkDiv = document.createElement( 'div' );\n\t\t\tlinkDiv.setAttribute( 'id', 'stripe-payment-link' );\n\t\t\tlinkDiv.classList.add( 'StripeElement--link' );\n\t\t\tthis.GFStripeObj.GFCCField.before( jQuery( linkDiv ) );\n\t\t}\n\n\t\tthis.link.mount( '#stripe-payment-link' );\n\t}\n\n\t/**\n\t * Binds event listeners.\n\t *\n\t * @since 5.0\n\t */\n\tasync bindEvents() {\n\t\tif ( this.card ) {\n\t\t\tthis.card.on( 'change', ( event ) => {\n\t\t\t\t\tif ( this.paymentMethod !== null ) {\n\t\t\t\t\t\tthis.clearErrors();\n\t\t\t\t\t}\n\t\t\t\t\tthis.paymentMethod = event;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Binding events for Stripe Coupon.\n\t\tthis.bindStripeCoupon();\n\n\t\tconst emailField = document.querySelector( '#input_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.link_email_field_id );\n\n\t\tif ( emailField === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\temailField.addEventListener( 'blur', this.handlelinkEmailFieldChange );\n\n\t\twindow.addEventListener( 'load', async function () {\n\t\tconst emailField = document.querySelector( '#input_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.link_email_field_id );\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\tString( emailField.value )\n\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t.match(\n\t\t\t\t\t\t\t/^(([^<>()[\\]\\\\.,;:\\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,}))$/\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t&& this.GFStripeObj.isLastPage()\n\t\t\t) {\n\t\t\t\tthis.handlelinkEmailFieldChange( { target: { value: emailField.value } } );\n\t\t\t}\n\n\t\t}.bind( this ) );\n\n\t}\n\n\t/**\n\t * Destroys the current instance of link and creates a new one with value extracted from the passed event.\n\t *\n\t * @since 5\n\t *\n\t * @param {Object} event an object that contains information about the email input.\n\t * @return {Promise}\n\t */\n\tasync reInitiateLinkWithEmailAddress( event ) {\n\n\t\tif ( this.GFStripeObj.isCreditCardOnPage() === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there is a Link instance, destroy it.\n\t\tthis.destroyLink();\n\n\t\tconst emailAddress = event.target.value;\n\t\tif ( emailAddress ) {\n\t\t\tthis.link = await this.elements.create( \"linkAuthentication\", { defaultValues: { email: emailAddress } } );\n\t\t\tthis.mountLink();\n\t\t\tthis.GFStripeObj.GFCCField.siblings( '.gfield #stripe-payment-link' ).addClass( 'visible' );\n\t\t}\n\t}\n\t/**\n\t * Validates the form.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {Object} event The form event object.\n\t *\n\t * @return {Promise}\n\t */\n\tasync validate( event ) {\n\t\t// If this is an ajax form submission, we just need to submit the form as everything has already been handled.\n\t\tconst form = jQuery( '#gform_' + this.GFStripeObj.formId );\n\t\tif ( form.data( 'isAjaxSubmitting' ) ) {\n\t\t\tform.submit();\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure the required information are entered.\n\t\t// Link stays incomplete even when email is entered, and it will fail with a friendly message when the confirmation request fails, so skip its frontend validation.\n\t\tif ( ! this.paymentMethod.complete && this.paymentMethod.value.type !== 'link' ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.payment_incomplete, this.GFStripeObj.formId )\n\t\t\treturn false;\n\t\t}\n\n\t\tgformAddSpinner( this.GFStripeObj.formId );\n\t\tconst response = await request( this.getFormData( event.target ) );\n\n\t\tif ( response === -1 ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.invalid_nonce, this.GFStripeObj.formId );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'success' in response && response.success === false ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.failed_to_confirm_intent, this.GFStripeObj.formId )\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Invoice for trials are automatically paid.\n\t\tif ( 'invoice_id' in response.data && response.data.invoice_id !== null && 'resume_token' in response.data ) {\n\t\t\tconst redirect_url = new URL( window.location.href );\n\t\t\tredirect_url.searchParams.append( 'resume_token', response.data.resume_token );\n\t\t\tredirect_url.searchParams.append( 'tracking_id', response.data.tracking_id );\n\t\t\twindow.location.href = redirect_url.href;\n\t\t}\n\n\t\tconst is_valid_intent = 'intent' in response.data\n\t\t\t\t\t\t\t\t\t&& response.data.intent !== false\n\t\t\t\t\t\t\t\t\t&& response.data.intent != null\n\t\t\t\t\t\t\t\t\t&& 'client_secret' in response.data.intent;\n\n\n\t\tconst is_valid_submission = 'data' in response\n\t\t\t\t\t\t\t\t\t&& 'is_valid' in response.data\n\t\t\t\t\t\t\t\t\t&& response.data.is_valid\n\t\t\t\t\t\t\t\t\t&& 'resume_token' in response.data\n\n\t\tconst is_spam = 'is_spam' in response.data && response.data.is_spam;\n\n\t\tif ( ! is_valid_intent && ! is_spam && is_valid_submission ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.failed_to_confirm_intent, this.GFStripeObj.formId )\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif ( is_valid_submission ) {\n\n\t\t\t// Reset any errors.\n\t\t\tthis.resetFormValidationErrors();\n\t\t\tthis.draftId = response.data.resume_token;\n\t\t\t// Validate Stripe coupon, if there is a setup fee or trial, the coupon won't be applied to the current payment, so pass validation as it is all handled in the backend.\n\t\t\tif (\n\t\t\t\tthis.GFStripeObj.activeFeed.hasTrial !== '1' &&\n\t\t\t\t! this.GFStripeObj.activeFeed.setupFee &&\n\t\t\t\t! this.isValidCoupon( response.data.total )\n\t\t\t) {\n\t\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.coupon_invalid, this.GFStripeObj.formId )\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Do not confirm payment if this is a spam submission.\n\t\t\tif ( is_spam ) {\n\t\t\t\t// For spam submissions, redirect to the confirmation page without confirming the payment. This will process the submission as a spam entry without capturing the payment.\n\t\t\t\tthis.handleRedirect( this.getRedirectUrl( response.data.resume_token ) );\n\t\t\t} else {\n\t\t\t\t// For non-spam submissions, confirm the payment and redirect to the confirmation page.\n\t\t\t\tthis.confirm( response.data );\n\t\t\t}\n\n\t\t} else {\n\t\t\t// Form is not valid, do a normal submit to render the validation errors markup in backend.\n\t\t\tevent.target.submit();\n\t\t}\n\t}\n\n\n\t/**\n\t * @function isValidCoupon\n\t * @description Validates the coupon code.\n\t *\n\t * @since 5.1\n\t *\n\t * @param {number} payment_amount Payment amount calculated by Stripe.\n\t *\n\t * @returns {boolean} Returns true if the coupon is valid, returns false otherwise.\n\t */\n\tisValidCoupon( payment_amount ) {\n\t\tconst coupon = this.getStripeCoupon();\n\t\tif ( ! coupon ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn coupon.is_valid && payment_amount == this.order.paymentAmount;\n\t}\n\n\t/**\n\t * Creates a FormData object containing the information required to validate the form and start the checkout process on the backend.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {Object} form The form object.\n\t *\n\t * @return {FormData}\n\t */\n\tgetFormData( form ) {\n\t\tconst formData = new FormData( form );\n\t\t// if gform_submit exist in the request, GFFormDisplay::process_form() will be called even before the AJAX handler.\n\t\tformData.delete( 'gform_submit' );\n\t\t// Append the payment data to the form.\n\t\tconst appendParams = {\n\t\t\t'action': 'gfstripe_validate_form',\n\t\t\t'feed_id': this.GFStripeObj.activeFeed.feedId,\n\t\t\t'form_id': this.GFStripeObj.formId,\n\t\t\t'tracking_id': Math.random().toString( 36 ).slice( 2, 10 ),\n\t\t\t'payment_method': this.paymentMethod.value.type,\n\t\t\t'nonce': gforms_stripe_frontend_strings.validate_form_nonce\n\t\t}\n\n\t\tObject.keys( appendParams ).forEach( ( key ) => {\n\t\t\tformData.append( key, appendParams[ key ] );\n\t\t} );\n\n\t\treturn formData;\n\t}\n\n\t/**\n\t * Updates the payment information amount.\n\t *\n\t * @since 5.1\n\t * @since 5.3 Added the updatedPaymentInformation filter.\n\t *\n\t * @param {Double} newAmount The updated amount.\n\t */\n\tupdatePaymentAmount( newAmount ) {\n\t\tif ( newAmount <= 0 || this.GFStripeObj.activeFeed.initial_payment_information.mode === 'setup' ) {\n\t\t\treturn;\n\t\t}\n\t\t// Get amount in cents (or the equivalent subunit for other currencies)\n\t\tlet total = newAmount * 100;\n\t\t// Round total to two decimal places.\n\t\ttotal = Math.round( total * 100 ) / 100;\n\n\t\tlet updatedPaymentInformation = {\n\t\t\tamount: total,\n\t\t};\n\n\t\t/**\n\t\t * Filters the payment information before updating it.\n\t\t *\n\t\t * @since 5.3\n\t\t *\n\t\t * @param {Object} updatedPaymentInformation The object that contains the updated payment information, for possible values, @see https://docs.stripe.com/js/elements_object/update#elements_update-options\n\t\t * @param {Object} initialPaymentInformation The initial payment information.\n\t\t * @param {int} feedId The feed ID.\n\t\t * @param {int} formId The form ID.\n\t\t *\n\t\t * @return {Object} The updated payment information.\n\t\t */\n\t\tupdatedPaymentInformation = window.gform.applyFilters( 'gform_stripe_payment_element_updated_payment_information', updatedPaymentInformation, this.GFStripeObj.activeFeed.initial_payment_information, this.GFStripeObj.activeFeed.feedId, this.GFStripeObj.formId );\n\n\t\tthis.elements.update( updatedPaymentInformation );\n\t}\n\n\t/**\n\t * @function applyStripeCoupon\n\t * @description Applies the coupon discount to the total.\n\t *\n\t * @since 5.1\n\t *\n\t * @param {number} total The payment amount.\n\t * @returns {number} Returns the updated total.\n\t */\n\tapplyStripeCoupon( total ) {\n\n\t\tconst coupon = this.getStripeCoupon();\n\t\tif ( ! coupon || ! coupon.is_valid ) {\n\t\t\treturn total;\n\t\t}\n\n\t\tif( coupon.percentage_off ) {\n\t\t\ttotal = total - ( total * ( coupon.percentage_off / 100 ) );\n\t\t} else if ( coupon.amount_off ) {\n\t\t\ttotal = total - coupon.amount_off;\n\t\t}\n\n\t\treturn total;\n\t}\n\n\t/**\n\t * Calls stripe confirm payment or confirm setup to attempt capturing the payment after form validation passed.\n\t *\n\t * @since 5.0\n\t * @since 5.4.0 Updated the method parameter, so it received the whole confirmData object instead of just the resume_token and client secret.\n\t *\n\t * @param {Object} confirmData The confirmData object that contains the resume_token, client secret and intent information.\n\t *\n\t * @return {Promise}\n\t */\n\tasync confirm( confirmData ) {\n\n\t\t// Prepare the return URL.\n\t\tconst redirect_url = this.getRedirectUrl( confirmData.resume_token );\n\t\tredirect_url.searchParams.append( 'tracking_id', confirmData.tracking_id );\n\n\t\tconst { error: submitError } = await this.elements.submit();\n\t\tif ( submitError ) {\n\t\t\tthis.failWithMessage( submitError.message , this.GFStripeObj.formId )\n\t\t\treturn;\n\t\t}\n\t\t// Gather the payment data.\n\t\tconst paymentData = {\n\t\t\telements: this.elements,\n\t\t\tclientSecret: confirmData.intent.client_secret,\n\t\t\tconfirmParams: {\n\t\t\t\treturn_url: redirect_url.toString(),\n\t\t\t\tpayment_method_data: {\n\t\t\t\t\tbilling_details: {\n\t\t\t\t\t\taddress: {\n\t\t\t\t\t\t\tline1: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_line1 ) ),\n\t\t\t\t\t\t\tline2: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_line2 ) ),\n\t\t\t\t\t\t\tcity: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_city ) ),\n\t\t\t\t\t\t\tstate: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_state ) ),\n\t\t\t\t\t\t\tpostal_code: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_zip ) ),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t// let Stripe handle redirection only if the payment method requires redirection to a third party page,\n\t\t\t// Otherwise, the add-on will handle the redirection.\n\t\t\tredirect: 'if_required',\n\t\t};\n\n\n\t\t/**\n\t\t * The promise that returns from calling stripe.confirmPayment or stripe.confirmSetup.\n\t\t *\n\t\t * If the payment method used requires redirecting the user to a third party page,\n\t\t * this promise will never resolve, as confirmPayment or confirmSetup redirect the user to the third party page.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @type {Promise}\n\t\t */\n\t\tlet paymentResult = {};\n\t\tlet isSetupIntent = confirmData.intent.id.indexOf( 'seti_' ) === 0;\n\t\ttry {\n\t\t\tpaymentResult = isSetupIntent ? await this.stripe.confirmSetup( paymentData ) : await this.stripe.confirmPayment( paymentData );\n\t\t} catch ( e ) {\n\t\t\tconsole.log( e );\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.failed_to_confirm_intent, this.GFStripeObj.formId )\n\t\t}\n\n\t\t// If we have a paymentIntent or a setupIntent in the result, the process was successful.\n\t\t// Note that confirming could be successful but the intent status is still 'processing' or 'pending'.\n\t\tif ( 'paymentIntent' in paymentResult || 'setupIntent' in paymentResult ) {\n\t\t\tthis.handlePaymentRedirect( paymentResult, redirect_url );\n\t\t} else {\n\t\t\tawait this.handleFailedPayment( paymentResult );\n\t\t}\n\t}\n\n\t/**\n\t * Redirects the user to the confirmation page after the payment intent is confirmed.\n\t *\n\t * This method will never be executed if the payment method used requires redirecting the user to a third party page.\n\t *\n\t * @since 5.0\n\t * @since 5.2 Added the redirect_url parameter.\n\t * @since 5.4 Renamed the function from handlePayment to handlePaymentRedirect.\n\t *\n\t * @param {Object} paymentResult The result of confirming a payment intent or a setup intent.\n\t * @param {URL} redirect_url The redirect URL the user will be taken to after confirmation.\n\t */\n\thandlePaymentRedirect( paymentResult, redirect_url ) {\n\t\tconst intent = paymentResult.paymentIntent ? paymentResult.paymentIntent : paymentResult.setupIntent;\n\t\t// Add parameters required for entry processing in the backend.\n\t\tconst intentTypeString = intent.id.indexOf( 'seti_' ) === 0 ? 'setup' : 'payment'\n\t\tredirect_url.searchParams.append( intentTypeString + '_intent', intent.id );\n\t\tredirect_url.searchParams.append( intentTypeString + '_intent_client_secret', intent.client_secret );\n\t\tredirect_url.searchParams.append( 'redirect_status', intent.status ? 'succeeded' : 'pending' );\n\n\t\tthis.handleRedirect( redirect_url );\n\t}\n\n\t/**\n\t * Redirects the user to the confirmation page.\n\t *\n\t * @since 5.4.1\n\t *\n\t * @param {URL} redirect_url The redirect URL the user will be taken to after confirmation.\n\t */\n\thandleRedirect( redirect_url ) {\n\n\t\t// If this is not an AJAX embedded form, redirect the user to the confirmation page.\n\t\tif ( ! this.isAjaxEmbed( this.GFStripeObj.formId ) ) {\n\t\t\twindow.location.href = redirect_url.toString();\n\t\t} else {\n\t\t\t// AJAX embeds are handled differently, we need to update the form's action with the redirect URL, and submit it inside the AJAX IFrame.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).attr( 'action' , redirect_url.toString() );\n\t\t\t// Prevent running same logic again after submitting the form.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).data( 'isAjaxSubmitting' , true );\n\t\t\t// Keeping this input makes the backend thinks it is not an ajax form, so we need to remove it.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).find( '[name=\"gform_submit\"]' ).remove();\n\t\t\t// Form will be submitted inside the IFrame, once IFrame content is updated, the form element will be replaced with the content of the IFrame.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).submit();\n\t\t}\n\t}\n\n\t/**\n\t * Returns the URL with the resume token appended to it.\n\t *\n\t * @since 5.4.1\n\t *\n\t * @param resume_token The resume token to append to the URL.\n\t *\n\t * @returns {URL} The URL with the resume token appended to it.\n\t */\n\tgetRedirectUrl( resume_token ) {\n\t\tconst redirect_url = new URL( window.location.href );\n\t\tredirect_url.searchParams.append( 'resume_token', resume_token );\n\t\tredirect_url.searchParams.append( 'feed_id', this.GFStripeObj.activeFeed.feedId );\n\t\tredirect_url.searchParams.append( 'form_id', this.GFStripeObj.formId );\n\t\treturn redirect_url;\n\t}\n\n\t/**\n\t * Handles a failed payment attempt.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {Object} paymentResult The result of confirming a payment intent or a setup intent.\n\t */\n\tasync handleFailedPayment( paymentResult ) {\n\t\tlet errorMessage = '';\n\t\tif ( 'error' in paymentResult && 'message' in paymentResult.error ) {\n\t\t\terrorMessage = paymentResult.error.message;\n\t\t}\n\t\tthis.failWithMessage( errorMessage, this.GFStripeObj.formId );\n\t\t// Delete the draft entry created.\n\t\tlet response = request(\n\t\t\tJSON.stringify( { 'draft_id': this.draftId } ),\n\t\t\ttrue,\n\t\t\t'gfstripe_delete_draft_entry',\n\t\t\tgforms_stripe_frontend_strings.delete_draft_nonce\n\t\t);\n\t\t// If rate limiting is enabled, increase the errors number at the backend side, and set the new count here.\n\t\tif ( this.GFStripeObj.hasOwnProperty( 'cardErrorCount' ) ) {\n\t\t\tresponse = await request(\n\t\t\t\tJSON.stringify( { 'increase_count': true } ),\n\t\t\t\ttrue ,\n\t\t\t\t'gfstripe_payment_element_check_rate_limiting',\n\t\t\t\tgforms_stripe_frontend_strings.rate_limiting_nonce\n\t\t\t);\n\t\t\tthis.GFStripeObj.cardErrorCount = response.data.error_count;\n\t\t}\n\t}\n\n\t/**\n\t * Destroys the stripe objects and removes any DOM nodes created while initializing them.\n\t *\n\t * @since 5.0\n\t */\n\tdestroy() {\n\t\tif ( this.card ) {\n\t\t\tthis.card.destroy();\n\t\t}\n\n\t\tthis.destroyLink();\n\t}\n\n\t/**\n\t * Destroys the Stripe payment link and removes any DOM nodes created while initializing it.\n\t *\n\t * @since 5.4.0\n\t */\n\tdestroyLink() {\n\t\tif ( this.link ) {\n\t\t\tthis.link.destroy();\n\t\t\tthis.link = null;\n\n\t\t\tconst linkContainer = this.GFStripeObj.GFCCField.siblings( '.gfield #stripe-payment-link' );\n\t\t\tif ( linkContainer ) {\n\t\t\t\tlinkContainer.remove();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clears the error messages around the Stripe card field.\n\t *\n\t * @since 5.0\n\t */\n\tclearErrors() {\n\t\t// Clear card field errors before initiate it.\n\t\tif ( this.GFStripeObj.GFCCField.next('.validation_message').length ) {\n\t\t\tthis.GFStripeObj.GFCCField.next('.validation_message').remove();\n\t\t}\n\t}\n\n\t/**\n\t * Removes the validation error messages from the form fields.\n\t *\n\t * @since 5.0\n\t */\n\tresetFormValidationErrors() {\n\t\tdocument.querySelectorAll( '.gform_validation_errors, .validation_message' ).forEach( ( el ) => { el.remove() } );\n\t\tdocument.querySelectorAll( '.gfield_error' ).forEach( ( el ) => { el.classList.remove( 'gfield_error' ) } );\n\t}\n\n\t/**\n\t * Displays an error message if the flow failed at any point, also clears the loading indicator and resets the form data attributes.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {String} message The error message to display.\n\t * @param {int} formId The form ID.\n\t */\n\tfailWithMessage( message, formId ) {\n\t\tmessage = message ? message : gforms_stripe_frontend_strings.failed_to_process_payment;\n\t\tthis.GFStripeObj.displayStripeCardError( { error : { message : message } } );\n\t\tthis.GFStripeObj.resetStripeStatus( jQuery( '#gform_' + formId ), formId, true );\n\t\tjQuery( '#gform_ajax_spinner_' + formId ).remove();\n\t}\n\n\t/**\n\t * Returns the merge tag for the billing address.\n\t *\n\t * @since 5.0\n\t *\n\t * @param field The billing address field.\n\t *\n\t * @return {string} The merge tag for the billing address.\n\t */\n\tgetBillingAddressMergeTag( field ) {\n\n\t\tif ( field === '' ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn '{:' + field + ':value}';\n\t}\n\n\t/**\n\t * Gets the order data.\n\t *\n\t * The order contains the following properties\n\t * \tpaymentAmount: The amount of the payment that will be charged after form submission.\n\t * \trecurringAmount: If this is a subscription, this is the recurring amount.\n\t *\n\t * @since 5.1\n\t *\n\t * @param total The form total.\n\t * @param formId The current form id.\n\t *\n\t * @return {Object} The order data.\n\t */\n\tgetOrderData( total, formId ) {\n\n\t\tif ( ! _gformPriceFields[ formId ] || this.GFStripeObj.activeFeed === null ) {\n\t\t\treturn this.order;\n\t\t}\n\n\t\tconst setUpFieldId = this.GFStripeObj.activeFeed.setupFee;\n\t\tlet setupFee = 0;\n\t\tlet productTotal = 0;\n\t\tconst isTrial = this.GFStripeObj.activeFeed.hasTrial;\n\n\n\t\t// If this is the setup fee field, or the shipping field, don't add to total.\n\t\tif ( setUpFieldId ) {\n\t\t\tconst setupFeeInfo = this.GFStripeObj.getProductFieldPrice( formId, this.GFStripeObj.activeFeed.setupFee );\n\t\t\tsetupFee = setupFeeInfo.price * setupFeeInfo.qty;\n\t\t\t// If this field is a setup fee, subtract it from total, so it is not added to the recurring amount.\n\t\t\ttotal -= setupFee;\n\t\t}\n\n\t\tif ( this.GFStripeObj.activeFeed.paymentAmount === 'form_total' ) {\n\t\t\tthis.order.recurringAmount = total;\n\t\t\tif ( this.isTextCoupon() ) {\n\t\t\t\tthis.order.recurringAmount = this.applyStripeCoupon( this.order.recurringAmount );\n\t\t\t}\n\t\t} else {\n\t\t\tthis.order.recurringAmount = gformCalculateProductPrice( formId, this.GFStripeObj.activeFeed.paymentAmount );\n\t\t\tthis.order.recurringAmount = this.applyStripeCoupon( this.order.recurringAmount );\n\t\t}\n\n\t\tif ( isTrial === '1' ) {\n\t\t\tthis.order.paymentAmount = setupFee;\n\t\t} else {\n\t\t\tthis.order.paymentAmount = this.order.recurringAmount + setupFee;\n\t\t}\n\n\t\treturn this.order;\n\t}\n\n\tisTextCoupon() {\n\t\tconst coupon = this.getStripeCouponInput();\n\t\tif ( ! coupon ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ! coupon.classList.contains( 'gf_coupon_code' )\n\t}\n\n\t/**\n\t * Decides whether the form is embedded with the AJAX option on or not.\n\t *\n\t * Since 5.2\n\t *\n\t * @param {integer} formId The form ID.\n\t * @returns {boolean}\n\t */\n\tisAjaxEmbed( formId ) {\n\t\treturn jQuery( '#gform_ajax_frame_' + formId ).length >= 1;\n\t}\n}\n","var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global)\n\nvar support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = global.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!global.fetch) {\n global.fetch = fetch\n global.Headers = Headers\n global.Request = Request\n global.Response = Response\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/src/frontend.js","webpack:///./js/src/payment-element/request.js","webpack:///./js/src/payment-element/stripe-payments-handler.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/whatwg-fetch/fetch.js"],"names":["window","GFStripe","gform","extensions","styles","gravityformsstripe","$","args","prop","hasOwnProperty","form","activeFeed","GFCCField","stripeResponse","hasPaymentIntent","stripePaymentHandlers","cardStyle","formId","componentStyles","Object","keys","length","JSON","parse","stringify","pageInstance","setComponentStyleValue","key","value","themeFrameworkStyles","manualElement","resolvedValue","indexOf","computedValue","getPropertyValue","selector","getComputedStyle","resolvedKey","replace","toLowerCase","trim","setComponentStyles","obj","objKey","parentKey","document","getElementById","firstFormControl","querySelector","forEach","objPath","init","isCreditCardOnPage","stripe_payment","GFStripeObj","feedActivated","hidePostalCode","apiKey","ccFieldId","addAction","feeds","i","addonSlug","isActivated","j","feedId","gformCalculateTotalPrice","StripePaymentsHandler","stripe","Stripe","elements","address_zip","card","_destroyed","destroy","next","remove","create","classes","cardClasses","style","hide","html","gforms_stripe_frontend_strings","requires_action","jQuery","append","gf_global","spinnerUrl","$iconSpan","isThemeFrameWork","console","log","removeClass","addClass","scaActionHandler","mount","attr","on","event","displayStripeCardError","setPublishableKey","getElement","isStripePaymentHandlerInitiated","after","no_active_frontend_feed","wp","a11y","speak","resetStripeStatus","isLastPage","addFilter","total","getOrderData","paymentAmount","paymentAmountInfo","getProductFieldPrice","price","qty","setupFeeInfo","setupFee","stripe_connect_enabled","updatePaymentAmount","order","skipElementsHandler","val","sourcePage","parseInt","targetPage","data","gformIsHidden","maybeHitRateLimits","invisibleCaptchaPending","recaptchav3Pending","preventDefault","maybeAddSpinner","injectHoneypot","validate","submit","type","createPaymentMethod","createToken","ccInputPrefix","cc","number","find","exp_month","exp_year","cvc","name","status","response","responseHandler","payment_element_intent_failure","validationMessage","prepend","fieldId","GFMergeTag","getMergeTagValue","getBillingAddressMergeTag","field","ccInputSuffixes","input","ccNumber","cardType","gformFindCardType","cardLabels","slice","toJSON","elementsResponseHandler","currency","applyFilters","amount","gf_currency_config","decimals","gformRoundPrice","error","paymentMethod","last4","brand","ajax","async","url","ajaxurl","dataType","method","action","nonce","create_payment_intent_nonce","payment_method","feed_id","success","token","payment_intent","id","currentResponse","updatedToken","retrievePaymentIntent","client_secret","then","result","paymentIntent","handleCardAction","scaSuccess","handleCardPayment","trigger","targetPageInput","isConversationalForm","convoForm","currentPage","getCurrentPageNumber","ccPage","currentPageInput","isAjax","gformAddSpinner","$spinnerTarget","spinnerNodes","querySelectorAll","node","cardErrors","message","cardholderName","tokenData","address_line1","replaceMergeTags","address_line2","address_city","address_state","address_country","country","countryFieldValue","code","line1","line2","city","state","postal_code","billing_details","address","cardErrorCount","reCaptcha","reCaptchaResponse","recaptchaField","recaptchaResponse","target","shouldInjectHoneypot","isFormSubmission","isSaveContinue","isHeadlessBrowser","hashInput","version_hash","insertAdjacentHTML","dataset","formid","nodes","getNodes","targetEl","_phantom","callPhantom","__phantomas","Buffer","emit","spawn","webdriver","_selenium","_Selenium_IDE_Recorder","callSelenium","__nightmare","domAutomation","domAutomationController","__webdriver_evaluate","__selenium_evaluate","__webdriver_script_function","__webdriver_script_func","__webdriver_script_fn","__fxdriver_evaluate","__driver_unwrapped","__webdriver_unwrapped","__driver_evaluate","__selenium_unwrapped","__fxdriver_unwrapped","documentElement","getAttribute","convert","custom","selectorString","convertElements","converted","unshift","undefined","request","isJson","has","set","get","delete","options","credentials","body","headers","URL","searchParams","is_preview","fetch","toString","json","constructor","draftId","validateForm","bind","handlelinkEmailFieldChange","reInitiateLinkWithEmailAddress","clearErrors","initStripe","link_email_field_id","emailField","email","link","mountCard","bindEvents","getStripeCoupon","coupons","stripeCoupons","currentCoupon","getStripeCouponCode","foundCoupon","coupon","localeCompare","sensitivity","getStripeCouponInput","couponField","couponInput","className","couponCode","bindStripeCoupon","addEventListener","handleCouponChange","setAttribute","classList","contains","toUpperCase","updateStripeCoupon","coupon_code","get_stripe_coupon_nonce","initialPaymentInformation","initial_payment_information","appearance","payment_method_types","values","mountLink","linkDiv","createElement","add","before","String","match","destroyLink","emailAddress","defaultValues","siblings","complete","failWithMessage","payment_incomplete","getFormData","invalid_nonce","failed_to_confirm_intent","invoice_id","redirect_url","location","href","resume_token","tracking_id","is_valid_intent","intent","is_valid_submission","is_valid","is_spam","resetFormValidationErrors","hasTrial","isValidCoupon","coupon_invalid","handleRedirect","getRedirectUrl","confirm","payment_amount","formData","FormData","appendParams","Math","random","validate_form_nonce","newAmount","mode","round","updatedPaymentInformation","update","applyStripeCoupon","percentage_off","amount_off","confirmData","submitError","paymentData","clientSecret","confirmParams","return_url","payment_method_data","redirect","paymentResult","isSetupIntent","confirmSetup","confirmPayment","e","handlePaymentRedirect","handleFailedPayment","setupIntent","intentTypeString","isAjaxEmbed","errorMessage","delete_draft_nonce","rate_limiting_nonce","error_count","linkContainer","el","failed_to_process_payment","_gformPriceFields","setUpFieldId","productTotal","isTrial","recurringAmount","isTextCoupon","gformCalculateProductPrice"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;Q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;;;;;ACD3C;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,qDAAqD;AACrD,OAAO;AACP;AACA,OAAO;AACP,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,qBAAqB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,6BAA6B,0BAA0B,eAAe;AACtE;;AAEO;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"./js/frontend.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * Front-end Script\n */\n\nimport StripePaymentsHandler from \"./payment-element/stripe-payments-handler\";\n\nwindow.GFStripe = null;\n\ngform.extensions = gform.extensions || {};\ngform.extensions.styles = gform.extensions.styles || {};\ngform.extensions.styles.gravityformsstripe = gform.extensions.styles.gravityformsstripe || {};\n\n(function ($) {\n\n\tGFStripe = function (args) {\n\n\t\tfor ( var prop in args ) {\n\t\t\tif ( args.hasOwnProperty( prop ) )\n\t\t\t\tthis[ prop ] = args[ prop ];\n\t\t}\n\n\t\tthis.form = null;\n\n\t\tthis.activeFeed = null;\n\n\t\tthis.GFCCField = null;\n\n\t\tthis.stripeResponse = null;\n\n\t\tthis.hasPaymentIntent = false;\n\n\t\tthis.stripePaymentHandlers = {};\n\n\t\tthis.cardStyle = this.cardStyle || {};\n\n\t\tgform.extensions.styles.gravityformsstripe[ this.formId ] = gform.extensions.styles.gravityformsstripe[ this.formId ] || {};\n\n\t\tconst componentStyles = Object.keys( this.cardStyle ).length > 0 ? JSON.parse( JSON.stringify( this.cardStyle ) ) : gform.extensions.styles.gravityformsstripe[ this.formId ][ this.pageInstance ] || {};\n\n\t\tthis.setComponentStyleValue = function ( key, value, themeFrameworkStyles, manualElement ) {\n\t\t\tlet resolvedValue = '';\n\n\t\t\t// If the value provided is a custom property let's begin\n\t\t\tif ( value.indexOf( '--' ) === 0 ) {\n\t\t\t\tconst computedValue = themeFrameworkStyles.getPropertyValue( value );\n\n\t\t\t\t// If we have a computed end value from the custom property, let's use that\n\t\t\t\tif ( computedValue ) {\n\t\t\t\t\tresolvedValue = computedValue;\n\t\t\t\t}\n\t\t\t\t\t// Otherwise, let's use a provided element or the form wrapper\n\t\t\t\t// along with the key to nab the computed end value for the CSS property\n\t\t\t\telse {\n\t\t\t\t\tconst selector = manualElement ? getComputedStyle( manualElement ) : themeFrameworkStyles;\n\t\t\t\t\tconst resolvedKey = key === 'fontSmoothing' ? '-webkit-font-smoothing' : key;\n\t\t\t\t\tresolvedValue = selector.getPropertyValue( resolvedKey.replace( /([a-z])([A-Z])/g, '$1-$2' ).toLowerCase() );\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Otherwise let's treat the provided value as the actual CSS value wanted\n\t\t\telse {\n\t\t\t\tresolvedValue = value;\n\t\t\t}\n\n\t\t\treturn resolvedValue.trim();\n\t\t};\n\n\t\tthis.setComponentStyles = function ( obj, objKey, parentKey ) {\n\t\t\t// If our object doesn't have any styles specified, let's bail here\n\t\t\tif ( Object.keys( obj ).length === 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Grab the computed styles for the form, which the global CSS API and theme framework are scoped to\n\t\t\tconst form = document.getElementById( 'gform_' + this.formId );\n\t\t\tconst themeFrameworkStyles = getComputedStyle( form );\n\n\t\t\t// Grab the first form control in the form for fallback CSS property value computation\n\t\t\tconst firstFormControl = form.querySelector( '.gfield input' )\n\n\t\t\t// Note, this currently only supports three levels deep of object nesting.\n\t\t\tObject.keys( obj ).forEach( ( key ) => {\n\t\t\t\t// Handling of keys that are objects with additional key/value pairs\n\t\t\t\tif ( typeof obj[ key ] === 'object' ) {\n\n\t\t\t\t\t// Create object for top level key\n\t\t\t\t\tif ( !parentKey ) {\n\t\t\t\t\t\tthis.cardStyle[ key ] = {};\n\t\t\t\t\t}\n\n\t\t\t\t\t// Create object for second level key\n\t\t\t\t\tif ( parentKey ) {\n\t\t\t\t\t\tthis.cardStyle[ parentKey ][ key ] = {};\n\t\t\t\t\t}\n\n\t\t\t\t\tconst objPath = parentKey ? parentKey : key;\n\n\t\t\t\t\t// Recursively pass each key's object through our method for continued processing\n\t\t\t\t\tthis.setComponentStyles( obj[ key ], key, objPath );\n\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Handling of keys that are not objects and need their value to be set\n\t\t\t\tif ( typeof obj[ key ] !== 'object' ) {\n\t\t\t\t\tlet value = '';\n\t\t\t\t\t// Handling of nested keys\n\t\t\t\t\tif ( parentKey ) {\n\t\t\t\t\t\tif ( objKey && objKey !== parentKey ) {\n\t\t\t\t\t\t\t// Setting value for a key three levels into the object\n\t\t\t\t\t\t\tvalue = this.setComponentStyleValue( key, componentStyles[ parentKey ][ objKey ][ key ], themeFrameworkStyles, firstFormControl );\n\t\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\t\tthis.cardStyle[ parentKey ][ objKey ][ key ] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Setting value for a key two levels into the object\n\t\t\t\t\t\t\tvalue = this.setComponentStyleValue( key, componentStyles[ parentKey ][ key ], themeFrameworkStyles, firstFormControl );\n\t\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\t\tthis.cardStyle[ parentKey ][ key ] = value;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Setting value for a key one level into the object\n\t\t\t\t\t\tvalue = this.setComponentStyleValue( key, componentStyles[ key ], themeFrameworkStyles, firstFormControl );\n\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\tthis.cardStyle[ key ] = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t};\n\n\t\tthis.init = async function () {\n\n\t\t\tthis.setComponentStyles( componentStyles );\n\n\t\t\tif ( !this.isCreditCardOnPage() ) {\n\t\t\t\tif ( this.stripe_payment === 'stripe.js' || ( this.stripe_payment === 'elements' && !$( '#gf_stripe_response' ).length ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar GFStripeObj = this, activeFeed = null, feedActivated = false,\n\t\t\t\thidePostalCode = false, apiKey = this.apiKey;\n\n\t\t\tthis.form = $( '#gform_' + this.formId );\n\t\t\tthis.GFCCField = $( '#input_' + this.formId + '_' + this.ccFieldId + '_1' );\n\n\t\t\tgform.addAction( 'gform_frontend_feeds_evaluated', async function ( feeds, formId ) {\n\t\t\t\tif ( formId !== GFStripeObj.formId ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tactiveFeed = null;\n\t\t\t\tfeedActivated = false;\n\t\t\t\thidePostalCode = false;\n\n\t\t\t\tfor ( var i = 0; i < Object.keys( feeds ).length; i++ ) {\n\t\t\t\t\tif ( feeds[ i ].addonSlug === 'gravityformsstripe' && feeds[ i ].isActivated ) {\n\t\t\t\t\t\tfeedActivated = true;\n\n\t\t\t\t\t\tfor ( var j = 0; j < Object.keys( GFStripeObj.feeds ).length; j++ ) {\n\t\t\t\t\t\t\tif ( GFStripeObj.feeds[ j ].feedId === feeds[ i ].feedId ) {\n\t\t\t\t\t\t\t\tactiveFeed = GFStripeObj.feeds[ j ];\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tapiKey = activeFeed.hasOwnProperty( 'apiKey' ) ? activeFeed.apiKey : GFStripeObj.apiKey;\n\t\t\t\t\t\tGFStripeObj.activeFeed = activeFeed;\n\n\t\t\t\t\t\tgformCalculateTotalPrice( formId );\n\n\t\t\t\t\t\tif ( GFStripeObj.stripe_payment == 'payment_element' ) {\n\t\t\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ] = new StripePaymentsHandler( apiKey, GFStripeObj );\n\t\t\t\t\t\t} else if ( GFStripeObj.stripe_payment === 'elements' ) {\n\t\t\t\t\t\t\tstripe = Stripe( apiKey );\n\t\t\t\t\t\t\telements = stripe.elements();\n\n\t\t\t\t\t\t\thidePostalCode = activeFeed.address_zip !== '';\n\n\t\t\t\t\t\t\t// If Stripe Card is already on the page (AJAX failed validation, or switch frontend feeds),\n\t\t\t\t\t\t\t// Destroy the card field so we can re-initiate it.\n\t\t\t\t\t\t\tif ( card != null && card.hasOwnProperty( '_destroyed' ) && card._destroyed === false ) {\n\t\t\t\t\t\t\t\tcard.destroy();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Clear card field errors before initiate it.\n\t\t\t\t\t\t\tif ( GFStripeObj.GFCCField.next( '.validation_message' ).length ) {\n\t\t\t\t\t\t\t\tGFStripeObj.GFCCField.next( '.validation_message' ).remove();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcard = elements.create(\n\t\t\t\t\t\t\t\t'card',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tclasses: GFStripeObj.cardClasses,\n\t\t\t\t\t\t\t\t\tstyle: GFStripeObj.cardStyle,\n\t\t\t\t\t\t\t\t\thidePostalCode: hidePostalCode\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tif ( $( '.gform_stripe_requires_action' ).length ) {\n\t\t\t\t\t\t\t\tif ( $( '.ginput_container_creditcard > div' ).length === 2 ) {\n\t\t\t\t\t\t\t\t\t// Cardholder name enabled.\n\t\t\t\t\t\t\t\t\t$( '.ginput_container_creditcard > div:last' ).hide();\n\t\t\t\t\t\t\t\t\t$( '.ginput_container_creditcard > div:first' ).html( '

' + gforms_stripe_frontend_strings.requires_action + '

' );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$( '.ginput_container_creditcard' ).html( '

' + gforms_stripe_frontend_strings.requires_action + '

' );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Add a spinner next to the validation message and disable the submit button until we are over with 3D Secure.\n\t\t\t\t\t\t\t\tif ( jQuery( '#gform_' + formId + '_validation_container h2 .gform_ajax_spinner').length <= 0 ) {\n\t\t\t\t\t\t\t\t\tjQuery( '#gform_' + formId + '_validation_container h2' ).append( '\"\"');\n\t\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , true );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Update legacy close icon to an info icon.\n\t\t\t\t\t\t\t\tconst $iconSpan = jQuery( '#gform_' + formId + '_validation_container h2 .gform-icon.gform-icon--close' );\n\t\t\t\t\t\t\t\tconst isThemeFrameWork = jQuery( '.gform-theme--framework' ).length;\n\t\t\t\t\t\t\t\tconsole.log( isThemeFrameWork );\n\t\t\t\t\t\t\t\tconsole.log( $iconSpan );\n\t\t\t\t\t\t\t\tif ( $iconSpan.length && ! isThemeFrameWork ) {\n\t\t\t\t\t\t\t\t\t$iconSpan.removeClass( 'gform-icon--close' ).addClass( 'gform-icon--info' );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tGFStripeObj.scaActionHandler( stripe, formId );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcard.mount( '#' + GFStripeObj.GFCCField.attr( 'id' ) );\n\n\t\t\t\t\t\t\t\tcard.on( 'change', function ( event ) {\n\t\t\t\t\t\t\t\t\tGFStripeObj.displayStripeCardError( event );\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else if ( GFStripeObj.stripe_payment == 'stripe.js' ) {\n\t\t\t\t\t\t\tStripe.setPublishableKey( apiKey );\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak; // allow only one active feed.\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( !feedActivated ) {\n\t\t\t\t\tif ( GFStripeObj.stripe_payment === 'elements' || GFStripeObj.stripe_payment === 'payment_element' ) {\n\t\t\t\t\t\tif ( elements != null && card === elements.getElement( 'card' ) ) {\n\t\t\t\t\t\t\tcard.destroy();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( GFStripeObj.isStripePaymentHandlerInitiated( formId ) ) {\n\t\t\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].destroy();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( !GFStripeObj.GFCCField.next( '.validation_message' ).length ) {\n\t\t\t\t\t\t\tGFStripeObj.GFCCField.after( '
' + gforms_stripe_frontend_strings.no_active_frontend_feed + '
' );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twp.a11y.speak( gforms_stripe_frontend_strings.no_active_frontend_feed );\n\t\t\t\t\t}\n\n\t\t\t\t\t// remove Stripe fields and form status when Stripe feed deactivated\n\t\t\t\t\tGFStripeObj.resetStripeStatus( GFStripeObj.form, formId, GFStripeObj.isLastPage() );\n\t\t\t\t\tapiKey = GFStripeObj.apiKey;\n\t\t\t\t\tGFStripeObj.activeFeed = null;\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Set priority to 51 so it will be triggered after the coupons add-on\n\t\t\tgform.addFilter( 'gform_product_total', function ( total, formId ) {\n\n\t\t\t\tif (\n\t\t\t\t\tGFStripeObj.stripe_payment == 'payment_element' &&\n\t\t\t\t\tGFStripeObj.isStripePaymentHandlerInitiated( formId )\n\t\t\t\t) {\n\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].getOrderData( total, formId );\n\t\t\t\t}\n\n\t\t\t\tif ( ! GFStripeObj.activeFeed ) {\n\t\t\t\t\twindow['gform_stripe_amount_' + formId] = 0;\n\t\t\t\t\treturn total;\n\t\t\t\t}\n\n\t\t\t\tif ( GFStripeObj.activeFeed.paymentAmount !== 'form_total' ) {\n\n\t\t\t\t\tconst paymentAmountInfo = GFStripeObj.getProductFieldPrice( formId, GFStripeObj.activeFeed.paymentAmount );\n\t\t\t\t\twindow[ 'gform_stripe_amount_' + formId ] = paymentAmountInfo.price * paymentAmountInfo.qty;\n\n\t\t\t\t\tif ( GFStripeObj.activeFeed.hasOwnProperty('setupFee') ) {\n\t\t\t\t\t\tconst setupFeeInfo = GFStripeObj.getProductFieldPrice( formId, GFStripeObj.activeFeed.setupFee );\n\t\t\t\t\t\twindow['gform_stripe_amount_' + formId] += setupFeeInfo.price * setupFeeInfo.qty;\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\twindow[ 'gform_stripe_amount_' + formId ] = total;\n\t\t\t\t}\n\n\t\t\t\t// Update elements payment amount if payment element is enabled.\n\t\t\t\tif (\n\t\t\t\t\tGFStripeObj.stripe_payment == 'payment_element' &&\n\t\t\t\t\tGFStripeObj.isStripePaymentHandlerInitiated( formId ) &&\n\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].elements !== null &&\n\t\t\t\t\tgforms_stripe_frontend_strings.stripe_connect_enabled === \"1\"\n\t\t\t\t) {\n\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ formId ].updatePaymentAmount( GFStripeObj.stripePaymentHandlers[ formId ].order.paymentAmount )\n\t\t\t\t}\n\n\t\t\t\treturn total;\n\n\t\t\t}, 51 );\n\n\t\t\tswitch ( this.stripe_payment ) {\n\t\t\t\tcase 'elements':\n\t\t\t\t\tvar stripe = null,\n\t\t\t\t\t\telements = null,\n\t\t\t\t\t\tcard = null,\n\t\t\t\t\t\tskipElementsHandler = false;\n\n\t\t\t\t\tif ( $( '#gf_stripe_response' ).length ) {\n\t\t\t\t\t\tthis.stripeResponse = JSON.parse( $( '#gf_stripe_response' ).val() );\n\n\t\t\t\t\t\tif ( this.stripeResponse.hasOwnProperty( 'client_secret' ) ) {\n\t\t\t\t\t\t\tthis.hasPaymentIntent = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// bind Stripe functionality to submit event\n\t\t\t$( '#gform_' + this.formId ).on( 'submit', function ( event ) {\n\n\t\t\t\t// Don't proceed with payment logic if clicking on the Previous button.\n\t\t\t\tlet skipElementsHandler = false;\n\t\t\t\tconst sourcePage = parseInt( $( '#gform_source_page_number_' + GFStripeObj.formId ).val(), 10 )\n\t\t\t\tconst targetPage = parseInt( $( '#gform_target_page_number_' + GFStripeObj.formId ).val(), 10 );\n\t\t\t\tif ( ( sourcePage > targetPage && targetPage !== 0 ) ) {\n\t\t\t\t\tskipElementsHandler = true;\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tskipElementsHandler\n\t\t\t\t\t|| !feedActivated\n\t\t\t\t\t|| $( this ).data( 'gfstripesubmitting' )\n\t\t\t\t\t|| $( '#gform_save_' + GFStripeObj.formId ).val() == 1\n\t\t\t\t\t|| ( !GFStripeObj.isLastPage() && 'elements' !== GFStripeObj.stripe_payment )\n\t\t\t\t\t|| gformIsHidden( GFStripeObj.GFCCField )\n\t\t\t\t\t|| GFStripeObj.maybeHitRateLimits()\n\t\t\t\t\t|| GFStripeObj.invisibleCaptchaPending()\n\t\t\t\t\t|| GFStripeObj.recaptchav3Pending()\n\t\t\t\t\t|| 'payment_element' === GFStripeObj.stripe_payment && window[ 'gform_stripe_amount_' + GFStripeObj.formId ] === 0\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t$( this ).data( 'gfstripesubmitting', true );\n\t\t\t\t\tGFStripeObj.maybeAddSpinner();\n\t\t\t\t}\n\n\t\t\t\tswitch ( GFStripeObj.stripe_payment ) {\n\t\t\t\t\tcase 'payment_element':\n\t\t\t\t\t\tGFStripeObj.injectHoneypot( event );\n\t\t\t\t\t\tGFStripeObj.stripePaymentHandlers[ GFStripeObj.formId ].validate( event );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'elements':\n\t\t\t\t\t\tGFStripeObj.form = $( this );\n\n\t\t\t\t\t\tif ( ( GFStripeObj.isLastPage() && !GFStripeObj.isCreditCardOnPage() ) || gformIsHidden( GFStripeObj.GFCCField ) || skipElementsHandler ) {\n\t\t\t\t\t\t\t$( this ).submit();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( activeFeed.type === 'product' ) {\n\t\t\t\t\t\t\t// Create a new payment method when every time the Stripe Elements is resubmitted.\n\t\t\t\t\t\t\tGFStripeObj.createPaymentMethod( stripe, card );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tGFStripeObj.createToken( stripe, card );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'stripe.js':\n\t\t\t\t\t\tvar form = $( this ),\n\t\t\t\t\t\t\tccInputPrefix = 'input_' + GFStripeObj.formId + '_' + GFStripeObj.ccFieldId + '_',\n\t\t\t\t\t\t\tcc = {\n\t\t\t\t\t\t\t\tnumber: form.find( '#' + ccInputPrefix + '1' ).val(),\n\t\t\t\t\t\t\t\texp_month: form.find( '#' + ccInputPrefix + '2_month' ).val(),\n\t\t\t\t\t\t\t\texp_year: form.find( '#' + ccInputPrefix + '2_year' ).val(),\n\t\t\t\t\t\t\t\tcvc: form.find( '#' + ccInputPrefix + '3' ).val(),\n\t\t\t\t\t\t\t\tname: form.find( '#' + ccInputPrefix + '5' ).val()\n\t\t\t\t\t\t\t};\n\n\n\t\t\t\t\t\tGFStripeObj.form = form;\n\n\t\t\t\t\t\tStripe.card.createToken( cc, function ( status, response ) {\n\t\t\t\t\t\t\tGFStripeObj.responseHandler( status, response );\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t// Show validation message if a payment element payment intent failed and we coulnd't tell until the page has been reloaded\n\t\t\tif ( 'payment_element_intent_failure' in GFStripeObj && GFStripeObj.payment_element_intent_failure ) {\n\t\t\t\tconst validationMessage = jQuery( '

' + gforms_stripe_frontend_strings.payment_element_intent_failure + '

' );\n\t\t\t\tjQuery( '#gform_wrapper_' + GFStripeObj.formId ).prepend( validationMessage );\n\t\t\t}\n\t\t};\n\n\t\tthis.getProductFieldPrice = function ( formId, fieldId ) {\n\n\t\t\tvar price = GFMergeTag.getMergeTagValue( formId, fieldId, ':price' ),\n\t\t\t\tqty = GFMergeTag.getMergeTagValue( formId, fieldId, ':qty' );\n\n\t\t\tif ( typeof price === 'string' ) {\n\t\t\t\tprice = GFMergeTag.getMergeTagValue( formId, fieldId + '.2', ':price' );\n\t\t\t\tqty = GFMergeTag.getMergeTagValue( formId, fieldId + '.3', ':qty' );\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tprice: price,\n\t\t\t\tqty: qty\n\t\t\t};\n\t\t}\n\n\t\tthis.getBillingAddressMergeTag = function (field) {\n\t\t\tif (field === '') {\n\t\t\t\treturn '';\n\t\t\t} else {\n\t\t\t\treturn '{:' + field + ':value}';\n\t\t\t}\n\t\t};\n\n\t\tthis.responseHandler = function (status, response) {\n\n\t\t\tvar form = this.form,\n\t\t\t\tccInputPrefix = 'input_' + this.formId + '_' + this.ccFieldId + '_',\n\t\t\t\tccInputSuffixes = ['1', '2_month', '2_year', '3', '5'];\n\n\t\t\t// remove \"name\" attribute from credit card inputs\n\t\t\tfor (var i = 0; i < ccInputSuffixes.length; i++) {\n\n\t\t\t\tvar input = form.find('#' + ccInputPrefix + ccInputSuffixes[i]);\n\n\t\t\t\tif (ccInputSuffixes[i] == '1') {\n\n\t\t\t\t\tvar ccNumber = $.trim(input.val()),\n\t\t\t\t\t\tcardType = gformFindCardType(ccNumber);\n\n\t\t\t\t\tif (typeof this.cardLabels[cardType] != 'undefined')\n\t\t\t\t\t\tcardType = this.cardLabels[cardType];\n\n\t\t\t\t\tform.append($('').val(ccNumber.slice(-4)));\n\t\t\t\t\tform.append($('').val(cardType));\n\n\t\t\t\t}\n\n\t\t\t\t// name attribute is now removed from markup in GFStripe::add_stripe_inputs()\n\t\t\t\t//input.attr( 'name', null );\n\n\t\t\t}\n\n\t\t\t// append stripe.js response\n\t\t\tform.append($('').val($.toJSON(response)));\n\n\t\t\t// submit the form\n\t\t\tform.submit();\n\n\t\t};\n\n\t\tthis.elementsResponseHandler = function (response) {\n\n\t\t\tvar form = this.form,\n\t\t\t\tGFStripeObj = this,\n\t\t\t\tactiveFeed = this.activeFeed,\n\t\t\t currency = gform.applyFilters( 'gform_stripe_currency', this.currency, this.formId ),\n\t\t\t\tamount = (0 === gf_global.gf_currency_config.decimals) ? window['gform_stripe_amount_' + this.formId] : gformRoundPrice( window['gform_stripe_amount_' + this.formId] * 100 );\n\n\t\t\tif (response.error) {\n\t\t\t\t// display error below the card field.\n\t\t\t\tthis.displayStripeCardError(response);\n\t\t\t\t// when Stripe response contains errors, stay on page\n\t\t\t\t// but remove some elements so the form can be submitted again\n\t\t\t\t// also remove last_4 and card type if that already exists (this happens when people navigate back to previous page and submit an empty CC field)\n\t\t\t\tthis.resetStripeStatus(form, this.formId, this.isLastPage());\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!this.hasPaymentIntent) {\n\t\t\t\t// append stripe.js response\n\t\t\t\tif (!$('#gf_stripe_response').length) {\n\t\t\t\t\tform.append($('').val($.toJSON(response)));\n\t\t\t\t} else {\n\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(response));\n\t\t\t\t}\n\n\t\t\t\tif (activeFeed.type === 'product') {\n\t\t\t\t\t//set last 4\n\t\t\t\t\tform.append($('').val(response.paymentMethod.card.last4));\n\n\t\t\t\t\t// set card type\n\t\t\t\t\tform.append($('').val(response.paymentMethod.card.brand));\n\t\t\t\t\t// Create server side payment intent.\n\t\t\t\t\t$.ajax({\n\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\turl: gforms_stripe_frontend_strings.ajaxurl,\n\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\taction: \"gfstripe_create_payment_intent\",\n\t\t\t\t\t\t\tnonce: gforms_stripe_frontend_strings.create_payment_intent_nonce,\n\t\t\t\t\t\t\tpayment_method: response.paymentMethod,\n\t\t\t\t\t\t\tcurrency: currency,\n\t\t\t\t\t\t\tamount: amount,\n\t\t\t\t\t\t\tfeed_id: activeFeed.feedId\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t\t\t// populate the stripe_response field again.\n\t\t\t\t\t\t\t\tif (!$('#gf_stripe_response').length) {\n\t\t\t\t\t\t\t\t\tform.append($('').val($.toJSON(response.data)));\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(response.data));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// submit the form\n\t\t\t\t\t\t\t\tform.submit();\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresponse.error = response.data;\n\t\t\t\t\t\t\t\tdelete response.data;\n\t\t\t\t\t\t\t\tGFStripeObj.displayStripeCardError(response);\n\t\t\t\t\t\t\t\tGFStripeObj.resetStripeStatus(form, GFStripeObj.formId, GFStripeObj.isLastPage());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tform.append($('').val(response.token.card.last4));\n\t\t\t\t\tform.append($('').val(response.token.card.brand));\n\t\t\t\t\tform.submit();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (activeFeed.type === 'product') {\n\t\t\t\t\tif (response.hasOwnProperty('paymentMethod')) {\n\t\t\t\t\t\t$('#gf_stripe_credit_card_last_four').val(response.paymentMethod.card.last4);\n\t\t\t\t\t\t$('#stripe_credit_card_type').val(response.paymentMethod.card.brand);\n\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\tasync: false,\n\t\t\t\t\t\t\turl: gforms_stripe_frontend_strings.ajaxurl,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\taction: \"gfstripe_update_payment_intent\",\n\t\t\t\t\t\t\t\tnonce: gforms_stripe_frontend_strings.create_payment_intent_nonce,\n\t\t\t\t\t\t\t\tpayment_intent: response.id,\n\t\t\t\t\t\t\t\tpayment_method: response.paymentMethod,\n\t\t\t\t\t\t\t\tcurrency: currency,\n\t\t\t\t\t\t\t\tamount: amount,\n\t\t\t\t\t\t\t\tfeed_id: activeFeed.feedId\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsuccess: function (response) {\n\t\t\t\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(response.data));\n\t\t\t\t\t\t\t\t\tform.submit();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tresponse.error = response.data;\n\t\t\t\t\t\t\t\t\tdelete response.data;\n\t\t\t\t\t\t\t\t\tGFStripeObj.displayStripeCardError(response);\n\t\t\t\t\t\t\t\t\tGFStripeObj.resetStripeStatus(form, GFStripeObj.formId, GFStripeObj.isLastPage());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (response.hasOwnProperty('amount')) {\n\t\t\t\t\t\tform.submit();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar currentResponse = JSON.parse($('#gf_stripe_response').val());\n\t\t\t\t\tcurrentResponse.updatedToken = response.token.id;\n\n\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(currentResponse));\n\n\t\t\t\t\tform.append($('').val(response.token.card.last4));\n\t\t\t\t\tform.append($('').val(response.token.card.brand));\n\t\t\t\t\tform.submit();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.scaActionHandler = function (stripe, formId) {\n\t\t\tif ( ! $('#gform_' + formId).data('gfstripescaauth') ) {\n\t\t\t\t$('#gform_' + formId).data('gfstripescaauth', true);\n\n\t\t\t\tvar GFStripeObj = this, response = JSON.parse($('#gf_stripe_response').val());\n\t\t\t\tif (this.activeFeed.type === 'product') {\n\t\t\t\t\t// Prevent the 3D secure auth from appearing twice, so we need to check if the intent status first.\n\t\t\t\t\tstripe.retrievePaymentIntent(\n\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\tif ( result.paymentIntent.status === 'requires_action' ) {\n\t\t\t\t\t\t\tstripe.handleCardAction(\n\t\t\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\t\t\tvar currentResponse = JSON.parse($('#gf_stripe_response').val());\n\t\t\t\t\t\t\t\tcurrentResponse.scaSuccess = true;\n\n\t\t\t\t\t\t\t\t$('#gf_stripe_response').val($.toJSON(currentResponse));\n\n\t\t\t\t\t\t\t\tGFStripeObj.maybeAddSpinner();\n\t\t\t\t\t\t\t\t// Enable the submit button, which was disabled before displaying the SCA warning message, so we can submit the form.\n\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , false );\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripescaauth', false);\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripesubmitting', true).submit();\n\t\t\t\t\t\t\t\t// There are a couple of seconds delay where the button is available for clicking before the thank you page is displayed,\n\t\t\t\t\t\t\t\t// Disable the button so the user will not think it needs to be clicked again.\n\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , true );\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tstripe.retrievePaymentIntent(\n\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\tif ( result.paymentIntent.status === 'requires_action' ) {\n\t\t\t\t\t\t\tstripe.handleCardPayment(\n\t\t\t\t\t\t\t\tresponse.client_secret\n\t\t\t\t\t\t\t).then(function(result) {\n\t\t\t\t\t\t\t\tGFStripeObj.maybeAddSpinner();\n\t\t\t\t\t\t\t\t// Enable the submit button, which was disabled before displaying the SCA warning message, so we can submit the form.\n\t\t\t\t\t\t\t\tjQuery( '#gform_submit_button_' + formId ).prop( 'disabled' , false );\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripescaauth', false);\n\t\t\t\t\t\t\t\t$('#gform_' + formId).data('gfstripesubmitting', true).trigger( 'submit' );\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.isLastPage = function () {\n\n\t\t\tvar targetPageInput = $('#gform_target_page_number_' + this.formId);\n\t\t\tif (targetPageInput.length > 0)\n\t\t\t\treturn targetPageInput.val() == 0;\n\n\t\t\treturn true;\n\t\t};\n\n\t\t/**\n\t\t * @function isConversationalForm\n\t\t * @description Determines if we are on conversational form mode\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @returns {boolean}\n\t\t */\n\t\tthis.isConversationalForm = function () {\n\t\t\tconst convoForm = $('[data-js=\"gform-conversational-form\"]');\n\n\t\t\treturn convoForm.length > 0;\n\t\t}\n\n\t\t/**\n\t\t * @function isCreditCardOnPage\n\t\t * @description Determines if the credit card field is on the current page\n\t\t *\n\t\t * @since 5.1.0\n\t\t *\n\t\t * @returns {boolean}\n\t\t */\n\t\tthis.isCreditCardOnPage = function () {\n\n\t\t\tvar currentPage = this.getCurrentPageNumber();\n\n\t\t\t// if current page is false or no credit card page number or this is a convo form, assume this is not a multi-page form\n\t\t\tif ( ! this.ccPage || ! currentPage || this.isConversationalForm() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn this.ccPage == currentPage;\n\t\t};\n\n\t\tthis.getCurrentPageNumber = function () {\n\t\t\tvar currentPageInput = $('#gform_source_page_number_' + this.formId);\n\t\t\treturn currentPageInput.length > 0 ? currentPageInput.val() : false;\n\t\t};\n\n\t\tthis.maybeAddSpinner = function () {\n\t\t\tif (this.isAjax)\n\t\t\t\treturn;\n\n\t\t\tif (typeof gformAddSpinner === 'function') {\n\t\t\t\tgformAddSpinner(this.formId);\n\t\t\t} else {\n\t\t\t\t// Can be removed after min Gravity Forms version passes 2.1.3.2.\n\t\t\t\tvar formId = this.formId;\n\n\t\t\t\tif (jQuery('#gform_ajax_spinner_' + formId).length == 0) {\n\t\t\t\t\tvar spinnerUrl = gform.applyFilters('gform_spinner_url', gf_global.spinnerUrl, formId),\n\t\t\t\t\t\t$spinnerTarget = gform.applyFilters('gform_spinner_target_elem', jQuery('#gform_submit_button_' + formId + ', #gform_wrapper_' + formId + ' .gform_next_button, #gform_send_resume_link_button_' + formId), formId);\n\t\t\t\t\t$spinnerTarget.after('\"\"');\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tthis.resetStripeStatus = function(form, formId, isLastPage) {\n\t\t\t$('#gf_stripe_response, #gf_stripe_credit_card_last_four, #stripe_credit_card_type').remove();\n\t\t\tform.data('gfstripesubmitting', false);\n\t\t\tconst spinnerNodes = document.querySelectorAll( '#gform_ajax_spinner_' + formId );\n\t\t\tspinnerNodes.forEach( function( node ) {\n\t\t\t\tnode.remove();\n\t\t\t} );\n\t\t\t// must do this or the form cannot be submitted again\n\t\t\tif (isLastPage) {\n\t\t\t\twindow[\"gf_submitting_\" + formId] = false;\n\t\t\t}\n\t\t};\n\n\t\tthis.displayStripeCardError = function (event) {\n\t\t\tif (event.error && !this.GFCCField.next('.validation_message').length) {\n\t\t\t\tthis.GFCCField.after('
');\n\t\t\t}\n\n\t\t\tvar cardErrors = this.GFCCField.next('.validation_message');\n\n\t\t\tif (event.error) {\n\t\t\t\tcardErrors.html(event.error.message);\n\n\t\t\t\twp.a11y.speak( event.error.message, 'assertive' );\n\t\t\t\t// Hide spinner.\n\t\t\t\tif ( $('#gform_ajax_spinner_' + this.formId).length > 0 ) {\n\t\t\t\t\t$('#gform_ajax_spinner_' + this.formId).remove();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcardErrors.remove();\n\t\t\t}\n\t\t};\n\n\t\tthis.createToken = function (stripe, card) {\n\n\t\t\tconst GFStripeObj = this;\n\t\t\tconst activeFeed = this.activeFeed;\n\t\t\tconst cardholderName = $( '#input_' + GFStripeObj.formId + '_' + GFStripeObj.ccFieldId + '_5' ).val();\n\t\t\tconst tokenData = {\n\t\t\t\t\tname: cardholderName,\n\t\t\t\t\taddress_line1: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line1)),\n\t\t\t\t\taddress_line2: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line2)),\n\t\t\t\t\taddress_city: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_city)),\n\t\t\t\t\taddress_state: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_state)),\n\t\t\t\t\taddress_zip: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_zip)),\n\t\t\t\t\taddress_country: GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_country)),\n\t\t\t\t\tcurrency: gform.applyFilters( 'gform_stripe_currency', this.currency, this.formId )\n\t\t\t\t};\n\t\t\tstripe.createToken(card, tokenData).then(function (response) {\n\t\t\t\tGFStripeObj.elementsResponseHandler(response);\n\t\t\t});\n\t\t}\n\n\t\tthis.createPaymentMethod = function (stripe, card, country) {\n\t\t\tvar GFStripeObj = this, activeFeed = this.activeFeed, countryFieldValue = '';\n\n\t\t\tif ( activeFeed.address_country !== '' ) {\n\t\t\t\tcountryFieldValue = GFMergeTag.replaceMergeTags(GFStripeObj.formId, GFStripeObj.getBillingAddressMergeTag(activeFeed.address_country));\n\t\t\t}\n\n\t\t\tif (countryFieldValue !== '' && ( typeof country === 'undefined' || country === '' )) {\n $.ajax({\n async: false,\n url: gforms_stripe_frontend_strings.ajaxurl,\n dataType: 'json',\n method: 'POST',\n data: {\n action: \"gfstripe_get_country_code\",\n nonce: gforms_stripe_frontend_strings.create_payment_intent_nonce,\n country: countryFieldValue,\n feed_id: activeFeed.feedId\n },\n success: function (response) {\n if (response.success) {\n GFStripeObj.createPaymentMethod(stripe, card, response.data.code);\n }\n }\n });\n } else {\n var cardholderName = $('#input_' + this.formId + '_' + this.ccFieldId + '_5').val(),\n\t\t\t\t\tline1 = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line1)),\n\t\t\t\t\tline2 = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_line2)),\n\t\t\t\t\tcity = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_city)),\n\t\t\t\t\tstate = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_state)),\n\t\t\t\t\tpostal_code = GFMergeTag.replaceMergeTags(this.formId, this.getBillingAddressMergeTag(activeFeed.address_zip)),\n data = { billing_details: { name: null, address: {} } };\n\n if (cardholderName !== '') {\n \tdata.billing_details.name = cardholderName;\n\t\t\t\t}\n\t\t\t\tif (line1 !== '') {\n\t\t\t\t\tdata.billing_details.address.line1 = line1;\n\t\t\t\t}\n\t\t\t\tif (line2 !== '') {\n\t\t\t\t\tdata.billing_details.address.line2 = line2;\n\t\t\t\t}\n\t\t\t\tif (city !== '') {\n\t\t\t\t\tdata.billing_details.address.city = city;\n\t\t\t\t}\n\t\t\t\tif (state !== '') {\n\t\t\t\t\tdata.billing_details.address.state = state;\n\t\t\t\t}\n\t\t\t\tif (postal_code !== '') {\n\t\t\t\t\tdata.billing_details.address.postal_code = postal_code;\n\t\t\t\t}\n\t\t\t\tif (country !== '') {\n\t\t\t\t\tdata.billing_details.address.country = country;\n\t\t\t\t}\n\n\t\t\t\tif (data.billing_details.name === null) {\n\t\t\t\t\tdelete data.billing_details.name;\n\t\t\t\t}\n\t\t\t\tif (data.billing_details.address === {}) {\n\t\t\t\t\tdelete data.billing_details.address;\n\t\t\t\t}\n\n\t\t\t\tstripe.createPaymentMethod('card', card, data).then(function (response) {\n\t\t\t\t\tif (GFStripeObj.stripeResponse !== null) {\n\t\t\t\t\t\tresponse.id = GFStripeObj.stripeResponse.id;\n\t\t\t\t\t\tresponse.client_secret = GFStripeObj.stripeResponse.client_secret;\n\t\t\t\t\t}\n\n\t\t\t\t\tGFStripeObj.elementsResponseHandler(response);\n\t\t\t\t});\n }\n\t\t};\n\n\t\tthis.maybeHitRateLimits = function() {\n\t\t\tif (this.hasOwnProperty('cardErrorCount')) {\n\t\t\t\tif (this.cardErrorCount >= 5) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tthis.invisibleCaptchaPending = function () {\n\t\t\tvar form = this.form,\n\t\t\t\treCaptcha = form.find('.ginput_recaptcha');\n\n\t\t\tif (!reCaptcha.length || reCaptcha.data('size') !== 'invisible') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tvar reCaptchaResponse = reCaptcha.find('.g-recaptcha-response');\n\n\t\t\treturn !(reCaptchaResponse.length && reCaptchaResponse.val());\n\t\t}\n\n\t\t/**\n\t\t * @function recaptchav3Pending\n\t\t * @description Check if recaptcha v3 is enabled and pending a response.\n\t\t *\n\t\t * @since 5.5.0\n\t\t */\n\t\tthis.recaptchav3Pending = function () {\n\t\t\tconst form = this.form;\n\t\t\tconst recaptchaField = form.find( '.ginput_recaptchav3' );\n\t\t\tif ( ! recaptchaField.length ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst recaptchaResponse = recaptchaField.find( '.gfield_recaptcha_response' );\n\n\t\t\treturn ! ( recaptchaResponse && recaptchaResponse.val() );\n\t\t};\n\n\t\t/**\n\t\t * This is duplicated honeypot logic from core that can be removed once Stripe can consume the core honeypot js.\n\t\t */\n\n\n\t\t/**\n\t\t * @function injectHoneypot\n\t\t * @description Duplicated from core. Injects the honeypot field when appropriate.\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @param {jQuery.Event} event Form submission event.\n\t\t */\n\t\tthis.injectHoneypot = ( event ) => {\n\t\t\tconst form = event.target;\n\t\t\tconst shouldInjectHoneypot = ( this.isFormSubmission( form ) || this.isSaveContinue( form ) ) && ! this.isHeadlessBrowser();\n\n\t\t\tif ( shouldInjectHoneypot ) {\n\t\t\t\tconst hashInput = ``;\n\t\t\t\tform.insertAdjacentHTML( 'beforeend', hashInput );\n\t\t\t}\n\t\t};\n\n\t\t/**\n\t\t * @function isSaveContinue\n\t\t * @description Duplicated from core. Determines if this submission is from a Save and Continue click.\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @param {HTMLFormElement} form The form that was submitted.\n\t\t *\n\t\t * @return {boolean} Returns true if this submission was initiated via a Save a Continue button click. Returns false otherwise.\n\t\t */\n\t\tthis.isSaveContinue = ( form ) => {\n\t\t\tconst formId = form.dataset.formid;\n\t\t\tconst nodes = this.getNodes( `#gform_save_${ formId }`, true, form, true );\n\t\t\treturn nodes.length > 0 && nodes[ 0 ].value === '1';\n\t\t};\n\n\t\t/**\n\t\t * @function isFormSubmission\n\t\t * @description Duplicated from core. Determines if this is a standard form submission (ie. not a next or previous page submission, and not a save and continue submission).\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @param {HTMLFormElement} form The form that was submitted.\n\t\t *\n\t\t * @return {boolean} Returns true if this is a standard form submission. Returns false otherwise.\n\t\t */\n\t\tthis.isFormSubmission = ( form ) => {\n\t\t\tconst formId = form.dataset.formid;\n\t\t\tconst targetEl = this.getNodes( `input[name = \"gform_target_page_number_${ formId }\"]`, true, form, true )[ 0 ];\n\t\t\tif ( 'undefined' === typeof targetEl ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst targetPage = parseInt( targetEl.value );\n\t\t\treturn targetPage === 0;\n\t\t};\n\n\t\t/**\n\t\t * @function isHeadlessBrowser.\n\t\t * @description Determines if the currently browser is headless.\n\t\t *\n\t\t * @since 5.0\n\t\t *\n\t\t * @return {boolean} Returns true for headless browsers. Returns false otherwise.\n\t\t */\n\t\tthis.isHeadlessBrowser = () => {\n\t\t\treturn window._phantom || window.callPhantom || // phantomjs.\n\t\t\t\twindow.__phantomas || // PhantomJS-based web perf metrics + monitoring tool.\n\t\t\t\twindow.Buffer || // nodejs.\n\t\t\t\twindow.emit || // couchjs.\n\t\t\t\twindow.spawn || // rhino.\n\t\t\t\twindow.webdriver || window._selenium || window._Selenium_IDE_Recorder || window.callSelenium || // selenium.\n\t\t\t\twindow.__nightmare ||\n\t\t\t\twindow.domAutomation ||\n\t\t\t\twindow.domAutomationController || // chromium based automation driver.\n\t\t\t\twindow.document.__webdriver_evaluate || window.document.__selenium_evaluate ||\n\t\t\t\twindow.document.__webdriver_script_function || window.document.__webdriver_script_func || window.document.__webdriver_script_fn ||\n\t\t\t\twindow.document.__fxdriver_evaluate ||\n\t\t\t\twindow.document.__driver_unwrapped ||\n\t\t\t\twindow.document.__webdriver_unwrapped ||\n\t\t\t\twindow.document.__driver_evaluate ||\n\t\t\t\twindow.document.__selenium_unwrapped ||\n\t\t\t\twindow.document.__fxdriver_unwrapped ||\n\t\t\t\twindow.document.documentElement.getAttribute( 'selenium' ) ||\n\t\t\t\twindow.document.documentElement.getAttribute( 'webdriver' ) ||\n\t\t\t\twindow.document.documentElement.getAttribute( 'driver' );\n\t\t};\n\n\t\t/**\n\t\t * @function getNodes.\n\t\t * @description Duplicated from core until the build system can use Gravity Forms utilities.\n\t\t *\n\t\t * @since 5.\n\t\t */\n\t\tthis.getNodes = (\n\t\tselector = '',\n\t\tconvert = false,\n\t\tnode = document,\n\t\tcustom = false\n\t\t) => {\n\t\t\tconst selectorString = custom ? selector : `[data-js=\"${ selector }\"]`;\n\t\t\tlet nodes = node.querySelectorAll( selectorString );\n\t\t\tif ( convert ) {\n\t\t\t\tnodes = this.convertElements( nodes );\n\t\t\t}\n\t\t\treturn nodes;\n\t\t}\n\n\t\t/**\n\t\t * @function convertElements.\n\t\t * @description Duplicated from core until the build system can use Gravity Forms utilities.\n\t\t *\n\t\t * @since 5.0\n\t\t */\n\t\tthis.convertElements = ( elements = [] ) => {\n\t\t\tconst converted = [];\n\t\t\tlet i = elements.length;\n\t\t\tfor ( i; i--; converted.unshift( elements[ i ] ) ); // eslint-disable-line\n\n\t\t\treturn converted;\n\t\t}\n\n\t\t/**\n\t\t * @function isStripePaymentHandlerInitiated.\n\t\t * @description Checks if a Stripe payment handler has been initiated for a form.\n\t\t *\n\t\t * @since 5.4\n\t\t */\n\t\tthis.isStripePaymentHandlerInitiated = function ( formId ) {\n\t\t\treturn (\n\t\t\t\tformId in this.stripePaymentHandlers &&\n\t\t\t\tthis.stripePaymentHandlers[ formId ] !== null &&\n\t\t\t\tthis.stripePaymentHandlers[ formId ] !== undefined\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * End duplicated honeypot logic.\n\t\t */\n\n\t\tthis.init();\n\n\t}\n\n})(jQuery);\n","const request = async( data, isJson = false, action = false, nonce = false ) => {\n\n\t// Delete gform_ajax if it exists in the FormData object\n\tif ( typeof data.has === 'function' && data.has( 'gform_ajax' ) ) {\n\n\t\t// Saves a temp gform_ajax so that it can be reset later during form processing.\n\t\tdata.set( 'gform_ajax--stripe-temp', data.get( 'gform_ajax' ) );\n\n\t\t// Remove the ajax input to prevent Gravity Forms ajax submission handler from handling the submission in the backend during Stripe's validation.\n\t\tdata.delete( 'gform_ajax' );\n\t}\n\n\tconst options = {\n\t\tmethod: 'POST',\n\t\tcredentials: 'same-origin',\n\t\tbody: data,\n\t};\n\n\tif ( isJson ) {\n\t\toptions.headers = { 'Accept': 'application/json', 'content-type': 'application/json' }\n\t}\n\n\tconst url = new URL( gforms_stripe_frontend_strings.ajaxurl )\n\n\tif ( action ) {\n\t\turl.searchParams.set( 'action', action )\n\t}\n\n\tif ( nonce ) {\n\t\turl.searchParams.set( 'nonce', nonce )\n\t}\n\n\tif ( gforms_stripe_frontend_strings.is_preview ) {\n\t\turl.searchParams.set( 'preview', '1' )\n\t}\n\n\treturn await fetch(\n\t\turl.toString(),\n\t\toptions\n\t).then(\n\t\tresponse => response.json()\n\t);\n}\n\nexport default request;\n","import request from './request';\nexport default class StripePaymentsHandler {\n\n\t/**\n\t * StripePaymentsHandler constructor\n\t *\n\t * @since 5.0\n\t *\n\t * @param {String} apiKey The stripe API key.\n\t * @param {Object} GFStripeObj The stripe addon JS object.\n\t */\n\tconstructor( apiKey, GFStripeObj ) {\n\t\tthis.GFStripeObj = GFStripeObj;\n\t\tthis.apiKey = apiKey;\n\t\tthis.stripe = null;\n\t\tthis.elements = null;\n\t\tthis.card = null;\n\t\tthis.paymentMethod = null;\n\t\tthis.draftId = null;\n\t\t// A workaround so we can call validate method from outside this class while still accessing the correct scope.\n\t\tthis.validateForm = this.validate.bind( this );\n\t\tthis.handlelinkEmailFieldChange = this.reInitiateLinkWithEmailAddress.bind( this );\n\t\tthis.order = {\n\t\t\t'recurringAmount': 0,\n\t\t\t'paymentAmount': 0,\n\t\t};\n\t\t// The object gets initialized everytime frontend feeds are evaluated so we need to clear any previous errors.\n\t\tthis.clearErrors();\n\n\t\tif ( ! this.initStripe() || gforms_stripe_frontend_strings.stripe_connect_enabled !== \"1\" ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Create the payment element and mount it.\n\t\tthis.card = this.elements.create( 'payment' );\n\n\t\t// If an email field is mapped to link, bind it to initiate link on change.\n\t\tif ( GFStripeObj.activeFeed.link_email_field_id ) {\n\t\t\tconst emailField = document.querySelector( '#input_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.link_email_field_id );\n\t\t\tconst email = emailField ? emailField.value : '';\n\t\t\tthis.handlelinkEmailFieldChange( { target: { value: email } } );\n\t\t} else {\n\t\t\tthis.link = null;\n\t\t}\n\n\t\tthis.mountCard();\n\t\tthis.bindEvents();\n\t}\n\n\t/**\n\t * @function getStripeCoupon\n\t * @description Retrieves the cached coupon associated with the entered coupon code.\n\t *\n\t * @since 5.1\n\t * @returns {object} Returns the cached coupon object or undefined if the coupon is not found.\n\t */\n\tgetStripeCoupon\t() {\n\t\tconst coupons = window.stripeCoupons || {};\n\t\tconst currentCoupon = this.getStripeCouponCode();\n\t\tconst foundCoupon = Object.keys(coupons).find(coupon => {\n\t\t\treturn coupon.localeCompare(currentCoupon, undefined, { sensitivity: 'accent' }) === 0;\n\t\t});\n\n\t\treturn foundCoupon ? coupons[foundCoupon] : undefined;\n\t}\n\n\t/**\n\t * @function getStripeCouponInput\n\t * @description Retrieves the coupon input associated with the active feed.\n\t *\n\t * @since 5.1\n\t *\n\t * @returns {HTMLInputElement} Returns the coupon input or null if the coupon input is not found.\n\t */\n\tgetStripeCouponInput() {\n\t\tconst couponField = document.querySelector( '#field_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.coupon );\n\t\treturn couponField ? couponField.querySelector( 'input' ) : null;\n\t}\n\n\t/**\n\t * @function getStripeCouponCode\n\t * @description Retrieves the coupon code from the coupon input associated with the active feed.\n\t *\n\t * @since 5.1\n\t *\n\t * @returns {string} Returns the coupon code or an empty string if the coupon input is not found.\n\t */\n\tgetStripeCouponCode() {\n\t\tconst couponInput = this.getStripeCouponInput();\n\t\tif ( ! couponInput ) {\n\t\t\treturn '';\n\t\t}\n\t\tif ( couponInput.className === 'gf_coupon_code' ) {\n\t\t\tconst couponCode = couponInput ? document.querySelector( '#gf_coupon_codes_' + this.GFStripeObj.formId ).value : null;\n\t\t\treturn couponCode;\n\t\t}\n\n\t\treturn couponInput ? couponInput.value : '';\n\t}\n\n\t/**\n\t * @function bindStripeCoupon\n\t * @description Binds the coupon input change event.\n\t *\n\t * @since 5.1\n\t *\n\t * @returns {void}\n\t */\n\tbindStripeCoupon() {\n\n\t\t// Binding coupon input event if it has not been bound before.\n\t\tconst couponInput = this.getStripeCouponInput();\n\t\tif ( couponInput && ! couponInput.getAttribute( 'data-listener-added' ) ) {\n\t\t\tcouponInput.addEventListener( 'blur', this.handleCouponChange.bind( this ) );\n\t\t\tcouponInput.setAttribute( 'data-listener-added', true );\n\t\t}\n\t}\n\n\t/**\n\t * @function handleCouponChange\n\t * @description Handles the coupon input change event.\n\t *\n\t * @since 5.1\n\t *\n\t * @param event The event object.\n\t * @returns {Promise}\n\t */\n\tasync handleCouponChange( event ) {\n\n\t\tif( this.getStripeCouponInput() !== event.target ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.target.classList.contains( 'gf_coupon_code' ) ) {\n\t\t\tevent.target.value = event.target.value.toUpperCase();\n\t\t}\n\n\t\tawait this.updateStripeCoupon( event.target.value );\n\n\t\tgformCalculateTotalPrice( this.GFStripeObj.formId );\n\t}\n\n\t/**\n\t * @function updateStripeCoupon\n\t * @description Retrieves a coupon from Stripe based on the coupon_code specified and caches it in the window object.\n\t *\n\t * @since 5.1\n\t *\n\t * @param {string} coupon_code The coupon code\n\t * @returns {Promise}\n\t */\n\tasync updateStripeCoupon( coupon_code ) {\n\n\t\t// If the coupon code is empty, we don't need to do anything.\n\t\tif ( ! coupon_code ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Initializing stripeCoupons object if it doesn't exist.\n\t\tif( ! window.stripeCoupons ){\n\t\t\twindow.stripeCoupons = {};\n\t\t}\n\n\t\t// If coupon has already been retrieved from Stripe, abort.\n\t\tif ( window.stripeCoupons[ coupon_code ] ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Retreive coupon from Stripe and store it in the window object.\n\t\tconst response = await request(\n\t\t\tJSON.stringify( {\n\t\t\t\t'coupon' : coupon_code,\n\t\t\t\t'feed_id' : this.GFStripeObj.activeFeed.feedId,\n\t\t\t} ),\n\t\t\ttrue,\n\t\t\t'gfstripe_get_stripe_coupon',\n\t\t\tgforms_stripe_frontend_strings.get_stripe_coupon_nonce,\n\t\t);\n\n\t\twindow.stripeCoupons[ coupon_code ] = response.data;\n\t}\n\n\t/**\n\t * Creates the Stripe object with the given API key.\n\t *\n\t * @since 5.0\n\t *\n\t * @return {boolean}\n\t */\n\tasync initStripe() {\n\t\tthis.stripe = Stripe( this.apiKey );\n\n\t\tconst initialPaymentInformation = this.GFStripeObj.activeFeed.initial_payment_information;\n\t\tconst appearance = this.GFStripeObj.cardStyle;\n\n\t\tif ( 'payment_method_types' in initialPaymentInformation ) {\n\t\t\tinitialPaymentInformation.payment_method_types = Object.values( initialPaymentInformation.payment_method_types );\n\t\t}\n\n\t\tthis.elements = this.stripe.elements( { ...initialPaymentInformation, appearance } );\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * Mounts the card element to the field node.\n\t *\n\t * @since 5.0\n\t */\n\tmountCard() {\n\t\tthis.card.mount( '#' + this.GFStripeObj.GFCCField.attr('id') );\n\t}\n\n\t/**\n\t * Creates a container node for the link element and mounts it.\n\t *\n\t * @since 5.0\n\t */\n\tmountLink() {\n\t\tif ( this.link === null ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( document.querySelectorAll( '.stripe-payment-link' ).length <= 0 ) {\n\t\t\tconst linkDiv = document.createElement( 'div' );\n\t\t\tlinkDiv.setAttribute( 'id', 'stripe-payment-link' );\n\t\t\tlinkDiv.classList.add( 'StripeElement--link' );\n\t\t\tthis.GFStripeObj.GFCCField.before( jQuery( linkDiv ) );\n\t\t}\n\n\t\tthis.link.mount( '#stripe-payment-link' );\n\t}\n\n\t/**\n\t * Binds event listeners.\n\t *\n\t * @since 5.0\n\t */\n\tasync bindEvents() {\n\t\tif ( this.card ) {\n\t\t\tthis.card.on( 'change', ( event ) => {\n\t\t\t\t\tif ( this.paymentMethod !== null ) {\n\t\t\t\t\t\tthis.clearErrors();\n\t\t\t\t\t}\n\t\t\t\t\tthis.paymentMethod = event;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\t// Binding events for Stripe Coupon.\n\t\tthis.bindStripeCoupon();\n\n\t\tconst emailField = document.querySelector( '#input_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.link_email_field_id );\n\n\t\tif ( emailField === null ) {\n\t\t\treturn;\n\t\t}\n\n\t\temailField.addEventListener( 'blur', this.handlelinkEmailFieldChange );\n\n\t\twindow.addEventListener( 'load', async function () {\n\t\tconst emailField = document.querySelector( '#input_' + this.GFStripeObj.formId + '_' + this.GFStripeObj.activeFeed.link_email_field_id );\n\t\t\tif (\n\t\t\t\t(\n\t\t\t\t\tString( emailField.value )\n\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t.match(\n\t\t\t\t\t\t\t/^(([^<>()[\\]\\\\.,;:\\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,}))$/\n\t\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t\t&& this.GFStripeObj.isLastPage()\n\t\t\t) {\n\t\t\t\tthis.handlelinkEmailFieldChange( { target: { value: emailField.value } } );\n\t\t\t}\n\n\t\t}.bind( this ) );\n\n\t}\n\n\t/**\n\t * Destroys the current instance of link and creates a new one with value extracted from the passed event.\n\t *\n\t * @since 5\n\t *\n\t * @param {Object} event an object that contains information about the email input.\n\t * @return {Promise}\n\t */\n\tasync reInitiateLinkWithEmailAddress( event ) {\n\n\t\tif ( this.GFStripeObj.isCreditCardOnPage() === false ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If there is a Link instance, destroy it.\n\t\tthis.destroyLink();\n\n\t\tconst emailAddress = event.target.value;\n\t\tif ( emailAddress ) {\n\t\t\tthis.link = await this.elements.create( \"linkAuthentication\", { defaultValues: { email: emailAddress } } );\n\t\t\tthis.mountLink();\n\t\t\tthis.GFStripeObj.GFCCField.siblings( '.gfield #stripe-payment-link' ).addClass( 'visible' );\n\t\t}\n\t}\n\t/**\n\t * Validates the form.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {Object} event The form event object.\n\t *\n\t * @return {Promise}\n\t */\n\tasync validate( event ) {\n\t\t// If this is an ajax form submission, we just need to submit the form as everything has already been handled.\n\t\tconst form = jQuery( '#gform_' + this.GFStripeObj.formId );\n\t\tif ( form.data( 'isAjaxSubmitting' ) ) {\n\t\t\tform.submit();\n\t\t\treturn;\n\t\t}\n\n\t\t// Make sure the required information are entered.\n\t\t// Link stays incomplete even when email is entered, and it will fail with a friendly message when the confirmation request fails, so skip its frontend validation.\n\t\tif ( ! this.paymentMethod.complete && this.paymentMethod.value.type !== 'link' ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.payment_incomplete, this.GFStripeObj.formId )\n\t\t\treturn false;\n\t\t}\n\n\t\tgformAddSpinner( this.GFStripeObj.formId );\n\t\tconst response = await request( this.getFormData( event.target ) );\n\n\t\tif ( response === -1 ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.invalid_nonce, this.GFStripeObj.formId );\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( 'success' in response && response.success === false ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.failed_to_confirm_intent, this.GFStripeObj.formId )\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Invoice for trials are automatically paid.\n\t\tif ( 'invoice_id' in response.data && response.data.invoice_id !== null && 'resume_token' in response.data ) {\n\t\t\tconst redirect_url = new URL( window.location.href );\n\t\t\tredirect_url.searchParams.append( 'resume_token', response.data.resume_token );\n\t\t\tredirect_url.searchParams.append( 'tracking_id', response.data.tracking_id );\n\t\t\twindow.location.href = redirect_url.href;\n\t\t}\n\n\t\tconst is_valid_intent = 'intent' in response.data\n\t\t\t\t\t\t\t\t\t&& response.data.intent !== false\n\t\t\t\t\t\t\t\t\t&& response.data.intent != null\n\t\t\t\t\t\t\t\t\t&& 'client_secret' in response.data.intent;\n\n\n\t\tconst is_valid_submission = 'data' in response\n\t\t\t\t\t\t\t\t\t&& 'is_valid' in response.data\n\t\t\t\t\t\t\t\t\t&& response.data.is_valid\n\t\t\t\t\t\t\t\t\t&& 'resume_token' in response.data\n\n\t\tconst is_spam = 'is_spam' in response.data && response.data.is_spam;\n\n\t\tif ( ! is_valid_intent && ! is_spam && is_valid_submission ) {\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.failed_to_confirm_intent, this.GFStripeObj.formId )\n\t\t\treturn false;\n\t\t}\n\n\n\t\tif ( is_valid_submission ) {\n\n\t\t\t// Reset any errors.\n\t\t\tthis.resetFormValidationErrors();\n\t\t\tthis.draftId = response.data.resume_token;\n\t\t\t// Validate Stripe coupon, if there is a setup fee or trial, the coupon won't be applied to the current payment, so pass validation as it is all handled in the backend.\n\t\t\tif (\n\t\t\t\tthis.GFStripeObj.activeFeed.hasTrial !== '1' &&\n\t\t\t\t! this.GFStripeObj.activeFeed.setupFee &&\n\t\t\t\t! this.isValidCoupon( response.data.total )\n\t\t\t) {\n\t\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.coupon_invalid, this.GFStripeObj.formId )\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Do not confirm payment if this is a spam submission.\n\t\t\tif ( is_spam ) {\n\t\t\t\t// For spam submissions, redirect to the confirmation page without confirming the payment. This will process the submission as a spam entry without capturing the payment.\n\t\t\t\tthis.handleRedirect( this.getRedirectUrl( response.data.resume_token ) );\n\t\t\t} else {\n\t\t\t\t// For non-spam submissions, confirm the payment and redirect to the confirmation page.\n\t\t\t\tthis.confirm( response.data );\n\t\t\t}\n\n\t\t} else {\n\t\t\t// Form is not valid, do a normal submit to render the validation errors markup in backend.\n\t\t\tevent.target.submit();\n\t\t}\n\t}\n\n\n\t/**\n\t * @function isValidCoupon\n\t * @description Validates the coupon code.\n\t *\n\t * @since 5.1\n\t *\n\t * @param {number} payment_amount Payment amount calculated by Stripe.\n\t *\n\t * @returns {boolean} Returns true if the coupon is valid, returns false otherwise.\n\t */\n\tisValidCoupon( payment_amount ) {\n\t\tconst coupon = this.getStripeCoupon();\n\t\tif ( ! coupon ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn coupon.is_valid && payment_amount == this.order.paymentAmount;\n\t}\n\n\t/**\n\t * Creates a FormData object containing the information required to validate the form and start the checkout process on the backend.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {Object} form The form object.\n\t *\n\t * @return {FormData}\n\t */\n\tgetFormData( form ) {\n\t\tconst formData = new FormData( form );\n\t\t// if gform_submit exist in the request, GFFormDisplay::process_form() will be called even before the AJAX handler.\n\t\tformData.delete( 'gform_submit' );\n\t\t// Append the payment data to the form.\n\t\tconst appendParams = {\n\t\t\t'action': 'gfstripe_validate_form',\n\t\t\t'feed_id': this.GFStripeObj.activeFeed.feedId,\n\t\t\t'form_id': this.GFStripeObj.formId,\n\t\t\t'tracking_id': Math.random().toString( 36 ).slice( 2, 10 ),\n\t\t\t'payment_method': this.paymentMethod.value.type,\n\t\t\t'nonce': gforms_stripe_frontend_strings.validate_form_nonce\n\t\t}\n\n\t\tObject.keys( appendParams ).forEach( ( key ) => {\n\t\t\tformData.append( key, appendParams[ key ] );\n\t\t} );\n\n\t\treturn formData;\n\t}\n\n\t/**\n\t * Updates the payment information amount.\n\t *\n\t * @since 5.1\n\t * @since 5.3 Added the updatedPaymentInformation filter.\n\t *\n\t * @param {Double} newAmount The updated amount.\n\t */\n\tupdatePaymentAmount( newAmount ) {\n\t\tif ( newAmount <= 0 || this.GFStripeObj.activeFeed.initial_payment_information.mode === 'setup' ) {\n\t\t\treturn;\n\t\t}\n\t\t// Get amount in cents (or the equivalent subunit for other currencies)\n\t\tlet total = newAmount * 100;\n\t\t// Round total to two decimal places.\n\t\ttotal = Math.round( total * 100 ) / 100;\n\n\t\tlet updatedPaymentInformation = {\n\t\t\tamount: total,\n\t\t};\n\n\t\t/**\n\t\t * Filters the payment information before updating it.\n\t\t *\n\t\t * @since 5.3\n\t\t *\n\t\t * @param {Object} updatedPaymentInformation The object that contains the updated payment information, for possible values, @see https://docs.stripe.com/js/elements_object/update#elements_update-options\n\t\t * @param {Object} initialPaymentInformation The initial payment information.\n\t\t * @param {int} feedId The feed ID.\n\t\t * @param {int} formId The form ID.\n\t\t *\n\t\t * @return {Object} The updated payment information.\n\t\t */\n\t\tupdatedPaymentInformation = window.gform.applyFilters( 'gform_stripe_payment_element_updated_payment_information', updatedPaymentInformation, this.GFStripeObj.activeFeed.initial_payment_information, this.GFStripeObj.activeFeed.feedId, this.GFStripeObj.formId );\n\n\t\tthis.elements.update( updatedPaymentInformation );\n\t}\n\n\t/**\n\t * @function applyStripeCoupon\n\t * @description Applies the coupon discount to the total.\n\t *\n\t * @since 5.1\n\t *\n\t * @param {number} total The payment amount.\n\t * @returns {number} Returns the updated total.\n\t */\n\tapplyStripeCoupon( total ) {\n\n\t\tconst coupon = this.getStripeCoupon();\n\t\tif ( ! coupon || ! coupon.is_valid ) {\n\t\t\treturn total;\n\t\t}\n\n\t\tif( coupon.percentage_off ) {\n\t\t\ttotal = total - ( total * ( coupon.percentage_off / 100 ) );\n\t\t} else if ( coupon.amount_off ) {\n\t\t\ttotal = total - coupon.amount_off;\n\t\t}\n\n\t\treturn total;\n\t}\n\n\t/**\n\t * Calls stripe confirm payment or confirm setup to attempt capturing the payment after form validation passed.\n\t *\n\t * @since 5.0\n\t * @since 5.4.0 Updated the method parameter, so it received the whole confirmData object instead of just the resume_token and client secret.\n\t *\n\t * @param {Object} confirmData The confirmData object that contains the resume_token, client secret and intent information.\n\t *\n\t * @return {Promise}\n\t */\n\tasync confirm( confirmData ) {\n\n\t\t// Prepare the return URL.\n\t\tconst redirect_url = this.getRedirectUrl( confirmData.resume_token );\n\t\tredirect_url.searchParams.append( 'tracking_id', confirmData.tracking_id );\n\n\t\tconst { error: submitError } = await this.elements.submit();\n\t\tif ( submitError ) {\n\t\t\tthis.failWithMessage( submitError.message , this.GFStripeObj.formId )\n\t\t\treturn;\n\t\t}\n\t\t// Gather the payment data.\n\t\tconst paymentData = {\n\t\t\telements: this.elements,\n\t\t\tclientSecret: confirmData.intent.client_secret,\n\t\t\tconfirmParams: {\n\t\t\t\treturn_url: redirect_url.toString(),\n\t\t\t\tpayment_method_data: {\n\t\t\t\t\tbilling_details: {\n\t\t\t\t\t\taddress: {\n\t\t\t\t\t\t\tline1: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_line1 ) ),\n\t\t\t\t\t\t\tline2: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_line2 ) ),\n\t\t\t\t\t\t\tcity: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_city ) ),\n\t\t\t\t\t\t\tstate: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_state ) ),\n\t\t\t\t\t\t\tpostal_code: GFMergeTag.replaceMergeTags( this.GFStripeObj.formId, this.getBillingAddressMergeTag( this.GFStripeObj.activeFeed.address_zip ) ),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t// let Stripe handle redirection only if the payment method requires redirection to a third party page,\n\t\t\t// Otherwise, the add-on will handle the redirection.\n\t\t\tredirect: 'if_required',\n\t\t};\n\n\n\t\t/**\n\t\t * The promise that returns from calling stripe.confirmPayment or stripe.confirmSetup.\n\t\t *\n\t\t * If the payment method used requires redirecting the user to a third party page,\n\t\t * this promise will never resolve, as confirmPayment or confirmSetup redirect the user to the third party page.\n\t\t *\n\t\t * @since 5.0.0\n\t\t *\n\t\t * @type {Promise}\n\t\t */\n\t\tlet paymentResult = {};\n\t\tlet isSetupIntent = confirmData.intent.id.indexOf( 'seti_' ) === 0;\n\t\ttry {\n\t\t\tpaymentResult = isSetupIntent ? await this.stripe.confirmSetup( paymentData ) : await this.stripe.confirmPayment( paymentData );\n\t\t} catch ( e ) {\n\t\t\tconsole.log( e );\n\t\t\tthis.failWithMessage( gforms_stripe_frontend_strings.failed_to_confirm_intent, this.GFStripeObj.formId )\n\t\t}\n\n\t\t// If we have a paymentIntent or a setupIntent in the result, the process was successful.\n\t\t// Note that confirming could be successful but the intent status is still 'processing' or 'pending'.\n\t\tif ( 'paymentIntent' in paymentResult || 'setupIntent' in paymentResult ) {\n\t\t\tthis.handlePaymentRedirect( paymentResult, redirect_url );\n\t\t} else {\n\t\t\tawait this.handleFailedPayment( paymentResult );\n\t\t}\n\t}\n\n\t/**\n\t * Redirects the user to the confirmation page after the payment intent is confirmed.\n\t *\n\t * This method will never be executed if the payment method used requires redirecting the user to a third party page.\n\t *\n\t * @since 5.0\n\t * @since 5.2 Added the redirect_url parameter.\n\t * @since 5.4 Renamed the function from handlePayment to handlePaymentRedirect.\n\t *\n\t * @param {Object} paymentResult The result of confirming a payment intent or a setup intent.\n\t * @param {URL} redirect_url The redirect URL the user will be taken to after confirmation.\n\t */\n\thandlePaymentRedirect( paymentResult, redirect_url ) {\n\t\tconst intent = paymentResult.paymentIntent ? paymentResult.paymentIntent : paymentResult.setupIntent;\n\t\t// Add parameters required for entry processing in the backend.\n\t\tconst intentTypeString = intent.id.indexOf( 'seti_' ) === 0 ? 'setup' : 'payment'\n\t\tredirect_url.searchParams.append( intentTypeString + '_intent', intent.id );\n\t\tredirect_url.searchParams.append( intentTypeString + '_intent_client_secret', intent.client_secret );\n\t\tredirect_url.searchParams.append( 'redirect_status', intent.status ? 'succeeded' : 'pending' );\n\n\t\tthis.handleRedirect( redirect_url );\n\t}\n\n\t/**\n\t * Redirects the user to the confirmation page.\n\t *\n\t * @since 5.4.1\n\t *\n\t * @param {URL} redirect_url The redirect URL the user will be taken to after confirmation.\n\t */\n\thandleRedirect( redirect_url ) {\n\n\t\t// If this is not an AJAX embedded form, redirect the user to the confirmation page.\n\t\tif ( ! this.isAjaxEmbed( this.GFStripeObj.formId ) ) {\n\t\t\twindow.location.href = redirect_url.toString();\n\t\t} else {\n\t\t\t// AJAX embeds are handled differently, we need to update the form's action with the redirect URL, and submit it inside the AJAX IFrame.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).attr( 'action' , redirect_url.toString() );\n\t\t\t// Prevent running same logic again after submitting the form.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).data( 'isAjaxSubmitting' , true );\n\t\t\t// Keeping this input makes the backend thinks it is not an ajax form, so we need to remove it.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).find( '[name=\"gform_submit\"]' ).remove();\n\t\t\t// Form will be submitted inside the IFrame, once IFrame content is updated, the form element will be replaced with the content of the IFrame.\n\t\t\tjQuery( '#gform_' + this.GFStripeObj.formId ).submit();\n\t\t}\n\t}\n\n\t/**\n\t * Returns the URL with the resume token appended to it.\n\t *\n\t * @since 5.4.1\n\t *\n\t * @param resume_token The resume token to append to the URL.\n\t *\n\t * @returns {URL} The URL with the resume token appended to it.\n\t */\n\tgetRedirectUrl( resume_token ) {\n\t\tconst redirect_url = new URL( window.location.href );\n\t\tredirect_url.searchParams.append( 'resume_token', resume_token );\n\t\tredirect_url.searchParams.append( 'feed_id', this.GFStripeObj.activeFeed.feedId );\n\t\tredirect_url.searchParams.append( 'form_id', this.GFStripeObj.formId );\n\t\treturn redirect_url;\n\t}\n\n\t/**\n\t * Handles a failed payment attempt.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {Object} paymentResult The result of confirming a payment intent or a setup intent.\n\t */\n\tasync handleFailedPayment( paymentResult ) {\n\t\tlet errorMessage = '';\n\t\tif ( 'error' in paymentResult && 'message' in paymentResult.error ) {\n\t\t\terrorMessage = paymentResult.error.message;\n\t\t}\n\t\tthis.failWithMessage( errorMessage, this.GFStripeObj.formId );\n\t\t// Delete the draft entry created.\n\t\tlet response = request(\n\t\t\tJSON.stringify( { 'draft_id': this.draftId } ),\n\t\t\ttrue,\n\t\t\t'gfstripe_delete_draft_entry',\n\t\t\tgforms_stripe_frontend_strings.delete_draft_nonce\n\t\t);\n\t\t// If rate limiting is enabled, increase the errors number at the backend side, and set the new count here.\n\t\tif ( this.GFStripeObj.hasOwnProperty( 'cardErrorCount' ) ) {\n\t\t\tresponse = await request(\n\t\t\t\tJSON.stringify( { 'increase_count': true } ),\n\t\t\t\ttrue ,\n\t\t\t\t'gfstripe_payment_element_check_rate_limiting',\n\t\t\t\tgforms_stripe_frontend_strings.rate_limiting_nonce\n\t\t\t);\n\t\t\tthis.GFStripeObj.cardErrorCount = response.data.error_count;\n\t\t}\n\t}\n\n\t/**\n\t * Destroys the stripe objects and removes any DOM nodes created while initializing them.\n\t *\n\t * @since 5.0\n\t */\n\tdestroy() {\n\t\tif ( this.card ) {\n\t\t\tthis.card.destroy();\n\t\t}\n\n\t\tthis.destroyLink();\n\t}\n\n\t/**\n\t * Destroys the Stripe payment link and removes any DOM nodes created while initializing it.\n\t *\n\t * @since 5.4.0\n\t */\n\tdestroyLink() {\n\t\tif ( this.link ) {\n\t\t\tthis.link.destroy();\n\t\t\tthis.link = null;\n\n\t\t\tconst linkContainer = this.GFStripeObj.GFCCField.siblings( '.gfield #stripe-payment-link' );\n\t\t\tif ( linkContainer ) {\n\t\t\t\tlinkContainer.remove();\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Clears the error messages around the Stripe card field.\n\t *\n\t * @since 5.0\n\t */\n\tclearErrors() {\n\t\t// Clear card field errors before initiate it.\n\t\tif ( this.GFStripeObj.GFCCField.next('.validation_message').length ) {\n\t\t\tthis.GFStripeObj.GFCCField.next('.validation_message').remove();\n\t\t}\n\t}\n\n\t/**\n\t * Removes the validation error messages from the form fields.\n\t *\n\t * @since 5.0\n\t */\n\tresetFormValidationErrors() {\n\t\tdocument.querySelectorAll( '.gform_validation_errors, .validation_message' ).forEach( ( el ) => { el.remove() } );\n\t\tdocument.querySelectorAll( '.gfield_error' ).forEach( ( el ) => { el.classList.remove( 'gfield_error' ) } );\n\t}\n\n\t/**\n\t * Displays an error message if the flow failed at any point, also clears the loading indicator and resets the form data attributes.\n\t *\n\t * @since 5.0\n\t *\n\t * @param {String} message The error message to display.\n\t * @param {int} formId The form ID.\n\t */\n\tfailWithMessage( message, formId ) {\n\t\tmessage = message ? message : gforms_stripe_frontend_strings.failed_to_process_payment;\n\t\tthis.GFStripeObj.displayStripeCardError( { error : { message : message } } );\n\t\tthis.GFStripeObj.resetStripeStatus( jQuery( '#gform_' + formId ), formId, true );\n\t\tjQuery( '#gform_ajax_spinner_' + formId ).remove();\n\t}\n\n\t/**\n\t * Returns the merge tag for the billing address.\n\t *\n\t * @since 5.0\n\t *\n\t * @param field The billing address field.\n\t *\n\t * @return {string} The merge tag for the billing address.\n\t */\n\tgetBillingAddressMergeTag( field ) {\n\n\t\tif ( field === '' ) {\n\t\t\treturn '';\n\t\t}\n\n\t\treturn '{:' + field + ':value}';\n\t}\n\n\t/**\n\t * Gets the order data.\n\t *\n\t * The order contains the following properties\n\t * \tpaymentAmount: The amount of the payment that will be charged after form submission.\n\t * \trecurringAmount: If this is a subscription, this is the recurring amount.\n\t *\n\t * @since 5.1\n\t *\n\t * @param total The form total.\n\t * @param formId The current form id.\n\t *\n\t * @return {Object} The order data.\n\t */\n\tgetOrderData( total, formId ) {\n\n\t\tif ( ! _gformPriceFields[ formId ] || this.GFStripeObj.activeFeed === null ) {\n\t\t\treturn this.order;\n\t\t}\n\n\t\tconst setUpFieldId = this.GFStripeObj.activeFeed.setupFee;\n\t\tlet setupFee = 0;\n\t\tlet productTotal = 0;\n\t\tconst isTrial = this.GFStripeObj.activeFeed.hasTrial;\n\n\n\t\t// If this is the setup fee field, or the shipping field, don't add to total.\n\t\tif ( setUpFieldId ) {\n\t\t\tconst setupFeeInfo = this.GFStripeObj.getProductFieldPrice( formId, this.GFStripeObj.activeFeed.setupFee );\n\t\t\tsetupFee = setupFeeInfo.price * setupFeeInfo.qty;\n\t\t\t// If this field is a setup fee, subtract it from total, so it is not added to the recurring amount.\n\t\t\ttotal -= setupFee;\n\t\t}\n\n\t\tif ( this.GFStripeObj.activeFeed.paymentAmount === 'form_total' ) {\n\t\t\tthis.order.recurringAmount = total;\n\t\t\tif ( this.isTextCoupon() ) {\n\t\t\t\tthis.order.recurringAmount = this.applyStripeCoupon( this.order.recurringAmount );\n\t\t\t}\n\t\t} else {\n\t\t\tthis.order.recurringAmount = gformCalculateProductPrice( formId, this.GFStripeObj.activeFeed.paymentAmount );\n\t\t\tthis.order.recurringAmount = this.applyStripeCoupon( this.order.recurringAmount );\n\t\t}\n\n\t\tif ( isTrial === '1' ) {\n\t\t\tthis.order.paymentAmount = setupFee;\n\t\t} else {\n\t\t\tthis.order.paymentAmount = this.order.recurringAmount + setupFee;\n\t\t}\n\n\t\treturn this.order;\n\t}\n\n\tisTextCoupon() {\n\t\tconst coupon = this.getStripeCouponInput();\n\t\tif ( ! coupon ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn ! coupon.classList.contains( 'gf_coupon_code' )\n\t}\n\n\t/**\n\t * Decides whether the form is embedded with the AJAX option on or not.\n\t *\n\t * Since 5.2\n\t *\n\t * @param {integer} formId The form ID.\n\t * @returns {boolean}\n\t */\n\tisAjaxEmbed( formId ) {\n\t\treturn jQuery( '#gform_ajax_frame_' + formId ).length >= 1;\n\t}\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* eslint-disable no-prototype-builtins */\nvar g =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n // eslint-disable-next-line no-undef\n (typeof global !== 'undefined' && global) ||\n {}\n\nvar support = {\n searchParams: 'URLSearchParams' in g,\n iterable: 'Symbol' in g && 'iterator' in Symbol,\n blob:\n 'FileReader' in g &&\n 'Blob' in g &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in g,\n arrayBuffer: 'ArrayBuffer' in g\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n if (header.length != 2) {\n throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)\n }\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body._noBody) return\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type)\n var encoding = match ? match[1] : 'utf-8'\n reader.readAsText(blob, encoding)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n // eslint-disable-next-line no-self-assign\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._noBody = true;\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else if (support.blob) {\n return this.blob().then(readBlobAsArrayBuffer)\n } else {\n throw new Error('could not read as ArrayBuffer')\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal || (function () {\n if ('AbortController' in g) {\n var ctrl = new AbortController();\n return ctrl.signal;\n }\n }());\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n try {\n headers.append(key, value)\n } catch (error) {\n console.warn('Response ' + error.message)\n }\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n if (this.status < 200 || this.status > 599) {\n throw new RangeError(\"Failed to construct 'Response': The status provided (0) is outside the range [200, 599].\")\n }\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 200, statusText: ''})\n response.ok = false\n response.status = 0\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = g.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n // This check if specifically for when a user fetches a file locally from the file system\n // Only if the status is out of a normal range\n if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {\n options.status = 200;\n } else {\n options.status = xhr.status;\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request timed out'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && g.location.href ? g.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {\n var names = [];\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n names.push(normalizeName(name))\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n request.headers.forEach(function(value, name) {\n if (names.indexOf(name) === -1) {\n xhr.setRequestHeader(name, value)\n }\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!g.fetch) {\n g.fetch = fetch\n g.Headers = Headers\n g.Request = Request\n g.Response = Response\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/frontend.min.js b/js/frontend.min.js index a76d6b6..32556fd 100644 --- a/js/frontend.min.js +++ b/js/frontend.min.js @@ -1 +1 @@ -!function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=2)}([function(e,t,r){"use strict";r.r(t),r.d(t,"Headers",(function(){return m})),r.d(t,"Request",(function(){return S})),r.d(t,"Response",(function(){return w})),r.d(t,"DOMException",(function(){return O})),r.d(t,"fetch",(function(){return I}));var i="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==i&&i,n="URLSearchParams"in i,s="Symbol"in i&&"iterator"in Symbol,a="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in i,d="ArrayBuffer"in i;if(d)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(t[Symbol.iterator]=function(){return t}),t}function m(e){this.map={},e instanceof m?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function _(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function h(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=h(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():d&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):d&&(ArrayBuffer.prototype.isPrototypeOf(e)||p(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=_(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=_(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(g)}),this.text=function(){var e,t,r,i=_(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=h(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function F(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(n))}})),t}function w(e,t){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new m(t.headers),this.url=t.url||"",this._initBody(e)}S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},b.call(S.prototype),b.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new m(this.headers),url:this.url})},w.error=function(){var e=new w(null,{status:0,statusText:""});return e.type="error",e};var j=[301,302,303,307,308];w.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new w(null,{status:t,headers:{location:e}})};var O=i.DOMException;try{new O}catch(e){(O=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),O.prototype.constructor=O}function I(e,t){return new Promise((function(r,n){var s=new S(e,t);if(s.signal&&s.signal.aborted)return n(new O("Aborted","AbortError"));var o=new XMLHttpRequest;function l(){o.abort()}o.onload=function(){var e,t,i={status:o.status,statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new m,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();t.append(i,n)}})),t)};i.url="responseURL"in o?o.responseURL:i.headers.get("X-Request-URL");var n="response"in o?o.response:o.responseText;setTimeout((function(){r(new w(n,i))}),0)},o.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.onabort=function(){setTimeout((function(){n(new O("Aborted","AbortError"))}),0)},o.open(s.method,function(e){try{return""===e&&i.location.href?i.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&(a?o.responseType="blob":d&&s.headers.get("Content-Type")&&-1!==s.headers.get("Content-Type").indexOf("application/octet-stream")&&(o.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof m?s.headers.forEach((function(e,t){o.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){o.setRequestHeader(e,u(t.headers[e]))})),s.signal&&(s.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",l)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}I.polyfill=!0,i.fetch||(i.fetch=I,i.Headers=m,i.Request=S,i.Response=w)},,function(e,t,r){r(0),e.exports=r(5)},,,function(e,t,r){"use strict";r.r(t);var i,n=async(e,t=!1,r=!1,i=!1)=>{"function"==typeof e.has&&e.has("gform_ajax")&&(e.set("gform_ajax--stripe-temp",e.get("gform_ajax")),e.delete("gform_ajax"));const n={method:"POST",credentials:"same-origin",body:e};t&&(n.headers={Accept:"application/json","content-type":"application/json"});const s=new URL(gforms_stripe_frontend_strings.ajaxurl);return r&&s.searchParams.set("action",r),i&&s.searchParams.set("nonce",i),gforms_stripe_frontend_strings.is_preview&&s.searchParams.set("preview","1"),await fetch(s.toString(),n).then(e=>e.json())},s=Object.assign||function(e){for(var t=1;t0===e.localeCompare(t,void 0,{sensitivity:"accent"}));return r?e[r]:void 0}getStripeCouponInput(){const e=document.querySelector("#field_"+this.GFStripeObj.formId+"_"+this.GFStripeObj.activeFeed.coupon);return e?e.querySelector("input"):null}getStripeCouponCode(){const e=this.getStripeCouponInput();if(!e)return"";if("gf_coupon_code"===e.className){return e?document.querySelector("#gf_coupon_codes_"+this.GFStripeObj.formId).value:null}return e?e.value:""}bindStripeCoupon(){const e=this.getStripeCouponInput();e&&!e.getAttribute("data-listener-added")&&(e.addEventListener("blur",this.handleCouponChange.bind(this)),e.setAttribute("data-listener-added",!0))}async handleCouponChange(e){this.getStripeCouponInput()===e.target&&(e.target.classList.contains("gf_coupon_code")&&(e.target.value=e.target.value.toUpperCase()),await this.updateStripeCoupon(e.target.value),gformCalculateTotalPrice(this.GFStripeObj.formId))}async updateStripeCoupon(e){if(!e)return;if(window.stripeCoupons||(window.stripeCoupons={}),window.stripeCoupons[e])return;const t=await n(JSON.stringify({coupon:e,feed_id:this.GFStripeObj.activeFeed.feedId}),!0,"gfstripe_get_stripe_coupon",gforms_stripe_frontend_strings.get_stripe_coupon_nonce);window.stripeCoupons[e]=t.data}async initStripe(){this.stripe=Stripe(this.apiKey);const e=this.GFStripeObj.activeFeed.initial_payment_information,t=this.GFStripeObj.cardStyle;return"payment_method_types"in e&&(e.payment_method_types=Object.values(e.payment_method_types)),this.elements=this.stripe.elements(s({},e,{appearance:t})),!0}mountCard(){this.card.mount("#"+this.GFStripeObj.GFCCField.attr("id"))}mountLink(){if(null!==this.link){if(document.querySelectorAll(".stripe-payment-link").length<=0){const e=document.createElement("div");e.setAttribute("id","stripe-payment-link"),e.classList.add("StripeElement--link"),this.GFStripeObj.GFCCField.before(jQuery(e))}this.link.mount("#stripe-payment-link")}}async bindEvents(){this.card&&this.card.on("change",e=>{null!==this.paymentMethod&&this.clearErrors(),this.paymentMethod=e}),this.bindStripeCoupon();const e=document.querySelector("#input_"+this.GFStripeObj.formId+"_"+this.GFStripeObj.activeFeed.link_email_field_id);null!==e&&(e.addEventListener("blur",this.handlelinkEmailFieldChange),window.addEventListener("load",async function(){const e=document.querySelector("#input_"+this.GFStripeObj.formId+"_"+this.GFStripeObj.activeFeed.link_email_field_id);String(e.value).toLowerCase().match(/^(([^<>()[\]\\.,;:\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,}))$/)&&this.GFStripeObj.isLastPage()&&this.handlelinkEmailFieldChange({target:{value:e.value}})}.bind(this)))}async reInitiateLinkWithEmailAddress(e){if(!1===this.GFStripeObj.isCreditCardOnPage())return;this.destroyLink();const t=e.target.value;t&&(this.link=await this.elements.create("linkAuthentication",{defaultValues:{email:t}}),this.mountLink(),this.GFStripeObj.GFCCField.siblings(".gfield #stripe-payment-link").addClass("visible"))}async validate(e){const t=jQuery("#gform_"+this.GFStripeObj.formId);if(t.data("isAjaxSubmitting"))return void t.submit();if(!this.paymentMethod.complete&&"link"!==this.paymentMethod.value.type)return this.failWithMessage(gforms_stripe_frontend_strings.payment_incomplete,this.GFStripeObj.formId),!1;gformAddSpinner(this.GFStripeObj.formId);const r=await n(this.getFormData(e.target));if(-1===r)return this.failWithMessage(gforms_stripe_frontend_strings.invalid_nonce,this.GFStripeObj.formId),!1;if("success"in r&&!1===r.success)return this.failWithMessage(gforms_stripe_frontend_strings.failed_to_confirm_intent,this.GFStripeObj.formId),!1;if("invoice_id"in r.data&&null!==r.data.invoice_id&&"resume_token"in r.data){const e=new URL(window.location.href);e.searchParams.append("resume_token",r.data.resume_token),e.searchParams.append("tracking_id",r.data.tracking_id),window.location.href=e.href}const i="intent"in r.data&&!1!==r.data.intent&&null!=r.data.intent&&"client_secret"in r.data.intent,s="data"in r&&"is_valid"in r.data&&r.data.is_valid&&"resume_token"in r.data,a="is_spam"in r.data&&r.data.is_spam;if(!i&&!a&&s)return this.failWithMessage(gforms_stripe_frontend_strings.failed_to_confirm_intent,this.GFStripeObj.formId),!1;if(s){if(this.resetFormValidationErrors(),this.draftId=r.data.resume_token,"1"!==this.GFStripeObj.activeFeed.hasTrial&&!this.GFStripeObj.activeFeed.setupFee&&!this.isValidCoupon(r.data.total))return this.failWithMessage(gforms_stripe_frontend_strings.coupon_invalid,this.GFStripeObj.formId),!1;a?this.handleRedirect(this.getRedirectUrl(r.data.resume_token)):this.confirm(r.data)}else e.target.submit()}isValidCoupon(e){const t=this.getStripeCoupon();return!t||t.is_valid&&e==this.order.paymentAmount}getFormData(e){const t=new FormData(e);t.delete("gform_submit");const r={action:"gfstripe_validate_form",feed_id:this.GFStripeObj.activeFeed.feedId,form_id:this.GFStripeObj.formId,tracking_id:Math.random().toString(36).slice(2,10),payment_method:this.paymentMethod.value.type,nonce:gforms_stripe_frontend_strings.validate_form_nonce};return Object.keys(r).forEach(e=>{t.append(e,r[e])}),t}updatePaymentAmount(e){if(e<=0||"setup"===this.GFStripeObj.activeFeed.initial_payment_information.mode)return;let t=100*e;t=Math.round(100*t)/100;let r={amount:t};r=window.gform.applyFilters("gform_stripe_payment_element_updated_payment_information",r,this.GFStripeObj.activeFeed.initial_payment_information,this.GFStripeObj.activeFeed.feedId,this.GFStripeObj.formId),this.elements.update(r)}applyStripeCoupon(e){const t=this.getStripeCoupon();return t&&t.is_valid?(t.percentage_off?e-=e*(t.percentage_off/100):t.amount_off&&(e-=t.amount_off),e):e}async confirm(e){const t=this.getRedirectUrl(e.resume_token);t.searchParams.append("tracking_id",e.tracking_id);const{error:r}=await this.elements.submit();if(r)return void this.failWithMessage(r.message,this.GFStripeObj.formId);const i={elements:this.elements,clientSecret:e.intent.client_secret,confirmParams:{return_url:t.toString(),payment_method_data:{billing_details:{address:{line1:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_line1)),line2:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_line2)),city:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_city)),state:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_state)),postal_code:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_zip))}}}},redirect:"if_required"};let n={},s=0===e.intent.id.indexOf("seti_");try{n=s?await this.stripe.confirmSetup(i):await this.stripe.confirmPayment(i)}catch(e){console.log(e),this.failWithMessage(gforms_stripe_frontend_strings.failed_to_confirm_intent,this.GFStripeObj.formId)}"paymentIntent"in n||"setupIntent"in n?this.handlePaymentRedirect(n,t):await this.handleFailedPayment(n)}handlePaymentRedirect(e,t){const r=e.paymentIntent?e.paymentIntent:e.setupIntent,i=0===r.id.indexOf("seti_")?"setup":"payment";t.searchParams.append(i+"_intent",r.id),t.searchParams.append(i+"_intent_client_secret",r.client_secret),t.searchParams.append("redirect_status",r.status?"succeeded":"pending"),this.handleRedirect(t)}handleRedirect(e){this.isAjaxEmbed(this.GFStripeObj.formId)?(jQuery("#gform_"+this.GFStripeObj.formId).attr("action",e.toString()),jQuery("#gform_"+this.GFStripeObj.formId).data("isAjaxSubmitting",!0),jQuery("#gform_"+this.GFStripeObj.formId).find('[name="gform_submit"]').remove(),jQuery("#gform_"+this.GFStripeObj.formId).submit()):window.location.href=e.toString()}getRedirectUrl(e){const t=new URL(window.location.href);return t.searchParams.append("resume_token",e),t.searchParams.append("feed_id",this.GFStripeObj.activeFeed.feedId),t.searchParams.append("form_id",this.GFStripeObj.formId),t}async handleFailedPayment(e){let t="";"error"in e&&"message"in e.error&&(t=e.error.message),this.failWithMessage(t,this.GFStripeObj.formId);let r=n(JSON.stringify({draft_id:this.draftId}),!0,"gfstripe_delete_draft_entry",gforms_stripe_frontend_strings.delete_draft_nonce);this.GFStripeObj.hasOwnProperty("cardErrorCount")&&(r=await n(JSON.stringify({increase_count:!0}),!0,"gfstripe_payment_element_check_rate_limiting",gforms_stripe_frontend_strings.rate_limiting_nonce),this.GFStripeObj.cardErrorCount=r.data.error_count)}destroy(){this.card&&this.card.destroy(),this.destroyLink()}destroyLink(){if(this.link){this.link.destroy(),this.link=null;const e=this.GFStripeObj.GFCCField.siblings(".gfield #stripe-payment-link");e&&e.remove()}}clearErrors(){this.GFStripeObj.GFCCField.next(".validation_message").length&&this.GFStripeObj.GFCCField.next(".validation_message").remove()}resetFormValidationErrors(){document.querySelectorAll(".gform_validation_errors, .validation_message").forEach(e=>{e.remove()}),document.querySelectorAll(".gfield_error").forEach(e=>{e.classList.remove("gfield_error")})}failWithMessage(e,t){e=e||gforms_stripe_frontend_strings.failed_to_process_payment,this.GFStripeObj.displayStripeCardError({error:{message:e}}),this.GFStripeObj.resetStripeStatus(jQuery("#gform_"+t),t,!0),jQuery("#gform_ajax_spinner_"+t).remove()}getBillingAddressMergeTag(e){return""===e?"":"{:"+e+":value}"}getOrderData(e,t){if(!_gformPriceFields[t]||null===this.GFStripeObj.activeFeed)return this.order;const r=this.GFStripeObj.activeFeed.setupFee;let i=0;const n=this.GFStripeObj.activeFeed.hasTrial;if(r){const r=this.GFStripeObj.getProductFieldPrice(t,this.GFStripeObj.activeFeed.setupFee);i=r.price*r.qty,e-=i}return"form_total"===this.GFStripeObj.activeFeed.paymentAmount?(this.order.recurringAmount=e,this.isTextCoupon()&&(this.order.recurringAmount=this.applyStripeCoupon(this.order.recurringAmount))):(this.order.recurringAmount=gformCalculateProductPrice(t,this.GFStripeObj.activeFeed.paymentAmount),this.order.recurringAmount=this.applyStripeCoupon(this.order.recurringAmount)),this.order.paymentAmount="1"===n?i:this.order.recurringAmount+i,this.order}isTextCoupon(){const e=this.getStripeCouponInput();return!!e&&!e.classList.contains("gf_coupon_code")}isAjaxEmbed(e){return jQuery("#gform_ajax_frame_"+e).length>=1}}window.GFStripe=null,gform.extensions=gform.extensions||{},gform.extensions.styles=gform.extensions.styles||{},gform.extensions.styles.gravityformsstripe=gform.extensions.styles.gravityformsstripe||{},i=jQuery,GFStripe=function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);this.form=null,this.activeFeed=null,this.GFCCField=null,this.stripeResponse=null,this.hasPaymentIntent=!1,this.stripePaymentHandlers={},this.cardStyle=this.cardStyle||{},gform.extensions.styles.gravityformsstripe[this.formId]=gform.extensions.styles.gravityformsstripe[this.formId]||{};const r=Object.keys(this.cardStyle).length>0?JSON.parse(JSON.stringify(this.cardStyle)):gform.extensions.styles.gravityformsstripe[this.formId][this.pageInstance]||{};this.setComponentStyleValue=function(e,t,r,i){let n="";if(0===t.indexOf("--")){const s=r.getPropertyValue(t);if(s)n=s;else{const t="fontSmoothing"===e?"-webkit-font-smoothing":e;n=(i?getComputedStyle(i):r).getPropertyValue(t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())}}else n=t;return n.trim()},this.setComponentStyles=function(e,t,i){if(0===Object.keys(e).length)return;const n=document.getElementById("gform_"+this.formId),s=getComputedStyle(n),a=n.querySelector(".gfield input");Object.keys(e).forEach(n=>{if("object"!=typeof e[n]){if("object"!=typeof e[n]){let e="";i?t&&t!==i?(e=this.setComponentStyleValue(n,r[i][t][n],s,a),e&&(this.cardStyle[i][t][n]=e)):(e=this.setComponentStyleValue(n,r[i][n],s,a),e&&(this.cardStyle[i][n]=e)):(e=this.setComponentStyleValue(n,r[n],s,a),e&&(this.cardStyle[n]=e))}}else{i||(this.cardStyle[n]={}),i&&(this.cardStyle[i][n]={});const t=i||n;this.setComponentStyles(e[n],n,t)}})},this.init=async function(){if(this.setComponentStyles(r),this.isCreditCardOnPage()||"stripe.js"!==this.stripe_payment&&("elements"!==this.stripe_payment||i("#gf_stripe_response").length)){var e=this,t=null,n=!1,s=!1,o=this.apiKey;switch(this.form=i("#gform_"+this.formId),this.GFCCField=i("#input_"+this.formId+"_"+this.ccFieldId+"_1"),gform.addAction("gform_frontend_feeds_evaluated",(async function(r,c){if(c===e.formId){t=null,n=!1,s=!1;for(var u=0;u div").length?(i(".ginput_container_creditcard > div:last").hide(),i(".ginput_container_creditcard > div:first").html("

"+gforms_stripe_frontend_strings.requires_action+"

")):i(".ginput_container_creditcard").html("

"+gforms_stripe_frontend_strings.requires_action+"

"),jQuery("#gform_"+c+"_validation_container h2 .gform_ajax_spinner").length<=0&&(jQuery("#gform_"+c+"_validation_container h2").append(''),jQuery("#gform_submit_button_"+c).prop("disabled",!0));const t=jQuery("#gform_"+c+"_validation_container h2 .gform-icon.gform-icon--close"),r=jQuery(".gform-theme--framework").length;console.log(r),console.log(t),t.length&&!r&&t.removeClass("gform-icon--close").addClass("gform-icon--info"),e.scaActionHandler(d,c)}else p.mount("#"+e.GFCCField.attr("id")),p.on("change",(function(t){e.displayStripeCardError(t)}));else if("stripe.js"==e.stripe_payment){Stripe.setPublishableKey(o);break}break}n||("elements"!==e.stripe_payment&&"payment_element"!==e.stripe_payment||(null!=l&&p===l.getElement("card")&&p.destroy(),e.isStripePaymentHandlerInitiated(c)&&e.stripePaymentHandlers[c].destroy(),e.GFCCField.next(".validation_message").length||e.GFCCField.after('
'+gforms_stripe_frontend_strings.no_active_frontend_feed+"
"),wp.a11y.speak(gforms_stripe_frontend_strings.no_active_frontend_feed)),e.resetStripeStatus(e.form,c,e.isLastPage()),o=e.apiKey,e.activeFeed=null)}})),gform.addFilter("gform_product_total",(function(t,r){if("payment_element"==e.stripe_payment&&e.isStripePaymentHandlerInitiated(r)&&e.stripePaymentHandlers[r].getOrderData(t,r),!e.activeFeed)return window["gform_stripe_amount_"+r]=0,t;if("form_total"!==e.activeFeed.paymentAmount){const t=e.getProductFieldPrice(r,e.activeFeed.paymentAmount);if(window["gform_stripe_amount_"+r]=t.price*t.qty,e.activeFeed.hasOwnProperty("setupFee")){const t=e.getProductFieldPrice(r,e.activeFeed.setupFee);window["gform_stripe_amount_"+r]+=t.price*t.qty}}else window["gform_stripe_amount_"+r]=t;return"payment_element"==e.stripe_payment&&e.isStripePaymentHandlerInitiated(r)&&null!==e.stripePaymentHandlers[r].elements&&"1"===gforms_stripe_frontend_strings.stripe_connect_enabled&&e.stripePaymentHandlers[r].updatePaymentAmount(e.stripePaymentHandlers[r].order.paymentAmount),t}),51),this.stripe_payment){case"elements":var d=null,l=null,p=null;i("#gf_stripe_response").length&&(this.stripeResponse=JSON.parse(i("#gf_stripe_response").val()),this.stripeResponse.hasOwnProperty("client_secret")&&(this.hasPaymentIntent=!0))}if(i("#gform_"+this.formId).on("submit",(function(r){let s=!1;const a=parseInt(i("#gform_source_page_number_"+e.formId).val(),10),o=parseInt(i("#gform_target_page_number_"+e.formId).val(),10);if(a>o&&0!==o&&(s=!0),!(s||!n||i(this).data("gfstripesubmitting")||1==i("#gform_save_"+e.formId).val()||!e.isLastPage()&&"elements"!==e.stripe_payment||gformIsHidden(e.GFCCField)||e.maybeHitRateLimits()||e.invisibleCaptchaPending()||e.recaptchav3Pending()||"payment_element"===e.stripe_payment&&0===window["gform_stripe_amount_"+e.formId]))switch(r.preventDefault(),i(this).data("gfstripesubmitting",!0),e.maybeAddSpinner(),e.stripe_payment){case"payment_element":e.injectHoneypot(r),e.stripePaymentHandlers[e.formId].validate(r);break;case"elements":if(e.form=i(this),e.isLastPage()&&!e.isCreditCardOnPage()||gformIsHidden(e.GFCCField)||s)return void i(this).submit();"product"===t.type?e.createPaymentMethod(d,p):e.createToken(d,p);break;case"stripe.js":var l=i(this),c="input_"+e.formId+"_"+e.ccFieldId+"_",u={number:l.find("#"+c+"1").val(),exp_month:l.find("#"+c+"2_month").val(),exp_year:l.find("#"+c+"2_year").val(),cvc:l.find("#"+c+"3").val(),name:l.find("#"+c+"5").val()};e.form=l,Stripe.card.createToken(u,(function(t,r){e.responseHandler(t,r)}))}})),"payment_element_intent_failure"in e&&e.payment_element_intent_failure){const t=jQuery('

'+gforms_stripe_frontend_strings.payment_element_intent_failure+"

");jQuery("#gform_wrapper_"+e.formId).prepend(t)}}},this.getProductFieldPrice=function(e,t){var r=GFMergeTag.getMergeTagValue(e,t,":price"),i=GFMergeTag.getMergeTagValue(e,t,":qty");return"string"==typeof r&&(r=GFMergeTag.getMergeTagValue(e,t+".2",":price"),i=GFMergeTag.getMergeTagValue(e,t+".3",":qty")),{price:r,qty:i}},this.getBillingAddressMergeTag=function(e){return""===e?"":"{:"+e+":value}"},this.responseHandler=function(e,t){for(var r=this.form,n="input_"+this.formId+"_"+this.ccFieldId+"_",s=["1","2_month","2_year","3","5"],a=0;a').val(d.slice(-4))),r.append(i('').val(l))}}r.append(i('').val(i.toJSON(t))),r.submit()},this.elementsResponseHandler=function(e){var t=this.form,r=this,n=this.activeFeed,s=gform.applyFilters("gform_stripe_currency",this.currency,this.formId),a=0===gf_global.gf_currency_config.decimals?window["gform_stripe_amount_"+this.formId]:gformRoundPrice(100*window["gform_stripe_amount_"+this.formId]);if(e.error)return this.displayStripeCardError(e),void this.resetStripeStatus(t,this.formId,this.isLastPage());if(this.hasPaymentIntent)if("product"===n.type)e.hasOwnProperty("paymentMethod")?(i("#gf_stripe_credit_card_last_four").val(e.paymentMethod.card.last4),i("#stripe_credit_card_type").val(e.paymentMethod.card.brand),i.ajax({async:!1,url:gforms_stripe_frontend_strings.ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_update_payment_intent",nonce:gforms_stripe_frontend_strings.create_payment_intent_nonce,payment_intent:e.id,payment_method:e.paymentMethod,currency:s,amount:a,feed_id:n.feedId},success:function(e){e.success?(i("#gf_stripe_response").val(i.toJSON(e.data)),t.submit()):(e.error=e.data,delete e.data,r.displayStripeCardError(e),r.resetStripeStatus(t,r.formId,r.isLastPage()))}})):e.hasOwnProperty("amount")&&t.submit();else{var o=JSON.parse(i("#gf_stripe_response").val());o.updatedToken=e.token.id,i("#gf_stripe_response").val(i.toJSON(o)),t.append(i('').val(e.token.card.last4)),t.append(i('').val(e.token.card.brand)),t.submit()}else i("#gf_stripe_response").length?i("#gf_stripe_response").val(i.toJSON(e)):t.append(i('').val(i.toJSON(e))),"product"===n.type?(t.append(i('').val(e.paymentMethod.card.last4)),t.append(i('').val(e.paymentMethod.card.brand)),i.ajax({async:!1,url:gforms_stripe_frontend_strings.ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_create_payment_intent",nonce:gforms_stripe_frontend_strings.create_payment_intent_nonce,payment_method:e.paymentMethod,currency:s,amount:a,feed_id:n.feedId},success:function(e){e.success?(i("#gf_stripe_response").length?i("#gf_stripe_response").val(i.toJSON(e.data)):t.append(i('').val(i.toJSON(e.data))),t.submit()):(e.error=e.data,delete e.data,r.displayStripeCardError(e),r.resetStripeStatus(t,r.formId,r.isLastPage()))}})):(t.append(i('').val(e.token.card.last4)),t.append(i('').val(e.token.card.brand)),t.submit())},this.scaActionHandler=function(e,t){if(!i("#gform_"+t).data("gfstripescaauth")){i("#gform_"+t).data("gfstripescaauth",!0);var r=this,n=JSON.parse(i("#gf_stripe_response").val());"product"===this.activeFeed.type?e.retrievePaymentIntent(n.client_secret).then((function(s){"requires_action"===s.paymentIntent.status&&e.handleCardAction(n.client_secret).then((function(e){var n=JSON.parse(i("#gf_stripe_response").val());n.scaSuccess=!0,i("#gf_stripe_response").val(i.toJSON(n)),r.maybeAddSpinner(),jQuery("#gform_submit_button_"+t).prop("disabled",!1),i("#gform_"+t).data("gfstripescaauth",!1),i("#gform_"+t).data("gfstripesubmitting",!0).submit(),jQuery("#gform_submit_button_"+t).prop("disabled",!0)}))})):e.retrievePaymentIntent(n.client_secret).then((function(s){"requires_action"===s.paymentIntent.status&&e.handleCardPayment(n.client_secret).then((function(e){r.maybeAddSpinner(),jQuery("#gform_submit_button_"+t).prop("disabled",!1),i("#gform_"+t).data("gfstripescaauth",!1),i("#gform_"+t).data("gfstripesubmitting",!0).trigger("submit")}))}))}},this.isLastPage=function(){var e=i("#gform_target_page_number_"+this.formId);return!(e.length>0)||0==e.val()},this.isConversationalForm=function(){return i('[data-js="gform-conversational-form"]').length>0},this.isCreditCardOnPage=function(){var e=this.getCurrentPageNumber();return!(this.ccPage&&e&&!this.isConversationalForm())||this.ccPage==e},this.getCurrentPageNumber=function(){var e=i("#gform_source_page_number_"+this.formId);return e.length>0&&e.val()},this.maybeAddSpinner=function(){if(!this.isAjax)if("function"==typeof gformAddSpinner)gformAddSpinner(this.formId);else{var e=this.formId;if(0==jQuery("#gform_ajax_spinner_"+e).length){var t=gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,e);gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+e+", #gform_wrapper_"+e+" .gform_next_button, #gform_send_resume_link_button_"+e),e).after('')}}},this.resetStripeStatus=function(e,t,r){i("#gf_stripe_response, #gf_stripe_credit_card_last_four, #stripe_credit_card_type").remove(),e.data("gfstripesubmitting",!1),document.querySelectorAll("#gform_ajax_spinner_"+t).forEach((function(e){e.remove()})),r&&(window["gf_submitting_"+t]=!1)},this.displayStripeCardError=function(e){e.error&&!this.GFCCField.next(".validation_message").length&&this.GFCCField.after('
');var t=this.GFCCField.next(".validation_message");e.error?(t.html(e.error.message),wp.a11y.speak(e.error.message,"assertive"),i("#gform_ajax_spinner_"+this.formId).length>0&&i("#gform_ajax_spinner_"+this.formId).remove()):t.remove()},this.createToken=function(e,t){const r=this,n=this.activeFeed,s={name:i("#input_"+r.formId+"_"+r.ccFieldId+"_5").val(),address_line1:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_line1)),address_line2:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_line2)),address_city:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_city)),address_state:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_state)),address_zip:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_zip)),address_country:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_country)),currency:gform.applyFilters("gform_stripe_currency",this.currency,this.formId)};e.createToken(t,s).then((function(e){r.elementsResponseHandler(e)}))},this.createPaymentMethod=function(e,t,r){var n=this,s=this.activeFeed,a="";if(""!==s.address_country&&(a=GFMergeTag.replaceMergeTags(n.formId,n.getBillingAddressMergeTag(s.address_country))),""===a||void 0!==r&&""!==r){var o=i("#input_"+this.formId+"_"+this.ccFieldId+"_5").val(),d=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_line1)),l=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_line2)),p=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_city)),c=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_state)),u=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_zip)),f={billing_details:{name:null,address:{}}};""!==o&&(f.billing_details.name=o),""!==d&&(f.billing_details.address.line1=d),""!==l&&(f.billing_details.address.line2=l),""!==p&&(f.billing_details.address.city=p),""!==c&&(f.billing_details.address.state=c),""!==u&&(f.billing_details.address.postal_code=u),""!==r&&(f.billing_details.address.country=r),null===f.billing_details.name&&delete f.billing_details.name,f.billing_details.address==={}&&delete f.billing_details.address,e.createPaymentMethod("card",t,f).then((function(e){null!==n.stripeResponse&&(e.id=n.stripeResponse.id,e.client_secret=n.stripeResponse.client_secret),n.elementsResponseHandler(e)}))}else i.ajax({async:!1,url:gforms_stripe_frontend_strings.ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_get_country_code",nonce:gforms_stripe_frontend_strings.create_payment_intent_nonce,country:a,feed_id:s.feedId},success:function(r){r.success&&n.createPaymentMethod(e,t,r.data.code)}})},this.maybeHitRateLimits=function(){return!!(this.hasOwnProperty("cardErrorCount")&&this.cardErrorCount>=5)},this.invisibleCaptchaPending=function(){var e=this.form.find(".ginput_recaptcha");if(!e.length||"invisible"!==e.data("size"))return!1;var t=e.find(".g-recaptcha-response");return!(t.length&&t.val())},this.recaptchav3Pending=function(){const e=this.form.find(".ginput_recaptchav3");if(!e.length)return!1;const t=e.find(".gfield_recaptcha_response");return!(t&&t.val())},this.injectHoneypot=e=>{const t=e.target;if((this.isFormSubmission(t)||this.isSaveContinue(t))&&!this.isHeadlessBrowser()){const e=``;t.insertAdjacentHTML("beforeend",e)}},this.isSaveContinue=e=>{const t=e.dataset.formid,r=this.getNodes("#gform_save_"+t,!0,e,!0);return r.length>0&&"1"===r[0].value},this.isFormSubmission=e=>{const t=e.dataset.formid,r=this.getNodes(`input[name = "gform_target_page_number_${t}"]`,!0,e,!0)[0];return void 0!==r&&0===parseInt(r.value)},this.isHeadlessBrowser=()=>window._phantom||window.callPhantom||window.__phantomas||window.Buffer||window.emit||window.spawn||window.webdriver||window._selenium||window._Selenium_IDE_Recorder||window.callSelenium||window.__nightmare||window.domAutomation||window.domAutomationController||window.document.__webdriver_evaluate||window.document.__selenium_evaluate||window.document.__webdriver_script_function||window.document.__webdriver_script_func||window.document.__webdriver_script_fn||window.document.__fxdriver_evaluate||window.document.__driver_unwrapped||window.document.__webdriver_unwrapped||window.document.__driver_evaluate||window.document.__selenium_unwrapped||window.document.__fxdriver_unwrapped||window.document.documentElement.getAttribute("selenium")||window.document.documentElement.getAttribute("webdriver")||window.document.documentElement.getAttribute("driver"),this.getNodes=(e="",t=!1,r=document,i=!1)=>{const n=i?e:`[data-js="${e}"]`;let s=r.querySelectorAll(n);return t&&(s=this.convertElements(s)),s},this.convertElements=(e=[])=>{const t=[];let r=e.length;for(;r--;t.unshift(e[r]));return t},this.isStripePaymentHandlerInitiated=function(e){return e in this.stripePaymentHandlers&&null!==this.stripePaymentHandlers[e]&&void 0!==this.stripePaymentHandlers[e]},this.init()}}]); \ No newline at end of file +!function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(i,n,function(t){return e[t]}.bind(null,n));return i},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"Headers",(function(){return h})),r.d(t,"Request",(function(){return w})),r.d(t,"Response",(function(){return S})),r.d(t,"DOMException",(function(){return O})),r.d(t,"fetch",(function(){return C}));var i="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e||{},n="URLSearchParams"in i,s="Symbol"in i&&"iterator"in Symbol,a="FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in i,d="ArrayBuffer"in i;if(d)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],p=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return s&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function _(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function m(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function b(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():d&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):d&&(ArrayBuffer.prototype.isPrototypeOf(e)||p(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=_(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=_(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(a)return this.blob().then(g);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,i,n,s=_(this);if(s)return s;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=m(t),i=/charset=([A-Za-z0-9_-]+)/.exec(e.type),n=i?i[1]:"utf-8",t.readAsText(e,n),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in i)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&s)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(s),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var a=/([?&])_=[^&]*/;if(a.test(this.url))this.url=this.url.replace(a,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function F(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),n=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(n))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},b.call(w.prototype),b.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var j=[301,302,303,307,308];S.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})};var O=i.DOMException;try{new O}catch(e){(O=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),O.prototype.constructor=O}function C(e,t){return new Promise((function(r,n){var s=new w(e,t);if(s.signal&&s.signal.aborted)return n(new O("Aborted","AbortError"));var o=new XMLHttpRequest;function l(){o.abort()}if(o.onload=function(){var e,t,i={statusText:o.statusText,headers:(e=o.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),i=r.shift().trim();if(i){var n=r.join(":").trim();try{t.append(i,n)}catch(e){console.warn("Response "+e.message)}}})),t)};0===s.url.indexOf("file://")&&(o.status<200||o.status>599)?i.status=200:i.status=o.status,i.url="responseURL"in o?o.responseURL:i.headers.get("X-Request-URL");var n="response"in o?o.response:o.responseText;setTimeout((function(){r(new S(n,i))}),0)},o.onerror=function(){setTimeout((function(){n(new TypeError("Network request failed"))}),0)},o.ontimeout=function(){setTimeout((function(){n(new TypeError("Network request timed out"))}),0)},o.onabort=function(){setTimeout((function(){n(new O("Aborted","AbortError"))}),0)},o.open(s.method,function(e){try{return""===e&&i.location.href?i.location.href:e}catch(t){return e}}(s.url),!0),"include"===s.credentials?o.withCredentials=!0:"omit"===s.credentials&&(o.withCredentials=!1),"responseType"in o&&(a?o.responseType="blob":d&&(o.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof h||i.Headers&&t.headers instanceof i.Headers)){var p=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){p.push(c(e)),o.setRequestHeader(e,u(t.headers[e]))})),s.headers.forEach((function(e,t){-1===p.indexOf(t)&&o.setRequestHeader(t,e)}))}else s.headers.forEach((function(e,t){o.setRequestHeader(t,e)}));s.signal&&(s.signal.addEventListener("abort",l),o.onreadystatechange=function(){4===o.readyState&&s.signal.removeEventListener("abort",l)}),o.send(void 0===s._bodyInit?null:s._bodyInit)}))}C.polyfill=!0,i.fetch||(i.fetch=C,i.Headers=h,i.Request=w,i.Response=S)}.call(this,r(1))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},,function(e,t,r){r(0),e.exports=r(6)},,,function(e,t,r){"use strict";r.r(t);var i,n=async(e,t=!1,r=!1,i=!1)=>{"function"==typeof e.has&&e.has("gform_ajax")&&(e.set("gform_ajax--stripe-temp",e.get("gform_ajax")),e.delete("gform_ajax"));const n={method:"POST",credentials:"same-origin",body:e};t&&(n.headers={Accept:"application/json","content-type":"application/json"});const s=new URL(gforms_stripe_frontend_strings.ajaxurl);return r&&s.searchParams.set("action",r),i&&s.searchParams.set("nonce",i),gforms_stripe_frontend_strings.is_preview&&s.searchParams.set("preview","1"),await fetch(s.toString(),n).then(e=>e.json())},s=Object.assign||function(e){for(var t=1;t0===e.localeCompare(t,void 0,{sensitivity:"accent"}));return r?e[r]:void 0}getStripeCouponInput(){const e=document.querySelector("#field_"+this.GFStripeObj.formId+"_"+this.GFStripeObj.activeFeed.coupon);return e?e.querySelector("input"):null}getStripeCouponCode(){const e=this.getStripeCouponInput();if(!e)return"";if("gf_coupon_code"===e.className){return e?document.querySelector("#gf_coupon_codes_"+this.GFStripeObj.formId).value:null}return e?e.value:""}bindStripeCoupon(){const e=this.getStripeCouponInput();e&&!e.getAttribute("data-listener-added")&&(e.addEventListener("blur",this.handleCouponChange.bind(this)),e.setAttribute("data-listener-added",!0))}async handleCouponChange(e){this.getStripeCouponInput()===e.target&&(e.target.classList.contains("gf_coupon_code")&&(e.target.value=e.target.value.toUpperCase()),await this.updateStripeCoupon(e.target.value),gformCalculateTotalPrice(this.GFStripeObj.formId))}async updateStripeCoupon(e){if(!e)return;if(window.stripeCoupons||(window.stripeCoupons={}),window.stripeCoupons[e])return;const t=await n(JSON.stringify({coupon:e,feed_id:this.GFStripeObj.activeFeed.feedId}),!0,"gfstripe_get_stripe_coupon",gforms_stripe_frontend_strings.get_stripe_coupon_nonce);window.stripeCoupons[e]=t.data}async initStripe(){this.stripe=Stripe(this.apiKey);const e=this.GFStripeObj.activeFeed.initial_payment_information,t=this.GFStripeObj.cardStyle;return"payment_method_types"in e&&(e.payment_method_types=Object.values(e.payment_method_types)),this.elements=this.stripe.elements(s({},e,{appearance:t})),!0}mountCard(){this.card.mount("#"+this.GFStripeObj.GFCCField.attr("id"))}mountLink(){if(null!==this.link){if(document.querySelectorAll(".stripe-payment-link").length<=0){const e=document.createElement("div");e.setAttribute("id","stripe-payment-link"),e.classList.add("StripeElement--link"),this.GFStripeObj.GFCCField.before(jQuery(e))}this.link.mount("#stripe-payment-link")}}async bindEvents(){this.card&&this.card.on("change",e=>{null!==this.paymentMethod&&this.clearErrors(),this.paymentMethod=e}),this.bindStripeCoupon();const e=document.querySelector("#input_"+this.GFStripeObj.formId+"_"+this.GFStripeObj.activeFeed.link_email_field_id);null!==e&&(e.addEventListener("blur",this.handlelinkEmailFieldChange),window.addEventListener("load",async function(){const e=document.querySelector("#input_"+this.GFStripeObj.formId+"_"+this.GFStripeObj.activeFeed.link_email_field_id);String(e.value).toLowerCase().match(/^(([^<>()[\]\\.,;:\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,}))$/)&&this.GFStripeObj.isLastPage()&&this.handlelinkEmailFieldChange({target:{value:e.value}})}.bind(this)))}async reInitiateLinkWithEmailAddress(e){if(!1===this.GFStripeObj.isCreditCardOnPage())return;this.destroyLink();const t=e.target.value;t&&(this.link=await this.elements.create("linkAuthentication",{defaultValues:{email:t}}),this.mountLink(),this.GFStripeObj.GFCCField.siblings(".gfield #stripe-payment-link").addClass("visible"))}async validate(e){const t=jQuery("#gform_"+this.GFStripeObj.formId);if(t.data("isAjaxSubmitting"))return void t.submit();if(!this.paymentMethod.complete&&"link"!==this.paymentMethod.value.type)return this.failWithMessage(gforms_stripe_frontend_strings.payment_incomplete,this.GFStripeObj.formId),!1;gformAddSpinner(this.GFStripeObj.formId);const r=await n(this.getFormData(e.target));if(-1===r)return this.failWithMessage(gforms_stripe_frontend_strings.invalid_nonce,this.GFStripeObj.formId),!1;if("success"in r&&!1===r.success)return this.failWithMessage(gforms_stripe_frontend_strings.failed_to_confirm_intent,this.GFStripeObj.formId),!1;if("invoice_id"in r.data&&null!==r.data.invoice_id&&"resume_token"in r.data){const e=new URL(window.location.href);e.searchParams.append("resume_token",r.data.resume_token),e.searchParams.append("tracking_id",r.data.tracking_id),window.location.href=e.href}const i="intent"in r.data&&!1!==r.data.intent&&null!=r.data.intent&&"client_secret"in r.data.intent,s="data"in r&&"is_valid"in r.data&&r.data.is_valid&&"resume_token"in r.data,a="is_spam"in r.data&&r.data.is_spam;if(!i&&!a&&s)return this.failWithMessage(gforms_stripe_frontend_strings.failed_to_confirm_intent,this.GFStripeObj.formId),!1;if(s){if(this.resetFormValidationErrors(),this.draftId=r.data.resume_token,"1"!==this.GFStripeObj.activeFeed.hasTrial&&!this.GFStripeObj.activeFeed.setupFee&&!this.isValidCoupon(r.data.total))return this.failWithMessage(gforms_stripe_frontend_strings.coupon_invalid,this.GFStripeObj.formId),!1;a?this.handleRedirect(this.getRedirectUrl(r.data.resume_token)):this.confirm(r.data)}else e.target.submit()}isValidCoupon(e){const t=this.getStripeCoupon();return!t||t.is_valid&&e==this.order.paymentAmount}getFormData(e){const t=new FormData(e);t.delete("gform_submit");const r={action:"gfstripe_validate_form",feed_id:this.GFStripeObj.activeFeed.feedId,form_id:this.GFStripeObj.formId,tracking_id:Math.random().toString(36).slice(2,10),payment_method:this.paymentMethod.value.type,nonce:gforms_stripe_frontend_strings.validate_form_nonce};return Object.keys(r).forEach(e=>{t.append(e,r[e])}),t}updatePaymentAmount(e){if(e<=0||"setup"===this.GFStripeObj.activeFeed.initial_payment_information.mode)return;let t=100*e;t=Math.round(100*t)/100;let r={amount:t};r=window.gform.applyFilters("gform_stripe_payment_element_updated_payment_information",r,this.GFStripeObj.activeFeed.initial_payment_information,this.GFStripeObj.activeFeed.feedId,this.GFStripeObj.formId),this.elements.update(r)}applyStripeCoupon(e){const t=this.getStripeCoupon();return t&&t.is_valid?(t.percentage_off?e-=e*(t.percentage_off/100):t.amount_off&&(e-=t.amount_off),e):e}async confirm(e){const t=this.getRedirectUrl(e.resume_token);t.searchParams.append("tracking_id",e.tracking_id);const{error:r}=await this.elements.submit();if(r)return void this.failWithMessage(r.message,this.GFStripeObj.formId);const i={elements:this.elements,clientSecret:e.intent.client_secret,confirmParams:{return_url:t.toString(),payment_method_data:{billing_details:{address:{line1:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_line1)),line2:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_line2)),city:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_city)),state:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_state)),postal_code:GFMergeTag.replaceMergeTags(this.GFStripeObj.formId,this.getBillingAddressMergeTag(this.GFStripeObj.activeFeed.address_zip))}}}},redirect:"if_required"};let n={},s=0===e.intent.id.indexOf("seti_");try{n=s?await this.stripe.confirmSetup(i):await this.stripe.confirmPayment(i)}catch(e){console.log(e),this.failWithMessage(gforms_stripe_frontend_strings.failed_to_confirm_intent,this.GFStripeObj.formId)}"paymentIntent"in n||"setupIntent"in n?this.handlePaymentRedirect(n,t):await this.handleFailedPayment(n)}handlePaymentRedirect(e,t){const r=e.paymentIntent?e.paymentIntent:e.setupIntent,i=0===r.id.indexOf("seti_")?"setup":"payment";t.searchParams.append(i+"_intent",r.id),t.searchParams.append(i+"_intent_client_secret",r.client_secret),t.searchParams.append("redirect_status",r.status?"succeeded":"pending"),this.handleRedirect(t)}handleRedirect(e){this.isAjaxEmbed(this.GFStripeObj.formId)?(jQuery("#gform_"+this.GFStripeObj.formId).attr("action",e.toString()),jQuery("#gform_"+this.GFStripeObj.formId).data("isAjaxSubmitting",!0),jQuery("#gform_"+this.GFStripeObj.formId).find('[name="gform_submit"]').remove(),jQuery("#gform_"+this.GFStripeObj.formId).submit()):window.location.href=e.toString()}getRedirectUrl(e){const t=new URL(window.location.href);return t.searchParams.append("resume_token",e),t.searchParams.append("feed_id",this.GFStripeObj.activeFeed.feedId),t.searchParams.append("form_id",this.GFStripeObj.formId),t}async handleFailedPayment(e){let t="";"error"in e&&"message"in e.error&&(t=e.error.message),this.failWithMessage(t,this.GFStripeObj.formId);let r=n(JSON.stringify({draft_id:this.draftId}),!0,"gfstripe_delete_draft_entry",gforms_stripe_frontend_strings.delete_draft_nonce);this.GFStripeObj.hasOwnProperty("cardErrorCount")&&(r=await n(JSON.stringify({increase_count:!0}),!0,"gfstripe_payment_element_check_rate_limiting",gforms_stripe_frontend_strings.rate_limiting_nonce),this.GFStripeObj.cardErrorCount=r.data.error_count)}destroy(){this.card&&this.card.destroy(),this.destroyLink()}destroyLink(){if(this.link){this.link.destroy(),this.link=null;const e=this.GFStripeObj.GFCCField.siblings(".gfield #stripe-payment-link");e&&e.remove()}}clearErrors(){this.GFStripeObj.GFCCField.next(".validation_message").length&&this.GFStripeObj.GFCCField.next(".validation_message").remove()}resetFormValidationErrors(){document.querySelectorAll(".gform_validation_errors, .validation_message").forEach(e=>{e.remove()}),document.querySelectorAll(".gfield_error").forEach(e=>{e.classList.remove("gfield_error")})}failWithMessage(e,t){e=e||gforms_stripe_frontend_strings.failed_to_process_payment,this.GFStripeObj.displayStripeCardError({error:{message:e}}),this.GFStripeObj.resetStripeStatus(jQuery("#gform_"+t),t,!0),jQuery("#gform_ajax_spinner_"+t).remove()}getBillingAddressMergeTag(e){return""===e?"":"{:"+e+":value}"}getOrderData(e,t){if(!_gformPriceFields[t]||null===this.GFStripeObj.activeFeed)return this.order;const r=this.GFStripeObj.activeFeed.setupFee;let i=0;const n=this.GFStripeObj.activeFeed.hasTrial;if(r){const r=this.GFStripeObj.getProductFieldPrice(t,this.GFStripeObj.activeFeed.setupFee);i=r.price*r.qty,e-=i}return"form_total"===this.GFStripeObj.activeFeed.paymentAmount?(this.order.recurringAmount=e,this.isTextCoupon()&&(this.order.recurringAmount=this.applyStripeCoupon(this.order.recurringAmount))):(this.order.recurringAmount=gformCalculateProductPrice(t,this.GFStripeObj.activeFeed.paymentAmount),this.order.recurringAmount=this.applyStripeCoupon(this.order.recurringAmount)),this.order.paymentAmount="1"===n?i:this.order.recurringAmount+i,this.order}isTextCoupon(){const e=this.getStripeCouponInput();return!!e&&!e.classList.contains("gf_coupon_code")}isAjaxEmbed(e){return jQuery("#gform_ajax_frame_"+e).length>=1}}window.GFStripe=null,gform.extensions=gform.extensions||{},gform.extensions.styles=gform.extensions.styles||{},gform.extensions.styles.gravityformsstripe=gform.extensions.styles.gravityformsstripe||{},i=jQuery,GFStripe=function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);this.form=null,this.activeFeed=null,this.GFCCField=null,this.stripeResponse=null,this.hasPaymentIntent=!1,this.stripePaymentHandlers={},this.cardStyle=this.cardStyle||{},gform.extensions.styles.gravityformsstripe[this.formId]=gform.extensions.styles.gravityformsstripe[this.formId]||{};const r=Object.keys(this.cardStyle).length>0?JSON.parse(JSON.stringify(this.cardStyle)):gform.extensions.styles.gravityformsstripe[this.formId][this.pageInstance]||{};this.setComponentStyleValue=function(e,t,r,i){let n="";if(0===t.indexOf("--")){const s=r.getPropertyValue(t);if(s)n=s;else{const t="fontSmoothing"===e?"-webkit-font-smoothing":e;n=(i?getComputedStyle(i):r).getPropertyValue(t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())}}else n=t;return n.trim()},this.setComponentStyles=function(e,t,i){if(0===Object.keys(e).length)return;const n=document.getElementById("gform_"+this.formId),s=getComputedStyle(n),a=n.querySelector(".gfield input");Object.keys(e).forEach(n=>{if("object"!=typeof e[n]){if("object"!=typeof e[n]){let e="";i?t&&t!==i?(e=this.setComponentStyleValue(n,r[i][t][n],s,a),e&&(this.cardStyle[i][t][n]=e)):(e=this.setComponentStyleValue(n,r[i][n],s,a),e&&(this.cardStyle[i][n]=e)):(e=this.setComponentStyleValue(n,r[n],s,a),e&&(this.cardStyle[n]=e))}}else{i||(this.cardStyle[n]={}),i&&(this.cardStyle[i][n]={});const t=i||n;this.setComponentStyles(e[n],n,t)}})},this.init=async function(){if(this.setComponentStyles(r),this.isCreditCardOnPage()||"stripe.js"!==this.stripe_payment&&("elements"!==this.stripe_payment||i("#gf_stripe_response").length)){var e=this,t=null,n=!1,s=!1,o=this.apiKey;switch(this.form=i("#gform_"+this.formId),this.GFCCField=i("#input_"+this.formId+"_"+this.ccFieldId+"_1"),gform.addAction("gform_frontend_feeds_evaluated",(async function(r,c){if(c===e.formId){t=null,n=!1,s=!1;for(var u=0;u div").length?(i(".ginput_container_creditcard > div:last").hide(),i(".ginput_container_creditcard > div:first").html("

"+gforms_stripe_frontend_strings.requires_action+"

")):i(".ginput_container_creditcard").html("

"+gforms_stripe_frontend_strings.requires_action+"

"),jQuery("#gform_"+c+"_validation_container h2 .gform_ajax_spinner").length<=0&&(jQuery("#gform_"+c+"_validation_container h2").append(''),jQuery("#gform_submit_button_"+c).prop("disabled",!0));const t=jQuery("#gform_"+c+"_validation_container h2 .gform-icon.gform-icon--close"),r=jQuery(".gform-theme--framework").length;console.log(r),console.log(t),t.length&&!r&&t.removeClass("gform-icon--close").addClass("gform-icon--info"),e.scaActionHandler(d,c)}else p.mount("#"+e.GFCCField.attr("id")),p.on("change",(function(t){e.displayStripeCardError(t)}));else if("stripe.js"==e.stripe_payment){Stripe.setPublishableKey(o);break}break}n||("elements"!==e.stripe_payment&&"payment_element"!==e.stripe_payment||(null!=l&&p===l.getElement("card")&&p.destroy(),e.isStripePaymentHandlerInitiated(c)&&e.stripePaymentHandlers[c].destroy(),e.GFCCField.next(".validation_message").length||e.GFCCField.after('
'+gforms_stripe_frontend_strings.no_active_frontend_feed+"
"),wp.a11y.speak(gforms_stripe_frontend_strings.no_active_frontend_feed)),e.resetStripeStatus(e.form,c,e.isLastPage()),o=e.apiKey,e.activeFeed=null)}})),gform.addFilter("gform_product_total",(function(t,r){if("payment_element"==e.stripe_payment&&e.isStripePaymentHandlerInitiated(r)&&e.stripePaymentHandlers[r].getOrderData(t,r),!e.activeFeed)return window["gform_stripe_amount_"+r]=0,t;if("form_total"!==e.activeFeed.paymentAmount){const t=e.getProductFieldPrice(r,e.activeFeed.paymentAmount);if(window["gform_stripe_amount_"+r]=t.price*t.qty,e.activeFeed.hasOwnProperty("setupFee")){const t=e.getProductFieldPrice(r,e.activeFeed.setupFee);window["gform_stripe_amount_"+r]+=t.price*t.qty}}else window["gform_stripe_amount_"+r]=t;return"payment_element"==e.stripe_payment&&e.isStripePaymentHandlerInitiated(r)&&null!==e.stripePaymentHandlers[r].elements&&"1"===gforms_stripe_frontend_strings.stripe_connect_enabled&&e.stripePaymentHandlers[r].updatePaymentAmount(e.stripePaymentHandlers[r].order.paymentAmount),t}),51),this.stripe_payment){case"elements":var d=null,l=null,p=null;i("#gf_stripe_response").length&&(this.stripeResponse=JSON.parse(i("#gf_stripe_response").val()),this.stripeResponse.hasOwnProperty("client_secret")&&(this.hasPaymentIntent=!0))}if(i("#gform_"+this.formId).on("submit",(function(r){let s=!1;const a=parseInt(i("#gform_source_page_number_"+e.formId).val(),10),o=parseInt(i("#gform_target_page_number_"+e.formId).val(),10);if(a>o&&0!==o&&(s=!0),!(s||!n||i(this).data("gfstripesubmitting")||1==i("#gform_save_"+e.formId).val()||!e.isLastPage()&&"elements"!==e.stripe_payment||gformIsHidden(e.GFCCField)||e.maybeHitRateLimits()||e.invisibleCaptchaPending()||e.recaptchav3Pending()||"payment_element"===e.stripe_payment&&0===window["gform_stripe_amount_"+e.formId]))switch(r.preventDefault(),i(this).data("gfstripesubmitting",!0),e.maybeAddSpinner(),e.stripe_payment){case"payment_element":e.injectHoneypot(r),e.stripePaymentHandlers[e.formId].validate(r);break;case"elements":if(e.form=i(this),e.isLastPage()&&!e.isCreditCardOnPage()||gformIsHidden(e.GFCCField)||s)return void i(this).submit();"product"===t.type?e.createPaymentMethod(d,p):e.createToken(d,p);break;case"stripe.js":var l=i(this),c="input_"+e.formId+"_"+e.ccFieldId+"_",u={number:l.find("#"+c+"1").val(),exp_month:l.find("#"+c+"2_month").val(),exp_year:l.find("#"+c+"2_year").val(),cvc:l.find("#"+c+"3").val(),name:l.find("#"+c+"5").val()};e.form=l,Stripe.card.createToken(u,(function(t,r){e.responseHandler(t,r)}))}})),"payment_element_intent_failure"in e&&e.payment_element_intent_failure){const t=jQuery('

'+gforms_stripe_frontend_strings.payment_element_intent_failure+"

");jQuery("#gform_wrapper_"+e.formId).prepend(t)}}},this.getProductFieldPrice=function(e,t){var r=GFMergeTag.getMergeTagValue(e,t,":price"),i=GFMergeTag.getMergeTagValue(e,t,":qty");return"string"==typeof r&&(r=GFMergeTag.getMergeTagValue(e,t+".2",":price"),i=GFMergeTag.getMergeTagValue(e,t+".3",":qty")),{price:r,qty:i}},this.getBillingAddressMergeTag=function(e){return""===e?"":"{:"+e+":value}"},this.responseHandler=function(e,t){for(var r=this.form,n="input_"+this.formId+"_"+this.ccFieldId+"_",s=["1","2_month","2_year","3","5"],a=0;a').val(d.slice(-4))),r.append(i('').val(l))}}r.append(i('').val(i.toJSON(t))),r.submit()},this.elementsResponseHandler=function(e){var t=this.form,r=this,n=this.activeFeed,s=gform.applyFilters("gform_stripe_currency",this.currency,this.formId),a=0===gf_global.gf_currency_config.decimals?window["gform_stripe_amount_"+this.formId]:gformRoundPrice(100*window["gform_stripe_amount_"+this.formId]);if(e.error)return this.displayStripeCardError(e),void this.resetStripeStatus(t,this.formId,this.isLastPage());if(this.hasPaymentIntent)if("product"===n.type)e.hasOwnProperty("paymentMethod")?(i("#gf_stripe_credit_card_last_four").val(e.paymentMethod.card.last4),i("#stripe_credit_card_type").val(e.paymentMethod.card.brand),i.ajax({async:!1,url:gforms_stripe_frontend_strings.ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_update_payment_intent",nonce:gforms_stripe_frontend_strings.create_payment_intent_nonce,payment_intent:e.id,payment_method:e.paymentMethod,currency:s,amount:a,feed_id:n.feedId},success:function(e){e.success?(i("#gf_stripe_response").val(i.toJSON(e.data)),t.submit()):(e.error=e.data,delete e.data,r.displayStripeCardError(e),r.resetStripeStatus(t,r.formId,r.isLastPage()))}})):e.hasOwnProperty("amount")&&t.submit();else{var o=JSON.parse(i("#gf_stripe_response").val());o.updatedToken=e.token.id,i("#gf_stripe_response").val(i.toJSON(o)),t.append(i('').val(e.token.card.last4)),t.append(i('').val(e.token.card.brand)),t.submit()}else i("#gf_stripe_response").length?i("#gf_stripe_response").val(i.toJSON(e)):t.append(i('').val(i.toJSON(e))),"product"===n.type?(t.append(i('').val(e.paymentMethod.card.last4)),t.append(i('').val(e.paymentMethod.card.brand)),i.ajax({async:!1,url:gforms_stripe_frontend_strings.ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_create_payment_intent",nonce:gforms_stripe_frontend_strings.create_payment_intent_nonce,payment_method:e.paymentMethod,currency:s,amount:a,feed_id:n.feedId},success:function(e){e.success?(i("#gf_stripe_response").length?i("#gf_stripe_response").val(i.toJSON(e.data)):t.append(i('').val(i.toJSON(e.data))),t.submit()):(e.error=e.data,delete e.data,r.displayStripeCardError(e),r.resetStripeStatus(t,r.formId,r.isLastPage()))}})):(t.append(i('').val(e.token.card.last4)),t.append(i('').val(e.token.card.brand)),t.submit())},this.scaActionHandler=function(e,t){if(!i("#gform_"+t).data("gfstripescaauth")){i("#gform_"+t).data("gfstripescaauth",!0);var r=this,n=JSON.parse(i("#gf_stripe_response").val());"product"===this.activeFeed.type?e.retrievePaymentIntent(n.client_secret).then((function(s){"requires_action"===s.paymentIntent.status&&e.handleCardAction(n.client_secret).then((function(e){var n=JSON.parse(i("#gf_stripe_response").val());n.scaSuccess=!0,i("#gf_stripe_response").val(i.toJSON(n)),r.maybeAddSpinner(),jQuery("#gform_submit_button_"+t).prop("disabled",!1),i("#gform_"+t).data("gfstripescaauth",!1),i("#gform_"+t).data("gfstripesubmitting",!0).submit(),jQuery("#gform_submit_button_"+t).prop("disabled",!0)}))})):e.retrievePaymentIntent(n.client_secret).then((function(s){"requires_action"===s.paymentIntent.status&&e.handleCardPayment(n.client_secret).then((function(e){r.maybeAddSpinner(),jQuery("#gform_submit_button_"+t).prop("disabled",!1),i("#gform_"+t).data("gfstripescaauth",!1),i("#gform_"+t).data("gfstripesubmitting",!0).trigger("submit")}))}))}},this.isLastPage=function(){var e=i("#gform_target_page_number_"+this.formId);return!(e.length>0)||0==e.val()},this.isConversationalForm=function(){return i('[data-js="gform-conversational-form"]').length>0},this.isCreditCardOnPage=function(){var e=this.getCurrentPageNumber();return!(this.ccPage&&e&&!this.isConversationalForm())||this.ccPage==e},this.getCurrentPageNumber=function(){var e=i("#gform_source_page_number_"+this.formId);return e.length>0&&e.val()},this.maybeAddSpinner=function(){if(!this.isAjax)if("function"==typeof gformAddSpinner)gformAddSpinner(this.formId);else{var e=this.formId;if(0==jQuery("#gform_ajax_spinner_"+e).length){var t=gform.applyFilters("gform_spinner_url",gf_global.spinnerUrl,e);gform.applyFilters("gform_spinner_target_elem",jQuery("#gform_submit_button_"+e+", #gform_wrapper_"+e+" .gform_next_button, #gform_send_resume_link_button_"+e),e).after('')}}},this.resetStripeStatus=function(e,t,r){i("#gf_stripe_response, #gf_stripe_credit_card_last_four, #stripe_credit_card_type").remove(),e.data("gfstripesubmitting",!1),document.querySelectorAll("#gform_ajax_spinner_"+t).forEach((function(e){e.remove()})),r&&(window["gf_submitting_"+t]=!1)},this.displayStripeCardError=function(e){e.error&&!this.GFCCField.next(".validation_message").length&&this.GFCCField.after('
');var t=this.GFCCField.next(".validation_message");e.error?(t.html(e.error.message),wp.a11y.speak(e.error.message,"assertive"),i("#gform_ajax_spinner_"+this.formId).length>0&&i("#gform_ajax_spinner_"+this.formId).remove()):t.remove()},this.createToken=function(e,t){const r=this,n=this.activeFeed,s={name:i("#input_"+r.formId+"_"+r.ccFieldId+"_5").val(),address_line1:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_line1)),address_line2:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_line2)),address_city:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_city)),address_state:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_state)),address_zip:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_zip)),address_country:GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(n.address_country)),currency:gform.applyFilters("gform_stripe_currency",this.currency,this.formId)};e.createToken(t,s).then((function(e){r.elementsResponseHandler(e)}))},this.createPaymentMethod=function(e,t,r){var n=this,s=this.activeFeed,a="";if(""!==s.address_country&&(a=GFMergeTag.replaceMergeTags(n.formId,n.getBillingAddressMergeTag(s.address_country))),""===a||void 0!==r&&""!==r){var o=i("#input_"+this.formId+"_"+this.ccFieldId+"_5").val(),d=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_line1)),l=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_line2)),p=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_city)),c=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_state)),u=GFMergeTag.replaceMergeTags(this.formId,this.getBillingAddressMergeTag(s.address_zip)),f={billing_details:{name:null,address:{}}};""!==o&&(f.billing_details.name=o),""!==d&&(f.billing_details.address.line1=d),""!==l&&(f.billing_details.address.line2=l),""!==p&&(f.billing_details.address.city=p),""!==c&&(f.billing_details.address.state=c),""!==u&&(f.billing_details.address.postal_code=u),""!==r&&(f.billing_details.address.country=r),null===f.billing_details.name&&delete f.billing_details.name,f.billing_details.address==={}&&delete f.billing_details.address,e.createPaymentMethod("card",t,f).then((function(e){null!==n.stripeResponse&&(e.id=n.stripeResponse.id,e.client_secret=n.stripeResponse.client_secret),n.elementsResponseHandler(e)}))}else i.ajax({async:!1,url:gforms_stripe_frontend_strings.ajaxurl,dataType:"json",method:"POST",data:{action:"gfstripe_get_country_code",nonce:gforms_stripe_frontend_strings.create_payment_intent_nonce,country:a,feed_id:s.feedId},success:function(r){r.success&&n.createPaymentMethod(e,t,r.data.code)}})},this.maybeHitRateLimits=function(){return!!(this.hasOwnProperty("cardErrorCount")&&this.cardErrorCount>=5)},this.invisibleCaptchaPending=function(){var e=this.form.find(".ginput_recaptcha");if(!e.length||"invisible"!==e.data("size"))return!1;var t=e.find(".g-recaptcha-response");return!(t.length&&t.val())},this.recaptchav3Pending=function(){const e=this.form.find(".ginput_recaptchav3");if(!e.length)return!1;const t=e.find(".gfield_recaptcha_response");return!(t&&t.val())},this.injectHoneypot=e=>{const t=e.target;if((this.isFormSubmission(t)||this.isSaveContinue(t))&&!this.isHeadlessBrowser()){const e=``;t.insertAdjacentHTML("beforeend",e)}},this.isSaveContinue=e=>{const t=e.dataset.formid,r=this.getNodes("#gform_save_"+t,!0,e,!0);return r.length>0&&"1"===r[0].value},this.isFormSubmission=e=>{const t=e.dataset.formid,r=this.getNodes(`input[name = "gform_target_page_number_${t}"]`,!0,e,!0)[0];return void 0!==r&&0===parseInt(r.value)},this.isHeadlessBrowser=()=>window._phantom||window.callPhantom||window.__phantomas||window.Buffer||window.emit||window.spawn||window.webdriver||window._selenium||window._Selenium_IDE_Recorder||window.callSelenium||window.__nightmare||window.domAutomation||window.domAutomationController||window.document.__webdriver_evaluate||window.document.__selenium_evaluate||window.document.__webdriver_script_function||window.document.__webdriver_script_func||window.document.__webdriver_script_fn||window.document.__fxdriver_evaluate||window.document.__driver_unwrapped||window.document.__webdriver_unwrapped||window.document.__driver_evaluate||window.document.__selenium_unwrapped||window.document.__fxdriver_unwrapped||window.document.documentElement.getAttribute("selenium")||window.document.documentElement.getAttribute("webdriver")||window.document.documentElement.getAttribute("driver"),this.getNodes=(e="",t=!1,r=document,i=!1)=>{const n=i?e:`[data-js="${e}"]`;let s=r.querySelectorAll(n);return t&&(s=this.convertElements(s)),s},this.convertElements=(e=[])=>{const t=[];let r=e.length;for(;r--;t.unshift(e[r]));return t},this.isStripePaymentHandlerInitiated=function(e){return e in this.stripePaymentHandlers&&null!==this.stripePaymentHandlers[e]&&void 0!==this.stripePaymentHandlers[e]},this.init()}}]); \ No newline at end of file diff --git a/js/payment_element_form_editor.js b/js/payment_element_form_editor.js index adfb20a..8a684c8 100644 --- a/js/payment_element_form_editor.js +++ b/js/payment_element_form_editor.js @@ -331,6 +331,37 @@ jQuery(document).on('gform_field_added', function (event, form, field) { } }); +/***/ }), + +/***/ "./node_modules/webpack/buildin/global.js": +/*!***********************************!*\ + !*** (webpack)/buildin/global.js ***! + \***********************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +var g; + +// This works in non-strict mode +g = (function() { + return this; +})(); + +try { + // This works if eval is allowed (see CSP) + g = g || new Function("return this")(); +} catch (e) { + // This works if the window reference is available + if (typeof window === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + + /***/ }), /***/ "./node_modules/whatwg-fetch/fetch.js": @@ -342,22 +373,25 @@ jQuery(document).on('gform_field_added', function (event, form, field) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Headers", function() { return Headers; }); +/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Headers", function() { return Headers; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Request", function() { return Request; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "Response", function() { return Response; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMException", function() { return DOMException; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "fetch", function() { return fetch; }); -var global = +/* eslint-disable no-prototype-builtins */ +var g = (typeof globalThis !== 'undefined' && globalThis) || (typeof self !== 'undefined' && self) || - (typeof global !== 'undefined' && global) + // eslint-disable-next-line no-undef + (typeof global !== 'undefined' && global) || + {} var support = { - searchParams: 'URLSearchParams' in global, - iterable: 'Symbol' in global && 'iterator' in Symbol, + searchParams: 'URLSearchParams' in g, + iterable: 'Symbol' in g && 'iterator' in Symbol, blob: - 'FileReader' in global && - 'Blob' in global && + 'FileReader' in g && + 'Blob' in g && (function() { try { new Blob() @@ -366,8 +400,8 @@ var support = { return false } })(), - formData: 'FormData' in global, - arrayBuffer: 'ArrayBuffer' in global + formData: 'FormData' in g, + arrayBuffer: 'ArrayBuffer' in g } function isDataView(obj) { @@ -438,6 +472,9 @@ function Headers(headers) { }, this) } else if (Array.isArray(headers)) { headers.forEach(function(header) { + if (header.length != 2) { + throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length) + } this.append(header[0], header[1]) }, this) } else if (headers) { @@ -508,6 +545,7 @@ if (support.iterable) { } function consumed(body) { + if (body._noBody) return if (body.bodyUsed) { return Promise.reject(new TypeError('Already read')) } @@ -535,7 +573,9 @@ function readBlobAsArrayBuffer(blob) { function readBlobAsText(blob) { var reader = new FileReader() var promise = fileReaderReady(reader) - reader.readAsText(blob) + var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type) + var encoding = match ? match[1] : 'utf-8' + reader.readAsText(blob, encoding) return promise } @@ -573,9 +613,11 @@ function Body() { semantic of setting Request.bodyUsed in the constructor before _initBody is called. */ + // eslint-disable-next-line no-self-assign this.bodyUsed = this.bodyUsed this._bodyInit = body if (!body) { + this._noBody = true; this._bodyText = '' } else if (typeof body === 'string') { this._bodyText = body @@ -623,26 +665,27 @@ function Body() { return Promise.resolve(new Blob([this._bodyText])) } } + } - this.arrayBuffer = function() { - if (this._bodyArrayBuffer) { - var isConsumed = consumed(this) - if (isConsumed) { - return isConsumed - } - if (ArrayBuffer.isView(this._bodyArrayBuffer)) { - return Promise.resolve( - this._bodyArrayBuffer.buffer.slice( - this._bodyArrayBuffer.byteOffset, - this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength - ) + this.arrayBuffer = function() { + if (this._bodyArrayBuffer) { + var isConsumed = consumed(this) + if (isConsumed) { + return isConsumed + } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) { + return Promise.resolve( + this._bodyArrayBuffer.buffer.slice( + this._bodyArrayBuffer.byteOffset, + this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength ) - } else { - return Promise.resolve(this._bodyArrayBuffer) - } + ) } else { - return this.blob().then(readBlobAsArrayBuffer) + return Promise.resolve(this._bodyArrayBuffer) } + } else if (support.blob) { + return this.blob().then(readBlobAsArrayBuffer) + } else { + throw new Error('could not read as ArrayBuffer') } } @@ -677,7 +720,7 @@ function Body() { } // HTTP methods whose capitalization should be normalized -var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'] +var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'] function normalizeMethod(method) { var upcased = method.toUpperCase() @@ -718,7 +761,12 @@ function Request(input, options) { } this.method = normalizeMethod(options.method || this.method || 'GET') this.mode = options.mode || this.mode || null - this.signal = options.signal || this.signal + this.signal = options.signal || this.signal || (function () { + if ('AbortController' in g) { + var ctrl = new AbortController(); + return ctrl.signal; + } + }()); this.referrer = null if ((this.method === 'GET' || this.method === 'HEAD') && body) { @@ -780,7 +828,11 @@ function parseHeaders(rawHeaders) { var key = parts.shift().trim() if (key) { var value = parts.join(':').trim() - headers.append(key, value) + try { + headers.append(key, value) + } catch (error) { + console.warn('Response ' + error.message) + } } }) return headers @@ -798,6 +850,9 @@ function Response(bodyInit, options) { this.type = 'default' this.status = options.status === undefined ? 200 : options.status + if (this.status < 200 || this.status > 599) { + throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].") + } this.ok = this.status >= 200 && this.status < 300 this.statusText = options.statusText === undefined ? '' : '' + options.statusText this.headers = new Headers(options.headers) @@ -817,7 +872,9 @@ Response.prototype.clone = function() { } Response.error = function() { - var response = new Response(null, {status: 0, statusText: ''}) + var response = new Response(null, {status: 200, statusText: ''}) + response.ok = false + response.status = 0 response.type = 'error' return response } @@ -832,7 +889,7 @@ Response.redirect = function(url, status) { return new Response(null, {status: status, headers: {location: url}}) } -var DOMException = global.DOMException +var DOMException = g.DOMException try { new DOMException() } catch (err) { @@ -862,10 +919,16 @@ function fetch(input, init) { xhr.onload = function() { var options = { - status: xhr.status, statusText: xhr.statusText, headers: parseHeaders(xhr.getAllResponseHeaders() || '') } + // This check if specifically for when a user fetches a file locally from the file system + // Only if the status is out of a normal range + if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) { + options.status = 200; + } else { + options.status = xhr.status; + } options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL') var body = 'response' in xhr ? xhr.response : xhr.responseText setTimeout(function() { @@ -881,7 +944,7 @@ function fetch(input, init) { xhr.ontimeout = function() { setTimeout(function() { - reject(new TypeError('Network request failed')) + reject(new TypeError('Network request timed out')) }, 0) } @@ -893,7 +956,7 @@ function fetch(input, init) { function fixUrl(url) { try { - return url === '' && global.location.href ? global.location.href : url + return url === '' && g.location.href ? g.location.href : url } catch (e) { return url } @@ -911,18 +974,23 @@ function fetch(input, init) { if (support.blob) { xhr.responseType = 'blob' } else if ( - support.arrayBuffer && - request.headers.get('Content-Type') && - request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1 + support.arrayBuffer ) { xhr.responseType = 'arraybuffer' } } - if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) { + if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) { + var names = []; Object.getOwnPropertyNames(init.headers).forEach(function(name) { + names.push(normalizeName(name)) xhr.setRequestHeader(name, normalizeValue(init.headers[name])) }) + request.headers.forEach(function(value, name) { + if (names.indexOf(name) === -1) { + xhr.setRequestHeader(name, value) + } + }) } else { request.headers.forEach(function(value, name) { xhr.setRequestHeader(name, value) @@ -946,13 +1014,14 @@ function fetch(input, init) { fetch.polyfill = true -if (!global.fetch) { - global.fetch = fetch - global.Headers = Headers - global.Request = Request - global.Response = Response +if (!g.fetch) { + g.fetch = fetch + g.Headers = Headers + g.Request = Request + g.Response = Response } +/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) /***/ }), diff --git a/js/payment_element_form_editor.js.map b/js/payment_element_form_editor.js.map index 058742b..5ff92e8 100644 --- a/js/payment_element_form_editor.js.map +++ b/js/payment_element_form_editor.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/src/payment-element/form_editor.js","webpack:///./node_modules/whatwg-fetch/fetch.js"],"names":["mountCard","jQuery","length","gform_stripe_payment_element_form_editor_strings","stripe_connect_enabled","stripe","Stripe","api_key","text","payment_element_error","elements","amount","currency","payment_element_currency","mode","payment_method_types","card","create","mount","prepend","showHideElement","enabled","form","fields","forEach","field","type","enableMultiplePaymentMethods","$elementContainer","$cardContainer","elementContainerStyle","cardContainerStyle","$linkEmailField","hide","show","get","style","display","showHideFieldSettings","allSettings","getAllFieldSettings","GetSelectedField","filterSubLabelsSettingClasses","settingsArray","paymentElementEnabled","is","splice","indexOf","push","validateFieldPosition","error","has_product","has_option","lastPageFieldIndex","findLastIndex","stripeFieldIndex","findIndex","field_position_validation_error","afterRefreshField","fieldId","id","bindEvents","gform","addAction","addFilter","document","bind","event","is_payment_element_supported","payment_element_supported","addClass","prop","setFieldError","payment_element_disabled_message","linkEmailSelect","utils","getNode","linkEmailSelectedId","value","optionNodes","getNodes","option","remove","index","createElement","setAttribute","textContent","label","email_field_id_text","appendChild","val","linkEmailFieldId","on","e","paymentElementFormEditorHandler","ready"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC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ACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,qDAAqD;AACrD,OAAO;AACP;AACA,OAAO;AACP,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,qBAAqB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,qCAAqC,0BAA0B;AAC/D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,6BAA6B,0BAA0B,eAAe;AACtE;;AAEO;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"./js/payment_element_form_editor.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","\n/**\n * Mounts the card element into the container.\n *\n * @since 5.0\n */\nconst mountCard = () => {\n\tif ( jQuery( '.stripe-payment-element-container' ).length <= 0 || gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled !== \"1\" ) {\n\t\treturn;\n\t}\n\tconst stripe = Stripe( gform_stripe_payment_element_form_editor_strings.api_key );\n\n\tif ( ! stripe) {\n\t\tjQuery( '.stripe-payment-element-container' ).text( gform_stripe_payment_element_form_editor_strings.payment_element_error );\n\t} else {\n\t\tconst elements = stripe.elements( {\n\t\t\tamount:100,\n\t\t\tcurrency: gform_stripe_payment_element_form_editor_strings.payment_element_currency,\n\t\t\tmode:\"payment\",\n\t\t\tpayment_method_types: ['card'],\n\t\t} );\n\n\t\tconst card = elements.create( 'payment', { 'readOnly': true } );\n\t\tcard.mount( '.stripe-payment-element-container' );\n\t\t//Prevents users from interacting with the Stripe Field in the form editor\n\t\tjQuery( '.stripe-payment-element-container' ).prepend( '
' );\n\n\n\t}\n}\n\n/**\n * Shows or hides the payment element.\n *\n * @since 4.3\n *\n * @param enabled Whether the element should be shown or hidden.\n */\nconst showHideElement = ( enabled = null ) => {\n\n\tif( enabled === null && gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled === \"1\" ) {\n\t\tenabled = false;\n\t\tform.fields.forEach( ( field ) => {\n\t\t\tif( field.type === 'stripe_creditcard' ) {\n\t\t\t\tenabled = field.enableMultiplePaymentMethods;\n\t\t\t}\n\t\t} )\n\t}\n\n\tconst $elementContainer = jQuery( '.stripe-payment-element-container' );\n\tconst $cardContainer = jQuery( '.ginput_stripe_creditcard' );\n\tconst elementContainerStyle = enabled ? 'block' : 'none';\n\tconst cardContainerStyle = enabled ? 'none' : 'block';\n\tconst $linkEmailField = jQuery( '#link_email_field_container' );\n\n\tif ( ! enabled ) {\n\t\t$linkEmailField.hide();\n\t} else {\n\t\t$linkEmailField.show();\n\t}\n\n\tif ( $elementContainer.length ) {\n\t\t$elementContainer.get(0).style.display = elementContainerStyle;\n\t}\n\tif ( $cardContainer.length ) {\n\t\t$cardContainer.get(0).style.display = cardContainerStyle;\n\t}\n}\n\n/**\n * Shows or hides the sub labels and input placeholders setting as it is not needed for the payment element when its setting is on.\n *\n * Can not call this inside showHideElement because it messes up the other field while the editor is still loading, and showHideElement is called on load.\n *\n * since 4.3\n */\nconst showHideFieldSettings = () => {\n\tjQuery( '.field_setting' ).hide();\n\tlet allSettings = getAllFieldSettings( GetSelectedField() );\n\tjQuery( allSettings ).show();\n}\n\n/**\n * Hooks to the field settings filter to remove the sub label classes and input placeholder classes if needed.\n *\n * @since 4.3\n *\n * @param {Array} settingsArray The field settings classes.\n * @param {Object} field The field object.\n *\n * @return {Array}\n */\nconst filterSubLabelsSettingClasses = ( settingsArray, field ) => {\n\tif ( field.type !== 'stripe_creditcard' ) {\n\t\treturn settingsArray;\n\t}\n\tconst paymentElementEnabled = jQuery( '#field_enable_multiple_payment_methods' ).is(':checked');\n\tif ( paymentElementEnabled ) {\n\t\tsettingsArray.splice( settingsArray.indexOf( '.sub_label_placement_setting' ), 1 );\n\t\tsettingsArray.splice( settingsArray.indexOf( '.sub_labels_setting' ), 1 );\n\t\tsettingsArray.splice( settingsArray.indexOf( '.input_placeholders_setting' ), 1 );\n\t} else {\n\t\tsettingsArray.push( '.sub_labels_setting', '.sub_label_placement_setting', '.input_placeholders_setting' );\n\t}\n\n\treturn settingsArray;\n}\n\n/**\n * Hooks to the form validation filter and validates that the field is in the last page of a multi-page form.\n *\n * @since 4.3\n *\n * @param {String} error The error message provided by the filter that will be returned.\n * @param {Object} form The form object.\n * @param {Boolean} has_product Whether the form has a product or not.\n * @param {Boolean} has_option Whether the form has an option field or not.\n *\n * @return {String}\n */\nconst validateFieldPosition = ( error, form, has_product, has_option ) => {\n\t\tconst lastPageFieldIndex = form.fields.findLastIndex( ( field ) => field.type === 'page' );\n\t\tconst stripeFieldIndex = form.fields.findIndex( ( field ) => field.type === 'stripe_creditcard' && field.enableMultiplePaymentMethods === true );\n\t\tif ( lastPageFieldIndex === -1 || stripeFieldIndex === -1 ) {\n\t\t\treturn error;\n\t\t}\n\n\t\tif ( stripeFieldIndex < lastPageFieldIndex ) {\n\t\t\terror = gform_stripe_payment_element_form_editor_strings.field_position_validation_error;\n\t\t}\n\n\t\treturn error;\n}\n\nconst afterRefreshField = ( fieldId ) => {\n\tconst stripeFieldIndex = form.fields.findIndex( ( field ) => field.type === 'stripe_creditcard' && field.enableMultiplePaymentMethods === true );\n\tif( stripeFieldIndex < 0 || form.fields[stripeFieldIndex].id != fieldId ) {\n\t\treturn;\n\t}\n\n\tshowHideElement();\n\tmountCard();\n}\n\n/**\n * Binds the functionalities needed to their corresponding events.\n *\n * @since 4.3\n */\nconst bindEvents = () => {\n\n\tgform.addAction( 'gform_after_refresh_field_preview', afterRefreshField );\n\n\tgform.addFilter( 'gform_editor_field_settings', filterSubLabelsSettingClasses );\n\tgform.addFilter( 'gform_validation_error_form_editor', validateFieldPosition );\n\n\tjQuery( document ).bind( 'gform_load_field_settings', function( event, field, form ) {\n\n\t\tif ( field.type !== 'stripe_creditcard' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst is_payment_element_supported = gform_stripe_payment_element_form_editor_strings.payment_element_supported === \"1\";\n\n\t\tif ( gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled !== \"1\" || ! is_payment_element_supported ) {\n\t\t\t// Adding disabled class to container.\n\t\t\tjQuery( '.enable_multiple_payment_methods_setting' ).addClass( 'gform-stripe--disabled' );\n\n\t\t\t// Disabling the checkbox.\n\t\t\tjQuery( '#field_enable_multiple_payment_methods' ).prop( 'disabled', true ).prop( 'checked', false );\n\t\t\tjQuery( '#link_email_field' ).prop( 'disabled', true );\n\t\t}\n\n\t\tif ( ! is_payment_element_supported ) {\n\t\t\t// Show the error message.\n\t\t\tsetFieldError( 'enable_multiple_payment_methods_setting', 'below', gform_stripe_payment_element_form_editor_strings.payment_element_disabled_message );\n\t\t}\n\n\t\tconst linkEmailSelect = gform.utils.getNode( '#link_email_field', document, true );\n\t\tconst linkEmailSelectedId = linkEmailSelect.value;\n\t\tconst optionNodes = gform.utils.getNodes( 'gform-stripe-link-email-ids' );\n\t\toptionNodes.forEach( ( option ) => { option.remove() } );\n\t\tform.fields.forEach( ( field, index ) => {\n\t\t\tif ( field.type === 'email' ) {\n\t\t\t\tconst option = document.createElement('option');\n\t\t\t\toption.value = field.id;\n\t\t\t\toption.setAttribute( 'data-js', 'gform-stripe-link-email-ids' );\n\t\t\t\toption.textContent = `${field.label} - ${gform_stripe_payment_element_form_editor_strings.email_field_id_text}: ${field.id}`;\n\t\t\t\tlinkEmailSelect.appendChild( option );\n\t\t\t}\n\t\t});\n\n\t\tlinkEmailSelect.value = linkEmailSelectedId;\n\n\t\tjQuery('#field_enable_multiple_payment_methods').prop( 'checked', field.enableMultiplePaymentMethods ? true : false );\n\t\tjQuery('#link_email_field').val( `linkEmailFieldId` in field ? field.linkEmailFieldId : 0 );\n\t\tshowHideFieldSettings();\n\t});\n\n\tjQuery( '#field_enable_multiple_payment_methods' ).on( 'change', function ( e ) {\n\t\tshowHideElement( jQuery( this ).is( ':checked' ) );\n\t\tshowHideFieldSettings();\n\t});\n\n\tjQuery( '#link_email_field' ).on( 'change', function ( e ) {\n\t\tconst field = GetSelectedField();\n\t\tfield.linkEmailFieldId = jQuery( this ).val();\n\t});\n\n}\n\n/**\n * Handles the form editor UI logic for the payment element.\n *\n * @since 4.3\n */\nconst paymentElementFormEditorHandler = () => {\n\n\tbindEvents();\n\tshowHideElement();\n\tmountCard();\n}\n\n/**\n * Launches UI handler on page ready.\n */\njQuery( document ).ready( function () {\n\tpaymentElementFormEditorHandler();\n})\n\n/**\n * Reset the UI after adding a new field.\n */\njQuery( document ).on( 'gform_field_added', function( event, form, field ) {\n\tif ( field.type === 'stripe_creditcard' ) {\n\t\tshowHideElement();\n\t\tmountCard();\n\t}\n});\n","var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global)\n\nvar support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsText(blob)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n headers.append(key, value)\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 0, statusText: ''})\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = global.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!global.fetch) {\n global.fetch = fetch\n global.Headers = Headers\n global.Request = Request\n global.Response = Response\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./js/src/payment-element/form_editor.js","webpack:///(webpack)/buildin/global.js","webpack:///./node_modules/whatwg-fetch/fetch.js"],"names":["mountCard","jQuery","length","gform_stripe_payment_element_form_editor_strings","stripe_connect_enabled","stripe","Stripe","api_key","text","payment_element_error","elements","amount","currency","payment_element_currency","mode","payment_method_types","card","create","mount","prepend","showHideElement","enabled","form","fields","forEach","field","type","enableMultiplePaymentMethods","$elementContainer","$cardContainer","elementContainerStyle","cardContainerStyle","$linkEmailField","hide","show","get","style","display","showHideFieldSettings","allSettings","getAllFieldSettings","GetSelectedField","filterSubLabelsSettingClasses","settingsArray","paymentElementEnabled","is","splice","indexOf","push","validateFieldPosition","error","has_product","has_option","lastPageFieldIndex","findLastIndex","stripeFieldIndex","findIndex","field_position_validation_error","afterRefreshField","fieldId","id","bindEvents","gform","addAction","addFilter","document","bind","event","is_payment_element_supported","payment_element_supported","addClass","prop","setFieldError","payment_element_disabled_message","linkEmailSelect","utils","getNode","linkEmailSelectedId","value","optionNodes","getNodes","option","remove","index","createElement","setAttribute","textContent","label","email_field_id_text","appendChild","val","linkEmailFieldId","on","e","paymentElementFormEditorHandler","ready"],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;ACjFA;;;;;AAKA,MAAMA,YAAY,MAAM;AACvB,KAAKC,OAAQ,mCAAR,EAA8CC,MAA9C,IAAwD,CAAxD,IAA6DC,iDAAiDC,sBAAjD,KAA4E,GAA9I,EAAoJ;AACnJ;AACA;AACD,OAAMC,SAASC,OAAQH,iDAAiDI,OAAzD,CAAf;;AAEA,KAAK,CAAEF,MAAP,EAAe;AACdJ,SAAQ,mCAAR,EAA8CO,IAA9C,CAAoDL,iDAAiDM,qBAArG;AACA,EAFD,MAEO;AACN,QAAMC,WAAWL,OAAOK,QAAP,CAAiB;AACjCC,WAAO,GAD0B;AAEjCC,aAAUT,iDAAiD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AR,EAA8B2F,EAA9B,CAAkC,QAAlC,EAA4C,UAAWC,CAAX,EAAe;AAC1D,QAAMpE,QAAQgB,kBAAd;AACAhB,QAAMkE,gBAAN,GAAyB1F,OAAQ,IAAR,EAAeyF,GAAf,EAAzB;AACA,EAHD;AAKA,CA3DD;;AA6DA;;;;;AAKA,MAAMI,kCAAkC,MAAM;;AAE7CjC;AACAzC;AACApB;AACA,CALD;;AAOA;;;AAGAC,OAAQgE,QAAR,EAAmB8B,KAAnB,CAA0B,YAAY;AACrCD;AACA,CAFD;;AAIA;;;AAGA7F,OAAQgE,QAAR,EAAmB2B,EAAnB,CAAuB,mBAAvB,EAA6C,UAAUzB,KAAV,EAAiB7C,IAAjB,EAAuBG,KAAvB,EAA+B;AAC3E,KAAKA,MAAMC,IAAN,KAAe,mBAApB,EAA0C;AACzCN;AACApB;AACA;AACD,CALD,E;;;;;;;;;;;ACxOA;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;;ACnBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO;AACP;;AAEA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,qDAAqD;AACrD,OAAO;AACP;AACA,OAAO;AACP,4EAA4E;AAC5E;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,4BAA4B,qBAAqB;AACjD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEO;AACP;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,6BAA6B,0BAA0B,eAAe;AACtE;;AAEO;AACP;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA","file":"./js/payment_element_form_editor.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 1);\n","\n/**\n * Mounts the card element into the container.\n *\n * @since 5.0\n */\nconst mountCard = () => {\n\tif ( jQuery( '.stripe-payment-element-container' ).length <= 0 || gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled !== \"1\" ) {\n\t\treturn;\n\t}\n\tconst stripe = Stripe( gform_stripe_payment_element_form_editor_strings.api_key );\n\n\tif ( ! stripe) {\n\t\tjQuery( '.stripe-payment-element-container' ).text( gform_stripe_payment_element_form_editor_strings.payment_element_error );\n\t} else {\n\t\tconst elements = stripe.elements( {\n\t\t\tamount:100,\n\t\t\tcurrency: gform_stripe_payment_element_form_editor_strings.payment_element_currency,\n\t\t\tmode:\"payment\",\n\t\t\tpayment_method_types: ['card'],\n\t\t} );\n\n\t\tconst card = elements.create( 'payment', { 'readOnly': true } );\n\t\tcard.mount( '.stripe-payment-element-container' );\n\t\t//Prevents users from interacting with the Stripe Field in the form editor\n\t\tjQuery( '.stripe-payment-element-container' ).prepend( '
' );\n\n\n\t}\n}\n\n/**\n * Shows or hides the payment element.\n *\n * @since 4.3\n *\n * @param enabled Whether the element should be shown or hidden.\n */\nconst showHideElement = ( enabled = null ) => {\n\n\tif( enabled === null && gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled === \"1\" ) {\n\t\tenabled = false;\n\t\tform.fields.forEach( ( field ) => {\n\t\t\tif( field.type === 'stripe_creditcard' ) {\n\t\t\t\tenabled = field.enableMultiplePaymentMethods;\n\t\t\t}\n\t\t} )\n\t}\n\n\tconst $elementContainer = jQuery( '.stripe-payment-element-container' );\n\tconst $cardContainer = jQuery( '.ginput_stripe_creditcard' );\n\tconst elementContainerStyle = enabled ? 'block' : 'none';\n\tconst cardContainerStyle = enabled ? 'none' : 'block';\n\tconst $linkEmailField = jQuery( '#link_email_field_container' );\n\n\tif ( ! enabled ) {\n\t\t$linkEmailField.hide();\n\t} else {\n\t\t$linkEmailField.show();\n\t}\n\n\tif ( $elementContainer.length ) {\n\t\t$elementContainer.get(0).style.display = elementContainerStyle;\n\t}\n\tif ( $cardContainer.length ) {\n\t\t$cardContainer.get(0).style.display = cardContainerStyle;\n\t}\n}\n\n/**\n * Shows or hides the sub labels and input placeholders setting as it is not needed for the payment element when its setting is on.\n *\n * Can not call this inside showHideElement because it messes up the other field while the editor is still loading, and showHideElement is called on load.\n *\n * since 4.3\n */\nconst showHideFieldSettings = () => {\n\tjQuery( '.field_setting' ).hide();\n\tlet allSettings = getAllFieldSettings( GetSelectedField() );\n\tjQuery( allSettings ).show();\n}\n\n/**\n * Hooks to the field settings filter to remove the sub label classes and input placeholder classes if needed.\n *\n * @since 4.3\n *\n * @param {Array} settingsArray The field settings classes.\n * @param {Object} field The field object.\n *\n * @return {Array}\n */\nconst filterSubLabelsSettingClasses = ( settingsArray, field ) => {\n\tif ( field.type !== 'stripe_creditcard' ) {\n\t\treturn settingsArray;\n\t}\n\tconst paymentElementEnabled = jQuery( '#field_enable_multiple_payment_methods' ).is(':checked');\n\tif ( paymentElementEnabled ) {\n\t\tsettingsArray.splice( settingsArray.indexOf( '.sub_label_placement_setting' ), 1 );\n\t\tsettingsArray.splice( settingsArray.indexOf( '.sub_labels_setting' ), 1 );\n\t\tsettingsArray.splice( settingsArray.indexOf( '.input_placeholders_setting' ), 1 );\n\t} else {\n\t\tsettingsArray.push( '.sub_labels_setting', '.sub_label_placement_setting', '.input_placeholders_setting' );\n\t}\n\n\treturn settingsArray;\n}\n\n/**\n * Hooks to the form validation filter and validates that the field is in the last page of a multi-page form.\n *\n * @since 4.3\n *\n * @param {String} error The error message provided by the filter that will be returned.\n * @param {Object} form The form object.\n * @param {Boolean} has_product Whether the form has a product or not.\n * @param {Boolean} has_option Whether the form has an option field or not.\n *\n * @return {String}\n */\nconst validateFieldPosition = ( error, form, has_product, has_option ) => {\n\t\tconst lastPageFieldIndex = form.fields.findLastIndex( ( field ) => field.type === 'page' );\n\t\tconst stripeFieldIndex = form.fields.findIndex( ( field ) => field.type === 'stripe_creditcard' && field.enableMultiplePaymentMethods === true );\n\t\tif ( lastPageFieldIndex === -1 || stripeFieldIndex === -1 ) {\n\t\t\treturn error;\n\t\t}\n\n\t\tif ( stripeFieldIndex < lastPageFieldIndex ) {\n\t\t\terror = gform_stripe_payment_element_form_editor_strings.field_position_validation_error;\n\t\t}\n\n\t\treturn error;\n}\n\nconst afterRefreshField = ( fieldId ) => {\n\tconst stripeFieldIndex = form.fields.findIndex( ( field ) => field.type === 'stripe_creditcard' && field.enableMultiplePaymentMethods === true );\n\tif( stripeFieldIndex < 0 || form.fields[stripeFieldIndex].id != fieldId ) {\n\t\treturn;\n\t}\n\n\tshowHideElement();\n\tmountCard();\n}\n\n/**\n * Binds the functionalities needed to their corresponding events.\n *\n * @since 4.3\n */\nconst bindEvents = () => {\n\n\tgform.addAction( 'gform_after_refresh_field_preview', afterRefreshField );\n\n\tgform.addFilter( 'gform_editor_field_settings', filterSubLabelsSettingClasses );\n\tgform.addFilter( 'gform_validation_error_form_editor', validateFieldPosition );\n\n\tjQuery( document ).bind( 'gform_load_field_settings', function( event, field, form ) {\n\n\t\tif ( field.type !== 'stripe_creditcard' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst is_payment_element_supported = gform_stripe_payment_element_form_editor_strings.payment_element_supported === \"1\";\n\n\t\tif ( gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled !== \"1\" || ! is_payment_element_supported ) {\n\t\t\t// Adding disabled class to container.\n\t\t\tjQuery( '.enable_multiple_payment_methods_setting' ).addClass( 'gform-stripe--disabled' );\n\n\t\t\t// Disabling the checkbox.\n\t\t\tjQuery( '#field_enable_multiple_payment_methods' ).prop( 'disabled', true ).prop( 'checked', false );\n\t\t\tjQuery( '#link_email_field' ).prop( 'disabled', true );\n\t\t}\n\n\t\tif ( ! is_payment_element_supported ) {\n\t\t\t// Show the error message.\n\t\t\tsetFieldError( 'enable_multiple_payment_methods_setting', 'below', gform_stripe_payment_element_form_editor_strings.payment_element_disabled_message );\n\t\t}\n\n\t\tconst linkEmailSelect = gform.utils.getNode( '#link_email_field', document, true );\n\t\tconst linkEmailSelectedId = linkEmailSelect.value;\n\t\tconst optionNodes = gform.utils.getNodes( 'gform-stripe-link-email-ids' );\n\t\toptionNodes.forEach( ( option ) => { option.remove() } );\n\t\tform.fields.forEach( ( field, index ) => {\n\t\t\tif ( field.type === 'email' ) {\n\t\t\t\tconst option = document.createElement('option');\n\t\t\t\toption.value = field.id;\n\t\t\t\toption.setAttribute( 'data-js', 'gform-stripe-link-email-ids' );\n\t\t\t\toption.textContent = `${field.label} - ${gform_stripe_payment_element_form_editor_strings.email_field_id_text}: ${field.id}`;\n\t\t\t\tlinkEmailSelect.appendChild( option );\n\t\t\t}\n\t\t});\n\n\t\tlinkEmailSelect.value = linkEmailSelectedId;\n\n\t\tjQuery('#field_enable_multiple_payment_methods').prop( 'checked', field.enableMultiplePaymentMethods ? true : false );\n\t\tjQuery('#link_email_field').val( `linkEmailFieldId` in field ? field.linkEmailFieldId : 0 );\n\t\tshowHideFieldSettings();\n\t});\n\n\tjQuery( '#field_enable_multiple_payment_methods' ).on( 'change', function ( e ) {\n\t\tshowHideElement( jQuery( this ).is( ':checked' ) );\n\t\tshowHideFieldSettings();\n\t});\n\n\tjQuery( '#link_email_field' ).on( 'change', function ( e ) {\n\t\tconst field = GetSelectedField();\n\t\tfield.linkEmailFieldId = jQuery( this ).val();\n\t});\n\n}\n\n/**\n * Handles the form editor UI logic for the payment element.\n *\n * @since 4.3\n */\nconst paymentElementFormEditorHandler = () => {\n\n\tbindEvents();\n\tshowHideElement();\n\tmountCard();\n}\n\n/**\n * Launches UI handler on page ready.\n */\njQuery( document ).ready( function () {\n\tpaymentElementFormEditorHandler();\n})\n\n/**\n * Reset the UI after adding a new field.\n */\njQuery( document ).on( 'gform_field_added', function( event, form, field ) {\n\tif ( field.type === 'stripe_creditcard' ) {\n\t\tshowHideElement();\n\t\tmountCard();\n\t}\n});\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/* eslint-disable no-prototype-builtins */\nvar g =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n // eslint-disable-next-line no-undef\n (typeof global !== 'undefined' && global) ||\n {}\n\nvar support = {\n searchParams: 'URLSearchParams' in g,\n iterable: 'Symbol' in g && 'iterator' in Symbol,\n blob:\n 'FileReader' in g &&\n 'Blob' in g &&\n (function() {\n try {\n new Blob()\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in g,\n arrayBuffer: 'ArrayBuffer' in g\n}\n\nfunction isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n}\n\nif (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ]\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n }\n}\n\nfunction normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name)\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n}\n\nfunction normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value)\n }\n return value\n}\n\n// Build a destructive iterator for the value list\nfunction iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift()\n return {done: value === undefined, value: value}\n }\n }\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n }\n }\n\n return iterator\n}\n\nexport function Headers(headers) {\n this.map = {}\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value)\n }, this)\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n if (header.length != 2) {\n throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)\n }\n this.append(header[0], header[1])\n }, this)\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name])\n }, this)\n }\n}\n\nHeaders.prototype.append = function(name, value) {\n name = normalizeName(name)\n value = normalizeValue(value)\n var oldValue = this.map[name]\n this.map[name] = oldValue ? oldValue + ', ' + value : value\n}\n\nHeaders.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)]\n}\n\nHeaders.prototype.get = function(name) {\n name = normalizeName(name)\n return this.has(name) ? this.map[name] : null\n}\n\nHeaders.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n}\n\nHeaders.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value)\n}\n\nHeaders.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this)\n }\n }\n}\n\nHeaders.prototype.keys = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push(name)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.values = function() {\n var items = []\n this.forEach(function(value) {\n items.push(value)\n })\n return iteratorFor(items)\n}\n\nHeaders.prototype.entries = function() {\n var items = []\n this.forEach(function(value, name) {\n items.push([name, value])\n })\n return iteratorFor(items)\n}\n\nif (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries\n}\n\nfunction consumed(body) {\n if (body._noBody) return\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true\n}\n\nfunction fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result)\n }\n reader.onerror = function() {\n reject(reader.error)\n }\n })\n}\n\nfunction readBlobAsArrayBuffer(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n reader.readAsArrayBuffer(blob)\n return promise\n}\n\nfunction readBlobAsText(blob) {\n var reader = new FileReader()\n var promise = fileReaderReady(reader)\n var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type)\n var encoding = match ? match[1] : 'utf-8'\n reader.readAsText(blob, encoding)\n return promise\n}\n\nfunction readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf)\n var chars = new Array(view.length)\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i])\n }\n return chars.join('')\n}\n\nfunction bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength)\n view.set(new Uint8Array(buf))\n return view.buffer\n }\n}\n\nfunction Body() {\n this.bodyUsed = false\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n // eslint-disable-next-line no-self-assign\n this.bodyUsed = this.bodyUsed\n this._bodyInit = body\n if (!body) {\n this._noBody = true;\n this._bodyText = ''\n } else if (typeof body === 'string') {\n this._bodyText = body\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString()\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer)\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer])\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body)\n } else {\n this._bodyText = body = Object.prototype.toString.call(body)\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8')\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type)\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8')\n }\n }\n }\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n }\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this)\n if (isConsumed) {\n return isConsumed\n } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else if (support.blob) {\n return this.blob().then(readBlobAsArrayBuffer)\n } else {\n throw new Error('could not read as ArrayBuffer')\n }\n }\n\n this.text = function() {\n var rejected = consumed(this)\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n }\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n }\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n }\n\n return this\n}\n\n// HTTP methods whose capitalization should be normalized\nvar methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE']\n\nfunction normalizeMethod(method) {\n var upcased = method.toUpperCase()\n return methods.indexOf(upcased) > -1 ? upcased : method\n}\n\nexport function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {}\n var body = options.body\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url\n this.credentials = input.credentials\n if (!options.headers) {\n this.headers = new Headers(input.headers)\n }\n this.method = input.method\n this.mode = input.mode\n this.signal = input.signal\n if (!body && input._bodyInit != null) {\n body = input._bodyInit\n input.bodyUsed = true\n }\n } else {\n this.url = String(input)\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin'\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers)\n }\n this.method = normalizeMethod(options.method || this.method || 'GET')\n this.mode = options.mode || this.mode || null\n this.signal = options.signal || this.signal || (function () {\n if ('AbortController' in g) {\n var ctrl = new AbortController();\n return ctrl.signal;\n }\n }());\n this.referrer = null\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body)\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime())\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime()\n }\n }\n }\n}\n\nRequest.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n}\n\nfunction decode(body) {\n var form = new FormData()\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=')\n var name = split.shift().replace(/\\+/g, ' ')\n var value = split.join('=').replace(/\\+/g, ' ')\n form.append(decodeURIComponent(name), decodeURIComponent(value))\n }\n })\n return form\n}\n\nfunction parseHeaders(rawHeaders) {\n var headers = new Headers()\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ')\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':')\n var key = parts.shift().trim()\n if (key) {\n var value = parts.join(':').trim()\n try {\n headers.append(key, value)\n } catch (error) {\n console.warn('Response ' + error.message)\n }\n }\n })\n return headers\n}\n\nBody.call(Request.prototype)\n\nexport function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {}\n }\n\n this.type = 'default'\n this.status = options.status === undefined ? 200 : options.status\n if (this.status < 200 || this.status > 599) {\n throw new RangeError(\"Failed to construct 'Response': The status provided (0) is outside the range [200, 599].\")\n }\n this.ok = this.status >= 200 && this.status < 300\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText\n this.headers = new Headers(options.headers)\n this.url = options.url || ''\n this._initBody(bodyInit)\n}\n\nBody.call(Response.prototype)\n\nResponse.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n}\n\nResponse.error = function() {\n var response = new Response(null, {status: 200, statusText: ''})\n response.ok = false\n response.status = 0\n response.type = 'error'\n return response\n}\n\nvar redirectStatuses = [301, 302, 303, 307, 308]\n\nResponse.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n}\n\nexport var DOMException = g.DOMException\ntry {\n new DOMException()\n} catch (err) {\n DOMException = function(message, name) {\n this.message = message\n this.name = name\n var error = Error(message)\n this.stack = error.stack\n }\n DOMException.prototype = Object.create(Error.prototype)\n DOMException.prototype.constructor = DOMException\n}\n\nexport function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init)\n\n if (request.signal && request.signal.aborted) {\n return reject(new DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest()\n\n function abortXhr() {\n xhr.abort()\n }\n\n xhr.onload = function() {\n var options = {\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n }\n // This check if specifically for when a user fetches a file locally from the file system\n // Only if the status is out of a normal range\n if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {\n options.status = 200;\n } else {\n options.status = xhr.status;\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL')\n var body = 'response' in xhr ? xhr.response : xhr.responseText\n setTimeout(function() {\n resolve(new Response(body, options))\n }, 0)\n }\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'))\n }, 0)\n }\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request timed out'))\n }, 0)\n }\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new DOMException('Aborted', 'AbortError'))\n }, 0)\n }\n\n function fixUrl(url) {\n try {\n return url === '' && g.location.href ? g.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true)\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob'\n } else if (\n support.arrayBuffer\n ) {\n xhr.responseType = 'arraybuffer'\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {\n var names = [];\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n names.push(normalizeName(name))\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]))\n })\n request.headers.forEach(function(value, name) {\n if (names.indexOf(name) === -1) {\n xhr.setRequestHeader(name, value)\n }\n })\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value)\n })\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr)\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr)\n }\n }\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit)\n })\n}\n\nfetch.polyfill = true\n\nif (!g.fetch) {\n g.fetch = fetch\n g.Headers = Headers\n g.Request = Request\n g.Response = Response\n}\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/payment_element_form_editor.min.js b/js/payment_element_form_editor.min.js index 443cf7b..5d9282c 100644 --- a/js/payment_element_form_editor.min.js +++ b/js/payment_element_form_editor.min.js @@ -1 +1 @@ -!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";r.r(t),r.d(t,"Headers",(function(){return h})),r.d(t,"Request",(function(){return v})),r.d(t,"Response",(function(){return A})),r.d(t,"DOMException",(function(){return T})),r.d(t,"fetch",(function(){return x}));var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==n&&n,i="URLSearchParams"in n,o="Symbol"in n&&"iterator"in Symbol,s="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,d="ArrayBuffer"in n;if(d)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function f(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function y(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function _(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=_(t);return t.readAsArrayBuffer(e),r}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():d&&s&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):d&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=y(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=y(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(m)}),this.text=function(){var e,t,r,n=y(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=_(t),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function j(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function A(e,t){if(!(this instanceof A))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},g.call(v.prototype),g.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},A.error=function(){var e=new A(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];A.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new A(null,{status:t,headers:{location:e}})};var T=n.DOMException;try{new T}catch(e){(T=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),T.prototype.constructor=T}function x(e,t){return new Promise((function(r,i){var o=new v(e,t);if(o.signal&&o.signal.aborted)return i(new T("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,n={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;setTimeout((function(){r(new A(i,n))}),0)},a.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},a.onabort=function(){setTimeout((function(){i(new T("Aborted","AbortError"))}),0)},a.open(o.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(o.url),!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&(s?a.responseType="blob":d&&o.headers.get("Content-Type")&&-1!==o.headers.get("Content-Type").indexOf("application/octet-stream")&&(a.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof h?o.headers.forEach((function(e,t){a.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){a.setRequestHeader(e,c(t.headers[e]))})),o.signal&&(o.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",l)}),a.send(void 0===o._bodyInit?null:o._bodyInit)}))}x.polyfill=!0,n.fetch||(n.fetch=x,n.Headers=h,n.Request=v,n.Response=A)},,,function(e,t,r){r(0),e.exports=r(4)},function(e,t){const r=()=>{if(jQuery(".stripe-payment-element-container").length<=0||"1"!==gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled)return;const e=Stripe(gform_stripe_payment_element_form_editor_strings.api_key);if(e){e.elements({amount:100,currency:gform_stripe_payment_element_form_editor_strings.payment_element_currency,mode:"payment",payment_method_types:["card"]}).create("payment",{readOnly:!0}).mount(".stripe-payment-element-container"),jQuery(".stripe-payment-element-container").prepend('
')}else jQuery(".stripe-payment-element-container").text(gform_stripe_payment_element_form_editor_strings.payment_element_error)},n=(e=null)=>{null===e&&"1"===gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled&&(e=!1,form.fields.forEach(t=>{"stripe_creditcard"===t.type&&(e=t.enableMultiplePaymentMethods)}));const t=jQuery(".stripe-payment-element-container"),r=jQuery(".ginput_stripe_creditcard"),n=e?"block":"none",i=e?"none":"block",o=jQuery("#link_email_field_container");e?o.show():o.hide(),t.length&&(t.get(0).style.display=n),r.length&&(r.get(0).style.display=i)},i=()=>{jQuery(".field_setting").hide();let e=getAllFieldSettings(GetSelectedField());jQuery(e).show()},o=(e,t)=>{if("stripe_creditcard"!==t.type)return e;return jQuery("#field_enable_multiple_payment_methods").is(":checked")?(e.splice(e.indexOf(".sub_label_placement_setting"),1),e.splice(e.indexOf(".sub_labels_setting"),1),e.splice(e.indexOf(".input_placeholders_setting"),1)):e.push(".sub_labels_setting",".sub_label_placement_setting",".input_placeholders_setting"),e},s=(e,t,r,n)=>{const i=t.fields.findLastIndex(e=>"page"===e.type),o=t.fields.findIndex(e=>"stripe_creditcard"===e.type&&!0===e.enableMultiplePaymentMethods);return-1===i||-1===o||o{const t=form.fields.findIndex(e=>"stripe_creditcard"===e.type&&!0===e.enableMultiplePaymentMethods);t<0||form.fields[t].id!=e||(n(),r())},d=()=>{gform.addAction("gform_after_refresh_field_preview",a),gform.addFilter("gform_editor_field_settings",o),gform.addFilter("gform_validation_error_form_editor",s),jQuery(document).bind("gform_load_field_settings",(function(e,t,r){if("stripe_creditcard"!==t.type)return;const n="1"===gform_stripe_payment_element_form_editor_strings.payment_element_supported;"1"===gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled&&n||(jQuery(".enable_multiple_payment_methods_setting").addClass("gform-stripe--disabled"),jQuery("#field_enable_multiple_payment_methods").prop("disabled",!0).prop("checked",!1),jQuery("#link_email_field").prop("disabled",!0)),n||setFieldError("enable_multiple_payment_methods_setting","below",gform_stripe_payment_element_form_editor_strings.payment_element_disabled_message);const o=gform.utils.getNode("#link_email_field",document,!0),s=o.value;gform.utils.getNodes("gform-stripe-link-email-ids").forEach(e=>{e.remove()}),r.fields.forEach((e,t)=>{if("email"===e.type){const t=document.createElement("option");t.value=e.id,t.setAttribute("data-js","gform-stripe-link-email-ids"),t.textContent=`${e.label} - ${gform_stripe_payment_element_form_editor_strings.email_field_id_text}: ${e.id}`,o.appendChild(t)}}),o.value=s,jQuery("#field_enable_multiple_payment_methods").prop("checked",!!t.enableMultiplePaymentMethods),jQuery("#link_email_field").val("linkEmailFieldId"in t?t.linkEmailFieldId:0),i()})),jQuery("#field_enable_multiple_payment_methods").on("change",(function(e){n(jQuery(this).is(":checked")),i()})),jQuery("#link_email_field").on("change",(function(e){GetSelectedField().linkEmailFieldId=jQuery(this).val()}))};jQuery(document).ready((function(){d(),n(),r()})),jQuery(document).on("gform_field_added",(function(e,t,i){"stripe_creditcard"===i.type&&(n(),r())}))}]); \ No newline at end of file +!function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"Headers",(function(){return h})),r.d(t,"Request",(function(){return v})),r.d(t,"Response",(function(){return E})),r.d(t,"DOMException",(function(){return j})),r.d(t,"fetch",(function(){return x}));var n="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e||{},o="URLSearchParams"in n,i="Symbol"in n&&"iterator"in Symbol,s="FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),a="FormData"in n,d="ArrayBuffer"in n;if(d)var l=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&l.indexOf(Object.prototype.toString.call(e))>-1};function f(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function c(e){return"string"!=typeof e&&(e=String(e)),e}function p(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return i&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){if(2!=e.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function y(e){if(!e._noBody)return e.bodyUsed?Promise.reject(new TypeError("Already read")):void(e.bodyUsed=!0)}function _(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=_(t);return t.readAsArrayBuffer(e),r}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:a&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:o&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():d&&s&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):d&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=y(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=y(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(s)return this.blob().then(m);throw new Error("could not read as ArrayBuffer")},this.text=function(){var e,t,r,n,o,i=y(this);if(i)return i;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,r=_(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),o=n?n[1]:"utf-8",t.readAsText(e,o),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n-1?o:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in n)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var s=/([?&])_=[^&]*/;if(s.test(this.url))this.url=this.url.replace(s,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function A(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(o))}})),t}function E(e,t){if(!(this instanceof E))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},g.call(v.prototype),g.call(E.prototype),E.prototype.clone=function(){return new E(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},E.error=function(){var e=new E(null,{status:200,statusText:""});return e.ok=!1,e.status=0,e.type="error",e};var T=[301,302,303,307,308];E.redirect=function(e,t){if(-1===T.indexOf(t))throw new RangeError("Invalid status code");return new E(null,{status:t,headers:{location:e}})};var j=n.DOMException;try{new j}catch(e){(j=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack}).prototype=Object.create(Error.prototype),j.prototype.constructor=j}function x(e,t){return new Promise((function(r,o){var i=new v(e,t);if(i.signal&&i.signal.aborted)return o(new j("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}if(a.onload=function(){var e,t,n={statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new h,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{t.append(n,o)}catch(e){console.warn("Response "+e.message)}}})),t)};0===i.url.indexOf("file://")&&(a.status<200||a.status>599)?n.status=200:n.status=a.status,n.url="responseURL"in a?a.responseURL:n.headers.get("X-Request-URL");var o="response"in a?a.response:a.responseText;setTimeout((function(){r(new E(o,n))}),0)},a.onerror=function(){setTimeout((function(){o(new TypeError("Network request failed"))}),0)},a.ontimeout=function(){setTimeout((function(){o(new TypeError("Network request timed out"))}),0)},a.onabort=function(){setTimeout((function(){o(new j("Aborted","AbortError"))}),0)},a.open(i.method,function(e){try{return""===e&&n.location.href?n.location.href:e}catch(t){return e}}(i.url),!0),"include"===i.credentials?a.withCredentials=!0:"omit"===i.credentials&&(a.withCredentials=!1),"responseType"in a&&(s?a.responseType="blob":d&&(a.responseType="arraybuffer")),t&&"object"==typeof t.headers&&!(t.headers instanceof h||n.Headers&&t.headers instanceof n.Headers)){var u=[];Object.getOwnPropertyNames(t.headers).forEach((function(e){u.push(f(e)),a.setRequestHeader(e,c(t.headers[e]))})),i.headers.forEach((function(e,t){-1===u.indexOf(t)&&a.setRequestHeader(t,e)}))}else i.headers.forEach((function(e,t){a.setRequestHeader(t,e)}));i.signal&&(i.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&i.signal.removeEventListener("abort",l)}),a.send(void 0===i._bodyInit?null:i._bodyInit)}))}x.polyfill=!0,n.fetch||(n.fetch=x,n.Headers=h,n.Request=v,n.Response=E)}.call(this,r(1))},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},,,function(e,t,r){r(0),e.exports=r(5)},function(e,t){const r=()=>{if(jQuery(".stripe-payment-element-container").length<=0||"1"!==gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled)return;const e=Stripe(gform_stripe_payment_element_form_editor_strings.api_key);if(e){e.elements({amount:100,currency:gform_stripe_payment_element_form_editor_strings.payment_element_currency,mode:"payment",payment_method_types:["card"]}).create("payment",{readOnly:!0}).mount(".stripe-payment-element-container"),jQuery(".stripe-payment-element-container").prepend('
')}else jQuery(".stripe-payment-element-container").text(gform_stripe_payment_element_form_editor_strings.payment_element_error)},n=(e=null)=>{null===e&&"1"===gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled&&(e=!1,form.fields.forEach(t=>{"stripe_creditcard"===t.type&&(e=t.enableMultiplePaymentMethods)}));const t=jQuery(".stripe-payment-element-container"),r=jQuery(".ginput_stripe_creditcard"),n=e?"block":"none",o=e?"none":"block",i=jQuery("#link_email_field_container");e?i.show():i.hide(),t.length&&(t.get(0).style.display=n),r.length&&(r.get(0).style.display=o)},o=()=>{jQuery(".field_setting").hide();let e=getAllFieldSettings(GetSelectedField());jQuery(e).show()},i=(e,t)=>{if("stripe_creditcard"!==t.type)return e;return jQuery("#field_enable_multiple_payment_methods").is(":checked")?(e.splice(e.indexOf(".sub_label_placement_setting"),1),e.splice(e.indexOf(".sub_labels_setting"),1),e.splice(e.indexOf(".input_placeholders_setting"),1)):e.push(".sub_labels_setting",".sub_label_placement_setting",".input_placeholders_setting"),e},s=(e,t,r,n)=>{const o=t.fields.findLastIndex(e=>"page"===e.type),i=t.fields.findIndex(e=>"stripe_creditcard"===e.type&&!0===e.enableMultiplePaymentMethods);return-1===o||-1===i||i{const t=form.fields.findIndex(e=>"stripe_creditcard"===e.type&&!0===e.enableMultiplePaymentMethods);t<0||form.fields[t].id!=e||(n(),r())},d=()=>{gform.addAction("gform_after_refresh_field_preview",a),gform.addFilter("gform_editor_field_settings",i),gform.addFilter("gform_validation_error_form_editor",s),jQuery(document).bind("gform_load_field_settings",(function(e,t,r){if("stripe_creditcard"!==t.type)return;const n="1"===gform_stripe_payment_element_form_editor_strings.payment_element_supported;"1"===gform_stripe_payment_element_form_editor_strings.stripe_connect_enabled&&n||(jQuery(".enable_multiple_payment_methods_setting").addClass("gform-stripe--disabled"),jQuery("#field_enable_multiple_payment_methods").prop("disabled",!0).prop("checked",!1),jQuery("#link_email_field").prop("disabled",!0)),n||setFieldError("enable_multiple_payment_methods_setting","below",gform_stripe_payment_element_form_editor_strings.payment_element_disabled_message);const i=gform.utils.getNode("#link_email_field",document,!0),s=i.value;gform.utils.getNodes("gform-stripe-link-email-ids").forEach(e=>{e.remove()}),r.fields.forEach((e,t)=>{if("email"===e.type){const t=document.createElement("option");t.value=e.id,t.setAttribute("data-js","gform-stripe-link-email-ids"),t.textContent=`${e.label} - ${gform_stripe_payment_element_form_editor_strings.email_field_id_text}: ${e.id}`,i.appendChild(t)}}),i.value=s,jQuery("#field_enable_multiple_payment_methods").prop("checked",!!t.enableMultiplePaymentMethods),jQuery("#link_email_field").val("linkEmailFieldId"in t?t.linkEmailFieldId:0),o()})),jQuery("#field_enable_multiple_payment_methods").on("change",(function(e){n(jQuery(this).is(":checked")),o()})),jQuery("#link_email_field").on("change",(function(e){GetSelectedField().linkEmailFieldId=jQuery(this).val()}))};jQuery(document).ready((function(){d(),n(),r()})),jQuery(document).on("gform_field_added",(function(e,t,o){"stripe_creditcard"===o.type&&(n(),r())}))}]); \ No newline at end of file diff --git a/languages/gravityformsstripe.pot b/languages/gravityformsstripe.pot index ed49f9a..53dd335 100644 --- a/languages/gravityformsstripe.pot +++ b/languages/gravityformsstripe.pot @@ -2,16 +2,16 @@ # This file is distributed under the GPL-2.0+. msgid "" msgstr "" -"Project-Id-Version: Gravity Forms Stripe Add-On 5.6.0\n" +"Project-Id-Version: Gravity Forms Stripe Add-On 5.7.0\n" "Report-Msgid-Bugs-To: https://gravityforms.com/support\n" "Last-Translator: Gravity Forms \n" "Language-Team: Gravity Forms \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-04-29T14:17:29+00:00\n" +"POT-Creation-Date: 2024-06-17T16:57:33+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.8.1\n" +"X-Generator: WP-CLI 2.10.0\n" "X-Domain: gravityformsstripe\n" #. Plugin Name of the plugin @@ -31,824 +31,825 @@ msgstr "" msgid "Gravity Forms" msgstr "" -#: class-gf-stripe.php:362 +#: class-gf-stripe.php:365 msgid "The credit card field will initiate once the payment condition is met." msgstr "" -#: class-gf-stripe.php:363 +#: class-gf-stripe.php:366 msgid "Please follow the instructions on the screen to validate your card." msgstr "" -#: class-gf-stripe.php:367 +#: class-gf-stripe.php:370 msgid "Please enter all required payment information." msgstr "" -#: class-gf-stripe.php:368 +#: class-gf-stripe.php:371 msgid "We could not process your request at the moment." msgstr "" -#: class-gf-stripe.php:369 +#: class-gf-stripe.php:372 msgid "Payment information field failed to be displayed, please contact support." msgstr "" -#: class-gf-stripe.php:370 +#: class-gf-stripe.php:373 msgid "The payment gateway failed to process the request. Please use a different payment method." msgstr "" -#: class-gf-stripe.php:371 -#: class-gf-stripe.php:8449 +#: class-gf-stripe.php:374 +#: class-gf-stripe.php:8455 msgid "We are not able to process your payment request at the moment. Please try again later." msgstr "" -#: class-gf-stripe.php:372 +#: class-gf-stripe.php:375 msgid "The payment has failed" msgstr "" -#: class-gf-stripe.php:378 +#: class-gf-stripe.php:381 msgid "You have entered an invalid coupon code." msgstr "" -#: class-gf-stripe.php:379 +#: class-gf-stripe.php:382 msgid "Oops! It looks like we're having trouble processing your request. To resolve this issue, please try clearing your browser cache and then refreshing the page." msgstr "" -#: class-gf-stripe.php:396 +#: class-gf-stripe.php:399 msgid "Error validating this key. Please try again later." msgstr "" -#: class-gf-stripe.php:397 +#: class-gf-stripe.php:400 msgid "In order to switch accounts, you must first save this feed by clicking the \"Update Settings\" button below" msgstr "" -#: class-gf-stripe.php:399 +#: class-gf-stripe.php:402 msgid "Are you sure you want to disconnect from Stripe for this website?" msgstr "" -#: class-gf-stripe.php:400 +#: class-gf-stripe.php:403 msgid "Are you sure you want to disconnect from Stripe for this feed?" msgstr "" -#: class-gf-stripe.php:401 +#: class-gf-stripe.php:404 msgid "Are you sure you want to disconnect all Gravity Forms sites connected to this Stripe account?" msgstr "" -#: class-gf-stripe.php:409 +#: class-gf-stripe.php:412 msgid "Are you sure you want to refund this payment?" msgstr "" -#: class-gf-stripe.php:411 +#: class-gf-stripe.php:414 msgid "Processing refund" msgstr "" -#: class-gf-stripe.php:412 +#: class-gf-stripe.php:415 msgid "Transaction successfully refunded" msgstr "" -#: class-gf-stripe.php:414 +#: class-gf-stripe.php:417 msgid "Processing capture" msgstr "" -#: class-gf-stripe.php:415 +#: class-gf-stripe.php:418 msgid "Transaction successfully captured" msgstr "" -#: class-gf-stripe.php:430 +#: class-gf-stripe.php:433 msgid "Please check your Stripe settings" msgstr "" -#: class-gf-stripe.php:433 +#: class-gf-stripe.php:436 msgid "When the additional payment methods option is enabled, the Stripe field must be on the last page of the form." msgstr "" -#: class-gf-stripe.php:436 +#: class-gf-stripe.php:439 msgid "To enable additional payment methods, you must update Gravity Forms to the latest version." msgstr "" -#: class-gf-stripe.php:437 +#: class-gf-stripe.php:440 msgid "Field ID" msgstr "" -#: class-gf-stripe.php:1156 +#: class-gf-stripe.php:1162 msgid "Payment Methods" msgstr "" -#: class-gf-stripe.php:1166 +#: class-gf-stripe.php:1172 msgid "Enable additional payment methods" msgstr "" #. translators: variables are the markup to generate a link. -#: class-gf-stripe.php:1171 +#: class-gf-stripe.php:1177 msgid "Available payment methods can be configured in your %1$sStripe Dashboard%2$s." msgstr "" -#: class-gf-stripe.php:1178 +#: class-gf-stripe.php:1184 msgid "Link Email Field" msgstr "" -#: class-gf-stripe.php:1182 +#: class-gf-stripe.php:1188 msgid "Select an Email Field" msgstr "" #. translators: variables are the markup to generate a link. -#: class-gf-stripe.php:1188 +#: class-gf-stripe.php:1194 msgid "Link is a payment method that enables your customers to save their payment information so they can use it again on any site that uses Stripe Link. %1$sLearn more about Link%2$s." msgstr "" #. translators: variables are the markup to generate a link. -#: class-gf-stripe.php:1196 +#: class-gf-stripe.php:1202 msgid "This option is disabled because Stripe is authenticated using API keys instead of Stripe Connect. To take advantage of additional payment methods, re-authenticate using Stripe Connect. %1$sLearn more about Stripe payment element%2$s." msgstr "" -#: class-gf-stripe.php:1262 -#: class-gf-stripe.php:7220 +#: class-gf-stripe.php:1268 +#: class-gf-stripe.php:7226 msgid "Access denied." msgstr "" -#: class-gf-stripe.php:1309 -#: class-gf-stripe.php:2514 +#: class-gf-stripe.php:1315 +#: class-gf-stripe.php:2520 msgid "Stripe Account" msgstr "" -#: class-gf-stripe.php:1316 +#: class-gf-stripe.php:1322 msgid "Payment Collection" msgstr "" -#: class-gf-stripe.php:1322 +#: class-gf-stripe.php:1328 msgid "Payment Collection Method" msgstr "" -#: class-gf-stripe.php:1327 +#: class-gf-stripe.php:1333 msgid "Stripe Field (Elements, SCA-ready)" msgstr "" -#: class-gf-stripe.php:1329 +#: class-gf-stripe.php:1335 msgid "Stripe Field" msgstr "" -#: class-gf-stripe.php:1330 +#: class-gf-stripe.php:1336 msgid "Select this option to use a Stripe field hosted by Stripe. The Stripe field can be embedded in a form and supports credit card payments as well as other payment methods such as Google Pay, Apple Pay and bank transfers." msgstr "" #. translators: 1. Open link tag 2. Close link tag -#: class-gf-stripe.php:1333 +#: class-gf-stripe.php:1339 msgid "Stripe Field is ready for %1$sStrong Customer Authentication%2$s for European customers." msgstr "" -#: class-gf-stripe.php:1337 +#: class-gf-stripe.php:1343 msgid "Stripe Payment Form (Stripe Checkout, SCA-ready)" msgstr "" -#: class-gf-stripe.php:1339 +#: class-gf-stripe.php:1345 msgid "Stripe Payment Form" msgstr "" -#: class-gf-stripe.php:1340 +#: class-gf-stripe.php:1346 msgid "Select this option to collect all payment information in a separate page hosted by Stripe. This option is the simplest to implement since it doesn't require a Stripe field in your form. Stripe Checkout supports credit card payments as well as other payment methods such as Google Pay, Apple Pay and bank transfers." msgstr "" #. translators: 1. Open link tag 2. Close link tag -#: class-gf-stripe.php:1343 +#: class-gf-stripe.php:1349 msgid "Stripe Checkout is ready for %1$sStrong Customer Authentication%2$s for European customers." msgstr "" -#: class-gf-stripe.php:1382 -#: class-gf-stripe.php:1385 -#: class-gf-stripe.php:1745 +#: class-gf-stripe.php:1388 +#: class-gf-stripe.php:1391 +#: class-gf-stripe.php:1751 msgid "Connected to Stripe as" msgstr "" -#: class-gf-stripe.php:1385 +#: class-gf-stripe.php:1391 msgid "The Stripe account this feed is currently connected to." msgstr "" -#: class-gf-stripe.php:1389 +#: class-gf-stripe.php:1395 msgid "Mode" msgstr "" -#: class-gf-stripe.php:1394 +#: class-gf-stripe.php:1400 msgid "Live" msgstr "" -#: class-gf-stripe.php:1398 +#: class-gf-stripe.php:1404 msgid "Test" msgstr "" -#: class-gf-stripe.php:1445 -#: class-gf-stripe.php:1480 +#: class-gf-stripe.php:1451 +#: class-gf-stripe.php:1486 msgid "Test Publishable Key" msgstr "" -#: class-gf-stripe.php:1452 -#: class-gf-stripe.php:1485 +#: class-gf-stripe.php:1458 +#: class-gf-stripe.php:1491 msgid "Test Secret Key" msgstr "" -#: class-gf-stripe.php:1460 -#: class-gf-stripe.php:1490 +#: class-gf-stripe.php:1466 +#: class-gf-stripe.php:1496 msgid "Live Publishable Key" msgstr "" -#: class-gf-stripe.php:1467 -#: class-gf-stripe.php:1495 +#: class-gf-stripe.php:1473 +#: class-gf-stripe.php:1501 msgid "Live Secret Key" msgstr "" -#: class-gf-stripe.php:1507 +#: class-gf-stripe.php:1513 msgid "Webhooks Enabled?" msgstr "" -#: class-gf-stripe.php:1515 +#: class-gf-stripe.php:1521 msgid "I have enabled the Gravity Forms webhook URL in my Stripe account." msgstr "" -#: class-gf-stripe.php:1523 +#: class-gf-stripe.php:1529 msgid "Test Signing Secret" msgstr "" -#: class-gf-stripe.php:1532 +#: class-gf-stripe.php:1538 msgid "Live Signing Secret" msgstr "" -#: class-gf-stripe.php:1599 +#: class-gf-stripe.php:1605 msgid "SSL Certificate Required" msgstr "" #. Translators: 1: Open link tag 2: Close link tag -#: class-gf-stripe.php:1601 +#: class-gf-stripe.php:1607 msgid "Make sure you have an SSL certificate installed and enabled, then %1$sclick here to reload the settings page%2$s." msgstr "" -#: class-gf-stripe.php:1627 +#: class-gf-stripe.php:1633 msgid "View Instructions" msgstr "" -#: class-gf-stripe.php:1632 +#: class-gf-stripe.php:1638 msgid "Click the following link and log in to access your Stripe Webhooks management page:" msgstr "" -#: class-gf-stripe.php:1636 +#: class-gf-stripe.php:1642 msgid "Click the \"Add Endpoint\" button above the list of Webhook URLs." msgstr "" -#: class-gf-stripe.php:1638 +#: class-gf-stripe.php:1644 msgid "Enter the following URL in the \"URL to be called\" field:" msgstr "" -#: class-gf-stripe.php:1641 +#: class-gf-stripe.php:1647 msgid "If offered the choice, select the latest API version." msgstr "" -#: class-gf-stripe.php:1642 +#: class-gf-stripe.php:1648 msgid "Click the \"receive all events\" link." msgstr "" -#: class-gf-stripe.php:1643 +#: class-gf-stripe.php:1649 msgid "Click the \"Add Endpoint\" button to save the webhook." msgstr "" -#: class-gf-stripe.php:1644 +#: class-gf-stripe.php:1650 msgid "Copy the signing secret of the newly created webhook on Stripe and paste to the setting field." msgstr "" -#: class-gf-stripe.php:1662 +#: class-gf-stripe.php:1668 msgid "Select how payment information will be collected. You can select one of the Stripe hosted solutions (Stripe Credit Card or Stripe Checkout) which simplifies the PCI compliance process with Stripe." msgstr "" #. translators: Placeholders represent opening and closing link tags. -#: class-gf-stripe.php:1667 +#: class-gf-stripe.php:1673 msgid "The Gravity Forms Credit Card Field was deprecated in the Stripe Add-On in version 3.4. Forms that are currently using this field will stop working in a future version. Refer to %1$sthis guide%2$s for more information about this change." msgstr "" -#: class-gf-stripe.php:1716 +#: class-gf-stripe.php:1722 msgid "Click here to authenticate with Stripe" msgstr "" -#: class-gf-stripe.php:1726 +#: class-gf-stripe.php:1732 msgid "You are currently logged in to Stripe using a deprecated authentication method." msgstr "" #. Translators: 1: Open strong tag 2: Close strong tag -#: class-gf-stripe.php:1728 +#: class-gf-stripe.php:1734 msgid "%1$sPlease login to your Stripe account via Stripe Connect using the button below.%2$s It is a more secure authentication method and will be required for upcoming features of the Stripe Add-on." msgstr "" #. translators: Placeholders represent wrapping link tag. -#: class-gf-stripe.php:1733 +#: class-gf-stripe.php:1739 msgid "%1$sLearn more%2$s about connecting with Stripe." msgstr "" -#: class-gf-stripe.php:1749 -#: class-gf-stripe.php:1767 +#: class-gf-stripe.php:1755 +#: class-gf-stripe.php:1773 msgid "Disconnect your Stripe account" msgstr "" #. translators: placeholder represents contextual target, either "feed" or "site". -#: class-gf-stripe.php:1762 +#: class-gf-stripe.php:1768 msgid "Disconnect this %s only" msgstr "" -#: class-gf-stripe.php:1764 +#: class-gf-stripe.php:1770 msgid "Disconnect all Gravity Forms sites connected to this Stripe account" msgstr "" -#: class-gf-stripe.php:1872 +#: class-gf-stripe.php:1878 msgid "%1$s%2$s%3$s" msgstr "" -#: class-gf-stripe.php:1887 +#: class-gf-stripe.php:1893 msgid "Switch Accounts" msgstr "" #. Translators: 1. Open link tag. 2. Close link tag. -#: class-gf-stripe.php:1903 +#: class-gf-stripe.php:1909 msgid "Logo can be configured on %1$sStripe's branding page%2$s." msgstr "" -#: class-gf-stripe.php:1964 +#: class-gf-stripe.php:1970 msgid "Unable to connect to Stripe due to mismatched state." msgstr "" -#: class-gf-stripe.php:2011 +#: class-gf-stripe.php:2017 msgid "Unable to authenticate with Stripe." msgstr "" -#: class-gf-stripe.php:2045 +#: class-gf-stripe.php:2051 msgid "Capture Payment" msgstr "" -#: class-gf-stripe.php:2046 +#: class-gf-stripe.php:2052 msgid "Capturing payment" msgstr "" #. Translators: 1: Open link tag 2: Close link tag -#: class-gf-stripe.php:2152 +#: class-gf-stripe.php:2158 msgid "You are currently logged in to Stripe using a deprecated authentication method. %1$sRe-authenticate your Stripe account%2$s." msgstr "" #. translators: 1: Open strong tag, 2: Close strong tag, 3: Form title, 4: Open link tag, 5: Close link tag. -#: class-gf-stripe.php:2224 +#: class-gf-stripe.php:2230 msgid "%1$sImportant%2$s: The form %3$s is using a deprecated payment collection method for Stripe that will stop working in a future version. Take action now to continue collecting payments. %4$sLearn more.%5$s" msgstr "" -#: class-gf-stripe.php:2333 +#: class-gf-stripe.php:2339 msgid "You must add a Stripe Card field to your form before creating a feed. Let's go %sadd one%s!" msgstr "" -#: class-gf-stripe.php:2358 +#: class-gf-stripe.php:2364 msgid "Customer Information" msgstr "" -#: class-gf-stripe.php:2367 -#: class-gf-stripe.php:2370 +#: class-gf-stripe.php:2373 +#: class-gf-stripe.php:2376 msgid "Email" msgstr "" -#: class-gf-stripe.php:2370 -#: class-gf-stripe.php:2549 +#: class-gf-stripe.php:2376 +#: class-gf-stripe.php:2555 msgid "You can specify an email field and it will be sent to Stripe as the customer's email." msgstr "" -#: class-gf-stripe.php:2374 +#: class-gf-stripe.php:2380 msgid "Description" msgstr "" -#: class-gf-stripe.php:2379 -#: class-gf-stripe.php:2382 +#: class-gf-stripe.php:2385 +#: class-gf-stripe.php:2388 msgid "Coupon" msgstr "" -#: class-gf-stripe.php:2382 +#: class-gf-stripe.php:2388 msgid "Select which field contains the coupon code to be applied to the recurring charge(s). The coupon must also exist in your Stripe Dashboard." msgstr "" -#: class-gf-stripe.php:2382 +#: class-gf-stripe.php:2388 msgid "If you use Stripe Checkout, the coupon won't be applied to your first invoice." msgstr "" -#: class-gf-stripe.php:2396 +#: class-gf-stripe.php:2402 msgid "You will see this data when viewing a customer page." msgstr "" -#: class-gf-stripe.php:2398 +#: class-gf-stripe.php:2404 msgid "You will see this data when viewing a payment page." msgstr "" -#: class-gf-stripe.php:2405 -#: class-gf-stripe.php:2409 +#: class-gf-stripe.php:2411 +#: class-gf-stripe.php:2415 msgid "Metadata" msgstr "" -#: class-gf-stripe.php:2409 +#: class-gf-stripe.php:2415 msgid "You may send custom meta information to Stripe. A maximum of 50 custom keys may be sent. The key name must be 40 characters or less, and the mapped data will be truncated to 500 characters per requirements by Stripe. " msgstr "" -#: class-gf-stripe.php:2423 +#: class-gf-stripe.php:2429 msgid "Trial" msgstr "" -#: class-gf-stripe.php:2426 +#: class-gf-stripe.php:2432 msgid "Enable a trial period. The user's recurring payment will not begin until after this trial period." msgstr "" -#: class-gf-stripe.php:2433 +#: class-gf-stripe.php:2439 msgid "Trial Period" msgstr "" -#: class-gf-stripe.php:2439 -#: class-gf-stripe.php:2442 +#: class-gf-stripe.php:2445 +#: class-gf-stripe.php:2448 msgid "days" msgstr "" -#: class-gf-stripe.php:2450 -#: class-gf-stripe.php:2453 +#: class-gf-stripe.php:2456 +#: class-gf-stripe.php:2459 msgid "Subscription Name" msgstr "" -#: class-gf-stripe.php:2453 +#: class-gf-stripe.php:2459 msgid "Enter a name for the subscription. It will be displayed on the payment form as well as the Stripe dashboard." msgstr "" -#: class-gf-stripe.php:2463 +#: class-gf-stripe.php:2469 msgid "Stripe Credit Card Field Settings" msgstr "" -#: class-gf-stripe.php:2471 -#: class-gf-stripe.php:2472 +#: class-gf-stripe.php:2477 +#: class-gf-stripe.php:2478 msgid "Billing Information" msgstr "" -#: class-gf-stripe.php:2472 +#: class-gf-stripe.php:2478 msgid "Map your Form Fields to the available listed fields. The address information will be sent to Stripe." msgstr "" -#: class-gf-stripe.php:2484 +#: class-gf-stripe.php:2490 msgid "Stripe Payment Form Settings" msgstr "" -#: class-gf-stripe.php:2485 +#: class-gf-stripe.php:2491 msgid "The following settings control information displayed on the Stripe hosted payment page that is displayed after the form is submitted." msgstr "" -#: class-gf-stripe.php:2502 -#: class-gf-stripe.php:2504 +#: class-gf-stripe.php:2508 +#: class-gf-stripe.php:2510 msgid "Stripe Receipt" msgstr "" -#: class-gf-stripe.php:2504 +#: class-gf-stripe.php:2510 msgid "Stripe can send a receipt via email upon payment. Select an email field to enable this feature." msgstr "" -#: class-gf-stripe.php:2538 +#: class-gf-stripe.php:2544 msgid "Logo" msgstr "" -#: class-gf-stripe.php:2543 #: class-gf-stripe.php:2549 +#: class-gf-stripe.php:2555 msgid "Customer Email" msgstr "" -#: class-gf-stripe.php:2553 -#: class-gf-stripe.php:2555 +#: class-gf-stripe.php:2559 +#: class-gf-stripe.php:2561 msgid "Billing Address" msgstr "" -#: class-gf-stripe.php:2555 +#: class-gf-stripe.php:2561 msgid "When enabled, Stripe Checkout will collect the customer's billing address for you." msgstr "" -#: class-gf-stripe.php:2559 -#: class-gf-stripe.php:2752 -#: class-gf-stripe.php:2818 +#: class-gf-stripe.php:2565 +#: class-gf-stripe.php:2758 +#: class-gf-stripe.php:2824 msgid "Enabled" msgstr "" -#: class-gf-stripe.php:2563 +#: class-gf-stripe.php:2569 msgid "Disabled" msgstr "" -#: class-gf-stripe.php:2685 +#: class-gf-stripe.php:2691 msgid "Do not send receipt" msgstr "" -#: class-gf-stripe.php:2691 +#: class-gf-stripe.php:2697 msgid "Do not set customer email" msgstr "" -#: class-gf-stripe.php:2908 +#: class-gf-stripe.php:2914 msgid "Please enter a valid number of days." msgstr "" -#: class-gf-stripe.php:2962 +#: class-gf-stripe.php:2968 msgid "A field has been mapped to a custom key without a name. Please enter a name for the custom key, remove the metadata item, or return the corresponding drop down to 'Select a Field'." msgstr "" -#: class-gf-stripe.php:2965 +#: class-gf-stripe.php:2971 msgid "The name of custom key %s is too long. Please shorten this to 40 characters or less." msgstr "" -#: class-gf-stripe.php:2983 +#: class-gf-stripe.php:2989 msgid "Please use the correct webhook signing secret, which should start with \"whsec_\"." msgstr "" -#: class-gf-stripe.php:3000 +#: class-gf-stripe.php:3006 msgid "day(s)" msgstr "" -#: class-gf-stripe.php:3001 +#: class-gf-stripe.php:3007 msgid "week(s)" msgstr "" -#: class-gf-stripe.php:3002 +#: class-gf-stripe.php:3008 msgid "month(s)" msgstr "" -#: class-gf-stripe.php:3003 +#: class-gf-stripe.php:3009 msgid "year(s)" msgstr "" -#: class-gf-stripe.php:3048 +#: class-gf-stripe.php:3054 msgid "Payment Pending" msgstr "" -#: class-gf-stripe.php:3049 +#: class-gf-stripe.php:3055 msgid "Payment Authorized" msgstr "" -#: class-gf-stripe.php:3050 +#: class-gf-stripe.php:3056 msgid "Payment Completed" msgstr "" -#: class-gf-stripe.php:3051 +#: class-gf-stripe.php:3057 msgid "Payment Refunded" msgstr "" -#: class-gf-stripe.php:3052 +#: class-gf-stripe.php:3058 msgid "Payment Failed" msgstr "" -#: class-gf-stripe.php:3053 +#: class-gf-stripe.php:3059 msgid "Subscription Created" msgstr "" -#: class-gf-stripe.php:3054 +#: class-gf-stripe.php:3060 msgid "Subscription Canceled" msgstr "" -#: class-gf-stripe.php:3055 +#: class-gf-stripe.php:3061 msgid "Subscription Payment Added" msgstr "" -#: class-gf-stripe.php:3056 +#: class-gf-stripe.php:3062 msgid "Subscription Payment Failed" msgstr "" -#: class-gf-stripe.php:3471 -#: class-gf-stripe.php:3630 -#: class-gf-stripe.php:3671 +#: class-gf-stripe.php:3477 +#: class-gf-stripe.php:3636 +#: class-gf-stripe.php:3677 msgid "Unknown" msgstr "" -#: class-gf-stripe.php:3480 +#: class-gf-stripe.php:3486 msgid "Card type (%s) is not supported. Please enter one of the supported credit cards." msgstr "" #. Translators: 1. Type of credit card. -#: class-gf-stripe.php:3675 +#: class-gf-stripe.php:3681 msgid "Card type (%1$s) is not supported. Please enter one of the supported credit cards." msgstr "" -#: class-gf-stripe.php:3693 +#: class-gf-stripe.php:3699 msgid "There was a problem with your submission." msgstr "" -#: class-gf-stripe.php:3724 +#: class-gf-stripe.php:3730 msgid "This form is not configured to collect payment." msgstr "" -#: class-gf-stripe.php:3745 +#: class-gf-stripe.php:3751 msgid "There was a problem with your submission. Please try again later." msgstr "" -#: class-gf-stripe.php:3749 +#: class-gf-stripe.php:3755 msgid "There was a problem with your submission:" msgstr "" -#: class-gf-stripe.php:3856 -#: class-gf-stripe.php:3879 -#: class-gf-stripe.php:3921 -#: class-gf-stripe.php:5010 -#: class-gf-stripe.php:5872 +#: class-gf-stripe.php:3862 +#: class-gf-stripe.php:3885 +#: class-gf-stripe.php:3927 +#: class-gf-stripe.php:5016 +#: class-gf-stripe.php:5878 msgid "Your payment attempt has failed. Please enter your card details and try again." msgstr "" -#: class-gf-stripe.php:3916 -#: class-gf-stripe.php:5883 +#: class-gf-stripe.php:3922 +#: class-gf-stripe.php:5889 msgid "This payment might require 3D Secure authentication, please wait while we communicate with Stripe." msgstr "" -#: class-gf-stripe.php:3923 +#: class-gf-stripe.php:3929 msgid "The payment has been canceled" msgstr "" -#: class-gf-stripe.php:4078 +#: class-gf-stripe.php:4084 msgid "Payment with Discounts" msgstr "" -#: class-gf-stripe.php:4150 +#: class-gf-stripe.php:4156 msgid "Setup Fee" msgstr "" -#: class-gf-stripe.php:4237 +#: class-gf-stripe.php:4243 msgid "Unable to create Stripe Checkout session." msgstr "" -#: class-gf-stripe.php:4611 +#: class-gf-stripe.php:4617 msgid "Cannot get payment intent." msgstr "" -#: class-gf-stripe.php:4621 +#: class-gf-stripe.php:4627 msgid "Cannot get payment intent data." msgstr "" -#: class-gf-stripe.php:4639 +#: class-gf-stripe.php:4645 msgid "Cannot update payment intent data." msgstr "" -#: class-gf-stripe.php:4674 +#: class-gf-stripe.php:4680 msgid "Cannot capture payment intent data." msgstr "" -#: class-gf-stripe.php:4680 +#: class-gf-stripe.php:4686 msgid "Cannot capture the payment; the payment intent status is " msgstr "" -#: class-gf-stripe.php:4697 -#: class-gf-stripe.php:4732 +#: class-gf-stripe.php:4703 +#: class-gf-stripe.php:4738 msgid "Unable to capture the charge." msgstr "" -#: class-gf-stripe.php:4716 +#: class-gf-stripe.php:4722 msgid "Unable to save the charge." msgstr "" -#: class-gf-stripe.php:4786 +#: class-gf-stripe.php:4792 msgid "Failed to get the customer ID from Stripe." msgstr "" -#: class-gf-stripe.php:5313 -#: class-gf-stripe.php:6408 +#: class-gf-stripe.php:5319 +#: class-gf-stripe.php:6414 msgid "Subscription payment has been paid. Amount: %s. Subscription Id: %s" msgstr "" -#: class-gf-stripe.php:6042 +#: class-gf-stripe.php:6048 msgid "Unable to authorize card. No response from Stripe.js." msgstr "" -#: class-gf-stripe.php:6370 -#: class-gf-stripe.php:6444 +#: class-gf-stripe.php:6376 +#: class-gf-stripe.php:6450 msgid "Subscription line item not found in request" msgstr "" -#: class-gf-stripe.php:6473 -#: class-gf-stripe.php:6501 +#: class-gf-stripe.php:6479 +#: class-gf-stripe.php:6507 msgid "Invalid Checkout Session" msgstr "" -#: class-gf-stripe.php:6665 +#: class-gf-stripe.php:6671 msgid "Entry %d was not processed by feed %d. Webhook cannot be processed." msgstr "" -#: class-gf-stripe.php:6682 +#: class-gf-stripe.php:6688 msgid "Entry for %s id: %s was not found. Webhook cannot be processed." msgstr "" -#: class-gf-stripe.php:6763 +#: class-gf-stripe.php:6769 msgid "Invalid request. Webhook could not be processed." msgstr "" -#: class-gf-stripe.php:6769 +#: class-gf-stripe.php:6775 msgid "Test webhook succeeded. Your Stripe Account and Stripe Add-On are configured correctly to process webhooks." msgstr "" -#: class-gf-stripe.php:7300 +#: class-gf-stripe.php:7306 msgid "Setup fee has been paid." msgstr "" -#: class-gf-stripe.php:7302 +#: class-gf-stripe.php:7308 msgid "Trial has been paid." msgstr "" -#: class-gf-stripe.php:7504 +#: class-gf-stripe.php:7510 msgid "You're being redirected to the hosted Checkout page on Stripe..." msgstr "" -#: class-gf-stripe.php:7567 +#: class-gf-stripe.php:7573 msgid "Entry ID: %d" msgstr "" -#: class-gf-stripe.php:7571 +#: class-gf-stripe.php:7577 msgid "Product: %s" msgid_plural "Products: %s" msgstr[0] "" msgstr[1] "" -#: class-gf-stripe.php:7737 +#: class-gf-stripe.php:7743 msgid "Address" msgstr "" -#: class-gf-stripe.php:7743 +#: class-gf-stripe.php:7749 msgid "Address 2" msgstr "" -#: class-gf-stripe.php:7749 +#: class-gf-stripe.php:7755 msgid "City" msgstr "" -#: class-gf-stripe.php:7755 +#: class-gf-stripe.php:7761 msgid "State" msgstr "" -#: class-gf-stripe.php:7761 +#: class-gf-stripe.php:7767 msgid "Zip" msgstr "" -#: class-gf-stripe.php:7767 +#: class-gf-stripe.php:7773 msgid "Country" msgstr "" -#: class-gf-stripe.php:7894 +#: class-gf-stripe.php:7900 msgid "%1$sYour Gravity Forms Stripe Add-On has been updated to 3.0, and now supports Apple Pay and Strong Customer Authentication (SCA/PSD2).%2$s%3$sNOTE:%4$s Stripe has changed Stripe Checkout from a modal display to a full page, and we have altered some existing Stripe hooks. Carefully review %5$sthis guide%6$s to see if your setup may be affected.%7$s" msgstr "" -#: class-gf-stripe.php:7907 +#: class-gf-stripe.php:7913 msgid "%1$sYour Gravity Forms Stripe Add-On has been updated to 3.0, and now supports Apple Pay and Strong Customer Authentication (SCA/PSD2).%2$s%3$sNOTE:%4$s Apple Pay and SCA are only supported by the Stripe Checkout payment collection method. Refer to %5$sthis guide%6$s for more information on payment methods and SCA.%7$s" msgstr "" -#: class-gf-stripe.php:7997 +#: class-gf-stripe.php:8003 msgid "%1$sYour Gravity Forms Stripe Add-On has been updated to 3.4, and now supports Strong Customer Authentication (SCA/PSD2).%2$s%3$sRefer to %4$sthis guide%5$s for more information on payment methods and SCA.%6$s" msgstr "" -#: class-gf-stripe.php:8008 +#: class-gf-stripe.php:8014 msgid "%1$sYour Gravity Forms Stripe Add-On has been updated to 3.4, and it no longer supports the Gravity Forms Credit Card Field in new forms (current integrations can still work as usual).%2$s%3$sRefer to %4$sthis guide%5$s for more information about this change.%6$s" msgstr "" #. translators: PaymentIntent status. -#: class-gf-stripe.php:8100 -#: class-gf-stripe.php:8145 +#. translators: PaymentIntent status. +#: class-gf-stripe.php:8106 +#: class-gf-stripe.php:8151 msgid "PaymentIntent status: %s is invalid." msgstr "" -#: class-gf-stripe.php:8165 -#: class-gf-stripe.php:8250 +#: class-gf-stripe.php:8171 +#: class-gf-stripe.php:8256 msgid "Unable to find entry." msgstr "" -#: class-gf-stripe.php:8172 -#: class-gf-stripe.php:8257 +#: class-gf-stripe.php:8178 +#: class-gf-stripe.php:8263 msgid "Unable to find payment feed." msgstr "" -#: class-gf-stripe.php:8178 +#: class-gf-stripe.php:8184 msgid "Could not initialize Stripe API." msgstr "" -#: class-gf-stripe.php:8275 +#: class-gf-stripe.php:8281 msgid "Unable to find payment on Stripe" msgstr "" -#: class-gf-stripe.php:8483 +#: class-gf-stripe.php:8489 msgid "Unnamed account" msgstr "" -#: class-gf-stripe.php:8508 +#: class-gf-stripe.php:8514 msgid "Could not retrieve payment information from Stripe." msgstr "" -#: class-gf-stripe.php:8516 +#: class-gf-stripe.php:8522 msgid "Payment has already been captured." msgstr "" -#: class-gf-stripe.php:8527 +#: class-gf-stripe.php:8533 msgid "Unable to capture payment" msgstr "" -#: class-gf-stripe.php:8538 +#: class-gf-stripe.php:8544 msgid "Payment captured successfully." msgstr "" -#: class-gf-stripe.php:8585 +#: class-gf-stripe.php:8591 msgid "Feed associated with entry could not be found." msgstr "" -#: class-gf-stripe.php:8620 +#: class-gf-stripe.php:8626 msgid "Refund Payment" msgstr "" -#: class-gf-stripe.php:8621 +#: class-gf-stripe.php:8627 msgid "Sending refund request" msgstr "" -#: class-gf-stripe.php:8646 +#: class-gf-stripe.php:8652 #: includes/class-gf-field-stripe-creditcard.php:73 #: includes/class-gf-field-stripe-creditcard.php:264 msgid "Cardholder Name" diff --git a/stripe.php b/stripe.php index a0c0491..96fcfb8 100644 --- a/stripe.php +++ b/stripe.php @@ -3,7 +3,7 @@ * Plugin Name: Gravity Forms Stripe Add-On * Plugin URI: https://gravityforms.com * Description: Integrates Gravity Forms with Stripe, enabling end users to purchase goods and services through Gravity Forms. - * Version: 5.6.0 + * Version: 5.7.0 * Author: Gravity Forms * Author URI: https://gravityforms.com * License: GPL-2.0+ @@ -30,7 +30,7 @@ defined( 'ABSPATH' ) || die(); -define( 'GF_STRIPE_VERSION', '5.6.0' ); +define( 'GF_STRIPE_VERSION', '5.7.0' ); // If Gravity Forms is loaded, bootstrap the Stripe Add-On. add_action( 'gform_loaded', array( 'GF_Stripe_Bootstrap', 'load' ), 5 );