jQuery(document).ready((()=>{const e="wppay-card-iframe",t=document.getElementById(e),a=jQuery("form.checkout");let d=!1;CardWidget.actionURL=t.getAttribute("data-url"),jQuery(window).on("message",(e=>{const t=CardWidget.eventListener(e);t&&"PAYMENT_TOKEN"===t.status&&(jQuery("form.checkout [name=card_token]").val(t.message),d=!0,a.submit())})),a.on("checkout_place_order",(()=>!(!d&&"wppay-card"===jQuery("[name=payment_method]:checked").val()&&(CardWidget.sendCardsForm(document.getElementById(e).contentWindow),1))))}));