rebilly-js-token
Version:
Rebilly payment token library
1 lines • 80.8 kB
JavaScript
window.Rebilly=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=47)}([function(e,t){var n=e.exports={version:"2.5.1"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(35)("wks"),i=n(36),o=n(2).Symbol,u="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=u&&o[e]||(u?o:i)("Symbol."+e))}).store=r},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(2),i=n(0),o=n(9),u=n(5),a=function(e,t,n){var s,c,l,f=e&a.F,h=e&a.G,d=e&a.S,p=e&a.P,g=e&a.B,v=e&a.W,m=h?i:i[t]||(i[t]={}),y=m.prototype,A=h?r:d?r[t]:(r[t]||{}).prototype;h&&(n=t);for(s in n)(c=!f&&A&&void 0!==A[s])&&s in m||(l=c?A[s]:n[s],m[s]=h&&"function"!=typeof A[s]?n[s]:g&&c?o(l,r):v&&A[s]==l?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};return t.prototype=e.prototype,t}(l):p&&"function"==typeof l?o(Function.call,l):l,p&&((m.virtual||(m.virtual={}))[s]=l,e&a.R&&y&&!y[s]&&u(y,s,l)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,e.exports=a},function(e,t,n){var r=n(10);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){var r=n(6),i=n(20);e.exports=n(7)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){var r=n(4),i=n(53),o=n(54),u=Object.defineProperty;t.f=n(7)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return u(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){e.exports=!n(13)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){e.exports={}},function(e,t,n){var r=n(12);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){"use strict";var r=n(52)(!0);n(32)(String,"String",function(e){this._t=String(e),this._i=0},function(){var e,t=this._t,n=this._i;return n>=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(18);e.exports=function(e){return Object(r(e))}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(10),i=n(2).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(59),i=n(37);e.exports=Object.keys||function(e){return r(e,i)}},function(e,t,n){var r=n(34),i=n(18);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(17),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t,n){var r=n(35)("keys"),i=n(36);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){var r=n(6).f,i=n(14),o=n(1)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){var r=n(27),i=n(1)("iterator"),o=n(8);e.exports=n(0).getIteratorMethod=function(e){if(void 0!=e)return e[i]||e["@@iterator"]||o[r(e)]}},function(e,t,n){var r=n(15),i=n(1)("toStringTag"),o="Arguments"==r(function(){return arguments}()),u=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,a;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=u(t=Object(e),i))?n:o?r(t):"Object"==(a=r(t))&&"function"==typeof t.callee?"Arguments":a}},function(e,t,n){e.exports={default:n(80),__esModule:!0}},function(e,t,n){n(82);for(var r=n(2),i=n(5),o=n(8),u=n(1)("toStringTag"),a="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),s=0;s<a.length;s++){var c=a[s],l=r[c],f=l&&l.prototype;f&&!f[u]&&i(f,u,c),o[c]=o.Array}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(12);e.exports.f=function(e){return new r(e)}},function(e,t,n){e.exports={default:n(51),__esModule:!0}},function(e,t,n){"use strict";var r=n(33),i=n(3),o=n(55),u=n(5),a=n(14),s=n(8),c=n(56),l=n(25),f=n(62),h=n(1)("iterator"),d=!([].keys&&"next"in[].keys()),p=function(){return this};e.exports=function(e,t,n,g,v,m,y){c(n,t,g);var A,x,E,S=function(e){if(!d&&e in b)return b[e];switch(e){case"keys":case"values":return function(){return new n(this,e)}}return function(){return new n(this,e)}},T=t+" Iterator",C="values"==v,w=!1,b=e.prototype,F=b[h]||b["@@iterator"]||v&&b[v],B=F||S(v),M=v?C?S("entries"):B:void 0,_="Array"==t?b.entries||F:F;if(_&&(E=f(_.call(new e)))!==Object.prototype&&E.next&&(l(E,T,!0),r||a(E,h)||u(E,h,p)),C&&F&&"values"!==F.name&&(w=!0,B=function(){return F.call(this)}),r&&!y||!d&&!w&&b[h]||u(b,h,B),s[t]=B,s[T]=p,v)if(A={values:C?B:S("values"),keys:m?B:S("keys"),entries:M},y)for(x in A)x in b||o(b,x,A[x]);else i(i.P+i.F*(d||w),t,A);return A}},function(e,t){e.exports=!0},function(e,t,n){var r=n(15);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){var r=n(2),i=r["__core-js_shared__"]||(r["__core-js_shared__"]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(2).document;e.exports=r&&r.documentElement},function(e,t,n){var r=n(4);e.exports=function(e,t,n,i){try{return i?t(r(n)[0],n[1]):t(n)}catch(t){var o=e.return;throw void 0!==o&&r(o.call(e)),t}}},function(e,t,n){var r=n(8),i=n(1)("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(r.Array===e||o[i]===e)}},function(e,t,n){var r=n(1)("iterator"),i=!1;try{var o=[7][r]();o.return=function(){i=!0},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var o=[7],u=o[r]();u.next=function(){return{done:n=!0}},o[r]=function(){return u},e(o)}catch(e){}return n}},function(e,t,n){var r=n(4),i=n(12),o=n(1)("species");e.exports=function(e,t){var n,u=r(e).constructor;return void 0===u||void 0==(n=r(u)[o])?t:i(n)}},function(e,t,n){var r,i,o,u=n(9),a=n(88),s=n(38),c=n(19),l=n(2),f=l.process,h=l.setImmediate,d=l.clearImmediate,p=l.MessageChannel,g=l.Dispatch,v=0,m={},y=function(){var e=+this;if(m.hasOwnProperty(e)){var t=m[e];delete m[e],t()}},A=function(e){y.call(e.data)};h&&d||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return m[++v]=function(){a("function"==typeof e?e:Function(e),t)},r(v),v},d=function(e){delete m[e]},"process"==n(15)(f)?r=function(e){f.nextTick(u(y,e,1))}:g&&g.now?r=function(e){g.now(u(y,e,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=A,r=u(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",A,!1)):r="onreadystatechange"in c("script")?function(e){s.appendChild(c("script")).onreadystatechange=function(){s.removeChild(this),y.call(e)}}:function(e){setTimeout(u(y,e,1),0)}),e.exports={set:h,clear:d}},function(e,t){e.exports=function(e){try{return{e:!1,v:e()}}catch(e){return{e:!0,v:e}}}},function(e,t,n){var r=n(4),i=n(10),o=n(30);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=o.f(e);return(0,n.resolve)(t),n.promise}},function(e,t){function n(e){var t=r.call(e);return"[object Function]"===t||"function"==typeof e&&"[object RegExp]"!==t||"undefined"!=typeof window&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)}e.exports=n;var r=Object.prototype.toString},function(e,t,n){e.exports=n(48)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(49),o=r(i),u=n(109),a=r(u);t.default=new o.default({modules:a.default})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.modules,n=void 0===t?[]:t,r={modules:n,endpoint:"https://api.rebilly.com/v2.1/tokens"},i=new u.default(r);return{setEndpoint:function(e){return i.setEndpoint(e)},setAuth:function(e){return i.setAuth(e)},setPublishableKey:function(e){return i.setPublishableKey(e)},createToken:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return i.createToken(e,t,n)},validate:s.default}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var o=n(50),u=r(o),a=n(108),s=r(a)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(31),o=r(i),u=n(65),a=r(u),s=n(66),c=r(s),l=n(70),f=r(l),h=n(73),d=r(h),p=n(28),g=r(p),v=n(94),m=r(v),y=n(95),A=r(y),x=n(96),E=r(x),S=n(100),T=r(S),C=n(107),w=function(){function e(t){var n=t.modules,r=t.endpoint;(0,A.default)(this,e),this.attrKey="data-rebilly",this.endpoint=null,this.authorization=null,this.publishableKey=null,this.modules=[],this.modules=n,this.endpoint=r}return(0,E.default)(e,[{key:"processModules",value:function(){function e(){return t.apply(this,arguments)}var t=(0,m.default)(f.default.mark(function e(){var t,n;return f.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=this.modules.map(function(e){return e()}),e.next=3,g.default.all(t);case 3:return n=e.sent,e.abrupt("return",n.reduce(function(e,t){return e=(0,d.default)({},e,t)},{}));case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"combineData",value:function(){function e(e){return t.apply(this,arguments)}var t=(0,m.default)(f.default.mark(function e(t){var n;return f.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.processModules();case 2:return n=e.sent,t.leadSource&&delete n.leadSource,e.abrupt("return",(0,d.default)({},t,n));case 5:case"end":return e.stop()}},e,this)}));return e}()},{key:"setEndpoint",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.endpoint=e}},{key:"setAuth",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.authorization=e}},{key:"setPublishableKey",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.publishableKey=e}},{key:"createToken",value:function(){function e(e,n){return t.apply(this,arguments)}var t=(0,m.default)(f.default.mark(function e(t,n){var r,i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return f.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==this.authorization||null!==this.publishableKey){e.next=3;break}return console.error("Missing Rebilly authentication value"),e.abrupt("return",!1);case 3:return r={},i=function(){try{return t instanceof HTMLElement}catch(e){return!1}}(),r=i?this.serializeForm(t):(0,d.default)({},t),e.next=8,this.combineData((0,d.default)({},r,o));case 8:if(r=e.sent,!r.method){e.next=13;break}this.convertLegacyMethods(r),e.next=19;break;case 13:if(!r.paymentInstrument){e.next=17;break}this.detectMethod(r),e.next=19;break;case 17:return console.error("Missing method and payment instrument data"),e.abrupt("return",!1);case 19:(0,T.default)(this.getConfig(r),this.handleResponse(n));case 20:case"end":return e.stop()}},e,this)}));return e}()},{key:"serializeForm",value:function(e){var t=this,n=["pan","expMonth","expYear","cvv","routingNumber","accountNumber","accountType"],r=this.getFormFields(e),i={},o={},u=function(e){return"select"===e.tagName.toLowerCase()?e.options[e.selectedIndex].value:e.value};return r.forEach(function(e){if(e.hasAttribute(t.attrKey)){var r=e.getAttribute(t.attrKey);if(null!==r&&""!==r){var a=String(u(e)).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");""!==a&&(n.indexOf(r)>-1?i[r]=a:o[r]=a)}}}),{paymentInstrument:(0,c.default)(i).length?i:null,billingAddress:(0,c.default)(o).length?o:null}}},{key:"getFormFields",value:function(e){return[].concat((0,a.default)((0,o.default)(e.getElementsByTagName("input"))),(0,a.default)((0,o.default)(e.getElementsByTagName("select"))))}},{key:"getConfig",value:function(e){var t={method:"post",body:e,uri:this.endpoint,json:!0,headers:{"reb-api-consumer":"RebillySDK/JS-Token "+C.version}};return null!==this.publishableKey?t.headers.Authorization="Bearer "+this.publishableKey:t.headers["reb-auth"]=this.authorization,t}},{key:"handleResponse",value:function(e){return function(t,n,r){var i={xhr:n.rawRequest,status:n.statusCode,error:!1,data:null,message:"success"};t?(i.error=!0,i.message=t.message):(i.data=r,201!==n.statusCode&&(i.error=!0,i.message=i.data.error)),e(i)}}},{key:"convertLegacyMethods",value:function(e){var t={payment_card:"payment-card",bank_account:"ach"};(0,c.default)(t).forEach(function(n){e.method===n&&(e.method=t[n])})}},{key:"detectMethod",value:function(e){var t={"payment-card":["pan","expMonth","expYear","cvv"],ach:["routingNumber","accountNumber","accountType"]},n=(0,c.default)(e.paymentInstrument);(0,c.default)(t).forEach(function(r){n.some(function(e){return t[r].indexOf(e)>-1})&&!e.method&&(e.method=r,console.log('Rebilly detected "'+r+'" as the payment method'))})}}]),e}();t.default=w},function(e,t,n){n(11),n(63),e.exports=n(0).Array.from},function(e,t,n){var r=n(17),i=n(18);e.exports=function(e){return function(t,n){var o,u,a=String(i(t)),s=r(n),c=a.length;return s<0||s>=c?e?"":void 0:(o=a.charCodeAt(s),o<55296||o>56319||s+1===c||(u=a.charCodeAt(s+1))<56320||u>57343?e?a.charAt(s):o:e?a.slice(s,s+2):u-56320+(o-55296<<10)+65536)}}},function(e,t,n){e.exports=!n(7)&&!n(13)(function(){return 7!=Object.defineProperty(n(19)("div"),"a",{get:function(){return 7}}).a})},function(e,t,n){var r=n(10);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},function(e,t,n){e.exports=n(5)},function(e,t,n){"use strict";var r=n(57),i=n(20),o=n(25),u={};n(5)(u,n(1)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(u,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){var r=n(4),i=n(58),o=n(37),u=n(24)("IE_PROTO"),a=function(){},s=function(){var e,t=n(19)("iframe"),r=o.length;for(t.style.display="none",n(38).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("<script>document.F=Object<\/script>"),e.close(),s=e.F;r--;)delete s.prototype[o[r]];return s()};e.exports=Object.create||function(e,t){var n;return null!==e?(a.prototype=r(e),n=new a,a.prototype=null,n[u]=e):n=s(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(6),i=n(4),o=n(21);e.exports=n(7)?Object.defineProperties:function(e,t){i(e);for(var n,u=o(t),a=u.length,s=0;a>s;)r.f(e,n=u[s++],t[n]);return e}},function(e,t,n){var r=n(14),i=n(22),o=n(60)(!1),u=n(24)("IE_PROTO");e.exports=function(e,t){var n,a=i(e),s=0,c=[];for(n in a)n!=u&&r(a,n)&&c.push(n);for(;t.length>s;)r(a,n=t[s++])&&(~o(c,n)||c.push(n));return c}},function(e,t,n){var r=n(22),i=n(23),o=n(61);e.exports=function(e){return function(t,n,u){var a,s=r(t),c=i(s.length),l=o(u,c);if(e&&n!=n){for(;c>l;)if((a=s[l++])!=a)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===n)return e||l||0;return!e&&-1}}},function(e,t,n){var r=n(17),i=Math.max,o=Math.min;e.exports=function(e,t){return e=r(e),e<0?i(e+t,0):o(e,t)}},function(e,t,n){var r=n(14),i=n(16),o=n(24)("IE_PROTO"),u=Object.prototype;e.exports=Object.getPrototypeOf||function(e){return e=i(e),r(e,o)?e[o]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?u:null}},function(e,t,n){"use strict";var r=n(9),i=n(3),o=n(16),u=n(39),a=n(40),s=n(23),c=n(64),l=n(26);i(i.S+i.F*!n(41)(function(e){Array.from(e)}),"Array",{from:function(e){var t,n,i,f,h=o(e),d="function"==typeof this?this:Array,p=arguments.length,g=p>1?arguments[1]:void 0,v=void 0!==g,m=0,y=l(h);if(v&&(g=r(g,p>2?arguments[2]:void 0,2)),void 0==y||d==Array&&a(y))for(t=s(h.length),n=new d(t);t>m;m++)c(n,m,v?g(h[m],m):h[m]);else for(f=y.call(h),n=new d;!(i=f.next()).done;m++)c(n,m,v?u(f,g,[i.value,m],!0):i.value);return n.length=m,n}})},function(e,t,n){"use strict";var r=n(6),i=n(20);e.exports=function(e,t,n){t in e?r.f(e,t,i(0,n)):e[t]=n}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(31),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return(0,i.default)(e)}},function(e,t,n){e.exports={default:n(67),__esModule:!0}},function(e,t,n){n(68),e.exports=n(0).Object.keys},function(e,t,n){var r=n(16),i=n(21);n(69)("keys",function(){return function(e){return i(r(e))}})},function(e,t,n){var r=n(3),i=n(0),o=n(13);e.exports=function(e,t){var n=(i.Object||{})[e]||Object[e],u={};u[e]=t(n),r(r.S+r.F*o(function(){n(1)}),"Object",u)}},function(e,t,n){e.exports=n(71)},function(e,t,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,e.exports=n(72),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(e){r.regeneratorRuntime=void 0}},function(e,t){!function(t){"use strict";function n(e,t,n,r){var o=t&&t.prototype instanceof i?t:i,u=Object.create(o.prototype),a=new d(r||[]);return u._invoke=c(e,n,a),u}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function u(){}function a(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function s(e){function t(n,i,o,u){var a=r(e[n],e,i);if("throw"!==a.type){var s=a.arg,c=s.value;return c&&"object"==typeof c&&y.call(c,"__await")?Promise.resolve(c.__await).then(function(e){t("next",e,o,u)},function(e){t("throw",e,o,u)}):Promise.resolve(c).then(function(e){s.value=e,o(s)},u)}u(a.arg)}function n(e,n){function r(){return new Promise(function(r,i){t(e,n,r,i)})}return i=i?i.then(r,r):r()}var i;this._invoke=n}function c(e,t,n){var i=w;return function(o,u){if(i===F)throw new Error("Generator is already running");if(i===B){if("throw"===o)throw u;return g()}for(n.method=o,n.arg=u;;){var a=n.delegate;if(a){var s=l(a,n);if(s){if(s===M)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===w)throw i=B,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=F;var c=r(e,t,n);if("normal"===c.type){if(i=n.done?B:b,c.arg===M)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=B,n.method="throw",n.arg=c.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,l(e,t),"throw"===t.method))return M;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return M}var i=r(n,e.iterator,t.arg);if("throw"===i.type)return t.method="throw",t.arg=i.arg,t.delegate=null,M;var o=i.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,M):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,M)}function f(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function h(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function d(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(f,this),this.reset(!0)}function p(e){if(e){var t=e[x];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(y.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=v,t.done=!0,t};return r.next=r}}return{next:g}}function g(){return{value:v,done:!0}}var v,m=Object.prototype,y=m.hasOwnProperty,A="function"==typeof Symbol?Symbol:{},x=A.iterator||"@@iterator",E=A.asyncIterator||"@@asyncIterator",S=A.toStringTag||"@@toStringTag",T="object"==typeof e,C=t.regeneratorRuntime;if(C)return void(T&&(e.exports=C));C=t.regeneratorRuntime=T?e.exports:{},C.wrap=n;var w="suspendedStart",b="suspendedYield",F="executing",B="completed",M={},_={};_[x]=function(){return this};var D=Object.getPrototypeOf,R=D&&D(D(p([])));R&&R!==m&&y.call(R,x)&&(_=R);var P=u.prototype=i.prototype=Object.create(_);o.prototype=P.constructor=u,u.constructor=o,u[S]=o.displayName="GeneratorFunction",C.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===o||"GeneratorFunction"===(t.displayName||t.name))},C.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,S in e||(e[S]="GeneratorFunction")),e.prototype=Object.create(P),e},C.awrap=function(e){return{__await:e}},a(s.prototype),s.prototype[E]=function(){return this},C.AsyncIterator=s,C.async=function(e,t,r,i){var o=new s(n(e,t,r,i));return C.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},a(P),P[S]="Generator",P[x]=function(){return this},P.toString=function(){return"[object Generator]"},C.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},C.values=p,d.prototype={constructor:d,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(h),!e)for(var t in this)"t"===t.charAt(0)&&y.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=v)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var u=y.call(i,"catchLoc"),a=y.call(i,"finallyLoc");if(u&&a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!a)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&y.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,M):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),M},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),h(n),M}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;h(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:p(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),M}}}(function(){return this}()||Function("return this")())},function(e,t,n){"use strict";t.__esModule=!0;var r=n(74),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=i.default||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}},function(e,t,n){e.exports={default:n(75),__esModule:!0}},function(e,t,n){n(76),e.exports=n(0).Object.assign},function(e,t,n){var r=n(3);r(r.S+r.F,"Object",{assign:n(77)})},function(e,t,n){"use strict";var r=n(21),i=n(78),o=n(79),u=n(16),a=n(34),s=Object.assign;e.exports=!s||n(13)(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach(function(e){t[e]=e}),7!=s({},e)[n]||Object.keys(s({},t)).join("")!=r})?function(e,t){for(var n=u(e),s=arguments.length,c=1,l=i.f,f=o.f;s>c;)for(var h,d=a(arguments[c++]),p=l?r(d).concat(l(d)):r(d),g=p.length,v=0;g>v;)f.call(d,h=p[v++])&&(n[h]=d[h]);return n}:s},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){n(81),n(11),n(29),n(85),n(92),n(93),e.exports=n(0).Promise},function(e,t){},function(e,t,n){"use strict";var r=n(83),i=n(84),o=n(8),u=n(22);e.exports=n(32)(Array,"Array",function(e,t){this._t=u(e),this._i=0,this._k=t},function(){var e=this._t,t=this._k,n=this._i++;return!e||n>=e.length?(this._t=void 0,i(1)):"keys"==t?i(0,n):"values"==t?i(0,e[n]):i(0,[n,e[n]])},"values"),o.Arguments=o.Array,r("keys"),r("values"),r("entries")},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){return{value:t,done:!!e}}},function(e,t,n){"use strict";var r,i,o,u,a=n(33),s=n(2),c=n(9),l=n(27),f=n(3),h=n(10),d=n(12),p=n(86),g=n(87),v=n(42),m=n(43).set,y=n(89)(),A=n(30),x=n(44),E=n(45),S=s.TypeError,T=s.process,C=s.Promise,w="process"==l(T),b=function(){},F=i=A.f,B=!!function(){try{var e=C.resolve(1),t=(e.constructor={})[n(1)("species")]=function(e){e(b,b)};return(w||"function"==typeof PromiseRejectionEvent)&&e.then(b)instanceof t}catch(e){}}(),M=function(e){var t;return!(!h(e)||"function"!=typeof(t=e.then))&&t},_=function(e,t){if(!e._n){e._n=!0;var n=e._c;y(function(){for(var r=e._v,i=1==e._s,o=0;n.length>o;)!function(t){var n,o,u=i?t.ok:t.fail,a=t.resolve,s=t.reject,c=t.domain;try{u?(i||(2==e._h&&P(e),e._h=1),!0===u?n=r:(c&&c.enter(),n=u(r),c&&c.exit()),n===t.promise?s(S("Promise-chain cycle")):(o=M(n))?o.call(n,a,s):a(n)):s(r)}catch(e){s(e)}}(n[o++]);e._c=[],e._n=!1,t&&!e._h&&D(e)})}},D=function(e){m.call(s,function(){var t,n,r,i=e._v,o=R(e);if(o&&(t=x(function(){w?T.emit("unhandledRejection",i,e):(n=s.onunhandledrejection)?n({promise:e,reason:i}):(r=s.console)&&r.error&&r.error("Unhandled promise rejection",i)}),e._h=w||R(e)?2:1),e._a=void 0,o&&t.e)throw t.v})},R=function(e){if(1==e._h)return!1;for(var t,n=e._a||e._c,r=0;n.length>r;)if(t=n[r++],t.fail||!R(t.promise))return!1;return!0},P=function(e){m.call(s,function(){var t;w?T.emit("rejectionHandled",e):(t=s.onrejectionhandled)&&t({promise:e,reason:e._v})})},O=function(e){var t=this;t._d||(t._d=!0,t=t._w||t,t._v=e,t._s=2,t._a||(t._a=t._c.slice()),_(t,!0))},L=function(e){var t,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===e)throw S("Promise can't be resolved itself");(t=M(e))?y(function(){var r={_w:n,_d:!1};try{t.call(e,c(L,r,1),c(O,r,1))}catch(e){O.call(r,e)}}):(n._v=e,n._s=1,_(n,!1))}catch(e){O.call({_w:n,_d:!1},e)}}};B||(C=function(e){p(this,C,"Promise","_h"),d(e),r.call(this);try{e(c(L,this,1),c(O,this,1))}catch(e){O.call(this,e)}},r=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n(90)(C.prototype,{then:function(e,t){var n=F(v(this,C));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=w?T.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&_(this,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r;this.promise=e,this.resolve=c(L,e,1),this.reject=c(O,e,1)},A.f=F=function(e){return e===C||e===u?new o(e):i(e)}),f(f.G+f.W+f.F*!B,{Promise:C}),n(25)(C,"Promise"),n(91)("Promise"),u=n(0).Promise,f(f.S+f.F*!B,"Promise",{reject:function(e){var t=F(this);return(0,t.reject)(e),t.promise}}),f(f.S+f.F*(a||!B),"Promise",{resolve:function(e){return E(a&&this===u?C:this,e)}}),f(f.S+f.F*!(B&&n(41)(function(e){C.all(e).catch(b)})),"Promise",{all:function(e){var t=this,n=F(t),r=n.resolve,i=n.reject,o=x(function(){var n=[],o=0,u=1;g(e,!1,function(e){var a=o++,s=!1;n.push(void 0),u++,t.resolve(e).then(function(e){s||(s=!0,n[a]=e,--u||r(n))},i)}),--u||r(n)});return o.e&&i(o.v),n.promise},race:function(e){var t=this,n=F(t),r=n.reject,i=x(function(){g(e,!1,function(e){t.resolve(e).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}})},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(9),i=n(39),o=n(40),u=n(4),a=n(23),s=n(26),c={},l={},t=e.exports=function(e,t,n,f,h){var d,p,g,v,m=h?function(){return e}:s(e),y=r(n,f,t?2:1),A=0;if("function"!=typeof m)throw TypeError(e+" is not iterable!");if(o(m)){for(d=a(e.length);d>A;A++)if((v=t?y(u(p=e[A])[0],p[1]):y(e[A]))===c||v===l)return v}else for(g=m.call(e);!(p=g.next()).done;)if((v=i(g,y,p.value,t))===c||v===l)return v};t.BREAK=c,t.RETURN=l},function(e,t){e.exports=function(e,t,n){var r=void 0===n;switch(t.length){case 0:return r?e():e.call(n);case 1:return r?e(t[0]):e.call(n,t[0]);case 2:return r?e(t[0],t[1]):e.call(n,t[0],t[1]);case 3:return r?e(t[0],t[1],t[2]):e.call(n,t[0],t[1],t[2]);case 4:return r?e(t[0],t[1],t[2],t[3]):e.call(n,t[0],t[1],t[2],t[3])}return e.apply(n,t)}},function(e,t,n){var r=n(2),i=n(43).set,o=r.MutationObserver||r.WebKitMutationObserver,u=r.process,a=r.Promise,s="process"==n(15)(u);e.exports=function(){var e,t,n,c=function(){var r,i;for(s&&(r=u.domain)&&r.exit();e;){i=e.fn,e=e.next;try{i()}catch(r){throw e?n():t=void 0,r}}t=void 0,r&&r.enter()};if(s)n=function(){u.nextTick(c)};else if(o){var l=!0,f=document.createTextNode("");new o(c).observe(f,{characterData:!0}),n=function(){f.data=l=!l}}else if(a&&a.resolve){var h=a.resolve();n=function(){h.then(c)}}else n=function(){i.call(r,c)};return function(r){var i={fn:r,next:void 0};t&&(t.next=i),e||(e=i,n()),t=i}}},function(e,t,n){var r=n(5);e.exports=function(e,t,n){for(var i in t)n&&e[i]?e[i]=t[i]:r(e,i,t[i]);return e}},function(e,t,n){"use strict";var r=n(2),i=n(0),o=n(6),u=n(7),a=n(1)("species");e.exports=function(e){var t="function"==typeof i[e]?i[e]:r[e];u&&t&&!t[a]&&o.f(t,a,{configurable:!0,get:function(){return this}})}},function(e,t,n){"use strict";var r=n(3),i=n(0),o=n(2),u=n(42),a=n(45);r(r.P+r.R,"Promise",{finally:function(e){var t=u(this,i.Promise||o.Promise),n="function"==typeof e;return this.then(n?function(n){return a(t,e()).then(function(){return n})}:e,n?function(n){return a(t,e()).then(function(){throw n})}:e)}})},function(e,t,n){"use strict";var r=n(3),i=n(30),o=n(44);r(r.S,"Promise",{try:function(e){var t=i.f(this),n=o(e);return(n.e?t.reject:t.resolve)(n.v),t.promise}})},function(e,t,n){"use strict";t.__esModule=!0;var r=n(28),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){return function(){var t=e.apply(this,arguments);return new i.default(function(e,n){function r(o,u){try{var a=t[o](u),s=a.value}catch(e){return void n(e)}if(!a.done)return i.default.resolve(s).then(function(e){r("next",e)},function(e){r("throw",e)});e(s)}return r("next")})}}},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(97),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),(0,i.default)(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}()},function(e,t,n){e.exports={default:n(98),__esModule:!0}},function(e,t,n){n(99);var r=n(0).Object;e.exports=function(e,t,n){return r.defineProperty(e,t,n)}},function(e,t,n){var r=n(3);r(r.S+r.F*!n(7),"Object",{defineProperty:n(6).f})},function(e,t,n){"use strict";function r(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function i(e,t,n){var r=e;return l(t)?(n=t,"string"==typeof e&&(r={uri:e})):r=h(t,{uri:e}),r.callback=n,r}function o(e,t,n){return t=i(e,t,n),u(t)}function u(e){function t(){4===l.readyState&&setTimeout(u,0)}function n(){var e=void 0;if(e=l.response?l.response:l.responseText||a(l),x)try{e=JSON.parse(e)}catch(e){}return e}function i(e){return clearTimeout(p),e instanceof Error||(e=new Error(""+(e||"Unknown XMLHttpRequest Error"))),e.statusCode=0,c(e,E)}function u(){if(!d){var t;clearTimeout(p),t=e.useXDR&&void 0===l.status?200:1223===l.status?204:l.status;var r=E,i=null;return 0!==t?(r={body:n(),statusCode:t,method:v,headers:{},url:g,rawRequest:l},l.getAllResponseHeaders&&(r.headers=f(l.getAllResponseHeaders()))):i=new Error("Internal XMLHttpRequest Error"),c(i,r,r.body)}}if(void 0===e.callback)throw new Error("callback argument missing");var s=!1,c=function(t,n,r){s||(s=!0,e.callback(t,n,r))},l=e.xhr||null;l||(l=e.cors||e.useXDR?new o.XDomainRequest:new o.XMLHttpRequest);var h,d,p,g=l.url=e.uri||e.url,v=l.method=e.method||"GET",m=e.body||e.data,y=l.headers=e.headers||{},A=!!e.sync,x=!1,E={body:void 0,headers:{},statusCode:0,method:v,url:g,rawRequest:l};if("json"in e&&!1!==e.json&&(x=!0,y.accept||y.Accept||(y.Accept="application/json"),"GET"!==v&&"HEAD"!==v&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),m=JSON.stringify(!0===e.json?m:e.json))),l.onreadystatechange=t,l.onload=u,l.onerror=i,l.onprogress=function(){},l.onabort=function(){d=!0},l.ontimeout=i,l.open(v,g,!A,e.username,e.password),A||(l.withCredentials=!!e.withCredentials),!A&&e.timeout>0&&(p=setTimeout(function(){if(!d){d=!0,l.abort("timeout");var e=new Error("XMLHttpRequest timeout");e.code="ETIMEDOUT",i(e)}},e.timeout)),l.setRequestHeader)for(h in y)y.hasOwnProperty(h)&&l.setRequestHeader(h,y[h]);else if(e.headers&&!r(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(l.responseType=e.responseType),"beforeSend"in e&&"function"==typeof e.beforeSend&&e.beforeSend(l),l.send(m||null),l}function a(e){if("document"===e.responseType)return e.responseXML;var t=e.responseXML&&"parsererror"===e.responseXML.documentElement.nodeName;return""!==e.responseType||t?null:e.responseXML}function s(){}var c=n(101),l=n(46),f=n(103),h=n(106);e.exports=o,o.XMLHttpRequest=c.XMLHttpRequest||s,o.XDomainRequest="withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:c.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){o["delete"===e?"del":e]=function(t,n,r){return n=i(t,n,r),n.method=e.toUpperCase(),u(n)}})},function(e,t,n){(function(t){var n;n="undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{},e.exports=n}).call(t,n(102))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){var r=n(104),i=n(105),o=function(e){return"[object Array]"===Object.prototype.toString.call(e)};e.exports=function(e){if(!e)return{};var t={};return i(r(e).split("\n"),function(e){var n=e.indexOf(":"),i=r(e.slice(0,n)).toLowerCase(),u=r(e.slice(n+1));void 0===t[i]?t[i]=u:o(t[i])?t[i].push(u):t[i]=[t[i],u]}),t}},function(e,t){function n(e){return e.replace(/^\s*|\s*$/g,"")}t=e.exports=n,t.left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e,t,n){function r(e,t,n){if(!a(t))throw new TypeError("iterator must be a function");arguments.length<3&&(n=this),"[object Array]"===s.call(e)?i(e,t,n):"string"==typeof e?o(e,t,n):u(e,t,n)}function i(e,t,n){for(var r=0,i=e.length;r<i;r++)c.call(e,r)&&t.call(n,e[r],r,e)}function o(e,t,n){for(var r=0,i=e.length;r<i;r++)t.call(n,e.charAt(r),r,e)}function u(e,t,n){for(var r in e)c.call(e,r)&&t.call(n,e[r],r,e)}var a=n(46);e.exports=r;var s=Object.prototype.toString,c=Object.prototype.hasOwnProperty},function(e,t){function n(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e}e.exports=n;var r=Object.prototype.hasOwnProperty},function(e,t){e.exports={name:"rebilly-js-token",version:"1.5.0",description:"Rebilly payment token library",main:"./dist/rebilly.js",scripts:{clean:"rimraf dist","build:dev":"npm run clean && webpack --env=dev","build:prod":"npm run clean && webpack --env=prod",prepare:"npm run build:prod",test:"mocha --compilers js:babel-core/register --require babel-polyfill --colors ./test/*.spec.js","test:watch":"npm run test -- --watch"},repository:{type:"git",url:"https://github.com/Rebilly/rebilly-js-token.git"},keywords:["rebilly","js","token","payment","card"],files:["dist"],author:"Andrei Moldoveanu",license:"MIT",bugs:{url:"https://github.com/Rebilly/rebilly-js-token/issues"},homepage:"https://github.com/Rebilly/rebilly-js-token#readme",devDependencies:{"babel-core":"^6.26.0","babel-loader":"^7.1.2","babel-plugin-transform-runtime":"^6.23.0","babel-polyfill":"^6.26.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-2":"^6.24.1",chai:"^4.1.2","cross-env":"^5.0.5",fingerprintjs2:"^1.5.1",mocha:"^4.0.0",rimraf:"^2.6.2",sinon:"^6.1.5",webpack:"^3.6.0",xhr:"^2.4.0"},dependencies:{"babel-runtime":"^6.26.0"}}},function(e,t,n){"use strict";function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=new RegExp(t);return e=String(e).trim(),e.length<=n&&r.test(e)}function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments[2];return r(e,"^["+o.source+t+"]+$",n)}Object.defineProperty(t,"__esModule",{value:!0});var o=/\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/,u={cardNumber:function(e){return e=String(e).replace(/\s+|-/g,""),e.length>=14&&e.length<=19&&this.luhn(e)},cvv:function(e){return e=String(e).trim(),/^\d+$/.test(e)&&e.length>=3&&e.length<=4},luhn:function(e){for(var t=[[0,1,2,3,4,5,6,7,8,9],[0,2,4,6,8,1,3,5,7,9]],n=e.length,r=0,i=0;n--;)i+=t[r][parseInt(e.charAt(n),10)],r^=1;return i%10==0&&i>0},expiry:function(e,t){var n=void 0,r=void 0;return e=String(e).trim(),t=String(t).trim(),/^\d+$/.test(e)&&/^\d+$/.test(t)&&parseInt(e)<=12&&(n=new Date(t,e),r=new Date,n.setMonth(n.getMonth()-1),n.setMonth(n.getMonth()+1,1),n>r)}},a={firstName:function(e){return i(e,"\\s,.'-",45)},lastName:function(e){return i(e,"0-9\\s,.'-",45)},city:function(e){return i(e,"0-9\\s,.'-",45)},region:function(e){return i(e,"0-9\\s,.'-",45)},address:function(e){return i(e,"0-9\\s,'.#\\/",60)},postalCode:function(e){return r(e,"^[A-Za-z0-9-\\s]+$",10)},phoneNumber:function(e){return r(e,"^([+]?[0-9\\s\\-()]+)$",20)}},s={card:u,customer:a};t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(110),o=r(i),u=n(112),a=r(u),s=[o.default,a.default];t.default=s},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(){return new u.default(function(e){new s.default({excludeAdBlock:!0}).get(function(t){return e({fingerprint:t})})})}Object.defineProperty(t,"__esModule",{value:!0});var o=n(28),u=r(o);t.default=i;var a=n(111),s=r(a)},function(e,t,n){var r,i;!function(o,u,a){"use strict";r=a,void 0!==(i="function"==typeof r?r.call(t,n,t,e):r)&&(e.exports=i)}(0,0,function(){"use strict";var e=function(t){if(!(this instanceof e))return new e(t);var n={swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i],userDefinedFonts:[]};this.options=this.extend(t,n),this.nativeForEach=Array.prototype.forEach,this.nativeMap=Array.prototype.map};return e.prototype={extend:function(e,t){if(null==e)return t;for(var n in e)null!=e[n]&&t[n]!==e[n]&&(t[n]=e[n]);return t},get:function(e){var t=[];t=this.userAgentKey(t),t=this.languageKey(t),t=this.colorDepthKey(t),t=this.pixelRatioKey(t),t=this.hardwareConcurrencyKey(t),t=this.screenResolutionKey(t),t=this.availableScreenResolutionKey(t),t=this.timezoneOffsetKey(t),t=this.sessionStorageKey(t),t=this.localStorageKey(t),t=this.indexedDbKey(t),t=this.addBehaviorKey(t),t=this.openDatabaseKey(t),t=this.cpuClassKey(t),t=this.platformKey(t),t=this.doNotTrackKey(t),t=this.pluginsKey(t),t=this.canvasKey(t),t=this.webglKey(t),t=this.adBlockKey(t),t=this.hasLiedLanguagesKey(t),t=this.hasLiedResolutionKey(t),t=this.hasLiedOsKey(t),t=this.hasLiedBrowserKey(t),t=this.touchSupportKey(t),t=this.customEntropyFunction(t);var n=this;this.fontsKey(t,function(t){var r=[];n.each(t,function(e){var t=e.value;void 0!==e.value.join&&(t=e.value.join(";")),r.push(t)});var i=n.x64hash128(r.join("~~~"),31);return e(i,t)})},customEntropyFunction:function(e){return"function"==typeof this.options.customFunction&&e.push({key:"custom",value:this.options.customFunction()}),e},userAgentKey:function(e){return this.options.excludeUserAgent||e.push({key:"user_agent",value:this.getUserAgent()}),e},getUserAgent:function(){return navigator.userAgent},languageKey:function(e){return this.options.excludeLanguage||e.push({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),e},colorDepthKey:function(e){return this.options.excludeColorDepth||e.push({key:"color_depth",value:screen.colorDepth||-1}),e},pixelRatioKey:function(e){return this.options.excludePixelRatio||e.push({key:"pixel_ratio",value:this.getPixelRatio()}),e},getPixelRatio:function(){return window.devicePixelRatio||""},screenResolutionKey:function(e){return this.options.excludeScreenResolution?e:this.getScreenResolution(e)},getScreenResolution:function(e){var t;return t=this.options.detectScreenOrientation&&screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height],void 0!==t&&e.push({key:"resolution",value:t}),e},availableScreenResolutionKey:function(e){return this.options.excludeAvailableScreenResolution?e:this.getAvailableScreenResolution(e)},getAvailableScreenResolution:function(e){var t;return screen.availWidth&&screen.availHeight&&(t=this.options.detectScreenOrientation?screen.availHeight>screen.availWidth?[screen.availHeight,screen.availWidth]:[screen.availWidth,screen.availHeight]:[screen.availHeight,screen.availWidth]),void 0!==t&&e.push({key:"available_resolution",value:t}),e},timezoneOffsetKey:function(e){return this.options.excludeTimezoneOffset||e.push({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),e},sessionStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&e.push({key:"session_storage",value:1}),e},localStorageKey:function(e){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&e.push({key:"local_storage",value:1}),e},indexedDbKey:function(e){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&e.push({key:"indexed_db",value:1}),e},addBehaviorKey:function(e){return document.body&&!this.options.excludeAddBehavior&&document.body.addBehavior&&e.push({key:"add_behavior",value:1}),e},openDatabaseKey:function(e){return!this.options.excludeOpenDatabase&&window.openDatabase&&e.push({key:"open_database",value:1}),e},cpuClassKey:function(e){return this.options.excludeCpuClass||e.push({key:"cpu_class",value:this.getNavigatorCpuClass()}),e},platformKey:function(e){return this.options.excludePlatform||e.push({key:"navigator_platform",value:this.getNavigatorPlatform()}),e},doNotTrackKey:function(e){return this.options.excludeDoNotTrack||e.push({key:"do_not_track",value:this.getDoNotTrack()}),e},canvasKey:function(e){return!this.options.excludeCanvas&&this.isCanvasSupported()&&e.push({key:"canvas",value:this.getCanvasFp()}),e},webglKey:function(e){return this.options.excludeWebGL?e:this.isWebGlSupported()?(e.push({key:"webgl",value:this.getWebglFp()}),e):e},adBlockKey:function(e){return this.options.excludeAdBlock||e.push({key:"adblock",value:this.getAdBlock()}),e},hasLiedLanguagesKey:function(e){return this.options.excludeHasLiedLanguages||e.push({key:"has_lied_languages",value:this.getHasLiedLanguages()}),e},hasLiedResolutionKey:function(e){return this.options.excludeHasLiedResolution||e.push({key:"has_lied_resolution",value:this.getHasLiedResolution()}),e},hasLiedOsKey:f