// source --> https://edelhanf.de/wp-content/plugins/woocommerce-novalnet-gateway/assets/js/novalnet.min.js?ver=12.10.3 
!function(e){wc_novalnet={iban_payments:{novalnet_sepa:"novalnet_sepa_iban",novalnet_guaranteed_sepa:"novalnet_guaranteed_sepa_iban",novalnet_instalment_sepa:"novalnet_instalment_sepa_iban"},init:function(){"undefined"!=typeof wc_novalnet_data&&"yes"===wc_novalnet_data.is_pay_for_order_page&&e(document.body).trigger("wc-credit-card-form-init"),e("#novalnet-instalment-suggestions").mouseover((function(){e(".novalnet-popover-container").show()})),e(".novalnet-popover-button-close").on("click",(function(){e(".novalnet-popover-container").hide()})),e("#novalnet_guaranteed_sepa_bic_field, #novalnet_sepa_bic_field, #novalnet_instalment_sepa_bic_field").css("display","none"),wc_novalnet.check_iban(),e("#"+wc_novalnet.form_id()).on("click",(function(n){var a=e("input[name=payment_method]:checked").val();if(-1!=e.inArray(a,["novalnet_sepa","novalnet_guaranteed_sepa","novalnet_instalment_sepa"])&&wc_novalnet.check_payment(a)&&(void 0!==e("#"+a+"_iban")&&(e("#novalnet_guaranteed_sepa_bic_field, #novalnet_sepa_bic_field, #novalnet_instalment_sepa_bic_field").css("display","none"),wc_novalnet.check_iban(),""===NovalnetUtility.formatAlphaNumeric(e("#"+a+"_iban").val()))))return wc_novalnet.show_error("#"+a+"_error",wc_novalnet_data.sepa_account_error);return!!(-1==e.inArray(a,["novalnet_guaranteed_invoice","novalnet_guaranteed_sepa","novalnet_instalment_invoice","novalnet_instalment_sepa"])||void 0===e("#"+a+"_dob")||void 0===e("#"+a+"_dob").val()||""!==e("#"+a+"_dob").val()&&NovalnetUtility.validateDateFormat(e("#"+a+"_dob").val()))||wc_novalnet.show_error("#"+a+"_error",wc_novalnet_data.dob_error)})),e("#novalnet_instalment_invoice_period, #novalnet_instalment_sepa_period").trigger("change"),e("#billing_company, #ship-to-different-address-checkbox").on("change",(function(){void 0===e("#novalnet_valid_company").val()?e("#billing_company:last").append("<input type='hidden' name='novalnet_valid_company' id='novalnet_valid_company' value = '"+NovalnetUtility.isValidCompanyName(e("#billing_company").val())+"'/>"):e("#novalnet_valid_company").val(NovalnetUtility.isValidCompanyName(e("#billing_company").val())),e(document.body).trigger("update_checkout")})).change()},is_valid_name:function(e){var n=e.which?e.which:e.keyCode;return n>=65&&n<=90||n>=97&&n<=122||38===n||45===n||46===n||32===n||(e.preventDefault(),!1)},is_number:function(e){var n=e.which?e.which:e.keyCode;return!(n>31&&(n<48||n>57))||(e.preventDefault(),!1)},check_iban:function(){wc_novalnet.set_iban_placeholder(),e.each(wc_novalnet.iban_payments,(function(n,a){if(""!==e("#"+a).val()&&null!=e("#"+a).val()){var t=e("#"+a).val().substring(0,2);wc_novalnet_data.bic_allowed_countries.includes(t.toUpperCase())&&e("#"+n+"_bic_field").css("display","block")}}))},form_id:function(){var n=void 0!==e("#order_review button[type=submit]").attr("id")&&""!==e("#order_review button[type=submit]").attr("id")?e("#order_review button[type=submit]").attr("id"):e("#order_review input[type=submit]").attr("id");return null==n?"place_order":n},check_payment:function(n){return n===e("input[name=payment_method]:checked").val()&&(void 0===e("#wc-"+n+"-payment-token-new").val()||e("#wc-"+n+"-payment-token-new").is(":checked"))},load_block:function(n,a){e("#"+n).block({message:"",overlayCSS:{background:"#fff",opacity:.6}})},show_error:function(n,a=""){return void 0!==a&&""!==a&&(e(n).closest(".form-row").removeClass("woocommerce-validated").addClass("woocommerce-invalid woocommerce-invalid-required-field"),e(n).html('<ul class="woocommerce-error"><li>'+a+"</li></ul>")),e(n).css("display","block"),e("html, body").animate({scrollTop:e(n).offset().top-100},1e3),setTimeout((function(){e(n).fadeOut("slow")}),5e3),!1},hide_error:function(n){e(n).html("")},show_instalment_table:function(n){if(void 0!==e("#"+n+"_period option:selected")&&""!==e("#"+n+"_period option:selected").val()){var a=e("#"+n+"_period option:selected").val();e("table[id^='"+n+"_table_']").css("display","none"),e("#"+n+"_table_"+a).css("display","")}},validate_date_format:function(e,n){if(!NovalnetUtility.validateDateFormat(e.value))return wc_novalnet.show_error("#"+n+"_error",wc_novalnet_data.dob_error)},set_iban_placeholder(){if(null!=e("#billing_country").val()&&""!=e("#billing_country").val()){var n=e("#billing_country").val()+"XX XXXX XXXX XXXX XXXX XX";e.each(wc_novalnet.iban_payments,(function(a,t){null!=e("#"+t).val()&&""==e("#"+t).val()&&e("#"+t).attr("placeholder",n)}))}},init_ajax:function(){e("#novalnet_instalment_invoice_period, #novalnet_instalment_sepa_period").trigger("change"),e("#novalnet_guaranteed_sepa_bic_field, #novalnet_sepa_bic_field, #novalnet_instalment_sepa_bic_field").css("display","none"),wc_novalnet.check_iban()},check_multistep_chosen_payment:function(){if(!e("#place_order").is(":visible"))return!0;let n=e("input[name=payment_method]:checked").val();e.ajax({url:wc_novalnet_data.ajax_url,type:"POST",data:{action:"check_mutlistep_payment"},success:function(e){""!==(void 0!==e.data.wc_chosen_payment?e.data.wc_chosen_payment:"")&&n!==e.data.wc_chosen_payment&&alert(wc_novalnet_data.gzdp_multistep_error)},error:function(e){alert(e.responseText)}})}},e(document).ready((function(){wc_novalnet.init(),e(document.body).on("updated_checkout",(function(e){wc_novalnet.init_ajax(),void 0!==window.germanized&&wc_novalnet.check_multistep_chosen_payment()})),e(document.body).on("checkout_error",(function(e){wc_novalnet.init_ajax()})),e("#update_all_subscriptions_payment_method").prop("checked",!1)}))}(jQuery);