!function(){var eventMethod=window.addEventListener?"addEventListener":"attachEvent",eventer=window[eventMethod],messageEvent="attachEvent"==eventMethod?"onmessage":"message",config={siteUrl:"https://paystack.com/",paystackApiUrl:"https://api.paystack.co/",newCheckoutUrl:"https://checkout.paystack.com/"};function Inline(t){this.iframe=null,this.background=null,this.iframeLoaded=!1,this.iframeOpen=!1,this.defaults=t,this.isEmbed=t&&null!=t.container,this.checkoutLoaded=!1,this.checkoutRemoved=!1,this.loadedButtonCSS=!1,this.setup(),this.listenForEvents(),noBrowserIframeSupport()&&(this.fallback=!0)}Inline.prototype.setTransaction=function(t){this.defaults&&this.resetNewCheckout(),this.defaults=t,this.isEmbed=null!=t.container,this.isEmbed?(this.removeNewCheckout(),this.setupEmbed()):this.updateIframe()},Inline.prototype.setForm=function(t){this.form=t,this.createButton()},Inline.prototype.loadButtonCSS=function(){var t=this;cssLoad(config.siteUrl+"public/css/button.min.css").done(function(){t.loadedButtonCSS=!0})},Inline.prototype.createButton=function(){var t,e=this;e.defaults.customButton?(t=document.getElementById(e.defaults.customButton)).setAttribute("data-paystack",e.defaults.id):((t=document.createElement("button")).innerHTML="Pay Securely with Paystack ",t.setAttribute("class","paystack-trigger-btn"),t.setAttribute("data-paystack",e.defaults.id),sourceScript.parentNode.insertBefore(t,sourceScript.nextSibling)),t.addEventListener("click",function(t){t.preventDefault(),e.openIframe()},!1)},Inline.prototype.setup=function(){this.isEmbed?this.setupEmbed():this.setupNewPopup(),this.loadedButtonCSS||this.loadButtonCSS()},Inline.prototype.setupEmbed=function(){var t=document.getElementById(this.defaults.container);t.innerHTML="",t.removeAttribute("style"),t.className="paystack-embed-container",t.style.position="relative",t.style.width="100%",this.listenForResizeEvent(),this.appendIframe({src:this.getOldCheckoutURL(),cssText:"background: transparent;\nbackground: rgba(0,0,0,0);\nborder: 0px none transparent;\noverflow-x: hidden;\noverflow-y: hidden;\nmargin: 0;\npadding: 0;\n-webkit-tap-highlight-color: transparent;\n-webkit-touch-callout: none;\nleft: 0;\ntop: 0;\nwidth: 100%;\nheight: 100%;",className:"paystack_embed",parent:t}),this.isSetup=!0,this.openOldCheckout()},Inline.prototype.setupOldPopup=function(){var t=10*findHighestZIndex("div"),e="z-index: "+Math.max(t,999999);e+=";\ndisplay: none;\nbackground: transparent;\nbackground: rgba(0,0,0,0.005);\nborder: 0px none transparent;\noverflow-x: hidden;\noverflow-y: hidden;\nvisibility: hidden;\nmargin: 0;\npadding: 0;\n-webkit-tap-highlight-color: transparent;\n-webkit-touch-callout: none; position: fixed;\nleft: 0;\ntop: 0;\nwidth: 100%;\nheight: 100%;",this.appendIframe({src:this.getOldCheckoutURL(),cssText:e,className:"paystack_pop",parent:document.body}),this.isSetup=!0},Inline.prototype.getTransactionParameters=function(){if(!this.defaults)return null;this.defaults.metadata.referrer=getHref();var t=omitKeys(this.defaults,["customButton","onClose","callback","tlsFallback"]);return t.mode="popup",t.hasTLSFallback=null!==this.defaults.tlsFallback,t.metadata&&"string"!=typeof t.metadata&&(t.metadata=JSON.stringify(t.metadata)),t.split&&"string"!=typeof t.split&&0 Paystack Checkout Loader '),e.close();var n=document.createElement("iframe");n.setAttribute("frameBorder","0"),n.setAttribute("allowtransparency","true"),n.setAttribute("allowpaymentrequest","true"),n.id=randomId(),n.name="paystack-checkout-"+n.id,n.style.cssText="z-index: 999999999999999;background: transparent;border: 0px none transparent;overflow-x: hidden;overflow-y: hidden;margin: 0;padding: 0;-webkit-tap-highlight-color: transparent;-webkit-touch-callout: none;position: fixed;left: 0;top: 0;width: 100%;height: 100%;visibility:hidden;",n.style.display="none",n.src=config.newCheckoutUrl+"popup",this.iframe=n,document.body.appendChild(n)},Inline.prototype.openNewCheckout=function(){!this.iframe||this.isIframeOpen||this.isEmbed||(this.background.style.display="",this.background.style.visibility="visible",this.iframe.style.display="",this.iframe.contentWindow.postMessage("render","*"),this.isIframeOpen=!0)},Inline.prototype.removeLoader=function(){this.iframe.style.visibility="visible",this.background.contentWindow.document.getElementById("app-loader").style.display="none"},Inline.prototype.handleNewCheckoutEvents=function(t){if(t.origin+"/"===config.newCheckoutUrl&&this.iframe.contentWindow==t.source){var e=t.data||t.message;if("loaded:checkout"===e&&(this.checkoutLoaded=!0,this.defaults&&this.updateIframe()),"loaded:transaction"===e&&this.removeLoader(),"close"===e){if(this.closeNewCheckout(),!this.defaults.onClose)return;this.defaults.onClose.call(this)}try{var n=JSON.parse(e);n&&"success"===n.status&&(this.closeNewCheckout(!0),this.handleSuccess(n))}catch(t){}}},Inline.prototype.closeNewCheckout=function(t){var e=this;e.background.style.opacity=0,e.iframe.style.display="none",e.iframe.contentWindow.postMessage("close","*"),e.isIframeOpen=!1,setTimeout(function(){e.resetBackgroundAndLoader()},300)},Inline.prototype.resetNewCheckout=function(){this.resetMainIframe(),this.resetBackgroundAndLoader()},Inline.prototype.resetMainIframe=function(){this.iframe.style.visibility="hidden",this.defaults=null,this.updateIframe()},Inline.prototype.resetBackgroundAndLoader=function(){this.background.style.display="none",this.background.style.opacity=1,this.background.contentWindow.document.getElementById("app-loader").style.display="block"},Inline.prototype.removeNewCheckout=function(){this.iframe.parentElement.removeChild(this.iframe),this.background.parentElement.removeChild(this.background),this.iframe=null,this.background=null,this.checkoutRemoved=!0},Inline.prototype.handleSuccess=function(t){var e;if(this.defaults.callback||this.form)return this.form?((e=document.createElement("input")).type="hidden",e.value=t.reference,e.name="reference",this.form.appendChild(e),(e=document.createElement("input")).type="hidden",e.value=t.reference,e.name="paystack-trxref",this.form.appendChild(e),void this.form.submit()):void(this.defaults.callback&&this.defaults.callback.call(this,t))},Inline.prototype.callCloseCallback=function(){this.defaults.onClose&&this.defaults.onClose.call(this)};var PaystackPop={isInitialized:!1,initialize:function(t){ca=new Inline(t),this.isInitialized=!0},setup:function(t,e){var n="paystack"+randomId(),r={id:n,key:t.key||"",ref:t.ref||"",label:t.label||"",email:t.email||"",amount:t.amount||"",currency:t.currency||"NGN",container:t.container,customButton:t.custom_button||t.customButton||"",firstname:t.firstname||"",lastname:t.lastname||"",phone:t.phone||"",remark:t.remark||"",payment_page:t.payment_page||t.paymentPage||"",payment_request:t.payment_request||t.paymentRequest||"",plan:t.plan||"",quantity:t.quantity||"",coupon:t.coupon||"",customer_code:t.customer_code||t.customerCode||"",invoice_limit:t.invoice_limit||t.invoiceLimit||"",start_date:t.start_date||t.startDate||"",interval:t.interval||t.interval||"",subaccount:t.subaccount||"",split:t.split||{},split_code:t.split_code||"",transaction_charge:t.transaction_charge||t.transactionCharge||"",bearer:t.bearer||"",metadata:t.metadata||{},onClose:t.on_close||t.onClose||"",callback:t.callback||"",tlsFallback:t.tlsFallback||"",channels:t.channels||"",hash:t.hash||"",card:t.card||"",bank:t.bank||""};if(isValid(r)){if(this.isInitialized?ca.setTransaction(r):this.initialize(r),!e)return ca;checkForParentForm(e),ca.setForm(getParentForm(e)),window[n]=ca}}},ca;window.PaystackPop=PaystackPop,window.onload=function(){PaystackPop.isInitialized||PaystackPop.initialize()};var sourceScript=document.currentScript||(ia=document.getElementsByTagName("script"),ia[ia.length-1]),ia;function parseObject(e){try{return JSON.parse(e)}catch(t){return e}}function parseFunction(string){try{return eval(string)}catch(t){return string}}function randomId(){for(var t="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=0;n<5;n++)t+=e.charAt(Math.floor(Math.random()*e.length));return t}function isValid(t){if(validateInputTypes(t),null==t.key)throw new Error("Please provide your public key via the key attribute");if(null==t.amount&&null==t.plan)throw new Error("Please provide transaction amount via the amount or plan attribute");if(null==t.email&&null==t.customer_code)throw new Error("Please provide customer email via the email or customerCode attribute");if(t.transaction_charge&&t.transaction_charge>=t.amount)throw new Error("Transaction charge must be less than the transaction amount");if(t.bearer&&"account"!=t.bearer&&"subaccount"!=t.bearer)throw new Error("Bearer should be either account or subaccount");if(t.channels&&!t.channels.length)throw new Error("Channels should be an array of [card, bank] values");if(t.customButton&&null!=t.customButton&&null==document.getElementById(t.customButton))throw new Error("Please ensure a button with id "+t.customButton+" is defined");if(t.container&&null!=t.container&&null==document.getElementById(t.container))throw new Error("Please ensure an element with id "+t.container+" is defined");return!0}function validateInputTypes(t){var n={email:"email",amount:"integer",transaction_charge:"integer",invoice_limit:"integer",onClose:"function",callback:"function",metadata:"object",channels:"array"};for(var e in t){r(e,t[e])}function r(t,e){if(n[t]&&e)switch(n[t]){case"email":isValidEmail(e)||i(t);break;case"integer":isNormalInteger(e)||i(t);break;case"function":isFunction(e)||i(t);break;case"object":isObject(e)||i(t);break;case"array":isArray(e)||i(t)}}function i(t){throw new Error("Attribute "+t+" must be a valid "+n[t])}}function checkForParentForm(t){if("FORM"==t.parentElement.tagName)return!0;throw new Error("Please put your Paystack Inline javascript file inside of a form element")}function getParentForm(t){return form=t.parentElement}function hasDataAttribute(t){var e=!1,n=t.attributes;for(key in n=Array.prototype.slice.call(n)){var r=n[key].nodeName;r&&-1()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}function getHref(){var t=window.location.href;return t&&500t;t++)a(t,o[t])})},a.resolve=function(e){return e&&"object"==typeof e&&e.constructor===a?e:new a(function(t){t(e)})},a.reject=function(n){return new a(function(t,e){e(n)})},a.race=function(i){return new a(function(t,e){for(var n=0,r=i.length;n