(()=>{"use strict";var e={969:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BankAccountFunctions=void 0;var o=n(882),r=function(){function e(){}return e.prototype.tokenize=function(e,t,n,r,i){n=o.trimWS(n||"");var a={country:"US",currency:"usd",routing_number:r=o.trimWS(r||""),account_number:n,account_holder_name:e,account_holder_type:t};o.tokenize({bank_account:a},i)},e}();t.BankAccountFunctions=r},673:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CardFunctions=void 0;var o=n(882),r=function(){function e(){}return e.prototype.tokenize=function(e,t,n,r,i,a,c){n=o.trimWS(n||""),r=o.trimWS(r||"");var s={number:e=(e||"").replace(/\D/g,""),cvc:t,exp_month:n,exp_year:r,name:i};a&&(s.address={address1:a.address1,address2:a.address2,city:a.city,state:a.state,postal_code:a.postal_code,country:a.country});var d=setInterval((function(){null!=document.body&&(clearInterval(d),function(){var e=null;try{void 0!==window.WePay&&(window.WePay.generate_risk_token(),e=window.WePay.get_risk_token())}catch(e){console.error(e)}o.tokenize({card:s,wepay_risk:e},c)}())}),1)},e}();t.CardFunctions=r},973:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WePay=t.initializeWePay=void 0,t.initializeWePay=function(){if(void 0===window.WePay){window.WePay=new n;try{void 0!==window.attachEvent?window.attachEvent("onload",window.WePay.generate_risk_token_onload):window.addEventListener("load",window.WePay.generate_risk_token_onload,!1)}catch(e){console.error(e)}}};var n=function(){function e(){this.device_token=""}return e.prototype.generate_risk_token_onload=function(){setTimeout(this.generate_risk_token,5e3)},e.prototype.generate_risk_token=function(){this.enable_device(this.insert())},e.prototype.get_risk_token=function(){return this.device_token},e.prototype.uuid=function(){for(var e=new Array(36),t="0123456789abcdef",n=0;n<36;n++)e[n]=t.substr(Math.floor(16*Math.random()),1);return e[14]="4",e[19]=t.substr(3&parseInt(e[19]||"0",16)|8,1),e[8]=e[13]=e[18]=e[23]="-",e.join("")},e.prototype.generate=function(e){var t=document.createElement("div"),n=document.createElement("div"),o=document.createElement("img"),r=document.createElement("script"),i=document.createElement("object"),a=document.createElement("param"),c=document.createElement("div");return t.id="WePay-tags",t.style.position="absolute",t.style.left="-1000px",n.style.background="url('https://t.wepay.com/fp/clear.png?org_id=ncwzrc4k&session_id="+e+"&m=1')",o.src="https://t.wepay.com/fp/clear.png?org_id=ncwzrc4k&session_id="+e+"&m=2",o.alt="",r.src="https://t.wepay.com/fp/check.js?org_id=ncwzrc4k&session_id="+e,r.type="text/javascript",r.async=!0,i.type="application/x-shockwave-flash",i.data="https://t.wepay.com/fp/fp.swf?org_id=ncwzrc4k&session_id="+e,i.width="1",i.height="1",i.id="obj_id",a.name="movie",a.value="https://t.wepay.com/fp/fp.swf?org_id=ncwzrc4k&session_id="+e,i.appendChild(a),i.appendChild(c),t.appendChild(n),t.appendChild(o),t.appendChild(r),t.appendChild(i),t},e.prototype.enable_device=function(e){this.device_token=e},e.prototype.insert=function(e){return e=e||this.device_token||this.uuid(),document.getElementById("WePay-tags")||document.body.appendChild(this.generate(e)),e},e}();t.WePay=n},882:(e,t)=>{function n(e,t){var o=[];for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var i=e[r];null==i||(i&&"object"==typeof i?t?o.push(n(i,t+"["+r+"]")):o.push(n(i,r)):t?o.push(t+"["+encodeURIComponent(r)+"]="+encodeURIComponent(i)):o.push(encodeURIComponent(r)+"="+encodeURIComponent(i)))}return o.join("&")}Object.defineProperty(t,"__esModule",{value:!0}),t.trimWS=t.tokenize=void 0,t.tokenize=function(e,t){var o,r,i,a,c;e.key=window.Invoiced.getPublishableKey(),o=window.Invoiced.getTokenizeEndpoint(),r=e,i=function(e,n){t(n,e)},a=function(e,n){e||(e={type:"api_error",message:"An unknown error occurred while processing your payment information."}),t(n.status,e)},(c=function(e,t){var n=new XMLHttpRequest;return"withCredentials"in n?n.open(e,t,!0):void 0!==window.XDomainRequest?(n=new XDomainRequest).open(e,t):console.error("Could not reach "+t+" because CORS is not supported"),n}("POST",o)).setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),c.setRequestHeader("Accept","application/json"),c.onload=function(){var e=JSON.parse(c.responseText);c.status>=200&&c.status<400?i(e,c.status,c):a(e,c)},c.onerror=function(){console.error("Could not reach "+o+" due to a connection error")},c.send(n(r))},t.trimWS=function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,n),i.exports}var o,r,i,a,c,s,d;o=n(969),r=n(673),i=n(973),c="",s=a="https://payments.invoiced.com/tokens",d=function(){function e(){this.environment="prod",this.bankAccount=new o.BankAccountFunctions,this.card=new r.CardFunctions}return e.prototype.getPublishableKey=function(){return c},e.prototype.getTokenizeEndpoint=function(){return s},e.prototype.setPublishableKey=function(e,t){void 0===t&&(t="prod"),this.environment=t,c=e,s="staging"===t?"https://payments.staging.invoiced.com/tokens":a},e}(),window.Invoiced=window.Invoiced||new d,i.initializeWePay()})();