(()=>{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(o,t){for(var n=0;n<t.length;n++){var e=t[n];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(o,(a=e.key,i=void 0,i=function(o,t){if("object"!==r(o)||null===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)}(a,"string"),"symbol"===r(i)?i:String(i)),e)}var a,i}var t,n=function(){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}var t,n,e;return t=r,(n=[{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(t.prototype,n),e&&o(t,e),Object.defineProperty(t,"prototype",{writable:!1}),r}();(t=jQuery).each(t("form.fluentform_has_payment"),(function(){var r=t(this);r.on("fluentform_init_single",(function(o,t){new n(r,t).init()}))}))})();