File "seamless.min.js"
Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/swedbank-pay-checkout/assets/js/seamless.min.js
File size: 3.83 KB
MIME-type: text/plain
Charset: utf-8
jQuery((function(e){"use strict";window.wc_sb_checkout_seamless={xhr:!1,init:function(o){this.form=o,this.form_submit=!1,this.js_url=null,e(this.form)},onSubmit:function(e){return!!e.data.obj.form_submit||!!e.data.obj.validateForm()&&(console.log("onSubmit"),!e.data.obj.form.is(".processing")&&(window.hasOwnProperty("wc_sb_checkin")&&window.wc_sb_checkin.isCheckinEnabled()&&window.wc_sb_checkin.isCheckinRequired()&&!window.wc_sb_checkin.isCustomerIdentified()?(e.data.obj.submit_error('<div class="woocommerce-error">'+WC_Gateway_Swedbank_Pay_Checkin.needs_checkin+"</div>"),!1):(console.log(this.js_url),void e.data.obj.waitForJsUrl())))},validateForm:function(){var o,t=!0;return(o=e("#ship-to-different-address-checkbox").is(":checked")?e(".woocommerce-billing-fields .validate-required, .woocommerce-shipping-fields .validate-required").find("input, select").not(e("#account_password, #account_username")):e(".woocommerce-billing-fields .validate-required").find("input, select").not(e("#account_password, #account_username"))).length&&o.each((function(){var o=e(this),u=o.closest(".form-row"),i=u.is(".validate-required"),c=u.is(".validate-email");(i&&("checkbox"!==o.attr("type")||o.is(":checked")?""===o.val()&&(t=!1):t=!1),c)&&(o.val()&&(new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i).test(o.val())||(t=!1)))})),t},setJsUrl:function(e){console.log("setJsUrl"),console.log(e),this.js_url=e},waitForJsUrl:function(){var e=this;let o=window.setInterval((function(){e.js_url&&(console.log("waitForJsUrl: "+e.js_url),window.clearInterval(o),e.initFrame(e.js_url))}),1e3)},initFrame:function(o,t){void 0===t&&(t=function(){});var u=this;this.loadJs(o,(function(){e.featherlight('<div id="swedbank-pay-seamless"> </div>',{variant:"featherlight-swedbank-seamless",persist:!0,closeOnClick:!1,closeOnEsc:!1,afterOpen:function(){u.initPaymentMenu("swedbank-pay-seamless")},afterClose:function(){u.form.removeClass("processing").unblock()}}),t()}))},loadJs:function(e,o){let t=document.createElement("script");t.setAttribute("src",e),t.setAttribute("type","text/javascript"),t.setAttribute("async",""),t.addEventListener("load",(function(){o()}),!1);let u=document.getElementsByTagName("head")[0];return u&&u.appendChild(t),t},submit_error:function(o){e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<div class="woocommerce-NoticeGroup woocommerce-NoticeGroup-checkout">'+o+"</div>"),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select, input:checkbox").trigger("validate").blur(),this.scroll_to_notices(),e(document.body).trigger("checkout_error")},scroll_to_notices:function(){let o=e(".woocommerce-NoticeGroup-updateOrderReview, .woocommerce-NoticeGroup-checkout");o.length||(o=e(".form.checkout")),e.scroll_to_notices(o)},checkPaymentUrl:function(){new URLSearchParams(document.location.search).get("payment_url")&&this.initFrame(this.payment_url,(function(){console.log("Payment url has been loaded.")}))}}}));
//# sourceMappingURL=seamless.min.js.map