"use strict";!function(n){n(document).ready(function(){n("#paymentChannelSuggestionLink").click(function(e){n("#paymentChannelSuggestionModal").show(),n("#overlay").show()}),n("#btnIconClose").click(function(){n("#paymentChannelSuggestionModal").hide(),n("#overlay").hide()}),n("#paymentChannelSuggestionValue").keyup(function(){n("#paymentChannelSuggestionErrorMsg").html(""),n("#paymentChannelSuggestionErrorMsgDiv").hide()}),n("#paymentChannelSuggestionForm").submit(function(e){var t=n("#paymentChannelSuggestionCountry").val().trim(),a=n("#paymentChannelSuggestionValue").val().trim(),o=n("#g-recaptcha-response").val().trim();if(!a||0===a.length)return n("#paymentChannelSuggestionErrorMsg").html(CODA.Shop.translation.paymentChannelSuggestionRequired?CODA.Shop.translation.paymentChannelSuggestionRequired:"Field cannot be empty."),n("#paymentChannelSuggestionErrorMsgDiv").show(),!1;if(!o||0===o.length)return n("#paymentChannelSuggestionErrorMsg").html(CODA.Shop.translation.paymentChannelSuggestionCaptchaRequired?CODA.Shop.translation.paymentChannelSuggestionCaptchaRequired:"Please tick this box."),n("#paymentChannelSuggestionErrorMsgDiv").show(),!1;e.preventDefault();var i=n(this).attr("action"),r={countryCode:t,preferedPaymentChannel:a,gRecaptchaResponse:o};n.ajax({type:"POST",url:i,headers:{"Content-Type":"application/json",Accept:"application/json"},data:JSON.stringify(r),timeout:1e4,beforeSend:function(){},success:function(e){e.success?(n("#paymentChannelSuggestionValue").val(""),n("#paymentChannelSuggestionModal").hide(),n("#overlay").hide(),n("#paymentChannelSuggestionErrorMsg").html(""),n("#paymentChannelSuggestionErrorMsgDiv").hide(),grecaptcha.reset()):(n("#paymentChannelSuggestionErrorMsg").html(e.message),n("#paymentChannelSuggestionErrorMsgDiv").show())},complete:function(n,e){},error:function(n,e,t){console.log(t)},dataType:"json"})})})}(jQuery);