(()=>{function r(o){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},r(o)}function o(r,o){for(var n=0;n<o.length;n++){var e=o[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(r,t(e.key),e)}}function t(o){var t=function(o,t){if("object"!=r(o)||!o)return o;var n=o[Symbol.toPrimitive];if(void 0!==n){var e=n.call(o,t||"default");if("object"!=r(e))return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(o)}(o,"string");return"symbol"==r(t)?t:t+""}var n=function(){return r=function r(o,t){!function(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}(this,r);var n=t.settings.id;this.$form=o,this.formInstance=t,this.formId=n},(t=[{key:"init",value:function(){var r=this;this.$form.on("fluentform_next_action_razorpay",(function(o,t){var n=t.response;r.$form.parent().find(".ff_razorpay_text").remove(),jQuery("<div/>",{id:"form_success",class:"ff-message-success ff_razorpay_text"}).html(n.data.message).insertAfter(r.$form),"initRazorPayModal"===n.data.actionName?r.initRazorPayModal(n.data):alert("No method found")}))}},{key:"initRazorPayModal",value:function(r){var o=this,t=r.modal_data;t.handler=function(t){o.formInstance.hideFormSubmissionProgress(o.$form);var n={action:"fluentform_razorpay_confirm_payment",transaction_hash:r.transaction_hash,form_id:o.formId,razorpay_order_id:t.razorpay_order_id,razorpay_payment_id:t.razorpay_payment_id,razorpay_signature:t.razorpay_signature};o.$form.parent().find(".ff_razorpay_text").remove(),jQuery("<div/>",{id:o.formId+"_success",class:"ff-message-success ff_msg_temp ff_razorpay_text"}).html(r.confirming_text).insertAfter(o.$form),o.formInstance.showFormSubmissionProgress(o.$form),o.formInstance.sendData(o.$form,n)},t.modal={escape:!1,ondismiss:function(){o.$form.parent().find(".ff_razorpay_text").remove(),o.formInstance.hideFormSubmissionProgress(o.$form)}};var n=new Razorpay(t);n.on("payment.failed",(function(r){console.log(r),o.formInstance.hideFormSubmissionProgress(o.$form)})),this.formInstance.showFormSubmissionProgress(this.$form),n.open()}}])&&o(r.prototype,t),n&&o(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,t,n}();function e(r){r.each(r("form.fluentform_has_payment"),(function(){function o(r,o){new n(t,o).init()}var t=r(this);t.off("fluentform_init_single","",o),t.on("fluentform_init_single",o)}))}e(jQuery),jQuery(document).ready((function(r){e(r)}))})();