jQuery(document).ready(function(a){var e=a("body").find(".ff_paypal_delay_loader_check");if(e.length){n();var o=0}function n(){o++,setTimeout(t,window.ff_paypal_vars.timeout)}function t(){a.post(window.ff_paypal_vars.ajax_url,{submission_id:window.ff_paypal_vars.submission_id,_ff_payment_token:window.ff_paypal_vars._ff_payment_token||"",action:"fluentform_paypal_delayed_check"}).then(function(t){t.data.nextAction&&"reload"==t.data.nextAction?window.location.reload():o<=5?n():(a(".ff_paypal_loader_svg").remove(),e.html(window.ff_paypal_vars.onFailedMessage))}).catch(function(o){var n=function(e,o){var n=a(".ff_paypal_delay_loader_check").closest("form").data("form_id")||a("form[data-form_id]").first().data("form_id");if(n){var t="fluentform_gateway_messages_"+n;if(window[t]&&window[t][e])return window[t][e]}return o}("request_failed","Request failed. Please try again");o.responseJSON?o.responseJSON.data&&(n=o.responseJSON.data.message):n=o.responseText,e.html(n)})}});