New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

braintree-web

Package Overview
Dependencies
Maintainers
1
Versions
282
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

braintree-web - npm Package Compare versions

Comparing version 3.6.3 to 3.7.0

paypal-checkout.debug.js

140

american-express.debug.js
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).americanExpress = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var deferred = _dereq_('../lib/deferred');

@@ -147,6 +147,6 @@ var errors = _dereq_('./errors');

},{"../lib/assign":5,"../lib/deferred":6,"../lib/error":8,"../lib/throw-if-no-callback":9,"./errors":2}],2:[function(_dereq_,module,exports){
},{"../lib/assign":4,"../lib/braintree-error":5,"../lib/deferred":6,"../lib/throw-if-no-callback":9,"./errors":2}],2:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');

@@ -164,3 +164,3 @@ module.exports = {

},{"../lib/error":8}],3:[function(_dereq_,module,exports){
},{"../lib/braintree-error":5}],3:[function(_dereq_,module,exports){
'use strict';

@@ -172,7 +172,7 @@ /**

var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var AmericanExpress = _dereq_('./american-express');
var deferred = _dereq_('../lib/deferred');
var sharedErrors = _dereq_('../errors');
var VERSION = "3.6.3";
var sharedErrors = _dereq_('../lib/errors');
var VERSION = "3.7.0";
var throwIfNoCallback = _dereq_('../lib/throw-if-no-callback');

@@ -226,34 +226,5 @@

},{"../errors":4,"../lib/deferred":6,"../lib/error":8,"../lib/throw-if-no-callback":9,"./american-express":1}],4:[function(_dereq_,module,exports){
},{"../lib/braintree-error":5,"../lib/deferred":6,"../lib/errors":8,"../lib/throw-if-no-callback":9,"./american-express":1}],4:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":8}],5:[function(_dereq_,module,exports){
'use strict';
var assignNormalized = typeof Object.assign === 'function' ? Object.assign : assignPolyfill;

@@ -281,33 +252,5 @@

},{}],6:[function(_dereq_,module,exports){
},{}],5:[function(_dereq_,module,exports){
'use strict';
module.exports = function (fn) {
return function () {
// IE9 doesn't support passing arguments to setTimeout so we have to emulate it.
var args = arguments;
setTimeout(function () {
fn.apply(null, args);
}, 1);
};
};
},{}],7:[function(_dereq_,module,exports){
'use strict';
function enumerate(values, prefix) {
prefix = prefix == null ? '' : prefix;
return values.reduce(function (enumeration, value) {
enumeration[value] = prefix + value;
return enumeration;
}, {});
}
module.exports = enumerate;
},{}],8:[function(_dereq_,module,exports){
'use strict';
var enumerate = _dereq_('./enumerate');

@@ -387,8 +330,65 @@

},{"./enumerate":7}],9:[function(_dereq_,module,exports){
},{"./enumerate":7}],6:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
module.exports = function (fn) {
return function () {
// IE9 doesn't support passing arguments to setTimeout so we have to emulate it.
var args = arguments;
setTimeout(function () {
fn.apply(null, args);
}, 1);
};
};
},{}],7:[function(_dereq_,module,exports){
'use strict';
function enumerate(values, prefix) {
prefix = prefix == null ? '' : prefix;
return values.reduce(function (enumeration, value) {
enumeration[value] = prefix + value;
return enumeration;
}, {});
}
module.exports = enumerate;
},{}],8:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./braintree-error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./braintree-error":5}],9:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');
module.exports = function (callback, functionName) {

@@ -404,3 +404,3 @@ if (typeof callback !== 'function') {

},{"../errors":4,"./error":8}]},{},[3])(3)
},{"../lib/errors":8,"./braintree-error":5}]},{},[3])(3)
});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(r.braintree||(r.braintree={})).americanExpress=e()}}(function(){return function e(r,t,n){function o(s,c){if(!t[s]){if(!r[s]){var a="function"==typeof require&&require;if(!c&&a)return a(s,!0);if(i)return i(s,!0);var E=new Error("Cannot find module '"+s+"'");throw E.code="MODULE_NOT_FOUND",E}var u=t[s]={exports:{}};r[s][0].call(u.exports,function(e){var t=r[s][1][e];return o(t?t:e)},u,u.exports,e,r,t,n)}return t[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,r,t){"use strict";function n(e){this._client=e.client}var o=e("../lib/error"),i=e("../lib/deferred"),s=e("./errors"),c=e("../lib/assign").assign,a=e("../lib/throw-if-no-callback");n.prototype.getRewardsBalance=function(e,r){var t,n=e.nonce;return a(r,"getRewardsBalance"),r=i(r),n?(delete e.nonce,t=c({_meta:{source:"american-express"},paymentMethodNonce:n},e),void this._client.request({method:"get",endpoint:"payment_methods/amex_rewards_balance",data:t},function(e,t){e?r(new o({type:s.AMEX_NETWORK_ERROR.type,code:s.AMEX_NETWORK_ERROR.code,message:"A network error occurred when getting the American Express rewards balance.",details:{originalError:e}})):r(null,t)})):void r(new o({type:s.AMEX_NONCE_REQUIRED.type,code:s.AMEX_NONCE_REQUIRED.code,message:"getRewardsBalance must be called with a nonce."}))},n.prototype.getExpressCheckoutProfile=function(e,r){return a(r,"getExpressCheckoutProfile"),r=i(r),e.nonce?void this._client.request({method:"get",endpoint:"payment_methods/amex_express_checkout_cards/"+e.nonce,data:{_meta:{source:"american-express"},paymentMethodNonce:e.nonce}},function(e,t){e?r(new o({type:s.AMEX_NETWORK_ERROR.type,code:s.AMEX_NETWORK_ERROR.code,message:"A network error occurred when getting the American Express Checkout nonce profile.",details:{originalError:e}})):r(null,t)}):void r(new o({type:s.AMEX_NONCE_REQUIRED.type,code:s.AMEX_NONCE_REQUIRED.code,message:"getExpressCheckoutProfile must be called with a nonce."}))},r.exports=n},{"../lib/assign":5,"../lib/deferred":6,"../lib/error":8,"../lib/throw-if-no-callback":9,"./errors":2}],2:[function(e,r,t){"use strict";var n=e("../lib/error");r.exports={AMEX_NONCE_REQUIRED:{type:n.types.MERCHANT,code:"AMEX_NONCE_REQUIRED"},AMEX_NETWORK_ERROR:{type:n.types.NETWORK,code:"AMEX_NETWORK_ERROR"}}},{"../lib/error":8}],3:[function(e,r,t){"use strict";function n(e,r){var t;return E(r,"create"),r=s(r),null==e.client?void r(new o({type:c.INSTANTIATION_OPTION_REQUIRED.type,code:c.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating American Express."})):(t=e.client.getConfiguration().analyticsMetadata.sdkVersion,t!==a?void r(new o({type:c.INCOMPATIBLE_VERSIONS.type,code:c.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+t+") and American Express (version "+a+") components must be from the same SDK version."})):void r(null,new i(e)))}var o=e("../lib/error"),i=e("./american-express"),s=e("../lib/deferred"),c=e("../errors"),a="3.6.3",E=e("../lib/throw-if-no-callback");r.exports={create:n,VERSION:a}},{"../errors":4,"../lib/deferred":6,"../lib/error":8,"../lib/throw-if-no-callback":9,"./american-express":1}],4:[function(e,r,t){"use strict";var n=e("./lib/error");r.exports={CALLBACK_REQUIRED:{type:n.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:n.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:n.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:n.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:n.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":8}],5:[function(e,r,t){"use strict";function n(e){var r,t,n;for(r=1;r<arguments.length;r++){t=arguments[r];for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}return e}var o="function"==typeof Object.assign?Object.assign:n;r.exports={assign:o,_assign:n}},{}],6:[function(e,r,t){"use strict";r.exports=function(e){return function(){var r=arguments;setTimeout(function(){e.apply(null,r)},1)}}},{}],7:[function(e,r,t){"use strict";function n(e,r){return r=null==r?"":r,e.reduce(function(e,t){return e[t]=r+t,e},{})}r.exports=n},{}],8:[function(e,r,t){"use strict";function n(e){if(!n.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),r.exports=n},{"./enumerate":7}],9:[function(e,r,t){"use strict";var n=e("./error"),o=e("../errors");r.exports=function(e,r){if("function"!=typeof e)throw new n({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:r+" must include a callback function."})}},{"../errors":4,"./error":8}]},{},[3])(3)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(r.braintree||(r.braintree={})).americanExpress=e()}}(function(){return function e(r,t,n){function o(s,a){if(!t[s]){if(!r[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var E=new Error("Cannot find module '"+s+"'");throw E.code="MODULE_NOT_FOUND",E}var u=t[s]={exports:{}};r[s][0].call(u.exports,function(e){var t=r[s][1][e];return o(t?t:e)},u,u.exports,e,r,t,n)}return t[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(e,r,t){"use strict";function n(e){this._client=e.client}var o=e("../lib/braintree-error"),i=e("../lib/deferred"),s=e("./errors"),a=e("../lib/assign").assign,c=e("../lib/throw-if-no-callback");n.prototype.getRewardsBalance=function(e,r){var t,n=e.nonce;return c(r,"getRewardsBalance"),r=i(r),n?(delete e.nonce,t=a({_meta:{source:"american-express"},paymentMethodNonce:n},e),void this._client.request({method:"get",endpoint:"payment_methods/amex_rewards_balance",data:t},function(e,t){e?r(new o({type:s.AMEX_NETWORK_ERROR.type,code:s.AMEX_NETWORK_ERROR.code,message:"A network error occurred when getting the American Express rewards balance.",details:{originalError:e}})):r(null,t)})):void r(new o({type:s.AMEX_NONCE_REQUIRED.type,code:s.AMEX_NONCE_REQUIRED.code,message:"getRewardsBalance must be called with a nonce."}))},n.prototype.getExpressCheckoutProfile=function(e,r){return c(r,"getExpressCheckoutProfile"),r=i(r),e.nonce?void this._client.request({method:"get",endpoint:"payment_methods/amex_express_checkout_cards/"+e.nonce,data:{_meta:{source:"american-express"},paymentMethodNonce:e.nonce}},function(e,t){e?r(new o({type:s.AMEX_NETWORK_ERROR.type,code:s.AMEX_NETWORK_ERROR.code,message:"A network error occurred when getting the American Express Checkout nonce profile.",details:{originalError:e}})):r(null,t)}):void r(new o({type:s.AMEX_NONCE_REQUIRED.type,code:s.AMEX_NONCE_REQUIRED.code,message:"getExpressCheckoutProfile must be called with a nonce."}))},r.exports=n},{"../lib/assign":4,"../lib/braintree-error":5,"../lib/deferred":6,"../lib/throw-if-no-callback":9,"./errors":2}],2:[function(e,r,t){"use strict";var n=e("../lib/braintree-error");r.exports={AMEX_NONCE_REQUIRED:{type:n.types.MERCHANT,code:"AMEX_NONCE_REQUIRED"},AMEX_NETWORK_ERROR:{type:n.types.NETWORK,code:"AMEX_NETWORK_ERROR"}}},{"../lib/braintree-error":5}],3:[function(e,r,t){"use strict";function n(e,r){var t;return E(r,"create"),r=s(r),null==e.client?void r(new o({type:a.INSTANTIATION_OPTION_REQUIRED.type,code:a.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating American Express."})):(t=e.client.getConfiguration().analyticsMetadata.sdkVersion,t!==c?void r(new o({type:a.INCOMPATIBLE_VERSIONS.type,code:a.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+t+") and American Express (version "+c+") components must be from the same SDK version."})):void r(null,new i(e)))}var o=e("../lib/braintree-error"),i=e("./american-express"),s=e("../lib/deferred"),a=e("../lib/errors"),c="3.7.0",E=e("../lib/throw-if-no-callback");r.exports={create:n,VERSION:c}},{"../lib/braintree-error":5,"../lib/deferred":6,"../lib/errors":8,"../lib/throw-if-no-callback":9,"./american-express":1}],4:[function(e,r,t){"use strict";function n(e){var r,t,n;for(r=1;r<arguments.length;r++){t=arguments[r];for(n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}return e}var o="function"==typeof Object.assign?Object.assign:n;r.exports={assign:o,_assign:n}},{}],5:[function(e,r,t){"use strict";function n(e){if(!n.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),r.exports=n},{"./enumerate":7}],6:[function(e,r,t){"use strict";r.exports=function(e){return function(){var r=arguments;setTimeout(function(){e.apply(null,r)},1)}}},{}],7:[function(e,r,t){"use strict";function n(e,r){return r=null==r?"":r,e.reduce(function(e,t){return e[t]=r+t,e},{})}r.exports=n},{}],8:[function(e,r,t){"use strict";var n=e("./braintree-error");r.exports={CALLBACK_REQUIRED:{type:n.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:n.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:n.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:n.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:n.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":5}],9:[function(e,r,t){"use strict";var n=e("./braintree-error"),o=e("../lib/errors");r.exports=function(e,r){if("function"!=typeof e)throw new n({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:r+" must include a callback function."})}},{"../lib/errors":8,"./braintree-error":5}]},{},[3])(3)});

@@ -5,6 +5,6 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).applePay = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var analytics = _dereq_('../lib/analytics');
var deferred = _dereq_('../lib/deferred');
var sharedErrors = _dereq_('../errors');
var sharedErrors = _dereq_('../lib/errors');
var errors = _dereq_('./errors');

@@ -282,6 +282,6 @@

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../errors":4,"../lib/analytics":6,"../lib/deferred":9,"../lib/error":11,"./errors":2}],2:[function(_dereq_,module,exports){
},{"../lib/analytics":5,"../lib/braintree-error":6,"../lib/deferred":9,"../lib/errors":11,"./errors":2}],2:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');

@@ -321,3 +321,3 @@ module.exports = {

},{"../lib/error":11}],3:[function(_dereq_,module,exports){
},{"../lib/braintree-error":6}],3:[function(_dereq_,module,exports){
'use strict';

@@ -330,3 +330,3 @@

var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var ApplePay = _dereq_('./apple-pay');

@@ -336,5 +336,5 @@ var analytics = _dereq_('../lib/analytics');

var throwIfNoCallback = _dereq_('../lib/throw-if-no-callback');
var sharedErrors = _dereq_('../errors');
var sharedErrors = _dereq_('../lib/errors');
var errors = _dereq_('./errors');
var VERSION = "3.6.3";
var VERSION = "3.7.0";

@@ -394,34 +394,5 @@ /**

},{"../errors":4,"../lib/analytics":6,"../lib/deferred":9,"../lib/error":11,"../lib/throw-if-no-callback":14,"./apple-pay":1,"./errors":2}],4:[function(_dereq_,module,exports){
},{"../lib/analytics":5,"../lib/braintree-error":6,"../lib/deferred":9,"../lib/errors":11,"../lib/throw-if-no-callback":14,"./apple-pay":1,"./errors":2}],4:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":11}],5:[function(_dereq_,module,exports){
'use strict';
var createAuthorizationData = _dereq_('./create-authorization-data');

@@ -458,3 +429,3 @@ var jsonClone = _dereq_('./json-clone');

},{"./constants":7,"./create-authorization-data":8,"./json-clone":12}],6:[function(_dereq_,module,exports){
},{"./constants":7,"./create-authorization-data":8,"./json-clone":12}],5:[function(_dereq_,module,exports){
'use strict';

@@ -493,6 +464,83 @@

},{"./add-metadata":5,"./constants":7}],7:[function(_dereq_,module,exports){
},{"./add-metadata":4,"./constants":7}],6:[function(_dereq_,module,exports){
'use strict';
var VERSION = "3.6.3";
var enumerate = _dereq_('./enumerate');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
}
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":10}],7:[function(_dereq_,module,exports){
'use strict';
var VERSION = "3.7.0";
var PLATFORM = 'web';

@@ -591,77 +639,29 @@

var enumerate = _dereq_('./enumerate');
var BraintreeError = _dereq_('./braintree-error');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":10}],12:[function(_dereq_,module,exports){
},{"./braintree-error":6}],12:[function(_dereq_,module,exports){
'use strict';

@@ -715,4 +715,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -729,3 +729,3 @@ module.exports = function (callback, functionName) {

},{"../errors":4,"./error":11}]},{},[3])(3)
},{"../lib/errors":11,"./braintree-error":6}]},{},[3])(3)
});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).applePay=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var p=new Error("Cannot find module '"+a+"'");throw p.code="MODULE_NOT_FOUND",p}var d=n[a]={exports:{}};t[a][0].call(d.exports,function(e){var n=t[a][1][e];return o(n?n:e)},d,d.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){(function(n){"use strict";function r(e){this._client=e.client,Object.defineProperty(this,"merchantIdentifier",{value:this._client.getConfiguration().gatewayConfiguration.applePayWeb.merchantIdentifier,configurable:!1,writable:!1})}var o=e("../lib/error"),i=e("../lib/analytics"),a=e("../lib/deferred"),s=e("../errors"),c=e("./errors");r.prototype.createPaymentRequest=function(e){var t=this._client.getConfiguration().gatewayConfiguration.applePayWeb,n={countryCode:t.countryCode,currencyCode:t.currencyCode,merchantCapabilities:t.merchantCapabilities||["supports3DS"],supportedNetworks:t.supportedNetworks.map(function(e){return"mastercard"===e?"masterCard":e})};return Object.assign({},n,e)},r.prototype.performValidation=function(e,t){var r;if("function"!=typeof t)throw new o({type:s.CALLBACK_REQUIRED.type,code:s.CALLBACK_REQUIRED.code,message:"performValidation requires a callback."});return t=a(t),e&&e.validationURL?(r={validationUrl:e.validationURL,domainName:e.domainName||n.location.hostname,merchantIdentifier:e.merchantIdentifier||this.merchantIdentifier},null!=e.displayName&&(r.displayName=e.displayName),void this._client.request({method:"post",endpoint:"apple_pay_web/sessions",data:{_meta:{source:"apple-pay"},applePayWebSession:r}},function(e,n){e?(t("CLIENT_REQUEST_ERROR"===e.code?new o({type:c.APPLE_PAY_MERCHANT_VALIDATION_FAILED.type,code:c.APPLE_PAY_MERCHANT_VALIDATION_FAILED.code,message:c.APPLE_PAY_MERCHANT_VALIDATION_FAILED.message,details:{originalError:e.details.originalError}}):new o({type:c.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.type,code:c.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.code,message:c.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.message,details:{originalError:e}})),i.sendEvent(this._client,"applepay.performValidation.failed")):(t(null,n),i.sendEvent(this._client,"applepay.performValidation.succeeded"))}.bind(this))):void t(new o(c.APPLE_PAY_VALIDATION_URL_REQUIRED))},r.prototype.tokenize=function(e,t){if("function"!=typeof t)throw new o({type:s.CALLBACK_REQUIRED.type,code:s.CALLBACK_REQUIRED.code,message:"tokenize requires a callback."});return t=a(t),e.token?void this._client.request({method:"post",endpoint:"payment_methods/apple_payment_tokens",data:{_meta:{source:"apple-pay"},applePaymentToken:Object.assign({},e.token,{paymentData:btoa(JSON.stringify(e.token.paymentData))})}},function(e,n){e?(t(new o({type:c.APPLE_PAY_TOKENIZATION.type,code:c.APPLE_PAY_TOKENIZATION.code,message:c.APPLE_PAY_TOKENIZATION.message,details:{originalError:e}})),i.sendEvent(this._client,"applepay.tokenize.failed")):(t(null,n.applePayCards[0]),i.sendEvent(this._client,"applepay.tokenize.succeeded"))}.bind(this)):void t(new o(c.APPLE_PAY_PAYMENT_TOKEN_REQUIRED))},t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":4,"../lib/analytics":6,"../lib/deferred":9,"../lib/error":11,"./errors":2}],2:[function(e,t,n){"use strict";var r=e("../lib/error");t.exports={APPLE_PAY_NOT_ENABLED:{type:r.types.MERCHANT,code:"APPLE_PAY_NOT_ENABLED",message:"Apple Pay is not enabled for this merchant."},APPLE_PAY_VALIDATION_URL_REQUIRED:{type:r.types.MERCHANT,code:"APPLE_PAY_VALIDATION_URL_REQUIRED",message:"performValidation must be called with a validationURL."},APPLE_PAY_MERCHANT_VALIDATION_NETWORK:{type:r.types.NETWORK,code:"APPLE_PAY_MERCHANT_VALIDATION_NETWORK",message:"A network error occurred when validating the Apple Pay merchant."},APPLE_PAY_MERCHANT_VALIDATION_FAILED:{type:r.types.MERCHANT,code:"APPLE_PAY_MERCHANT_VALIDATION_FAILED",message:"Make sure you have registered your domain name in the Braintree Control Panel."},APPLE_PAY_PAYMENT_TOKEN_REQUIRED:{type:r.types.MERCHANT,code:"APPLE_PAY_PAYMENT_TOKEN_REQUIRED",message:"tokenize must be called with a payment token."},APPLE_PAY_TOKENIZATION:{type:r.types.NETWORK,code:"APPLE_PAY_TOKENIZATION",message:"A network error occurred when processing the Apple Pay payment."}}},{"../lib/error":11}],3:[function(e,t,n){"use strict";function r(e,t){var n;return c(t,"create"),t=s(t),null==e.client?void t(new o({type:p.INSTANTIATION_OPTION_REQUIRED.type,code:p.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating Apple Pay."})):(n=e.client.getConfiguration().analyticsMetadata.sdkVersion,n!==l?void t(new o({type:p.INCOMPATIBLE_VERSIONS.type,code:p.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+n+") and Apple Pay (version "+l+") components must be from the same SDK version."})):e.client.getConfiguration().gatewayConfiguration.applePayWeb?(a.sendEvent(e.client,"applepay.initialized"),void t(null,new i(e))):void t(new o(d.APPLE_PAY_NOT_ENABLED)))}var o=e("../lib/error"),i=e("./apple-pay"),a=e("../lib/analytics"),s=e("../lib/deferred"),c=e("../lib/throw-if-no-callback"),p=e("../errors"),d=e("./errors"),l="3.6.3";t.exports={create:r,VERSION:l}},{"../errors":4,"../lib/analytics":6,"../lib/deferred":9,"../lib/error":11,"../lib/throw-if-no-callback":14,"./apple-pay":1,"./errors":2}],4:[function(e,t,n){"use strict";var r=e("./lib/error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":11}],5:[function(e,t,n){"use strict";function r(e,t){var n,r=t?i(t):{},s=o(e.authorization).attrs,c=i(e.analyticsMetadata);r.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(c[n]=r._meta[n]);return r._meta=c,s.tokenizationKey?r.tokenizationKey=s.tokenizationKey:r.authorizationFingerprint=s.authorizationFingerprint,r}var o=e("./create-authorization-data"),i=e("./json-clone"),a=e("./constants");t.exports=r},{"./constants":7,"./create-authorization-data":8,"./json-clone":12}],6:[function(e,t,n){"use strict";function r(e){return Math.floor(e/1e3)}function o(e,t,n){var o=e.getConfiguration(),s=e._request,c=r(Date.now()),p=o.gatewayConfiguration.analytics.url,d={analytics:[{kind:i.ANALYTICS_PREFIX+t,timestamp:c}]};s({url:p,method:"post",data:a(o,d),timeout:i.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var i=e("./constants"),a=e("./add-metadata");t.exports={sendEvent:o}},{"./add-metadata":5,"./constants":7}],7:[function(e,t,n){"use strict";var r="3.6.3",o="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:o,BRAINTREE_LIBRARY_VERSION:"braintree/"+o+"/"+r}},{}],8:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function o(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function i(e){var t,n,i={attrs:{},configUrl:""};return r(e)?(n=o(e),i.attrs.tokenizationKey=e,i.configUrl=s[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":13}],9:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],10:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],11:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":10}],12:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],13:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,o,i,a,s,c,p=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="";if(!p.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do o=d.indexOf(e.charAt(c++)),i=d.indexOf(e.charAt(c++)),a=d.indexOf(e.charAt(c++)),s=d.indexOf(e.charAt(c++)),t=(63&o)<<2|i>>4&3,n=(15&i)<<4|a>>2&15,r=(3&a)<<6|63&s,l+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(c<e.length);return l}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(e,t,n){"use strict";var r=e("./error"),o=e("../errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../errors":4,"./error":11}]},{},[3])(3)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).applePay=e()}}(function(){return function e(t,r,n){function i(a,s){if(!r[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var p=new Error("Cannot find module '"+a+"'");throw p.code="MODULE_NOT_FOUND",p}var l=r[a]={exports:{}};t[a][0].call(l.exports,function(e){var r=t[a][1][e];return i(r?r:e)},l,l.exports,e,t,r,n)}return r[a].exports}for(var o="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){(function(r){"use strict";function n(e){this._client=e.client,Object.defineProperty(this,"merchantIdentifier",{value:this._client.getConfiguration().gatewayConfiguration.applePayWeb.merchantIdentifier,configurable:!1,writable:!1})}var i=e("../lib/braintree-error"),o=e("../lib/analytics"),a=e("../lib/deferred"),s=e("../lib/errors"),c=e("./errors");n.prototype.createPaymentRequest=function(e){var t=this._client.getConfiguration().gatewayConfiguration.applePayWeb,r={countryCode:t.countryCode,currencyCode:t.currencyCode,merchantCapabilities:t.merchantCapabilities||["supports3DS"],supportedNetworks:t.supportedNetworks.map(function(e){return"mastercard"===e?"masterCard":e})};return Object.assign({},r,e)},n.prototype.performValidation=function(e,t){var n;if("function"!=typeof t)throw new i({type:s.CALLBACK_REQUIRED.type,code:s.CALLBACK_REQUIRED.code,message:"performValidation requires a callback."});return t=a(t),e&&e.validationURL?(n={validationUrl:e.validationURL,domainName:e.domainName||r.location.hostname,merchantIdentifier:e.merchantIdentifier||this.merchantIdentifier},null!=e.displayName&&(n.displayName=e.displayName),void this._client.request({method:"post",endpoint:"apple_pay_web/sessions",data:{_meta:{source:"apple-pay"},applePayWebSession:n}},function(e,r){e?(t("CLIENT_REQUEST_ERROR"===e.code?new i({type:c.APPLE_PAY_MERCHANT_VALIDATION_FAILED.type,code:c.APPLE_PAY_MERCHANT_VALIDATION_FAILED.code,message:c.APPLE_PAY_MERCHANT_VALIDATION_FAILED.message,details:{originalError:e.details.originalError}}):new i({type:c.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.type,code:c.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.code,message:c.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.message,details:{originalError:e}})),o.sendEvent(this._client,"applepay.performValidation.failed")):(t(null,r),o.sendEvent(this._client,"applepay.performValidation.succeeded"))}.bind(this))):void t(new i(c.APPLE_PAY_VALIDATION_URL_REQUIRED))},n.prototype.tokenize=function(e,t){if("function"!=typeof t)throw new i({type:s.CALLBACK_REQUIRED.type,code:s.CALLBACK_REQUIRED.code,message:"tokenize requires a callback."});return t=a(t),e.token?void this._client.request({method:"post",endpoint:"payment_methods/apple_payment_tokens",data:{_meta:{source:"apple-pay"},applePaymentToken:Object.assign({},e.token,{paymentData:btoa(JSON.stringify(e.token.paymentData))})}},function(e,r){e?(t(new i({type:c.APPLE_PAY_TOKENIZATION.type,code:c.APPLE_PAY_TOKENIZATION.code,message:c.APPLE_PAY_TOKENIZATION.message,details:{originalError:e}})),o.sendEvent(this._client,"applepay.tokenize.failed")):(t(null,r.applePayCards[0]),o.sendEvent(this._client,"applepay.tokenize.succeeded"))}.bind(this)):void t(new i(c.APPLE_PAY_PAYMENT_TOKEN_REQUIRED))},t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lib/analytics":5,"../lib/braintree-error":6,"../lib/deferred":9,"../lib/errors":11,"./errors":2}],2:[function(e,t,r){"use strict";var n=e("../lib/braintree-error");t.exports={APPLE_PAY_NOT_ENABLED:{type:n.types.MERCHANT,code:"APPLE_PAY_NOT_ENABLED",message:"Apple Pay is not enabled for this merchant."},APPLE_PAY_VALIDATION_URL_REQUIRED:{type:n.types.MERCHANT,code:"APPLE_PAY_VALIDATION_URL_REQUIRED",message:"performValidation must be called with a validationURL."},APPLE_PAY_MERCHANT_VALIDATION_NETWORK:{type:n.types.NETWORK,code:"APPLE_PAY_MERCHANT_VALIDATION_NETWORK",message:"A network error occurred when validating the Apple Pay merchant."},APPLE_PAY_MERCHANT_VALIDATION_FAILED:{type:n.types.MERCHANT,code:"APPLE_PAY_MERCHANT_VALIDATION_FAILED",message:"Make sure you have registered your domain name in the Braintree Control Panel."},APPLE_PAY_PAYMENT_TOKEN_REQUIRED:{type:n.types.MERCHANT,code:"APPLE_PAY_PAYMENT_TOKEN_REQUIRED",message:"tokenize must be called with a payment token."},APPLE_PAY_TOKENIZATION:{type:n.types.NETWORK,code:"APPLE_PAY_TOKENIZATION",message:"A network error occurred when processing the Apple Pay payment."}}},{"../lib/braintree-error":6}],3:[function(e,t,r){"use strict";function n(e,t){var r;return c(t,"create"),t=s(t),null==e.client?void t(new i({type:p.INSTANTIATION_OPTION_REQUIRED.type,code:p.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating Apple Pay."})):(r=e.client.getConfiguration().analyticsMetadata.sdkVersion,r!==d?void t(new i({type:p.INCOMPATIBLE_VERSIONS.type,code:p.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+r+") and Apple Pay (version "+d+") components must be from the same SDK version."})):e.client.getConfiguration().gatewayConfiguration.applePayWeb?(a.sendEvent(e.client,"applepay.initialized"),void t(null,new o(e))):void t(new i(l.APPLE_PAY_NOT_ENABLED)))}var i=e("../lib/braintree-error"),o=e("./apple-pay"),a=e("../lib/analytics"),s=e("../lib/deferred"),c=e("../lib/throw-if-no-callback"),p=e("../lib/errors"),l=e("./errors"),d="3.7.0";t.exports={create:n,VERSION:d}},{"../lib/analytics":5,"../lib/braintree-error":6,"../lib/deferred":9,"../lib/errors":11,"../lib/throw-if-no-callback":14,"./apple-pay":1,"./errors":2}],4:[function(e,t,r){"use strict";function n(e,t){var r,n=t?o(t):{},s=i(e.authorization).attrs,c=o(e.analyticsMetadata);n.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(r in n._meta)n._meta.hasOwnProperty(r)&&(c[r]=n._meta[r]);return n._meta=c,s.tokenizationKey?n.tokenizationKey=s.tokenizationKey:n.authorizationFingerprint=s.authorizationFingerprint,n}var i=e("./create-authorization-data"),o=e("./json-clone"),a=e("./constants");t.exports=n},{"./constants":7,"./create-authorization-data":8,"./json-clone":12}],5:[function(e,t,r){"use strict";function n(e){return Math.floor(e/1e3)}function i(e,t,r){var i=e.getConfiguration(),s=e._request,c=n(Date.now()),p=i.gatewayConfiguration.analytics.url,l={analytics:[{kind:o.ANALYTICS_PREFIX+t,timestamp:c}]};s({url:p,method:"post",data:a(i,l),timeout:o.ANALYTICS_REQUEST_TIMEOUT_MS},r)}var o=e("./constants"),a=e("./add-metadata");t.exports={sendEvent:i}},{"./add-metadata":4,"./constants":7}],6:[function(e,t,r){"use strict";function n(e){if(!n.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var i=e("./enumerate");n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=n},{"./enumerate":10}],7:[function(e,t,r){"use strict";var n="3.7.0",i="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:n,INTEGRATION:"custom",SOURCE:"client",PLATFORM:i,BRAINTREE_LIBRARY_VERSION:"braintree/"+i+"/"+n}},{}],8:[function(e,t,r){"use strict";function n(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function i(e){var t=e.split("_"),r=t[0],n=t.slice(2).join("_");return{merchantId:n,environment:r}}function o(e){var t,r,o={attrs:{},configUrl:""};return n(e)?(r=i(e),o.attrs.tokenizationKey=e,o.configUrl=s[r.environment]+"/merchants/"+r.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),o.attrs.authorizationFingerprint=t.authorizationFingerprint,o.configUrl=t.configUrl),o}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=o},{"../lib/polyfill":13}],9:[function(e,t,r){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],10:[function(e,t,r){"use strict";function n(e,t){return t=null==t?"":t,e.reduce(function(e,r){return e[r]=t+r,e},{})}t.exports=n},{}],11:[function(e,t,r){"use strict";var n=e("./braintree-error");t.exports={CALLBACK_REQUIRED:{type:n.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:n.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:n.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:n.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:n.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":6}],12:[function(e,t,r){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],13:[function(e,t,r){(function(e){"use strict";function r(e){var t,r,n,i,o,a,s,c,p=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="";if(!p.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do i=l.indexOf(e.charAt(c++)),o=l.indexOf(e.charAt(c++)),a=l.indexOf(e.charAt(c++)),s=l.indexOf(e.charAt(c++)),t=(63&i)<<2|o>>4&3,r=(15&o)<<4|a>>2&15,n=(3&a)<<6|63&s,d+=String.fromCharCode(t)+(r?String.fromCharCode(r):"")+(n?String.fromCharCode(n):"");while(c<e.length);return d}var n="function"==typeof e.atob?e.atob:r;t.exports={atob:n,_atob:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],14:[function(e,t,r){"use strict";var n=e("./braintree-error"),i=e("../lib/errors");t.exports=function(e,t){if("function"!=typeof e)throw new n({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../lib/errors":11,"./braintree-error":6}]},{},[3])(3)});
CHANGELOG
=========
## 3.7.0
* Client
* Fix issue where `getConfiguration` and `toJSON` were not returning the same object
* Hosted Fields
* Fix a bug when placeholders aren't supplied for expiration month/year
* Fix a bug where CVV field wouldn't validate all possible card type CVV lengths
* Fix a bug where Samsung keyboards would incorrectly highlight the first character typed
* Disable input formatting in the Android Samsung Internet browser
* PayPal
* Return PayPal Credit financing details in `tokenizePayload.creditFinancingOffered`
* PayPal Checkout
* Create the PayPal Checkout component to integrate with PayPal's [checkout.js library](https://github.com/paypal/paypal-checkout)
## 3.6.3

@@ -5,0 +19,0 @@

@@ -6,3 +6,3 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).client = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

var isWhitelistedDomain = _dereq_('../lib/is-whitelisted-domain');
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var addMetadata = _dereq_('../lib/add-metadata');

@@ -68,4 +68,2 @@ var deferred = _dereq_('../lib/deferred');

this._configuration = this.getConfiguration();
this.toJSON = this.getConfiguration;
}

@@ -173,8 +171,12 @@

Client.prototype.toJSON = function () {
return this.getConfiguration();
};
module.exports = Client;
},{"../lib/add-metadata":13,"../lib/deferred":16,"../lib/error":18,"../lib/is-whitelisted-domain":19,"./errors":2,"./request":7}],2:[function(_dereq_,module,exports){
},{"../lib/add-metadata":12,"../lib/braintree-error":13,"../lib/deferred":16,"../lib/is-whitelisted-domain":19,"./errors":2,"./request":7}],2:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');

@@ -227,7 +229,7 @@ module.exports = {

},{"../lib/error":18}],3:[function(_dereq_,module,exports){
},{"../lib/braintree-error":13}],3:[function(_dereq_,module,exports){
(function (global){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var request = _dereq_('./request');

@@ -306,12 +308,12 @@ var uuid = _dereq_('../lib/uuid');

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../lib/constants":14,"../lib/create-authorization-data":15,"../lib/error":18,"../lib/uuid":25,"./errors":2,"./request":7}],4:[function(_dereq_,module,exports){
},{"../lib/braintree-error":13,"../lib/constants":14,"../lib/create-authorization-data":15,"../lib/uuid":25,"./errors":2,"./request":7}],4:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var Client = _dereq_('./client');
var getConfiguration = _dereq_('./get-configuration').getConfiguration;
var throwIfNoCallback = _dereq_('../lib/throw-if-no-callback');
var packageVersion = "3.6.3";
var packageVersion = "3.7.0";
var deferred = _dereq_('../lib/deferred');
var sharedErrors = _dereq_('../errors');
var sharedErrors = _dereq_('../lib/errors');

@@ -379,3 +381,3 @@ /** @module braintree-web/client */

},{"../errors":12,"../lib/deferred":16,"../lib/error":18,"../lib/throw-if-no-callback":24,"./client":1,"./get-configuration":3}],5:[function(_dereq_,module,exports){
},{"../lib/braintree-error":13,"../lib/deferred":16,"../lib/errors":18,"../lib/throw-if-no-callback":24,"./client":1,"./get-configuration":3}],5:[function(_dereq_,module,exports){
(function (global){

@@ -660,31 +662,2 @@ 'use strict';

var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":18}],13:[function(_dereq_,module,exports){
'use strict';
var createAuthorizationData = _dereq_('./create-authorization-data');

@@ -721,6 +694,83 @@ var jsonClone = _dereq_('./json-clone');

},{"./constants":14,"./create-authorization-data":15,"./json-clone":20}],14:[function(_dereq_,module,exports){
},{"./constants":14,"./create-authorization-data":15,"./json-clone":20}],13:[function(_dereq_,module,exports){
'use strict';
var VERSION = "3.6.3";
var enumerate = _dereq_('./enumerate');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
}
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":17}],14:[function(_dereq_,module,exports){
'use strict';
var VERSION = "3.7.0";
var PLATFORM = 'web';

@@ -819,77 +869,29 @@

var enumerate = _dereq_('./enumerate');
var BraintreeError = _dereq_('./braintree-error');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":17}],19:[function(_dereq_,module,exports){
},{"./braintree-error":13}],19:[function(_dereq_,module,exports){
'use strict';

@@ -1084,4 +1086,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -1098,3 +1100,3 @@ module.exports = function (callback, functionName) {

},{"../errors":12,"./error":18}],25:[function(_dereq_,module,exports){
},{"../lib/errors":18,"./braintree-error":13}],25:[function(_dereq_,module,exports){
'use strict';

@@ -1101,0 +1103,0 @@

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).client=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";function r(e){var t,n;if(e=e||{},t=JSON.stringify(e),n=e.gatewayConfiguration,!n)throw new a(c.CLIENT_MISSING_GATEWAY_CONFIGURATION);["assetsUrl","clientApiUrl","configUrl"].forEach(function(e){if(e in n&&!i(n[e]))throw new a({type:c.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,code:c.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,message:e+" property is on an invalid domain."})}),this.getConfiguration=function(){return JSON.parse(t)},this._request=o,this._baseUrl=e.gatewayConfiguration.clientApiUrl+"/v1/",this._configuration=this.getConfiguration(),this.toJSON=this.getConfiguration}var o=e("./request"),i=e("../lib/is-whitelisted-domain"),a=e("../lib/error"),s=e("../lib/add-metadata"),u=e("../lib/deferred"),c=e("./errors");r.prototype.request=function(e,t){var n;return e.method?e.endpoint||(n="options.endpoint"):n="options.method",n?(t=u(t),void t(new a({type:c.CLIENT_OPTION_REQUIRED.type,code:c.CLIENT_OPTION_REQUIRED.code,message:n+" is required when making a request."}))):void this._request({url:this._baseUrl+e.endpoint,method:e.method,data:s(this._configuration,e.data),headers:e._headers,timeout:e.timeout},this._bindRequestCallback(t))},r.prototype._bindRequestCallback=function(e){return function(t,n,r){-1===r?e(new a(c.CLIENT_REQUEST_TIMEOUT),null,r):403===r?e(new a(c.CLIENT_AUTHORIZATION_INSUFFICIENT),null,r):429===r?e(new a(c.CLIENT_RATE_LIMITED),null,r):r>=500?e(new a(c.CLIENT_GATEWAY_NETWORK),null,r):200>r||r>=400?e(new a({type:c.CLIENT_REQUEST_ERROR.type,code:c.CLIENT_REQUEST_ERROR.code,message:c.CLIENT_REQUEST_ERROR.message,details:{originalError:t}}),null,r):e(null,n,r)}},t.exports=r},{"../lib/add-metadata":13,"../lib/deferred":16,"../lib/error":18,"../lib/is-whitelisted-domain":19,"./errors":2,"./request":7}],2:[function(e,t,n){"use strict";var r=e("../lib/error");t.exports={CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN:{type:r.types.MERCHANT,code:"CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN"},CLIENT_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"CLIENT_OPTION_REQUIRED"},CLIENT_MISSING_GATEWAY_CONFIGURATION:{type:r.types.INTERNAL,code:"CLIENT_MISSING_GATEWAY_CONFIGURATION",message:"Missing gatewayConfiguration."},CLIENT_INVALID_AUTHORIZATION:{type:r.types.MERCHANT,code:"CLIENT_INVALID_AUTHORIZATION",message:"Authorization is invalid. Make sure your client token or tokenization key is valid."},CLIENT_GATEWAY_NETWORK:{type:r.types.NETWORK,code:"CLIENT_GATEWAY_NETWORK",message:"Cannot contact the gateway at this time."},CLIENT_REQUEST_TIMEOUT:{type:r.types.NETWORK,code:"CLIENT_REQUEST_TIMEOUT",message:"Request timed out waiting for a reply."},CLIENT_REQUEST_ERROR:{type:r.types.NETWORK,code:"CLIENT_REQUEST_ERROR",message:"There was a problem with your request."},CLIENT_RATE_LIMITED:{type:r.types.MERCHANT,code:"CLIENT_RATE_LIMITED",message:"You are being rate-limited; please try again in a few minutes."},CLIENT_AUTHORIZATION_INSUFFICIENT:{type:r.types.MERCHANT,code:"CLIENT_AUTHORIZATION_INSUFFICIENT",message:"The authorization used has insufficient privileges."}}},{"../lib/error":18}],3:[function(e,t,n){(function(n){"use strict";function r(e,t){var r,l,f,d,p=a(),E={merchantAppId:n.location.host,platform:s.PLATFORM,sdkVersion:s.VERSION,source:s.SOURCE,integration:s.INTEGRATION,integrationType:s.INTEGRATION,sessionId:p};try{l=u(e.authorization)}catch(I){return void t(new o(c.CLIENT_INVALID_AUTHORIZATION))}f=l.attrs,d=l.configUrl,f._meta=E,f.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION,f.configVersion="3",i({url:d,method:"GET",data:f},function(n,i,a){var s;return n?(s=403===a?c.CLIENT_AUTHORIZATION_INSUFFICIENT:c.CLIENT_GATEWAY_NETWORK,void t(new o({type:s.type,code:s.code,message:s.message,details:{originalError:n}}))):(r={authorization:e.authorization,authorizationType:f.tokenizationKey?"TOKENIZATION_KEY":"CLIENT_TOKEN",analyticsMetadata:E,gatewayConfiguration:i},void t(null,r))})}var o=e("../lib/error"),i=e("./request"),a=e("../lib/uuid"),s=e("../lib/constants"),u=e("../lib/create-authorization-data"),c=e("./errors");t.exports={getConfiguration:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lib/constants":14,"../lib/create-authorization-data":15,"../lib/error":18,"../lib/uuid":25,"./errors":2,"./request":7}],4:[function(e,t,n){"use strict";function r(e,t){return s(t,"create"),t=c(t),e.authorization?void a(e,function(e,n){var r;if(e)return void t(e);try{r=new i(n)}catch(o){return void t(o)}t(null,r)}):void t(new o({type:l.INSTANTIATION_OPTION_REQUIRED.type,code:l.INSTANTIATION_OPTION_REQUIRED.code,message:"options.authorization is required when instantiating a client."}))}var o=e("../lib/error"),i=e("./client"),a=e("./get-configuration").getConfiguration,s=e("../lib/throw-if-no-callback"),u="3.6.3",c=e("../lib/deferred"),l=e("../errors");t.exports={create:r,VERSION:u}},{"../errors":12,"../lib/deferred":16,"../lib/error":18,"../lib/throw-if-no-callback":24,"./client":1,"./get-configuration":3}],5:[function(e,t,n){(function(n){"use strict";function r(){return u?new XMLHttpRequest:new XDomainRequest}function o(e,t){var n,o,c=e.method,l=e.url,f=e.data,d=e.timeout,p=e.headers||{},E=r(),I=t;"GET"===c&&(l=i.queryify(l,f),f=null),u?E.onreadystatechange=function(){4===E.readyState&&(n=E.status,o=s(E.responseText),n>=400||200>n?I(o||"error",null,n||500):I(null,o,n))}:(E.onload=function(){I(null,s(E.responseText),E.status)},E.onerror=function(){I("error",null,500)},E.onprogress=function(){},E.ontimeout=function(){I("timeout",null,-1)}),E.open(c,l,!0),E.timeout=d,u&&(E.setRequestHeader("Content-Type","application/json"),Object.keys(p).forEach(function(e){E.setRequestHeader(e,p[e])}));try{E.send(a(c,f))}catch(T){}}var i=e("../../lib/querystring"),a=e("./prep-body"),s=e("./parse-body"),u=n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest;t.exports={request:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../lib/querystring":23,"./parse-body":10,"./prep-body":11}],6:[function(e,t,n){(function(e){"use strict";t.exports=function(){return e.navigator.userAgent}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(e,t,n){"use strict";function r(){return null==o&&(o=!(c()&&/MSIE\s(8|9)/.test(u()))),o}var o,i=e("../../lib/once"),a=e("./jsonp-driver"),s=e("./ajax-driver"),u=e("./get-user-agent"),c=e("./is-http");t.exports=function(e,t){t=i(t||Function.prototype),e.method=(e.method||"GET").toUpperCase(),e.timeout=null==e.timeout?6e4:e.timeout,e.data=e.data||{},r()?s.request(e,t):a.request(e,t)}},{"../../lib/once":21,"./ajax-driver":5,"./get-user-agent":6,"./is-http":8,"./jsonp-driver":9}],8:[function(e,t,n){(function(e){"use strict";t.exports=function(){return"http:"===e.location.protocol}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t,n){(function(n){"use strict";function r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function o(e,t){var r=document.createElement("script"),o=!1;return r.src=e,r.async=!0,r.onerror=function(){n[t]({message:"error",status:500})},r.onload=r.onreadystatechange=function(){o||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(o=!0,r.onload=r.onreadystatechange=null)},r}function i(e){try{delete n[e]}catch(t){n[e]=null}}function a(e,t){d[t]=setTimeout(function(){d[t]=null,n[t]({error:"timeout",status:-1}),n[t]=function(){i(t)}},e)}function s(e,t,o){n[o]=function(n){var a=n.status||500,s=null,u=null;delete n.status,a>=400||200>a?s=n:u=n,i(o),r(e),clearTimeout(d[o]),t(s,u,a)}}function u(e,t){var n,r="callback_json_"+l().replace(/-/g,""),i=e.url,u=e.data,d=e.method,p=e.timeout;i=f.queryify(i,u),i=f.queryify(i,{_method:d,callback:r}),n=o(i,r),s(n,t,r),a(p,r),c||(c=document.getElementsByTagName("head")[0]),c.appendChild(n)}var c,l=e("../../lib/uuid"),f=e("../../lib/querystring"),d={};t.exports={request:u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../lib/querystring":23,"../../lib/uuid":25}],10:[function(e,t,n){"use strict";t.exports=function(e){try{e=JSON.parse(e)}catch(t){}return e}},{}],11:[function(e,t,n){"use strict";t.exports=function(e,t){if("string"!=typeof e)throw new Error("Method must be a string");return"get"!==e.toLowerCase()&&null!=t&&(t="string"==typeof t?t:JSON.stringify(t)),t}},{}],12:[function(e,t,n){"use strict";var r=e("./lib/error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":18}],13:[function(e,t,n){"use strict";function r(e,t){var n,r=t?i(t):{},s=o(e.authorization).attrs,u=i(e.analyticsMetadata);r.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(u[n]=r._meta[n]);return r._meta=u,s.tokenizationKey?r.tokenizationKey=s.tokenizationKey:r.authorizationFingerprint=s.authorizationFingerprint,r}var o=e("./create-authorization-data"),i=e("./json-clone"),a=e("./constants");t.exports=r},{"./constants":14,"./create-authorization-data":15,"./json-clone":20}],14:[function(e,t,n){"use strict";var r="3.6.3",o="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:o,BRAINTREE_LIBRARY_VERSION:"braintree/"+o+"/"+r}},{}],15:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function o(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function i(e){var t,n,i={attrs:{},configUrl:""};return r(e)?(n=o(e),i.attrs.tokenizationKey=e,i.configUrl=s[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":22}],16:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],17:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],18:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":17}],19:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function o(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(i=i||document.createElement("a"),i.href=e,t=r(i.hostname),a.hasOwnProperty(t)):!1}var i,a={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=o},{}],20:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],21:[function(e,t,n){"use strict";function r(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=r},{}],22:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,o,i,a,s,u,c=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";if(!c.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");u=0;do o=l.indexOf(e.charAt(u++)),i=l.indexOf(e.charAt(u++)),a=l.indexOf(e.charAt(u++)),s=l.indexOf(e.charAt(u++)),t=(63&o)<<2|i>>4&3,n=(15&i)<<4|a>>2&15,r=(3&a)<<6|63&s,f+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(u<e.length);return f}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,n){(function(e){"use strict";function n(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&"[object Array]"===Object.prototype.toString.call(e)||!1}function o(t){var n,r;return t=t||e.location.href,/\?/.test(t)?(n=t.replace(/#.*$/,"").replace(/^.*\?/,"").split("&"),r=n.reduce(function(e,t){var n=t.split("="),r=decodeURIComponent(n[0]),o=decodeURIComponent(n[1]);return e[r]=o,e},{})):{}}function i(e,t){var n,o,a,s=[];for(a in e)e.hasOwnProperty(a)&&(o=e[a],n=t?r(e)?t+"[]":t+"["+a+"]":a,"object"==typeof o?s.push(i(o,n)):s.push(encodeURIComponent(n)+"="+encodeURIComponent(o)));return s.join("&")}function a(e,t){return e=e||"",null!=t&&"object"==typeof t&&n(t)&&(e+=-1===e.indexOf("?")?"?":"",e+=-1!==e.indexOf("=")?"&":"",e+=i(t)),e}t.exports={parse:o,stringify:i,queryify:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,n){"use strict";var r=e("./error"),o=e("../errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../errors":12,"./error":18}],25:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}]},{},[4])(4)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).client=e()}}(function(){return function e(t,n,r){function o(a,s){if(!n[a]){if(!t[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t,n){"use strict";function r(e){var t,n;if(e=e||{},t=JSON.stringify(e),n=e.gatewayConfiguration,!n)throw new a(c.CLIENT_MISSING_GATEWAY_CONFIGURATION);["assetsUrl","clientApiUrl","configUrl"].forEach(function(e){if(e in n&&!i(n[e]))throw new a({type:c.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,code:c.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,message:e+" property is on an invalid domain."})}),this.getConfiguration=function(){return JSON.parse(t)},this._request=o,this._baseUrl=e.gatewayConfiguration.clientApiUrl+"/v1/",this._configuration=this.getConfiguration()}var o=e("./request"),i=e("../lib/is-whitelisted-domain"),a=e("../lib/braintree-error"),s=e("../lib/add-metadata"),u=e("../lib/deferred"),c=e("./errors");r.prototype.request=function(e,t){var n;return e.method?e.endpoint||(n="options.endpoint"):n="options.method",n?(t=u(t),void t(new a({type:c.CLIENT_OPTION_REQUIRED.type,code:c.CLIENT_OPTION_REQUIRED.code,message:n+" is required when making a request."}))):void this._request({url:this._baseUrl+e.endpoint,method:e.method,data:s(this._configuration,e.data),headers:e._headers,timeout:e.timeout},this._bindRequestCallback(t))},r.prototype._bindRequestCallback=function(e){return function(t,n,r){-1===r?e(new a(c.CLIENT_REQUEST_TIMEOUT),null,r):403===r?e(new a(c.CLIENT_AUTHORIZATION_INSUFFICIENT),null,r):429===r?e(new a(c.CLIENT_RATE_LIMITED),null,r):r>=500?e(new a(c.CLIENT_GATEWAY_NETWORK),null,r):200>r||r>=400?e(new a({type:c.CLIENT_REQUEST_ERROR.type,code:c.CLIENT_REQUEST_ERROR.code,message:c.CLIENT_REQUEST_ERROR.message,details:{originalError:t}}),null,r):e(null,n,r)}},r.prototype.toJSON=function(){return this.getConfiguration()},t.exports=r},{"../lib/add-metadata":12,"../lib/braintree-error":13,"../lib/deferred":16,"../lib/is-whitelisted-domain":19,"./errors":2,"./request":7}],2:[function(e,t,n){"use strict";var r=e("../lib/braintree-error");t.exports={CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN:{type:r.types.MERCHANT,code:"CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN"},CLIENT_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"CLIENT_OPTION_REQUIRED"},CLIENT_MISSING_GATEWAY_CONFIGURATION:{type:r.types.INTERNAL,code:"CLIENT_MISSING_GATEWAY_CONFIGURATION",message:"Missing gatewayConfiguration."},CLIENT_INVALID_AUTHORIZATION:{type:r.types.MERCHANT,code:"CLIENT_INVALID_AUTHORIZATION",message:"Authorization is invalid. Make sure your client token or tokenization key is valid."},CLIENT_GATEWAY_NETWORK:{type:r.types.NETWORK,code:"CLIENT_GATEWAY_NETWORK",message:"Cannot contact the gateway at this time."},CLIENT_REQUEST_TIMEOUT:{type:r.types.NETWORK,code:"CLIENT_REQUEST_TIMEOUT",message:"Request timed out waiting for a reply."},CLIENT_REQUEST_ERROR:{type:r.types.NETWORK,code:"CLIENT_REQUEST_ERROR",message:"There was a problem with your request."},CLIENT_RATE_LIMITED:{type:r.types.MERCHANT,code:"CLIENT_RATE_LIMITED",message:"You are being rate-limited; please try again in a few minutes."},CLIENT_AUTHORIZATION_INSUFFICIENT:{type:r.types.MERCHANT,code:"CLIENT_AUTHORIZATION_INSUFFICIENT",message:"The authorization used has insufficient privileges."}}},{"../lib/braintree-error":13}],3:[function(e,t,n){(function(n){"use strict";function r(e,t){var r,l,f,d,p=a(),E={merchantAppId:n.location.host,platform:s.PLATFORM,sdkVersion:s.VERSION,source:s.SOURCE,integration:s.INTEGRATION,integrationType:s.INTEGRATION,sessionId:p};try{l=u(e.authorization)}catch(I){return void t(new o(c.CLIENT_INVALID_AUTHORIZATION))}f=l.attrs,d=l.configUrl,f._meta=E,f.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION,f.configVersion="3",i({url:d,method:"GET",data:f},function(n,i,a){var s;return n?(s=403===a?c.CLIENT_AUTHORIZATION_INSUFFICIENT:c.CLIENT_GATEWAY_NETWORK,void t(new o({type:s.type,code:s.code,message:s.message,details:{originalError:n}}))):(r={authorization:e.authorization,authorizationType:f.tokenizationKey?"TOKENIZATION_KEY":"CLIENT_TOKEN",analyticsMetadata:E,gatewayConfiguration:i},void t(null,r))})}var o=e("../lib/braintree-error"),i=e("./request"),a=e("../lib/uuid"),s=e("../lib/constants"),u=e("../lib/create-authorization-data"),c=e("./errors");t.exports={getConfiguration:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lib/braintree-error":13,"../lib/constants":14,"../lib/create-authorization-data":15,"../lib/uuid":25,"./errors":2,"./request":7}],4:[function(e,t,n){"use strict";function r(e,t){return s(t,"create"),t=c(t),e.authorization?void a(e,function(e,n){var r;if(e)return void t(e);try{r=new i(n)}catch(o){return void t(o)}t(null,r)}):void t(new o({type:l.INSTANTIATION_OPTION_REQUIRED.type,code:l.INSTANTIATION_OPTION_REQUIRED.code,message:"options.authorization is required when instantiating a client."}))}var o=e("../lib/braintree-error"),i=e("./client"),a=e("./get-configuration").getConfiguration,s=e("../lib/throw-if-no-callback"),u="3.7.0",c=e("../lib/deferred"),l=e("../lib/errors");t.exports={create:r,VERSION:u}},{"../lib/braintree-error":13,"../lib/deferred":16,"../lib/errors":18,"../lib/throw-if-no-callback":24,"./client":1,"./get-configuration":3}],5:[function(e,t,n){(function(n){"use strict";function r(){return u?new XMLHttpRequest:new XDomainRequest}function o(e,t){var n,o,c=e.method,l=e.url,f=e.data,d=e.timeout,p=e.headers||{},E=r(),I=t;"GET"===c&&(l=i.queryify(l,f),f=null),u?E.onreadystatechange=function(){4===E.readyState&&(n=E.status,o=s(E.responseText),n>=400||200>n?I(o||"error",null,n||500):I(null,o,n))}:(E.onload=function(){I(null,s(E.responseText),E.status)},E.onerror=function(){I("error",null,500)},E.onprogress=function(){},E.ontimeout=function(){I("timeout",null,-1)}),E.open(c,l,!0),E.timeout=d,u&&(E.setRequestHeader("Content-Type","application/json"),Object.keys(p).forEach(function(e){E.setRequestHeader(e,p[e])}));try{E.send(a(c,f))}catch(T){}}var i=e("../../lib/querystring"),a=e("./prep-body"),s=e("./parse-body"),u=n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest;t.exports={request:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../lib/querystring":23,"./parse-body":10,"./prep-body":11}],6:[function(e,t,n){(function(e){"use strict";t.exports=function(){return e.navigator.userAgent}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],7:[function(e,t,n){"use strict";function r(){return null==o&&(o=!(c()&&/MSIE\s(8|9)/.test(u()))),o}var o,i=e("../../lib/once"),a=e("./jsonp-driver"),s=e("./ajax-driver"),u=e("./get-user-agent"),c=e("./is-http");t.exports=function(e,t){t=i(t||Function.prototype),e.method=(e.method||"GET").toUpperCase(),e.timeout=null==e.timeout?6e4:e.timeout,e.data=e.data||{},r()?s.request(e,t):a.request(e,t)}},{"../../lib/once":21,"./ajax-driver":5,"./get-user-agent":6,"./is-http":8,"./jsonp-driver":9}],8:[function(e,t,n){(function(e){"use strict";t.exports=function(){return"http:"===e.location.protocol}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],9:[function(e,t,n){(function(n){"use strict";function r(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function o(e,t){var r=document.createElement("script"),o=!1;return r.src=e,r.async=!0,r.onerror=function(){n[t]({message:"error",status:500})},r.onload=r.onreadystatechange=function(){o||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(o=!0,r.onload=r.onreadystatechange=null)},r}function i(e){try{delete n[e]}catch(t){n[e]=null}}function a(e,t){d[t]=setTimeout(function(){d[t]=null,n[t]({error:"timeout",status:-1}),n[t]=function(){i(t)}},e)}function s(e,t,o){n[o]=function(n){var a=n.status||500,s=null,u=null;delete n.status,a>=400||200>a?s=n:u=n,i(o),r(e),clearTimeout(d[o]),t(s,u,a)}}function u(e,t){var n,r="callback_json_"+l().replace(/-/g,""),i=e.url,u=e.data,d=e.method,p=e.timeout;i=f.queryify(i,u),i=f.queryify(i,{_method:d,callback:r}),n=o(i,r),s(n,t,r),a(p,r),c||(c=document.getElementsByTagName("head")[0]),c.appendChild(n)}var c,l=e("../../lib/uuid"),f=e("../../lib/querystring"),d={};t.exports={request:u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../lib/querystring":23,"../../lib/uuid":25}],10:[function(e,t,n){"use strict";t.exports=function(e){try{e=JSON.parse(e)}catch(t){}return e}},{}],11:[function(e,t,n){"use strict";t.exports=function(e,t){if("string"!=typeof e)throw new Error("Method must be a string");return"get"!==e.toLowerCase()&&null!=t&&(t="string"==typeof t?t:JSON.stringify(t)),t}},{}],12:[function(e,t,n){"use strict";function r(e,t){var n,r=t?i(t):{},s=o(e.authorization).attrs,u=i(e.analyticsMetadata);r.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(u[n]=r._meta[n]);return r._meta=u,s.tokenizationKey?r.tokenizationKey=s.tokenizationKey:r.authorizationFingerprint=s.authorizationFingerprint,r}var o=e("./create-authorization-data"),i=e("./json-clone"),a=e("./constants");t.exports=r},{"./constants":14,"./create-authorization-data":15,"./json-clone":20}],13:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":17}],14:[function(e,t,n){"use strict";var r="3.7.0",o="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:o,BRAINTREE_LIBRARY_VERSION:"braintree/"+o+"/"+r}},{}],15:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function o(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function i(e){var t,n,i={attrs:{},configUrl:""};return r(e)?(n=o(e),i.attrs.tokenizationKey=e,i.configUrl=s[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":22}],16:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],17:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],18:[function(e,t,n){"use strict";var r=e("./braintree-error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":13}],19:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function o(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(i=i||document.createElement("a"),i.href=e,t=r(i.hostname),a.hasOwnProperty(t)):!1}var i,a={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=o},{}],20:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],21:[function(e,t,n){"use strict";function r(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=r},{}],22:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,o,i,a,s,u,c=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";if(!c.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");u=0;do o=l.indexOf(e.charAt(u++)),i=l.indexOf(e.charAt(u++)),a=l.indexOf(e.charAt(u++)),s=l.indexOf(e.charAt(u++)),t=(63&o)<<2|i>>4&3,n=(15&i)<<4|a>>2&15,r=(3&a)<<6|63&s,f+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(u<e.length);return f}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,n){(function(e){"use strict";function n(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&"[object Array]"===Object.prototype.toString.call(e)||!1}function o(t){var n,r;return t=t||e.location.href,/\?/.test(t)?(n=t.replace(/#.*$/,"").replace(/^.*\?/,"").split("&"),r=n.reduce(function(e,t){var n=t.split("="),r=decodeURIComponent(n[0]),o=decodeURIComponent(n[1]);return e[r]=o,e},{})):{}}function i(e,t){var n,o,a,s=[];for(a in e)e.hasOwnProperty(a)&&(o=e[a],n=t?r(e)?t+"[]":t+"["+a+"]":a,"object"==typeof o?s.push(i(o,n)):s.push(encodeURIComponent(n)+"="+encodeURIComponent(o)));return s.join("&")}function a(e,t){return e=e||"",null!=t&&"object"==typeof t&&n(t)&&(e+=-1===e.indexOf("?")?"?":"",e+=-1!==e.indexOf("=")?"&":"",e+=i(t)),e}t.exports={parse:o,stringify:i,queryify:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,n){"use strict";var r=e("./braintree-error"),o=e("../lib/errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../lib/errors":18,"./braintree-error":13}],25:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}]},{},[4])(4)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).dataCollector = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');

@@ -28,3 +28,3 @@ module.exports = {

},{"../lib/error":10}],2:[function(_dereq_,module,exports){
},{"../lib/braintree-error":6}],2:[function(_dereq_,module,exports){
'use strict';

@@ -139,3 +139,3 @@

var fraudnet = _dereq_('./fraudnet');
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var methods = _dereq_('../lib/methods');

@@ -145,4 +145,4 @@ var throwIfNoCallback = _dereq_('../lib/throw-if-no-callback');

var deferred = _dereq_('../lib/deferred');
var VERSION = "3.6.3";
var sharedErrors = _dereq_('../errors');
var VERSION = "3.7.0";
var sharedErrors = _dereq_('../lib/errors');
var errors = _dereq_('./errors');

@@ -290,3 +290,3 @@

},{"../errors":6,"../lib/convert-methods-to-error":7,"../lib/deferred":8,"../lib/error":10,"../lib/methods":11,"../lib/throw-if-no-callback":12,"./errors":1,"./fraudnet":2,"./kount":4}],4:[function(_dereq_,module,exports){
},{"../lib/braintree-error":6,"../lib/convert-methods-to-error":7,"../lib/deferred":8,"../lib/errors":10,"../lib/methods":11,"../lib/throw-if-no-callback":12,"./errors":1,"./fraudnet":2,"./kount":4}],4:[function(_dereq_,module,exports){
'use strict';

@@ -429,77 +429,2 @@ /* eslint-disable camelcase */

var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":10}],7:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
module.exports = function (instance, methodNames) {
methodNames.forEach(function (methodName) {
instance[methodName] = function () {
throw new BraintreeError({
type: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.type,
code: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.code,
message: methodName + ' cannot be called after teardown.'
});
};
});
};
},{"../errors":6,"./error":10}],8:[function(_dereq_,module,exports){
'use strict';
module.exports = function (fn) {
return function () {
// IE9 doesn't support passing arguments to setTimeout so we have to emulate it.
var args = arguments;
setTimeout(function () {
fn.apply(null, args);
}, 1);
};
};
},{}],9:[function(_dereq_,module,exports){
'use strict';
function enumerate(values, prefix) {
prefix = prefix == null ? '' : prefix;
return values.reduce(function (enumeration, value) {
enumeration[value] = prefix + value;
return enumeration;
}, {});
}
module.exports = enumerate;
},{}],10:[function(_dereq_,module,exports){
'use strict';
var enumerate = _dereq_('./enumerate');

@@ -579,5 +504,80 @@

},{"./enumerate":9}],11:[function(_dereq_,module,exports){
},{"./enumerate":9}],7:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');
module.exports = function (instance, methodNames) {
methodNames.forEach(function (methodName) {
instance[methodName] = function () {
throw new BraintreeError({
type: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.type,
code: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.code,
message: methodName + ' cannot be called after teardown.'
});
};
});
};
},{"../lib/errors":10,"./braintree-error":6}],8:[function(_dereq_,module,exports){
'use strict';
module.exports = function (fn) {
return function () {
// IE9 doesn't support passing arguments to setTimeout so we have to emulate it.
var args = arguments;
setTimeout(function () {
fn.apply(null, args);
}, 1);
};
};
},{}],9:[function(_dereq_,module,exports){
'use strict';
function enumerate(values, prefix) {
prefix = prefix == null ? '' : prefix;
return values.reduce(function (enumeration, value) {
enumeration[value] = prefix + value;
return enumeration;
}, {});
}
module.exports = enumerate;
},{}],10:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./braintree-error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./braintree-error":6}],11:[function(_dereq_,module,exports){
'use strict';
module.exports = function (obj) {

@@ -592,4 +592,4 @@ return Object.keys(obj).filter(function (key) {

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -606,3 +606,3 @@ module.exports = function (callback, functionName) {

},{"../errors":6,"./error":10}]},{},[3])(3)
},{"../lib/errors":10,"./braintree-error":6}]},{},[3])(3)
});

@@ -1,1 +0,1 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.braintree||(e.braintree={})).dataCollector=t()}}(function(){var t;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){"use strict";var r=t("../lib/error");e.exports={DATA_COLLECTOR_KOUNT_NOT_ENABLED:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_KOUNT_NOT_ENABLED",message:"Kount is not enabled for this merchant."},DATA_COLLECTOR_KOUNT_ERROR:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_KOUNT_ERROR"},DATA_COLLECTOR_PAYPAL_NOT_ENABLED:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_PAYPAL_NOT_ENABLED",message:"PayPal is not enabled for this merchant."},DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS",message:"Data Collector must be created with Kount and/or PayPal."}}},{"../lib/error":10}],2:[function(t,e,n){"use strict";function r(){return new i}function i(){this.sessionId=o(),this._beaconId=s(this.sessionId),this._parameterBlock=a(this.sessionId,this._beaconId),this._thirdPartyBlock=c()}function o(){var t,e="";for(t=0;32>t;t++)e+=Math.floor(16*Math.random()).toString(16);return e}function s(t){var e=(new Date).getTime()/1e3;return"https://b.stats.paypal.com/counter.cgi?i=127.0.0.1&p="+t+"&t="+e+"&a=14"}function a(t,e){var n=document.body.appendChild(document.createElement("script"));return n.type="application/json",n.setAttribute("fncls","fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99"),n.text=JSON.stringify({f:t,s:"BRAINTREE_SIGNIN",b:e}),n}function c(){function t(){n._l()}var e,n,r="https://www.paypalobjects.com/webstatic/r/fb/",i=document.createElement("iframe");i.src="about:blank",i.title="",i.role="presentation",(i.frameElement||i).style.cssText="width: 0; height: 0; border: 0; position: absolute; z-index: -999",document.body.appendChild(i);try{n=i.contentWindow.document}catch(o){e=document.domain,i.src='javascript:var d=document.open();d.domain="'+e+'";void(0);',n=i.contentWindow.document}return n.open()._l=function(){var t=this.createElement("script");e&&(this.domain=e),t.id="js-iframe-async",t.src=r+"fb-all-prod.pp.min.js",this.body.appendChild(t)},i.addEventListener?i.addEventListener("load",t,!1):i.attachEvent?i.attachEvent("onload",t):n.write('<body onload="document._l();">'),n.close(),i}i.prototype.teardown=function(){this._thirdPartyBlock.parentNode.removeChild(this._thirdPartyBlock)},e.exports={setup:r}},{}],3:[function(t,e,n){"use strict";function r(t,e){function n(t){var e;for(e=0;e<g.length;e++)g[e].teardown();h(y,a(y)),t&&(t=u(t))()}var r,p,m,y,v,E,g=[];if(c(e,"create"),e=u(e),null==t.client)return void e(new s({type:l.INSTANTIATION_OPTION_REQUIRED.type,code:l.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating Data Collector."}));if(v=t.client.getConfiguration(),E=v.analyticsMetadata.sdkVersion,E!==d)return void e(new s({type:l.INCOMPATIBLE_VERSIONS.type,code:l.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+E+") and Data Collector (version "+d+") components must be from the same SDK version."}));if(t.kount===!0){if(!v.gatewayConfiguration.kount)return void e(new s(f.DATA_COLLECTOR_KOUNT_NOT_ENABLED));try{p=i.setup({environment:v.gatewayConfiguration.environment,merchantId:v.gatewayConfiguration.kount.kountMerchantId})}catch(w){return void e(new s({type:f.DATA_COLLECTOR_KOUNT_ERROR.type,code:f.DATA_COLLECTOR_KOUNT_ERROR.code,message:w.message}))}r=p.deviceData,g.push(p)}else r={};if(t.paypal===!0){if(v.gatewayConfiguration.paypalEnabled!==!0)return void e(new s(f.DATA_COLLECTOR_PAYPAL_NOT_ENABLED));m=o.setup(),r.correlation_id=m.sessionId,g.push(m)}return 0===g.length?void e(new s(f.DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS)):(y={deviceData:JSON.stringify(r),teardown:n},void e(null,y))}var i=t("./kount"),o=t("./fraudnet"),s=t("../lib/error"),a=t("../lib/methods"),c=t("../lib/throw-if-no-callback"),h=t("../lib/convert-methods-to-error"),u=t("../lib/deferred"),d="3.6.3",l=t("../errors"),f=t("./errors");e.exports={create:r,VERSION:d}},{"../errors":6,"../lib/convert-methods-to-error":7,"../lib/deferred":8,"../lib/error":10,"../lib/methods":11,"../lib/throw-if-no-callback":12,"./errors":1,"./fraudnet":2,"./kount":4}],4:[function(t,e,n){"use strict";function r(t){var e=null!=t?t:{};return new i(e)}function i(t){o.random.startCollectors(),this._currentEnvironment=this._initializeEnvironment(t),this._deviceSessionId=this._generateDeviceSessionId(),this.deviceData=this._getDeviceData(),this._iframe=this._setupIFrame()}var o=t("./vendor/sjcl"),s="https://assets.qa.braintreepayments.com/data",a="braintreeDataFrame",c={development:s,qa:s,sandbox:"https://assets.braintreegateway.com/sandbox/data",production:"https://assets.braintreegateway.com/data"};i.prototype.teardown=function(){o.random.stopCollectors(),this._removeIframe()},i.prototype._removeIframe=function(){this._iframe.parentNode.removeChild(this._iframe)},i.prototype._getDeviceData=function(){return{device_session_id:this._deviceSessionId,fraud_merchant_id:this._currentEnvironment.id}},i.prototype._generateDeviceSessionId=function(){var t,e;return t=o.random.randomWords(4,0),e=o.codec.hex.fromBits(t)},i.prototype._setupIFrame=function(){var t,e=this,n=document.getElementById(a);return null!=n?n:(t="?m="+this._currentEnvironment.id+"&s="+this._deviceSessionId,n=document.createElement("iframe"),n.width=1,n.id=a,n.height=1,n.frameBorder=0,n.scrolling="no",document.body.appendChild(n),setTimeout(function(){n.src=e._currentEnvironment.url+"/logo.htm"+t,n.innerHTML='<img src="'+e._currentEnvironment.url+"/logo.gif"+t+'" />'},10),n)},i.prototype._initializeEnvironment=function(t){var e=c[t.environment];if(null==e)throw new Error(t.environment+" is not a valid environment for kount.environment");return{url:e,name:t.environment,id:t.merchantId}},e.exports={setup:r,Kount:i,environmentUrls:c}},{"./vendor/sjcl":5}],5:[function(e,n,r){"use strict";function i(t,e,n){if(4!==e.length)throw new d.exception.invalid("invalid aes block size");var r=t.b[n],i=e[0]^r[0],o=e[n?3:1]^r[1],s=e[2]^r[2];e=e[n?1:3]^r[3];var a,c,h,u,l=r.length/4-2,f=4,p=[0,0,0,0];a=t.l[n],t=a[0];var m=a[1],y=a[2],v=a[3],E=a[4];for(u=0;l>u;u++)a=t[i>>>24]^m[o>>16&255]^y[s>>8&255]^v[255&e]^r[f],c=t[o>>>24]^m[s>>16&255]^y[e>>8&255]^v[255&i]^r[f+1],h=t[s>>>24]^m[e>>16&255]^y[i>>8&255]^v[255&o]^r[f+2],e=t[e>>>24]^m[i>>16&255]^y[o>>8&255]^v[255&s]^r[f+3],f+=4,i=a,o=c,s=h;for(u=0;4>u;u++)p[n?3&-u:u]=E[i>>>24]<<24^E[o>>16&255]<<16^E[s>>8&255]<<8^E[255&e]^r[f++],a=i,i=o,o=s,s=e,e=a;return p}function o(t,e){var n,r,i,o=t.u,s=t.b,a=o[0],c=o[1],h=o[2],u=o[3],d=o[4],l=o[5],f=o[6],p=o[7];for(n=0;64>n;n++)16>n?r=e[n]:(r=e[n+1&15],i=e[n+14&15],r=e[15&n]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+e[15&n]+e[n+9&15]|0),r=r+p+(d>>>6^d>>>11^d>>>25^d<<26^d<<21^d<<7)+(f^d&(l^f))+s[n],p=f,f=l,l=d,d=u+r|0,u=h,h=c,c=a,a=r+(c&h^u&(c^h))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;o[0]=o[0]+a|0,o[1]=o[1]+c|0,o[2]=o[2]+h|0,o[3]=o[3]+u|0,o[4]=o[4]+d|0,o[5]=o[5]+l|0,o[6]=o[6]+f|0,o[7]=o[7]+p|0}function s(t,e){var n,r=d.random.B[t],i=[];for(n in r)r.hasOwnProperty(n)&&i.push(r[n]);for(n=0;n<i.length;n++)i[n](e)}function a(t,e){"undefined"!=typeof window&&window.performance&&"function"==typeof window.performance.now?t.addEntropy(window.performance.now(),e,"loadtime"):t.addEntropy((new Date).valueOf(),e,"loadtime")}function c(t){t.b=h(t).concat(h(t)),t.C=new d.cipher.aes(t.b)}function h(t){for(var e=0;4>e&&(t.g[e]=t.g[e]+1|0,!t.g[e]);e++);return t.C.encrypt(t.g)}function u(t,e){return function(){e.apply(t,arguments)}}var d={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};d.cipher.aes=function(t){this.l[0][0][0]||this.G();var e,n,r,i,o=this.l[0][4],s=this.l[1];e=t.length;var a=1;if(4!==e&&6!==e&&8!==e)throw new d.exception.invalid("invalid aes key size");for(this.b=[r=t.slice(0),i=[]],t=e;4*e+28>t;t++)n=r[t-1],(0===t%e||8===e&&4===t%e)&&(n=o[n>>>24]<<24^o[n>>16&255]<<16^o[n>>8&255]<<8^o[255&n],0===t%e&&(n=n<<8^n>>>24^a<<24,a=a<<1^283*(a>>7))),r[t]=r[t-e]^n;for(e=0;t;e++,t--)n=r[3&e?t:t-4],i[e]=4>=t||4>e?n:s[0][o[n>>>24]]^s[1][o[n>>16&255]]^s[2][o[n>>8&255]]^s[3][o[255&n]]},d.cipher.aes.prototype={encrypt:function(t){return i(this,t,0)},decrypt:function(t){return i(this,t,1)},l:[[[],[],[],[],[]],[[],[],[],[],[]]],G:function(){var t,e,n,r,i,o,s,a=this.l[0],c=this.l[1],h=a[4],u=c[4],d=[],l=[];for(t=0;256>t;t++)l[(d[t]=t<<1^283*(t>>7))^t]=t;for(e=n=0;!h[e];e^=r||1,n=l[n]||1)for(o=n^n<<1^n<<2^n<<3^n<<4,o=o>>8^255&o^99,h[e]=o,u[o]=e,i=d[t=d[r=d[e]]],s=16843009*i^65537*t^257*r^16843008*e,i=257*d[o]^16843008*o,t=0;4>t;t++)a[t][e]=i=i<<24^i>>>8,c[t][o]=s=s<<24^s>>>8;for(t=0;5>t;t++)a[t]=a[t].slice(0),c[t]=c[t].slice(0)}},d.bitArray={bitSlice:function(t,e,n){return t=d.bitArray.M(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:d.bitArray.clamp(t,n-e)},extract:function(t,e,n){var r=Math.floor(-e-n&31);return(-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r)&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],r=d.bitArray.getPartial(n);return 32===r?t.concat(e):d.bitArray.M(e,r,0|n,t.slice(0,t.length-1))},bitLength:function(t){var e=t.length;return 0===e?0:32*(e-1)+d.bitArray.getPartial(t[e-1])},clamp:function(t,e){if(32*t.length<e)return t;t=t.slice(0,Math.ceil(e/32));var n=t.length;return e=31&e,n>0&&e&&(t[n-1]=d.bitArray.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(d.bitArray.bitLength(t)!==d.bitArray.bitLength(e))return!1;var n,r=0;for(n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},M:function(t,e,n,r){var i;for(i=0,void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(i=0;i<t.length;i++)r.push(n|t[i]>>>e),n=t[i]<<32-e;return i=t.length?t[t.length-1]:0,t=d.bitArray.getPartial(i),r.push(d.bitArray.partial(e+t&31,e+t>32?n:r.pop(),1)),r},Y:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,n;for(e=0;e<t.length;++e)n=t[e],t[e]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return t}},d.codec.utf8String={fromBits:function(t){var e,n,r="",i=d.bitArray.bitLength(t);for(e=0;i/8>e;e++)0===(3&e)&&(n=t[e/4]),r+=String.fromCharCode(n>>>24),n<<=8;return decodeURIComponent(escape(r))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],r=0;for(e=0;e<t.length;e++)r=r<<8|t.charCodeAt(e),3===(3&e)&&(n.push(r),r=0);return 3&e&&n.push(d.bitArray.partial(8*(3&e),r)),n}},d.codec.hex={fromBits:function(t){var e,n="";for(e=0;e<t.length;e++)n+=((0|t[e])+0xf00000000000).toString(16).substr(4);return n.substr(0,d.bitArray.bitLength(t)/4)},toBits:function(t){var e,n,r=[];for(t=t.replace(/\s|0x/g,""),n=t.length,t+="00000000",e=0;e<t.length;e+=8)r.push(0^parseInt(t.substr(e,8),16));return d.bitArray.clamp(r,4*n)}},d.hash.sha256=function(t){this.b[0]||this.G(),t?(this.u=t.u.slice(0),this.o=t.o.slice(0),this.h=t.h):this.reset()},d.hash.sha256.hash=function(t){return(new d.hash.sha256).update(t).finalize()},d.hash.sha256.prototype={blockSize:512,reset:function(){return this.u=this.K.slice(0),this.o=[],this.h=0,this},update:function(t){"string"==typeof t&&(t=d.codec.utf8String.toBits(t));var e,n=this.o=d.bitArray.concat(this.o,t);if(e=this.h,t=this.h=e+d.bitArray.bitLength(t),t>9007199254740991)throw new d.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var r=new Uint32Array(n),i=0;for(e=512+e-(512+e&511);t>=e;e+=512)o(this,r.subarray(16*i,16*(i+1))),i+=1;n.splice(0,16*i)}else for(e=512+e-(512+e&511);t>=e;e+=512)o(this,n.splice(0,16));return this},finalize:function(){var t,e=this.o,n=this.u,e=d.bitArray.concat(e,[d.bitArray.partial(1,1)]);for(t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this.h/4294967296)),e.push(0|this.h);e.length;)o(this,e.splice(0,16));return this.reset(),n},K:[],b:[],G:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}for(var e,n,r=0,i=2;64>r;i++){for(n=!0,e=2;i>=e*e;e++)if(0===i%e){n=!1;break}n&&(8>r&&(this.K[r]=t(Math.pow(i,.5))),this.b[r]=t(Math.pow(i,1/3)),r++)}}},d.prng=function(t){this.c=[new d.hash.sha256],this.i=[0],this.H=0,this.v={},this.F=0,this.J={},this.L=this.f=this.j=this.T=0,this.b=[0,0,0,0,0,0,0,0],this.g=[0,0,0,0],this.C=void 0,this.D=t,this.s=!1,this.B={progress:{},seeded:{}},this.m=this.S=0,this.w=1,this.A=2,this.O=65536,this.I=[0,48,64,96,128,192,256,384,512,768,1024],this.P=3e4,this.N=80},d.prng.prototype={randomWords:function(t,e){var n,r=[];n=this.isReady(e);var i;if(n===this.m)throw new d.exception.notReady("generator isn't seeded");if(n&this.A){n=!(n&this.w),i=[];var o,s=0;for(this.L=i[0]=(new Date).valueOf()+this.P,o=0;16>o;o++)i.push(4294967296*Math.random()|0);for(o=0;o<this.c.length&&(i=i.concat(this.c[o].finalize()),s+=this.i[o],this.i[o]=0,n||!(this.H&1<<o));o++);for(this.H>=1<<this.c.length&&(this.c.push(new d.hash.sha256),this.i.push(0)),this.f-=s,s>this.j&&(this.j=s),this.H++,this.b=d.hash.sha256.hash(this.b.concat(i)),this.C=new d.cipher.aes(this.b),n=0;4>n&&(this.g[n]=this.g[n]+1|0,!this.g[n]);n++);}for(n=0;t>n;n+=4)0===(n+1)%this.O&&c(this),i=h(this),r.push(i[0],i[1],i[2],i[3]);return c(this),r.slice(0,t)},setDefaultParanoia:function(t,e){if(0===t&&"Setting paranoia=0 will ruin your security; use it only for testing"!==e)throw new d.exception.invalid("Setting paranoia=0 will ruin your security; use it only for testing");this.D=t},addEntropy:function(t,e,n){n=n||"user";var r,i,o=(new Date).valueOf(),a=this.v[n],c=this.isReady(),h=0;switch(r=this.J[n],void 0===r&&(r=this.J[n]=this.T++),void 0===a&&(a=this.v[n]=0),this.v[n]=(this.v[n]+1)%this.c.length,typeof t){case"number":void 0===e&&(e=1),this.c[a].update([r,this.F++,1,e,o,1,0|t]);break;case"object":if(n=Object.prototype.toString.call(t),"[object Uint32Array]"===n){for(i=[],n=0;n<t.length;n++)i.push(t[n]);t=i}else for("[object Array]"!==n&&(h=1),n=0;n<t.length&&!h;n++)"number"!=typeof t[n]&&(h=1);if(!h){if(void 0===e)for(n=e=0;n<t.length;n++)for(i=t[n];i>0;)e++,i>>>=1;this.c[a].update([r,this.F++,2,e,o,t.length].concat(t))}break;case"string":void 0===e&&(e=t.length),this.c[a].update([r,this.F++,3,e,o,t.length]),this.c[a].update(t);break;default:h=1}if(h)throw new d.exception.bug("random: addEntropy only supports number, array of numbers or string");this.i[a]+=e,this.f+=e,c===this.m&&(this.isReady()!==this.m&&s("seeded",Math.max(this.j,this.f)),s("progress",this.getProgress()))},isReady:function(t){return t=this.I[void 0!==t?t:this.D],this.j&&this.j>=t?this.i[0]>this.N&&(new Date).valueOf()>this.L?this.A|this.w:this.w:this.f>=t?this.A|this.m:this.m},getProgress:function(t){return t=this.I[t?t:this.D],this.j>=t?1:this.f>t?1:this.f/t},startCollectors:function(){if(!this.s){if(this.a={loadTimeCollector:u(this,this.V),mouseCollector:u(this,this.W),keyboardCollector:u(this,this.U),accelerometerCollector:u(this,this.R),touchCollector:u(this,this.X)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else{if(!document.attachEvent)throw new d.exception.bug("can't attach event");document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)}this.s=!0}},stopCollectors:function(){this.s&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.s=!1)},addEventListener:function(t,e){this.B[t][this.S++]=e},removeEventListener:function(t,e){var n,r,i=this.B[t],o=[];for(r in i)i.hasOwnProperty(r)&&i[r]===e&&o.push(r);for(n=0;n<o.length;n++)r=o[n],delete i[r]},U:function(){a(this,1)},W:function(t){var e,n;try{e=t.x||t.clientX||t.offsetX||0,n=t.y||t.clientY||t.offsetY||0}catch(r){n=e=0}0!=e&&0!=n&&this.addEntropy([e,n],2,"mouse"),a(this,0)},X:function(t){t=t.touches[0]||t.changedTouches[0],this.addEntropy([t.pageX||t.clientX,t.pageY||t.clientY],1,"touch"),a(this,0)},V:function(){a(this,2)},R:function(t){if(t=t.accelerationIncludingGravity.x||t.accelerationIncludingGravity.y||t.accelerationIncludingGravity.z,window.orientation){var e=window.orientation;"number"==typeof e&&this.addEntropy(e,1,"accelerometer")}t&&this.addEntropy(t,2,"accelerometer"),a(this,0)}},d.random=new d.prng(6);t:try{var l,f,p,m;if(m="undefined"!=typeof n&&n.exports){var y;try{y=e("crypto")}catch(v){y=null}m=f=y}if(m&&f.randomBytes)l=f.randomBytes(128),l=new Uint32Array(new Uint8Array(l).buffer),d.random.addEntropy(l,1024,"crypto['randomBytes']");else if("undefined"!=typeof window&&"undefined"!=typeof Uint32Array){if(p=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(p);else{if(!window.msCrypto||!window.msCrypto.getRandomValues)break t;window.msCrypto.getRandomValues(p)}d.random.addEntropy(p,1024,"crypto['getRandomValues']")}}catch(v){"undefined"!=typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(v))}"undefined"!=typeof n&&n.exports&&(n.exports=d),"function"==typeof t&&t([],function(){return d})},{crypto:void 0}],6:[function(t,e,n){"use strict";var r=t("./lib/error");e.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":10}],7:[function(t,e,n){"use strict";var r=t("./error"),i=t("../errors");e.exports=function(t,e){e.forEach(function(e){t[e]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:e+" cannot be called after teardown."})}})}},{"../errors":6,"./error":10}],8:[function(t,e,n){"use strict";e.exports=function(t){return function(){var e=arguments;setTimeout(function(){t.apply(null,e)},1)}}},{}],9:[function(t,e,n){"use strict";function r(t,e){return e=null==e?"":e,t.reduce(function(t,n){return t[n]=e+n,t},{})}e.exports=r},{}],10:[function(t,e,n){"use strict";function r(t){if(!r.types.hasOwnProperty(t.type))throw new Error(t.type+" is not a valid type.");if(!t.code)throw new Error("Error code required.");if(!t.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=t.code,this.message=t.message,this.type=t.type,this.details=t.details}var i=t("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),e.exports=r},{"./enumerate":9}],11:[function(t,e,n){"use strict";e.exports=function(t){return Object.keys(t).filter(function(e){return"function"==typeof t[e]})}},{}],12:[function(t,e,n){"use strict";var r=t("./error"),i=t("../errors");e.exports=function(t,e){if("function"!=typeof t)throw new r({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:e+" must include a callback function."})}},{"../errors":6,"./error":10}]},{},[3])(3)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(e.braintree||(e.braintree={})).dataCollector=t()}}(function(){var t;return function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var h=new Error("Cannot find module '"+s+"'");throw h.code="MODULE_NOT_FOUND",h}var u=n[s]={exports:{}};t[s][0].call(u.exports,function(e){var n=t[s][1][e];return i(n?n:e)},u,u.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e,n){"use strict";var r=t("../lib/braintree-error");e.exports={DATA_COLLECTOR_KOUNT_NOT_ENABLED:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_KOUNT_NOT_ENABLED",message:"Kount is not enabled for this merchant."},DATA_COLLECTOR_KOUNT_ERROR:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_KOUNT_ERROR"},DATA_COLLECTOR_PAYPAL_NOT_ENABLED:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_PAYPAL_NOT_ENABLED",message:"PayPal is not enabled for this merchant."},DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS:{type:r.types.MERCHANT,code:"DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS",message:"Data Collector must be created with Kount and/or PayPal."}}},{"../lib/braintree-error":6}],2:[function(t,e,n){"use strict";function r(){return new i}function i(){this.sessionId=o(),this._beaconId=s(this.sessionId),this._parameterBlock=a(this.sessionId,this._beaconId),this._thirdPartyBlock=c()}function o(){var t,e="";for(t=0;32>t;t++)e+=Math.floor(16*Math.random()).toString(16);return e}function s(t){var e=(new Date).getTime()/1e3;return"https://b.stats.paypal.com/counter.cgi?i=127.0.0.1&p="+t+"&t="+e+"&a=14"}function a(t,e){var n=document.body.appendChild(document.createElement("script"));return n.type="application/json",n.setAttribute("fncls","fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99"),n.text=JSON.stringify({f:t,s:"BRAINTREE_SIGNIN",b:e}),n}function c(){function t(){n._l()}var e,n,r="https://www.paypalobjects.com/webstatic/r/fb/",i=document.createElement("iframe");i.src="about:blank",i.title="",i.role="presentation",(i.frameElement||i).style.cssText="width: 0; height: 0; border: 0; position: absolute; z-index: -999",document.body.appendChild(i);try{n=i.contentWindow.document}catch(o){e=document.domain,i.src='javascript:var d=document.open();d.domain="'+e+'";void(0);',n=i.contentWindow.document}return n.open()._l=function(){var t=this.createElement("script");e&&(this.domain=e),t.id="js-iframe-async",t.src=r+"fb-all-prod.pp.min.js",this.body.appendChild(t)},i.addEventListener?i.addEventListener("load",t,!1):i.attachEvent?i.attachEvent("onload",t):n.write('<body onload="document._l();">'),n.close(),i}i.prototype.teardown=function(){this._thirdPartyBlock.parentNode.removeChild(this._thirdPartyBlock)},e.exports={setup:r}},{}],3:[function(t,e,n){"use strict";function r(t,e){function n(t){var e;for(e=0;e<g.length;e++)g[e].teardown();h(y,a(y)),t&&(t=u(t))()}var r,p,m,y,v,E,g=[];if(c(e,"create"),e=u(e),null==t.client)return void e(new s({type:l.INSTANTIATION_OPTION_REQUIRED.type,code:l.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating Data Collector."}));if(v=t.client.getConfiguration(),E=v.analyticsMetadata.sdkVersion,E!==d)return void e(new s({type:l.INCOMPATIBLE_VERSIONS.type,code:l.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+E+") and Data Collector (version "+d+") components must be from the same SDK version."}));if(t.kount===!0){if(!v.gatewayConfiguration.kount)return void e(new s(f.DATA_COLLECTOR_KOUNT_NOT_ENABLED));try{p=i.setup({environment:v.gatewayConfiguration.environment,merchantId:v.gatewayConfiguration.kount.kountMerchantId})}catch(w){return void e(new s({type:f.DATA_COLLECTOR_KOUNT_ERROR.type,code:f.DATA_COLLECTOR_KOUNT_ERROR.code,message:w.message}))}r=p.deviceData,g.push(p)}else r={};if(t.paypal===!0){if(v.gatewayConfiguration.paypalEnabled!==!0)return void e(new s(f.DATA_COLLECTOR_PAYPAL_NOT_ENABLED));m=o.setup(),r.correlation_id=m.sessionId,g.push(m)}return 0===g.length?void e(new s(f.DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS)):(y={deviceData:JSON.stringify(r),teardown:n},void e(null,y))}var i=t("./kount"),o=t("./fraudnet"),s=t("../lib/braintree-error"),a=t("../lib/methods"),c=t("../lib/throw-if-no-callback"),h=t("../lib/convert-methods-to-error"),u=t("../lib/deferred"),d="3.7.0",l=t("../lib/errors"),f=t("./errors");e.exports={create:r,VERSION:d}},{"../lib/braintree-error":6,"../lib/convert-methods-to-error":7,"../lib/deferred":8,"../lib/errors":10,"../lib/methods":11,"../lib/throw-if-no-callback":12,"./errors":1,"./fraudnet":2,"./kount":4}],4:[function(t,e,n){"use strict";function r(t){var e=null!=t?t:{};return new i(e)}function i(t){o.random.startCollectors(),this._currentEnvironment=this._initializeEnvironment(t),this._deviceSessionId=this._generateDeviceSessionId(),this.deviceData=this._getDeviceData(),this._iframe=this._setupIFrame()}var o=t("./vendor/sjcl"),s="https://assets.qa.braintreepayments.com/data",a="braintreeDataFrame",c={development:s,qa:s,sandbox:"https://assets.braintreegateway.com/sandbox/data",production:"https://assets.braintreegateway.com/data"};i.prototype.teardown=function(){o.random.stopCollectors(),this._removeIframe()},i.prototype._removeIframe=function(){this._iframe.parentNode.removeChild(this._iframe)},i.prototype._getDeviceData=function(){return{device_session_id:this._deviceSessionId,fraud_merchant_id:this._currentEnvironment.id}},i.prototype._generateDeviceSessionId=function(){var t,e;return t=o.random.randomWords(4,0),e=o.codec.hex.fromBits(t)},i.prototype._setupIFrame=function(){var t,e=this,n=document.getElementById(a);return null!=n?n:(t="?m="+this._currentEnvironment.id+"&s="+this._deviceSessionId,n=document.createElement("iframe"),n.width=1,n.id=a,n.height=1,n.frameBorder=0,n.scrolling="no",document.body.appendChild(n),setTimeout(function(){n.src=e._currentEnvironment.url+"/logo.htm"+t,n.innerHTML='<img src="'+e._currentEnvironment.url+"/logo.gif"+t+'" />'},10),n)},i.prototype._initializeEnvironment=function(t){var e=c[t.environment];if(null==e)throw new Error(t.environment+" is not a valid environment for kount.environment");return{url:e,name:t.environment,id:t.merchantId}},e.exports={setup:r,Kount:i,environmentUrls:c}},{"./vendor/sjcl":5}],5:[function(e,n,r){"use strict";function i(t,e,n){if(4!==e.length)throw new d.exception.invalid("invalid aes block size");var r=t.b[n],i=e[0]^r[0],o=e[n?3:1]^r[1],s=e[2]^r[2];e=e[n?1:3]^r[3];var a,c,h,u,l=r.length/4-2,f=4,p=[0,0,0,0];a=t.l[n],t=a[0];var m=a[1],y=a[2],v=a[3],E=a[4];for(u=0;l>u;u++)a=t[i>>>24]^m[o>>16&255]^y[s>>8&255]^v[255&e]^r[f],c=t[o>>>24]^m[s>>16&255]^y[e>>8&255]^v[255&i]^r[f+1],h=t[s>>>24]^m[e>>16&255]^y[i>>8&255]^v[255&o]^r[f+2],e=t[e>>>24]^m[i>>16&255]^y[o>>8&255]^v[255&s]^r[f+3],f+=4,i=a,o=c,s=h;for(u=0;4>u;u++)p[n?3&-u:u]=E[i>>>24]<<24^E[o>>16&255]<<16^E[s>>8&255]<<8^E[255&e]^r[f++],a=i,i=o,o=s,s=e,e=a;return p}function o(t,e){var n,r,i,o=t.u,s=t.b,a=o[0],c=o[1],h=o[2],u=o[3],d=o[4],l=o[5],f=o[6],p=o[7];for(n=0;64>n;n++)16>n?r=e[n]:(r=e[n+1&15],i=e[n+14&15],r=e[15&n]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(i>>>17^i>>>19^i>>>10^i<<15^i<<13)+e[15&n]+e[n+9&15]|0),r=r+p+(d>>>6^d>>>11^d>>>25^d<<26^d<<21^d<<7)+(f^d&(l^f))+s[n],p=f,f=l,l=d,d=u+r|0,u=h,h=c,c=a,a=r+(c&h^u&(c^h))+(c>>>2^c>>>13^c>>>22^c<<30^c<<19^c<<10)|0;o[0]=o[0]+a|0,o[1]=o[1]+c|0,o[2]=o[2]+h|0,o[3]=o[3]+u|0,o[4]=o[4]+d|0,o[5]=o[5]+l|0,o[6]=o[6]+f|0,o[7]=o[7]+p|0}function s(t,e){var n,r=d.random.B[t],i=[];for(n in r)r.hasOwnProperty(n)&&i.push(r[n]);for(n=0;n<i.length;n++)i[n](e)}function a(t,e){"undefined"!=typeof window&&window.performance&&"function"==typeof window.performance.now?t.addEntropy(window.performance.now(),e,"loadtime"):t.addEntropy((new Date).valueOf(),e,"loadtime")}function c(t){t.b=h(t).concat(h(t)),t.C=new d.cipher.aes(t.b)}function h(t){for(var e=0;4>e&&(t.g[e]=t.g[e]+1|0,!t.g[e]);e++);return t.C.encrypt(t.g)}function u(t,e){return function(){e.apply(t,arguments)}}var d={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(t){this.toString=function(){return"CORRUPT: "+this.message},this.message=t},invalid:function(t){this.toString=function(){return"INVALID: "+this.message},this.message=t},bug:function(t){this.toString=function(){return"BUG: "+this.message},this.message=t},notReady:function(t){this.toString=function(){return"NOT READY: "+this.message},this.message=t}}};d.cipher.aes=function(t){this.l[0][0][0]||this.G();var e,n,r,i,o=this.l[0][4],s=this.l[1];e=t.length;var a=1;if(4!==e&&6!==e&&8!==e)throw new d.exception.invalid("invalid aes key size");for(this.b=[r=t.slice(0),i=[]],t=e;4*e+28>t;t++)n=r[t-1],(0===t%e||8===e&&4===t%e)&&(n=o[n>>>24]<<24^o[n>>16&255]<<16^o[n>>8&255]<<8^o[255&n],0===t%e&&(n=n<<8^n>>>24^a<<24,a=a<<1^283*(a>>7))),r[t]=r[t-e]^n;for(e=0;t;e++,t--)n=r[3&e?t:t-4],i[e]=4>=t||4>e?n:s[0][o[n>>>24]]^s[1][o[n>>16&255]]^s[2][o[n>>8&255]]^s[3][o[255&n]]},d.cipher.aes.prototype={encrypt:function(t){return i(this,t,0)},decrypt:function(t){return i(this,t,1)},l:[[[],[],[],[],[]],[[],[],[],[],[]]],G:function(){var t,e,n,r,i,o,s,a=this.l[0],c=this.l[1],h=a[4],u=c[4],d=[],l=[];for(t=0;256>t;t++)l[(d[t]=t<<1^283*(t>>7))^t]=t;for(e=n=0;!h[e];e^=r||1,n=l[n]||1)for(o=n^n<<1^n<<2^n<<3^n<<4,o=o>>8^255&o^99,h[e]=o,u[o]=e,i=d[t=d[r=d[e]]],s=16843009*i^65537*t^257*r^16843008*e,i=257*d[o]^16843008*o,t=0;4>t;t++)a[t][e]=i=i<<24^i>>>8,c[t][o]=s=s<<24^s>>>8;for(t=0;5>t;t++)a[t]=a[t].slice(0),c[t]=c[t].slice(0)}},d.bitArray={bitSlice:function(t,e,n){return t=d.bitArray.M(t.slice(e/32),32-(31&e)).slice(1),void 0===n?t:d.bitArray.clamp(t,n-e)},extract:function(t,e,n){var r=Math.floor(-e-n&31);return(-32&(e+n-1^e)?t[e/32|0]<<32-r^t[e/32+1|0]>>>r:t[e/32|0]>>>r)&(1<<n)-1},concat:function(t,e){if(0===t.length||0===e.length)return t.concat(e);var n=t[t.length-1],r=d.bitArray.getPartial(n);return 32===r?t.concat(e):d.bitArray.M(e,r,0|n,t.slice(0,t.length-1))},bitLength:function(t){var e=t.length;return 0===e?0:32*(e-1)+d.bitArray.getPartial(t[e-1])},clamp:function(t,e){if(32*t.length<e)return t;t=t.slice(0,Math.ceil(e/32));var n=t.length;return e=31&e,n>0&&e&&(t[n-1]=d.bitArray.partial(e,t[n-1]&2147483648>>e-1,1)),t},partial:function(t,e,n){return 32===t?e:(n?0|e:e<<32-t)+1099511627776*t},getPartial:function(t){return Math.round(t/1099511627776)||32},equal:function(t,e){if(d.bitArray.bitLength(t)!==d.bitArray.bitLength(e))return!1;var n,r=0;for(n=0;n<t.length;n++)r|=t[n]^e[n];return 0===r},M:function(t,e,n,r){var i;for(i=0,void 0===r&&(r=[]);e>=32;e-=32)r.push(n),n=0;if(0===e)return r.concat(t);for(i=0;i<t.length;i++)r.push(n|t[i]>>>e),n=t[i]<<32-e;return i=t.length?t[t.length-1]:0,t=d.bitArray.getPartial(i),r.push(d.bitArray.partial(e+t&31,e+t>32?n:r.pop(),1)),r},Y:function(t,e){return[t[0]^e[0],t[1]^e[1],t[2]^e[2],t[3]^e[3]]},byteswapM:function(t){var e,n;for(e=0;e<t.length;++e)n=t[e],t[e]=n>>>24|n>>>8&65280|(65280&n)<<8|n<<24;return t}},d.codec.utf8String={fromBits:function(t){var e,n,r="",i=d.bitArray.bitLength(t);for(e=0;i/8>e;e++)0===(3&e)&&(n=t[e/4]),r+=String.fromCharCode(n>>>24),n<<=8;return decodeURIComponent(escape(r))},toBits:function(t){t=unescape(encodeURIComponent(t));var e,n=[],r=0;for(e=0;e<t.length;e++)r=r<<8|t.charCodeAt(e),3===(3&e)&&(n.push(r),r=0);return 3&e&&n.push(d.bitArray.partial(8*(3&e),r)),n}},d.codec.hex={fromBits:function(t){var e,n="";for(e=0;e<t.length;e++)n+=((0|t[e])+0xf00000000000).toString(16).substr(4);return n.substr(0,d.bitArray.bitLength(t)/4)},toBits:function(t){var e,n,r=[];for(t=t.replace(/\s|0x/g,""),n=t.length,t+="00000000",e=0;e<t.length;e+=8)r.push(0^parseInt(t.substr(e,8),16));return d.bitArray.clamp(r,4*n)}},d.hash.sha256=function(t){this.b[0]||this.G(),t?(this.u=t.u.slice(0),this.o=t.o.slice(0),this.h=t.h):this.reset()},d.hash.sha256.hash=function(t){return(new d.hash.sha256).update(t).finalize()},d.hash.sha256.prototype={blockSize:512,reset:function(){return this.u=this.K.slice(0),this.o=[],this.h=0,this},update:function(t){"string"==typeof t&&(t=d.codec.utf8String.toBits(t));var e,n=this.o=d.bitArray.concat(this.o,t);if(e=this.h,t=this.h=e+d.bitArray.bitLength(t),t>9007199254740991)throw new d.exception.invalid("Cannot hash more than 2^53 - 1 bits");if("undefined"!=typeof Uint32Array){var r=new Uint32Array(n),i=0;for(e=512+e-(512+e&511);t>=e;e+=512)o(this,r.subarray(16*i,16*(i+1))),i+=1;n.splice(0,16*i)}else for(e=512+e-(512+e&511);t>=e;e+=512)o(this,n.splice(0,16));return this},finalize:function(){var t,e=this.o,n=this.u,e=d.bitArray.concat(e,[d.bitArray.partial(1,1)]);for(t=e.length+2;15&t;t++)e.push(0);for(e.push(Math.floor(this.h/4294967296)),e.push(0|this.h);e.length;)o(this,e.splice(0,16));return this.reset(),n},K:[],b:[],G:function(){function t(t){return 4294967296*(t-Math.floor(t))|0}for(var e,n,r=0,i=2;64>r;i++){for(n=!0,e=2;i>=e*e;e++)if(0===i%e){n=!1;break}n&&(8>r&&(this.K[r]=t(Math.pow(i,.5))),this.b[r]=t(Math.pow(i,1/3)),r++)}}},d.prng=function(t){this.c=[new d.hash.sha256],this.i=[0],this.H=0,this.v={},this.F=0,this.J={},this.L=this.f=this.j=this.T=0,this.b=[0,0,0,0,0,0,0,0],this.g=[0,0,0,0],this.C=void 0,this.D=t,this.s=!1,this.B={progress:{},seeded:{}},this.m=this.S=0,this.w=1,this.A=2,this.O=65536,this.I=[0,48,64,96,128,192,256,384,512,768,1024],this.P=3e4,this.N=80},d.prng.prototype={randomWords:function(t,e){var n,r=[];n=this.isReady(e);var i;if(n===this.m)throw new d.exception.notReady("generator isn't seeded");if(n&this.A){n=!(n&this.w),i=[];var o,s=0;for(this.L=i[0]=(new Date).valueOf()+this.P,o=0;16>o;o++)i.push(4294967296*Math.random()|0);for(o=0;o<this.c.length&&(i=i.concat(this.c[o].finalize()),s+=this.i[o],this.i[o]=0,n||!(this.H&1<<o));o++);for(this.H>=1<<this.c.length&&(this.c.push(new d.hash.sha256),this.i.push(0)),this.f-=s,s>this.j&&(this.j=s),this.H++,this.b=d.hash.sha256.hash(this.b.concat(i)),this.C=new d.cipher.aes(this.b),n=0;4>n&&(this.g[n]=this.g[n]+1|0,!this.g[n]);n++);}for(n=0;t>n;n+=4)0===(n+1)%this.O&&c(this),i=h(this),r.push(i[0],i[1],i[2],i[3]);return c(this),r.slice(0,t)},setDefaultParanoia:function(t,e){if(0===t&&"Setting paranoia=0 will ruin your security; use it only for testing"!==e)throw new d.exception.invalid("Setting paranoia=0 will ruin your security; use it only for testing");this.D=t},addEntropy:function(t,e,n){n=n||"user";var r,i,o=(new Date).valueOf(),a=this.v[n],c=this.isReady(),h=0;switch(r=this.J[n],void 0===r&&(r=this.J[n]=this.T++),void 0===a&&(a=this.v[n]=0),this.v[n]=(this.v[n]+1)%this.c.length,typeof t){case"number":void 0===e&&(e=1),this.c[a].update([r,this.F++,1,e,o,1,0|t]);break;case"object":if(n=Object.prototype.toString.call(t),"[object Uint32Array]"===n){for(i=[],n=0;n<t.length;n++)i.push(t[n]);t=i}else for("[object Array]"!==n&&(h=1),n=0;n<t.length&&!h;n++)"number"!=typeof t[n]&&(h=1);if(!h){if(void 0===e)for(n=e=0;n<t.length;n++)for(i=t[n];i>0;)e++,i>>>=1;this.c[a].update([r,this.F++,2,e,o,t.length].concat(t))}break;case"string":void 0===e&&(e=t.length),this.c[a].update([r,this.F++,3,e,o,t.length]),this.c[a].update(t);break;default:h=1}if(h)throw new d.exception.bug("random: addEntropy only supports number, array of numbers or string");this.i[a]+=e,this.f+=e,c===this.m&&(this.isReady()!==this.m&&s("seeded",Math.max(this.j,this.f)),s("progress",this.getProgress()))},isReady:function(t){return t=this.I[void 0!==t?t:this.D],this.j&&this.j>=t?this.i[0]>this.N&&(new Date).valueOf()>this.L?this.A|this.w:this.w:this.f>=t?this.A|this.m:this.m},getProgress:function(t){return t=this.I[t?t:this.D],this.j>=t?1:this.f>t?1:this.f/t},startCollectors:function(){if(!this.s){if(this.a={loadTimeCollector:u(this,this.V),mouseCollector:u(this,this.W),keyboardCollector:u(this,this.U),accelerometerCollector:u(this,this.R),touchCollector:u(this,this.X)},window.addEventListener)window.addEventListener("load",this.a.loadTimeCollector,!1),window.addEventListener("mousemove",this.a.mouseCollector,!1),window.addEventListener("keypress",this.a.keyboardCollector,!1),window.addEventListener("devicemotion",this.a.accelerometerCollector,!1),window.addEventListener("touchmove",this.a.touchCollector,!1);else{if(!document.attachEvent)throw new d.exception.bug("can't attach event");document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)}this.s=!0}},stopCollectors:function(){this.s&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window.removeEventListener("keypress",this.a.keyboardCollector,!1),window.removeEventListener("devicemotion",this.a.accelerometerCollector,!1),window.removeEventListener("touchmove",this.a.touchCollector,!1)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.s=!1)},addEventListener:function(t,e){this.B[t][this.S++]=e},removeEventListener:function(t,e){var n,r,i=this.B[t],o=[];for(r in i)i.hasOwnProperty(r)&&i[r]===e&&o.push(r);for(n=0;n<o.length;n++)r=o[n],delete i[r]},U:function(){a(this,1)},W:function(t){var e,n;try{e=t.x||t.clientX||t.offsetX||0,n=t.y||t.clientY||t.offsetY||0}catch(r){n=e=0}0!=e&&0!=n&&this.addEntropy([e,n],2,"mouse"),a(this,0)},X:function(t){t=t.touches[0]||t.changedTouches[0],this.addEntropy([t.pageX||t.clientX,t.pageY||t.clientY],1,"touch"),a(this,0)},V:function(){a(this,2)},R:function(t){if(t=t.accelerationIncludingGravity.x||t.accelerationIncludingGravity.y||t.accelerationIncludingGravity.z,window.orientation){var e=window.orientation;"number"==typeof e&&this.addEntropy(e,1,"accelerometer")}t&&this.addEntropy(t,2,"accelerometer"),a(this,0)}},d.random=new d.prng(6);t:try{var l,f,p,m;if(m="undefined"!=typeof n&&n.exports){var y;try{y=e("crypto")}catch(v){y=null}m=f=y}if(m&&f.randomBytes)l=f.randomBytes(128),l=new Uint32Array(new Uint8Array(l).buffer),d.random.addEntropy(l,1024,"crypto['randomBytes']");else if("undefined"!=typeof window&&"undefined"!=typeof Uint32Array){if(p=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(p);else{if(!window.msCrypto||!window.msCrypto.getRandomValues)break t;window.msCrypto.getRandomValues(p)}d.random.addEntropy(p,1024,"crypto['getRandomValues']")}}catch(v){"undefined"!=typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(v))}"undefined"!=typeof n&&n.exports&&(n.exports=d),"function"==typeof t&&t([],function(){return d})},{crypto:void 0}],6:[function(t,e,n){"use strict";function r(t){if(!r.types.hasOwnProperty(t.type))throw new Error(t.type+" is not a valid type.");if(!t.code)throw new Error("Error code required.");if(!t.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=t.code,this.message=t.message,this.type=t.type,this.details=t.details}var i=t("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),e.exports=r},{"./enumerate":9}],7:[function(t,e,n){"use strict";var r=t("./braintree-error"),i=t("../lib/errors");e.exports=function(t,e){e.forEach(function(e){t[e]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:e+" cannot be called after teardown."})}})}},{"../lib/errors":10,"./braintree-error":6}],8:[function(t,e,n){"use strict";e.exports=function(t){return function(){var e=arguments;setTimeout(function(){t.apply(null,e)},1)}}},{}],9:[function(t,e,n){"use strict";function r(t,e){return e=null==e?"":e,t.reduce(function(t,n){return t[n]=e+n,t},{})}e.exports=r},{}],10:[function(t,e,n){"use strict";var r=t("./braintree-error");e.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":6}],11:[function(t,e,n){"use strict";e.exports=function(t){return Object.keys(t).filter(function(e){return"function"==typeof t[e]})}},{}],12:[function(t,e,n){"use strict";var r=t("./braintree-error"),i=t("../lib/errors");e.exports=function(t,e){if("function"!=typeof t)throw new r({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:e+" must include a callback function."})}},{"../lib/errors":10,"./braintree-error":6}]},{},[3])(3)});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).hostedFields=e()}}(function(){var e;return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";function r(e){var t,n,r;return e?(t=e.prefixPattern.source,n=e.exactPattern.source,r=JSON.parse(JSON.stringify(e)),r.prefixPattern=t,r.exactPattern=n,r):null}function i(e){var t,n,i,s=[],a=[];if(!("string"==typeof e||e instanceof String))return[];for(i=0;i<I.length;i++)t=I[i],n=o[t],0!==e.length?n.exactPattern.test(e)?a.push(r(n)):n.prefixPattern.test(e)&&s.push(r(n)):s.push(r(n));return a.length?a:s}var o={},s="visa",a="master-card",c="american-express",l="diners-club",u="discover",f="jcb",d="unionpay",p="maestro",E="CVV",_="CID",h="CVC",y="CVN",I=[s,a,c,l,u,f,d,p];o[s]={niceType:"Visa",type:s,prefixPattern:/^4$/,exactPattern:/^4\d*$/,gaps:[4,8,12],lengths:[16],code:{name:E,size:3}},o[a]={niceType:"MasterCard",type:a,prefixPattern:/^(5|5[1-5]|2|22|222|222[1-9]|2[3-6]|27[0-1]|2720)$/,exactPattern:/^(5[1-5]|222[1-9]|2[3-6]|27[0-1]|2720)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:h,size:3}},o[c]={niceType:"American Express",type:c,prefixPattern:/^(3|34|37)$/,exactPattern:/^3[47]\d*$/,isAmex:!0,gaps:[4,10],lengths:[15],code:{name:_,size:4}},o[l]={niceType:"Diners Club",type:l,prefixPattern:/^(3|3[0689]|30[0-5])$/,exactPattern:/^3(0[0-5]|[689])\d*$/,gaps:[4,10],lengths:[14],code:{name:E,size:3}},o[u]={niceType:"Discover",type:u,prefixPattern:/^(6|60|601|6011|65|64|64[4-9])$/,exactPattern:/^(6011|65|64[4-9])\d*$/,gaps:[4,8,12],lengths:[16,19],code:{name:_,size:3}},o[f]={niceType:"JCB",type:f,prefixPattern:/^(2|21|213|2131|1|18|180|1800|3|35)$/,exactPattern:/^(2131|1800|35)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:E,size:3}},o[d]={niceType:"UnionPay",type:d,prefixPattern:/^(6|62)$/,exactPattern:/^62\d*$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:y,size:3}},o[p]={niceType:"Maestro",type:p,prefixPattern:/^(5|5[06-9]|6\d*)$/,exactPattern:/^5[06-9]\d*$/,gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:h,size:3}},i.getTypeInfo=function(e){return r(o[e])},i.types={VISA:s,MASTERCARD:a,AMERICAN_EXPRESS:c,DINERS_CLUB:l,DISCOVER:u,JCB:f,UNIONPAY:d,MAESTRO:p},t.exports=i},{}],2:[function(t,n,r){(function(t){"use strict";!function(i,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o("undefined"==typeof t?i:t):"function"==typeof e&&e.amd?e([],function(){return o(i)}):i.framebus=o(i)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(T.push(e),!0)}function n(e){var t,n={};for(t in D)D.hasOwnProperty(t)&&(n[t]=D[t]);return n._origin=e||"*",n}function r(e){var t,n,r=s(this);return a(e)?!1:a(r)?!1:(n=Array.prototype.slice.call(arguments,1),t=c(e,n,r),t===!1?!1:(_(m.top,t,r),!0))}function i(e,t){var n=s(this);return I(e,t,n)?!1:(g[n]=g[n]||{},g[n][e]=g[n][e]||[],g[n][e].push(t),!0)}function o(e,t){var n,r,i=s(this);if(I(e,t,i))return!1;if(r=g[i]&&g[i][e],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===t)return r.splice(n,1),!0;return!1}function s(e){return e&&e._origin||"*"}function a(e){return"string"!=typeof e}function c(e,t,n){var r=!1,i={event:e,origin:n},o=t[t.length-1];"function"==typeof o&&(i.reply=y(o,n),t=t.slice(0,-1)),i.args=t;try{r=S+JSON.stringify(i)}catch(s){throw new Error("Could not stringify event: "+s.message)}return r}function l(e){var t,n,r,i;if(e.data.slice(0,S.length)!==S)return!1;try{t=JSON.parse(e.data.slice(S.length))}catch(o){return!1}return null!=t.reply&&(n=e.origin,r=e.source,i=t.reply,t.reply=function(e){var t=c(i,[e],n);return t===!1?!1:void r.postMessage(t,n)},t.args.push(t.reply)),t}function u(t){m||(m=t||e,m.addEventListener?m.addEventListener("message",d,!1):m.attachEvent?m.attachEvent("onmessage",d):null===m.onmessage?m.onmessage=d:m=null)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}function d(e){var t;a(e.data)||(t=l(e),t&&(p("*",t.event,t.args,e),p(e.origin,t.event,t.args,e),h(e.data,t.origin,e.source)))}function p(e,t,n,r){var i;if(g[e]&&g[e][t])for(i=0;i<g[e][t].length;i++)g[e][t][i].apply(r,n)}function E(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function _(e,t,n){var r;try{for(e.postMessage(t,n),E(e)&&_(e.opener.top,t,n),r=0;r<e.frames.length;r++)_(e.frames[r],t,n)}catch(i){}}function h(e,t,n){var r,i;for(r=T.length-1;r>=0;r--)i=T[r],i.closed===!0?T=T.slice(r,1):n!==i&&_(i.top,e,t)}function y(e,t){function n(i,o){e(i,o),D.target(t).unsubscribe(r,n)}var r=f();return D.target(t).subscribe(r,n),r}function I(e,t,n){return a(e)?!0:"function"!=typeof t?!0:a(n)?!0:!1}var m,D,T=[],g={},S="/*framebus*/";return u(),D={target:n,include:t,publish:r,pub:r,trigger:r,emit:r,subscribe:i,sub:i,on:i,unsubscribe:o,unsub:o,off:o}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,n){"use strict";var r=e("./lib/set-attributes"),i=e("./lib/default-attributes"),o=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),n=o({},i,e);return n.style&&"string"!=typeof n.style&&(o(t.style,n.style),delete n.style),r(t,n),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":4,"./lib/default-attributes":5,"./lib/set-attributes":6}],4:[function(e,t,n){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}},{}],5:[function(e,t,n){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],6:[function(e,t,n){"use strict";t.exports=function(e,t){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],null==n?e.removeAttribute(r):e.setAttribute(r,n))}},{}],7:[function(e,t,n){"use strict";var r=e("./lib/error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":28}],8:[function(e,t,n){"use strict";var r=e("../shared/constants");t.exports=function(e,t){return e+"/web/"+r.VERSION+"/html/hosted-fields-frame.min.html#"+t}},{"../shared/constants":12}],9:[function(e,t,n){"use strict";function r(e){return function(t){var n,r=t.merchantPayload,i=r.emittedBy,o=e[i].containerElement;Object.keys(r.fields).forEach(function(t){r.fields[t].container=e[t].containerElement}),n=r.fields[i],s.toggle(o,f.externalClasses.FOCUSED,n.isFocused),s.toggle(o,f.externalClasses.VALID,n.isValid),s.toggle(o,f.externalClasses.INVALID,!n.isPotentiallyValid),this._state={cards:r.cards,fields:r.fields},this._emit(t.type,r)}}function i(e){var t,n,_=this,h={},y=0,g=E();if(!e.client)throw new l({type:L.INSTANTIATION_OPTION_REQUIRED.type,code:L.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating Hosted Fields."});if(n=e.client.getConfiguration().analyticsMetadata.sdkVersion,n!==S)throw new l({type:L.INCOMPATIBLE_VERSIONS.type,code:L.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+n+") and Hosted Fields (version "+S+") components must be from the same SDK version."});if(!e.fields)throw new l({type:L.INSTANTIATION_OPTION_REQUIRED.type,code:L.INSTANTIATION_OPTION_REQUIRED.code,message:"options.fields is required when instantiating Hosted Fields."});m.call(this),this._injectedNodes=[],this._destructor=new o,this._fields=h,this._state={fields:{},cards:v("")},this._bus=new c({channel:g,merchantUrl:location.href}),this._destructor.registerFunctionForTeardown(function(){_._bus.teardown()}),this._client=e.client,T.sendEvent(this._client,"custom.hosted-fields.initialized"),Object.keys(e.fields).forEach(function(t){var n,r,i;if(!f.whitelistedFields.hasOwnProperty(t))throw new l({type:d.HOSTED_FIELDS_INVALID_FIELD_KEY.type,code:d.HOSTED_FIELDS_INVALID_FIELD_KEY.code,message:'"'+t+'" is not a valid field.'});if(n=e.fields[t],r=document.querySelector(n.selector),!r)throw new l({type:d.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.type,code:d.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.code,message:d.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.message,details:{fieldSelector:n.selector,fieldKey:t}});if(r.querySelector('iframe[name^="braintree-"]'))throw new l({type:d.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.type,code:d.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.code,message:d.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.message,details:{fieldSelector:n.selector,fieldKey:t}});i=a({type:t,name:"braintree-hosted-field-"+t,style:f.defaultIFrameStyle}),this._injectedNodes=this._injectedNodes.concat(D(i,r)),this._setupLabelFocus(t,r),h[t]={frameElement:i,containerElement:r},y++,this._state.fields[t]={isEmpty:!0,isValid:!1,isPotentiallyValid:!0,isFocused:!1,container:r},setTimeout(function(){i.src=u(_._client.getConfiguration().gatewayConfiguration.assetsUrl,g)},0)}.bind(this)),t=setTimeout(function(){T.sendEvent(_._client,"custom.hosted-fields.load.timed-out")},p),this._bus.on(I.FRAME_READY,function(n){y--,0===y&&(clearTimeout(t),n(e),_._emit("ready"))}),this._bus.on(I.INPUT_EVENT,r(h).bind(this)),this._destructor.registerFunctionForTeardown(function(){var e,t,n;for(e=0;e<_._injectedNodes.length;e++)t=_._injectedNodes[e],n=t.parentNode,n.removeChild(t),s.remove(n,f.externalClasses.FOCUSED,f.externalClasses.INVALID,f.externalClasses.VALID)}),this._destructor.registerFunctionForTeardown(function(){var e=O(i.prototype).concat(O(m.prototype));N(_,e)})}var o=e("../../lib/destructor"),s=e("../../lib/classlist"),a=e("iframer"),c=e("../../lib/bus"),l=e("../../lib/error"),u=e("./compose-url"),f=e("../shared/constants"),d=e("../shared/errors"),p=e("../../lib/constants").INTEGRATION_TIMEOUT_MS,E=e("../../lib/uuid"),_=e("../shared/find-parent-tags"),h=e("../../lib/throw-if-no-callback"),y=e("../../lib/is-ios"),I=f.events,m=e("../../lib/event-emitter"),D=e("./inject-frame"),T=e("../../lib/analytics"),g=f.whitelistedFields,S="3.6.3",O=e("../../lib/methods"),N=e("../../lib/convert-methods-to-error"),A=e("../../lib/deferred"),L=e("../../errors"),v=e("credit-card-type");i.prototype=Object.create(m.prototype,{constructor:i}),i.prototype._setupLabelFocus=function(e,t){function n(){s.emit(I.TRIGGER_INPUT_FOCUS,e)}var r,i,o=y(),s=this._bus;if(!o&&null!=t.id){for(r=Array.prototype.slice.call(document.querySelectorAll('label[for="'+t.id+'"]')),r=r.concat(_(t,"label")),i=0;i<r.length;i++)r[i].addEventListener("click",n,!1);this._destructor.registerFunctionForTeardown(function(){for(i=0;i<r.length;i++)r[i].removeEventListener("click",n,!1)})}},i.prototype.teardown=function(e){var t=this._client;this._destructor.teardown(function(n){T.sendEvent(t,"custom.hosted-fields.teardown-completed"),"function"==typeof e&&(e=A(e))(n)})},i.prototype.tokenize=function(e,t){t||(t=e,e={}),h(t,"tokenize"),this._bus.emit(I.TOKENIZATION_REQUEST,e,function(e){t.apply(null,e)})},i.prototype.addClass=function(e,t,n){var r;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.ADD_CLASS,e,t):r=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot add class to "'+e+'" field because it is not part of the current Hosted Fields options.'}):r=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when adding a class.'}),"function"==typeof n&&(n=A(n))(r)},i.prototype.removeClass=function(e,t,n){var r;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.REMOVE_CLASS,e,t):r=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot remove class from "'+e+'" field because it is not part of the current Hosted Fields options.'}):r=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when removing a class.'}),"function"==typeof n&&(n=A(n))(r)},i.prototype.setPlaceholder=function(e,t,n){var r;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.SET_PLACEHOLDER,e,t):r=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot set placeholder for "'+e+'" field because it is not part of the current Hosted Fields options.'}):r=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when setting a placeholder.'}),"function"==typeof n&&(n=A(n))(r)},i.prototype.clear=function(e,t){var n;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.CLEAR_FIELD,e):n=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot clear "'+e+'" field because it is not part of the current Hosted Fields options.'}):n=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when clearing a field.'}),"function"==typeof t&&(t=A(t))(n)},i.prototype.getState=function(){return this._state},t.exports=i},{"../../errors":7,"../../lib/analytics":16,"../../lib/bus":20,"../../lib/classlist":21,"../../lib/constants":22,"../../lib/convert-methods-to-error":23,"../../lib/deferred":25,"../../lib/destructor":26,"../../lib/error":28,"../../lib/event-emitter":29,"../../lib/is-ios":30,"../../lib/methods":33,"../../lib/throw-if-no-callback":36,"../../lib/uuid":37,"../shared/constants":12,"../shared/errors":13,"../shared/find-parent-tags":14,"./compose-url":8,"./inject-frame":10,"credit-card-type":1,iframer:3}],10:[function(e,t,n){"use strict";t.exports=function(e,t){var n=document.createElement("div"),r=document.createDocumentFragment();return n.style.clear="both",r.appendChild(e),r.appendChild(n),t.appendChild(r),[e,n]}},{}],11:[function(e,t,n){"use strict";function r(e,t){var n;s(t,"create");try{n=new i(e)}catch(r){return t=o(t),void t(r)}n.on("ready",function(){t(null,n)})}var i=e("./external/hosted-fields"),o=e("../lib/deferred"),s=e("../lib/throw-if-no-callback"),a="3.6.3";t.exports={create:r,VERSION:a}},{"../lib/deferred":25,"../lib/throw-if-no-callback":36,"./external/hosted-fields":9}],12:[function(e,t,n){"use strict";var r=e("../../lib/enumerate"),i="3.6.3",o={VERSION:i,maxExpirationYearAge:19,externalEvents:{FOCUS:"focus",BLUR:"blur",EMPTY:"empty",NOT_EMPTY:"notEmpty",VALIDITY_CHANGE:"validityChange",CARD_TYPE_CHANGE:"cardTypeChange"},defaultMaxLengths:{number:19,postalCode:8,expirationDate:7,expirationMonth:2,expirationYear:4,cvv:3},externalClasses:{FOCUSED:"braintree-hosted-fields-focused",INVALID:"braintree-hosted-fields-invalid",VALID:"braintree-hosted-fields-valid"},defaultIFrameStyle:{border:"none",width:"100%",height:"100%","float":"left"},whitelistedStyles:["-moz-osx-font-smoothing","-moz-tap-highlight-color","-moz-transition","-webkit-font-smoothing","-webkit-tap-highlight-color","-webkit-transition","color","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-weight","letter-spacing","line-height","opacity","outline","text-shadow","transition"],whitelistedFields:{number:{name:"credit-card-number",label:"Credit Card Number"},cvv:{name:"cvv",label:"CVV"},expirationDate:{name:"expiration",label:"Expiration Date"},expirationMonth:{name:"expiration-month",label:"Expiration Month"},expirationYear:{name:"expiration-year",label:"Expiration Year"},postalCode:{name:"postal-code",label:"Postal Code"}}};o.events=r(["FRAME_READY","VALIDATE_STRICT","CONFIGURATION","TOKENIZATION_REQUEST","INPUT_EVENT","TRIGGER_INPUT_FOCUS","ADD_CLASS","REMOVE_CLASS","SET_PLACEHOLDER","CLEAR_FIELD"],"hosted-fields:"),t.exports=o},{"../../lib/enumerate":27}],13:[function(e,t,n){"use strict";var r=e("../../lib/error");t.exports={HOSTED_FIELDS_INVALID_FIELD_KEY:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_KEY"},HOSTED_FIELDS_INVALID_FIELD_SELECTOR:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_SELECTOR",message:"Selector does not reference a valid DOM node."},HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME",message:"Element already contains a Braintree iframe."},HOSTED_FIELDS_FIELD_INVALID:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_INVALID"},HOSTED_FIELDS_FIELD_NOT_PRESENT:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_NOT_PRESENT"},HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR:{type:r.types.NETWORK,code:"HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},HOSTED_FIELDS_FAILED_TOKENIZATION:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FAILED_TOKENIZATION",message:"The supplied card data failed tokenization."},HOSTED_FIELDS_FIELDS_EMPTY:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_EMPTY",message:"All fields are empty. Cannot tokenize empty card fields."},HOSTED_FIELDS_FIELDS_INVALID:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_INVALID",message:"Some payment input fields are invalid. Cannot tokenize invalid card fields."}}},{"../../lib/error":28}],14:[function(e,t,n){"use strict";function r(e,t){for(var n=e.parentNode,r=[];null!=n;)null!=n.tagName&&n.tagName.toLowerCase()===t&&r.push(n),n=n.parentNode;return r}t.exports=r},{}],15:[function(e,t,n){"use strict";function r(e,t){var n,r=t?o(t):{},a=i(e.authorization).attrs,c=o(e.analyticsMetadata);r.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(c[n]=r._meta[n]);return r._meta=c,a.tokenizationKey?r.tokenizationKey=a.tokenizationKey:r.authorizationFingerprint=a.authorizationFingerprint,r}var i=e("./create-authorization-data"),o=e("./json-clone"),s=e("./constants");t.exports=r},{"./constants":22,"./create-authorization-data":24,"./json-clone":32}],16:[function(e,t,n){"use strict";function r(e){return Math.floor(e/1e3)}function i(e,t,n){var i=e.getConfiguration(),a=e._request,c=r(Date.now()),l=i.gatewayConfiguration.analytics.url,u={analytics:[{kind:o.ANALYTICS_PREFIX+t,timestamp:c}]};a({url:l,method:"post",data:s(i,u),timeout:o.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var o=e("./constants"),s=e("./add-metadata");t.exports={sendEvent:i}},{"./add-metadata":15,"./constants":22}],17:[function(e,t,n){"use strict";function r(e,t){var n=0===e.length;n?(e(),t(null)):e(t)}var i=e("./once");t.exports=function(e,t){function n(e){return e?void c(e):(a-=1,void(0===a&&c(null)))}var o,s=e.length,a=s,c=i(t);if(0===s)return void c(null);for(o=0;s>o;o++)r(e[o],n)}},{"./once":34}],18:[function(e,t,n){"use strict";function r(e,t){var n,r,o=document.createElement("a");return o.href=t,r="https:"===o.protocol?o.host.replace(/:443$/,""):"http:"===o.protocol?o.host.replace(/:80$/,""):o.host,n=o.protocol+"//"+r,n===e?!0:(o.href=e,i(e))}var i=e("../is-whitelisted-domain");t.exports={checkOrigin:r}},{"../is-whitelisted-domain":31}],19:[function(e,t,n){"use strict";var r=e("../enumerate");t.exports=r(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":27}],20:[function(e,t,n){"use strict";function r(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new a({type:a.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var i=e("framebus"),o=e("./events"),s=e("./check-origin").checkOrigin,a=e("../error");r.prototype.on=function(e,t){var n,r,o=t,a=this;this._isDestroyed||(this.merchantUrl&&(o=function(){s(this.origin,a.merchantUrl)&&t.apply(this,arguments)}),n=this._namespaceEvent(e),r=Array.prototype.slice.call(arguments),r[0]=n,r[1]=o,this._log("on",r),i.on.apply(i,r),this._listeners.push({eventName:e,handler:o,originalHandler:t}))},r.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),i.emit.apply(i,t))},r.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),i.off.apply(i,t))},r.prototype.off=function(e,t){var n,r,i=t;if(!this._isDestroyed){if(this.merchantUrl)for(n=0;n<this._listeners.length;n++)r=this._listeners[n],r.originalHandler===t&&(i=r.handler);this._offDirect(e,i)}},r.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},r.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},r.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},r.events=o,t.exports=r},{"../error":28,"./check-origin":18,"./events":19,framebus:2}],21:[function(e,t,n){"use strict";function r(e){return e.className.trim().split(/\s+/)}function i(e){var t=Array.prototype.slice.call(arguments,1),n=r(e).filter(function(e){return-1===t.indexOf(e)}).concat(t).join(" ");e.className=n}function o(e){var t=Array.prototype.slice.call(arguments,1),n=r(e).filter(function(e){return-1===t.indexOf(e)}).join(" ");e.className=n}function s(e,t,n){n?i(e,t):o(e,t)}t.exports={add:i,remove:o,toggle:s}},{}],22:[function(e,t,n){"use strict";var r="3.6.3",i="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:i,BRAINTREE_LIBRARY_VERSION:"braintree/"+i+"/"+r}},{}],23:[function(e,t,n){"use strict";var r=e("./error"),i=e("../errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../errors":7,"./error":28}],24:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function i(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function o(e){var t,n,o={attrs:{},configUrl:""};return r(e)?(n=i(e),o.attrs.tokenizationKey=e,o.configUrl=a[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(s(e)),o.attrs.authorizationFingerprint=t.authorizationFingerprint,o.configUrl=t.configUrl),o}var s=e("../lib/polyfill").atob,a={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=o},{"../lib/polyfill":35}],25:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],26:[function(e,t,n){"use strict";function r(){this._teardownRegistry=[],this._isTearingDown=!1}var i=e("./batch-execute-functions");r.prototype.registerFunctionForTeardown=function(e){"function"==typeof e&&this._teardownRegistry.push(e)},r.prototype.teardown=function(e){return this._isTearingDown?void e(new Error("Destructor is already tearing down")):(this._isTearingDown=!0,void i(this._teardownRegistry,function(t){this._teardownRegistry=[],this._isTearingDown=!1,"function"==typeof e&&e(t)}.bind(this)))},t.exports=r},{"./batch-execute-functions":17}],27:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],28:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var i=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":27}],29:[function(e,t,n){"use strict";function r(){this._events={}}r.prototype.on=function(e,t){this._events[e]?this._events[e].push(t):this._events[e]=[t]},r.prototype._emit=function(e){var t,n,r=this._events[e];if(r)for(n=Array.prototype.slice.call(arguments,1),t=0;t<r.length;t++)r[t].apply(null,n)},t.exports=r},{}],30:[function(e,t,n){"use strict";t.exports=function(e){return e=e||navigator.userAgent,/(iPad|iPhone|iPod)/i.test(e)}},{}],31:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function i(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(o=o||document.createElement("a"),o.href=e,t=r(o.hostname),s.hasOwnProperty(t)):!1}var o,s={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=i},{}],32:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],33:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],34:[function(e,t,n){"use strict";function r(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=r},{}],35:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,i,o,s,a,c,l=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";if(!l.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do i=u.indexOf(e.charAt(c++)),o=u.indexOf(e.charAt(c++)),s=u.indexOf(e.charAt(c++)),a=u.indexOf(e.charAt(c++)),t=(63&i)<<2|o>>4&3,n=(15&o)<<4|s>>2&15,r=(3&s)<<6|63&a,f+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(c<e.length);return f}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],36:[function(e,t,n){"use strict";var r=e("./error"),i=e("../errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../errors":7,"./error":28}],37:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}]},{},[11])(11)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).hostedFields=e()}}(function(){var e;return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[s]={exports:{}};e[s][0].call(u.exports,function(t){var n=e[s][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";function r(e){var t,n,r;return e?(t=e.prefixPattern.source,n=e.exactPattern.source,r=JSON.parse(JSON.stringify(e)),r.prefixPattern=t,r.exactPattern=n,r):null}function i(e){var t,n,i,s=[],a=[];if(!("string"==typeof e||e instanceof String))return[];for(i=0;i<I.length;i++)t=I[i],n=o[t],0!==e.length?n.exactPattern.test(e)?a.push(r(n)):n.prefixPattern.test(e)&&s.push(r(n)):s.push(r(n));return a.length?a:s}var o={},s="visa",a="master-card",c="american-express",l="diners-club",u="discover",f="jcb",d="unionpay",p="maestro",E="CVV",_="CID",h="CVC",y="CVN",I=[s,a,c,l,u,f,d,p];o[s]={niceType:"Visa",type:s,prefixPattern:/^4$/,exactPattern:/^4\d*$/,gaps:[4,8,12],lengths:[16],code:{name:E,size:3}},o[a]={niceType:"MasterCard",type:a,prefixPattern:/^(5|5[1-5]|2|22|222|222[1-9]|2[3-6]|27[0-1]|2720)$/,exactPattern:/^(5[1-5]|222[1-9]|2[3-6]|27[0-1]|2720)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:h,size:3}},o[c]={niceType:"American Express",type:c,prefixPattern:/^(3|34|37)$/,exactPattern:/^3[47]\d*$/,isAmex:!0,gaps:[4,10],lengths:[15],code:{name:_,size:4}},o[l]={niceType:"Diners Club",type:l,prefixPattern:/^(3|3[0689]|30[0-5])$/,exactPattern:/^3(0[0-5]|[689])\d*$/,gaps:[4,10],lengths:[14],code:{name:E,size:3}},o[u]={niceType:"Discover",type:u,prefixPattern:/^(6|60|601|6011|65|64|64[4-9])$/,exactPattern:/^(6011|65|64[4-9])\d*$/,gaps:[4,8,12],lengths:[16,19],code:{name:_,size:3}},o[f]={niceType:"JCB",type:f,prefixPattern:/^(2|21|213|2131|1|18|180|1800|3|35)$/,exactPattern:/^(2131|1800|35)\d*$/,gaps:[4,8,12],lengths:[16],code:{name:E,size:3}},o[d]={niceType:"UnionPay",type:d,prefixPattern:/^(6|62)$/,exactPattern:/^62\d*$/,gaps:[4,8,12],lengths:[16,17,18,19],code:{name:y,size:3}},o[p]={niceType:"Maestro",type:p,prefixPattern:/^(5|5[06-9]|6\d*)$/,exactPattern:/^5[06-9]\d*$/,gaps:[4,8,12],lengths:[12,13,14,15,16,17,18,19],code:{name:h,size:3}},i.getTypeInfo=function(e){return r(o[e])},i.types={VISA:s,MASTERCARD:a,AMERICAN_EXPRESS:c,DINERS_CLUB:l,DISCOVER:u,JCB:f,UNIONPAY:d,MAESTRO:p},t.exports=i},{}],2:[function(t,n,r){(function(t){"use strict";!function(i,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o("undefined"==typeof t?i:t):"function"==typeof e&&e.amd?e([],function(){return o(i)}):i.framebus=o(i)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(T.push(e),!0)}function n(e){var t,n={};for(t in D)D.hasOwnProperty(t)&&(n[t]=D[t]);return n._origin=e||"*",n}function r(e){var t,n,r=s(this);return a(e)?!1:a(r)?!1:(n=Array.prototype.slice.call(arguments,1),t=c(e,n,r),t===!1?!1:(_(m.top,t,r),!0))}function i(e,t){var n=s(this);return I(e,t,n)?!1:(g[n]=g[n]||{},g[n][e]=g[n][e]||[],g[n][e].push(t),!0)}function o(e,t){var n,r,i=s(this);if(I(e,t,i))return!1;if(r=g[i]&&g[i][e],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===t)return r.splice(n,1),!0;return!1}function s(e){return e&&e._origin||"*"}function a(e){return"string"!=typeof e}function c(e,t,n){var r=!1,i={event:e,origin:n},o=t[t.length-1];"function"==typeof o&&(i.reply=y(o,n),t=t.slice(0,-1)),i.args=t;try{r=S+JSON.stringify(i)}catch(s){throw new Error("Could not stringify event: "+s.message)}return r}function l(e){var t,n,r,i;if(e.data.slice(0,S.length)!==S)return!1;try{t=JSON.parse(e.data.slice(S.length))}catch(o){return!1}return null!=t.reply&&(n=e.origin,r=e.source,i=t.reply,t.reply=function(e){var t=c(i,[e],n);return t===!1?!1:void r.postMessage(t,n)},t.args.push(t.reply)),t}function u(t){m||(m=t||e,m.addEventListener?m.addEventListener("message",d,!1):m.attachEvent?m.attachEvent("onmessage",d):null===m.onmessage?m.onmessage=d:m=null)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}function d(e){var t;a(e.data)||(t=l(e),t&&(p("*",t.event,t.args,e),p(e.origin,t.event,t.args,e),h(e.data,t.origin,e.source)))}function p(e,t,n,r){var i;if(g[e]&&g[e][t])for(i=0;i<g[e][t].length;i++)g[e][t][i].apply(r,n)}function E(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function _(e,t,n){var r;try{for(e.postMessage(t,n),E(e)&&_(e.opener.top,t,n),r=0;r<e.frames.length;r++)_(e.frames[r],t,n)}catch(i){}}function h(e,t,n){var r,i;for(r=T.length-1;r>=0;r--)i=T[r],i.closed===!0?T=T.slice(r,1):n!==i&&_(i.top,e,t)}function y(e,t){function n(i,o){e(i,o),D.target(t).unsubscribe(r,n)}var r=f();return D.target(t).subscribe(r,n),r}function I(e,t,n){return a(e)?!0:"function"!=typeof t?!0:a(n)?!0:!1}var m,D,T=[],g={},S="/*framebus*/";return u(),D={target:n,include:t,publish:r,pub:r,trigger:r,emit:r,subscribe:i,sub:i,on:i,unsubscribe:o,unsub:o,off:o}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,t,n){"use strict";var r=e("./lib/set-attributes"),i=e("./lib/default-attributes"),o=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),n=o({},i,e);return n.style&&"string"!=typeof n.style&&(o(t.style,n.style),delete n.style),r(t,n),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":4,"./lib/default-attributes":5,"./lib/set-attributes":6}],4:[function(e,t,n){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}},{}],5:[function(e,t,n){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],6:[function(e,t,n){"use strict";t.exports=function(e,t){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],null==n?e.removeAttribute(r):e.setAttribute(r,n))}},{}],7:[function(e,t,n){"use strict";var r=e("../shared/constants");t.exports=function(e,t){return e+"/web/"+r.VERSION+"/html/hosted-fields-frame.min.html#"+t}},{"../shared/constants":11}],8:[function(e,t,n){"use strict";function r(e){return function(t){var n,r=t.merchantPayload,i=r.emittedBy,o=e[i].containerElement;Object.keys(r.fields).forEach(function(t){r.fields[t].container=e[t].containerElement}),n=r.fields[i],s.toggle(o,f.externalClasses.FOCUSED,n.isFocused),s.toggle(o,f.externalClasses.VALID,n.isValid),s.toggle(o,f.externalClasses.INVALID,!n.isPotentiallyValid),this._state={cards:r.cards,fields:r.fields},this._emit(t.type,r)}}function i(e){var t,n,_=this,h={},y=0,g=E();if(!e.client)throw new l({type:A.INSTANTIATION_OPTION_REQUIRED.type,code:A.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating Hosted Fields."});if(n=e.client.getConfiguration().analyticsMetadata.sdkVersion,n!==S)throw new l({type:A.INCOMPATIBLE_VERSIONS.type,code:A.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+n+") and Hosted Fields (version "+S+") components must be from the same SDK version."});if(!e.fields)throw new l({type:A.INSTANTIATION_OPTION_REQUIRED.type,code:A.INSTANTIATION_OPTION_REQUIRED.code,message:"options.fields is required when instantiating Hosted Fields."});m.call(this),this._injectedNodes=[],this._destructor=new o,this._fields=h,this._state={fields:{},cards:L("")},this._bus=new c({channel:g,merchantUrl:location.href}),this._destructor.registerFunctionForTeardown(function(){_._bus.teardown()}),this._client=e.client,T.sendEvent(this._client,"custom.hosted-fields.initialized"),Object.keys(e.fields).forEach(function(t){var n,r,i;if(!f.whitelistedFields.hasOwnProperty(t))throw new l({type:d.HOSTED_FIELDS_INVALID_FIELD_KEY.type,code:d.HOSTED_FIELDS_INVALID_FIELD_KEY.code,message:'"'+t+'" is not a valid field.'});if(n=e.fields[t],r=document.querySelector(n.selector),!r)throw new l({type:d.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.type,code:d.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.code,message:d.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.message,details:{fieldSelector:n.selector,fieldKey:t}});if(r.querySelector('iframe[name^="braintree-"]'))throw new l({type:d.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.type,code:d.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.code,message:d.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.message,details:{fieldSelector:n.selector,fieldKey:t}});i=a({type:t,name:"braintree-hosted-field-"+t,style:f.defaultIFrameStyle}),this._injectedNodes=this._injectedNodes.concat(D(i,r)),this._setupLabelFocus(t,r),h[t]={frameElement:i,containerElement:r},y++,this._state.fields[t]={isEmpty:!0,isValid:!1,isPotentiallyValid:!0,isFocused:!1,container:r},setTimeout(function(){i.src=u(_._client.getConfiguration().gatewayConfiguration.assetsUrl,g)},0)}.bind(this)),t=setTimeout(function(){T.sendEvent(_._client,"custom.hosted-fields.load.timed-out")},p),this._bus.on(I.FRAME_READY,function(n){y--,0===y&&(clearTimeout(t),n(e),_._emit("ready"))}),this._bus.on(I.INPUT_EVENT,r(h).bind(this)),this._destructor.registerFunctionForTeardown(function(){var e,t,n;for(e=0;e<_._injectedNodes.length;e++)t=_._injectedNodes[e],n=t.parentNode,n.removeChild(t),s.remove(n,f.externalClasses.FOCUSED,f.externalClasses.INVALID,f.externalClasses.VALID)}),this._destructor.registerFunctionForTeardown(function(){var e=O(i.prototype).concat(O(m.prototype));b(_,e)})}var o=e("../../lib/destructor"),s=e("../../lib/classlist"),a=e("iframer"),c=e("../../lib/bus"),l=e("../../lib/braintree-error"),u=e("./compose-url"),f=e("../shared/constants"),d=e("../shared/errors"),p=e("../../lib/constants").INTEGRATION_TIMEOUT_MS,E=e("../../lib/uuid"),_=e("../shared/find-parent-tags"),h=e("../../lib/throw-if-no-callback"),y=e("../../lib/is-ios"),I=f.events,m=e("../../lib/event-emitter"),D=e("./inject-frame"),T=e("../../lib/analytics"),g=f.whitelistedFields,S="3.7.0",O=e("../../lib/methods"),b=e("../../lib/convert-methods-to-error"),N=e("../../lib/deferred"),A=e("../../lib/errors"),L=e("credit-card-type");i.prototype=Object.create(m.prototype,{constructor:i}),i.prototype._setupLabelFocus=function(e,t){function n(){s.emit(I.TRIGGER_INPUT_FOCUS,e)}var r,i,o=y(),s=this._bus;if(!o&&null!=t.id){for(r=Array.prototype.slice.call(document.querySelectorAll('label[for="'+t.id+'"]')),r=r.concat(_(t,"label")),i=0;i<r.length;i++)r[i].addEventListener("click",n,!1);this._destructor.registerFunctionForTeardown(function(){for(i=0;i<r.length;i++)r[i].removeEventListener("click",n,!1)})}},i.prototype.teardown=function(e){var t=this._client;this._destructor.teardown(function(n){T.sendEvent(t,"custom.hosted-fields.teardown-completed"),"function"==typeof e&&(e=N(e))(n)})},i.prototype.tokenize=function(e,t){t||(t=e,e={}),h(t,"tokenize"),this._bus.emit(I.TOKENIZATION_REQUEST,e,function(e){t.apply(null,e)})},i.prototype.addClass=function(e,t,n){var r;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.ADD_CLASS,e,t):r=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot add class to "'+e+'" field because it is not part of the current Hosted Fields options.'}):r=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when adding a class.'}),"function"==typeof n&&(n=N(n))(r)},i.prototype.removeClass=function(e,t,n){var r;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.REMOVE_CLASS,e,t):r=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot remove class from "'+e+'" field because it is not part of the current Hosted Fields options.'}):r=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when removing a class.'}),"function"==typeof n&&(n=N(n))(r)},i.prototype.setPlaceholder=function(e,t,n){var r;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.SET_PLACEHOLDER,e,t):r=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot set placeholder for "'+e+'" field because it is not part of the current Hosted Fields options.'}):r=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when setting a placeholder.'}),"function"==typeof n&&(n=N(n))(r)},i.prototype.clear=function(e,t){var n;g.hasOwnProperty(e)?this._fields.hasOwnProperty(e)?this._bus.emit(I.CLEAR_FIELD,e):n=new l({type:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,code:d.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,message:'Cannot clear "'+e+'" field because it is not part of the current Hosted Fields options.'}):n=new l({type:d.HOSTED_FIELDS_FIELD_INVALID.type,code:d.HOSTED_FIELDS_FIELD_INVALID.code,message:'"'+e+'" is not a valid field. You must use a valid field option when clearing a field.'}),"function"==typeof t&&(t=N(t))(n)},i.prototype.getState=function(){return this._state},t.exports=i},{"../../lib/analytics":15,"../../lib/braintree-error":17,"../../lib/bus":20,"../../lib/classlist":21,"../../lib/constants":22,"../../lib/convert-methods-to-error":23,"../../lib/deferred":25,"../../lib/destructor":26,"../../lib/errors":28,"../../lib/event-emitter":29,"../../lib/is-ios":30,"../../lib/methods":33,"../../lib/throw-if-no-callback":36,"../../lib/uuid":37,"../shared/constants":11,"../shared/errors":12,"../shared/find-parent-tags":13,"./compose-url":7,"./inject-frame":9,"credit-card-type":1,iframer:3}],9:[function(e,t,n){"use strict";t.exports=function(e,t){var n=document.createElement("div"),r=document.createDocumentFragment();return n.style.clear="both",r.appendChild(e),r.appendChild(n),t.appendChild(r),[e,n]}},{}],10:[function(e,t,n){"use strict";function r(e,t){var n;s(t,"create");try{n=new i(e)}catch(r){return t=o(t),void t(r)}n.on("ready",function(){t(null,n)})}var i=e("./external/hosted-fields"),o=e("../lib/deferred"),s=e("../lib/throw-if-no-callback"),a="3.7.0";t.exports={create:r,VERSION:a}},{"../lib/deferred":25,"../lib/throw-if-no-callback":36,"./external/hosted-fields":8}],11:[function(e,t,n){"use strict";var r=e("../../lib/enumerate"),i="3.7.0",o={VERSION:i,maxExpirationYearAge:19,externalEvents:{FOCUS:"focus",BLUR:"blur",EMPTY:"empty",NOT_EMPTY:"notEmpty",VALIDITY_CHANGE:"validityChange",CARD_TYPE_CHANGE:"cardTypeChange"},defaultMaxLengths:{number:19,postalCode:8,expirationDate:7,expirationMonth:2,expirationYear:4,cvv:3},externalClasses:{FOCUSED:"braintree-hosted-fields-focused",INVALID:"braintree-hosted-fields-invalid",VALID:"braintree-hosted-fields-valid"},defaultIFrameStyle:{border:"none",width:"100%",height:"100%","float":"left"},whitelistedStyles:["-moz-osx-font-smoothing","-moz-tap-highlight-color","-moz-transition","-webkit-font-smoothing","-webkit-tap-highlight-color","-webkit-transition","color","font","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-weight","letter-spacing","line-height","opacity","outline","text-shadow","transition"],whitelistedFields:{number:{name:"credit-card-number",label:"Credit Card Number"},cvv:{name:"cvv",label:"CVV"},expirationDate:{name:"expiration",label:"Expiration Date"},expirationMonth:{name:"expiration-month",label:"Expiration Month"},expirationYear:{name:"expiration-year",label:"Expiration Year"},postalCode:{name:"postal-code",label:"Postal Code"}}};o.events=r(["FRAME_READY","VALIDATE_STRICT","CONFIGURATION","TOKENIZATION_REQUEST","INPUT_EVENT","TRIGGER_INPUT_FOCUS","ADD_CLASS","REMOVE_CLASS","SET_PLACEHOLDER","CLEAR_FIELD"],"hosted-fields:"),t.exports=o},{"../../lib/enumerate":27}],12:[function(e,t,n){"use strict";var r=e("../../lib/braintree-error");t.exports={HOSTED_FIELDS_INVALID_FIELD_KEY:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_KEY"},HOSTED_FIELDS_INVALID_FIELD_SELECTOR:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_INVALID_FIELD_SELECTOR",message:"Selector does not reference a valid DOM node."},HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME",message:"Element already contains a Braintree iframe."},HOSTED_FIELDS_FIELD_INVALID:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_INVALID"},HOSTED_FIELDS_FIELD_NOT_PRESENT:{type:r.types.MERCHANT,code:"HOSTED_FIELDS_FIELD_NOT_PRESENT"},HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR:{type:r.types.NETWORK,code:"HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},HOSTED_FIELDS_FAILED_TOKENIZATION:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FAILED_TOKENIZATION",message:"The supplied card data failed tokenization."},HOSTED_FIELDS_FIELDS_EMPTY:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_EMPTY",message:"All fields are empty. Cannot tokenize empty card fields."},HOSTED_FIELDS_FIELDS_INVALID:{type:r.types.CUSTOMER,code:"HOSTED_FIELDS_FIELDS_INVALID",message:"Some payment input fields are invalid. Cannot tokenize invalid card fields."}}},{"../../lib/braintree-error":17}],13:[function(e,t,n){"use strict";function r(e,t){for(var n=e.parentNode,r=[];null!=n;)null!=n.tagName&&n.tagName.toLowerCase()===t&&r.push(n),n=n.parentNode;return r}t.exports=r},{}],14:[function(e,t,n){"use strict";function r(e,t){var n,r=t?o(t):{},a=i(e.authorization).attrs,c=o(e.analyticsMetadata);r.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(c[n]=r._meta[n]);return r._meta=c,a.tokenizationKey?r.tokenizationKey=a.tokenizationKey:r.authorizationFingerprint=a.authorizationFingerprint,r}var i=e("./create-authorization-data"),o=e("./json-clone"),s=e("./constants");t.exports=r},{"./constants":22,"./create-authorization-data":24,"./json-clone":32}],15:[function(e,t,n){"use strict";function r(e){return Math.floor(e/1e3)}function i(e,t,n){var i=e.getConfiguration(),a=e._request,c=r(Date.now()),l=i.gatewayConfiguration.analytics.url,u={analytics:[{kind:o.ANALYTICS_PREFIX+t,timestamp:c}]};a({url:l,method:"post",data:s(i,u),timeout:o.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var o=e("./constants"),s=e("./add-metadata");t.exports={sendEvent:i}},{"./add-metadata":14,"./constants":22}],16:[function(e,t,n){"use strict";function r(e,t){var n=0===e.length;n?(e(),t(null)):e(t)}var i=e("./once");t.exports=function(e,t){function n(e){return e?void c(e):(a-=1,void(0===a&&c(null)))}var o,s=e.length,a=s,c=i(t);if(0===s)return void c(null);for(o=0;s>o;o++)r(e[o],n)}},{"./once":34}],17:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var i=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":27}],18:[function(e,t,n){"use strict";function r(e,t){var n,r,o=document.createElement("a");return o.href=t,r="https:"===o.protocol?o.host.replace(/:443$/,""):"http:"===o.protocol?o.host.replace(/:80$/,""):o.host,n=o.protocol+"//"+r,n===e?!0:(o.href=e,i(e))}var i=e("../is-whitelisted-domain");t.exports={checkOrigin:r}},{"../is-whitelisted-domain":31}],19:[function(e,t,n){"use strict";var r=e("../enumerate");t.exports=r(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":27}],20:[function(e,t,n){"use strict";function r(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new a({type:a.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var i=e("framebus"),o=e("./events"),s=e("./check-origin").checkOrigin,a=e("../braintree-error");r.prototype.on=function(e,t){var n,r,o=t,a=this;this._isDestroyed||(this.merchantUrl&&(o=function(){s(this.origin,a.merchantUrl)&&t.apply(this,arguments)}),n=this._namespaceEvent(e),r=Array.prototype.slice.call(arguments),r[0]=n,r[1]=o,this._log("on",r),i.on.apply(i,r),this._listeners.push({eventName:e,handler:o,originalHandler:t}))},r.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),i.emit.apply(i,t))},r.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),i.off.apply(i,t))},r.prototype.off=function(e,t){var n,r,i=t;if(!this._isDestroyed){if(this.merchantUrl)for(n=0;n<this._listeners.length;n++)r=this._listeners[n],r.originalHandler===t&&(i=r.handler);this._offDirect(e,i)}},r.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},r.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},r.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},r.events=o,t.exports=r},{"../braintree-error":17,"./check-origin":18,"./events":19,framebus:2}],21:[function(e,t,n){"use strict";function r(e){return e.className.trim().split(/\s+/)}function i(e){var t=Array.prototype.slice.call(arguments,1),n=r(e).filter(function(e){return-1===t.indexOf(e)}).concat(t).join(" ");e.className=n}function o(e){var t=Array.prototype.slice.call(arguments,1),n=r(e).filter(function(e){return-1===t.indexOf(e)}).join(" ");e.className=n}function s(e,t,n){n?i(e,t):o(e,t)}t.exports={add:i,remove:o,toggle:s}},{}],22:[function(e,t,n){"use strict";var r="3.7.0",i="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:i,BRAINTREE_LIBRARY_VERSION:"braintree/"+i+"/"+r}},{}],23:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("../lib/errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../lib/errors":28,"./braintree-error":17}],24:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function i(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function o(e){var t,n,o={attrs:{},configUrl:""};return r(e)?(n=i(e),o.attrs.tokenizationKey=e,o.configUrl=a[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(s(e)),o.attrs.authorizationFingerprint=t.authorizationFingerprint,o.configUrl=t.configUrl),o}var s=e("../lib/polyfill").atob,a={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=o},{"../lib/polyfill":35}],25:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],26:[function(e,t,n){"use strict";function r(){this._teardownRegistry=[],this._isTearingDown=!1}var i=e("./batch-execute-functions");r.prototype.registerFunctionForTeardown=function(e){"function"==typeof e&&this._teardownRegistry.push(e)},r.prototype.teardown=function(e){return this._isTearingDown?void e(new Error("Destructor is already tearing down")):(this._isTearingDown=!0,void i(this._teardownRegistry,function(t){this._teardownRegistry=[],this._isTearingDown=!1,"function"==typeof e&&e(t)}.bind(this)))},t.exports=r},{"./batch-execute-functions":16}],27:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],28:[function(e,t,n){"use strict";var r=e("./braintree-error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":17}],29:[function(e,t,n){"use strict";function r(){this._events={}}r.prototype.on=function(e,t){this._events[e]?this._events[e].push(t):this._events[e]=[t]},r.prototype._emit=function(e){var t,n,r=this._events[e];if(r)for(n=Array.prototype.slice.call(arguments,1),t=0;t<r.length;t++)r[t].apply(null,n)},t.exports=r},{}],30:[function(e,t,n){"use strict";t.exports=function(e){return e=e||navigator.userAgent,/(iPad|iPhone|iPod)/i.test(e)}},{}],31:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function i(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(o=o||document.createElement("a"),o.href=e,t=r(o.hostname),s.hasOwnProperty(t)):!1}var o,s={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=i},{}],32:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],33:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],34:[function(e,t,n){"use strict";function r(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=r},{}],35:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,i,o,s,a,c,l=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";if(!l.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do i=u.indexOf(e.charAt(c++)),o=u.indexOf(e.charAt(c++)),s=u.indexOf(e.charAt(c++)),a=u.indexOf(e.charAt(c++)),t=(63&i)<<2|o>>4&3,n=(15&o)<<4|s>>2&15,r=(3&s)<<6|63&a,f+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(c<e.length);return f}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],36:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("../lib/errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../lib/errors":28,"./braintree-error":17}],37:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}]},{},[10])(10)});
{
"name": "braintree-web",
"description": "A suite of tools for integrating Braintree in the browser",
"version": "3.6.3",
"version": "3.7.0",
"main": "index.js",

@@ -6,0 +6,0 @@ "repository": {

@@ -351,31 +351,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).paypal = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":18}],7:[function(_dereq_,module,exports){
'use strict';
var createAuthorizationData = _dereq_('./create-authorization-data');

@@ -412,3 +383,3 @@ var jsonClone = _dereq_('./json-clone');

},{"./constants":13,"./create-authorization-data":15,"./json-clone":29}],8:[function(_dereq_,module,exports){
},{"./constants":13,"./create-authorization-data":15,"./json-clone":29}],7:[function(_dereq_,module,exports){
'use strict';

@@ -447,3 +418,80 @@

},{"./add-metadata":7,"./constants":13}],9:[function(_dereq_,module,exports){
},{"./add-metadata":6,"./constants":13}],8:[function(_dereq_,module,exports){
'use strict';
var enumerate = _dereq_('./enumerate');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
}
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":17}],9:[function(_dereq_,module,exports){
(function (global){

@@ -578,3 +626,3 @@ 'use strict';

var checkOrigin = _dereq_('./check-origin').checkOrigin;
var BraintreeError = _dereq_('../error');
var BraintreeError = _dereq_('../braintree-error');

@@ -704,6 +752,6 @@ function BraintreeBus(options) {

},{"../error":18,"./check-origin":10,"./events":11,"framebus":1}],13:[function(_dereq_,module,exports){
},{"../braintree-error":8,"./check-origin":10,"./events":11,"framebus":1}],13:[function(_dereq_,module,exports){
'use strict';
var VERSION = "3.6.3";
var VERSION = "3.7.0";
var PLATFORM = 'web';

@@ -725,4 +773,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -741,3 +789,3 @@ module.exports = function (instance, methodNames) {

},{"../errors":6,"./error":18}],15:[function(_dereq_,module,exports){
},{"../lib/errors":18,"./braintree-error":8}],15:[function(_dereq_,module,exports){
'use strict';

@@ -822,77 +870,29 @@

var enumerate = _dereq_('./enumerate');
var BraintreeError = _dereq_('./braintree-error');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":17}],19:[function(_dereq_,module,exports){
},{"./braintree-error":8}],19:[function(_dereq_,module,exports){
'use strict';

@@ -907,3 +907,3 @@

var iFramer = _dereq_('iframer');
var BraintreeError = _dereq_('../../error');
var BraintreeError = _dereq_('../../braintree-error');

@@ -1089,3 +1089,3 @@ var REQUIRED_CONFIG_KEYS = [

},{"../../bus":12,"../../error":18,"../../uuid":35,"../shared/constants":25,"../shared/errors":26,"../shared/events":27,"./popup":22,"iframer":2}],20:[function(_dereq_,module,exports){
},{"../../braintree-error":8,"../../bus":12,"../../uuid":35,"../shared/constants":25,"../shared/errors":26,"../shared/events":27,"./popup":22,"iframer":2}],20:[function(_dereq_,module,exports){
'use strict';

@@ -1191,3 +1191,3 @@

var BraintreeError = _dereq_('../../error');
var BraintreeError = _dereq_('../../braintree-error');

@@ -1207,3 +1207,3 @@ module.exports = {

},{"../../error":18}],27:[function(_dereq_,module,exports){
},{"../../braintree-error":8}],27:[function(_dereq_,module,exports){
'use strict';

@@ -1417,4 +1417,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -1431,3 +1431,3 @@ module.exports = function (callback, functionName) {

},{"../errors":6,"./error":18}],35:[function(_dereq_,module,exports){
},{"../lib/errors":18,"./braintree-error":8}],35:[function(_dereq_,module,exports){
'use strict';

@@ -1450,5 +1450,5 @@

var frameService = _dereq_('../../lib/frame-service/external');
var BraintreeError = _dereq_('../../lib/error');
var BraintreeError = _dereq_('../../lib/braintree-error');
var once = _dereq_('../../lib/once');
var VERSION = "3.6.3";
var VERSION = "3.7.0";
var constants = _dereq_('../shared/constants');

@@ -1492,2 +1492,16 @@ var INTEGRATION_TIMEOUT_MS = _dereq_('../../lib/constants').INTEGRATION_TIMEOUT_MS;

* @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).
* @property {?object} creditFinancingOffered This property will only be present when the customer pays with PayPal Credit.
* @property {object} creditFinancingOffered.totalCost This is the estimated total payment amount including interest and fees the user will pay during the lifetime of the loan.
* @property {string} creditFinancingOffered.totalCost.value An amount defined by [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.
* @property {string} creditFinancingOffered.totalCost.currency 3 letter currency code as defined by [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm).
* @property {number} creditFinancingOffered.term Length of financing terms in months.
* @property {object} creditFinancingOffered.monthlyPayment This is the estimated amount per month that the customer will need to pay including fees and interest.
* @property {string} creditFinancingOffered.monthlyPayment.value An amount defined by [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.
* @property {string} creditFinancingOffered.monthlyPayment.currency 3 letter currency code as defined by [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm).
* @property {object} creditFinancingOffered.totalInterest Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.
* @property {string} creditFinancingOffered.totalInterest.value An amount defined by [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.
* @property {string} creditFinancingOffered.totalInterest.currency 3 letter currency code as defined by [ISO 4217](http://www.iso.org/iso/home/standards/currency_codes.htm).
* @property {boolean} creditFinancingOffered.payerAcceptance Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.
* @property {boolean} creditFinancingOffered.cartAmountImmutable Indicates whether the cart amount is editable after payer's acceptance on PayPal side.
*
*/

@@ -1505,2 +1519,3 @@

* @classdesc This class represents a PayPal component. Instances of this class have methods for launching auth dialogs and other programmatic interactions with the PayPal component.
* @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/paypal.create|braintree-web.paypal.create} instead.</strong>
*/

@@ -1543,4 +1558,2 @@ function PayPal(options) {

* @param {string} [options.useraction]
* This option only applies to the "checkout" flow and will have no effect on the "vault" flow.
*
* Changes the call-to-action in the PayPal flow. By default the final button will show the localized

@@ -1727,2 +1740,6 @@ * word for "Continue" and implies that the final amount billed is not yet known.

if (account.details && account.details.creditFinancingOffered) {
payload.creditFinancingOffered = account.details.creditFinancingOffered;
}
return payload;

@@ -1869,3 +1886,3 @@ };

},{"../../lib/analytics":8,"../../lib/constants":13,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/error":18,"../../lib/frame-service/external":20,"../../lib/methods":30,"../../lib/once":31,"../../lib/querystring":33,"../../lib/throw-if-no-callback":34,"../shared/constants":38,"../shared/errors":39}],37:[function(_dereq_,module,exports){
},{"../../lib/analytics":7,"../../lib/braintree-error":8,"../../lib/constants":13,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/frame-service/external":20,"../../lib/methods":30,"../../lib/once":31,"../../lib/querystring":33,"../../lib/throw-if-no-callback":34,"../shared/constants":38,"../shared/errors":39}],37:[function(_dereq_,module,exports){
'use strict';

@@ -1875,3 +1892,3 @@ /** @module braintree-web/paypal */

var analytics = _dereq_('../lib/analytics');
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var browserDetection = _dereq_('../lib/browser-detection');

@@ -1882,4 +1899,4 @@ var deferred = _dereq_('../lib/deferred');

var PayPal = _dereq_('./external/paypal');
var sharedErrors = _dereq_('../errors');
var VERSION = "3.6.3";
var sharedErrors = _dereq_('../lib/errors');
var VERSION = "3.7.0";

@@ -1961,3 +1978,3 @@ /**

},{"../errors":6,"../lib/analytics":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/error":18,"../lib/throw-if-no-callback":34,"./external/paypal":36,"./shared/errors":39}],38:[function(_dereq_,module,exports){
},{"../lib/analytics":7,"../lib/braintree-error":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/errors":18,"../lib/throw-if-no-callback":34,"./external/paypal":36,"./shared/errors":39}],38:[function(_dereq_,module,exports){
'use strict';

@@ -1984,3 +2001,3 @@

var BraintreeError = _dereq_('../../lib/error');
var BraintreeError = _dereq_('../../lib/braintree-error');

@@ -2035,3 +2052,3 @@ module.exports = {

},{"../../lib/error":18}]},{},[37])(37)
},{"../../lib/braintree-error":8}]},{},[37])(37)
});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).paypal=e()}}(function(){var e;return function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return o(n?n:t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(t,n,r){(function(t){"use strict";!function(o,i){"object"==typeof r&&"undefined"!=typeof n?n.exports=i("undefined"==typeof t?o:t):"function"==typeof e&&e.amd?e([],function(){return i(o)}):o.framebus=i(o)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(I.push(e),!0)}function n(e){var t,n={};for(t in P)P.hasOwnProperty(t)&&(n[t]=P[t]);return n._origin=e||"*",n}function r(e){var t,n,r=a(this);return s(e)?!1:s(r)?!1:(n=Array.prototype.slice.call(arguments,1),t=c(e,n,r),t===!1?!1:(h(m.top,t,r),!0))}function o(e,t){var n=a(this);return E(e,t,n)?!1:(O[n]=O[n]||{},O[n][e]=O[n][e]||[],O[n][e].push(t),!0)}function i(e,t){var n,r,o=a(this);if(E(e,t,o))return!1;if(r=O[o]&&O[o][e],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===t)return r.splice(n,1),!0;return!1}function a(e){return e&&e._origin||"*"}function s(e){return"string"!=typeof e}function c(e,t,n){var r=!1,o={event:e,origin:n},i=t[t.length-1];"function"==typeof i&&(o.reply=A(i,n),t=t.slice(0,-1)),o.args=t;try{r=g+JSON.stringify(o)}catch(a){throw new Error("Could not stringify event: "+a.message)}return r}function l(e){var t,n,r,o;if(e.data.slice(0,g.length)!==g)return!1;try{t=JSON.parse(e.data.slice(g.length))}catch(i){return!1}return null!=t.reply&&(n=e.origin,r=e.source,o=t.reply,t.reply=function(e){var t=c(o,[e],n);return t===!1?!1:void r.postMessage(t,n)},t.args.push(t.reply)),t}function u(t){m||(m=t||e,m.addEventListener?m.addEventListener("message",f,!1):m.attachEvent?m.attachEvent("onmessage",f):null===m.onmessage?m.onmessage=f:m=null)}function p(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}function f(e){var t;s(e.data)||(t=l(e),t&&(d("*",t.event,t.args,e),d(e.origin,t.event,t.args,e),y(e.data,t.origin,e.source)))}function d(e,t,n,r){var o;if(O[e]&&O[e][t])for(o=0;o<O[e][t].length;o++)O[e][t][o].apply(r,n)}function _(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function h(e,t,n){var r;try{for(e.postMessage(t,n),_(e)&&h(e.opener.top,t,n),r=0;r<e.frames.length;r++)h(e.frames[r],t,n)}catch(o){}}function y(e,t,n){var r,o;for(r=I.length-1;r>=0;r--)o=I[r],o.closed===!0?I=I.slice(r,1):n!==o&&h(o.top,e,t)}function A(e,t){function n(o,i){e(o,i),P.target(t).unsubscribe(r,n)}var r=p();return P.target(t).subscribe(r,n),r}function E(e,t,n){return s(e)?!0:"function"!=typeof t?!0:s(n)?!0:!1}var m,P,I=[],O={},g="/*framebus*/";return u(),P={target:n,include:t,publish:r,pub:r,trigger:r,emit:r,subscribe:o,sub:o,on:o,unsubscribe:i,unsub:i,off:i}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e("./lib/set-attributes"),o=e("./lib/default-attributes"),i=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),n=i({},o,e);return n.style&&"string"!=typeof n.style&&(i(t.style,n.style),delete n.style),r(t,n),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":3,"./lib/default-attributes":4,"./lib/set-attributes":5}],3:[function(e,t,n){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}},{}],4:[function(e,t,n){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],5:[function(e,t,n){"use strict";t.exports=function(e,t){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],null==n?e.removeAttribute(r):e.setAttribute(r,n))}},{}],6:[function(e,t,n){"use strict";var r=e("./lib/error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":18}],7:[function(e,t,n){"use strict";function r(e,t){var n,r=t?i(t):{},s=o(e.authorization).attrs,c=i(e.analyticsMetadata);r.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(c[n]=r._meta[n]);return r._meta=c,s.tokenizationKey?r.tokenizationKey=s.tokenizationKey:r.authorizationFingerprint=s.authorizationFingerprint,r}var o=e("./create-authorization-data"),i=e("./json-clone"),a=e("./constants");t.exports=r},{"./constants":13,"./create-authorization-data":15,"./json-clone":29}],8:[function(e,t,n){"use strict";function r(e){return Math.floor(e/1e3)}function o(e,t,n){var o=e.getConfiguration(),s=e._request,c=r(Date.now()),l=o.gatewayConfiguration.analytics.url,u={analytics:[{kind:i.ANALYTICS_PREFIX+t,timestamp:c}]};s({url:l,method:"post",data:a(o,u),timeout:i.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var i=e("./constants"),a=e("./add-metadata");t.exports={sendEvent:o}},{"./add-metadata":7,"./constants":13}],9:[function(e,t,n){(function(e){"use strict";function n(t){return t=t||e.navigator.userAgent,t.indexOf("Opera Mini")>-1}function r(t){return t=t||e.navigator.userAgent,s(t)&&t.indexOf("Firefox")>-1}function o(t){return t=t||e.navigator.userAgent,-1!==t.indexOf("MSIE")?parseInt(t.replace(/.*MSIE ([0-9]+)\..*/,"$1"),10):/Trident.*rv:11/.test(t)?11:null}function i(t){return t=t||e.location.protocol,"https:"===t}function a(t){return t=t||e.navigator.userAgent,/iPhone|iPod|iPad/.test(t)}function s(t){return t=t||e.navigator.userAgent,/Android/.test(t)}function c(t){return t=t||e.navigator.userAgent,!(u(t)||p(t)||n(t))}function l(e){return/\bGSA\b/.test(e)}function u(t){return t=t||e.navigator.userAgent,a(t)?l(t)?!0:/.+AppleWebKit(?!.*Safari)/.test(t):!1}function p(t){var r=/Version\/[\d\.]+/;return t=t||e.navigator.userAgent,s(t)?r.test(t)&&!n(t):!1}t.exports={isOperaMini:n,isAndroidFirefox:r,getIEVersion:o,isHTTPS:i,isIos:a,isAndroid:s,supportsPopups:c}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(e,t,n){"use strict";function r(e,t){var n,r,i=document.createElement("a");return i.href=t,r="https:"===i.protocol?i.host.replace(/:443$/,""):"http:"===i.protocol?i.host.replace(/:80$/,""):i.host,n=i.protocol+"//"+r,n===e?!0:(i.href=e,o(e))}var o=e("../is-whitelisted-domain");t.exports={checkOrigin:r}},{"../is-whitelisted-domain":28}],11:[function(e,t,n){"use strict";var r=e("../enumerate");t.exports=r(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":17}],12:[function(e,t,n){"use strict";function r(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new s({type:s.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var o=e("framebus"),i=e("./events"),a=e("./check-origin").checkOrigin,s=e("../error");r.prototype.on=function(e,t){var n,r,i=t,s=this;this._isDestroyed||(this.merchantUrl&&(i=function(){a(this.origin,s.merchantUrl)&&t.apply(this,arguments)}),n=this._namespaceEvent(e),r=Array.prototype.slice.call(arguments),r[0]=n,r[1]=i,this._log("on",r),o.on.apply(o,r),this._listeners.push({eventName:e,handler:i,originalHandler:t}))},r.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),o.emit.apply(o,t))},r.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),o.off.apply(o,t))},r.prototype.off=function(e,t){var n,r,o=t;if(!this._isDestroyed){if(this.merchantUrl)for(n=0;n<this._listeners.length;n++)r=this._listeners[n],r.originalHandler===t&&(o=r.handler);this._offDirect(e,o)}},r.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},r.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},r.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},r.events=i,t.exports=r},{"../error":18,"./check-origin":10,"./events":11,framebus:1}],13:[function(e,t,n){"use strict";var r="3.6.3",o="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:o,BRAINTREE_LIBRARY_VERSION:"braintree/"+o+"/"+r}},{}],14:[function(e,t,n){"use strict";var r=e("./error"),o=e("../errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new r({type:o.METHOD_CALLED_AFTER_TEARDOWN.type,code:o.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../errors":6,"./error":18}],15:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function o(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function i(e){var t,n,i={attrs:{},configUrl:""};return r(e)?(n=o(e),i.attrs.tokenizationKey=e,i.configUrl=s[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":32}],16:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],17:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],18:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":17}],19:[function(e,t,n){"use strict";function r(){}function o(e){if(!e)throw new Error("Valid configuration is required");if(_.forEach(function(t){if(!e.hasOwnProperty(t))throw new Error("A valid frame "+t+" must be provided")}),!/^[\w_]+$/.test(e.name))throw new Error("A valid frame name must be provided")}function i(e){o(e),this._serviceId=p().replace(/-/g,""),this._options={name:e.name+"_"+this._serviceId,dispatchFrameUrl:e.dispatchFrameUrl,openFrameUrl:e.openFrameUrl},this._state=e.state,this._bus=new s({channel:this._serviceId}),this._setBusEvents()}var a=e("./popup"),s=e("../../bus"),c=e("../shared/events"),l=e("../shared/errors"),u=e("../shared/constants"),p=e("../../uuid"),f=e("iframer"),d=e("../../error"),_=["name","dispatchFrameUrl","openFrameUrl"];i.prototype.initialize=function(e){var t=function(){e(),this._bus.off(c.DISPATCH_FRAME_READY,t)}.bind(this);this._bus.on(c.DISPATCH_FRAME_READY,t),this._writeDispatchFrame()},i.prototype._writeDispatchFrame=function(){var e=u.DISPATCH_FRAME_NAME+"_"+this._serviceId,t=this._options.dispatchFrameUrl;this._dispatchFrame=f({name:e,src:t,"class":u.DISPATCH_FRAME_CLASS,height:0,width:0,style:{position:"absolute",left:"-9999px"}}),document.body.appendChild(this._dispatchFrame)},i.prototype._setBusEvents=function(){this._bus.on(c.DISPATCH_FRAME_REPORT,function(e,t){this._onCompleteCallback&&this._onCompleteCallback.call(null,e.err,e.payload),this._onCompleteCallback=null,t&&t()}.bind(this)),this._bus.on(s.events.CONFIGURATION_REQUEST,function(e){e(this._state)}.bind(this))},i.prototype.open=function(e){return this._onCompleteCallback=e,this._frame=a.open(this._options),this.isFrameClosed()?(this._cleanupFrame(),void(e&&e(new d(l.FRAME_SERVICE_FRAME_OPEN_FAILED)))):void this._pollForPopupClose()},i.prototype.redirect=function(e){this._frame&&!this.isFrameClosed()&&(this._frame.location.href=e)},i.prototype.close=function(){this.isFrameClosed()||this._frame.close()},i.prototype.focus=function(){this.isFrameClosed()||this._frame.focus()},i.prototype.createHandler=function(e){return e=e||{},{close:function(){e.beforeClose&&e.beforeClose(),this.close()}.bind(this),focus:function(){e.beforeFocus&&e.beforeFocus(),this.focus()}.bind(this)}},i.prototype.createNoopHandler=function(){return{close:r,focus:r}},i.prototype.teardown=function(){this.close(),this._dispatchFrame.parentNode.removeChild(this._dispatchFrame),this._dispatchFrame=null,this._cleanupFrame()},i.prototype.isFrameClosed=function(){return null==this._frame||this._frame.closed},i.prototype._cleanupFrame=function(){this._frame=null,clearInterval(this._popupInterval),this._popupInterval=null},i.prototype._pollForPopupClose=function(){return this._popupInterval=setInterval(function(){this.isFrameClosed()&&(this._cleanupFrame(),this._onCompleteCallback&&this._onCompleteCallback(new d(l.FRAME_SERVICE_FRAME_CLOSED)))}.bind(this),u.POPUP_POLL_INTERVAL),this._popupInterval},t.exports=i},{"../../bus":12,"../../error":18,"../../uuid":35,"../shared/constants":25,"../shared/errors":26,"../shared/events":27,"./popup":22,iframer:2}],20:[function(e,t,n){"use strict";var r=e("./frame-service");t.exports={create:function(e,t){var n=new r(e);n.initialize(function(){t(n)})}}},{"./frame-service":19}],21:[function(e,t,n){"use strict";var r=e("../../shared/constants"),o=e("./position");t.exports=function(){return[r.POPUP_BASE_OPTIONS,"top="+o.top(),"left="+o.left()].join(",")}},{"../../shared/constants":25,"./position":24}],22:[function(e,t,n){"use strict";t.exports={open:e("./open")}},{"./open":23}],23:[function(e,t,n){(function(n){"use strict";var r=e("./compose-options");t.exports=function(e){return n.open(e.openFrameUrl,e.name,r())}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./compose-options":21}],24:[function(e,t,n){(function(n){"use strict";function r(){var e=n.outerHeight||document.documentElement.clientHeight,t=null==n.screenY?n.screenTop:n.screenY;return i(e,a.POPUP_HEIGHT,t)}function o(){var e=n.outerWidth||document.documentElement.clientWidth,t=null==n.screenX?n.screenLeft:n.screenX;return i(e,a.POPUP_WIDTH,t)}function i(e,t,n){return(e-t)/2+n}var a=e("../../shared/constants");t.exports={top:r,left:o,center:i}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../shared/constants":25}],25:[function(e,t,n){"use strict";var r=535,o=450;t.exports={DISPATCH_FRAME_NAME:"dispatch",DISPATCH_FRAME_CLASS:"braintree-dispatch-frame",POPUP_BASE_OPTIONS:"resizable,scrollbars,height="+r+",width="+o,POPUP_WIDTH:o,POPUP_HEIGHT:r,POPUP_POLL_INTERVAL:100,POPUP_CLOSE_TIMEOUT:100}},{}],26:[function(e,t,n){"use strict";var r=e("../../error");t.exports={FRAME_SERVICE_FRAME_CLOSED:{type:r.types.INTERNAL,code:"FRAME_SERVICE_FRAME_CLOSED",message:"Frame closed before tokenization could occur."},FRAME_SERVICE_FRAME_OPEN_FAILED:{type:r.types.INTERNAL,code:"FRAME_SERVICE_FRAME_OPEN_FAILED",message:"Frame failed to open."}}},{"../../error":18}],27:[function(e,t,n){"use strict";var r=e("../../enumerate");t.exports=r(["DISPATCH_FRAME_READY","DISPATCH_FRAME_REPORT"],"frameService:")},{"../../enumerate":17}],28:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function o(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(i=i||document.createElement("a"),i.href=e,t=r(i.hostname),a.hasOwnProperty(t)):!1}var i,a={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=o},{}],29:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],30:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],31:[function(e,t,n){"use strict";function r(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=r},{}],32:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,o,i,a,s,c,l=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p="";if(!l.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do o=u.indexOf(e.charAt(c++)),i=u.indexOf(e.charAt(c++)),a=u.indexOf(e.charAt(c++)),s=u.indexOf(e.charAt(c++)),t=(63&o)<<2|i>>4&3,n=(15&i)<<4|a>>2&15,r=(3&a)<<6|63&s,p+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(c<e.length);return p}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],33:[function(e,t,n){(function(e){"use strict";function n(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&"[object Array]"===Object.prototype.toString.call(e)||!1}function o(t){var n,r;return t=t||e.location.href,/\?/.test(t)?(n=t.replace(/#.*$/,"").replace(/^.*\?/,"").split("&"),r=n.reduce(function(e,t){var n=t.split("="),r=decodeURIComponent(n[0]),o=decodeURIComponent(n[1]);return e[r]=o,e},{})):{}}function i(e,t){var n,o,a,s=[];for(a in e)e.hasOwnProperty(a)&&(o=e[a],n=t?r(e)?t+"[]":t+"["+a+"]":a,"object"==typeof o?s.push(i(o,n)):s.push(encodeURIComponent(n)+"="+encodeURIComponent(o)));return s.join("&")}function a(e,t){return e=e||"",null!=t&&"object"==typeof t&&n(t)&&(e+=-1===e.indexOf("?")?"?":"",e+=-1!==e.indexOf("=")?"&":"",e+=i(t)),e}t.exports={parse:o,stringify:i,queryify:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],34:[function(e,t,n){"use strict";var r=e("./error"),o=e("../errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../errors":6,"./error":18}],35:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}],36:[function(e,t,n){"use strict";function r(e){this._client=e.client,this._assetsUrl=e.client.getConfiguration().gatewayConfiguration.paypal.assetsUrl+"/web/"+s,this._loadingFrameUrl=this._assetsUrl+"/html/paypal-landing-frame.min.html",this._authorizationInProgress=!1}var o=e("../../lib/frame-service/external"),i=e("../../lib/error"),a=e("../../lib/once"),s="3.6.3",c=e("../shared/constants"),l=e("../../lib/constants").INTEGRATION_TIMEOUT_MS,u=e("../../lib/analytics"),p=e("../../lib/throw-if-no-callback"),f=e("../../lib/methods"),d=e("../../lib/deferred"),_=e("../shared/errors"),h=e("../../lib/convert-methods-to-error"),y=e("../../lib/querystring");r.prototype._initialize=function(e){var t=this._client,n=setTimeout(function(){u.sendEvent(t,"paypal.load.timed-out")},l);o.create({name:c.LANDING_FRAME_NAME,dispatchFrameUrl:this._assetsUrl+"/html/dispatch-frame.min.html",openFrameUrl:this._loadingFrameUrl},function(r){this._frameService=r,clearTimeout(n),u.sendEvent(t,"paypal.load.succeeded"),e()}.bind(this))},r.prototype.tokenize=function(e,t){var n=this._client;return p(t,"tokenize"),t=a(d(t)),e&&c.FLOW_ENDPOINTS.hasOwnProperty(e.flow)?(this._authorizationInProgress?(u.sendEvent(n,"paypal.tokenization.error.already-opened"),t(new i(_.PAYPAL_TOKENIZATION_REQUEST_ACTIVE))):(this._authorizationInProgress=!0,u.sendEvent(n,"paypal.tokenization.opened"),this._navigateFrameToAuth(e,t),this._frameService.open(this._createFrameServiceCallback(e,t))),this._frameService.createHandler({beforeClose:function(){u.sendEvent(n,"paypal.tokenization.closed.by-merchant")}})):(t(new i(_.PAYPAL_FLOW_OPTION_REQUIRED)),this._frameService.createNoopHandler())},r.prototype._createFrameServiceCallback=function(e,t){var n=this._client;return function(r,o){this._authorizationInProgress=!1,r?"FRAME_SERVICE_FRAME_CLOSED"===r.code?(u.sendEvent(n,"paypal.tokenization.closed.by-user"),t(new i(_.PAYPAL_POPUP_CLOSED))):"FRAME_SERVICE_FRAME_OPEN_FAILED"===r.code&&t(new i(_.PAYPAL_POPUP_OPEN_FAILED)):this._tokenizePayPal(e,o,t)}.bind(this)},r.prototype._tokenizePayPal=function(e,t,n){var r=this._client;this._frameService.redirect(this._loadingFrameUrl),r.request({endpoint:"payment_methods/paypal_accounts",method:"post",data:this._formatTokenizeData(e,t)},function(e,t){e?(u.sendEvent(r,"paypal.tokenization.failed"),n(e instanceof i?e:new i({type:_.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,code:_.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,message:_.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message,details:{originalError:e}}))):(u.sendEvent(r,"paypal.tokenization.success"),n(null,this._formatTokenizePayload(t))),this._frameService.close()}.bind(this))},r.prototype._formatTokenizePayload=function(e){var t,n={};return e.paypalAccounts&&(n=e.paypalAccounts[0]),t={nonce:n.nonce,details:{},type:n.type},n.details&&n.details.payerInfo&&(t.details=n.details.payerInfo),t},r.prototype._formatTokenizeData=function(e,t){var n=this._client.getConfiguration(),r=n.gatewayConfiguration,o="TOKENIZATION_KEY"===n.authorizationType,i={paypalAccount:{correlationId:this._frameService._serviceId,options:{validate:"vault"===e.flow&&!o}}};return t.ba_token?i.paypalAccount.billingAgreementToken=t.ba_token:(i.paypalAccount.paymentToken=t.paymentId,i.paypalAccount.payerId=t.PayerID,i.paypalAccount.unilateral=r.paypal.unvettedMerchant,e.hasOwnProperty("intent")&&(i.paypalAccount.intent=e.intent)),i},r.prototype._navigateFrameToAuth=function(e,t){var n=this._client,r="paypal_hermes/"+c.FLOW_ENDPOINTS[e.flow];n.request({endpoint:r,method:"post",data:this._formatPaymentResourceData(e)},function(n,r,o){var a;n?(t(422===o?new i({type:_.PAYPAL_INVALID_PAYMENT_OPTION.type,code:_.PAYPAL_INVALID_PAYMENT_OPTION.code,message:_.PAYPAL_INVALID_PAYMENT_OPTION.message,details:{originalError:n}}):n instanceof i?n:new i({type:_.PAYPAL_FLOW_FAILED.type,code:_.PAYPAL_FLOW_FAILED.code,message:_.PAYPAL_FLOW_FAILED.message,details:{originalError:n}})),this._frameService.close()):(a="checkout"===e.flow?r.paymentResource.redirectUrl:r.agreementSetup.approvalUrl,"commit"===e.useraction&&(a=y.queryify(a,{useraction:"commit"})),this._frameService.redirect(a))}.bind(this))},r.prototype._formatPaymentResourceData=function(e){var t,n=this._client.getConfiguration().gatewayConfiguration,r=this._frameService._serviceId,o={returnUrl:n.paypal.assetsUrl+"/web/"+s+"/html/paypal-redirect-frame.min.html?channel="+r,cancelUrl:n.paypal.assetsUrl+"/web/"+s+"/html/paypal-cancel-frame.min.html?channel="+r,correlationId:r,experienceProfile:{brandName:e.displayName||n.paypal.displayName,localeCode:e.locale,noShipping:(!e.enableShippingAddress).toString(),addressOverride:e.shippingAddressEditable===!1}};if("checkout"===e.flow){o.amount=e.amount,o.currencyIsoCode=e.currency,o.offerPaypalCredit=e.offerCredit===!0,e.hasOwnProperty("intent")&&(o.intent=e.intent);for(t in e.shippingAddressOverride)e.shippingAddressOverride.hasOwnProperty(t)&&(o[t]=e.shippingAddressOverride[t])}else o.shippingAddress=e.shippingAddressOverride,e.billingAgreementDescription&&(o.description=e.billingAgreementDescription);return o},r.prototype.teardown=function(e){this._frameService.teardown(),h(this,f(r.prototype)),u.sendEvent(this._client,"paypal.teardown-completed"),"function"==typeof e&&(e=d(e))()},t.exports=r},{"../../lib/analytics":8,"../../lib/constants":13,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/error":18,"../../lib/frame-service/external":20,"../../lib/methods":30,"../../lib/once":31,"../../lib/querystring":33,"../../lib/throw-if-no-callback":34,"../shared/constants":38,"../shared/errors":39}],37:[function(e,t,n){"use strict";function r(e,t){var n,r,d;return l(t,"create"),t=s(t),null==e.client?void t(new i({type:p.INSTANTIATION_OPTION_REQUIRED.type,code:p.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating PayPal."})):(n=e.client.getConfiguration(),d=n.analyticsMetadata.sdkVersion,d!==f?void t(new i({type:p.INCOMPATIBLE_VERSIONS.type,code:p.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+d+") and PayPal (version "+f+") components must be from the same SDK version."})):n.gatewayConfiguration.paypalEnabled!==!0?void t(new i(c.PAYPAL_NOT_ENABLED)):a.supportsPopups()?(o.sendEvent(e.client,"paypal.initialized"),r=new u(e),void r._initialize(function(){t(null,r)})):void t(new i(c.PAYPAL_BROWSER_NOT_SUPPORTED)))}var o=e("../lib/analytics"),i=e("../lib/error"),a=e("../lib/browser-detection"),s=e("../lib/deferred"),c=e("./shared/errors"),l=e("../lib/throw-if-no-callback"),u=e("./external/paypal"),p=e("../errors"),f="3.6.3";t.exports={create:r,VERSION:f}},{"../errors":6,"../lib/analytics":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/error":18,"../lib/throw-if-no-callback":34,"./external/paypal":36,"./shared/errors":39}],38:[function(e,t,n){"use strict";var r=535,o=450;t.exports={AUTH_INIT_ERROR_MESSAGE:"Could not initialize PayPal flow.",LANDING_FRAME_NAME:"braintreepaypallanding",POPUP_BASE_OPTIONS:"resizable,scrollbars,height="+r+",width="+o,POPUP_WIDTH:o,POPUP_HEIGHT:r,POPUP_POLL_INTERVAL:100,FLOW_ENDPOINTS:{checkout:"create_payment_resource",vault:"setup_billing_agreement"}}},{}],39:[function(e,t,n){"use strict";var r=e("../../lib/error");t.exports={PAYPAL_NOT_ENABLED:{type:r.types.MERCHANT,code:"PAYPAL_NOT_ENABLED",message:"PayPal is not enabled for this merchant."},PAYPAL_TOKENIZATION_REQUEST_ACTIVE:{type:r.types.MERCHANT,code:"PAYPAL_TOKENIZATION_REQUEST_ACTIVE",message:"Another tokenization request is active."},PAYPAL_ACCOUNT_TOKENIZATION_FAILED:{type:r.types.NETWORK,code:"PAYPAL_ACCOUNT_TOKENIZATION_FAILED",message:"Could not tokenize user's PayPal account."},PAYPAL_FLOW_FAILED:{type:r.types.NETWORK,code:"PAYPAL_FLOW_FAILED",message:"Could not initialize PayPal flow."},PAYPAL_FLOW_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"PAYPAL_FLOW_OPTION_REQUIRED",message:"PayPal flow property is invalid or missing."},PAYPAL_BROWSER_NOT_SUPPORTED:{type:r.types.CUSTOMER,code:"PAYPAL_BROWSER_NOT_SUPPORTED",message:"Browser is not supported."},PAYPAL_POPUP_OPEN_FAILED:{type:r.types.MERCHANT,code:"PAYPAL_POPUP_OPEN_FAILED",message:"PayPal popup failed to open, make sure to tokenize in response to a user action."},PAYPAL_POPUP_CLOSED:{type:r.types.CUSTOMER,code:"PAYPAL_POPUP_CLOSED",message:"Customer closed PayPal popup before authorizing."},PAYPAL_INVALID_PAYMENT_OPTION:{type:r.types.MERCHANT,code:"PAYPAL_INVALID_PAYMENT_OPTION",message:"PayPal payment options are invalid."}}},{"../../lib/error":18}]},{},[37])(37)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).paypal=e()}}(function(){var e;return function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(o)return o(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[a]={exports:{}};e[a][0].call(u.exports,function(t){var n=e[a][1][t];return i(n?n:t)},u,u.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,n,r){(function(t){"use strict";!function(i,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o("undefined"==typeof t?i:t):"function"==typeof e&&e.amd?e([],function(){return o(i)}):i.framebus=o(i)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(I.push(e),!0)}function n(e){var t,n={};for(t in P)P.hasOwnProperty(t)&&(n[t]=P[t]);return n._origin=e||"*",n}function r(e){var t,n,r=a(this);return s(e)?!1:s(r)?!1:(n=Array.prototype.slice.call(arguments,1),t=c(e,n,r),t===!1?!1:(h(m.top,t,r),!0))}function i(e,t){var n=a(this);return E(e,t,n)?!1:(O[n]=O[n]||{},O[n][e]=O[n][e]||[],O[n][e].push(t),!0)}function o(e,t){var n,r,i=a(this);if(E(e,t,i))return!1;if(r=O[i]&&O[i][e],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===t)return r.splice(n,1),!0;return!1}function a(e){return e&&e._origin||"*"}function s(e){return"string"!=typeof e}function c(e,t,n){var r=!1,i={event:e,origin:n},o=t[t.length-1];"function"==typeof o&&(i.reply=A(o,n),t=t.slice(0,-1)),i.args=t;try{r=g+JSON.stringify(i)}catch(a){throw new Error("Could not stringify event: "+a.message)}return r}function l(e){var t,n,r,i;if(e.data.slice(0,g.length)!==g)return!1;try{t=JSON.parse(e.data.slice(g.length))}catch(o){return!1}return null!=t.reply&&(n=e.origin,r=e.source,i=t.reply,t.reply=function(e){var t=c(i,[e],n);return t===!1?!1:void r.postMessage(t,n)},t.args.push(t.reply)),t}function u(t){m||(m=t||e,m.addEventListener?m.addEventListener("message",f,!1):m.attachEvent?m.attachEvent("onmessage",f):null===m.onmessage?m.onmessage=f:m=null)}function p(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}function f(e){var t;s(e.data)||(t=l(e),t&&(d("*",t.event,t.args,e),d(e.origin,t.event,t.args,e),y(e.data,t.origin,e.source)))}function d(e,t,n,r){var i;if(O[e]&&O[e][t])for(i=0;i<O[e][t].length;i++)O[e][t][i].apply(r,n)}function _(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function h(e,t,n){var r;try{for(e.postMessage(t,n),_(e)&&h(e.opener.top,t,n),r=0;r<e.frames.length;r++)h(e.frames[r],t,n)}catch(i){}}function y(e,t,n){var r,i;for(r=I.length-1;r>=0;r--)i=I[r],i.closed===!0?I=I.slice(r,1):n!==i&&h(i.top,e,t)}function A(e,t){function n(i,o){e(i,o),P.target(t).unsubscribe(r,n)}var r=p();return P.target(t).subscribe(r,n),r}function E(e,t,n){return s(e)?!0:"function"!=typeof t?!0:s(n)?!0:!1}var m,P,I=[],O={},g="/*framebus*/";return u(),P={target:n,include:t,publish:r,pub:r,trigger:r,emit:r,subscribe:i,sub:i,on:i,unsubscribe:o,unsub:o,off:o}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e("./lib/set-attributes"),i=e("./lib/default-attributes"),o=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),n=o({},i,e);return n.style&&"string"!=typeof n.style&&(o(t.style,n.style),delete n.style),r(t,n),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":3,"./lib/default-attributes":4,"./lib/set-attributes":5}],3:[function(e,t,n){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}},{}],4:[function(e,t,n){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],5:[function(e,t,n){"use strict";t.exports=function(e,t){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],null==n?e.removeAttribute(r):e.setAttribute(r,n))}},{}],6:[function(e,t,n){"use strict";function r(e,t){var n,r=t?o(t):{},s=i(e.authorization).attrs,c=o(e.analyticsMetadata);r.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(c[n]=r._meta[n]);return r._meta=c,s.tokenizationKey?r.tokenizationKey=s.tokenizationKey:r.authorizationFingerprint=s.authorizationFingerprint,r}var i=e("./create-authorization-data"),o=e("./json-clone"),a=e("./constants");t.exports=r},{"./constants":13,"./create-authorization-data":15,"./json-clone":29}],7:[function(e,t,n){"use strict";function r(e){return Math.floor(e/1e3)}function i(e,t,n){var i=e.getConfiguration(),s=e._request,c=r(Date.now()),l=i.gatewayConfiguration.analytics.url,u={analytics:[{kind:o.ANALYTICS_PREFIX+t,timestamp:c}]};s({url:l,method:"post",data:a(i,u),timeout:o.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var o=e("./constants"),a=e("./add-metadata");t.exports={sendEvent:i}},{"./add-metadata":6,"./constants":13}],8:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var i=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":17}],9:[function(e,t,n){(function(e){"use strict";function n(t){return t=t||e.navigator.userAgent,t.indexOf("Opera Mini")>-1}function r(t){return t=t||e.navigator.userAgent,s(t)&&t.indexOf("Firefox")>-1}function i(t){return t=t||e.navigator.userAgent,-1!==t.indexOf("MSIE")?parseInt(t.replace(/.*MSIE ([0-9]+)\..*/,"$1"),10):/Trident.*rv:11/.test(t)?11:null}function o(t){return t=t||e.location.protocol,"https:"===t}function a(t){return t=t||e.navigator.userAgent,/iPhone|iPod|iPad/.test(t)}function s(t){return t=t||e.navigator.userAgent,/Android/.test(t)}function c(t){return t=t||e.navigator.userAgent,!(u(t)||p(t)||n(t))}function l(e){return/\bGSA\b/.test(e)}function u(t){return t=t||e.navigator.userAgent,a(t)?l(t)?!0:/.+AppleWebKit(?!.*Safari)/.test(t):!1}function p(t){var r=/Version\/[\d\.]+/;return t=t||e.navigator.userAgent,s(t)?r.test(t)&&!n(t):!1}t.exports={isOperaMini:n,isAndroidFirefox:r,getIEVersion:i,isHTTPS:o,isIos:a,isAndroid:s,supportsPopups:c}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(e,t,n){"use strict";function r(e,t){var n,r,o=document.createElement("a");return o.href=t,r="https:"===o.protocol?o.host.replace(/:443$/,""):"http:"===o.protocol?o.host.replace(/:80$/,""):o.host,n=o.protocol+"//"+r,n===e?!0:(o.href=e,i(e))}var i=e("../is-whitelisted-domain");t.exports={checkOrigin:r}},{"../is-whitelisted-domain":28}],11:[function(e,t,n){"use strict";var r=e("../enumerate");t.exports=r(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":17}],12:[function(e,t,n){"use strict";function r(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new s({type:s.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var i=e("framebus"),o=e("./events"),a=e("./check-origin").checkOrigin,s=e("../braintree-error");r.prototype.on=function(e,t){var n,r,o=t,s=this;this._isDestroyed||(this.merchantUrl&&(o=function(){a(this.origin,s.merchantUrl)&&t.apply(this,arguments)}),n=this._namespaceEvent(e),r=Array.prototype.slice.call(arguments),r[0]=n,r[1]=o,this._log("on",r),i.on.apply(i,r),this._listeners.push({eventName:e,handler:o,originalHandler:t}))},r.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),i.emit.apply(i,t))},r.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),i.off.apply(i,t))},r.prototype.off=function(e,t){var n,r,i=t;if(!this._isDestroyed){if(this.merchantUrl)for(n=0;n<this._listeners.length;n++)r=this._listeners[n],r.originalHandler===t&&(i=r.handler);this._offDirect(e,i)}},r.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},r.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},r.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},r.events=o,t.exports=r},{"../braintree-error":8,"./check-origin":10,"./events":11,framebus:1}],13:[function(e,t,n){"use strict";var r="3.7.0",i="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:i,BRAINTREE_LIBRARY_VERSION:"braintree/"+i+"/"+r}},{}],14:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("../lib/errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../lib/errors":18,"./braintree-error":8}],15:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function i(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function o(e){var t,n,o={attrs:{},configUrl:""};return r(e)?(n=i(e),o.attrs.tokenizationKey=e,o.configUrl=s[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),o.attrs.authorizationFingerprint=t.authorizationFingerprint,o.configUrl=t.configUrl),o}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=o},{"../lib/polyfill":32}],16:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],17:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],18:[function(e,t,n){"use strict";var r=e("./braintree-error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":8}],19:[function(e,t,n){"use strict";function r(){}function i(e){if(!e)throw new Error("Valid configuration is required");if(_.forEach(function(t){if(!e.hasOwnProperty(t))throw new Error("A valid frame "+t+" must be provided")}),!/^[\w_]+$/.test(e.name))throw new Error("A valid frame name must be provided")}function o(e){i(e),this._serviceId=p().replace(/-/g,""),this._options={name:e.name+"_"+this._serviceId,dispatchFrameUrl:e.dispatchFrameUrl,openFrameUrl:e.openFrameUrl},this._state=e.state,this._bus=new s({channel:this._serviceId}),this._setBusEvents()}var a=e("./popup"),s=e("../../bus"),c=e("../shared/events"),l=e("../shared/errors"),u=e("../shared/constants"),p=e("../../uuid"),f=e("iframer"),d=e("../../braintree-error"),_=["name","dispatchFrameUrl","openFrameUrl"];o.prototype.initialize=function(e){var t=function(){e(),this._bus.off(c.DISPATCH_FRAME_READY,t)}.bind(this);this._bus.on(c.DISPATCH_FRAME_READY,t),this._writeDispatchFrame()},o.prototype._writeDispatchFrame=function(){var e=u.DISPATCH_FRAME_NAME+"_"+this._serviceId,t=this._options.dispatchFrameUrl;this._dispatchFrame=f({name:e,src:t,"class":u.DISPATCH_FRAME_CLASS,height:0,width:0,style:{position:"absolute",left:"-9999px"}}),document.body.appendChild(this._dispatchFrame)},o.prototype._setBusEvents=function(){this._bus.on(c.DISPATCH_FRAME_REPORT,function(e,t){this._onCompleteCallback&&this._onCompleteCallback.call(null,e.err,e.payload),this._onCompleteCallback=null,t&&t()}.bind(this)),this._bus.on(s.events.CONFIGURATION_REQUEST,function(e){e(this._state)}.bind(this))},o.prototype.open=function(e){return this._onCompleteCallback=e,this._frame=a.open(this._options),this.isFrameClosed()?(this._cleanupFrame(),void(e&&e(new d(l.FRAME_SERVICE_FRAME_OPEN_FAILED)))):void this._pollForPopupClose()},o.prototype.redirect=function(e){this._frame&&!this.isFrameClosed()&&(this._frame.location.href=e)},o.prototype.close=function(){this.isFrameClosed()||this._frame.close()},o.prototype.focus=function(){this.isFrameClosed()||this._frame.focus()},o.prototype.createHandler=function(e){return e=e||{},{close:function(){e.beforeClose&&e.beforeClose(),this.close()}.bind(this),focus:function(){e.beforeFocus&&e.beforeFocus(),this.focus()}.bind(this)}},o.prototype.createNoopHandler=function(){return{close:r,focus:r}},o.prototype.teardown=function(){this.close(),this._dispatchFrame.parentNode.removeChild(this._dispatchFrame),this._dispatchFrame=null,this._cleanupFrame()},o.prototype.isFrameClosed=function(){return null==this._frame||this._frame.closed},o.prototype._cleanupFrame=function(){this._frame=null,clearInterval(this._popupInterval),this._popupInterval=null},o.prototype._pollForPopupClose=function(){return this._popupInterval=setInterval(function(){this.isFrameClosed()&&(this._cleanupFrame(),this._onCompleteCallback&&this._onCompleteCallback(new d(l.FRAME_SERVICE_FRAME_CLOSED)))}.bind(this),u.POPUP_POLL_INTERVAL),this._popupInterval},t.exports=o},{"../../braintree-error":8,"../../bus":12,"../../uuid":35,"../shared/constants":25,"../shared/errors":26,"../shared/events":27,"./popup":22,iframer:2}],20:[function(e,t,n){"use strict";var r=e("./frame-service");t.exports={create:function(e,t){var n=new r(e);n.initialize(function(){t(n)})}}},{"./frame-service":19}],21:[function(e,t,n){"use strict";var r=e("../../shared/constants"),i=e("./position");t.exports=function(){return[r.POPUP_BASE_OPTIONS,"top="+i.top(),"left="+i.left()].join(",")}},{"../../shared/constants":25,"./position":24}],22:[function(e,t,n){"use strict";t.exports={open:e("./open")}},{"./open":23}],23:[function(e,t,n){(function(n){"use strict";var r=e("./compose-options");t.exports=function(e){return n.open(e.openFrameUrl,e.name,r())}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./compose-options":21}],24:[function(e,t,n){(function(n){"use strict";function r(){var e=n.outerHeight||document.documentElement.clientHeight,t=null==n.screenY?n.screenTop:n.screenY;return o(e,a.POPUP_HEIGHT,t)}function i(){var e=n.outerWidth||document.documentElement.clientWidth,t=null==n.screenX?n.screenLeft:n.screenX;return o(e,a.POPUP_WIDTH,t)}function o(e,t,n){return(e-t)/2+n}var a=e("../../shared/constants");t.exports={top:r,left:i,center:o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../../shared/constants":25}],25:[function(e,t,n){"use strict";var r=535,i=450;t.exports={DISPATCH_FRAME_NAME:"dispatch",DISPATCH_FRAME_CLASS:"braintree-dispatch-frame",POPUP_BASE_OPTIONS:"resizable,scrollbars,height="+r+",width="+i,POPUP_WIDTH:i,POPUP_HEIGHT:r,POPUP_POLL_INTERVAL:100,POPUP_CLOSE_TIMEOUT:100}},{}],26:[function(e,t,n){"use strict";var r=e("../../braintree-error");t.exports={FRAME_SERVICE_FRAME_CLOSED:{type:r.types.INTERNAL,code:"FRAME_SERVICE_FRAME_CLOSED",message:"Frame closed before tokenization could occur."},FRAME_SERVICE_FRAME_OPEN_FAILED:{type:r.types.INTERNAL,code:"FRAME_SERVICE_FRAME_OPEN_FAILED",message:"Frame failed to open."}}},{"../../braintree-error":8}],27:[function(e,t,n){"use strict";var r=e("../../enumerate");t.exports=r(["DISPATCH_FRAME_READY","DISPATCH_FRAME_REPORT"],"frameService:")},{"../../enumerate":17}],28:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function i(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(o=o||document.createElement("a"),o.href=e,t=r(o.hostname),a.hasOwnProperty(t)):!1}var o,a={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=i},{}],29:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],30:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],31:[function(e,t,n){"use strict";function r(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=r},{}],32:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,i,o,a,s,c,l=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p="";if(!l.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do i=u.indexOf(e.charAt(c++)),o=u.indexOf(e.charAt(c++)),a=u.indexOf(e.charAt(c++)),s=u.indexOf(e.charAt(c++)),t=(63&i)<<2|o>>4&3,n=(15&o)<<4|a>>2&15,r=(3&a)<<6|63&s,p+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(c<e.length);return p}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],33:[function(e,t,n){(function(e){"use strict";function n(e){var t;for(t in e)if(e.hasOwnProperty(t))return!0;return!1}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&"[object Array]"===Object.prototype.toString.call(e)||!1}function i(t){var n,r;return t=t||e.location.href,/\?/.test(t)?(n=t.replace(/#.*$/,"").replace(/^.*\?/,"").split("&"),r=n.reduce(function(e,t){var n=t.split("="),r=decodeURIComponent(n[0]),i=decodeURIComponent(n[1]);return e[r]=i,e},{})):{}}function o(e,t){var n,i,a,s=[];for(a in e)e.hasOwnProperty(a)&&(i=e[a],n=t?r(e)?t+"[]":t+"["+a+"]":a,"object"==typeof i?s.push(o(i,n)):s.push(encodeURIComponent(n)+"="+encodeURIComponent(i)));return s.join("&")}function a(e,t){return e=e||"",null!=t&&"object"==typeof t&&n(t)&&(e+=-1===e.indexOf("?")?"?":"",e+=-1!==e.indexOf("=")?"&":"",e+=o(t)),e}t.exports={parse:i,stringify:o,queryify:a}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],34:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("../lib/errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../lib/errors":18,"./braintree-error":8}],35:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}],36:[function(e,t,n){"use strict";function r(e){this._client=e.client,this._assetsUrl=e.client.getConfiguration().gatewayConfiguration.paypal.assetsUrl+"/web/"+s,this._loadingFrameUrl=this._assetsUrl+"/html/paypal-landing-frame.min.html",this._authorizationInProgress=!1}var i=e("../../lib/frame-service/external"),o=e("../../lib/braintree-error"),a=e("../../lib/once"),s="3.7.0",c=e("../shared/constants"),l=e("../../lib/constants").INTEGRATION_TIMEOUT_MS,u=e("../../lib/analytics"),p=e("../../lib/throw-if-no-callback"),f=e("../../lib/methods"),d=e("../../lib/deferred"),_=e("../shared/errors"),h=e("../../lib/convert-methods-to-error"),y=e("../../lib/querystring");r.prototype._initialize=function(e){var t=this._client,n=setTimeout(function(){u.sendEvent(t,"paypal.load.timed-out")},l);i.create({name:c.LANDING_FRAME_NAME,dispatchFrameUrl:this._assetsUrl+"/html/dispatch-frame.min.html",openFrameUrl:this._loadingFrameUrl},function(r){this._frameService=r,clearTimeout(n),u.sendEvent(t,"paypal.load.succeeded"),e()}.bind(this))},r.prototype.tokenize=function(e,t){var n=this._client;return p(t,"tokenize"),t=a(d(t)),e&&c.FLOW_ENDPOINTS.hasOwnProperty(e.flow)?(this._authorizationInProgress?(u.sendEvent(n,"paypal.tokenization.error.already-opened"),t(new o(_.PAYPAL_TOKENIZATION_REQUEST_ACTIVE))):(this._authorizationInProgress=!0,u.sendEvent(n,"paypal.tokenization.opened"),this._navigateFrameToAuth(e,t),this._frameService.open(this._createFrameServiceCallback(e,t))),this._frameService.createHandler({beforeClose:function(){u.sendEvent(n,"paypal.tokenization.closed.by-merchant")}})):(t(new o(_.PAYPAL_FLOW_OPTION_REQUIRED)),this._frameService.createNoopHandler())},r.prototype._createFrameServiceCallback=function(e,t){var n=this._client;return function(r,i){this._authorizationInProgress=!1,r?"FRAME_SERVICE_FRAME_CLOSED"===r.code?(u.sendEvent(n,"paypal.tokenization.closed.by-user"),t(new o(_.PAYPAL_POPUP_CLOSED))):"FRAME_SERVICE_FRAME_OPEN_FAILED"===r.code&&t(new o(_.PAYPAL_POPUP_OPEN_FAILED)):this._tokenizePayPal(e,i,t)}.bind(this)},r.prototype._tokenizePayPal=function(e,t,n){var r=this._client;this._frameService.redirect(this._loadingFrameUrl),r.request({endpoint:"payment_methods/paypal_accounts",method:"post",data:this._formatTokenizeData(e,t)},function(e,t){e?(u.sendEvent(r,"paypal.tokenization.failed"),n(e instanceof o?e:new o({type:_.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,code:_.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,message:_.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message,details:{originalError:e}}))):(u.sendEvent(r,"paypal.tokenization.success"),n(null,this._formatTokenizePayload(t))),this._frameService.close()}.bind(this))},r.prototype._formatTokenizePayload=function(e){var t,n={};return e.paypalAccounts&&(n=e.paypalAccounts[0]),t={nonce:n.nonce,details:{},type:n.type},n.details&&n.details.payerInfo&&(t.details=n.details.payerInfo),n.details&&n.details.creditFinancingOffered&&(t.creditFinancingOffered=n.details.creditFinancingOffered),t},r.prototype._formatTokenizeData=function(e,t){var n=this._client.getConfiguration(),r=n.gatewayConfiguration,i="TOKENIZATION_KEY"===n.authorizationType,o={paypalAccount:{correlationId:this._frameService._serviceId,options:{validate:"vault"===e.flow&&!i}}};return t.ba_token?o.paypalAccount.billingAgreementToken=t.ba_token:(o.paypalAccount.paymentToken=t.paymentId,o.paypalAccount.payerId=t.PayerID,o.paypalAccount.unilateral=r.paypal.unvettedMerchant,e.hasOwnProperty("intent")&&(o.paypalAccount.intent=e.intent)),o},r.prototype._navigateFrameToAuth=function(e,t){var n=this._client,r="paypal_hermes/"+c.FLOW_ENDPOINTS[e.flow];n.request({endpoint:r,method:"post",data:this._formatPaymentResourceData(e)},function(n,r,i){var a;n?(t(422===i?new o({type:_.PAYPAL_INVALID_PAYMENT_OPTION.type,code:_.PAYPAL_INVALID_PAYMENT_OPTION.code,message:_.PAYPAL_INVALID_PAYMENT_OPTION.message,details:{originalError:n}}):n instanceof o?n:new o({type:_.PAYPAL_FLOW_FAILED.type,code:_.PAYPAL_FLOW_FAILED.code,message:_.PAYPAL_FLOW_FAILED.message,details:{originalError:n}})),this._frameService.close()):(a="checkout"===e.flow?r.paymentResource.redirectUrl:r.agreementSetup.approvalUrl,"commit"===e.useraction&&(a=y.queryify(a,{useraction:"commit"})),this._frameService.redirect(a))}.bind(this))},r.prototype._formatPaymentResourceData=function(e){var t,n=this._client.getConfiguration().gatewayConfiguration,r=this._frameService._serviceId,i={returnUrl:n.paypal.assetsUrl+"/web/"+s+"/html/paypal-redirect-frame.min.html?channel="+r,cancelUrl:n.paypal.assetsUrl+"/web/"+s+"/html/paypal-cancel-frame.min.html?channel="+r,correlationId:r,experienceProfile:{brandName:e.displayName||n.paypal.displayName,localeCode:e.locale,noShipping:(!e.enableShippingAddress).toString(),addressOverride:e.shippingAddressEditable===!1}};if("checkout"===e.flow){i.amount=e.amount,i.currencyIsoCode=e.currency,i.offerPaypalCredit=e.offerCredit===!0,e.hasOwnProperty("intent")&&(i.intent=e.intent);for(t in e.shippingAddressOverride)e.shippingAddressOverride.hasOwnProperty(t)&&(i[t]=e.shippingAddressOverride[t])}else i.shippingAddress=e.shippingAddressOverride,e.billingAgreementDescription&&(i.description=e.billingAgreementDescription);return i},r.prototype.teardown=function(e){this._frameService.teardown(),h(this,f(r.prototype)),u.sendEvent(this._client,"paypal.teardown-completed"),"function"==typeof e&&(e=d(e))()},t.exports=r},{"../../lib/analytics":7,"../../lib/braintree-error":8,"../../lib/constants":13,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/frame-service/external":20,"../../lib/methods":30,"../../lib/once":31,"../../lib/querystring":33,"../../lib/throw-if-no-callback":34,"../shared/constants":38,"../shared/errors":39}],37:[function(e,t,n){"use strict";function r(e,t){var n,r,d;return l(t,"create"),t=s(t),null==e.client?void t(new o({type:p.INSTANTIATION_OPTION_REQUIRED.type,code:p.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating PayPal."})):(n=e.client.getConfiguration(),d=n.analyticsMetadata.sdkVersion,d!==f?void t(new o({type:p.INCOMPATIBLE_VERSIONS.type,code:p.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+d+") and PayPal (version "+f+") components must be from the same SDK version."})):n.gatewayConfiguration.paypalEnabled!==!0?void t(new o(c.PAYPAL_NOT_ENABLED)):a.supportsPopups()?(i.sendEvent(e.client,"paypal.initialized"),r=new u(e),void r._initialize(function(){t(null,r)})):void t(new o(c.PAYPAL_BROWSER_NOT_SUPPORTED)))}var i=e("../lib/analytics"),o=e("../lib/braintree-error"),a=e("../lib/browser-detection"),s=e("../lib/deferred"),c=e("./shared/errors"),l=e("../lib/throw-if-no-callback"),u=e("./external/paypal"),p=e("../lib/errors"),f="3.7.0";t.exports={create:r,VERSION:f}},{"../lib/analytics":7,"../lib/braintree-error":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/errors":18,"../lib/throw-if-no-callback":34,"./external/paypal":36,"./shared/errors":39}],38:[function(e,t,n){"use strict";var r=535,i=450;t.exports={AUTH_INIT_ERROR_MESSAGE:"Could not initialize PayPal flow.",LANDING_FRAME_NAME:"braintreepaypallanding",POPUP_BASE_OPTIONS:"resizable,scrollbars,height="+r+",width="+i,POPUP_WIDTH:i,POPUP_HEIGHT:r,POPUP_POLL_INTERVAL:100,FLOW_ENDPOINTS:{checkout:"create_payment_resource",vault:"setup_billing_agreement"}}},{}],39:[function(e,t,n){"use strict";var r=e("../../lib/braintree-error");t.exports={PAYPAL_NOT_ENABLED:{type:r.types.MERCHANT,code:"PAYPAL_NOT_ENABLED",message:"PayPal is not enabled for this merchant."},PAYPAL_TOKENIZATION_REQUEST_ACTIVE:{type:r.types.MERCHANT,code:"PAYPAL_TOKENIZATION_REQUEST_ACTIVE",message:"Another tokenization request is active."},PAYPAL_ACCOUNT_TOKENIZATION_FAILED:{type:r.types.NETWORK,code:"PAYPAL_ACCOUNT_TOKENIZATION_FAILED",message:"Could not tokenize user's PayPal account."},PAYPAL_FLOW_FAILED:{type:r.types.NETWORK,code:"PAYPAL_FLOW_FAILED",message:"Could not initialize PayPal flow."},PAYPAL_FLOW_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"PAYPAL_FLOW_OPTION_REQUIRED",message:"PayPal flow property is invalid or missing."},PAYPAL_BROWSER_NOT_SUPPORTED:{type:r.types.CUSTOMER,code:"PAYPAL_BROWSER_NOT_SUPPORTED",message:"Browser is not supported."},PAYPAL_POPUP_OPEN_FAILED:{type:r.types.MERCHANT,code:"PAYPAL_POPUP_OPEN_FAILED",message:"PayPal popup failed to open, make sure to tokenize in response to a user action."},PAYPAL_POPUP_CLOSED:{type:r.types.CUSTOMER,code:"PAYPAL_POPUP_CLOSED",message:"Customer closed PayPal popup before authorizing."},PAYPAL_INVALID_PAYMENT_OPTION:{type:r.types.MERCHANT,code:"PAYPAL_INVALID_PAYMENT_OPTION",message:"PayPal payment options are invalid."}}},{"../../lib/braintree-error":8}]},{},[37])(37)});

@@ -351,31 +351,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).threeDSecure = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":18}],7:[function(_dereq_,module,exports){
'use strict';
var createAuthorizationData = _dereq_('./create-authorization-data');

@@ -412,3 +383,3 @@ var jsonClone = _dereq_('./json-clone');

},{"./constants":13,"./create-authorization-data":15,"./json-clone":20}],8:[function(_dereq_,module,exports){
},{"./constants":13,"./create-authorization-data":15,"./json-clone":20}],7:[function(_dereq_,module,exports){
'use strict';

@@ -447,3 +418,80 @@

},{"./add-metadata":7,"./constants":13}],9:[function(_dereq_,module,exports){
},{"./add-metadata":6,"./constants":13}],8:[function(_dereq_,module,exports){
'use strict';
var enumerate = _dereq_('./enumerate');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
}
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":17}],9:[function(_dereq_,module,exports){
(function (global){

@@ -578,3 +626,3 @@ 'use strict';

var checkOrigin = _dereq_('./check-origin').checkOrigin;
var BraintreeError = _dereq_('../error');
var BraintreeError = _dereq_('../braintree-error');

@@ -704,6 +752,6 @@ function BraintreeBus(options) {

},{"../error":18,"./check-origin":10,"./events":11,"framebus":1}],13:[function(_dereq_,module,exports){
},{"../braintree-error":8,"./check-origin":10,"./events":11,"framebus":1}],13:[function(_dereq_,module,exports){
'use strict';
var VERSION = "3.6.3";
var VERSION = "3.7.0";
var PLATFORM = 'web';

@@ -725,4 +773,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -741,3 +789,3 @@ module.exports = function (instance, methodNames) {

},{"../errors":6,"./error":18}],15:[function(_dereq_,module,exports){
},{"../lib/errors":18,"./braintree-error":8}],15:[function(_dereq_,module,exports){
'use strict';

@@ -822,77 +870,29 @@

var enumerate = _dereq_('./enumerate');
var BraintreeError = _dereq_('./braintree-error');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":17}],19:[function(_dereq_,module,exports){
},{"./braintree-error":8}],19:[function(_dereq_,module,exports){
'use strict';

@@ -989,4 +989,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -1003,3 +1003,3 @@ module.exports = function (callback, functionName) {

},{"../errors":6,"./error":18}],24:[function(_dereq_,module,exports){
},{"../lib/errors":18,"./braintree-error":8}],24:[function(_dereq_,module,exports){
'use strict';

@@ -1021,3 +1021,3 @@

var BraintreeError = _dereq_('../../lib/error');
var BraintreeError = _dereq_('../../lib/braintree-error');
var analytics = _dereq_('../../lib/analytics');

@@ -1033,3 +1033,3 @@ var methods = _dereq_('../../lib/methods');

var events = _dereq_('../shared/events');
var version = "3.6.3";
var version = "3.7.0";
var iFramer = _dereq_('iframer');

@@ -1344,3 +1344,3 @@

},{"../../lib/analytics":8,"../../lib/bus":12,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/error":18,"../../lib/methods":21,"../../lib/throw-if-no-callback":23,"../../lib/uuid":24,"../shared/constants":27,"../shared/errors":28,"../shared/events":29,"iframer":2}],26:[function(_dereq_,module,exports){
},{"../../lib/analytics":7,"../../lib/braintree-error":8,"../../lib/bus":12,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/methods":21,"../../lib/throw-if-no-callback":23,"../../lib/uuid":24,"../shared/constants":27,"../shared/errors":28,"../shared/events":29,"iframer":2}],26:[function(_dereq_,module,exports){
'use strict';

@@ -1351,3 +1351,3 @@ /** @module braintree-web/three-d-secure */

var browserDetection = _dereq_('../lib/browser-detection');
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var analytics = _dereq_('../lib/analytics');

@@ -1357,4 +1357,4 @@ var throwIfNoCallback = _dereq_('../lib/throw-if-no-callback');

var errors = _dereq_('./shared/errors');
var sharedErrors = _dereq_('../errors');
var VERSION = "3.6.3";
var sharedErrors = _dereq_('../lib/errors');
var VERSION = "3.7.0";

@@ -1430,3 +1430,3 @@ /**

},{"../errors":6,"../lib/analytics":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/error":18,"../lib/throw-if-no-callback":23,"./external/three-d-secure":25,"./shared/errors":28}],27:[function(_dereq_,module,exports){
},{"../lib/analytics":7,"../lib/braintree-error":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/errors":18,"../lib/throw-if-no-callback":23,"./external/three-d-secure":25,"./shared/errors":28}],27:[function(_dereq_,module,exports){
'use strict';

@@ -1441,3 +1441,3 @@

var BraintreeError = _dereq_('../../lib/error');
var BraintreeError = _dereq_('../../lib/braintree-error');

@@ -1476,3 +1476,3 @@ module.exports = {

},{"../../lib/error":18}],29:[function(_dereq_,module,exports){
},{"../../lib/braintree-error":8}],29:[function(_dereq_,module,exports){
'use strict';

@@ -1479,0 +1479,0 @@

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).threeDSecure=e()}}(function(){var e;return function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,r,n){(function(t){"use strict";!function(o,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i("undefined"==typeof t?o:t):"function"==typeof e&&e.amd?e([],function(){return i(o)}):o.framebus=i(o)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(g.push(e),!0)}function r(e){var t,r={};for(t in I)I.hasOwnProperty(t)&&(r[t]=I[t]);return r._origin=e||"*",r}function n(e){var t,r,n=s(this);return a(e)?!1:a(n)?!1:(r=Array.prototype.slice.call(arguments,1),t=c(e,r,n),t===!1?!1:(_(b.top,t,n),!0))}function o(e,t){var r=s(this);return m(e,t,r)?!1:(A[r]=A[r]||{},A[r][e]=A[r][e]||[],A[r][e].push(t),!0)}function i(e,t){var r,n,o=s(this);if(m(e,t,o))return!1;if(n=A[o]&&A[o][e],!n)return!1;for(r=0;r<n.length;r++)if(n[r]===t)return n.splice(r,1),!0;return!1}function s(e){return e&&e._origin||"*"}function a(e){return"string"!=typeof e}function c(e,t,r){var n=!1,o={event:e,origin:r},i=t[t.length-1];"function"==typeof i&&(o.reply=y(i,r),t=t.slice(0,-1)),o.args=t;try{n=R+JSON.stringify(o)}catch(s){throw new Error("Could not stringify event: "+s.message)}return n}function u(e){var t,r,n,o;if(e.data.slice(0,R.length)!==R)return!1;try{t=JSON.parse(e.data.slice(R.length))}catch(i){return!1}return null!=t.reply&&(r=e.origin,n=e.source,o=t.reply,t.reply=function(e){var t=c(o,[e],r);return t===!1?!1:void n.postMessage(t,r)},t.args.push(t.reply)),t}function l(t){b||(b=t||e,b.addEventListener?b.addEventListener("message",p,!1):b.attachEvent?b.attachEvent("onmessage",p):null===b.onmessage?b.onmessage=p:b=null)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}function p(e){var t;a(e.data)||(t=u(e),t&&(d("*",t.event,t.args,e),d(e.origin,t.event,t.args,e),E(e.data,t.origin,e.source)))}function d(e,t,r,n){var o;if(A[e]&&A[e][t])for(o=0;o<A[e][t].length;o++)A[e][t][o].apply(n,r)}function h(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function _(e,t,r){var n;try{for(e.postMessage(t,r),h(e)&&_(e.opener.top,t,r),n=0;n<e.frames.length;n++)_(e.frames[n],t,r)}catch(o){}}function E(e,t,r){var n,o;for(n=g.length-1;n>=0;n--)o=g[n],o.closed===!0?g=g.slice(n,1):r!==o&&_(o.top,e,t)}function y(e,t){function r(o,i){e(o,i),I.target(t).unsubscribe(n,r)}var n=f();return I.target(t).subscribe(n,r),n}function m(e,t,r){return a(e)?!0:"function"!=typeof t?!0:a(r)?!0:!1}var b,I,g=[],A={},R="/*framebus*/";return l(),I={target:r,include:t,publish:n,pub:n,trigger:n,emit:n,subscribe:o,sub:o,on:o,unsubscribe:i,unsub:i,off:i}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){"use strict";var n=e("./lib/set-attributes"),o=e("./lib/default-attributes"),i=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),r=i({},o,e);return r.style&&"string"!=typeof r.style&&(i(t.style,r.style),delete r.style),n(t,r),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":3,"./lib/default-attributes":4,"./lib/set-attributes":5}],3:[function(e,t,r){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}},{}],4:[function(e,t,r){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],5:[function(e,t,r){"use strict";t.exports=function(e,t){var r;for(var n in t)t.hasOwnProperty(n)&&(r=t[n],null==r?e.removeAttribute(n):e.setAttribute(n,r))}},{}],6:[function(e,t,r){"use strict";var n=e("./lib/error");t.exports={CALLBACK_REQUIRED:{type:n.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:n.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:n.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:n.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:n.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":18}],7:[function(e,t,r){"use strict";function n(e,t){var r,n=t?i(t):{},a=o(e.authorization).attrs,c=i(e.analyticsMetadata);n.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION;for(r in n._meta)n._meta.hasOwnProperty(r)&&(c[r]=n._meta[r]);return n._meta=c,a.tokenizationKey?n.tokenizationKey=a.tokenizationKey:n.authorizationFingerprint=a.authorizationFingerprint,n}var o=e("./create-authorization-data"),i=e("./json-clone"),s=e("./constants");t.exports=n},{"./constants":13,"./create-authorization-data":15,"./json-clone":20}],8:[function(e,t,r){"use strict";function n(e){return Math.floor(e/1e3)}function o(e,t,r){var o=e.getConfiguration(),a=e._request,c=n(Date.now()),u=o.gatewayConfiguration.analytics.url,l={analytics:[{kind:i.ANALYTICS_PREFIX+t,timestamp:c}]};a({url:u,method:"post",data:s(o,l),timeout:i.ANALYTICS_REQUEST_TIMEOUT_MS},r)}var i=e("./constants"),s=e("./add-metadata");t.exports={sendEvent:o}},{"./add-metadata":7,"./constants":13}],9:[function(e,t,r){(function(e){"use strict";function r(t){return t=t||e.navigator.userAgent,t.indexOf("Opera Mini")>-1}function n(t){return t=t||e.navigator.userAgent,a(t)&&t.indexOf("Firefox")>-1}function o(t){return t=t||e.navigator.userAgent,-1!==t.indexOf("MSIE")?parseInt(t.replace(/.*MSIE ([0-9]+)\..*/,"$1"),10):/Trident.*rv:11/.test(t)?11:null}function i(t){return t=t||e.location.protocol,"https:"===t}function s(t){return t=t||e.navigator.userAgent,/iPhone|iPod|iPad/.test(t)}function a(t){return t=t||e.navigator.userAgent,/Android/.test(t)}function c(t){return t=t||e.navigator.userAgent,!(l(t)||f(t)||r(t))}function u(e){return/\bGSA\b/.test(e)}function l(t){return t=t||e.navigator.userAgent,s(t)?u(t)?!0:/.+AppleWebKit(?!.*Safari)/.test(t):!1}function f(t){var n=/Version\/[\d\.]+/;return t=t||e.navigator.userAgent,a(t)?n.test(t)&&!r(t):!1}t.exports={isOperaMini:r,isAndroidFirefox:n,getIEVersion:o,isHTTPS:i,isIos:s,isAndroid:a,supportsPopups:c}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(e,t,r){"use strict";function n(e,t){var r,n,i=document.createElement("a");return i.href=t,n="https:"===i.protocol?i.host.replace(/:443$/,""):"http:"===i.protocol?i.host.replace(/:80$/,""):i.host,r=i.protocol+"//"+n,r===e?!0:(i.href=e,o(e))}var o=e("../is-whitelisted-domain");t.exports={checkOrigin:n}},{"../is-whitelisted-domain":19}],11:[function(e,t,r){"use strict";var n=e("../enumerate");t.exports=n(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":17}],12:[function(e,t,r){"use strict";function n(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new a({type:a.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var o=e("framebus"),i=e("./events"),s=e("./check-origin").checkOrigin,a=e("../error");n.prototype.on=function(e,t){var r,n,i=t,a=this;this._isDestroyed||(this.merchantUrl&&(i=function(){s(this.origin,a.merchantUrl)&&t.apply(this,arguments)}),r=this._namespaceEvent(e),n=Array.prototype.slice.call(arguments),n[0]=r,n[1]=i,this._log("on",n),o.on.apply(o,n),this._listeners.push({eventName:e,handler:i,originalHandler:t}))},n.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),o.emit.apply(o,t))},n.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),o.off.apply(o,t))},n.prototype.off=function(e,t){var r,n,o=t;if(!this._isDestroyed){if(this.merchantUrl)for(r=0;r<this._listeners.length;r++)n=this._listeners[r],n.originalHandler===t&&(o=n.handler);this._offDirect(e,o)}},n.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},n.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},n.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},n.events=i,t.exports=n},{"../error":18,"./check-origin":10,"./events":11,framebus:1}],13:[function(e,t,r){"use strict";var n="3.6.3",o="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:n,INTEGRATION:"custom",SOURCE:"client",PLATFORM:o,BRAINTREE_LIBRARY_VERSION:"braintree/"+o+"/"+n}},{}],14:[function(e,t,r){"use strict";var n=e("./error"),o=e("../errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new n({type:o.METHOD_CALLED_AFTER_TEARDOWN.type,code:o.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../errors":6,"./error":18}],15:[function(e,t,r){"use strict";function n(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function o(e){var t=e.split("_"),r=t[0],n=t.slice(2).join("_");return{merchantId:n,environment:r}}function i(e){var t,r,i={attrs:{},configUrl:""};return n(e)?(r=o(e),i.attrs.tokenizationKey=e,i.configUrl=a[r.environment]+"/merchants/"+r.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(s(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var s=e("../lib/polyfill").atob,a={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":22}],16:[function(e,t,r){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],17:[function(e,t,r){"use strict";function n(e,t){return t=null==t?"":t,e.reduce(function(e,r){return e[r]=t+r,e},{})}t.exports=n},{}],18:[function(e,t,r){"use strict";function n(e){if(!n.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=n},{"./enumerate":17}],19:[function(e,t,r){"use strict";function n(e){return e.split(".").slice(-2).join(".")}function o(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(i=i||document.createElement("a"),i.href=e,t=n(i.hostname),s.hasOwnProperty(t)):!1}var i,s={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=o},{}],20:[function(e,t,r){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],21:[function(e,t,r){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],22:[function(e,t,r){(function(e){"use strict";function r(e){var t,r,n,o,i,s,a,c,u=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";if(!u.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do o=l.indexOf(e.charAt(c++)),i=l.indexOf(e.charAt(c++)),s=l.indexOf(e.charAt(c++)),a=l.indexOf(e.charAt(c++)),t=(63&o)<<2|i>>4&3,r=(15&i)<<4|s>>2&15,n=(3&s)<<6|63&a,f+=String.fromCharCode(t)+(r?String.fromCharCode(r):"")+(n?String.fromCharCode(n):"");while(c<e.length);return f}var n="function"==typeof e.atob?e.atob:r;t.exports={atob:n,_atob:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,r){"use strict";var n=e("./error"),o=e("../errors");t.exports=function(e,t){if("function"!=typeof e)throw new n({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../errors":6,"./error":18}],24:[function(e,t,r){"use strict";function n(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}t.exports=n},{}],25:[function(e,t,r){"use strict";function n(e){this._options=e,this._assetsUrl=e.client.getConfiguration().gatewayConfiguration.assetsUrl,this._client=e.client}var o=e("../../lib/error"),i=e("../../lib/analytics"),s=e("../../lib/methods"),a=e("../../lib/convert-methods-to-error"),c=e("../shared/constants"),u=e("../../lib/bus"),l=e("../../lib/uuid"),f=e("../../lib/deferred"),p=e("../shared/errors"),d=e("../../lib/throw-if-no-callback"),h=e("../shared/events"),_="3.6.3",E=e("iframer"),y=400,m=400;n.prototype.verifyCard=function(e,t){var r,n,i,s,a;return d(t,"verifyCard"),e=e||{},t=f(t),this._verifyCardInProgress===!0?s=p.THREEDS_AUTHENTICATION_IN_PROGRESS:e.nonce?e.amount?"function"!=typeof e.addFrame?a="an addFrame function":"function"!=typeof e.removeFrame&&(a="a removeFrame function"):a="an amount":a="a nonce",a&&(s={type:p.THREEDS_MISSING_VERIFY_CARD_OPTION.type,code:p.THREEDS_MISSING_VERIFY_CARD_OPTION.code,message:"verifyCard options must include "+a+"."}),s?void t(new o(s)):(this._verifyCardInProgress=!0,n=f(e.addFrame),i=f(e.removeFrame),r="payment_methods/"+e.nonce+"/three_d_secure/lookup",void this._client.request({endpoint:r,method:"post",data:{amount:e.amount}},function(e,r){return e?(this._verifyCardInProgress=!1,void t(e)):(this._lookupPaymentMethod=r.paymentMethod,this._verifyCardCallback=function(){this._verifyCardInProgress=!1,t.apply(null,arguments)}.bind(this),void this._handleLookupResponse({lookupResponse:r,addFrame:n,removeFrame:i}))}.bind(this)))},n.prototype.cancelVerifyCard=function(e){var t;this._verifyCardInProgress=!1,"function"==typeof e&&(this._lookupPaymentMethod||(t=new o(p.THREEDS_NO_VERIFICATION_PAYLOAD)),e(t,this._lookupPaymentMethod))},n.prototype._handleLookupResponse=function(e){var t=e.lookupResponse;t.lookup&&t.lookup.acsUrl&&t.lookup.acsUrl.length>0?e.addFrame(null,this._createIframe({response:t.lookup,removeFrame:e.removeFrame})):this._verifyCardCallback(null,{nonce:t.paymentMethod.nonce,verificationDetails:t.threeDSecureInfo})},n.prototype._createIframe=function(e){var t,r,n=window.location.href,o=e.response;return this._bus=new u({channel:l(),merchantUrl:location.href}),r=this._assetsUrl+"/web/"+_+"/html/three-d-secure-authentication-complete-frame.html?channel="+encodeURIComponent(this._bus.channel)+"&",n.indexOf("#")>-1&&(n=n.split("#")[0]),this._bus.on(u.events.CONFIGURATION_REQUEST,function(e){e({acsUrl:o.acsUrl,pareq:o.pareq,termUrl:o.termUrl+"&three_d_secure_version="+_+"&authentication_complete_base_url="+encodeURIComponent(r),md:o.md,parentUrl:n})}),this._bus.on(h.AUTHENTICATION_COMPLETE,function(t){this._handleAuthResponse(t,e)}.bind(this)),t=this._assetsUrl+"/web/"+_+"/html/three-d-secure-bank-frame.min.html",this._bankIframe=E({src:t,height:y,width:m,name:c.LANDING_FRAME_NAME+"_"+this._bus.channel}),this._bankIframe},n.prototype._handleAuthResponse=function(e,t){var r=JSON.parse(e.auth_response);this._bus.teardown(),t.removeFrame(),f(function(){r.success?this._verifyCardCallback(null,this._formatAuthResponse(r.paymentMethod,r.threeDSecureInfo)):r.threeDSecureInfo&&r.threeDSecureInfo.liabilityShiftPossible?this._verifyCardCallback(null,this._formatAuthResponse(this._lookupPaymentMethod,r.threeDSecureInfo)):this._verifyCardCallback(new o({type:o.types.UNKNOWN,code:"UNKNOWN_AUTH_RESPONSE",message:r.error.message}))}.bind(this))()},n.prototype._formatAuthResponse=function(e,t){return{nonce:e.nonce,details:e.details,description:e.description,liabilityShifted:t.liabilityShifted,liabilityShiftPossible:t.liabilityShiftPossible}},n.prototype.teardown=function(e){var t;a(this,s(n.prototype)),i.sendEvent(this._options.client,"threedsecure.teardown-completed"),this._bus&&this._bus.teardown(),this._bankIframe&&(t=this._bankIframe.parentNode,t&&t.removeChild(this._bankIframe)),"function"==typeof e&&(e=f(e))()},t.exports=n},{"../../lib/analytics":8,"../../lib/bus":12,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/error":18,"../../lib/methods":21,"../../lib/throw-if-no-callback":23,"../../lib/uuid":24,"../shared/constants":27,"../shared/errors":28,"../shared/events":29,iframer:2}],26:[function(e,t,r){"use strict";function n(e,t){var r,n,d,h;if(c(t,"create"),t=u(t),null==e.client)return void t(new s({type:f.INSTANTIATION_OPTION_REQUIRED.type,code:f.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating 3D Secure."}));if(r=e.client.getConfiguration(),h=r.analyticsMetadata.sdkVersion,r.gatewayConfiguration.threeDSecureEnabled?r.analyticsMetadata.sdkVersion!==p?d={type:f.INCOMPATIBLE_VERSIONS.type,code:f.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+h+") and 3D Secure (version "+p+") components must be from the same SDK version."}:i.isHTTPS()||(d=l.THREEDS_HTTPS_REQUIRED):d=l.THREEDS_NOT_ENABLED,d)return void t(new s(d));a.sendEvent(e.client,"threedsecure.initialized");try{n=new o(e)}catch(_){return void t(_)}t(null,n)}var o=e("./external/three-d-secure"),i=e("../lib/browser-detection"),s=e("../lib/error"),a=e("../lib/analytics"),c=e("../lib/throw-if-no-callback"),u=e("../lib/deferred"),l=e("./shared/errors"),f=e("../errors"),p="3.6.3";t.exports={create:n,VERSION:p}},{"../errors":6,"../lib/analytics":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/error":18,"../lib/throw-if-no-callback":23,"./external/three-d-secure":25,"./shared/errors":28}],27:[function(e,t,r){"use strict";t.exports={LANDING_FRAME_NAME:"braintreethreedsecurelanding"}},{}],28:[function(e,t,r){"use strict";var n=e("../../lib/error");t.exports={THREEDS_AUTHENTICATION_IN_PROGRESS:{type:n.types.MERCHANT,code:"THREEDS_AUTHENTICATION_IN_PROGRESS",message:"Cannot call verifyCard while existing authentication is in progress."},THREEDS_MISSING_VERIFY_CARD_OPTION:{type:n.types.MERCHANT,code:"THREEDS_MISSING_VERIFY_CARD_OPTION"},THREEDS_NO_VERIFICATION_PAYLOAD:{type:n.types.MERCHANT,code:"THREEDS_NO_VERIFICATION_PAYLOAD",message:"No verification payload available."},THREEDS_NOT_ENABLED:{type:n.types.MERCHANT,code:"THREEDS_NOT_ENABLED",message:"3D Secure is not enabled for this merchant."},THREEDS_HTTPS_REQUIRED:{type:n.types.MERCHANT,code:"THREEDS_HTTPS_REQUIRED",message:"3D Secure requires HTTPS."},THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN:{type:n.types.INTERNAL,code:"THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN",message:"Term Url must be on a Braintree domain."}}},{"../../lib/error":18}],29:[function(e,t,r){"use strict";var n=e("../../lib/enumerate");t.exports=n(["AUTHENTICATION_COMPLETE"],"threedsecure:")},{"../../lib/enumerate":17}]},{},[26])(26)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).threeDSecure=e()}}(function(){var e;return function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[s]={exports:{}};e[s][0].call(l.exports,function(t){var r=e[s][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[s].exports}for(var i="function"==typeof require&&require,s=0;s<n.length;s++)o(n[s]);return o}({1:[function(t,r,n){(function(t){"use strict";!function(o,i){"object"==typeof n&&"undefined"!=typeof r?r.exports=i("undefined"==typeof t?o:t):"function"==typeof e&&e.amd?e([],function(){return i(o)}):o.framebus=i(o)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(g.push(e),!0)}function r(e){var t,r={};for(t in I)I.hasOwnProperty(t)&&(r[t]=I[t]);return r._origin=e||"*",r}function n(e){var t,r,n=s(this);return a(e)?!1:a(n)?!1:(r=Array.prototype.slice.call(arguments,1),t=c(e,r,n),t===!1?!1:(_(b.top,t,n),!0))}function o(e,t){var r=s(this);return m(e,t,r)?!1:(A[r]=A[r]||{},A[r][e]=A[r][e]||[],A[r][e].push(t),!0)}function i(e,t){var r,n,o=s(this);if(m(e,t,o))return!1;if(n=A[o]&&A[o][e],!n)return!1;for(r=0;r<n.length;r++)if(n[r]===t)return n.splice(r,1),!0;return!1}function s(e){return e&&e._origin||"*"}function a(e){return"string"!=typeof e}function c(e,t,r){var n=!1,o={event:e,origin:r},i=t[t.length-1];"function"==typeof i&&(o.reply=y(i,r),t=t.slice(0,-1)),o.args=t;try{n=R+JSON.stringify(o)}catch(s){throw new Error("Could not stringify event: "+s.message)}return n}function u(e){var t,r,n,o;if(e.data.slice(0,R.length)!==R)return!1;try{t=JSON.parse(e.data.slice(R.length))}catch(i){return!1}return null!=t.reply&&(r=e.origin,n=e.source,o=t.reply,t.reply=function(e){var t=c(o,[e],r);return t===!1?!1:void n.postMessage(t,r)},t.args.push(t.reply)),t}function l(t){b||(b=t||e,b.addEventListener?b.addEventListener("message",p,!1):b.attachEvent?b.attachEvent("onmessage",p):null===b.onmessage?b.onmessage=p:b=null)}function f(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}function p(e){var t;a(e.data)||(t=u(e),t&&(d("*",t.event,t.args,e),d(e.origin,t.event,t.args,e),E(e.data,t.origin,e.source)))}function d(e,t,r,n){var o;if(A[e]&&A[e][t])for(o=0;o<A[e][t].length;o++)A[e][t][o].apply(n,r)}function h(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function _(e,t,r){var n;try{for(e.postMessage(t,r),h(e)&&_(e.opener.top,t,r),n=0;n<e.frames.length;n++)_(e.frames[n],t,r)}catch(o){}}function E(e,t,r){var n,o;for(n=g.length-1;n>=0;n--)o=g[n],o.closed===!0?g=g.slice(n,1):r!==o&&_(o.top,e,t)}function y(e,t){function r(o,i){e(o,i),I.target(t).unsubscribe(n,r)}var n=f();return I.target(t).subscribe(n,r),n}function m(e,t,r){return a(e)?!0:"function"!=typeof t?!0:a(r)?!0:!1}var b,I,g=[],A={},R="/*framebus*/";return l(),I={target:r,include:t,publish:n,pub:n,trigger:n,emit:n,subscribe:o,sub:o,on:o,unsubscribe:i,unsub:i,off:i}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){"use strict";var n=e("./lib/set-attributes"),o=e("./lib/default-attributes"),i=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),r=i({},o,e);return r.style&&"string"!=typeof r.style&&(i(t.style,r.style),delete r.style),n(t,r),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":3,"./lib/default-attributes":4,"./lib/set-attributes":5}],3:[function(e,t,r){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(r){e[r]=t[r]})}),e}},{}],4:[function(e,t,r){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],5:[function(e,t,r){"use strict";t.exports=function(e,t){var r;for(var n in t)t.hasOwnProperty(n)&&(r=t[n],null==r?e.removeAttribute(n):e.setAttribute(n,r))}},{}],6:[function(e,t,r){"use strict";function n(e,t){var r,n=t?i(t):{},a=o(e.authorization).attrs,c=i(e.analyticsMetadata);n.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION;for(r in n._meta)n._meta.hasOwnProperty(r)&&(c[r]=n._meta[r]);return n._meta=c,a.tokenizationKey?n.tokenizationKey=a.tokenizationKey:n.authorizationFingerprint=a.authorizationFingerprint,n}var o=e("./create-authorization-data"),i=e("./json-clone"),s=e("./constants");t.exports=n},{"./constants":13,"./create-authorization-data":15,"./json-clone":20}],7:[function(e,t,r){"use strict";function n(e){return Math.floor(e/1e3)}function o(e,t,r){var o=e.getConfiguration(),a=e._request,c=n(Date.now()),u=o.gatewayConfiguration.analytics.url,l={analytics:[{kind:i.ANALYTICS_PREFIX+t,timestamp:c}]};a({url:u,method:"post",data:s(o,l),timeout:i.ANALYTICS_REQUEST_TIMEOUT_MS},r)}var i=e("./constants"),s=e("./add-metadata");t.exports={sendEvent:o}},{"./add-metadata":6,"./constants":13}],8:[function(e,t,r){"use strict";function n(e){if(!n.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var o=e("./enumerate");n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n.types=o(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=n},{"./enumerate":17}],9:[function(e,t,r){(function(e){"use strict";function r(t){return t=t||e.navigator.userAgent,t.indexOf("Opera Mini")>-1}function n(t){return t=t||e.navigator.userAgent,a(t)&&t.indexOf("Firefox")>-1}function o(t){return t=t||e.navigator.userAgent,-1!==t.indexOf("MSIE")?parseInt(t.replace(/.*MSIE ([0-9]+)\..*/,"$1"),10):/Trident.*rv:11/.test(t)?11:null}function i(t){return t=t||e.location.protocol,"https:"===t}function s(t){return t=t||e.navigator.userAgent,/iPhone|iPod|iPad/.test(t)}function a(t){return t=t||e.navigator.userAgent,/Android/.test(t)}function c(t){return t=t||e.navigator.userAgent,!(l(t)||f(t)||r(t))}function u(e){return/\bGSA\b/.test(e)}function l(t){return t=t||e.navigator.userAgent,s(t)?u(t)?!0:/.+AppleWebKit(?!.*Safari)/.test(t):!1}function f(t){var n=/Version\/[\d\.]+/;return t=t||e.navigator.userAgent,a(t)?n.test(t)&&!r(t):!1}t.exports={isOperaMini:r,isAndroidFirefox:n,getIEVersion:o,isHTTPS:i,isIos:s,isAndroid:a,supportsPopups:c}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],10:[function(e,t,r){"use strict";function n(e,t){var r,n,i=document.createElement("a");return i.href=t,n="https:"===i.protocol?i.host.replace(/:443$/,""):"http:"===i.protocol?i.host.replace(/:80$/,""):i.host,r=i.protocol+"//"+n,r===e?!0:(i.href=e,o(e))}var o=e("../is-whitelisted-domain");t.exports={checkOrigin:n}},{"../is-whitelisted-domain":19}],11:[function(e,t,r){"use strict";var n=e("../enumerate");t.exports=n(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":17}],12:[function(e,t,r){"use strict";function n(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new a({type:a.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var o=e("framebus"),i=e("./events"),s=e("./check-origin").checkOrigin,a=e("../braintree-error");n.prototype.on=function(e,t){var r,n,i=t,a=this;this._isDestroyed||(this.merchantUrl&&(i=function(){s(this.origin,a.merchantUrl)&&t.apply(this,arguments)}),r=this._namespaceEvent(e),n=Array.prototype.slice.call(arguments),n[0]=r,n[1]=i,this._log("on",n),o.on.apply(o,n),this._listeners.push({eventName:e,handler:i,originalHandler:t}))},n.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),o.emit.apply(o,t))},n.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),o.off.apply(o,t))},n.prototype.off=function(e,t){var r,n,o=t;if(!this._isDestroyed){if(this.merchantUrl)for(r=0;r<this._listeners.length;r++)n=this._listeners[r],n.originalHandler===t&&(o=n.handler);this._offDirect(e,o)}},n.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},n.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},n.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},n.events=i,t.exports=n},{"../braintree-error":8,"./check-origin":10,"./events":11,framebus:1}],13:[function(e,t,r){"use strict";var n="3.7.0",o="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:n,INTEGRATION:"custom",SOURCE:"client",PLATFORM:o,BRAINTREE_LIBRARY_VERSION:"braintree/"+o+"/"+n}},{}],14:[function(e,t,r){"use strict";var n=e("./braintree-error"),o=e("../lib/errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new n({type:o.METHOD_CALLED_AFTER_TEARDOWN.type,code:o.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../lib/errors":18,"./braintree-error":8}],15:[function(e,t,r){"use strict";function n(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function o(e){var t=e.split("_"),r=t[0],n=t.slice(2).join("_");return{merchantId:n,environment:r}}function i(e){var t,r,i={attrs:{},configUrl:""};return n(e)?(r=o(e),i.attrs.tokenizationKey=e,i.configUrl=a[r.environment]+"/merchants/"+r.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(s(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var s=e("../lib/polyfill").atob,a={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":22}],16:[function(e,t,r){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],17:[function(e,t,r){"use strict";function n(e,t){return t=null==t?"":t,e.reduce(function(e,r){return e[r]=t+r,e},{})}t.exports=n},{}],18:[function(e,t,r){"use strict";var n=e("./braintree-error");t.exports={CALLBACK_REQUIRED:{type:n.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:n.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:n.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:n.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:n.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":8}],19:[function(e,t,r){"use strict";function n(e){return e.split(".").slice(-2).join(".")}function o(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(i=i||document.createElement("a"),i.href=e,t=n(i.hostname),s.hasOwnProperty(t)):!1}var i,s={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=o},{}],20:[function(e,t,r){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],21:[function(e,t,r){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],22:[function(e,t,r){(function(e){"use strict";function r(e){var t,r,n,o,i,s,a,c,u=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",f="";if(!u.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do o=l.indexOf(e.charAt(c++)),i=l.indexOf(e.charAt(c++)),s=l.indexOf(e.charAt(c++)),a=l.indexOf(e.charAt(c++)),t=(63&o)<<2|i>>4&3,r=(15&i)<<4|s>>2&15,n=(3&s)<<6|63&a,f+=String.fromCharCode(t)+(r?String.fromCharCode(r):"")+(n?String.fromCharCode(n):"");while(c<e.length);return f}var n="function"==typeof e.atob?e.atob:r;t.exports={atob:n,_atob:r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],23:[function(e,t,r){"use strict";var n=e("./braintree-error"),o=e("../lib/errors");t.exports=function(e,t){if("function"!=typeof e)throw new n({type:o.CALLBACK_REQUIRED.type,code:o.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../lib/errors":18,"./braintree-error":8}],24:[function(e,t,r){"use strict";function n(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,r="x"===e?t:3&t|8;return r.toString(16)})}t.exports=n},{}],25:[function(e,t,r){"use strict";function n(e){this._options=e,this._assetsUrl=e.client.getConfiguration().gatewayConfiguration.assetsUrl,this._client=e.client}var o=e("../../lib/braintree-error"),i=e("../../lib/analytics"),s=e("../../lib/methods"),a=e("../../lib/convert-methods-to-error"),c=e("../shared/constants"),u=e("../../lib/bus"),l=e("../../lib/uuid"),f=e("../../lib/deferred"),p=e("../shared/errors"),d=e("../../lib/throw-if-no-callback"),h=e("../shared/events"),_="3.7.0",E=e("iframer"),y=400,m=400;n.prototype.verifyCard=function(e,t){var r,n,i,s,a;return d(t,"verifyCard"),e=e||{},t=f(t),this._verifyCardInProgress===!0?s=p.THREEDS_AUTHENTICATION_IN_PROGRESS:e.nonce?e.amount?"function"!=typeof e.addFrame?a="an addFrame function":"function"!=typeof e.removeFrame&&(a="a removeFrame function"):a="an amount":a="a nonce",a&&(s={type:p.THREEDS_MISSING_VERIFY_CARD_OPTION.type,code:p.THREEDS_MISSING_VERIFY_CARD_OPTION.code,message:"verifyCard options must include "+a+"."}),s?void t(new o(s)):(this._verifyCardInProgress=!0,n=f(e.addFrame),i=f(e.removeFrame),r="payment_methods/"+e.nonce+"/three_d_secure/lookup",void this._client.request({endpoint:r,method:"post",data:{amount:e.amount}},function(e,r){return e?(this._verifyCardInProgress=!1,void t(e)):(this._lookupPaymentMethod=r.paymentMethod,this._verifyCardCallback=function(){this._verifyCardInProgress=!1,t.apply(null,arguments)}.bind(this),void this._handleLookupResponse({lookupResponse:r,addFrame:n,removeFrame:i}))}.bind(this)))},n.prototype.cancelVerifyCard=function(e){var t;this._verifyCardInProgress=!1,"function"==typeof e&&(this._lookupPaymentMethod||(t=new o(p.THREEDS_NO_VERIFICATION_PAYLOAD)),e(t,this._lookupPaymentMethod))},n.prototype._handleLookupResponse=function(e){var t=e.lookupResponse;t.lookup&&t.lookup.acsUrl&&t.lookup.acsUrl.length>0?e.addFrame(null,this._createIframe({response:t.lookup,removeFrame:e.removeFrame})):this._verifyCardCallback(null,{nonce:t.paymentMethod.nonce,verificationDetails:t.threeDSecureInfo})},n.prototype._createIframe=function(e){var t,r,n=window.location.href,o=e.response;return this._bus=new u({channel:l(),merchantUrl:location.href}),r=this._assetsUrl+"/web/"+_+"/html/three-d-secure-authentication-complete-frame.html?channel="+encodeURIComponent(this._bus.channel)+"&",n.indexOf("#")>-1&&(n=n.split("#")[0]),this._bus.on(u.events.CONFIGURATION_REQUEST,function(e){e({acsUrl:o.acsUrl,pareq:o.pareq,termUrl:o.termUrl+"&three_d_secure_version="+_+"&authentication_complete_base_url="+encodeURIComponent(r),md:o.md,parentUrl:n})}),this._bus.on(h.AUTHENTICATION_COMPLETE,function(t){this._handleAuthResponse(t,e)}.bind(this)),t=this._assetsUrl+"/web/"+_+"/html/three-d-secure-bank-frame.min.html",this._bankIframe=E({src:t,height:y,width:m,name:c.LANDING_FRAME_NAME+"_"+this._bus.channel}),this._bankIframe},n.prototype._handleAuthResponse=function(e,t){var r=JSON.parse(e.auth_response);this._bus.teardown(),t.removeFrame(),f(function(){r.success?this._verifyCardCallback(null,this._formatAuthResponse(r.paymentMethod,r.threeDSecureInfo)):r.threeDSecureInfo&&r.threeDSecureInfo.liabilityShiftPossible?this._verifyCardCallback(null,this._formatAuthResponse(this._lookupPaymentMethod,r.threeDSecureInfo)):this._verifyCardCallback(new o({type:o.types.UNKNOWN,code:"UNKNOWN_AUTH_RESPONSE",message:r.error.message}))}.bind(this))()},n.prototype._formatAuthResponse=function(e,t){return{nonce:e.nonce,details:e.details,description:e.description,liabilityShifted:t.liabilityShifted,liabilityShiftPossible:t.liabilityShiftPossible}},n.prototype.teardown=function(e){var t;a(this,s(n.prototype)),i.sendEvent(this._options.client,"threedsecure.teardown-completed"),this._bus&&this._bus.teardown(),this._bankIframe&&(t=this._bankIframe.parentNode,t&&t.removeChild(this._bankIframe)),"function"==typeof e&&(e=f(e))()},t.exports=n},{"../../lib/analytics":7,"../../lib/braintree-error":8,"../../lib/bus":12,"../../lib/convert-methods-to-error":14,"../../lib/deferred":16,"../../lib/methods":21,"../../lib/throw-if-no-callback":23,"../../lib/uuid":24,"../shared/constants":27,"../shared/errors":28,"../shared/events":29,iframer:2}],26:[function(e,t,r){"use strict";function n(e,t){var r,n,d,h;if(c(t,"create"),t=u(t),null==e.client)return void t(new s({type:f.INSTANTIATION_OPTION_REQUIRED.type,code:f.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating 3D Secure."}));if(r=e.client.getConfiguration(),h=r.analyticsMetadata.sdkVersion,r.gatewayConfiguration.threeDSecureEnabled?r.analyticsMetadata.sdkVersion!==p?d={type:f.INCOMPATIBLE_VERSIONS.type,code:f.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+h+") and 3D Secure (version "+p+") components must be from the same SDK version."}:i.isHTTPS()||(d=l.THREEDS_HTTPS_REQUIRED):d=l.THREEDS_NOT_ENABLED,d)return void t(new s(d));a.sendEvent(e.client,"threedsecure.initialized");try{n=new o(e)}catch(_){return void t(_)}t(null,n)}var o=e("./external/three-d-secure"),i=e("../lib/browser-detection"),s=e("../lib/braintree-error"),a=e("../lib/analytics"),c=e("../lib/throw-if-no-callback"),u=e("../lib/deferred"),l=e("./shared/errors"),f=e("../lib/errors"),p="3.7.0";t.exports={create:n,VERSION:p}},{"../lib/analytics":7,"../lib/braintree-error":8,"../lib/browser-detection":9,"../lib/deferred":16,"../lib/errors":18,"../lib/throw-if-no-callback":23,"./external/three-d-secure":25,"./shared/errors":28}],27:[function(e,t,r){"use strict";t.exports={LANDING_FRAME_NAME:"braintreethreedsecurelanding"}},{}],28:[function(e,t,r){"use strict";var n=e("../../lib/braintree-error");t.exports={THREEDS_AUTHENTICATION_IN_PROGRESS:{type:n.types.MERCHANT,code:"THREEDS_AUTHENTICATION_IN_PROGRESS",message:"Cannot call verifyCard while existing authentication is in progress."},THREEDS_MISSING_VERIFY_CARD_OPTION:{type:n.types.MERCHANT,code:"THREEDS_MISSING_VERIFY_CARD_OPTION"},THREEDS_NO_VERIFICATION_PAYLOAD:{type:n.types.MERCHANT,code:"THREEDS_NO_VERIFICATION_PAYLOAD",message:"No verification payload available."},THREEDS_NOT_ENABLED:{type:n.types.MERCHANT,code:"THREEDS_NOT_ENABLED",message:"3D Secure is not enabled for this merchant."},THREEDS_HTTPS_REQUIRED:{type:n.types.MERCHANT,code:"THREEDS_HTTPS_REQUIRED",message:"3D Secure requires HTTPS."},THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN:{type:n.types.INTERNAL,code:"THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN",message:"Term Url must be on a Braintree domain."}}},{"../../lib/braintree-error":8}],29:[function(e,t,r){"use strict";var n=e("../../lib/enumerate");t.exports=n(["AUTHENTICATION_COMPLETE"],"threedsecure:")},{"../../lib/enumerate":17}]},{},[26])(26)});

@@ -351,31 +351,2 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).unionpay = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){

var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":17}],7:[function(_dereq_,module,exports){
'use strict';
var createAuthorizationData = _dereq_('./create-authorization-data');

@@ -412,3 +383,3 @@ var jsonClone = _dereq_('./json-clone');

},{"./constants":12,"./create-authorization-data":14,"./json-clone":19}],8:[function(_dereq_,module,exports){
},{"./constants":12,"./create-authorization-data":14,"./json-clone":19}],7:[function(_dereq_,module,exports){
'use strict';

@@ -447,5 +418,82 @@

},{"./add-metadata":7,"./constants":12}],9:[function(_dereq_,module,exports){
},{"./add-metadata":6,"./constants":12}],8:[function(_dereq_,module,exports){
'use strict';
var enumerate = _dereq_('./enumerate');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
}
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":16}],9:[function(_dereq_,module,exports){
'use strict';
var isWhitelistedDomain = _dereq_('../is-whitelisted-domain');

@@ -495,3 +543,3 @@

var checkOrigin = _dereq_('./check-origin').checkOrigin;
var BraintreeError = _dereq_('../error');
var BraintreeError = _dereq_('../braintree-error');

@@ -621,6 +669,6 @@ function BraintreeBus(options) {

},{"../error":17,"./check-origin":9,"./events":10,"framebus":1}],12:[function(_dereq_,module,exports){
},{"../braintree-error":8,"./check-origin":9,"./events":10,"framebus":1}],12:[function(_dereq_,module,exports){
'use strict';
var VERSION = "3.6.3";
var VERSION = "3.7.0";
var PLATFORM = 'web';

@@ -642,4 +690,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -658,3 +706,3 @@ module.exports = function (instance, methodNames) {

},{"../errors":6,"./error":17}],14:[function(_dereq_,module,exports){
},{"../lib/errors":17,"./braintree-error":8}],14:[function(_dereq_,module,exports){
'use strict';

@@ -739,77 +787,29 @@

var enumerate = _dereq_('./enumerate');
var BraintreeError = _dereq_('./braintree-error');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":16}],18:[function(_dereq_,module,exports){
},{"./braintree-error":8}],18:[function(_dereq_,module,exports){
'use strict';

@@ -906,4 +906,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -920,3 +920,3 @@ module.exports = function (callback, functionName) {

},{"../errors":6,"./error":17}],23:[function(_dereq_,module,exports){
},{"../lib/errors":17,"./braintree-error":8}],23:[function(_dereq_,module,exports){
'use strict';

@@ -943,3 +943,3 @@

var UnionPay = _dereq_('./shared/unionpay');
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var analytics = _dereq_('../lib/analytics');

@@ -949,4 +949,4 @@ var deferred = _dereq_('../lib/deferred');

var errors = _dereq_('./shared/errors');
var sharedErrors = _dereq_('../errors');
var VERSION = "3.6.3";
var sharedErrors = _dereq_('../lib/errors');
var VERSION = "3.7.0";

@@ -1016,3 +1016,3 @@ /**

},{"../errors":6,"../lib/analytics":8,"../lib/deferred":15,"../lib/error":17,"../lib/throw-if-no-callback":22,"./shared/errors":26,"./shared/unionpay":27}],25:[function(_dereq_,module,exports){
},{"../lib/analytics":7,"../lib/braintree-error":8,"../lib/deferred":15,"../lib/errors":17,"../lib/throw-if-no-callback":22,"./shared/errors":26,"./shared/unionpay":27}],25:[function(_dereq_,module,exports){
'use strict';

@@ -1034,3 +1034,3 @@

var BraintreeError = _dereq_('../../lib/error');
var BraintreeError = _dereq_('../../lib/braintree-error');

@@ -1100,7 +1100,7 @@ module.exports = {

},{"../../lib/error":17}],27:[function(_dereq_,module,exports){
},{"../../lib/braintree-error":8}],27:[function(_dereq_,module,exports){
'use strict';
var analytics = _dereq_('../../lib/analytics');
var BraintreeError = _dereq_('../../lib/error');
var BraintreeError = _dereq_('../../lib/braintree-error');
var Bus = _dereq_('../../lib/bus');

@@ -1114,3 +1114,3 @@ var constants = _dereq_('./constants');

var methods = _dereq_('../../lib/methods');
var VERSION = "3.6.3";
var VERSION = "3.7.0";
var uuid = _dereq_('../../lib/uuid');

@@ -1643,3 +1643,3 @@ var throwIfNoCallback = _dereq_('../../lib/throw-if-no-callback');

},{"../../lib/analytics":8,"../../lib/bus":11,"../../lib/convert-methods-to-error":13,"../../lib/deferred":15,"../../lib/error":17,"../../lib/methods":20,"../../lib/throw-if-no-callback":22,"../../lib/uuid":23,"./constants":25,"./errors":26,"iframer":2}]},{},[24])(24)
},{"../../lib/analytics":7,"../../lib/braintree-error":8,"../../lib/bus":11,"../../lib/convert-methods-to-error":13,"../../lib/deferred":15,"../../lib/methods":20,"../../lib/throw-if-no-callback":22,"../../lib/uuid":23,"./constants":25,"./errors":26,"iframer":2}]},{},[24])(24)
});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).unionpay=e()}}(function(){var e;return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,n,r){(function(t){"use strict";!function(i,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o("undefined"==typeof t?i:t):"function"==typeof e&&e.amd?e([],function(){return o(i)}):i.framebus=o(i)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(O.push(e),!0)}function n(e){var t,n={};for(t in y)y.hasOwnProperty(t)&&(n[t]=y[t]);return n._origin=e||"*",n}function r(e){var t,n,r=s(this);return a(e)?!1:a(r)?!1:(n=Array.prototype.slice.call(arguments,1),t=u(e,n,r),t===!1?!1:(f(A.top,t,r),!0))}function i(e,t){var n=s(this);return h(e,t,n)?!1:(T[n]=T[n]||{},T[n][e]=T[n][e]||[],T[n][e].push(t),!0)}function o(e,t){var n,r,i=s(this);if(h(e,t,i))return!1;if(r=T[i]&&T[i][e],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===t)return r.splice(n,1),!0;return!1}function s(e){return e&&e._origin||"*"}function a(e){return"string"!=typeof e}function u(e,t,n){var r=!1,i={event:e,origin:n},o=t[t.length-1];"function"==typeof o&&(i.reply=I(o,n),t=t.slice(0,-1)),i.args=t;try{r=m+JSON.stringify(i)}catch(s){throw new Error("Could not stringify event: "+s.message)}return r}function c(e){var t,n,r,i;if(e.data.slice(0,m.length)!==m)return!1;try{t=JSON.parse(e.data.slice(m.length))}catch(o){return!1}return null!=t.reply&&(n=e.origin,r=e.source,i=t.reply,t.reply=function(e){var t=u(i,[e],n);return t===!1?!1:void r.postMessage(t,n)},t.args.push(t.reply)),t}function l(t){A||(A=t||e,A.addEventListener?A.addEventListener("message",E,!1):A.attachEvent?A.attachEvent("onmessage",E):null===A.onmessage?A.onmessage=E:A=null)}function d(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}function E(e){var t;a(e.data)||(t=c(e),t&&(_("*",t.event,t.args,e),_(e.origin,t.event,t.args,e),N(e.data,t.origin,e.source)))}function _(e,t,n,r){var i;if(T[e]&&T[e][t])for(i=0;i<T[e][t].length;i++)T[e][t][i].apply(r,n)}function p(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function f(e,t,n){var r;try{for(e.postMessage(t,n),p(e)&&f(e.opener.top,t,n),r=0;r<e.frames.length;r++)f(e.frames[r],t,n)}catch(i){}}function N(e,t,n){var r,i;for(r=O.length-1;r>=0;r--)i=O[r],i.closed===!0?O=O.slice(r,1):n!==i&&f(i.top,e,t)}function I(e,t){function n(i,o){e(i,o),y.target(t).unsubscribe(r,n)}var r=d();return y.target(t).subscribe(r,n),r}function h(e,t,n){return a(e)?!0:"function"!=typeof t?!0:a(n)?!0:!1}var A,y,O=[],T={},m="/*framebus*/";return l(),y={target:n,include:t,publish:r,pub:r,trigger:r,emit:r,subscribe:i,sub:i,on:i,unsubscribe:o,unsub:o,off:o}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e("./lib/set-attributes"),i=e("./lib/default-attributes"),o=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),n=o({},i,e);return n.style&&"string"!=typeof n.style&&(o(t.style,n.style),delete n.style),r(t,n),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":3,"./lib/default-attributes":4,"./lib/set-attributes":5}],3:[function(e,t,n){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}},{}],4:[function(e,t,n){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],5:[function(e,t,n){"use strict";t.exports=function(e,t){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],null==n?e.removeAttribute(r):e.setAttribute(r,n))}},{}],6:[function(e,t,n){"use strict";var r=e("./lib/error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":17}],7:[function(e,t,n){"use strict";function r(e,t){var n,r=t?o(t):{},a=i(e.authorization).attrs,u=o(e.analyticsMetadata);r.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(u[n]=r._meta[n]);return r._meta=u,a.tokenizationKey?r.tokenizationKey=a.tokenizationKey:r.authorizationFingerprint=a.authorizationFingerprint,r}var i=e("./create-authorization-data"),o=e("./json-clone"),s=e("./constants");t.exports=r},{"./constants":12,"./create-authorization-data":14,"./json-clone":19}],8:[function(e,t,n){"use strict";function r(e){return Math.floor(e/1e3)}function i(e,t,n){var i=e.getConfiguration(),a=e._request,u=r(Date.now()),c=i.gatewayConfiguration.analytics.url,l={analytics:[{kind:o.ANALYTICS_PREFIX+t,timestamp:u}]};a({url:c,method:"post",data:s(i,l),timeout:o.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var o=e("./constants"),s=e("./add-metadata");t.exports={sendEvent:i}},{"./add-metadata":7,"./constants":12}],9:[function(e,t,n){"use strict";function r(e,t){var n,r,o=document.createElement("a");return o.href=t,r="https:"===o.protocol?o.host.replace(/:443$/,""):"http:"===o.protocol?o.host.replace(/:80$/,""):o.host,n=o.protocol+"//"+r,n===e?!0:(o.href=e,i(e))}var i=e("../is-whitelisted-domain");t.exports={checkOrigin:r}},{"../is-whitelisted-domain":18}],10:[function(e,t,n){"use strict";var r=e("../enumerate");t.exports=r(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":16}],11:[function(e,t,n){"use strict";function r(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new a({type:a.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var i=e("framebus"),o=e("./events"),s=e("./check-origin").checkOrigin,a=e("../error");r.prototype.on=function(e,t){var n,r,o=t,a=this;this._isDestroyed||(this.merchantUrl&&(o=function(){s(this.origin,a.merchantUrl)&&t.apply(this,arguments)}),n=this._namespaceEvent(e),r=Array.prototype.slice.call(arguments),r[0]=n,r[1]=o,this._log("on",r),i.on.apply(i,r),this._listeners.push({eventName:e,handler:o,originalHandler:t}))},r.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),i.emit.apply(i,t))},r.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),i.off.apply(i,t))},r.prototype.off=function(e,t){var n,r,i=t;if(!this._isDestroyed){if(this.merchantUrl)for(n=0;n<this._listeners.length;n++)r=this._listeners[n],r.originalHandler===t&&(i=r.handler);this._offDirect(e,i)}},r.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},r.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},r.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},r.events=o,t.exports=r},{"../error":17,"./check-origin":9,"./events":10,framebus:1}],12:[function(e,t,n){"use strict";var r="3.6.3",i="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:i,BRAINTREE_LIBRARY_VERSION:"braintree/"+i+"/"+r}},{}],13:[function(e,t,n){"use strict";var r=e("./error"),i=e("../errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../errors":6,"./error":17}],14:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function i(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function o(e){var t,n,o={attrs:{},configUrl:""};return r(e)?(n=i(e),o.attrs.tokenizationKey=e,o.configUrl=a[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(s(e)),o.attrs.authorizationFingerprint=t.authorizationFingerprint,o.configUrl=t.configUrl),o}var s=e("../lib/polyfill").atob,a={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=o},{"../lib/polyfill":21}],15:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],16:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],17:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var i=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":16}],18:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function i(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(o=o||document.createElement("a"),o.href=e,t=r(o.hostname),s.hasOwnProperty(t)):!1}var o,s={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=i},{}],19:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],20:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],21:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,i,o,s,a,u,c=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="";if(!c.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");u=0;do i=l.indexOf(e.charAt(u++)),o=l.indexOf(e.charAt(u++)),s=l.indexOf(e.charAt(u++)),a=l.indexOf(e.charAt(u++)),t=(63&i)<<2|o>>4&3,n=(15&o)<<4|s>>2&15,r=(3&s)<<6|63&a,d+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(u<e.length);return d}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],22:[function(e,t,n){"use strict";var r=e("./error"),i=e("../errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../errors":6,"./error":17}],23:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}],24:[function(e,t,n){"use strict";function r(e,t){var n,r;return u(t,"create"),t=a(t),null==e.client?void t(new o({type:l.INSTANTIATION_OPTION_REQUIRED.type,code:l.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating UnionPay."})):(n=e.client.getConfiguration(),r=n.analyticsMetadata.sdkVersion,r!==d?void t(new o({type:l.INCOMPATIBLE_VERSIONS.type,code:l.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+r+") and UnionPay (version "+d+") components must be from the same SDK version."})):n.gatewayConfiguration.unionPay&&n.gatewayConfiguration.unionPay.enabled===!0?(s.sendEvent(e.client,"unionpay.initialized"),void t(null,new i(e))):void t(new o(c.UNIONPAY_NOT_ENABLED)))}var i=e("./shared/unionpay"),o=e("../lib/error"),s=e("../lib/analytics"),a=e("../lib/deferred"),u=e("../lib/throw-if-no-callback"),c=e("./shared/errors"),l=e("../errors"),d="3.6.3";t.exports={create:r,VERSION:d}},{"../errors":6,"../lib/analytics":8,"../lib/deferred":15,"../lib/error":17,"../lib/throw-if-no-callback":22,"./shared/errors":26,"./shared/unionpay":27}],25:[function(e,t,n){"use strict";var r=e("../../lib/enumerate");t.exports={events:r(["HOSTED_FIELDS_FETCH_CAPABILITIES","HOSTED_FIELDS_ENROLL","HOSTED_FIELDS_TOKENIZE"],"union-pay:"),HOSTED_FIELDS_FRAME_NAME:"braintreeunionpayhostedfields"}},{"../../lib/enumerate":16}],26:[function(e,t,n){"use strict";var r=e("../../lib/error");t.exports={UNIONPAY_NOT_ENABLED:{type:r.types.MERCHANT,code:"UNIONPAY_NOT_ENABLED",message:"UnionPay is not enabled for this merchant."},UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID:{type:r.types.MERCHANT,code:"UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID",message:"Found an invalid Hosted Fields instance. Please use a valid Hosted Fields instance."},UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED:{type:r.types.MERCHANT,code:"UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED",message:"Could not find the Hosted Fields instance."},UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED:{type:r.types.MERCHANT,code:"UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED",message:"A card or a Hosted Fields instance is required. Please supply a card or a Hosted Fields instance."},UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES:{type:r.types.MERCHANT,code:"UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES",message:"Please supply either a card or a Hosted Fields instance, not both."},UNIONPAY_EXPIRATION_DATE_INCOMPLETE:{type:r.types.MERCHANT,code:"UNIONPAY_EXPIRATION_DATE_INCOMPLETE",message:"You must supply expiration month and year or neither."},UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID:{type:r.types.CUSTOMER,code:"UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID",message:"Enrollment failed due to user input error."},UNIONPAY_ENROLLMENT_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_ENROLLMENT_NETWORK_ERROR",message:"Could not enroll UnionPay card."},UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR",message:"Could not fetch card capabilities."},UNIONPAY_TOKENIZATION_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},UNIONPAY_MISSING_MOBILE_PHONE_DATA:{type:r.types.MERCHANT,code:"UNIONPAY_MISSING_MOBILE_PHONE_DATA",message:"A `mobile` with `countryCode` and `number` is required."},UNIONPAY_FAILED_TOKENIZATION:{type:r.types.CUSTOMER,code:"UNIONPAY_FAILED_TOKENIZATION",message:"The supplied card data failed tokenization."}}},{"../../lib/error":17}],27:[function(e,t,n){"use strict";function r(e){this._options=e}var i=e("../../lib/analytics"),o=e("../../lib/error"),s=e("../../lib/bus"),a=e("./constants"),u=e("../../lib/convert-methods-to-error"),c=e("../../lib/deferred"),l=e("./errors"),d=a.events,E=e("iframer"),_=e("../../lib/methods"),p="3.6.3",f=e("../../lib/uuid"),N=e("../../lib/throw-if-no-callback");r.prototype.fetchCapabilities=function(e,t){var n=this._options.client,r=e.card?e.card.number:null,s=e.hostedFields;if(N(t,"fetchCapabilities"),t=c(t),r&&s)return void t(new o(l.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));if(r)n.request({method:"get",endpoint:"payment_methods/credit_cards/capabilities",data:{_meta:{source:"unionpay"},creditCard:{number:r}}},function(e,r,s){return e?(t(403===s?e:new o({type:l.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.type,code:l.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.code,message:l.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.message,details:{originalError:e}})),void i.sendEvent(n,"unionpay.capabilities-failed")):(i.sendEvent(n,"unionpay.capabilities-received"),void t(null,r))});else{if(!s)return void t(new o(l.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));if(!s._bus)return void t(new o(l.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));this._initializeHostedFields(function(){this._bus.emit(d.HOSTED_FIELDS_FETCH_CAPABILITIES,{hostedFields:s},function(e){return e.err?void t(new o(e.err)):void t(null,e.payload)})}.bind(this))}},r.prototype.enroll=function(e,t){var n,r=this._options.client,s=e.card,a=e.mobile,u=e.hostedFields;if(N(t,"enroll"),t=c(t),!a)return void t(new o(l.UNIONPAY_MISSING_MOBILE_PHONE_DATA));if(u){if(!u._bus)return void t(new o(l.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));if(s)return void t(new o(l.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));this._initializeHostedFields(function(){this._bus.emit(d.HOSTED_FIELDS_ENROLL,{hostedFields:u,mobile:a},function(e){return e.err?void t(new o(e.err)):void t(null,e.payload)})}.bind(this))}else{if(!s||!s.number)return void t(new o(l.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));if(n={_meta:{source:"unionpay"},unionPayEnrollment:{number:s.number,mobileCountryCode:a.countryCode,mobileNumber:a.number}},s.expirationDate)n.unionPayEnrollment.expirationDate=s.expirationDate;else if(s.expirationMonth||s.expirationYear){if(!s.expirationMonth||!s.expirationYear)return void t(new o(l.UNIONPAY_EXPIRATION_DATE_INCOMPLETE));n.unionPayEnrollment.expirationYear=s.expirationYear,n.unionPayEnrollment.expirationMonth=s.expirationMonth}r.request({method:"post",endpoint:"union_pay_enrollments",data:n},function(e,n,s){var a;return e?(403===s?a=e:500>s?(a=new o(l.UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID),a.details={originalError:e}):(a=new o(l.UNIONPAY_ENROLLMENT_NETWORK_ERROR),a.details={originalError:e}),i.sendEvent(r,"unionpay.enrollment-failed"),void t(a)):(i.sendEvent(r,"unionpay.enrollment-succeeded"),void t(null,{enrollmentId:n.unionPayEnrollmentId,smsCodeRequired:n.smsCodeRequired}))})}},r.prototype.tokenize=function(e,t){var n,r,s,a=this._options.client,u=e.card,E=e.hostedFields;if(N(t,"tokenize"),t=c(t),u&&E)return void t(new o(l.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));if(u)n={_meta:{source:"unionpay"},creditCard:{number:e.card.number,options:{unionPayEnrollment:{id:e.enrollmentId}}}},e.smsCode&&(n.creditCard.options.unionPayEnrollment.smsCode=e.smsCode),u.expirationDate?n.creditCard.expirationDate=u.expirationDate:u.expirationMonth&&u.expirationYear&&(n.creditCard.expirationYear=u.expirationYear,n.creditCard.expirationMonth=u.expirationMonth),e.card.cvv&&(n.creditCard.cvv=e.card.cvv),a.request({method:"post",endpoint:"payment_methods/credit_cards",data:n},function(e,n,u){return e?(i.sendEvent(a,"unionpay.nonce-failed"),403===u?s=e:500>u?(s=new o(l.UNIONPAY_FAILED_TOKENIZATION),s.details={originalError:e}):(s=new o(l.UNIONPAY_TOKENIZATION_NETWORK_ERROR),s.details={originalError:e}),void t(s)):(r=n.creditCards[0],delete r.consumed,delete r.threeDSecureInfo,i.sendEvent(a,"unionpay.nonce-received"),void t(null,r))});else{if(!E)return void t(new o(l.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));if(!E._bus)return void t(new o(l.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));this._initializeHostedFields(function(){this._bus.emit(d.HOSTED_FIELDS_TOKENIZE,e,function(e){return e.err?void t(new o(e.err)):void t(null,e.payload)})}.bind(this))}},r.prototype.teardown=function(e){this._bus&&(this._hostedFieldsFrame.parentNode.removeChild(this._hostedFieldsFrame),this._bus.teardown()),u(this,_(r.prototype)),"function"==typeof e&&(e=c(e))()},r.prototype._initializeHostedFields=function(e){var t=f();return this._bus?void e():(this._bus=new s({channel:t,merchantUrl:location.href}),this._hostedFieldsFrame=E({name:a.HOSTED_FIELDS_FRAME_NAME+"_"+t,src:this._options.client.getConfiguration().gatewayConfiguration.assetsUrl+"/web/"+p+"/html/unionpay-hosted-fields-frame.min.html",height:0,width:0}),this._bus.on(s.events.CONFIGURATION_REQUEST,function(t){t(this._options.client),e()}.bind(this)),void document.body.appendChild(this._hostedFieldsFrame))},t.exports=r},{"../../lib/analytics":8,"../../lib/bus":11,"../../lib/convert-methods-to-error":13,"../../lib/deferred":15,"../../lib/error":17,"../../lib/methods":20,"../../lib/throw-if-no-callback":22,"../../lib/uuid":23,"./constants":25,"./errors":26,iframer:2}]},{},[24])(24)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).unionpay=e()}}(function(){var e;return function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[s]={exports:{}};e[s][0].call(l.exports,function(t){var n=e[s][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,n,r){(function(t){"use strict";!function(i,o){"object"==typeof r&&"undefined"!=typeof n?n.exports=o("undefined"==typeof t?i:t):"function"==typeof e&&e.amd?e([],function(){return o(i)}):i.framebus=o(i)}(this,function(e){function t(e){return null==e?!1:null==e.Window?!1:e.constructor!==e.Window?!1:(O.push(e),!0)}function n(e){var t,n={};for(t in y)y.hasOwnProperty(t)&&(n[t]=y[t]);return n._origin=e||"*",n}function r(e){var t,n,r=s(this);return a(e)?!1:a(r)?!1:(n=Array.prototype.slice.call(arguments,1),t=u(e,n,r),t===!1?!1:(f(A.top,t,r),!0))}function i(e,t){var n=s(this);return h(e,t,n)?!1:(T[n]=T[n]||{},T[n][e]=T[n][e]||[],T[n][e].push(t),!0)}function o(e,t){var n,r,i=s(this);if(h(e,t,i))return!1;if(r=T[i]&&T[i][e],!r)return!1;for(n=0;n<r.length;n++)if(r[n]===t)return r.splice(n,1),!0;return!1}function s(e){return e&&e._origin||"*"}function a(e){return"string"!=typeof e}function u(e,t,n){var r=!1,i={event:e,origin:n},o=t[t.length-1];"function"==typeof o&&(i.reply=I(o,n),t=t.slice(0,-1)),i.args=t;try{r=m+JSON.stringify(i)}catch(s){throw new Error("Could not stringify event: "+s.message)}return r}function c(e){var t,n,r,i;if(e.data.slice(0,m.length)!==m)return!1;try{t=JSON.parse(e.data.slice(m.length))}catch(o){return!1}return null!=t.reply&&(n=e.origin,r=e.source,i=t.reply,t.reply=function(e){var t=u(i,[e],n);return t===!1?!1:void r.postMessage(t,n)},t.args.push(t.reply)),t}function l(t){A||(A=t||e,A.addEventListener?A.addEventListener("message",E,!1):A.attachEvent?A.attachEvent("onmessage",E):null===A.onmessage?A.onmessage=E:A=null)}function d(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}function E(e){var t;a(e.data)||(t=c(e),t&&(_("*",t.event,t.args,e),_(e.origin,t.event,t.args,e),N(e.data,t.origin,e.source)))}function _(e,t,n,r){var i;if(T[e]&&T[e][t])for(i=0;i<T[e][t].length;i++)T[e][t][i].apply(r,n)}function p(e){return e.top!==e?!1:null==e.opener?!1:e.opener===e?!1:e.opener.closed===!0?!1:!0}function f(e,t,n){var r;try{for(e.postMessage(t,n),p(e)&&f(e.opener.top,t,n),r=0;r<e.frames.length;r++)f(e.frames[r],t,n)}catch(i){}}function N(e,t,n){var r,i;for(r=O.length-1;r>=0;r--)i=O[r],i.closed===!0?O=O.slice(r,1):n!==i&&f(i.top,e,t)}function I(e,t){function n(i,o){e(i,o),y.target(t).unsubscribe(r,n)}var r=d();return y.target(t).subscribe(r,n),r}function h(e,t,n){return a(e)?!0:"function"!=typeof t?!0:a(n)?!0:!1}var A,y,O=[],T={},m="/*framebus*/";return l(),y={target:n,include:t,publish:r,pub:r,trigger:r,emit:r,subscribe:i,sub:i,on:i,unsubscribe:o,unsub:o,off:o}})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,n){"use strict";var r=e("./lib/set-attributes"),i=e("./lib/default-attributes"),o=e("./lib/assign");t.exports=function(e){var t=document.createElement("iframe"),n=o({},i,e);return n.style&&"string"!=typeof n.style&&(o(t.style,n.style),delete n.style),r(t,n),t.getAttribute("id")||(t.id=t.name),t}},{"./lib/assign":3,"./lib/default-attributes":4,"./lib/set-attributes":5}],3:[function(e,t,n){"use strict";t.exports=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach(function(t){"object"==typeof t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}},{}],4:[function(e,t,n){t.exports={src:"about:blank",frameBorder:0,allowtransparency:!0,scrolling:"no"}},{}],5:[function(e,t,n){"use strict";t.exports=function(e,t){var n;for(var r in t)t.hasOwnProperty(r)&&(n=t[r],null==n?e.removeAttribute(r):e.setAttribute(r,n))}},{}],6:[function(e,t,n){"use strict";function r(e,t){var n,r=t?o(t):{},a=i(e.authorization).attrs,u=o(e.analyticsMetadata);r.braintreeLibraryVersion=s.BRAINTREE_LIBRARY_VERSION;for(n in r._meta)r._meta.hasOwnProperty(n)&&(u[n]=r._meta[n]);return r._meta=u,a.tokenizationKey?r.tokenizationKey=a.tokenizationKey:r.authorizationFingerprint=a.authorizationFingerprint,r}var i=e("./create-authorization-data"),o=e("./json-clone"),s=e("./constants");t.exports=r},{"./constants":12,"./create-authorization-data":14,"./json-clone":19}],7:[function(e,t,n){"use strict";function r(e){return Math.floor(e/1e3)}function i(e,t,n){var i=e.getConfiguration(),a=e._request,u=r(Date.now()),c=i.gatewayConfiguration.analytics.url,l={analytics:[{kind:o.ANALYTICS_PREFIX+t,timestamp:u}]};a({url:c,method:"post",data:s(i,l),timeout:o.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var o=e("./constants"),s=e("./add-metadata");t.exports={sendEvent:i}},{"./add-metadata":6,"./constants":12}],8:[function(e,t,n){"use strict";function r(e){if(!r.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var i=e("./enumerate");r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.types=i(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=r},{"./enumerate":16}],9:[function(e,t,n){"use strict";function r(e,t){var n,r,o=document.createElement("a");return o.href=t,r="https:"===o.protocol?o.host.replace(/:443$/,""):"http:"===o.protocol?o.host.replace(/:80$/,""):o.host,n=o.protocol+"//"+r,n===e?!0:(o.href=e,i(e))}var i=e("../is-whitelisted-domain");t.exports={checkOrigin:r}},{"../is-whitelisted-domain":18}],10:[function(e,t,n){"use strict";var r=e("../enumerate");t.exports=r(["CONFIGURATION_REQUEST"],"bus:")},{"../enumerate":16}],11:[function(e,t,n){"use strict";function r(e){if(e=e||{},this.channel=e.channel,!this.channel)throw new a({type:a.types.INTERNAL,code:"MISSING_CHANNEL_ID",message:"Channel ID must be specified."});this.merchantUrl=e.merchantUrl,this._isDestroyed=!1,this._isVerbose=!1,this._listeners=[],this._log("new bus on channel "+this.channel,[location.href])}var i=e("framebus"),o=e("./events"),s=e("./check-origin").checkOrigin,a=e("../braintree-error");r.prototype.on=function(e,t){var n,r,o=t,a=this;this._isDestroyed||(this.merchantUrl&&(o=function(){s(this.origin,a.merchantUrl)&&t.apply(this,arguments)}),n=this._namespaceEvent(e),r=Array.prototype.slice.call(arguments),r[0]=n,r[1]=o,this._log("on",r),i.on.apply(i,r),this._listeners.push({eventName:e,handler:o,originalHandler:t}))},r.prototype.emit=function(e){var t;this._isDestroyed||(t=Array.prototype.slice.call(arguments),t[0]=this._namespaceEvent(e),this._log("emit",t),i.emit.apply(i,t))},r.prototype._offDirect=function(e){var t=Array.prototype.slice.call(arguments);this._isDestroyed||(t[0]=this._namespaceEvent(e),this._log("off",t),i.off.apply(i,t))},r.prototype.off=function(e,t){var n,r,i=t;if(!this._isDestroyed){if(this.merchantUrl)for(n=0;n<this._listeners.length;n++)r=this._listeners[n],r.originalHandler===t&&(i=r.handler);this._offDirect(e,i)}},r.prototype._namespaceEvent=function(e){return["braintree",this.channel,e].join(":")},r.prototype.teardown=function(){var e,t;for(t=0;t<this._listeners.length;t++)e=this._listeners[t],this._offDirect(e.eventName,e.handler);this._listeners.length=0,this._isDestroyed=!0},r.prototype._log=function(e,t){this._isVerbose&&console.log(e,t)},r.events=o,t.exports=r},{"../braintree-error":8,"./check-origin":9,"./events":10,framebus:1}],12:[function(e,t,n){"use strict";var r="3.7.0",i="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:r,INTEGRATION:"custom",SOURCE:"client",PLATFORM:i,BRAINTREE_LIBRARY_VERSION:"braintree/"+i+"/"+r}},{}],13:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("../lib/errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new r({type:i.METHOD_CALLED_AFTER_TEARDOWN.type,code:i.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../lib/errors":17,"./braintree-error":8}],14:[function(e,t,n){"use strict";function r(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function i(e){var t=e.split("_"),n=t[0],r=t.slice(2).join("_");return{merchantId:r,environment:n}}function o(e){var t,n,o={attrs:{},configUrl:""};return r(e)?(n=i(e),o.attrs.tokenizationKey=e,o.configUrl=a[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(s(e)),o.attrs.authorizationFingerprint=t.authorizationFingerprint,o.configUrl=t.configUrl),o}var s=e("../lib/polyfill").atob,a={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=o},{"../lib/polyfill":21}],15:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],16:[function(e,t,n){"use strict";function r(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=r},{}],17:[function(e,t,n){"use strict";var r=e("./braintree-error");t.exports={CALLBACK_REQUIRED:{type:r.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:r.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:r.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:r.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:r.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":8}],18:[function(e,t,n){"use strict";function r(e){return e.split(".").slice(-2).join(".")}function i(e){var t;return e=e.toLowerCase(),/^https:/.test(e)?(o=o||document.createElement("a"),o.href=e,t=r(o.hostname),s.hasOwnProperty(t)):!1}var o,s={"paypal.com":1,"braintreepayments.com":1,"braintreegateway.com":1};t.exports=i},{}],19:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],20:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],21:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,r,i,o,s,a,u,c=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="";if(!c.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");u=0;do i=l.indexOf(e.charAt(u++)),o=l.indexOf(e.charAt(u++)),s=l.indexOf(e.charAt(u++)),a=l.indexOf(e.charAt(u++)),t=(63&i)<<2|o>>4&3,n=(15&o)<<4|s>>2&15,r=(3&s)<<6|63&a,d+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(r?String.fromCharCode(r):"");while(u<e.length);return d}var r="function"==typeof e.atob?e.atob:n;t.exports={atob:r,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],22:[function(e,t,n){"use strict";var r=e("./braintree-error"),i=e("../lib/errors");t.exports=function(e,t){if("function"!=typeof e)throw new r({type:i.CALLBACK_REQUIRED.type,code:i.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../lib/errors":17,"./braintree-error":8}],23:[function(e,t,n){"use strict";function r(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"===e?t:3&t|8;return n.toString(16)})}t.exports=r},{}],24:[function(e,t,n){"use strict";function r(e,t){var n,r;return u(t,"create"),t=a(t),null==e.client?void t(new o({type:l.INSTANTIATION_OPTION_REQUIRED.type,code:l.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating UnionPay."})):(n=e.client.getConfiguration(),r=n.analyticsMetadata.sdkVersion,r!==d?void t(new o({type:l.INCOMPATIBLE_VERSIONS.type,code:l.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+r+") and UnionPay (version "+d+") components must be from the same SDK version."})):n.gatewayConfiguration.unionPay&&n.gatewayConfiguration.unionPay.enabled===!0?(s.sendEvent(e.client,"unionpay.initialized"),void t(null,new i(e))):void t(new o(c.UNIONPAY_NOT_ENABLED)))}var i=e("./shared/unionpay"),o=e("../lib/braintree-error"),s=e("../lib/analytics"),a=e("../lib/deferred"),u=e("../lib/throw-if-no-callback"),c=e("./shared/errors"),l=e("../lib/errors"),d="3.7.0";t.exports={create:r,VERSION:d}},{"../lib/analytics":7,"../lib/braintree-error":8,"../lib/deferred":15,"../lib/errors":17,"../lib/throw-if-no-callback":22,"./shared/errors":26,"./shared/unionpay":27}],25:[function(e,t,n){"use strict";var r=e("../../lib/enumerate");t.exports={events:r(["HOSTED_FIELDS_FETCH_CAPABILITIES","HOSTED_FIELDS_ENROLL","HOSTED_FIELDS_TOKENIZE"],"union-pay:"),HOSTED_FIELDS_FRAME_NAME:"braintreeunionpayhostedfields"}},{"../../lib/enumerate":16}],26:[function(e,t,n){"use strict";var r=e("../../lib/braintree-error");t.exports={UNIONPAY_NOT_ENABLED:{type:r.types.MERCHANT,code:"UNIONPAY_NOT_ENABLED",message:"UnionPay is not enabled for this merchant."},UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID:{type:r.types.MERCHANT,code:"UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID",message:"Found an invalid Hosted Fields instance. Please use a valid Hosted Fields instance."},UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED:{type:r.types.MERCHANT,code:"UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED",message:"Could not find the Hosted Fields instance."},UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED:{type:r.types.MERCHANT,code:"UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED",message:"A card or a Hosted Fields instance is required. Please supply a card or a Hosted Fields instance."},UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES:{type:r.types.MERCHANT,code:"UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES",message:"Please supply either a card or a Hosted Fields instance, not both."},UNIONPAY_EXPIRATION_DATE_INCOMPLETE:{type:r.types.MERCHANT,code:"UNIONPAY_EXPIRATION_DATE_INCOMPLETE",message:"You must supply expiration month and year or neither."},UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID:{type:r.types.CUSTOMER,code:"UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID",message:"Enrollment failed due to user input error."},UNIONPAY_ENROLLMENT_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_ENROLLMENT_NETWORK_ERROR",message:"Could not enroll UnionPay card."},UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR",message:"Could not fetch card capabilities."},UNIONPAY_TOKENIZATION_NETWORK_ERROR:{type:r.types.NETWORK,code:"UNIONPAY_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},UNIONPAY_MISSING_MOBILE_PHONE_DATA:{type:r.types.MERCHANT,code:"UNIONPAY_MISSING_MOBILE_PHONE_DATA",message:"A `mobile` with `countryCode` and `number` is required."},UNIONPAY_FAILED_TOKENIZATION:{type:r.types.CUSTOMER,code:"UNIONPAY_FAILED_TOKENIZATION",message:"The supplied card data failed tokenization."}}},{"../../lib/braintree-error":8}],27:[function(e,t,n){"use strict";function r(e){this._options=e}var i=e("../../lib/analytics"),o=e("../../lib/braintree-error"),s=e("../../lib/bus"),a=e("./constants"),u=e("../../lib/convert-methods-to-error"),c=e("../../lib/deferred"),l=e("./errors"),d=a.events,E=e("iframer"),_=e("../../lib/methods"),p="3.7.0",f=e("../../lib/uuid"),N=e("../../lib/throw-if-no-callback");r.prototype.fetchCapabilities=function(e,t){var n=this._options.client,r=e.card?e.card.number:null,s=e.hostedFields;if(N(t,"fetchCapabilities"),t=c(t),r&&s)return void t(new o(l.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));if(r)n.request({method:"get",endpoint:"payment_methods/credit_cards/capabilities",data:{_meta:{source:"unionpay"},creditCard:{number:r}}},function(e,r,s){return e?(t(403===s?e:new o({type:l.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.type,code:l.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.code,message:l.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.message,details:{originalError:e}})),void i.sendEvent(n,"unionpay.capabilities-failed")):(i.sendEvent(n,"unionpay.capabilities-received"),void t(null,r))});else{if(!s)return void t(new o(l.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));if(!s._bus)return void t(new o(l.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));this._initializeHostedFields(function(){this._bus.emit(d.HOSTED_FIELDS_FETCH_CAPABILITIES,{hostedFields:s},function(e){return e.err?void t(new o(e.err)):void t(null,e.payload)})}.bind(this))}},r.prototype.enroll=function(e,t){var n,r=this._options.client,s=e.card,a=e.mobile,u=e.hostedFields;if(N(t,"enroll"),t=c(t),!a)return void t(new o(l.UNIONPAY_MISSING_MOBILE_PHONE_DATA));if(u){if(!u._bus)return void t(new o(l.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));if(s)return void t(new o(l.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));this._initializeHostedFields(function(){this._bus.emit(d.HOSTED_FIELDS_ENROLL,{hostedFields:u,mobile:a},function(e){return e.err?void t(new o(e.err)):void t(null,e.payload)})}.bind(this))}else{if(!s||!s.number)return void t(new o(l.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));if(n={_meta:{source:"unionpay"},unionPayEnrollment:{number:s.number,mobileCountryCode:a.countryCode,mobileNumber:a.number}},s.expirationDate)n.unionPayEnrollment.expirationDate=s.expirationDate;else if(s.expirationMonth||s.expirationYear){if(!s.expirationMonth||!s.expirationYear)return void t(new o(l.UNIONPAY_EXPIRATION_DATE_INCOMPLETE));n.unionPayEnrollment.expirationYear=s.expirationYear,n.unionPayEnrollment.expirationMonth=s.expirationMonth}r.request({method:"post",endpoint:"union_pay_enrollments",data:n},function(e,n,s){var a;return e?(403===s?a=e:500>s?(a=new o(l.UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID),a.details={originalError:e}):(a=new o(l.UNIONPAY_ENROLLMENT_NETWORK_ERROR),a.details={originalError:e}),i.sendEvent(r,"unionpay.enrollment-failed"),void t(a)):(i.sendEvent(r,"unionpay.enrollment-succeeded"),void t(null,{enrollmentId:n.unionPayEnrollmentId,smsCodeRequired:n.smsCodeRequired}))})}},r.prototype.tokenize=function(e,t){var n,r,s,a=this._options.client,u=e.card,E=e.hostedFields;if(N(t,"tokenize"),t=c(t),u&&E)return void t(new o(l.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES));if(u)n={_meta:{source:"unionpay"},creditCard:{number:e.card.number,options:{unionPayEnrollment:{id:e.enrollmentId}}}},e.smsCode&&(n.creditCard.options.unionPayEnrollment.smsCode=e.smsCode),u.expirationDate?n.creditCard.expirationDate=u.expirationDate:u.expirationMonth&&u.expirationYear&&(n.creditCard.expirationYear=u.expirationYear,n.creditCard.expirationMonth=u.expirationMonth),e.card.cvv&&(n.creditCard.cvv=e.card.cvv),a.request({method:"post",endpoint:"payment_methods/credit_cards",data:n},function(e,n,u){return e?(i.sendEvent(a,"unionpay.nonce-failed"),403===u?s=e:500>u?(s=new o(l.UNIONPAY_FAILED_TOKENIZATION),s.details={originalError:e}):(s=new o(l.UNIONPAY_TOKENIZATION_NETWORK_ERROR),s.details={originalError:e}),void t(s)):(r=n.creditCards[0],delete r.consumed,delete r.threeDSecureInfo,i.sendEvent(a,"unionpay.nonce-received"),void t(null,r))});else{if(!E)return void t(new o(l.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED));if(!E._bus)return void t(new o(l.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID));this._initializeHostedFields(function(){this._bus.emit(d.HOSTED_FIELDS_TOKENIZE,e,function(e){return e.err?void t(new o(e.err)):void t(null,e.payload)})}.bind(this))}},r.prototype.teardown=function(e){this._bus&&(this._hostedFieldsFrame.parentNode.removeChild(this._hostedFieldsFrame),this._bus.teardown()),u(this,_(r.prototype)),"function"==typeof e&&(e=c(e))()},r.prototype._initializeHostedFields=function(e){var t=f();return this._bus?void e():(this._bus=new s({channel:t,merchantUrl:location.href}),this._hostedFieldsFrame=E({name:a.HOSTED_FIELDS_FRAME_NAME+"_"+t,src:this._options.client.getConfiguration().gatewayConfiguration.assetsUrl+"/web/"+p+"/html/unionpay-hosted-fields-frame.min.html",height:0,width:0}),this._bus.on(s.events.CONFIGURATION_REQUEST,function(t){t(this._options.client),e()}.bind(this)),void document.body.appendChild(this._hostedFieldsFrame))},t.exports=r},{"../../lib/analytics":7,"../../lib/braintree-error":8,"../../lib/bus":11,"../../lib/convert-methods-to-error":13,"../../lib/deferred":15,"../../lib/methods":20,"../../lib/throw-if-no-callback":22,"../../lib/uuid":23,"./constants":25,"./errors":26,iframer:2}]},{},[24])(24)});
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}(g.braintree || (g.braintree = {})).usBankAccount = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
'use strict';
var BraintreeError = _dereq_('./lib/error');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
},{"./lib/error":10}],2:[function(_dereq_,module,exports){
'use strict';
var createAuthorizationData = _dereq_('./create-authorization-data');

@@ -64,3 +35,3 @@ var jsonClone = _dereq_('./json-clone');

},{"./constants":5,"./create-authorization-data":7,"./json-clone":11}],3:[function(_dereq_,module,exports){
},{"./constants":5,"./create-authorization-data":7,"./json-clone":11}],2:[function(_dereq_,module,exports){
'use strict';

@@ -99,5 +70,82 @@

},{"./add-metadata":2,"./constants":5}],4:[function(_dereq_,module,exports){
},{"./add-metadata":1,"./constants":5}],3:[function(_dereq_,module,exports){
'use strict';
var enumerate = _dereq_('./enumerate');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
}
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":9}],4:[function(_dereq_,module,exports){
'use strict';
// Taken from https://github.com/sindresorhus/decamelize/blob/95980ab6fb44c40eaca7792bdf93aff7c210c805/index.js

@@ -123,3 +171,3 @@ function transformKey(key) {

var VERSION = "3.6.3";
var VERSION = "3.7.0";
var PLATFORM = 'web';

@@ -141,4 +189,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -157,3 +205,3 @@ module.exports = function (instance, methodNames) {

},{"../errors":1,"./error":10}],7:[function(_dereq_,module,exports){
},{"../lib/errors":10,"./braintree-error":3}],7:[function(_dereq_,module,exports){
'use strict';

@@ -238,77 +286,29 @@

var enumerate = _dereq_('./enumerate');
var BraintreeError = _dereq_('./braintree-error');
/**
* @class
* @global
* @param {object} options Construction options
* @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.
* @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>
*/
function BraintreeError(options) {
if (!BraintreeError.types.hasOwnProperty(options.type)) {
throw new Error(options.type + ' is not a valid type.');
module.exports = {
CALLBACK_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'CALLBACK_REQUIRED'
},
INSTANTIATION_OPTION_REQUIRED: {
type: BraintreeError.types.MERCHANT,
code: 'INSTANTIATION_OPTION_REQUIRED'
},
INCOMPATIBLE_VERSIONS: {
type: BraintreeError.types.MERCHANT,
code: 'INCOMPATIBLE_VERSIONS'
},
METHOD_CALLED_AFTER_TEARDOWN: {
type: BraintreeError.types.MERCHANT,
code: 'METHOD_CALLED_AFTER_TEARDOWN'
},
BRAINTREE_API_ACCESS_RESTRICTED: {
type: BraintreeError.types.MERCHANT,
code: 'BRAINTREE_API_ACCESS_RESTRICTED',
message: 'Your access is restricted and cannot use this part of the Braintree API.'
}
};
if (!options.code) {
throw new Error('Error code required.');
}
if (!options.message) {
throw new Error('Error message required.');
}
this.name = 'BraintreeError';
/**
* @type {string}
* @description A code that corresponds to specific errors.
*/
this.code = options.code;
/**
* @type {string}
* @description A short description of the error.
*/
this.message = options.message;
/**
* @type {BraintreeError.types}
* @description The type of error.
*/
this.type = options.type;
/**
* @type {object=}
* @description Additional information about the error, such as an underlying network error response.
*/
this.details = options.details;
}
BraintreeError.prototype = Object.create(Error.prototype);
BraintreeError.prototype.constructor = BraintreeError;
/**
* Enum for {@link BraintreeError} types.
* @name BraintreeError.types
* @enum
* @readonly
* @memberof BraintreeError
* @property {string} CUSTOMER An error caused by the customer.
* @property {string} MERCHANT An error that is actionable by the merchant.
* @property {string} NETWORK An error due to a network problem.
* @property {string} INTERNAL An error caused by Braintree code.
* @property {string} UNKNOWN An error where the origin is unknown.
*/
BraintreeError.types = enumerate([
'CUSTOMER',
'MERCHANT',
'NETWORK',
'INTERNAL',
'UNKNOWN'
]);
module.exports = BraintreeError;
},{"./enumerate":9}],11:[function(_dereq_,module,exports){
},{"./braintree-error":3}],11:[function(_dereq_,module,exports){
'use strict';

@@ -387,4 +387,4 @@

var BraintreeError = _dereq_('./error');
var sharedErrors = _dereq_('../errors');
var BraintreeError = _dereq_('./braintree-error');
var sharedErrors = _dereq_('../lib/errors');

@@ -401,3 +401,3 @@ module.exports = function (callback, functionName) {

},{"../errors":1,"./error":10}],16:[function(_dereq_,module,exports){
},{"../lib/errors":10,"./braintree-error":3}],16:[function(_dereq_,module,exports){
'use strict';

@@ -413,3 +413,3 @@

var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');

@@ -462,3 +462,3 @@ module.exports = {

},{"../lib/error":10}],18:[function(_dereq_,module,exports){
},{"../lib/braintree-error":3}],18:[function(_dereq_,module,exports){
'use strict';

@@ -470,3 +470,3 @@ /**

var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var errors = _dereq_('./errors');

@@ -476,4 +476,4 @@ var USBankAccount = _dereq_('./us-bank-account');

var throwIfNoCallback = _dereq_('../lib/throw-if-no-callback');
var VERSION = "3.6.3";
var sharedErrors = _dereq_('../errors');
var VERSION = "3.7.0";
var sharedErrors = _dereq_('../lib/errors');

@@ -538,10 +538,10 @@ /**

},{"../errors":1,"../lib/deferred":8,"../lib/error":10,"../lib/throw-if-no-callback":15,"./errors":17,"./us-bank-account":19}],19:[function(_dereq_,module,exports){
},{"../lib/braintree-error":3,"../lib/deferred":8,"../lib/errors":10,"../lib/throw-if-no-callback":15,"./errors":17,"./us-bank-account":19}],19:[function(_dereq_,module,exports){
(function (global){
'use strict';
var BraintreeError = _dereq_('../lib/error');
var BraintreeError = _dereq_('../lib/braintree-error');
var constants = _dereq_('./constants');
var errors = _dereq_('./errors');
var sharedErrors = _dereq_('../errors');
var sharedErrors = _dereq_('../lib/errors');
var analytics = _dereq_('../lib/analytics');

@@ -931,3 +931,3 @@ var deferred = _dereq_('../lib/deferred');

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{"../errors":1,"../lib/analytics":3,"../lib/camel-case-to-snake-case":4,"../lib/convert-methods-to-error":6,"../lib/deferred":8,"../lib/error":10,"../lib/methods":12,"../lib/once":13,"../lib/throw-if-no-callback":15,"./constants":16,"./errors":17}]},{},[18])(18)
},{"../lib/analytics":2,"../lib/braintree-error":3,"../lib/camel-case-to-snake-case":4,"../lib/convert-methods-to-error":6,"../lib/deferred":8,"../lib/errors":10,"../lib/methods":12,"../lib/once":13,"../lib/throw-if-no-callback":15,"./constants":16,"./errors":17}]},{},[18])(18)
});

@@ -1,1 +0,1 @@

!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).usBankAccount=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var _=n[a]={exports:{}};t[a][0].call(_.exports,function(e){var n=t[a][1][e];return r(n?n:e)},_,_.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(e,t,n){"use strict";var o=e("./lib/error");t.exports={CALLBACK_REQUIRED:{type:o.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:o.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:o.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:o.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:o.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./lib/error":10}],2:[function(e,t,n){"use strict";function o(e,t){var n,o=t?i(t):{},s=r(e.authorization).attrs,c=i(e.analyticsMetadata);o.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(n in o._meta)o._meta.hasOwnProperty(n)&&(c[n]=o._meta[n]);return o._meta=c,s.tokenizationKey?o.tokenizationKey=s.tokenizationKey:o.authorizationFingerprint=s.authorizationFingerprint,o}var r=e("./create-authorization-data"),i=e("./json-clone"),a=e("./constants");t.exports=o},{"./constants":5,"./create-authorization-data":7,"./json-clone":11}],3:[function(e,t,n){"use strict";function o(e){return Math.floor(e/1e3)}function r(e,t,n){var r=e.getConfiguration(),s=e._request,c=o(Date.now()),u=r.gatewayConfiguration.analytics.url,_={analytics:[{kind:i.ANALYTICS_PREFIX+t,timestamp:c}]};s({url:u,method:"post",data:a(r,_),timeout:i.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var i=e("./constants"),a=e("./add-metadata");t.exports={sendEvent:r}},{"./add-metadata":2,"./constants":5}],4:[function(e,t,n){"use strict";function o(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}t.exports=function(e){return Object.keys(e).reduce(function(t,n){var r=o(n);return t[r]=e[n],t},{})}},{}],5:[function(e,t,n){"use strict";var o="3.6.3",r="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:o,INTEGRATION:"custom",SOURCE:"client",PLATFORM:r,BRAINTREE_LIBRARY_VERSION:"braintree/"+r+"/"+o}},{}],6:[function(e,t,n){"use strict";var o=e("./error"),r=e("../errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new o({type:r.METHOD_CALLED_AFTER_TEARDOWN.type,code:r.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../errors":1,"./error":10}],7:[function(e,t,n){"use strict";function o(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function r(e){var t=e.split("_"),n=t[0],o=t.slice(2).join("_");return{merchantId:o,environment:n}}function i(e){var t,n,i={attrs:{},configUrl:""};return o(e)?(n=r(e),i.attrs.tokenizationKey=e,i.configUrl=s[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":14}],8:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],9:[function(e,t,n){"use strict";function o(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=o},{}],10:[function(e,t,n){"use strict";function o(e){if(!o.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var r=e("./enumerate");o.prototype=Object.create(Error.prototype),o.prototype.constructor=o,o.types=r(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=o},{"./enumerate":9}],11:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],12:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],13:[function(e,t,n){"use strict";function o(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=o},{}],14:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,o,r,i,a,s,c,u=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="";if(!u.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do r=_.indexOf(e.charAt(c++)),i=_.indexOf(e.charAt(c++)),a=_.indexOf(e.charAt(c++)),s=_.indexOf(e.charAt(c++)),t=(63&r)<<2|i>>4&3,n=(15&i)<<4|a>>2&15,o=(3&a)<<6|63&s,d+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(o?String.fromCharCode(o):"");while(c<e.length);return d}var o="function"==typeof e.atob?e.atob:n;t.exports={atob:o,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(e,t,n){"use strict";var o=e("./error"),r=e("../errors");t.exports=function(e,t){if("function"!=typeof e)throw new o({type:r.CALLBACK_REQUIRED.type,code:r.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../errors":1,"./error":10}],16:[function(e,t,n){"use strict";t.exports={REQUIRED_BANK_DETAILS:["routingNumber","accountNumber","accountType","accountHolderName","billingAddress"],PLAID_LINK_JS:"https://cdn.plaid.com/link/stable/link-initialize.js"}},{}],17:[function(e,t,n){"use strict";var o=e("../lib/error");t.exports={US_BANK_ACCOUNT_OPTION_REQUIRED:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_OPTION_REQUIRED"},US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS"},US_BANK_ACCOUNT_LOGIN_LOAD_FAILED:{type:o.types.NETWORK,code:"US_BANK_ACCOUNT_LOGIN_LOAD_FAILED",message:"Bank login flow failed to load."},US_BANK_ACCOUNT_LOGIN_CLOSED:{type:o.types.CUSTOMER,code:"US_BANK_ACCOUNT_LOGIN_CLOSED",message:"Customer closed bank login flow before authorizing."},US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE",message:"Another bank login tokenization request is active."},US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR:{type:o.types.NETWORK,code:"US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},US_BANK_ACCOUNT_FAILED_TOKENIZATION:{type:o.types.CUSTOMER,code:"US_BANK_ACCOUNT_FAILED_TOKENIZATION",message:"The supplied data failed tokenization."},US_BANK_ACCOUNT_NOT_ENABLED:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_NOT_ENABLED",message:"US bank account is not enabled."},US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED",message:"Bank login is not enabled."}}},{"../lib/error":10}],18:[function(e,t,n){"use strict";function o(e,t){var n,o,d;return c(t,"create"),t=s(t),null==e.client?void t(new r({type:_.INSTANTIATION_OPTION_REQUIRED.type,code:_.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating US Bank Account."})):(n=e.client.getConfiguration().analyticsMetadata.sdkVersion,n!==u?void t(new r({type:_.INCOMPATIBLE_VERSIONS.type,code:_.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+n+") and US Bank Account (version "+u+") components must be from the same SDK version."})):(o=e.client.getConfiguration().gatewayConfiguration.braintreeApi)?(d=e.client.getConfiguration().gatewayConfiguration.usBankAccount)?void t(null,new a(e)):void t(new r(i.US_BANK_ACCOUNT_NOT_ENABLED)):void t(new r(_.BRAINTREE_API_ACCESS_RESTRICTED)))}var r=e("../lib/error"),i=e("./errors"),a=e("./us-bank-account"),s=e("../lib/deferred"),c=e("../lib/throw-if-no-callback"),u="3.6.3",_=e("../errors");t.exports={create:o,VERSION:u}},{"../errors":1,"../lib/deferred":8,"../lib/error":10,"../lib/throw-if-no-callback":15,"./errors":17,"./us-bank-account":19}],19:[function(e,t,n){(function(n){"use strict";function o(e){this._client=e.client,this._isTokenizingBankLogin=!1,d.sendEvent(this._client,"web.usbankaccount.initialized")}function r(e,t){var n;return n=new s(401===t?_.BRAINTREE_API_ACCESS_RESTRICTED:500>t?u.US_BANK_ACCOUNT_FAILED_TOKENIZATION:u.US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR),n.details={originalError:e},n}function i(e){return{nonce:e.data.id,details:{},description:e.data.description,type:e.data.type}}function a(e,t){function o(){var e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(i(),t(null,n.Plaid))}function r(){e.parentNode.removeChild(e),t(new s(u.US_BANK_ACCOUNT_LOGIN_LOAD_FAILED))}function i(){e.removeEventListener("error",r),e.removeEventListener("load",o),e.removeEventListener("readystatechange",o)}e.addEventListener("error",r),e.addEventListener("load",o),e.addEventListener("readystatechange",o)}var s=e("../lib/error"),c=e("./constants"),u=e("./errors"),_=e("../errors"),d=e("../lib/analytics"),l=e("../lib/deferred"),N=e("../lib/once"),A=e("../lib/convert-methods-to-error"),E=e("../lib/methods"),p=e("../lib/throw-if-no-callback"),T=e("../lib/camel-case-to-snake-case");o.prototype.tokenize=function(e,t){return p(t,"tokenize"),e=e||{},t=l(t),e.mandateText?void(e.bankDetails&&e.bankLogin?t(new s({type:u.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.type,code:u.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.code,message:"tokenize must be called with bankDetails or bankLogin, not both."})):e.bankDetails?this._tokenizeBankDetails(e,t):e.bankLogin?this._tokenizeBankLogin(e,t):t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"tokenize must be called with bankDetails or bankLogin."}))):void t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"mandateText property is required."}))},o.prototype._tokenizeBankDetails=function(e,t){var n,o,a=this._client,_=e.bankDetails,l=a.getConfiguration().gatewayConfiguration.braintreeApi;for(n=0;n<c.REQUIRED_BANK_DETAILS.length;n++)if(o=c.REQUIRED_BANK_DETAILS[n],!_[o])return void t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"bankDetails."+o+" property is required."}));a._request({method:"POST",url:l.url+"/tokens",headers:{Authorization:"Bearer "+l.accessToken,"Braintree-Version":"2016-08-25"},data:{type:"us_bank_account",routing_number:_.routingNumber,account_number:_.accountNumber,account_holder_name:_.accountHolderName,account_type:_.accountType,billing_address:T(_.billingAddress),ach_mandate:{text:e.mandateText}}},function(e,n,o){var s;return e?(s=r(e,o),d.sendEvent(a,"web.usbankaccount.bankdetails.tokenization.failed"),void t(s)):(d.sendEvent(a,"web.usbankaccount.bankdetails.tokenization.succeeded"),void t(null,i(n)))})},o.prototype._tokenizeBankLogin=function(e,t){var n=this,o=this._client,a=o.getConfiguration().gatewayConfiguration,c="production"===a.environment,_=a.usBankAccount.plaid,l=a.braintreeApi;return e.bankLogin.displayName?_?this._isTokenizingBankLogin?void t(new s(u.US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE)):(this._isTokenizingBankLogin=!0,void this._loadPlaid(function(a,N){return a?void t(a):(N.create({clientName:e.bankLogin.displayName,env:c?"production":"tartan",key:c?_.publicKey:"test_key",product:"auth",selectAccount:!0,onExit:function(){n._isTokenizingBankLogin=!1,d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.closed.by-user"),t(new s(u.US_BANK_ACCOUNT_LOGIN_CLOSED))},onSuccess:function(a,s){o._request({method:"POST",url:l.url+"/tokens",headers:{Authorization:"Bearer "+l.accessToken,"Braintree-Version":"2016-08-25"},data:{type:"plaid_public_token",public_token:a,account_id:s.account_id,ach_mandate:{text:e.mandateText}}},function(e,a,s){var c;return n._isTokenizingBankLogin=!1,e?(c=r(e,s),d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.failed"),void t(c)):(d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.succeeded"),void t(null,i(a)))})}}).open(),void d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.started"))})):void t(new s(u.US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED)):void t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"displayName property is required when using bankLogin."}))},o.prototype._loadPlaid=function(e){var t,o;return e=N(e),n.Plaid?void e(null,n.Plaid):(t=document.querySelector('script[src="'+c.PLAID_LINK_JS+'"]'),void(t?a(t,e):(o=document.createElement("script"),o.src=c.PLAID_LINK_JS,o.async=!0,a(o,e),document.body.appendChild(o),this._plaidScript=o)))},o.prototype.teardown=function(e){this._plaidScript&&document.body.removeChild(this._plaidScript),A(this,E(o.prototype)),e&&(e=l(e))()},t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":1,"../lib/analytics":3,"../lib/camel-case-to-snake-case":4,"../lib/convert-methods-to-error":6,"../lib/deferred":8,"../lib/error":10,"../lib/methods":12,"../lib/once":13,"../lib/throw-if-no-callback":15,"./constants":16,"./errors":17}]},{},[18])(18)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,(t.braintree||(t.braintree={})).usBankAccount=e()}}(function(){return function e(t,n,o){function r(a,s){if(!n[a]){if(!t[a]){var c="function"==typeof require&&require;if(!s&&c)return c(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var _=n[a]={exports:{}};t[a][0].call(_.exports,function(e){var n=t[a][1][e];return r(n?n:e)},_,_.exports,e,t,n,o)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<o.length;a++)r(o[a]);return r}({1:[function(e,t,n){"use strict";function o(e,t){var n,o=t?i(t):{},s=r(e.authorization).attrs,c=i(e.analyticsMetadata);o.braintreeLibraryVersion=a.BRAINTREE_LIBRARY_VERSION;for(n in o._meta)o._meta.hasOwnProperty(n)&&(c[n]=o._meta[n]);return o._meta=c,s.tokenizationKey?o.tokenizationKey=s.tokenizationKey:o.authorizationFingerprint=s.authorizationFingerprint,o}var r=e("./create-authorization-data"),i=e("./json-clone"),a=e("./constants");t.exports=o},{"./constants":5,"./create-authorization-data":7,"./json-clone":11}],2:[function(e,t,n){"use strict";function o(e){return Math.floor(e/1e3)}function r(e,t,n){var r=e.getConfiguration(),s=e._request,c=o(Date.now()),u=r.gatewayConfiguration.analytics.url,_={analytics:[{kind:i.ANALYTICS_PREFIX+t,timestamp:c}]};s({url:u,method:"post",data:a(r,_),timeout:i.ANALYTICS_REQUEST_TIMEOUT_MS},n)}var i=e("./constants"),a=e("./add-metadata");t.exports={sendEvent:r}},{"./add-metadata":1,"./constants":5}],3:[function(e,t,n){"use strict";function o(e){if(!o.types.hasOwnProperty(e.type))throw new Error(e.type+" is not a valid type.");if(!e.code)throw new Error("Error code required.");if(!e.message)throw new Error("Error message required.");this.name="BraintreeError",this.code=e.code,this.message=e.message,this.type=e.type,this.details=e.details}var r=e("./enumerate");o.prototype=Object.create(Error.prototype),o.prototype.constructor=o,o.types=r(["CUSTOMER","MERCHANT","NETWORK","INTERNAL","UNKNOWN"]),t.exports=o},{"./enumerate":9}],4:[function(e,t,n){"use strict";function o(e){return e.replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1_$2").toLowerCase()}t.exports=function(e){return Object.keys(e).reduce(function(t,n){var r=o(n);return t[r]=e[n],t},{})}},{}],5:[function(e,t,n){"use strict";var o="3.7.0",r="web";t.exports={ANALYTICS_PREFIX:"web.",ANALYTICS_REQUEST_TIMEOUT_MS:2e3,INTEGRATION_TIMEOUT_MS:6e4,VERSION:o,INTEGRATION:"custom",SOURCE:"client",PLATFORM:r,BRAINTREE_LIBRARY_VERSION:"braintree/"+r+"/"+o}},{}],6:[function(e,t,n){"use strict";var o=e("./braintree-error"),r=e("../lib/errors");t.exports=function(e,t){t.forEach(function(t){e[t]=function(){throw new o({type:r.METHOD_CALLED_AFTER_TEARDOWN.type,code:r.METHOD_CALLED_AFTER_TEARDOWN.code,message:t+" cannot be called after teardown."})}})}},{"../lib/errors":10,"./braintree-error":3}],7:[function(e,t,n){"use strict";function o(e){return/^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(e)}function r(e){var t=e.split("_"),n=t[0],o=t.slice(2).join("_");return{merchantId:o,environment:n}}function i(e){var t,n,i={attrs:{},configUrl:""};return o(e)?(n=r(e),i.attrs.tokenizationKey=e,i.configUrl=s[n.environment]+"/merchants/"+n.merchantId+"/client_api/v1/configuration"):(t=JSON.parse(a(e)),i.attrs.authorizationFingerprint=t.authorizationFingerprint,i.configUrl=t.configUrl),i}var a=e("../lib/polyfill").atob,s={production:"https://api.braintreegateway.com:443",sandbox:"https://api.sandbox.braintreegateway.com:443"};t.exports=i},{"../lib/polyfill":14}],8:[function(e,t,n){"use strict";t.exports=function(e){return function(){var t=arguments;setTimeout(function(){e.apply(null,t)},1)}}},{}],9:[function(e,t,n){"use strict";function o(e,t){return t=null==t?"":t,e.reduce(function(e,n){return e[n]=t+n,e},{})}t.exports=o},{}],10:[function(e,t,n){"use strict";var o=e("./braintree-error");t.exports={CALLBACK_REQUIRED:{type:o.types.MERCHANT,code:"CALLBACK_REQUIRED"},INSTANTIATION_OPTION_REQUIRED:{type:o.types.MERCHANT,code:"INSTANTIATION_OPTION_REQUIRED"},INCOMPATIBLE_VERSIONS:{type:o.types.MERCHANT,code:"INCOMPATIBLE_VERSIONS"},METHOD_CALLED_AFTER_TEARDOWN:{type:o.types.MERCHANT,code:"METHOD_CALLED_AFTER_TEARDOWN"},BRAINTREE_API_ACCESS_RESTRICTED:{type:o.types.MERCHANT,code:"BRAINTREE_API_ACCESS_RESTRICTED",message:"Your access is restricted and cannot use this part of the Braintree API."}}},{"./braintree-error":3}],11:[function(e,t,n){"use strict";t.exports=function(e){return JSON.parse(JSON.stringify(e))}},{}],12:[function(e,t,n){"use strict";t.exports=function(e){return Object.keys(e).filter(function(t){return"function"==typeof e[t]})}},{}],13:[function(e,t,n){"use strict";function o(e){var t=!1;return function(){t||(t=!0,e.apply(null,arguments))}}t.exports=o},{}],14:[function(e,t,n){(function(e){"use strict";function n(e){var t,n,o,r,i,a,s,c,u=new RegExp("^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$"),_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d="";if(!u.test(e))throw new Error("Non base64 encoded input passed to window.atob polyfill");c=0;do r=_.indexOf(e.charAt(c++)),i=_.indexOf(e.charAt(c++)),a=_.indexOf(e.charAt(c++)),s=_.indexOf(e.charAt(c++)),t=(63&r)<<2|i>>4&3,n=(15&i)<<4|a>>2&15,o=(3&a)<<6|63&s,d+=String.fromCharCode(t)+(n?String.fromCharCode(n):"")+(o?String.fromCharCode(o):"");while(c<e.length);return d}var o="function"==typeof e.atob?e.atob:n;t.exports={atob:o,_atob:n}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],15:[function(e,t,n){"use strict";var o=e("./braintree-error"),r=e("../lib/errors");t.exports=function(e,t){if("function"!=typeof e)throw new o({type:r.CALLBACK_REQUIRED.type,code:r.CALLBACK_REQUIRED.code,message:t+" must include a callback function."})}},{"../lib/errors":10,"./braintree-error":3}],16:[function(e,t,n){"use strict";t.exports={REQUIRED_BANK_DETAILS:["routingNumber","accountNumber","accountType","accountHolderName","billingAddress"],PLAID_LINK_JS:"https://cdn.plaid.com/link/stable/link-initialize.js"}},{}],17:[function(e,t,n){"use strict";var o=e("../lib/braintree-error");t.exports={US_BANK_ACCOUNT_OPTION_REQUIRED:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_OPTION_REQUIRED"},US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS"},US_BANK_ACCOUNT_LOGIN_LOAD_FAILED:{type:o.types.NETWORK,code:"US_BANK_ACCOUNT_LOGIN_LOAD_FAILED",message:"Bank login flow failed to load."},US_BANK_ACCOUNT_LOGIN_CLOSED:{type:o.types.CUSTOMER,code:"US_BANK_ACCOUNT_LOGIN_CLOSED",message:"Customer closed bank login flow before authorizing."},US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE",message:"Another bank login tokenization request is active."},US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR:{type:o.types.NETWORK,code:"US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR",message:"A tokenization network error occurred."},US_BANK_ACCOUNT_FAILED_TOKENIZATION:{type:o.types.CUSTOMER,code:"US_BANK_ACCOUNT_FAILED_TOKENIZATION",message:"The supplied data failed tokenization."},US_BANK_ACCOUNT_NOT_ENABLED:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_NOT_ENABLED",message:"US bank account is not enabled."},US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED:{type:o.types.MERCHANT,code:"US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED",message:"Bank login is not enabled."}}},{"../lib/braintree-error":3}],18:[function(e,t,n){"use strict";function o(e,t){var n,o,d;return c(t,"create"),t=s(t),null==e.client?void t(new r({type:_.INSTANTIATION_OPTION_REQUIRED.type,code:_.INSTANTIATION_OPTION_REQUIRED.code,message:"options.client is required when instantiating US Bank Account."})):(n=e.client.getConfiguration().analyticsMetadata.sdkVersion,n!==u?void t(new r({type:_.INCOMPATIBLE_VERSIONS.type,code:_.INCOMPATIBLE_VERSIONS.code,message:"Client (version "+n+") and US Bank Account (version "+u+") components must be from the same SDK version."})):(o=e.client.getConfiguration().gatewayConfiguration.braintreeApi)?(d=e.client.getConfiguration().gatewayConfiguration.usBankAccount)?void t(null,new a(e)):void t(new r(i.US_BANK_ACCOUNT_NOT_ENABLED)):void t(new r(_.BRAINTREE_API_ACCESS_RESTRICTED)))}var r=e("../lib/braintree-error"),i=e("./errors"),a=e("./us-bank-account"),s=e("../lib/deferred"),c=e("../lib/throw-if-no-callback"),u="3.7.0",_=e("../lib/errors");t.exports={create:o,VERSION:u}},{"../lib/braintree-error":3,"../lib/deferred":8,"../lib/errors":10,"../lib/throw-if-no-callback":15,"./errors":17,"./us-bank-account":19}],19:[function(e,t,n){(function(n){"use strict";function o(e){this._client=e.client,this._isTokenizingBankLogin=!1,d.sendEvent(this._client,"web.usbankaccount.initialized")}function r(e,t){var n;return n=new s(401===t?_.BRAINTREE_API_ACCESS_RESTRICTED:500>t?u.US_BANK_ACCOUNT_FAILED_TOKENIZATION:u.US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR),n.details={originalError:e},n}function i(e){return{nonce:e.data.id,details:{},description:e.data.description,type:e.data.type}}function a(e,t){function o(){var e=this.readyState;e&&"loaded"!==e&&"complete"!==e||(i(),t(null,n.Plaid))}function r(){e.parentNode.removeChild(e),t(new s(u.US_BANK_ACCOUNT_LOGIN_LOAD_FAILED))}function i(){e.removeEventListener("error",r),e.removeEventListener("load",o),e.removeEventListener("readystatechange",o)}e.addEventListener("error",r),e.addEventListener("load",o),e.addEventListener("readystatechange",o)}var s=e("../lib/braintree-error"),c=e("./constants"),u=e("./errors"),_=e("../lib/errors"),d=e("../lib/analytics"),l=e("../lib/deferred"),N=e("../lib/once"),A=e("../lib/convert-methods-to-error"),E=e("../lib/methods"),p=e("../lib/throw-if-no-callback"),T=e("../lib/camel-case-to-snake-case");o.prototype.tokenize=function(e,t){return p(t,"tokenize"),e=e||{},t=l(t),e.mandateText?void(e.bankDetails&&e.bankLogin?t(new s({type:u.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.type,code:u.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.code,message:"tokenize must be called with bankDetails or bankLogin, not both."})):e.bankDetails?this._tokenizeBankDetails(e,t):e.bankLogin?this._tokenizeBankLogin(e,t):t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"tokenize must be called with bankDetails or bankLogin."}))):void t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"mandateText property is required."}))},o.prototype._tokenizeBankDetails=function(e,t){var n,o,a=this._client,_=e.bankDetails,l=a.getConfiguration().gatewayConfiguration.braintreeApi;for(n=0;n<c.REQUIRED_BANK_DETAILS.length;n++)if(o=c.REQUIRED_BANK_DETAILS[n],!_[o])return void t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"bankDetails."+o+" property is required."}));a._request({method:"POST",url:l.url+"/tokens",headers:{Authorization:"Bearer "+l.accessToken,"Braintree-Version":"2016-08-25"},data:{type:"us_bank_account",routing_number:_.routingNumber,account_number:_.accountNumber,account_holder_name:_.accountHolderName,account_type:_.accountType,billing_address:T(_.billingAddress),ach_mandate:{text:e.mandateText}}},function(e,n,o){var s;return e?(s=r(e,o),d.sendEvent(a,"web.usbankaccount.bankdetails.tokenization.failed"),void t(s)):(d.sendEvent(a,"web.usbankaccount.bankdetails.tokenization.succeeded"),void t(null,i(n)))})},o.prototype._tokenizeBankLogin=function(e,t){var n=this,o=this._client,a=o.getConfiguration().gatewayConfiguration,c="production"===a.environment,_=a.usBankAccount.plaid,l=a.braintreeApi;return e.bankLogin.displayName?_?this._isTokenizingBankLogin?void t(new s(u.US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE)):(this._isTokenizingBankLogin=!0,void this._loadPlaid(function(a,N){return a?void t(a):(N.create({clientName:e.bankLogin.displayName,env:c?"production":"tartan",key:c?_.publicKey:"test_key",product:"auth",selectAccount:!0,onExit:function(){n._isTokenizingBankLogin=!1,d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.closed.by-user"),t(new s(u.US_BANK_ACCOUNT_LOGIN_CLOSED))},onSuccess:function(a,s){o._request({method:"POST",url:l.url+"/tokens",headers:{Authorization:"Bearer "+l.accessToken,"Braintree-Version":"2016-08-25"},data:{type:"plaid_public_token",public_token:a,account_id:s.account_id,ach_mandate:{text:e.mandateText}}},function(e,a,s){var c;return n._isTokenizingBankLogin=!1,e?(c=r(e,s),d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.failed"),void t(c)):(d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.succeeded"),void t(null,i(a)))})}}).open(),void d.sendEvent(o,"web.usbankaccount.banklogin.tokenization.started"))})):void t(new s(u.US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED)):void t(new s({type:u.US_BANK_ACCOUNT_OPTION_REQUIRED.type,code:u.US_BANK_ACCOUNT_OPTION_REQUIRED.code,message:"displayName property is required when using bankLogin."}))},o.prototype._loadPlaid=function(e){var t,o;return e=N(e),n.Plaid?void e(null,n.Plaid):(t=document.querySelector('script[src="'+c.PLAID_LINK_JS+'"]'),void(t?a(t,e):(o=document.createElement("script"),o.src=c.PLAID_LINK_JS,o.async=!0,a(o,e),document.body.appendChild(o),this._plaidScript=o)))},o.prototype.teardown=function(e){this._plaidScript&&document.body.removeChild(this._plaidScript),A(this,E(o.prototype)),e&&(e=l(e))()},t.exports=o}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../lib/analytics":2,"../lib/braintree-error":3,"../lib/camel-case-to-snake-case":4,"../lib/convert-methods-to-error":6,"../lib/deferred":8,"../lib/errors":10,"../lib/methods":12,"../lib/once":13,"../lib/throw-if-no-callback":15,"./constants":16,"./errors":17}]},{},[18])(18)});

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc