(()=>{vare,t,n,r;functiono(e,t){for(varn=0;n<t.length;n++){varr=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}functioni(e,t,n){returntine?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}vara=function(){functione(t,n){varr=this;!function(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}(this,e),i(this,"setupStripe",(function(){r.stripeConnect?r.stripe=Stripe(r.key,{stripeAccount:r.stripeConnect}):r.stripe=Stripe(r.key);vare=r.stripe.elements();returnr.fpx=e.create("fpxBank",{style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}},accountHolderType:"individual"}),r.fpx.mount("#fpx-bank-element"),r})),i(this,"handle",(function(){document.getElementById("pay-now").addEventListener("click",(function(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),r.stripe.confirmFpxPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{fpx:r.fpx},return_url:document.querySelector('meta[name="return-url"]').content}).then((function(e){e.error&&r.handleFailure(e.error.message)}))}))})),this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=n}vart,n,r;returnt=e,(n=[{key:"handleFailure",value:function(e){vart=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}])&&o(t.prototype,n),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();newa(null!==(e=null===(t=document.querySelector('meta[name="stripe-publishable-key"]'))||void0===t?void0:t.content)&&void0!==e?e:"",null!==(n=null===(r=document.querySelector('meta[name="stripe-account-id"]'))||void0===r?void0:r.content)&&void0!==n?n:"").setupStripe().handle()})();