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,SAAUyV,GAGd,OAFA/B,EAAUgC,UAAUzK,EAAKkH,QAAS,mCAE3BsD,EAASk5D,kBAAkB,EACpC,IACCxvE,OAAM,SAAUG,GAGf,OAFAoU,EAAUgC,UAAUzK,EAAKkH,QAAS,gCAE3BpZ,QAAQ2B,OACb,IAAIoX,EAAe,CACjBxL,KAAMyL,EAAO87D,2BAA2BvnE,KACxCrO,KAAM8Z,EAAO87D,2BAA2B51E,KACxC0W,QAASoD,EAAO87D,2BAA2Bl/D,QAC3CiE,QAAS,CACPC,cAAevT,KAIvB,IAtCOvG,QAAQ2B,OACb,IAAIoX,EAAeC,EAAO67D,gCAsChC,EAcAE,EAAa3wE,UAAU0O,SAAW,WAGhC,OAFAoG,EAAsB1Z,KAAMyZ,EAAQ87D,EAAa3wE,YAE1CpE,QAAQ0B,SACjB,EAEApD,EAAOC,QAAUwL,EAAYE,cAAc8qE,EAE3C,EAAE,CAAC,mBAAmB,IAAI,yBAAyB,IAAI,kCAAkC,IAAI,oBAAoB,IAAI,iBAAiB,IAAI,WAAW,IAAI,0BAA0B,MAAM,CAAC,EAAE,CAAC,KAljxBoL,CAkjxB9K,I","sources":["webpack://www.bowling.com/./node_modules/braintree-web/dist/browser/index.js"],"sourcesContent":["(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 = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(_dereq_,module,exports){\n\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PromiseGlobal = void 0;\nvar promise_polyfill_1 = __importDefault(_dereq_(\"promise-polyfill\"));\nvar PromiseGlobal = \n// eslint-disable-next-line no-undef\ntypeof Promise !== \"undefined\" ? Promise : promise_polyfill_1.default;\nexports.PromiseGlobal = PromiseGlobal;\n\n},{\"promise-polyfill\":68}],2:[function(_dereq_,module,exports){\n\"use strict\";\nvar promise_1 = _dereq_(\"./lib/promise\");\nvar scriptPromiseCache = {};\nfunction loadScript(options) {\n var scriptLoadPromise;\n var stringifiedOptions = JSON.stringify(options);\n if (!options.forceScriptReload) {\n scriptLoadPromise = scriptPromiseCache[stringifiedOptions];\n if (scriptLoadPromise) {\n return scriptLoadPromise;\n }\n }\n var script = document.createElement(\"script\");\n var attrs = options.dataAttributes || {};\n var container = options.container || document.head;\n script.src = options.src;\n script.id = options.id || \"\";\n script.async = true;\n if (options.crossorigin) {\n script.setAttribute(\"crossorigin\", \"\" + options.crossorigin);\n }\n Object.keys(attrs).forEach(function (key) {\n script.setAttribute(\"data-\" + key, \"\" + attrs[key]);\n });\n scriptLoadPromise = new promise_1.PromiseGlobal(function (resolve, reject) {\n script.addEventListener(\"load\", function () {\n resolve(script);\n });\n script.addEventListener(\"error\", function () {\n reject(new Error(options.src + \" failed to load.\"));\n });\n script.addEventListener(\"abort\", function () {\n reject(new Error(options.src + \" has aborted.\"));\n });\n container.appendChild(script);\n });\n scriptPromiseCache[stringifiedOptions] = scriptLoadPromise;\n return scriptLoadPromise;\n}\nloadScript.clearCache = function () {\n scriptPromiseCache = {};\n};\nmodule.exports = loadScript;\n\n},{\"./lib/promise\":1}],3:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/load-script\");\n\n},{\"./dist/load-script\":2}],4:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isAndroid(ua) {\n ua = ua || window.navigator.userAgent;\n return /Android/i.test(ua);\n};\n\n},{}],5:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isChromeOS(ua) {\n ua = ua || window.navigator.userAgent;\n return /CrOS/i.test(ua);\n};\n\n},{}],6:[function(_dereq_,module,exports){\n\"use strict\";\nvar isEdge = _dereq_(\"./is-edge\");\nvar isSamsung = _dereq_(\"./is-samsung\");\nvar isDuckDuckGo = _dereq_(\"./is-duckduckgo\");\nvar isOpera = _dereq_(\"./is-opera\");\nvar isSilk = _dereq_(\"./is-silk\");\nmodule.exports = function isChrome(ua) {\n ua = ua || window.navigator.userAgent;\n return ((ua.indexOf(\"Chrome\") !== -1 || ua.indexOf(\"CriOS\") !== -1) &&\n !isEdge(ua) &&\n !isSamsung(ua) &&\n !isDuckDuckGo(ua) &&\n !isOpera(ua) &&\n !isSilk(ua));\n};\n\n},{\"./is-duckduckgo\":7,\"./is-edge\":8,\"./is-opera\":18,\"./is-samsung\":19,\"./is-silk\":20}],7:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isDuckDuckGo(ua) {\n ua = ua || window.navigator.userAgent;\n return ua.indexOf(\"DuckDuckGo/\") !== -1;\n};\n\n},{}],8:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isEdge(ua) {\n ua = ua || window.navigator.userAgent;\n return ua.indexOf(\"Edge/\") !== -1;\n};\n\n},{}],9:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isFirefox(ua) {\n ua = ua || window.navigator.userAgent;\n return /Firefox/i.test(ua);\n};\n\n},{}],10:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isIe9(ua) {\n ua = ua || window.navigator.userAgent;\n return ua.indexOf(\"MSIE 9\") !== -1;\n};\n\n},{}],11:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isIosFirefox(ua) {\n ua = ua || window.navigator.userAgent;\n return /FxiOS/i.test(ua);\n};\n\n},{}],12:[function(_dereq_,module,exports){\n\"use strict\";\nvar isIos = _dereq_(\"./is-ios\");\nfunction isGoogleSearchApp(ua) {\n return /\\bGSA\\b/.test(ua);\n}\nmodule.exports = function isIosGoogleSearchApp(ua) {\n ua = ua || window.navigator.userAgent;\n return isIos(ua) && isGoogleSearchApp(ua);\n};\n\n},{\"./is-ios\":16}],13:[function(_dereq_,module,exports){\n\"use strict\";\nvar isIos = _dereq_(\"./is-ios\");\nvar isIosFirefox = _dereq_(\"./is-ios-firefox\");\nvar webkitRegexp = /webkit/i;\nfunction isWebkit(ua) {\n return webkitRegexp.test(ua);\n}\nfunction isIosChrome(ua) {\n return ua.indexOf(\"CriOS\") > -1;\n}\nfunction isFacebook(ua) {\n return ua.indexOf(\"FBAN\") > -1;\n}\nmodule.exports = function isIosSafari(ua) {\n ua = ua || window.navigator.userAgent;\n return (isIos(ua) &&\n isWebkit(ua) &&\n !isIosChrome(ua) &&\n !isIosFirefox(ua) &&\n !isFacebook(ua));\n};\n\n},{\"./is-ios\":16,\"./is-ios-firefox\":11}],14:[function(_dereq_,module,exports){\n\"use strict\";\nvar isIos = _dereq_(\"./is-ios\");\nvar isIosGoogleSearchApp = _dereq_(\"./is-ios-google-search-app\");\nmodule.exports = function isIosWebview(ua) {\n ua = ua || window.navigator.userAgent;\n if (isIos(ua)) {\n // The Google Search iOS app is technically a webview and doesn't support popups.\n if (isIosGoogleSearchApp(ua)) {\n return true;\n }\n // Historically, a webview could be identified by the presence of AppleWebKit and _no_ presence of Safari after.\n return /.+AppleWebKit(?!.*Safari)/i.test(ua);\n }\n return false;\n};\n\n},{\"./is-ios\":16,\"./is-ios-google-search-app\":12}],15:[function(_dereq_,module,exports){\n\"use strict\";\nvar isIosWebview = _dereq_(\"./is-ios-webview\");\nmodule.exports = function isIosWKWebview(ua, statusBarVisible) {\n statusBarVisible =\n typeof statusBarVisible !== \"undefined\"\n ? statusBarVisible\n : window.statusbar.visible;\n return isIosWebview(ua) && statusBarVisible;\n};\n\n},{\"./is-ios-webview\":14}],16:[function(_dereq_,module,exports){\n\"use strict\";\nvar isIpadOS = _dereq_(\"./is-ipados\");\nmodule.exports = function isIos(ua, checkIpadOS, document) {\n if (checkIpadOS === void 0) { checkIpadOS = true; }\n ua = ua || window.navigator.userAgent;\n var iOsTest = /iPhone|iPod|iPad/i.test(ua);\n return checkIpadOS ? iOsTest || isIpadOS(ua, document) : iOsTest;\n};\n\n},{\"./is-ipados\":17}],17:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isIpadOS(ua, document) {\n ua = ua || window.navigator.userAgent;\n document = document || window.document;\n // \"ontouchend\" is used to determine if a browser is on an iPad, otherwise\n // user-agents for iPadOS behave/identify as a desktop browser\n return /Mac|iPad/i.test(ua) && \"ontouchend\" in document;\n};\n\n},{}],18:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isOpera(ua) {\n ua = ua || window.navigator.userAgent;\n return (ua.indexOf(\"OPR/\") !== -1 ||\n ua.indexOf(\"Opera/\") !== -1 ||\n ua.indexOf(\"OPT/\") !== -1);\n};\n\n},{}],19:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isSamsungBrowser(ua) {\n ua = ua || window.navigator.userAgent;\n return /SamsungBrowser/i.test(ua);\n};\n\n},{}],20:[function(_dereq_,module,exports){\n\"use strict\";\nmodule.exports = function isSilk(ua) {\n ua = ua || window.navigator.userAgent;\n return ua.indexOf(\"Silk/\") !== -1;\n};\n\n},{}],21:[function(_dereq_,module,exports){\n\"use strict\";\nvar MINIMUM_SUPPORTED_CHROME_IOS_VERSION = 48;\nvar isAndroid = _dereq_(\"./is-android\");\nvar isIosFirefox = _dereq_(\"./is-ios-firefox\");\nvar isIosWebview = _dereq_(\"./is-ios-webview\");\nvar isChrome = _dereq_(\"./is-chrome\");\nvar isSamsungBrowser = _dereq_(\"./is-samsung\");\nvar isDuckDuckGo = _dereq_(\"./is-duckduckgo\");\nfunction isUnsupportedIosChrome(ua) {\n ua = ua || window.navigator.userAgent;\n var match = ua.match(/CriOS\\/(\\d+)\\./);\n if (!match) {\n return false;\n }\n var version = parseInt(match[1], 10);\n return version < MINIMUM_SUPPORTED_CHROME_IOS_VERSION;\n}\nfunction isOperaMini(ua) {\n ua = ua || window.navigator.userAgent;\n return ua.indexOf(\"Opera Mini\") > -1;\n}\nfunction isAndroidWebview(ua) {\n var androidWebviewRegExp = /Version\\/[\\d.]+/i;\n ua = ua || window.navigator.userAgent;\n if (isAndroid(ua)) {\n return (androidWebviewRegExp.test(ua) && !isOperaMini(ua) && !isDuckDuckGo(ua));\n }\n return false;\n}\nfunction isOldSamsungBrowserOrSamsungWebview(ua) {\n return !isChrome(ua) && !isSamsungBrowser(ua) && /samsung/i.test(ua);\n}\nmodule.exports = function supportsPopups(ua) {\n ua = ua || window.navigator.userAgent;\n return !(isIosWebview(ua) ||\n isIosFirefox(ua) ||\n isAndroidWebview(ua) ||\n isOperaMini(ua) ||\n isUnsupportedIosChrome(ua) ||\n isOldSamsungBrowserOrSamsungWebview(ua));\n};\n\n},{\"./is-android\":4,\"./is-chrome\":6,\"./is-duckduckgo\":7,\"./is-ios-firefox\":11,\"./is-ios-webview\":14,\"./is-samsung\":19}],22:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-android\");\n\n},{\"./dist/is-android\":4}],23:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-chrome-os\");\n\n},{\"./dist/is-chrome-os\":5}],24:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-chrome\");\n\n},{\"./dist/is-chrome\":6}],25:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-firefox\");\n\n},{\"./dist/is-firefox\":9}],26:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-ie9\");\n\n},{\"./dist/is-ie9\":10}],27:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-ios-safari\");\n\n},{\"./dist/is-ios-safari\":13}],28:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-ios-webview\");\n\n},{\"./dist/is-ios-webview\":14}],29:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-ios-wkwebview\");\n\n},{\"./dist/is-ios-wkwebview\":15}],30:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-ios\");\n\n},{\"./dist/is-ios\":16}],31:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/is-samsung\");\n\n},{\"./dist/is-samsung\":19}],32:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/supports-popups\");\n\n},{\"./dist/supports-popups\":21}],33:[function(_dereq_,module,exports){\n\"use strict\";\nvar EventEmitter = /** @class */ (function () {\n function EventEmitter() {\n this._events = {};\n }\n EventEmitter.prototype.on = function (event, callback) {\n if (this._events[event]) {\n this._events[event].push(callback);\n }\n else {\n this._events[event] = [callback];\n }\n };\n EventEmitter.prototype.off = function (event, callback) {\n var eventCallbacks = this._events[event];\n if (!eventCallbacks) {\n return;\n }\n var indexOfCallback = eventCallbacks.indexOf(callback);\n eventCallbacks.splice(indexOfCallback, 1);\n };\n EventEmitter.prototype._emit = function (event) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var eventCallbacks = this._events[event];\n if (!eventCallbacks) {\n return;\n }\n eventCallbacks.forEach(function (callback) {\n callback.apply(void 0, args);\n });\n };\n EventEmitter.prototype.hasListener = function (event) {\n var eventCallbacks = this._events[event];\n if (!eventCallbacks) {\n return false;\n }\n return eventCallbacks.length > 0;\n };\n EventEmitter.createChild = function (ChildObject) {\n ChildObject.prototype = Object.create(EventEmitter.prototype, {\n constructor: ChildObject,\n });\n };\n return EventEmitter;\n}());\nmodule.exports = EventEmitter;\n\n},{}],34:[function(_dereq_,module,exports){\n\"use strict\";\nvar GlobalPromise = (typeof Promise !== \"undefined\"\n ? Promise // eslint-disable-line no-undef\n : null);\nvar ExtendedPromise = /** @class */ (function () {\n function ExtendedPromise(options) {\n var _this = this;\n if (typeof options === \"function\") {\n this._promise = new ExtendedPromise.Promise(options);\n return;\n }\n this._promise = new ExtendedPromise.Promise(function (resolve, reject) {\n _this._resolveFunction = resolve;\n _this._rejectFunction = reject;\n });\n options = options || {};\n this._onResolve = options.onResolve || ExtendedPromise.defaultOnResolve;\n this._onReject = options.onReject || ExtendedPromise.defaultOnReject;\n if (ExtendedPromise.shouldCatchExceptions(options)) {\n this._promise.catch(function () {\n // prevents unhandled promise rejection warning\n // in the console for extended promises that\n // that catch the error in an asynchronous manner\n });\n }\n this._resetState();\n }\n ExtendedPromise.defaultOnResolve = function (result) {\n return ExtendedPromise.Promise.resolve(result);\n };\n ExtendedPromise.defaultOnReject = function (err) {\n return ExtendedPromise.Promise.reject(err);\n };\n ExtendedPromise.setPromise = function (PromiseClass) {\n ExtendedPromise.Promise = PromiseClass;\n };\n ExtendedPromise.shouldCatchExceptions = function (options) {\n if (options.hasOwnProperty(\"suppressUnhandledPromiseMessage\")) {\n return Boolean(options.suppressUnhandledPromiseMessage);\n }\n return Boolean(ExtendedPromise.suppressUnhandledPromiseMessage);\n };\n // start Promise methods documented in:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#Methods\n ExtendedPromise.all = function (args) {\n return ExtendedPromise.Promise.all(args);\n };\n ExtendedPromise.allSettled = function (args) {\n return ExtendedPromise.Promise.allSettled(args);\n };\n ExtendedPromise.race = function (args) {\n return ExtendedPromise.Promise.race(args);\n };\n ExtendedPromise.reject = function (arg) {\n return ExtendedPromise.Promise.reject(arg);\n };\n ExtendedPromise.resolve = function (arg) {\n return ExtendedPromise.Promise.resolve(arg);\n };\n ExtendedPromise.prototype.then = function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = this._promise).then.apply(_a, args);\n };\n ExtendedPromise.prototype.catch = function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return (_a = this._promise).catch.apply(_a, args);\n };\n ExtendedPromise.prototype.resolve = function (arg) {\n var _this = this;\n if (this.isFulfilled) {\n return this;\n }\n this._setResolved();\n ExtendedPromise.Promise.resolve()\n .then(function () {\n return _this._onResolve(arg);\n })\n .then(function (argForResolveFunction) {\n _this._resolveFunction(argForResolveFunction);\n })\n .catch(function (err) {\n _this._resetState();\n _this.reject(err);\n });\n return this;\n };\n ExtendedPromise.prototype.reject = function (arg) {\n var _this = this;\n if (this.isFulfilled) {\n return this;\n }\n this._setRejected();\n ExtendedPromise.Promise.resolve()\n .then(function () {\n return _this._onReject(arg);\n })\n .then(function (result) {\n _this._setResolved();\n _this._resolveFunction(result);\n })\n .catch(function (err) {\n return _this._rejectFunction(err);\n });\n return this;\n };\n ExtendedPromise.prototype._resetState = function () {\n this.isFulfilled = false;\n this.isResolved = false;\n this.isRejected = false;\n };\n ExtendedPromise.prototype._setResolved = function () {\n this.isFulfilled = true;\n this.isResolved = true;\n this.isRejected = false;\n };\n ExtendedPromise.prototype._setRejected = function () {\n this.isFulfilled = true;\n this.isResolved = false;\n this.isRejected = true;\n };\n ExtendedPromise.Promise = GlobalPromise;\n return ExtendedPromise;\n}());\nmodule.exports = ExtendedPromise;\n\n},{}],35:[function(_dereq_,module,exports){\n\"use strict\";\nvar set_attributes_1 = _dereq_(\"./lib/set-attributes\");\nvar default_attributes_1 = _dereq_(\"./lib/default-attributes\");\nvar assign_1 = _dereq_(\"./lib/assign\");\nmodule.exports = function createFrame(options) {\n if (options === void 0) { options = {}; }\n var iframe = document.createElement(\"iframe\");\n var config = assign_1.assign({}, default_attributes_1.defaultAttributes, options);\n if (config.style && typeof config.style !== \"string\") {\n assign_1.assign(iframe.style, config.style);\n delete config.style;\n }\n set_attributes_1.setAttributes(iframe, config);\n if (!iframe.getAttribute(\"id\")) {\n iframe.id = iframe.name;\n }\n return iframe;\n};\n\n},{\"./lib/assign\":36,\"./lib/default-attributes\":37,\"./lib/set-attributes\":38}],36:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.assign = void 0;\nfunction assign(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntarget) {\n var objs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n objs[_i - 1] = arguments[_i];\n }\n objs.forEach(function (obj) {\n if (typeof obj !== \"object\") {\n return;\n }\n Object.keys(obj).forEach(function (key) {\n target[key] = obj[key];\n });\n });\n return target;\n}\nexports.assign = assign;\n\n},{}],37:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultAttributes = void 0;\nexports.defaultAttributes = {\n src: \"about:blank\",\n frameBorder: 0,\n allowtransparency: true,\n scrolling: \"no\",\n};\n\n},{}],38:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.setAttributes = void 0;\nfunction setAttributes(element, \n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nattributes) {\n for (var key in attributes) {\n if (attributes.hasOwnProperty(key)) {\n var value = attributes[key];\n if (value == null) {\n element.removeAttribute(key);\n }\n else {\n element.setAttribute(key, value);\n }\n }\n }\n}\nexports.setAttributes = setAttributes;\n\n},{}],39:[function(_dereq_,module,exports){\n'use strict';\n\nfunction uuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0;\n var v = c === 'x' ? r : r & 0x3 | 0x8;\n\n return v.toString(16);\n });\n}\n\nmodule.exports = uuid;\n\n},{}],40:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction deferred(fn) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n setTimeout(function () {\n try {\n fn.apply(void 0, args);\n }\n catch (err) {\n /* eslint-disable no-console */\n console.log(\"Error in callback function\");\n console.log(err);\n /* eslint-enable no-console */\n }\n }, 1);\n };\n}\nexports.deferred = deferred;\n\n},{}],41:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction once(fn) {\n var called = false;\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (!called) {\n called = true;\n fn.apply(void 0, args);\n }\n };\n}\nexports.once = once;\n\n},{}],42:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/* eslint-disable consistent-return */\nfunction promiseOrCallback(promise, callback) {\n if (!callback) {\n return promise;\n }\n promise.then(function (data) { return callback(null, data); }).catch(function (err) { return callback(err); });\n}\nexports.promiseOrCallback = promiseOrCallback;\n\n},{}],43:[function(_dereq_,module,exports){\n\"use strict\";\nvar deferred_1 = _dereq_(\"./lib/deferred\");\nvar once_1 = _dereq_(\"./lib/once\");\nvar promise_or_callback_1 = _dereq_(\"./lib/promise-or-callback\");\nfunction wrapPromise(fn) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var callback;\n var lastArg = args[args.length - 1];\n if (typeof lastArg === \"function\") {\n callback = args.pop();\n callback = once_1.once(deferred_1.deferred(callback));\n }\n // I know, I know, this looks bad. But it's a quirk of the library that\n // we need to allow passing the this context to the original function\n // eslint-disable-next-line @typescript-eslint/ban-ts-ignore\n // @ts-ignore: this has an implicit any\n return promise_or_callback_1.promiseOrCallback(fn.apply(this, args), callback); // eslint-disable-line no-invalid-this\n };\n}\nwrapPromise.wrapPrototype = function (target, options) {\n if (options === void 0) { options = {}; }\n var ignoreMethods = options.ignoreMethods || [];\n var includePrivateMethods = options.transformPrivateMethods === true;\n var methods = Object.getOwnPropertyNames(target.prototype).filter(function (method) {\n var isNotPrivateMethod;\n var isNonConstructorFunction = method !== \"constructor\" &&\n typeof target.prototype[method] === \"function\";\n var isNotAnIgnoredMethod = ignoreMethods.indexOf(method) === -1;\n if (includePrivateMethods) {\n isNotPrivateMethod = true;\n }\n else {\n isNotPrivateMethod = method.charAt(0) !== \"_\";\n }\n return (isNonConstructorFunction && isNotPrivateMethod && isNotAnIgnoredMethod);\n });\n methods.forEach(function (method) {\n var original = target.prototype[method];\n target.prototype[method] = wrapPromise(original);\n });\n return target;\n};\nmodule.exports = wrapPromise;\n\n},{\"./lib/deferred\":40,\"./lib/once\":41,\"./lib/promise-or-callback\":42}],44:[function(_dereq_,module,exports){\n\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar cardTypes = _dereq_(\"./lib/card-types\");\nvar add_matching_cards_to_results_1 = _dereq_(\"./lib/add-matching-cards-to-results\");\nvar is_valid_input_type_1 = _dereq_(\"./lib/is-valid-input-type\");\nvar find_best_match_1 = _dereq_(\"./lib/find-best-match\");\nvar clone_1 = _dereq_(\"./lib/clone\");\nvar customCards = {};\nvar cardNames = {\n VISA: \"visa\",\n MASTERCARD: \"mastercard\",\n AMERICAN_EXPRESS: \"american-express\",\n DINERS_CLUB: \"diners-club\",\n DISCOVER: \"discover\",\n JCB: \"jcb\",\n UNIONPAY: \"unionpay\",\n MAESTRO: \"maestro\",\n ELO: \"elo\",\n MIR: \"mir\",\n HIPER: \"hiper\",\n HIPERCARD: \"hipercard\",\n};\nvar ORIGINAL_TEST_ORDER = [\n cardNames.VISA,\n cardNames.MASTERCARD,\n cardNames.AMERICAN_EXPRESS,\n cardNames.DINERS_CLUB,\n cardNames.DISCOVER,\n cardNames.JCB,\n cardNames.UNIONPAY,\n cardNames.MAESTRO,\n cardNames.ELO,\n cardNames.MIR,\n cardNames.HIPER,\n cardNames.HIPERCARD,\n];\nvar testOrder = clone_1.clone(ORIGINAL_TEST_ORDER);\nfunction findType(cardType) {\n return customCards[cardType] || cardTypes[cardType];\n}\nfunction getAllCardTypes() {\n return testOrder.map(function (cardType) { return clone_1.clone(findType(cardType)); });\n}\nfunction getCardPosition(name, ignoreErrorForNotExisting) {\n if (ignoreErrorForNotExisting === void 0) { ignoreErrorForNotExisting = false; }\n var position = testOrder.indexOf(name);\n if (!ignoreErrorForNotExisting && position === -1) {\n throw new Error('\"' + name + '\" is not a supported card type.');\n }\n return position;\n}\nfunction creditCardType(cardNumber) {\n var results = [];\n if (!is_valid_input_type_1.isValidInputType(cardNumber)) {\n return results;\n }\n if (cardNumber.length === 0) {\n return getAllCardTypes();\n }\n testOrder.forEach(function (cardType) {\n var cardConfiguration = findType(cardType);\n add_matching_cards_to_results_1.addMatchingCardsToResults(cardNumber, cardConfiguration, results);\n });\n var bestMatch = find_best_match_1.findBestMatch(results);\n if (bestMatch) {\n return [bestMatch];\n }\n return results;\n}\ncreditCardType.getTypeInfo = function (cardType) {\n return clone_1.clone(findType(cardType));\n};\ncreditCardType.removeCard = function (name) {\n var position = getCardPosition(name);\n testOrder.splice(position, 1);\n};\ncreditCardType.addCard = function (config) {\n var existingCardPosition = getCardPosition(config.type, true);\n customCards[config.type] = config;\n if (existingCardPosition === -1) {\n testOrder.push(config.type);\n }\n};\ncreditCardType.updateCard = function (cardType, updates) {\n var originalObject = customCards[cardType] || cardTypes[cardType];\n if (!originalObject) {\n throw new Error(\"\\\"\" + cardType + \"\\\" is not a recognized type. Use `addCard` instead.'\");\n }\n if (updates.type && originalObject.type !== updates.type) {\n throw new Error(\"Cannot overwrite type parameter.\");\n }\n var clonedCard = clone_1.clone(originalObject);\n clonedCard = __assign(__assign({}, clonedCard), updates);\n customCards[clonedCard.type] = clonedCard;\n};\ncreditCardType.changeOrder = function (name, position) {\n var currentPosition = getCardPosition(name);\n testOrder.splice(currentPosition, 1);\n testOrder.splice(position, 0, name);\n};\ncreditCardType.resetModifications = function () {\n testOrder = clone_1.clone(ORIGINAL_TEST_ORDER);\n customCards = {};\n};\ncreditCardType.types = cardNames;\nmodule.exports = creditCardType;\n\n},{\"./lib/add-matching-cards-to-results\":45,\"./lib/card-types\":46,\"./lib/clone\":47,\"./lib/find-best-match\":48,\"./lib/is-valid-input-type\":49}],45:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.addMatchingCardsToResults = void 0;\nvar clone_1 = _dereq_(\"./clone\");\nvar matches_1 = _dereq_(\"./matches\");\nfunction addMatchingCardsToResults(cardNumber, cardConfiguration, results) {\n var i, patternLength;\n for (i = 0; i < cardConfiguration.patterns.length; i++) {\n var pattern = cardConfiguration.patterns[i];\n if (!matches_1.matches(cardNumber, pattern)) {\n continue;\n }\n var clonedCardConfiguration = clone_1.clone(cardConfiguration);\n if (Array.isArray(pattern)) {\n patternLength = String(pattern[0]).length;\n }\n else {\n patternLength = String(pattern).length;\n }\n if (cardNumber.length >= patternLength) {\n clonedCardConfiguration.matchStrength = patternLength;\n }\n results.push(clonedCardConfiguration);\n break;\n }\n}\nexports.addMatchingCardsToResults = addMatchingCardsToResults;\n\n},{\"./clone\":47,\"./matches\":50}],46:[function(_dereq_,module,exports){\n\"use strict\";\nvar cardTypes = {\n visa: {\n niceType: \"Visa\",\n type: \"visa\",\n patterns: [4],\n gaps: [4, 8, 12],\n lengths: [16, 18, 19],\n code: {\n name: \"CVV\",\n size: 3,\n },\n },\n mastercard: {\n niceType: \"Mastercard\",\n type: \"mastercard\",\n patterns: [[51, 55], [2221, 2229], [223, 229], [23, 26], [270, 271], 2720],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n \"american-express\": {\n niceType: \"American Express\",\n type: \"american-express\",\n patterns: [34, 37],\n gaps: [4, 10],\n lengths: [15],\n code: {\n name: \"CID\",\n size: 4,\n },\n },\n \"diners-club\": {\n niceType: \"Diners Club\",\n type: \"diners-club\",\n patterns: [[300, 305], 36, 38, 39],\n gaps: [4, 10],\n lengths: [14, 16, 19],\n code: {\n name: \"CVV\",\n size: 3,\n },\n },\n discover: {\n niceType: \"Discover\",\n type: \"discover\",\n patterns: [6011, [644, 649], 65],\n gaps: [4, 8, 12],\n lengths: [16, 19],\n code: {\n name: \"CID\",\n size: 3,\n },\n },\n jcb: {\n niceType: \"JCB\",\n type: \"jcb\",\n patterns: [2131, 1800, [3528, 3589]],\n gaps: [4, 8, 12],\n lengths: [16, 17, 18, 19],\n code: {\n name: \"CVV\",\n size: 3,\n },\n },\n unionpay: {\n niceType: \"UnionPay\",\n type: \"unionpay\",\n patterns: [\n 620,\n [624, 626],\n [62100, 62182],\n [62184, 62187],\n [62185, 62197],\n [62200, 62205],\n [622010, 622999],\n 622018,\n [622019, 622999],\n [62207, 62209],\n [622126, 622925],\n [623, 626],\n 6270,\n 6272,\n 6276,\n [627700, 627779],\n [627781, 627799],\n [6282, 6289],\n 6291,\n 6292,\n 810,\n [8110, 8131],\n [8132, 8151],\n [8152, 8163],\n [8164, 8171],\n ],\n gaps: [4, 8, 12],\n lengths: [14, 15, 16, 17, 18, 19],\n code: {\n name: \"CVN\",\n size: 3,\n },\n },\n maestro: {\n niceType: \"Maestro\",\n type: \"maestro\",\n patterns: [\n 493698,\n [500000, 504174],\n [504176, 506698],\n [506779, 508999],\n [56, 59],\n 63,\n 67,\n 6,\n ],\n gaps: [4, 8, 12],\n lengths: [12, 13, 14, 15, 16, 17, 18, 19],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n elo: {\n niceType: \"Elo\",\n type: \"elo\",\n patterns: [\n 401178,\n 401179,\n 438935,\n 457631,\n 457632,\n 431274,\n 451416,\n 457393,\n 504175,\n [506699, 506778],\n [509000, 509999],\n 627780,\n 636297,\n 636368,\n [650031, 650033],\n [650035, 650051],\n [650405, 650439],\n [650485, 650538],\n [650541, 650598],\n [650700, 650718],\n [650720, 650727],\n [650901, 650978],\n [651652, 651679],\n [655000, 655019],\n [655021, 655058],\n ],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVE\",\n size: 3,\n },\n },\n mir: {\n niceType: \"Mir\",\n type: \"mir\",\n patterns: [[2200, 2204]],\n gaps: [4, 8, 12],\n lengths: [16, 17, 18, 19],\n code: {\n name: \"CVP2\",\n size: 3,\n },\n },\n hiper: {\n niceType: \"Hiper\",\n type: \"hiper\",\n patterns: [637095, 63737423, 63743358, 637568, 637599, 637609, 637612],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n hipercard: {\n niceType: \"Hipercard\",\n type: \"hipercard\",\n patterns: [606282],\n gaps: [4, 8, 12],\n lengths: [16],\n code: {\n name: \"CVC\",\n size: 3,\n },\n },\n};\nmodule.exports = cardTypes;\n\n},{}],47:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clone = void 0;\nfunction clone(originalObject) {\n if (!originalObject) {\n return null;\n }\n return JSON.parse(JSON.stringify(originalObject));\n}\nexports.clone = clone;\n\n},{}],48:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findBestMatch = void 0;\nfunction hasEnoughResultsToDetermineBestMatch(results) {\n var numberOfResultsWithMaxStrengthProperty = results.filter(function (result) { return result.matchStrength; }).length;\n /*\n * if all possible results have a maxStrength property that means the card\n * number is sufficiently long enough to determine conclusively what the card\n * type is\n * */\n return (numberOfResultsWithMaxStrengthProperty > 0 &&\n numberOfResultsWithMaxStrengthProperty === results.length);\n}\nfunction findBestMatch(results) {\n if (!hasEnoughResultsToDetermineBestMatch(results)) {\n return null;\n }\n return results.reduce(function (bestMatch, result) {\n if (!bestMatch) {\n return result;\n }\n /*\n * If the current best match pattern is less specific than this result, set\n * the result as the new best match\n * */\n if (Number(bestMatch.matchStrength) < Number(result.matchStrength)) {\n return result;\n }\n return bestMatch;\n });\n}\nexports.findBestMatch = findBestMatch;\n\n},{}],49:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isValidInputType = void 0;\nfunction isValidInputType(cardNumber) {\n return typeof cardNumber === \"string\" || cardNumber instanceof String;\n}\nexports.isValidInputType = isValidInputType;\n\n},{}],50:[function(_dereq_,module,exports){\n\"use strict\";\n/*\n * Adapted from https://github.com/polvo-labs/card-type/blob/aaab11f80fa1939bccc8f24905a06ae3cd864356/src/cardType.js#L37-L42\n * */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.matches = void 0;\nfunction matchesRange(cardNumber, min, max) {\n var maxLengthToCheck = String(min).length;\n var substr = cardNumber.substr(0, maxLengthToCheck);\n var integerRepresentationOfCardNumber = parseInt(substr, 10);\n min = parseInt(String(min).substr(0, substr.length), 10);\n max = parseInt(String(max).substr(0, substr.length), 10);\n return (integerRepresentationOfCardNumber >= min &&\n integerRepresentationOfCardNumber <= max);\n}\nfunction matchesPattern(cardNumber, pattern) {\n pattern = String(pattern);\n return (pattern.substring(0, cardNumber.length) ===\n cardNumber.substring(0, pattern.length));\n}\nfunction matches(cardNumber, pattern) {\n if (Array.isArray(pattern)) {\n return matchesRange(cardNumber, pattern[0], pattern[1]);\n }\n return matchesPattern(cardNumber, pattern);\n}\nexports.matches = matches;\n\n},{}],51:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Framebus = void 0;\nvar lib_1 = _dereq_(\"./lib\");\nvar DefaultPromise = (typeof window !== \"undefined\" &&\n window.Promise);\nvar Framebus = /** @class */ (function () {\n function Framebus(options) {\n if (options === void 0) { options = {}; }\n this.origin = options.origin || \"*\";\n this.channel = options.channel || \"\";\n this.verifyDomain = options.verifyDomain;\n // if a targetFrames configuration is not passed in,\n // the default behavior is to broadcast the payload\n // to the top level window or to the frame itself.\n // By default, the broadcast function will loop through\n // all the known siblings and children of the window.\n // If a targetFrames array is passed, it will instead\n // only broadcast to those specified targetFrames\n this.targetFrames = options.targetFrames || [];\n this.limitBroadcastToFramesArray = Boolean(options.targetFrames);\n this.isDestroyed = false;\n this.listeners = [];\n this.hasAdditionalChecksForOnListeners = Boolean(this.verifyDomain || this.limitBroadcastToFramesArray);\n }\n Framebus.setPromise = function (PromiseGlobal) {\n Framebus.Promise = PromiseGlobal;\n };\n Framebus.target = function (options) {\n return new Framebus(options);\n };\n Framebus.prototype.addTargetFrame = function (frame) {\n if (!this.limitBroadcastToFramesArray) {\n return;\n }\n this.targetFrames.push(frame);\n };\n Framebus.prototype.include = function (childWindow) {\n if (childWindow == null) {\n return false;\n }\n if (childWindow.Window == null) {\n return false;\n }\n if (childWindow.constructor !== childWindow.Window) {\n return false;\n }\n lib_1.childWindows.push(childWindow);\n return true;\n };\n Framebus.prototype.target = function (options) {\n return Framebus.target(options);\n };\n Framebus.prototype.emit = function (eventName, data, reply) {\n if (this.isDestroyed) {\n return false;\n }\n var origin = this.origin;\n eventName = this.namespaceEvent(eventName);\n if ((0, lib_1.isntString)(eventName)) {\n return false;\n }\n if ((0, lib_1.isntString)(origin)) {\n return false;\n }\n if (typeof data === \"function\") {\n reply = data;\n data = undefined; // eslint-disable-line no-undefined\n }\n var payload = (0, lib_1.packagePayload)(eventName, origin, data, reply);\n if (!payload) {\n return false;\n }\n if (this.limitBroadcastToFramesArray) {\n this.targetFramesAsWindows().forEach(function (frame) {\n (0, lib_1.sendMessage)(frame, payload, origin);\n });\n }\n else {\n (0, lib_1.broadcast)(payload, {\n origin: origin,\n frame: window.top || window.self,\n });\n }\n return true;\n };\n Framebus.prototype.emitAsPromise = function (eventName, data) {\n var _this = this;\n return new Framebus.Promise(function (resolve, reject) {\n var didAttachListener = _this.emit(eventName, data, function (payload) {\n resolve(payload);\n });\n if (!didAttachListener) {\n reject(new Error(\"Listener not added for \\\"\".concat(eventName, \"\\\"\")));\n }\n });\n };\n Framebus.prototype.on = function (eventName, originalHandler) {\n if (this.isDestroyed) {\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n var self = this;\n var origin = this.origin;\n var handler = originalHandler;\n eventName = this.namespaceEvent(eventName);\n if ((0, lib_1.subscriptionArgsInvalid)(eventName, handler, origin)) {\n return false;\n }\n if (this.hasAdditionalChecksForOnListeners) {\n /* eslint-disable no-invalid-this, @typescript-eslint/ban-ts-comment */\n handler = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // @ts-ignore\n if (!self.passesVerifyDomainCheck(this && this.origin)) {\n return;\n }\n // @ts-ignore\n if (!self.hasMatchingTargetFrame(this && this.source)) {\n return;\n }\n originalHandler.apply(void 0, args);\n };\n /* eslint-enable no-invalid-this, @typescript-eslint/ban-ts-comment */\n }\n this.listeners.push({\n eventName: eventName,\n handler: handler,\n originalHandler: originalHandler,\n });\n lib_1.subscribers[origin] = lib_1.subscribers[origin] || {};\n lib_1.subscribers[origin][eventName] = lib_1.subscribers[origin][eventName] || [];\n lib_1.subscribers[origin][eventName].push(handler);\n return true;\n };\n Framebus.prototype.off = function (eventName, originalHandler) {\n var handler = originalHandler;\n if (this.isDestroyed) {\n return false;\n }\n if (this.verifyDomain) {\n for (var i = 0; i < this.listeners.length; i++) {\n var listener = this.listeners[i];\n if (listener.originalHandler === originalHandler) {\n handler = listener.handler;\n }\n }\n }\n eventName = this.namespaceEvent(eventName);\n var origin = this.origin;\n if ((0, lib_1.subscriptionArgsInvalid)(eventName, handler, origin)) {\n return false;\n }\n var subscriberList = lib_1.subscribers[origin] && lib_1.subscribers[origin][eventName];\n if (!subscriberList) {\n return false;\n }\n for (var i = 0; i < subscriberList.length; i++) {\n if (subscriberList[i] === handler) {\n subscriberList.splice(i, 1);\n return true;\n }\n }\n return false;\n };\n Framebus.prototype.teardown = function () {\n if (this.isDestroyed) {\n return;\n }\n this.isDestroyed = true;\n for (var i = 0; i < this.listeners.length; i++) {\n var listener = this.listeners[i];\n this.off(listener.eventName, listener.handler);\n }\n this.listeners.length = 0;\n };\n Framebus.prototype.passesVerifyDomainCheck = function (origin) {\n if (!this.verifyDomain) {\n // always pass this check if no verifyDomain option was set\n return true;\n }\n return this.checkOrigin(origin);\n };\n Framebus.prototype.targetFramesAsWindows = function () {\n if (!this.limitBroadcastToFramesArray) {\n return [];\n }\n return this.targetFrames\n .map(function (frame) {\n // we can't pull off the contentWindow\n // when the iframe is originally added\n // to the array, because if it is not\n // in the DOM at that time, it will have\n // a contentWindow of `null`\n if (frame instanceof HTMLIFrameElement) {\n return frame.contentWindow;\n }\n return frame;\n })\n .filter(function (win) {\n // just in case an iframe element\n // was removed from the DOM\n // and the contentWindow property\n // is null\n return win;\n });\n };\n Framebus.prototype.hasMatchingTargetFrame = function (source) {\n if (!this.limitBroadcastToFramesArray) {\n // always pass this check if we aren't limiting to the target frames\n return true;\n }\n var matchingFrame = this.targetFramesAsWindows().find(function (frame) {\n return frame === source;\n });\n return Boolean(matchingFrame);\n };\n Framebus.prototype.checkOrigin = function (postMessageOrigin) {\n var merchantHost;\n var a = document.createElement(\"a\");\n a.href = location.href;\n if (a.protocol === \"https:\") {\n merchantHost = a.host.replace(/:443$/, \"\");\n }\n else if (a.protocol === \"http:\") {\n merchantHost = a.host.replace(/:80$/, \"\");\n }\n else {\n merchantHost = a.host;\n }\n var merchantOrigin = a.protocol + \"//\" + merchantHost;\n if (merchantOrigin === postMessageOrigin) {\n return true;\n }\n if (this.verifyDomain) {\n return this.verifyDomain(postMessageOrigin);\n }\n return true;\n };\n Framebus.prototype.namespaceEvent = function (eventName) {\n if (!this.channel) {\n return eventName;\n }\n return \"\".concat(this.channel, \":\").concat(eventName);\n };\n Framebus.Promise = DefaultPromise;\n return Framebus;\n}());\nexports.Framebus = Framebus;\n\n},{\"./lib\":59}],52:[function(_dereq_,module,exports){\n\"use strict\";\nvar lib_1 = _dereq_(\"./lib\");\nvar framebus_1 = _dereq_(\"./framebus\");\n(0, lib_1.attach)();\nmodule.exports = framebus_1.Framebus;\n\n},{\"./framebus\":51,\"./lib\":59}],53:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.detach = exports.attach = void 0;\nvar _1 = _dereq_(\"./\");\nvar isAttached = false;\nfunction attach() {\n if (isAttached || typeof window === \"undefined\") {\n return;\n }\n isAttached = true;\n window.addEventListener(\"message\", _1.onMessage, false);\n}\nexports.attach = attach;\n// removeIf(production)\nfunction detach() {\n isAttached = false;\n window.removeEventListener(\"message\", _1.onMessage, false);\n}\nexports.detach = detach;\n// endRemoveIf(production)\n\n},{\"./\":59}],54:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.broadcastToChildWindows = void 0;\nvar _1 = _dereq_(\"./\");\nfunction broadcastToChildWindows(payload, origin, source) {\n for (var i = _1.childWindows.length - 1; i >= 0; i--) {\n var childWindow = _1.childWindows[i];\n if (childWindow.closed) {\n _1.childWindows.splice(i, 1);\n }\n else if (source !== childWindow) {\n (0, _1.broadcast)(payload, {\n origin: origin,\n frame: childWindow.top,\n });\n }\n }\n}\nexports.broadcastToChildWindows = broadcastToChildWindows;\n\n},{\"./\":59}],55:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.broadcast = void 0;\nvar _1 = _dereq_(\"./\");\nfunction broadcast(payload, options) {\n var i = 0;\n var frameToBroadcastTo;\n var origin = options.origin, frame = options.frame;\n try {\n frame.postMessage(payload, origin);\n if ((0, _1.hasOpener)(frame) && frame.opener.top !== window.top) {\n broadcast(payload, {\n origin: origin,\n frame: frame.opener.top,\n });\n }\n // previously, our max value was frame.frames.length\n // but frames.length inherits from window.length\n // which can be overwritten if a developer does\n // `var length = value;` outside of a function\n // scope, it'll prevent us from looping through\n // all the frames. With this, we loop through\n // until there are no longer any frames\n // eslint-disable-next-line no-cond-assign\n while ((frameToBroadcastTo = frame.frames[i])) {\n broadcast(payload, {\n origin: origin,\n frame: frameToBroadcastTo,\n });\n i++;\n }\n }\n catch (_) {\n /* ignored */\n }\n}\nexports.broadcast = broadcast;\n\n},{\"./\":59}],56:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscribers = exports.childWindows = exports.prefix = void 0;\nexports.prefix = \"/*framebus*/\";\nexports.childWindows = [];\nexports.subscribers = {};\n\n},{}],57:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dispatch = void 0;\nvar _1 = _dereq_(\"./\");\nfunction dispatch(origin, event, data, reply, e) {\n if (!_1.subscribers[origin]) {\n return;\n }\n if (!_1.subscribers[origin][event]) {\n return;\n }\n var args = [];\n if (data) {\n args.push(data);\n }\n if (reply) {\n args.push(reply);\n }\n for (var i = 0; i < _1.subscribers[origin][event].length; i++) {\n _1.subscribers[origin][event][i].apply(e, args);\n }\n}\nexports.dispatch = dispatch;\n\n},{\"./\":59}],58:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.hasOpener = void 0;\nfunction hasOpener(frame) {\n if (frame.top !== frame) {\n return false;\n }\n if (frame.opener == null) {\n return false;\n }\n if (frame.opener === frame) {\n return false;\n }\n if (frame.opener.closed === true) {\n return false;\n }\n return true;\n}\nexports.hasOpener = hasOpener;\n\n},{}],59:[function(_dereq_,module,exports){\n\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(_dereq_(\"./attach\"), exports);\n__exportStar(_dereq_(\"./broadcast-to-child-windows\"), exports);\n__exportStar(_dereq_(\"./broadcast\"), exports);\n__exportStar(_dereq_(\"./constants\"), exports);\n__exportStar(_dereq_(\"./dispatch\"), exports);\n__exportStar(_dereq_(\"./has-opener\"), exports);\n__exportStar(_dereq_(\"./is-not-string\"), exports);\n__exportStar(_dereq_(\"./message\"), exports);\n__exportStar(_dereq_(\"./package-payload\"), exports);\n__exportStar(_dereq_(\"./send-message\"), exports);\n__exportStar(_dereq_(\"./subscribe-replier\"), exports);\n__exportStar(_dereq_(\"./subscription-args-invalid\"), exports);\n__exportStar(_dereq_(\"./types\"), exports);\n__exportStar(_dereq_(\"./unpack-payload\"), exports);\n\n},{\"./attach\":53,\"./broadcast\":55,\"./broadcast-to-child-windows\":54,\"./constants\":56,\"./dispatch\":57,\"./has-opener\":58,\"./is-not-string\":60,\"./message\":61,\"./package-payload\":62,\"./send-message\":63,\"./subscribe-replier\":64,\"./subscription-args-invalid\":65,\"./types\":66,\"./unpack-payload\":67}],60:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isntString = void 0;\nfunction isntString(str) {\n return typeof str !== \"string\";\n}\nexports.isntString = isntString;\n\n},{}],61:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.onMessage = void 0;\nvar _1 = _dereq_(\"./\");\nfunction onMessage(e) {\n if ((0, _1.isntString)(e.data)) {\n return;\n }\n var payload = (0, _1.unpackPayload)(e);\n if (!payload) {\n return;\n }\n var data = payload.eventData;\n var reply = payload.reply;\n (0, _1.dispatch)(\"*\", payload.event, data, reply, e);\n (0, _1.dispatch)(e.origin, payload.event, data, reply, e);\n (0, _1.broadcastToChildWindows)(e.data, payload.origin, e.source);\n}\nexports.onMessage = onMessage;\n\n},{\"./\":59}],62:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.packagePayload = void 0;\nvar _1 = _dereq_(\"./\");\nfunction packagePayload(event, origin, data, reply) {\n var packaged;\n var payload = {\n event: event,\n origin: origin,\n };\n if (typeof reply === \"function\") {\n payload.reply = (0, _1.subscribeReplier)(reply, origin);\n }\n payload.eventData = data;\n try {\n packaged = _1.prefix + JSON.stringify(payload);\n }\n catch (e) {\n throw new Error(\"Could not stringify event: \".concat(e.message));\n }\n return packaged;\n}\nexports.packagePayload = packagePayload;\n\n},{\"./\":59}],63:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.sendMessage = void 0;\n/**\n * A basic function for wrapping the sending of postMessages to frames.\n */\nfunction sendMessage(frame, payload, origin) {\n try {\n frame.postMessage(payload, origin);\n }\n catch (error) {\n /* ignored */\n }\n}\nexports.sendMessage = sendMessage;\n\n},{}],64:[function(_dereq_,module,exports){\n\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscribeReplier = void 0;\nvar framebus_1 = _dereq_(\"../framebus\");\nvar uuid_1 = __importDefault(_dereq_(\"@braintree/uuid\"));\nfunction subscribeReplier(fn, origin) {\n var uuid = (0, uuid_1.default)();\n function replier(data, replyOriginHandler) {\n fn(data, replyOriginHandler);\n framebus_1.Framebus.target({\n origin: origin,\n }).off(uuid, replier);\n }\n framebus_1.Framebus.target({\n origin: origin,\n }).on(uuid, replier);\n return uuid;\n}\nexports.subscribeReplier = subscribeReplier;\n\n},{\"../framebus\":51,\"@braintree/uuid\":39}],65:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.subscriptionArgsInvalid = void 0;\nvar _1 = _dereq_(\"./\");\nfunction subscriptionArgsInvalid(event, fn, origin) {\n if ((0, _1.isntString)(event)) {\n return true;\n }\n if (typeof fn !== \"function\") {\n return true;\n }\n return (0, _1.isntString)(origin);\n}\nexports.subscriptionArgsInvalid = subscriptionArgsInvalid;\n\n},{\"./\":59}],66:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n\n},{}],67:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unpackPayload = void 0;\nvar _1 = _dereq_(\"./\");\nfunction unpackPayload(e) {\n var payload;\n if (e.data.slice(0, _1.prefix.length) !== _1.prefix) {\n return false;\n }\n try {\n payload = JSON.parse(e.data.slice(_1.prefix.length));\n }\n catch (err) {\n return false;\n }\n if (payload.reply) {\n var replyOrigin_1 = e.origin;\n var replySource_1 = e.source;\n var replyEvent_1 = payload.reply;\n payload.reply = function reply(replyData) {\n if (!replySource_1) {\n return;\n }\n var replyPayload = (0, _1.packagePayload)(replyEvent_1, replyOrigin_1, replyData);\n if (!replyPayload) {\n return;\n }\n replySource_1.postMessage(replyPayload, replyOrigin_1);\n };\n }\n return payload;\n}\nexports.unpackPayload = unpackPayload;\n\n},{\"./\":59}],68:[function(_dereq_,module,exports){\n'use strict';\n\n/**\n * @this {Promise}\n */\nfunction finallyConstructor(callback) {\n var constructor = this.constructor;\n return this.then(\n function(value) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n return value;\n });\n },\n function(reason) {\n // @ts-ignore\n return constructor.resolve(callback()).then(function() {\n // @ts-ignore\n return constructor.reject(reason);\n });\n }\n );\n}\n\nfunction allSettled(arr) {\n var P = this;\n return new P(function(resolve, reject) {\n if (!(arr && typeof arr.length !== 'undefined')) {\n return reject(\n new TypeError(\n typeof arr +\n ' ' +\n arr +\n ' is not iterable(cannot read property Symbol(Symbol.iterator))'\n )\n );\n }\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n function(e) {\n args[i] = { status: 'rejected', reason: e };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n );\n return;\n }\n }\n args[i] = { status: 'fulfilled', value: val };\n if (--remaining === 0) {\n resolve(args);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n}\n\n// Store setTimeout reference so promise-polyfill will be unaffected by\n// other code modifying setTimeout (like sinon.useFakeTimers())\nvar setTimeoutFunc = setTimeout;\n\nfunction isArray(x) {\n return Boolean(x && typeof x.length !== 'undefined');\n}\n\nfunction noop() {}\n\n// Polyfill for Function.prototype.bind\nfunction bind(fn, thisArg) {\n return function() {\n fn.apply(thisArg, arguments);\n };\n}\n\n/**\n * @constructor\n * @param {Function} fn\n */\nfunction Promise(fn) {\n if (!(this instanceof Promise))\n throw new TypeError('Promises must be constructed via new');\n if (typeof fn !== 'function') throw new TypeError('not a function');\n /** @type {!number} */\n this._state = 0;\n /** @type {!boolean} */\n this._handled = false;\n /** @type {Promise|undefined} */\n this._value = undefined;\n /** @type {!Array<!Function>} */\n this._deferreds = [];\n\n doResolve(fn, this);\n}\n\nfunction handle(self, deferred) {\n while (self._state === 3) {\n self = self._value;\n }\n if (self._state === 0) {\n self._deferreds.push(deferred);\n return;\n }\n self._handled = true;\n Promise._immediateFn(function() {\n var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected;\n if (cb === null) {\n (self._state === 1 ? resolve : reject)(deferred.promise, self._value);\n return;\n }\n var ret;\n try {\n ret = cb(self._value);\n } catch (e) {\n reject(deferred.promise, e);\n return;\n }\n resolve(deferred.promise, ret);\n });\n}\n\nfunction resolve(self, newValue) {\n try {\n // Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n if (newValue === self)\n throw new TypeError('A promise cannot be resolved with itself.');\n if (\n newValue &&\n (typeof newValue === 'object' || typeof newValue === 'function')\n ) {\n var then = newValue.then;\n if (newValue instanceof Promise) {\n self._state = 3;\n self._value = newValue;\n finale(self);\n return;\n } else if (typeof then === 'function') {\n doResolve(bind(then, newValue), self);\n return;\n }\n }\n self._state = 1;\n self._value = newValue;\n finale(self);\n } catch (e) {\n reject(self, e);\n }\n}\n\nfunction reject(self, newValue) {\n self._state = 2;\n self._value = newValue;\n finale(self);\n}\n\nfunction finale(self) {\n if (self._state === 2 && self._deferreds.length === 0) {\n Promise._immediateFn(function() {\n if (!self._handled) {\n Promise._unhandledRejectionFn(self._value);\n }\n });\n }\n\n for (var i = 0, len = self._deferreds.length; i < len; i++) {\n handle(self, self._deferreds[i]);\n }\n self._deferreds = null;\n}\n\n/**\n * @constructor\n */\nfunction Handler(onFulfilled, onRejected, promise) {\n this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n this.onRejected = typeof onRejected === 'function' ? onRejected : null;\n this.promise = promise;\n}\n\n/**\n * Take a potentially misbehaving resolver function and make sure\n * onFulfilled and onRejected are only called once.\n *\n * Makes no guarantees about asynchrony.\n */\nfunction doResolve(fn, self) {\n var done = false;\n try {\n fn(\n function(value) {\n if (done) return;\n done = true;\n resolve(self, value);\n },\n function(reason) {\n if (done) return;\n done = true;\n reject(self, reason);\n }\n );\n } catch (ex) {\n if (done) return;\n done = true;\n reject(self, ex);\n }\n}\n\nPromise.prototype['catch'] = function(onRejected) {\n return this.then(null, onRejected);\n};\n\nPromise.prototype.then = function(onFulfilled, onRejected) {\n // @ts-ignore\n var prom = new this.constructor(noop);\n\n handle(this, new Handler(onFulfilled, onRejected, prom));\n return prom;\n};\n\nPromise.prototype['finally'] = finallyConstructor;\n\nPromise.all = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.all accepts an array'));\n }\n\n var args = Array.prototype.slice.call(arr);\n if (args.length === 0) return resolve([]);\n var remaining = args.length;\n\n function res(i, val) {\n try {\n if (val && (typeof val === 'object' || typeof val === 'function')) {\n var then = val.then;\n if (typeof then === 'function') {\n then.call(\n val,\n function(val) {\n res(i, val);\n },\n reject\n );\n return;\n }\n }\n args[i] = val;\n if (--remaining === 0) {\n resolve(args);\n }\n } catch (ex) {\n reject(ex);\n }\n }\n\n for (var i = 0; i < args.length; i++) {\n res(i, args[i]);\n }\n });\n};\n\nPromise.allSettled = allSettled;\n\nPromise.resolve = function(value) {\n if (value && typeof value === 'object' && value.constructor === Promise) {\n return value;\n }\n\n return new Promise(function(resolve) {\n resolve(value);\n });\n};\n\nPromise.reject = function(value) {\n return new Promise(function(resolve, reject) {\n reject(value);\n });\n};\n\nPromise.race = function(arr) {\n return new Promise(function(resolve, reject) {\n if (!isArray(arr)) {\n return reject(new TypeError('Promise.race accepts an array'));\n }\n\n for (var i = 0, len = arr.length; i < len; i++) {\n Promise.resolve(arr[i]).then(resolve, reject);\n }\n });\n};\n\n// Use polyfill for setImmediate for performance gains\nPromise._immediateFn =\n // @ts-ignore\n (typeof setImmediate === 'function' &&\n function(fn) {\n // @ts-ignore\n setImmediate(fn);\n }) ||\n function(fn) {\n setTimeoutFunc(fn, 0);\n };\n\nPromise._unhandledRejectionFn = function _unhandledRejectionFn(err) {\n if (typeof console !== 'undefined' && console) {\n console.warn('Possible Unhandled Promise Rejection:', err); // eslint-disable-line no-console\n }\n};\n\nmodule.exports = Promise;\n\n},{}],69:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isIos = exports.isIE9 = exports.isSamsungBrowser = exports.isAndroidChrome = exports.isKitKatWebview = void 0;\n// server side rendering check\nvar UA = (typeof window !== \"undefined\" &&\n window.navigator &&\n window.navigator.userAgent);\n// TODO remove this when browser detection is converted to typescript\n/* eslint-disable @typescript-eslint/ban-ts-comment */\n// @ts-ignore\nvar isAndroid = _dereq_(\"@braintree/browser-detection/is-android\");\n// @ts-ignore\nvar isChromeOs = _dereq_(\"@braintree/browser-detection/is-chrome-os\");\n// @ts-ignore\nvar isChrome = _dereq_(\"@braintree/browser-detection/is-chrome\");\n// @ts-ignore\nvar isIos = _dereq_(\"@braintree/browser-detection/is-ios\");\nexports.isIos = isIos;\n// @ts-ignore\nvar isIE9 = _dereq_(\"@braintree/browser-detection/is-ie9\");\nexports.isIE9 = isIE9;\n/* eslint-enable @typescript-eslint/ban-ts-comment */\n// Old Android Webviews used specific versions of Chrome with 0.0.0 as their version suffix\n// https://developer.chrome.com/multidevice/user-agent#webview_user_agent\nvar KITKAT_WEBVIEW_REGEX = /Version\\/\\d\\.\\d* Chrome\\/\\d*\\.0\\.0\\.0/;\nfunction isOldSamsungBrowserOrSamsungWebview(ua) {\n return !isChrome(ua) && ua.indexOf(\"Samsung\") > -1;\n}\nfunction isKitKatWebview(ua) {\n if (ua === void 0) { ua = UA; }\n return isAndroid(ua) && KITKAT_WEBVIEW_REGEX.test(ua);\n}\nexports.isKitKatWebview = isKitKatWebview;\nfunction isAndroidChrome(ua) {\n if (ua === void 0) { ua = UA; }\n return (isAndroid(ua) || isChromeOs(ua)) && isChrome(ua);\n}\nexports.isAndroidChrome = isAndroidChrome;\nfunction isSamsungBrowser(ua) {\n if (ua === void 0) { ua = UA; }\n return /SamsungBrowser/.test(ua) || isOldSamsungBrowserOrSamsungWebview(ua);\n}\nexports.isSamsungBrowser = isSamsungBrowser;\n\n},{\"@braintree/browser-detection/is-android\":22,\"@braintree/browser-detection/is-chrome\":24,\"@braintree/browser-detection/is-chrome-os\":23,\"@braintree/browser-detection/is-ie9\":26,\"@braintree/browser-detection/is-ios\":30}],70:[function(_dereq_,module,exports){\n\"use strict\";\nvar device_1 = _dereq_(\"./lib/device\");\nmodule.exports = function supportsInputFormatting() {\n // Digits get dropped in samsung browser\n return !(0, device_1.isSamsungBrowser)();\n};\n\n},{\"./lib/device\":69}],71:[function(_dereq_,module,exports){\nmodule.exports = _dereq_(\"./dist/supports-input-formatting\");\n\n},{\"./dist/supports-input-formatting\":70}],72:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar errors = _dereq_(\"./errors\");\nvar assign = _dereq_(\"../lib/assign\").assign;\nvar methods = _dereq_(\"../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @class\n * @param {object} options Options\n * @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/american-express.create|braintree.american-express.create} instead.</strong>\n * @classdesc This class allows you use a nonce to interact with American Express Checkout. To accept American Express cards, use Hosted Fields.\n */\nfunction AmericanExpress(options) {\n this._client = options.client;\n}\n\n/**\n * Gets the rewards balance associated with a Braintree nonce.\n * @public\n * @param {object} options Request options\n * @param {string} options.nonce An existing Braintree nonce.\n * @param {callback} [callback] The second argument, <code>data</code>, is the returned server data. If no callback is provided, `getRewardsBalance` returns a promise that resolves with the server data.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * var americanExpress = require('braintree-web/american-express');\n *\n * americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) {\n * var options = {nonce: existingBraintreeNonce};\n * americanExpressInstance.getRewardsBalance(options, function (getErr, payload) {\n * if (getErr || payload.error) {\n * // Handle error\n * return;\n * }\n *\n * console.log('Rewards amount: ' + payload.rewardsAmount);\n * });\n * });\n */\nAmericanExpress.prototype.getRewardsBalance = function (options) {\n var nonce = options.nonce;\n var data;\n\n if (!nonce) {\n return Promise.reject(\n new BraintreeError({\n type: errors.AMEX_NONCE_REQUIRED.type,\n code: errors.AMEX_NONCE_REQUIRED.code,\n message: \"getRewardsBalance must be called with a nonce.\",\n })\n );\n }\n\n data = assign(\n {\n _meta: { source: \"american-express\" },\n paymentMethodNonce: nonce,\n },\n options\n );\n\n delete data.nonce;\n\n return this._client\n .request({\n method: \"get\",\n endpoint: \"payment_methods/amex_rewards_balance\",\n data: data,\n })\n .catch(function (err) {\n return Promise.reject(\n new BraintreeError({\n type: errors.AMEX_NETWORK_ERROR.type,\n code: errors.AMEX_NETWORK_ERROR.code,\n message:\n \"A network error occurred when getting the American Express rewards balance.\",\n details: {\n originalError: err,\n },\n })\n );\n });\n};\n\n/**\n * Gets the Express Checkout nonce profile given a nonce from American Express.\n * @public\n * @param {object} options Request options\n * @param {string} options.nonce An existing nonce from American Express (note that this is <em>not</em> a nonce from Braintree).\n * @param {callback} [callback] The second argument, <code>data</code>, is the returned server data. If no callback is provided, `getExpressCheckoutProfile` returns a promise that resolves with the server data.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * var americanExpress = require('braintree-web/american-express');\n *\n * americanExpress.create({client: clientInstance}, function (createErr, americanExpressInstance) {\n * var options = {nonce: existingAmericanExpressNonce};\n * americanExpressInstance.getExpressCheckoutProfile(options, function (getErr, payload) {\n * if (getErr) {\n * // Handle error\n * return;\n * }\n *\n * console.log('Number of cards: ' + payload.amexExpressCheckoutCards.length);\n * });\n * });\n */\nAmericanExpress.prototype.getExpressCheckoutProfile = function (options) {\n if (!options.nonce) {\n return Promise.reject(\n new BraintreeError({\n type: errors.AMEX_NONCE_REQUIRED.type,\n code: errors.AMEX_NONCE_REQUIRED.code,\n message: \"getExpressCheckoutProfile must be called with a nonce.\",\n })\n );\n }\n\n return this._client\n .request({\n method: \"get\",\n endpoint: \"payment_methods/amex_express_checkout_cards/\" + options.nonce,\n data: {\n _meta: { source: \"american-express\" },\n paymentMethodNonce: options.nonce,\n },\n })\n .catch(function (err) {\n return Promise.reject(\n new BraintreeError({\n type: errors.AMEX_NETWORK_ERROR.type,\n code: errors.AMEX_NETWORK_ERROR.code,\n message:\n \"A network error occurred when getting the American Express Checkout nonce profile.\",\n details: {\n originalError: err,\n },\n })\n );\n });\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/american-express.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * americanExpressInstance.teardown();\n * @example <caption>With callback</caption>\n * americanExpressInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nAmericanExpress.prototype.teardown = function () {\n convertMethodsToError(this, methods(AmericanExpress.prototype));\n\n return Promise.resolve();\n};\n\nmodule.exports = wrapPromise.wrapPrototype(AmericanExpress);\n\n},{\"../lib/assign\":121,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/methods\":155,\"./errors\":73,\"@braintree/wrap-promise\":43}],73:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.American Express - getRewardsBalance Error Codes\n * @description Errors that occur when creating components.\n * @property {MERCHANT} AMEX_NONCE_REQUIRED Occurs when a nonce is not provided to method.\n * @property {NETWORK} AMEX_NETWORK_ERROR Occurs when there is an error communicating with the Braintree gateway.\n */\n\n/**\n * @name BraintreeError.American Express - getExpressCheckoutProfile Error Codes\n * @description Errors that occur when creating components.\n * @property {MERCHANT} AMEX_NONCE_REQUIRED Occurs when a nonce is not provided to method.\n * @property {NETWORK} AMEX_NETWORK_ERROR Occurs when there is an error communicating with the Braintree gateway.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n AMEX_NONCE_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"AMEX_NONCE_REQUIRED\",\n },\n AMEX_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"AMEX_NETWORK_ERROR\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],74:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/american-express\n * @description This module is for use with Amex Express Checkout. To accept American Express cards, use Hosted Fields.\n */\n\nvar AmericanExpress = _dereq_(\"./american-express\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link AmericanExpress} instance. If no callback is provided, `create` returns a promise that resolves with the {@link AmericanExpress} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"American Express\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n options.client = client;\n\n return new AmericanExpress(options);\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./american-express\":72,\"@braintree/wrap-promise\":43}],75:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar errors = _dereq_(\"./errors\");\nvar methods = _dereq_(\"../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @typedef {object} ApplePay~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.cardHolderName The name of the card holder.\n * @property {string} details.dpanLastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, always `ApplePayCard`.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n/**\n * An Apple Pay Payment Authorization Event object.\n * @typedef {object} ApplePayPaymentAuthorizedEvent\n * @external ApplePayPaymentAuthorizedEvent\n * @see {@link https://developer.apple.com/reference/applepayjs/applepaypaymentauthorizedevent ApplePayPaymentAuthorizedEvent}\n */\n\n/**\n * An Apple Pay Payment Request object.\n * @typedef {object} ApplePayPaymentRequest\n * @external ApplePayPaymentRequest\n * @see {@link https://developer.apple.com/reference/applepayjs/1916082-applepay_js_data_types/paymentrequest PaymentRequest}\n */\n\n/**\n * @class\n * @param {object} options Options\n * @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/apple-pay.create|braintree.applePay.create} instead.</strong>\n * @classdesc This class represents an Apple Pay component. Instances of this class have methods for validating the merchant server and tokenizing payments.\n */\nfunction ApplePay(options) {\n this._instantiatedWithClient = Boolean(!options.useDeferredClient);\n this._client = options.client;\n this._createPromise = options.createPromise;\n\n if (this._client) {\n this._setMerchantIdentifier();\n }\n}\n\nApplePay.prototype._waitForClient = function () {\n if (this._client) {\n return Promise.resolve();\n }\n\n return this._createPromise.then(\n function (client) {\n this._client = client;\n\n this._setMerchantIdentifier();\n }.bind(this)\n );\n};\n\nApplePay.prototype._setMerchantIdentifier = function () {\n var applePayConfig =\n this._client.getConfiguration().gatewayConfiguration.applePayWeb;\n\n if (!applePayConfig) {\n return;\n }\n /**\n * @name ApplePay#merchantIdentifier\n * @description A special merchant ID which represents the merchant association with Braintree. Required when using `ApplePaySession.canMakePaymentsWithActiveCard`.\n * @example\n * var promise = ApplePaySession.canMakePaymentsWithActiveCard(applePayInstance.merchantIdentifier);\n * promise.then(function (canMakePaymentsWithActiveCard) {\n * if (canMakePaymentsWithActiveCard) {\n * // Set up Apple Pay buttons\n * }\n * });\n */\n Object.defineProperty(this, \"merchantIdentifier\", {\n value: applePayConfig.merchantIdentifier,\n configurable: false,\n writable: false,\n });\n};\n\n/**\n * Merges a payment request with Braintree defaults to return an {external:ApplePayPaymentRequest}.\n *\n * The following properties are assigned to `paymentRequest` if not already defined. Their default values come from the Braintree gateway.\n * - `countryCode`\n * - `currencyCode`\n * - `merchantCapabilities`\n * - `supportedNetworks`\n * @public\n * @param {external:ApplePayPaymentRequest} paymentRequest The payment request details to apply on top of those from Braintree.\n * @returns {external:ApplePayPaymentRequest|Promise} The decorated `paymentRequest` object. If `useDeferredClient` is used along with an `authorization`, this method will return a promise that resolves with the `paymentRequest` object.\n * @example\n * var applePay = require('braintree-web/apple-pay');\n *\n * applePay.create({client: clientInstance}, function (applePayErr, applePayInstance) {\n * if (applePayErr) {\n * // Handle error here\n * return;\n * }\n *\n * var paymentRequest = applePayInstance.createPaymentRequest({\n * total: {\n * label: 'My Company',\n * amount: '19.99'\n * }\n * });\n *\n * var session = new ApplePaySession(3, paymentRequest);\n *\n * // ...\n * @example <caption>With deferred client</caption>\n * var applePay = require('braintree-web/apple-pay');\n *\n * applePay.create({\n * authorization: 'client-token-or-tokenization-key',\n * useDeferredClient: true\n * }, function (applePayErr, applePayInstance) {\n * if (applePayErr) {\n * // Handle error here\n * return;\n * }\n *\n * applePayInstance.createPaymentRequest({\n * total: {\n * label: 'My Company',\n * amount: '19.99'\n * }\n * }).then(function (paymentRequest) {\n * var session = new ApplePaySession(3, paymentRequest);\n *\n * // ...\n * });\n */\nApplePay.prototype.createPaymentRequest = function (paymentRequest) {\n if (this._instantiatedWithClient) {\n return this._createPaymentRequestSynchronously(paymentRequest);\n }\n\n return this._waitForClient().then(\n function () {\n return this._createPaymentRequestSynchronously(paymentRequest);\n }.bind(this)\n );\n};\n\nApplePay.prototype._createPaymentRequestSynchronously = function (\n paymentRequest\n) {\n var applePay =\n this._client.getConfiguration().gatewayConfiguration.applePayWeb;\n var defaults = {\n countryCode: applePay.countryCode,\n currencyCode: applePay.currencyCode,\n merchantCapabilities: applePay.merchantCapabilities || [\"supports3DS\"],\n supportedNetworks: applePay.supportedNetworks.map(function (network) {\n return network === \"mastercard\" ? \"masterCard\" : network;\n }),\n };\n\n return Object.assign({}, defaults, paymentRequest);\n};\n\n/**\n * Validates your merchant website, as required by `ApplePaySession` before payment can be authorized.\n * @public\n * @param {object} options Options\n * @param {string} options.validationURL The validationURL from an `ApplePayValidateMerchantEvent`.\n * @param {string} options.displayName The canonical name for your store. Use a non-localized name. This parameter should be a UTF-8 string that is a maximum of 64 characters. The system may display this name to the user.\n * @param {callback} [callback] The second argument, <code>data</code>, is the Apple Pay merchant session object. If no callback is provided, `performValidation` returns a promise.\n * Pass the merchant session to your Apple Pay session's `completeMerchantValidation` method.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * var applePay = require('braintree-web/apple-pay');\n *\n * applePay.create({client: clientInstance}, function (applePayErr, applePayInstance) {\n * if (applePayErr) {\n * // Handle error here\n * return;\n * }\n *\n * var paymentRequest = applePayInstance.createPaymentRequest({\n * total: {\n * label: 'My Company',\n * amount: '19.99'\n * }\n * });\n * var session = new ApplePaySession(3, paymentRequest);\n *\n * session.onvalidatemerchant = function (event) {\n * applePayInstance.performValidation({\n * validationURL: event.validationURL,\n * displayName: 'My Great Store'\n * }, function (validationErr, validationData) {\n * if (validationErr) {\n * console.error(validationErr);\n * session.abort();\n * return;\n * }\n *\n * session.completeMerchantValidation(validationData);\n * });\n * };\n * });\n */\nApplePay.prototype.performValidation = function (options) {\n var self = this;\n\n if (!options || !options.validationURL) {\n return Promise.reject(\n new BraintreeError(errors.APPLE_PAY_VALIDATION_URL_REQUIRED)\n );\n }\n\n return this._waitForClient()\n .then(function () {\n var applePayWebSession = {\n validationUrl: options.validationURL,\n domainName: options.domainName || window.location.hostname,\n merchantIdentifier:\n options.merchantIdentifier || self.merchantIdentifier,\n };\n\n if (options.displayName != null) {\n applePayWebSession.displayName = options.displayName;\n }\n\n return self._client.request({\n method: \"post\",\n endpoint: \"apple_pay_web/sessions\",\n data: {\n _meta: { source: \"apple-pay\" },\n applePayWebSession: applePayWebSession,\n },\n });\n })\n .then(function (response) {\n analytics.sendEvent(self._client, \"applepay.performValidation.succeeded\");\n\n return Promise.resolve(response);\n })\n .catch(function (err) {\n analytics.sendEvent(self._client, \"applepay.performValidation.failed\");\n\n if (err.code === \"CLIENT_REQUEST_ERROR\") {\n return Promise.reject(\n new BraintreeError({\n type: errors.APPLE_PAY_MERCHANT_VALIDATION_FAILED.type,\n code: errors.APPLE_PAY_MERCHANT_VALIDATION_FAILED.code,\n message: errors.APPLE_PAY_MERCHANT_VALIDATION_FAILED.message,\n details: {\n originalError: err.details.originalError,\n },\n })\n );\n }\n\n return Promise.reject(\n new BraintreeError({\n type: errors.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.type,\n code: errors.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.code,\n message: errors.APPLE_PAY_MERCHANT_VALIDATION_NETWORK.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n};\n\n/**\n * Tokenizes an Apple Pay payment. This will likely be called in your `ApplePaySession`'s `onpaymentauthorized` callback.\n * @public\n * @param {object} options Options\n * @param {object} options.token The `payment.token` property of an {@link external:ApplePayPaymentAuthorizedEvent}.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link ApplePay~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with a {@link ApplePay~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * var applePay = require('braintree-web/apple-pay');\n *\n * applePay.create({client: clientInstance}, function (applePayErr, applePayInstance) {\n * if (applePayErr) {\n * // Handle error here\n * return;\n * }\n *\n * var paymentRequest = applePayInstance.createPaymentRequest({\n * total: {\n * label: 'My Company',\n * amount: '19.99'\n * }\n * });\n * var session = new ApplePaySession(3, paymentRequest);\n *\n * session.onpaymentauthorized = function (event) {\n * applePayInstance.tokenize({\n * token: event.payment.token\n * }, function (tokenizeErr, tokenizedPayload) {\n * if (tokenizeErr) {\n * session.completePayment(ApplePaySession.STATUS_FAILURE);\n * return;\n * }\n * // Send the tokenizedPayload to your server here!\n *\n * // Once the transaction is complete, call completePayment\n * // to close the Apple Pay sheet\n * session.completePayment(ApplePaySession.STATUS_SUCCESS);\n * });\n * };\n *\n * // ...\n * });\n */\nApplePay.prototype.tokenize = function (options) {\n var self = this;\n\n if (!options.token) {\n return Promise.reject(\n new BraintreeError(errors.APPLE_PAY_PAYMENT_TOKEN_REQUIRED)\n );\n }\n\n return this._waitForClient()\n .then(function () {\n return self._client.request({\n method: \"post\",\n endpoint: \"payment_methods/apple_payment_tokens\",\n data: {\n _meta: {\n source: \"apple-pay\",\n },\n applePaymentToken: Object.assign({}, options.token, {\n // The gateway requires this key to be base64-encoded.\n paymentData: btoa(JSON.stringify(options.token.paymentData)),\n }),\n },\n });\n })\n .then(function (response) {\n analytics.sendEvent(self._client, \"applepay.tokenize.succeeded\");\n\n return Promise.resolve(response.applePayCards[0]);\n })\n .catch(function (err) {\n analytics.sendEvent(self._client, \"applepay.tokenize.failed\");\n\n return Promise.reject(\n new BraintreeError({\n type: errors.APPLE_PAY_TOKENIZATION.type,\n code: errors.APPLE_PAY_TOKENIZATION.code,\n message: errors.APPLE_PAY_TOKENIZATION.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/apple-pay.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * applePayInstance.teardown();\n * @example <caption>With callback</caption>\n * applePayInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nApplePay.prototype.teardown = function () {\n convertMethodsToError(this, methods(ApplePay.prototype));\n\n return Promise.resolve();\n};\n\nmodule.exports = wrapPromise.wrapPrototype(ApplePay);\n\n},{\"../lib/analytics\":119,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/methods\":155,\"./errors\":76,\"@braintree/wrap-promise\":43}],76:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Apple Pay - Creation Error Codes\n * @description Errors that occur when [creating the Apple Pay component](./module-braintree-web_apple-pay.html#.create).\n * @property {MERCHANT} APPLE_PAY_NOT_ENABLED Occurs when the authorization used is not authorized to process Apple Pay.\n */\n\n/**\n * @name BraintreeError.Apple Pay - performValidation Error Codes\n * @description Errors that occur when [validating](./ApplePay.html#performValidation).\n * @property {MERCHANT} APPLE_PAY_VALIDATION_URL_REQUIRED Occurs when the `validationURL` option is not passed in.\n * @property {MERCHANT} APPLE_PAY_MERCHANT_VALIDATION_FAILED Occurs when the website domain has not been registered in the Braintree control panel.\n * @property {NETWORK} APPLE_PAY_MERCHANT_VALIDATION_NETWORK Occurs when an unknown network error occurs.\n */\n\n/**\n * @name BraintreeError.Apple Pay - tokenize Error Codes\n * @description Errors that occur when [tokenizing](./ApplePay.html#tokenize).\n * @property {MERCHANT} APPLE_PAY_PAYMENT_TOKEN_REQUIRED Occurs when the `token` option is not passed in.\n * @property {NETWORK} APPLE_PAY_TOKENIZATION Occurs when an unknown network error occurs.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n APPLE_PAY_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"APPLE_PAY_NOT_ENABLED\",\n message: \"Apple Pay is not enabled for this merchant.\",\n },\n APPLE_PAY_VALIDATION_URL_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"APPLE_PAY_VALIDATION_URL_REQUIRED\",\n message: \"performValidation must be called with a validationURL.\",\n },\n APPLE_PAY_MERCHANT_VALIDATION_NETWORK: {\n type: BraintreeError.types.NETWORK,\n code: \"APPLE_PAY_MERCHANT_VALIDATION_NETWORK\",\n message: \"A network error occurred when validating the Apple Pay merchant.\",\n },\n APPLE_PAY_MERCHANT_VALIDATION_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"APPLE_PAY_MERCHANT_VALIDATION_FAILED\",\n message:\n \"Make sure you have registered your domain name in the Braintree Control Panel.\",\n },\n APPLE_PAY_PAYMENT_TOKEN_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"APPLE_PAY_PAYMENT_TOKEN_REQUIRED\",\n message: \"tokenize must be called with a payment token.\",\n },\n APPLE_PAY_TOKENIZATION: {\n type: BraintreeError.types.NETWORK,\n code: \"APPLE_PAY_TOKENIZATION\",\n message: \"A network error occurred when processing the Apple Pay payment.\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],77:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @module braintree-web/apple-pay\n * @description Accept Apple Pay on the Web. *This component is currently in beta and is subject to change.*\n */\n\nvar ApplePay = _dereq_(\"./apple-pay\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar errors = _dereq_(\"./errors\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.useDeferredClient] Used in conjunction with `authorization`, allows the Apple Pay instance to be available right away by fetching the client configuration in the background. When this option is used, {@link ApplePay#createPaymentRequest} will return a promise that resolves with the configuration instead of returning synchronously.\n * @param {callback} [callback] The second argument, `data`, is the {@link ApplePay} instance. If no callback is provided, `create` returns a promise that resolves with the {@link ApplePay} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"Apple Pay\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n var applePayInstance;\n var createPromise = createDeferredClient\n .create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n })\n .then(function (client) {\n if (!client.getConfiguration().gatewayConfiguration.applePayWeb) {\n return Promise.reject(\n new BraintreeError(errors.APPLE_PAY_NOT_ENABLED)\n );\n }\n\n analytics.sendEvent(client, \"applepay.initialized\");\n\n return client;\n });\n\n options.createPromise = createPromise;\n applePayInstance = new ApplePay(options);\n\n if (!options.useDeferredClient) {\n return createPromise.then(function (client) {\n applePayInstance._client = client;\n\n return applePayInstance;\n });\n }\n\n return applePayInstance;\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./apple-pay\":75,\"./errors\":76,\"@braintree/wrap-promise\":43}],78:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BRAINTREE_VERSION = _dereq_(\"./constants\").BRAINTREE_VERSION;\n\nvar GraphQL = _dereq_(\"./request/graphql\");\nvar request = _dereq_(\"./request\");\nvar isVerifiedDomain = _dereq_(\"../lib/is-verified-domain\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar convertToBraintreeError = _dereq_(\"../lib/convert-to-braintree-error\");\nvar getGatewayConfiguration = _dereq_(\"./get-configuration\").getConfiguration;\nvar createAuthorizationData = _dereq_(\"../lib/create-authorization-data\");\nvar addMetadata = _dereq_(\"../lib/add-metadata\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar once = _dereq_(\"../lib/once\");\nvar deferred = _dereq_(\"../lib/deferred\");\nvar assign = _dereq_(\"../lib/assign\").assign;\nvar analytics = _dereq_(\"../lib/analytics\");\nvar errors = _dereq_(\"./errors\");\nvar VERSION = _dereq_(\"../lib/constants\").VERSION;\nvar GRAPHQL_URLS = _dereq_(\"../lib/constants\").GRAPHQL_URLS;\nvar methods = _dereq_(\"../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar assets = _dereq_(\"../lib/assets\");\nvar FRAUDNET_FNCLS = _dereq_(\"../lib/constants\").FRAUDNET_FNCLS;\nvar FRAUDNET_SOURCE = _dereq_(\"../lib/constants\").FRAUDNET_SOURCE;\nvar FRAUDNET_URL = _dereq_(\"../lib/constants\").FRAUDNET_URL;\n\nvar cachedClients = {};\n\n/**\n * This object is returned by {@link Client#getConfiguration|getConfiguration}. This information is used extensively by other Braintree modules to properly configure themselves.\n * @typedef {object} Client~configuration\n * @property {object} client The braintree-web/client parameters.\n * @property {string} client.authorization A tokenizationKey or clientToken.\n * @property {object} gatewayConfiguration Gateway-supplied configuration.\n * @property {object} analyticsMetadata Analytics-specific data.\n * @property {string} analyticsMetadata.sessionId Uniquely identifies a browsing session.\n * @property {string} analyticsMetadata.sdkVersion The braintree.js version.\n * @property {string} analyticsMetadata.merchantAppId Identifies the merchant's web app.\n */\n\n/**\n * @class\n * @param {Client~configuration} configuration Options\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/client.create|braintree.client.create} instead.</strong>\n * @classdesc This class is required by many other Braintree components. It serves as the base API layer that communicates with our servers. It is also capable of being used to formulate direct calls to our servers, such as direct credit card tokenization. See {@link Client#request}.\n */\nfunction Client(configuration) {\n var configurationJSON, gatewayConfiguration;\n\n configuration = configuration || {};\n\n configurationJSON = JSON.stringify(configuration);\n gatewayConfiguration = configuration.gatewayConfiguration;\n\n if (!gatewayConfiguration) {\n throw new BraintreeError(errors.CLIENT_MISSING_GATEWAY_CONFIGURATION);\n }\n\n [\"assetsUrl\", \"clientApiUrl\", \"configUrl\"].forEach(function (property) {\n if (\n property in gatewayConfiguration &&\n !isVerifiedDomain(gatewayConfiguration[property])\n ) {\n throw new BraintreeError({\n type: errors.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,\n code: errors.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,\n message: property + \" property is on an invalid domain.\",\n });\n }\n });\n\n /**\n * Returns a copy of the configuration values.\n * @public\n * @returns {Client~configuration} configuration\n */\n this.getConfiguration = function () {\n return JSON.parse(configurationJSON);\n };\n\n this._request = request;\n this._configuration = this.getConfiguration();\n\n this._clientApiBaseUrl = gatewayConfiguration.clientApiUrl + \"/v1/\";\n\n if (gatewayConfiguration.graphQL) {\n if (!isVerifiedDomain(gatewayConfiguration.graphQL.url)) {\n throw new BraintreeError({\n type: errors.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.type,\n code: errors.CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN.code,\n message: \"graphQL.url property is on an invalid domain.\",\n });\n }\n\n this._graphQL = new GraphQL({\n graphQL: gatewayConfiguration.graphQL,\n });\n }\n}\n\nClient.initialize = function (options) {\n var clientInstance, authData;\n var promise = cachedClients[options.authorization];\n\n if (promise) {\n analytics.sendEvent(promise, \"custom.client.load.cached\");\n\n return promise;\n }\n\n try {\n authData = createAuthorizationData(options.authorization);\n } catch (err) {\n return Promise.reject(\n new BraintreeError(errors.CLIENT_INVALID_AUTHORIZATION)\n );\n }\n\n promise = getGatewayConfiguration(authData).then(function (configuration) {\n if (options.debug) {\n configuration.isDebug = true;\n }\n\n configuration.authorization = options.authorization;\n\n clientInstance = new Client(configuration);\n\n return clientInstance;\n });\n\n cachedClients[options.authorization] = promise;\n\n analytics.sendEvent(promise, \"custom.client.load.initialized\");\n\n return promise\n .then(function (client) {\n analytics.sendEvent(clientInstance, \"custom.client.load.succeeded\");\n\n return client;\n })\n .catch(function (err) {\n delete cachedClients[options.authorization];\n\n return Promise.reject(err);\n });\n};\n\n// Primarily used for testing the client initalization call\nClient.clearCache = function () {\n cachedClients = {};\n};\n\nClient.prototype._findOrCreateFraudnetJSON = function (clientMetadataId) {\n var el = document.querySelector('script[fncls=\"' + FRAUDNET_FNCLS + '\"]');\n var config, additionalData, authorizationFingerprint, parameters;\n\n if (!el) {\n el = document.body.appendChild(document.createElement(\"script\"));\n el.type = \"application/json\";\n el.setAttribute(\"fncls\", FRAUDNET_FNCLS);\n }\n\n config = this.getConfiguration();\n additionalData = {\n rda_tenant: \"bt_card\", // eslint-disable-line camelcase\n mid: config.gatewayConfiguration.merchantId,\n };\n authorizationFingerprint = config.authorizationFingerprint;\n\n if (authorizationFingerprint) {\n authorizationFingerprint.split(\"&\").forEach(function (pieces) {\n var component = pieces.split(\"=\");\n\n if (component[0] === \"customer_id\" && component.length > 1) {\n additionalData.cid = component[1];\n }\n });\n }\n\n parameters = {\n f: clientMetadataId.substr(0, 32),\n fp: additionalData,\n bu: false,\n s: FRAUDNET_SOURCE,\n };\n el.text = JSON.stringify(parameters);\n};\n\n/**\n * Used by other modules to formulate all network requests to the Braintree gateway. It is also capable of being used directly from your own form to tokenize credit card information. However, be sure to satisfy PCI compliance if you use direct card tokenization.\n * @public\n * @param {object} options Request options:\n * @param {string} options.method HTTP method, e.g. \"get\" or \"post\".\n * @param {string} options.endpoint Endpoint path, e.g. \"payment_methods\".\n * @param {object} options.data Data to send with the request.\n * @param {number} [options.timeout=60000] Set a timeout (in milliseconds) for the request.\n * @param {callback} [callback] The second argument, <code>data</code>, is the returned server data.\n * @example\n * <caption>Direct Credit Card Tokenization</caption>\n * var createClient = require('braintree-web/client').create;\n *\n * createClient({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (createErr, clientInstance) {\n * var form = document.getElementById('my-form-id');\n * var data = {\n * creditCard: {\n * number: form['cc-number'].value,\n * cvv: form['cc-cvv'].value,\n * expirationDate: form['cc-expiration-date'].value,\n * billingAddress: {\n * postalCode: form['cc-postal-code'].value\n * },\n * options: {\n * validate: false\n * }\n * }\n * };\n *\n * // Warning: For a merchant to be eligible for the easiest level of PCI compliance (SAQ A),\n * // payment fields cannot be hosted on your checkout page.\n * // For an alternative to the following, use Hosted Fields.\n * clientInstance.request({\n * endpoint: 'payment_methods/credit_cards',\n * method: 'post',\n * data: data\n * }, function (requestErr, response) {\n * // More detailed example of handling API errors: https://codepen.io/braintree/pen/MbwjdM\n * if (requestErr) { throw new Error(requestErr); }\n *\n * console.log('Got nonce:', response.creditCards[0].nonce);\n * });\n * });\n * @example\n * <caption>Tokenizing Fields for AVS Checks</caption>\n * var createClient = require('braintree-web/client').create;\n *\n * createClient({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (createErr, clientInstance) {\n * var form = document.getElementById('my-form-id');\n * var data = {\n * creditCard: {\n * number: form['cc-number'].value,\n * cvv: form['cc-cvv'].value,\n * expirationDate: form['cc-date'].value,\n * // The billing address can be checked with AVS rules.\n * // See: https://articles.braintreepayments.com/support/guides/fraud-tools/basic/avs-cvv-rules\n * billingAddress: {\n * postalCode: form['cc-postal-code'].value,\n * streetAddress: form['cc-street-address'].value,\n * countryName: form['cc-country-name'].value,\n * countryCodeAlpha2: form['cc-country-alpha2'].value,\n * countryCodeAlpha3: form['cc-country-alpha3'].value,\n * countryCodeNumeric: form['cc-country-numeric'].value\n * },\n * options: {\n * validate: false\n * }\n * }\n * };\n *\n * // Warning: For a merchant to be eligible for the easiest level of PCI compliance (SAQ A),\n * // payment fields cannot be hosted on your checkout page.\n * // For an alternative to the following, use Hosted Fields.\n * clientInstance.request({\n * endpoint: 'payment_methods/credit_cards',\n * method: 'post',\n * data: data\n * }, function (requestErr, response) {\n * // More detailed example of handling API errors: https://codepen.io/braintree/pen/MbwjdM\n * if (requestErr) { throw new Error(requestErr); }\n *\n * console.log('Got nonce:', response.creditCards[0].nonce);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nClient.prototype.request = function (options, callback) {\n var self = this; // eslint-disable-line no-invalid-this\n var requestPromise = new Promise(function (resolve, reject) {\n var optionName, api, baseUrl, requestOptions;\n var shouldCollectData = Boolean(\n options.endpoint === \"payment_methods/credit_cards\" &&\n self.getConfiguration().gatewayConfiguration.creditCards\n .collectDeviceData\n );\n\n if (options.api !== \"graphQLApi\") {\n if (!options.method) {\n optionName = \"options.method\";\n } else if (!options.endpoint) {\n optionName = \"options.endpoint\";\n }\n }\n\n if (optionName) {\n throw new BraintreeError({\n type: errors.CLIENT_OPTION_REQUIRED.type,\n code: errors.CLIENT_OPTION_REQUIRED.code,\n message: optionName + \" is required when making a request.\",\n });\n }\n\n if (\"api\" in options) {\n api = options.api;\n } else {\n api = \"clientApi\";\n }\n\n requestOptions = {\n method: options.method,\n graphQL: self._graphQL,\n timeout: options.timeout,\n metadata: self._configuration.analyticsMetadata,\n };\n\n if (api === \"clientApi\") {\n baseUrl = self._clientApiBaseUrl;\n\n requestOptions.data = addMetadata(self._configuration, options.data);\n } else if (api === \"graphQLApi\") {\n baseUrl =\n GRAPHQL_URLS[self._configuration.gatewayConfiguration.environment];\n options.endpoint = \"\";\n requestOptions.method = \"post\";\n requestOptions.data = assign(\n {\n clientSdkMetadata: {\n platform: self._configuration.analyticsMetadata.platform,\n source: self._configuration.analyticsMetadata.source,\n integration: self._configuration.analyticsMetadata.integration,\n sessionId: self._configuration.analyticsMetadata.sessionId,\n version: VERSION,\n },\n },\n options.data\n );\n\n requestOptions.headers = getAuthorizationHeadersForGraphQL(\n self._configuration\n );\n } else {\n throw new BraintreeError({\n type: errors.CLIENT_OPTION_INVALID.type,\n code: errors.CLIENT_OPTION_INVALID.code,\n message: \"options.api is invalid.\",\n });\n }\n\n requestOptions.url = baseUrl + options.endpoint;\n requestOptions.sendAnalyticsEvent = function (kind) {\n analytics.sendEvent(self, kind);\n };\n\n self._request(requestOptions, function (err, data, status) {\n var resolvedData, requestError;\n\n requestError = formatRequestError(status, err);\n\n if (requestError) {\n reject(requestError);\n\n return;\n }\n\n if (api === \"graphQLApi\" && data.errors) {\n reject(\n convertToBraintreeError(data.errors, {\n type: errors.CLIENT_GRAPHQL_REQUEST_ERROR.type,\n code: errors.CLIENT_GRAPHQL_REQUEST_ERROR.code,\n message: errors.CLIENT_GRAPHQL_REQUEST_ERROR.message,\n })\n );\n\n return;\n }\n\n resolvedData = assign({ _httpStatus: status }, data);\n\n if (\n shouldCollectData &&\n resolvedData.creditCards &&\n resolvedData.creditCards.length > 0\n ) {\n self._findOrCreateFraudnetJSON(resolvedData.creditCards[0].nonce);\n\n assets.loadScript({\n src: FRAUDNET_URL,\n forceScriptReload: true,\n });\n }\n resolve(resolvedData);\n });\n });\n\n if (typeof callback === \"function\") {\n callback = once(deferred(callback));\n\n requestPromise\n .then(function (response) {\n callback(null, response, response._httpStatus);\n })\n .catch(function (err) {\n var status = err && err.details && err.details.httpStatus;\n\n callback(err, null, status);\n });\n\n return;\n }\n\n return requestPromise; // eslint-disable-line consistent-return\n};\n\n// eslint-disable-next-line consistent-return\nfunction formatRequestError(status, err) {\n var requestError;\n\n if (status === -1) {\n requestError = new BraintreeError(errors.CLIENT_REQUEST_TIMEOUT);\n } else if (status === 401) {\n requestError = new BraintreeError(errors.CLIENT_AUTHORIZATION_INVALID);\n } else if (status === 403) {\n requestError = new BraintreeError(errors.CLIENT_AUTHORIZATION_INSUFFICIENT);\n } else if (status === 429) {\n requestError = new BraintreeError(errors.CLIENT_RATE_LIMITED);\n } else if (status >= 500) {\n requestError = new BraintreeError(errors.CLIENT_GATEWAY_NETWORK);\n } else if (status < 200 || status >= 400) {\n requestError = convertToBraintreeError(err, {\n type: errors.CLIENT_REQUEST_ERROR.type,\n code: errors.CLIENT_REQUEST_ERROR.code,\n message: errors.CLIENT_REQUEST_ERROR.message,\n });\n }\n\n if (requestError) {\n requestError.details = requestError.details || {};\n requestError.details.httpStatus = status;\n\n return requestError;\n }\n}\n\nClient.prototype.toJSON = function () {\n return this.getConfiguration();\n};\n\n/**\n * Returns the Client version.\n * @public\n * @returns {String} The created client's version.\n * @example\n * var createClient = require('braintree-web/client').create;\n *\n * createClient({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (createErr, clientInstance) {\n * console.log(clientInstance.getVersion()); // Ex: 1.0.0\n * });\n * @returns {void}\n */\nClient.prototype.getVersion = function () {\n return VERSION;\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/client.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * clientInstance.teardown();\n * @example <caption>With callback</caption>\n * clientInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nClient.prototype.teardown = wrapPromise(function () {\n var self = this; // eslint-disable-line no-invalid-this\n\n delete cachedClients[self.getConfiguration().authorization];\n convertMethodsToError(self, methods(Client.prototype));\n\n return Promise.resolve();\n});\n\nfunction getAuthorizationHeadersForGraphQL(configuration) {\n var token =\n configuration.authorizationFingerprint || configuration.authorization;\n\n return {\n Authorization: \"Bearer \" + token,\n \"Braintree-Version\": BRAINTREE_VERSION,\n };\n}\n\nmodule.exports = Client;\n\n},{\"../lib/add-metadata\":118,\"../lib/analytics\":119,\"../lib/assets\":120,\"../lib/assign\":121,\"../lib/braintree-error\":124,\"../lib/constants\":126,\"../lib/convert-methods-to-error\":127,\"../lib/convert-to-braintree-error\":128,\"../lib/create-authorization-data\":130,\"../lib/deferred\":132,\"../lib/is-verified-domain\":153,\"../lib/methods\":155,\"../lib/once\":156,\"./constants\":79,\"./errors\":80,\"./get-configuration\":81,\"./request\":92,\"./request/graphql\":90,\"@braintree/wrap-promise\":43}],79:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n BRAINTREE_VERSION: \"2018-05-10\",\n};\n\n},{}],80:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Client - Internal Error Codes\n * @ignore\n * @description These codes should never be experienced by the merchant directly.\n * @property {MERCHANT} CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN An error to prevent client creation for domains that are not allowed in the JS.\n * @property {INTERNAL} CLIENT_MISSING_GATEWAY_CONFIGURATION Occurs when the client is created without a gateway configuration. Should never happen.\n */\n\n/**\n * @name BraintreeError.Client - Create Error Codes\n * @description Errors that may occur when [creating the client](./module-braintree-web_client.html#.create)\n * @property {MERCHANT} CLIENT_INVALID_AUTHORIZATION Occurs when client token cannot be parsed.\n */\n\n/**\n * @name BraintreeError.Client - Request Error Codes\n * @description Errors that may occur when [using the request method](./Client.html#request)\n * @property {MERCHANT} CLIENT_OPTION_REQUIRED An option required in the request method was not provided. Usually `options.method` or `options.endpoint`\n * @property {MERCHANT} CLIENT_OPTION_INVALID The request option provided is invalid.\n * @property {MERCHANT} CLIENT_GATEWAY_NETWORK The Braintree gateway could not be contacted.\n * @property {NETWORK} CLIENT_REQUEST_TIMEOUT The request took too long to complete and timed out.\n * @property {NETWORK} CLIENT_REQUEST_ERROR The response from a request had status 400 or greater.\n * @property {NETWORK} CLIENT_GRAPHQL_REQUEST_ERROR The response from a request to GraphQL contained an error.\n * @property {MERCHANT} CLIENT_RATE_LIMITED The response from a request had a status of 429, indicating rate limiting.\n * @property {MERCHANT} CLIENT_AUTHORIZATION_INSUFFICIENT The user associated with the client token or tokenization key does not have permissions to make the request.\n * @property {MERCHANT} CLIENT_AUTHORIZATION_INVALID The provided authorization could not be found. Either the client token has expired and a new client token must be generated or the tokenization key used is set to be inactive or has been deleted.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN: {\n type: BraintreeError.types.MERCHANT,\n code: \"CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN\",\n },\n CLIENT_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"CLIENT_OPTION_REQUIRED\",\n },\n CLIENT_OPTION_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"CLIENT_OPTION_INVALID\",\n },\n CLIENT_MISSING_GATEWAY_CONFIGURATION: {\n type: BraintreeError.types.INTERNAL,\n code: \"CLIENT_MISSING_GATEWAY_CONFIGURATION\",\n message: \"Missing gatewayConfiguration.\",\n },\n CLIENT_INVALID_AUTHORIZATION: {\n type: BraintreeError.types.MERCHANT,\n code: \"CLIENT_INVALID_AUTHORIZATION\",\n message:\n \"Authorization is invalid. Make sure your client token or tokenization key is valid.\",\n },\n CLIENT_GATEWAY_NETWORK: {\n type: BraintreeError.types.NETWORK,\n code: \"CLIENT_GATEWAY_NETWORK\",\n message: \"Cannot contact the gateway at this time.\",\n },\n CLIENT_REQUEST_TIMEOUT: {\n type: BraintreeError.types.NETWORK,\n code: \"CLIENT_REQUEST_TIMEOUT\",\n message: \"Request timed out waiting for a reply.\",\n },\n CLIENT_REQUEST_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"CLIENT_REQUEST_ERROR\",\n message: \"There was a problem with your request.\",\n },\n CLIENT_GRAPHQL_REQUEST_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"CLIENT_GRAPHQL_REQUEST_ERROR\",\n message: \"There was a problem with your request.\",\n },\n CLIENT_RATE_LIMITED: {\n type: BraintreeError.types.MERCHANT,\n code: \"CLIENT_RATE_LIMITED\",\n message: \"You are being rate-limited; please try again in a few minutes.\",\n },\n CLIENT_AUTHORIZATION_INSUFFICIENT: {\n type: BraintreeError.types.MERCHANT,\n code: \"CLIENT_AUTHORIZATION_INSUFFICIENT\",\n message: \"The authorization used has insufficient privileges.\",\n },\n CLIENT_AUTHORIZATION_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"CLIENT_AUTHORIZATION_INVALID\",\n message:\n \"Either the client token has expired and a new one should be generated or the tokenization key has been deactivated or deleted.\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],81:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar request = _dereq_(\"./request\");\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar constants = _dereq_(\"../lib/constants\");\nvar errors = _dereq_(\"./errors\");\nvar GraphQL = _dereq_(\"./request/graphql\");\nvar GRAPHQL_URLS = _dereq_(\"../lib/constants\").GRAPHQL_URLS;\nvar isDateStringBeforeOrOn = _dereq_(\"../lib/is-date-string-before-or-on\");\n\nvar BRAINTREE_VERSION = _dereq_(\"./constants\").BRAINTREE_VERSION;\n\nfunction getConfiguration(authData) {\n return new Promise(function (resolve, reject) {\n var configuration, attrs, configUrl, reqOptions;\n var sessionId = uuid();\n var analyticsMetadata = {\n merchantAppId: window.location.host,\n platform: constants.PLATFORM,\n sdkVersion: constants.VERSION,\n source: constants.SOURCE,\n // NEXT_MAJOR_VERSION remove one of these to not duplicate data. Target parity with mobile platforms approach.\n integration: constants.INTEGRATION,\n integrationType: constants.INTEGRATION,\n sessionId: sessionId,\n };\n\n attrs = authData.attrs;\n configUrl = authData.configUrl;\n\n attrs._meta = analyticsMetadata;\n attrs.braintreeLibraryVersion = constants.BRAINTREE_LIBRARY_VERSION;\n attrs.configVersion = \"3\";\n\n reqOptions = {\n url: configUrl,\n method: \"GET\",\n data: attrs,\n };\n\n if (attrs.authorizationFingerprint && authData.graphQL) {\n if (isDateStringBeforeOrOn(authData.graphQL.date, BRAINTREE_VERSION)) {\n reqOptions.graphQL = new GraphQL({\n graphQL: {\n url: authData.graphQL.url,\n features: [\"configuration\"],\n },\n });\n }\n\n reqOptions.metadata = analyticsMetadata;\n } else if (attrs.tokenizationKey) {\n reqOptions.graphQL = new GraphQL({\n graphQL: {\n url: GRAPHQL_URLS[authData.environment],\n features: [\"configuration\"],\n },\n });\n\n reqOptions.metadata = analyticsMetadata;\n }\n\n // NEXT_MAJOR_VERSION\n // there are various issues with the config endpoint where the values returned\n // do not match the values from the merchant account id passed into a client token\n // we need to update the configuration request endpoint to be able to pass the\n // correct values. The following ones are incorrect\n // * applePayWeb - definitely supportedNetworks, which compiles all the card\n // networks from all the merchant accounts instead of providing just the\n // ones from the specified one. The same is probably true for ios apple pay\n // Also the merchantidentifier\n // NEXT_MAJOR_VERSION Allow passing in merchant account id when creating the component\n // to fetch the config for that merchant account id (particularly helpful when using\n // a tokenization key for authorization)\n request(reqOptions, function (err, response, status) {\n var errorTemplate;\n\n if (err) {\n if (status === 403) {\n errorTemplate = errors.CLIENT_AUTHORIZATION_INSUFFICIENT;\n } else if (status === 401) {\n errorTemplate = errors.CLIENT_AUTHORIZATION_INVALID;\n } else {\n errorTemplate = errors.CLIENT_GATEWAY_NETWORK;\n }\n\n reject(\n new BraintreeError({\n type: errorTemplate.type,\n code: errorTemplate.code,\n message: errorTemplate.message,\n details: {\n originalError: err,\n },\n })\n );\n\n return;\n }\n\n configuration = {\n authorizationType: attrs.tokenizationKey\n ? \"TOKENIZATION_KEY\"\n : \"CLIENT_TOKEN\",\n authorizationFingerprint: attrs.authorizationFingerprint,\n analyticsMetadata: analyticsMetadata,\n gatewayConfiguration: response,\n };\n\n resolve(configuration);\n });\n });\n}\n\nmodule.exports = {\n getConfiguration: wrapPromise(getConfiguration),\n};\n\n},{\"../lib/braintree-error\":124,\"../lib/constants\":126,\"../lib/is-date-string-before-or-on\":151,\"./constants\":79,\"./errors\":80,\"./request\":92,\"./request/graphql\":90,\"@braintree/uuid\":39,\"@braintree/wrap-promise\":43}],82:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar Client = _dereq_(\"./client\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar sharedErrors = _dereq_(\"../lib/errors\");\n\n/** @module braintree-web/client */\n\n/**\n * @function create\n * @description This function is the entry point for the <code>braintree.client</code> module. It is used for creating {@link Client} instances that service communication to Braintree servers.\n * @param {object} options Object containing all {@link Client} options:\n * @param {string} options.authorization A tokenizationKey or clientToken.\n * @param {callback} [callback] The second argument, <code>data</code>, is the {@link Client} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * var createClient = require('braintree-web/client').create;\n *\n * createClient({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (createErr, clientInstance) {\n * if (createErr) {\n * if (createErr.code === 'CLIENT_AUTHORIZATION_INVALID') {\n * // either the client token has expired, and a new one should be generated\n * // or the tokenization key was deactivated or deleted\n * } else {\n * console.log('something went wrong creating the client instance', createErr);\n * }\n * return;\n * }\n *\n * // set up other components\n * });\n * @static\n */\nfunction create(options) {\n if (!options.authorization) {\n return Promise.reject(\n new BraintreeError({\n type: sharedErrors.INSTANTIATION_OPTION_REQUIRED.type,\n code: sharedErrors.INSTANTIATION_OPTION_REQUIRED.code,\n message:\n \"options.authorization is required when instantiating a client.\",\n })\n );\n }\n\n return Client.initialize(options);\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/braintree-error\":124,\"../lib/errors\":135,\"./client\":78,\"@braintree/wrap-promise\":43}],83:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar querystring = _dereq_(\"../../lib/querystring\");\nvar assign = _dereq_(\"../../lib/assign\").assign;\nvar prepBody = _dereq_(\"./prep-body\");\nvar parseBody = _dereq_(\"./parse-body\");\nvar xhr = _dereq_(\"./xhr\");\nvar isXHRAvailable = xhr.isAvailable;\nvar GraphQLRequest = _dereq_(\"./graphql/request\");\nvar DefaultRequest = _dereq_(\"./default-request\");\n\nvar MAX_TCP_RETRYCOUNT = 1;\nvar TCP_PRECONNECT_BUG_STATUS_CODE = 408;\n\nfunction requestShouldRetry(status) {\n return !status || status === TCP_PRECONNECT_BUG_STATUS_CODE;\n}\n\nfunction graphQLRequestShouldRetryWithClientApi(body) {\n var errorClass =\n !body.data &&\n body.errors &&\n body.errors[0] &&\n body.errors[0].extensions &&\n body.errors[0].extensions.errorClass;\n\n return errorClass === \"UNKNOWN\" || errorClass === \"INTERNAL\";\n}\n\nfunction _requestWithRetry(options, tcpRetryCount, cb) {\n var status, resBody, ajaxRequest, body, method, headers, parsedBody;\n var url = options.url;\n var graphQL = options.graphQL;\n var timeout = options.timeout;\n var req = xhr.getRequestObject();\n var callback = cb;\n var isGraphQLRequest = Boolean(\n graphQL && graphQL.isGraphQLRequest(url, options.data)\n );\n\n options.headers = assign(\n { \"Content-Type\": \"application/json\" },\n options.headers\n );\n\n if (isGraphQLRequest) {\n ajaxRequest = new GraphQLRequest(options);\n } else {\n ajaxRequest = new DefaultRequest(options);\n }\n\n url = ajaxRequest.getUrl();\n body = ajaxRequest.getBody();\n method = ajaxRequest.getMethod();\n headers = ajaxRequest.getHeaders();\n\n if (method === \"GET\") {\n url = querystring.queryify(url, body);\n body = null;\n }\n\n if (isXHRAvailable) {\n req.onreadystatechange = function () {\n if (req.readyState !== 4) {\n return;\n }\n\n if (req.status === 0 && isGraphQLRequest) {\n // If a merchant experiences a connection\n // issue to the GraphQL endpoint (possibly\n // due to a Content Security Policy), retry\n // the request against the old client API.\n delete options.graphQL;\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n\n parsedBody = parseBody(req.responseText);\n resBody = ajaxRequest.adaptResponseBody(parsedBody);\n status = ajaxRequest.determineStatus(req.status, parsedBody);\n\n if (status >= 400 || status < 200) {\n if (\n isGraphQLRequest &&\n graphQLRequestShouldRetryWithClientApi(parsedBody)\n ) {\n delete options.graphQL;\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n\n if (tcpRetryCount < MAX_TCP_RETRYCOUNT && requestShouldRetry(status)) {\n tcpRetryCount++;\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n callback(resBody || \"error\", null, status || 500);\n } else {\n callback(null, resBody, status);\n }\n };\n } else {\n if (options.headers) {\n url = querystring.queryify(url, headers);\n }\n\n req.onload = function () {\n callback(null, parseBody(req.responseText), req.status);\n };\n\n req.onerror = function () {\n // XDomainRequest does not report a body or status for errors, so\n // hardcode to 'error' and 500, respectively\n callback(\"error\", null, 500);\n };\n\n // This must remain for IE9 to work\n req.onprogress = function () {};\n\n req.ontimeout = function () {\n callback(\"timeout\", null, -1);\n };\n }\n\n try {\n req.open(method, url, true);\n } catch (requestOpenError) {\n // If a merchant has a Content Security Policy and they have\n // not allowed our endpoints, some browsers may\n // synchronously throw an error. If it is not a GraphQL\n // request, we throw the error. If it is a GraphQL request\n // we remove the GraphQL option and try the request against\n // the old client API.\n if (!isGraphQLRequest) {\n throw requestOpenError;\n }\n\n delete options.graphQL;\n\n _requestWithRetry(options, tcpRetryCount, cb);\n\n return;\n }\n\n req.timeout = timeout;\n\n if (isXHRAvailable) {\n Object.keys(headers).forEach(function (headerKey) {\n req.setRequestHeader(headerKey, headers[headerKey]);\n });\n }\n\n try {\n req.send(prepBody(method, body));\n } catch (e) {\n /* ignored */\n }\n}\n\nfunction request(options, cb) {\n _requestWithRetry(options, 0, cb);\n}\n\nmodule.exports = {\n request: request,\n};\n\n},{\"../../lib/assign\":121,\"../../lib/querystring\":157,\"./default-request\":84,\"./graphql/request\":91,\"./parse-body\":93,\"./prep-body\":94,\"./xhr\":95}],84:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction DefaultRequest(options) {\n this._url = options.url;\n this._data = options.data;\n this._method = options.method;\n this._headers = options.headers;\n}\n\nDefaultRequest.prototype.getUrl = function () {\n return this._url;\n};\n\nDefaultRequest.prototype.getBody = function () {\n return this._data;\n};\n\nDefaultRequest.prototype.getMethod = function () {\n return this._method;\n};\n\nDefaultRequest.prototype.getHeaders = function () {\n return this._headers;\n};\n\nDefaultRequest.prototype.adaptResponseBody = function (parsedBody) {\n return parsedBody;\n};\n\nDefaultRequest.prototype.determineStatus = function (status) {\n return status;\n};\n\nmodule.exports = DefaultRequest;\n\n},{}],85:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar errorResponseAdapter = _dereq_(\"./error\");\nvar assign = _dereq_(\"../../../../lib/assign\").assign;\n\n/* eslint-disable camelcase */\nvar cardTypeTransforms = {\n creditCard: {\n AMERICAN_EXPRESS: \"American Express\",\n DISCOVER: \"Discover\",\n INTERNATIONAL_MAESTRO: \"Maestro\",\n JCB: \"JCB\",\n MASTERCARD: \"MasterCard\",\n SOLO: \"Solo\",\n UK_MAESTRO: \"UK Maestro\",\n UNION_PAY: \"UnionPay\",\n VISA: \"Visa\",\n ELO: \"Elo\",\n HIPER: \"Hiper\",\n HIPERCARD: \"Hipercard\",\n },\n applePayWeb: {\n VISA: \"visa\",\n MASTERCARD: \"mastercard\",\n DISCOVER: \"discover\",\n AMERICAN_EXPRESS: \"amex\",\n INTERNATIONAL_MAESTRO: \"maestro\",\n ELO: \"elo\",\n },\n visaCheckout: {\n VISA: \"Visa\",\n MASTERCARD: \"MasterCard\",\n DISCOVER: \"Discover\",\n AMERICAN_EXPRESS: \"American Express\",\n },\n googlePay: {\n VISA: \"visa\",\n MASTERCARD: \"mastercard\",\n DISCOVER: \"discover\",\n AMERICAN_EXPRESS: \"amex\",\n INTERNATIONAL_MAESTRO: \"maestro\",\n ELO: \"elo\",\n },\n masterpass: {\n VISA: \"visa\",\n MASTERCARD: \"master\",\n DISCOVER: \"discover\",\n AMERICAN_EXPRESS: \"amex\",\n DINERS: \"diners\",\n INTERNATIONAL_MAESTRO: \"maestro\",\n JCB: \"jcb\",\n },\n};\n/* eslint-enable camelcase */\n\nfunction configurationResponseAdapter(responseBody, ctx) {\n var adaptedResponse;\n\n if (responseBody.data && !responseBody.errors) {\n adaptedResponse = adaptConfigurationResponseBody(responseBody, ctx);\n } else {\n adaptedResponse = errorResponseAdapter(responseBody);\n }\n\n return adaptedResponse;\n}\n\nfunction adaptConfigurationResponseBody(body, ctx) {\n var configuration = body.data.clientConfiguration;\n var response;\n\n response = {\n environment: configuration.environment.toLowerCase(),\n clientApiUrl: configuration.clientApiUrl,\n assetsUrl: configuration.assetsUrl,\n analytics: {\n url: configuration.analyticsUrl,\n },\n merchantId: configuration.merchantId,\n venmo: \"off\",\n };\n\n if (configuration.supportedFeatures) {\n response.graphQL = {\n url: ctx._graphQL._config.url,\n features: configuration.supportedFeatures.map(function (feature) {\n return feature.toLowerCase();\n }),\n };\n }\n\n if (configuration.braintreeApi) {\n response.braintreeApi = configuration.braintreeApi;\n }\n\n if (configuration.applePayWeb) {\n response.applePayWeb = configuration.applePayWeb;\n response.applePayWeb.supportedNetworks = mapCardTypes(\n configuration.applePayWeb.supportedCardBrands,\n cardTypeTransforms.applePayWeb\n );\n\n delete response.applePayWeb.supportedCardBrands;\n }\n\n if (configuration.ideal) {\n response.ideal = configuration.ideal;\n }\n\n if (configuration.kount) {\n response.kount = {\n kountMerchantId: configuration.kount.merchantId,\n };\n }\n\n if (configuration.creditCard) {\n response.challenges = configuration.creditCard.challenges.map(function (\n challenge\n ) {\n return challenge.toLowerCase();\n });\n\n response.creditCards = {\n supportedCardTypes: mapCardTypes(\n configuration.creditCard.supportedCardBrands,\n cardTypeTransforms.creditCard\n ),\n };\n response.threeDSecureEnabled = configuration.creditCard.threeDSecureEnabled;\n response.threeDSecure = configuration.creditCard.threeDSecure;\n } else {\n response.challenges = [];\n response.creditCards = {\n supportedCardTypes: [],\n };\n response.threeDSecureEnabled = false;\n }\n\n if (configuration.googlePay) {\n response.androidPay = {\n displayName: configuration.googlePay.displayName,\n enabled: true,\n environment: configuration.googlePay.environment.toLowerCase(),\n googleAuthorizationFingerprint:\n configuration.googlePay.googleAuthorization,\n paypalClientId: configuration.googlePay.paypalClientId,\n supportedNetworks: mapCardTypes(\n configuration.googlePay.supportedCardBrands,\n cardTypeTransforms.googlePay\n ),\n };\n }\n\n if (configuration.venmo) {\n response.payWithVenmo = {\n merchantId: configuration.venmo.merchantId,\n accessToken: configuration.venmo.accessToken,\n environment: configuration.venmo.environment.toLowerCase(),\n enrichedCustomerDataEnabled:\n configuration.venmo.enrichedCustomerDataEnabled,\n };\n }\n\n if (configuration.paypal) {\n response.paypalEnabled = true;\n response.paypal = assign({}, configuration.paypal);\n response.paypal.currencyIsoCode = response.paypal.currencyCode;\n response.paypal.environment = response.paypal.environment.toLowerCase();\n\n delete response.paypal.currencyCode;\n } else {\n response.paypalEnabled = false;\n }\n\n if (configuration.unionPay) {\n response.unionPay = {\n enabled: true,\n merchantAccountId: configuration.unionPay.merchantAccountId,\n };\n }\n\n if (configuration.visaCheckout) {\n response.visaCheckout = {\n apikey: configuration.visaCheckout.apiKey,\n encryptionKey: configuration.visaCheckout.encryptionKey,\n externalClientId: configuration.visaCheckout.externalClientId,\n supportedCardTypes: mapCardTypes(\n configuration.visaCheckout.supportedCardBrands,\n cardTypeTransforms.visaCheckout\n ),\n };\n }\n\n if (configuration.masterpass) {\n response.masterpass = {\n merchantCheckoutId: configuration.masterpass.merchantCheckoutId,\n supportedNetworks: mapCardTypes(\n configuration.masterpass.supportedCardBrands,\n cardTypeTransforms.masterpass\n ),\n };\n }\n\n if (configuration.usBankAccount) {\n response.usBankAccount = {\n routeId: configuration.usBankAccount.routeId,\n plaid: {\n publicKey: configuration.usBankAccount.plaidPublicKey,\n },\n };\n }\n\n return response;\n}\n\nfunction mapCardTypes(cardTypes, cardTypeTransformMap) {\n return cardTypes.reduce(function (acc, type) {\n if (cardTypeTransformMap.hasOwnProperty(type)) {\n return acc.concat(cardTypeTransformMap[type]);\n }\n\n return acc;\n }, []);\n}\n\nmodule.exports = configurationResponseAdapter;\n\n},{\"../../../../lib/assign\":121,\"./error\":87}],86:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar errorResponseAdapter = _dereq_(\"./error\");\n\nvar CARD_BRAND_MAP = {\n /* eslint-disable camelcase */\n AMERICAN_EXPRESS: \"American Express\",\n DINERS: \"Discover\",\n DISCOVER: \"Discover\",\n ELO: \"Elo\",\n HIPER: \"Hiper\",\n HIPERCARD: \"Hipercard\",\n INTERNATIONAL_MAESTRO: \"Maestro\",\n JCB: \"JCB\",\n MASTERCARD: \"MasterCard\",\n UK_MAESTRO: \"Maestro\",\n UNION_PAY: \"UnionPay\",\n VISA: \"Visa\",\n /* eslint-enable camelcase */\n};\n\nvar BIN_DATA_MAP = {\n YES: \"Yes\",\n NO: \"No\",\n UNKNOWN: \"Unknown\",\n};\n\nvar AUTHENTICATION_INSIGHT_MAP = {\n PSDTWO: \"psd2\",\n};\n\nfunction creditCardTokenizationResponseAdapter(responseBody) {\n var adaptedResponse;\n\n if (responseBody.data && !responseBody.errors) {\n adaptedResponse = adaptTokenizeCreditCardResponseBody(responseBody);\n } else {\n adaptedResponse = errorResponseAdapter(responseBody);\n }\n\n return adaptedResponse;\n}\n\nfunction adaptTokenizeCreditCardResponseBody(body) {\n var data = body.data.tokenizeCreditCard;\n var creditCard = data.creditCard;\n var lastTwo = creditCard.last4 ? creditCard.last4.substr(2, 4) : \"\";\n var binData = creditCard.binData;\n var response, regulationEnvironment;\n\n if (binData) {\n [\n \"commercial\",\n \"debit\",\n \"durbinRegulated\",\n \"healthcare\",\n \"payroll\",\n \"prepaid\",\n ].forEach(function (key) {\n if (binData[key]) {\n binData[key] = BIN_DATA_MAP[binData[key]];\n } else {\n binData[key] = \"Unknown\";\n }\n });\n\n [\"issuingBank\", \"countryOfIssuance\", \"productId\"].forEach(function (key) {\n if (!binData[key]) {\n binData[key] = \"Unknown\";\n }\n });\n }\n\n response = {\n creditCards: [\n {\n binData: binData,\n consumed: false,\n description: lastTwo ? \"ending in \" + lastTwo : \"\",\n nonce: data.token,\n details: {\n cardholderName: creditCard.cardholderName,\n expirationMonth: creditCard.expirationMonth,\n expirationYear: creditCard.expirationYear,\n bin: creditCard.bin || \"\",\n cardType: CARD_BRAND_MAP[creditCard.brandCode] || \"Unknown\",\n lastFour: creditCard.last4 || \"\",\n lastTwo: lastTwo,\n },\n type: \"CreditCard\",\n threeDSecureInfo: null,\n },\n ],\n };\n\n if (data.authenticationInsight) {\n regulationEnvironment =\n data.authenticationInsight.customerAuthenticationRegulationEnvironment;\n response.creditCards[0].authenticationInsight = {\n regulationEnvironment:\n AUTHENTICATION_INSIGHT_MAP[regulationEnvironment] ||\n regulationEnvironment.toLowerCase(),\n };\n }\n\n return response;\n}\n\nmodule.exports = creditCardTokenizationResponseAdapter;\n\n},{\"./error\":87}],87:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction errorResponseAdapter(responseBody) {\n var response;\n var errorClass =\n responseBody.errors &&\n responseBody.errors[0] &&\n responseBody.errors[0].extensions &&\n responseBody.errors[0].extensions.errorClass;\n\n if (errorClass === \"VALIDATION\") {\n response = userErrorResponseAdapter(responseBody);\n } else if (errorClass) {\n response = errorWithClassResponseAdapter(responseBody);\n } else {\n response = {\n error: { message: \"There was a problem serving your request\" },\n fieldErrors: [],\n };\n }\n\n return response;\n}\n\nfunction errorWithClassResponseAdapter(responseBody) {\n return {\n error: { message: responseBody.errors[0].message },\n fieldErrors: [],\n };\n}\n\nfunction userErrorResponseAdapter(responseBody) {\n var fieldErrors = buildFieldErrors(responseBody.errors);\n\n if (fieldErrors.length === 0) {\n return { error: { message: responseBody.errors[0].message } };\n }\n\n return {\n error: { message: getLegacyMessage(fieldErrors) },\n fieldErrors: fieldErrors,\n };\n}\n\nfunction buildFieldErrors(errors) {\n var fieldErrors = [];\n\n errors.forEach(function (error) {\n if (!(error.extensions && error.extensions.inputPath)) {\n return;\n }\n addFieldError(error.extensions.inputPath.slice(1), error, fieldErrors);\n });\n\n return fieldErrors;\n}\n\nfunction addFieldError(inputPath, errorDetail, fieldErrors) {\n var fieldError;\n var legacyCode = errorDetail.extensions.legacyCode;\n var inputField = inputPath[0];\n\n if (inputPath.length === 1) {\n fieldErrors.push({\n code: legacyCode,\n field: inputField,\n message: errorDetail.message,\n });\n\n return;\n }\n\n fieldErrors.forEach(function (candidate) {\n if (candidate.field === inputField) {\n fieldError = candidate;\n }\n });\n\n if (!fieldError) {\n fieldError = { field: inputField, fieldErrors: [] };\n fieldErrors.push(fieldError);\n }\n\n addFieldError(inputPath.slice(1), errorDetail, fieldError.fieldErrors);\n}\n\nfunction getLegacyMessage(errors) {\n var legacyMessages = {\n creditCard: \"Credit card is invalid\",\n };\n\n var field = errors[0].field;\n\n return legacyMessages[field];\n}\n\nmodule.exports = errorResponseAdapter;\n\n},{}],88:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar CONFIGURATION_QUERY =\n \"query ClientConfiguration { \" +\n \" clientConfiguration { \" +\n \" analyticsUrl \" +\n \" environment \" +\n \" merchantId \" +\n \" assetsUrl \" +\n \" clientApiUrl \" +\n \" creditCard { \" +\n \" supportedCardBrands \" +\n \" challenges \" +\n \" threeDSecureEnabled \" +\n \" threeDSecure { \" +\n \" cardinalAuthenticationJWT \" +\n \" } \" +\n \" } \" +\n \" applePayWeb { \" +\n \" countryCode \" +\n \" currencyCode \" +\n \" merchantIdentifier \" +\n \" supportedCardBrands \" +\n \" } \" +\n \" googlePay { \" +\n \" displayName \" +\n \" supportedCardBrands \" +\n \" environment \" +\n \" googleAuthorization \" +\n \" paypalClientId \" +\n \" } \" +\n \" ideal { \" +\n \" routeId \" +\n \" assetsUrl \" +\n \" } \" +\n \" kount { \" +\n \" merchantId \" +\n \" } \" +\n \" masterpass { \" +\n \" merchantCheckoutId \" +\n \" supportedCardBrands \" +\n \" } \" +\n \" paypal { \" +\n \" displayName \" +\n \" clientId \" +\n \" assetsUrl \" +\n \" environment \" +\n \" environmentNoNetwork \" +\n \" unvettedMerchant \" +\n \" braintreeClientId \" +\n \" billingAgreementsEnabled \" +\n \" merchantAccountId \" +\n \" currencyCode \" +\n \" payeeEmail \" +\n \" } \" +\n \" unionPay { \" +\n \" merchantAccountId \" +\n \" } \" +\n \" usBankAccount { \" +\n \" routeId \" +\n \" plaidPublicKey \" +\n \" } \" +\n \" venmo { \" +\n \" merchantId \" +\n \" accessToken \" +\n \" environment \" +\n \" enrichedCustomerDataEnabled\" +\n \" } \" +\n \" visaCheckout { \" +\n \" apiKey \" +\n \" externalClientId \" +\n \" supportedCardBrands \" +\n \" } \" +\n \" braintreeApi { \" +\n \" accessToken \" +\n \" url \" +\n \" } \" +\n \" supportedFeatures \" +\n \" } \" +\n \"}\";\n\nfunction configuration() {\n return {\n query: CONFIGURATION_QUERY,\n operationName: \"ClientConfiguration\",\n };\n}\n\nmodule.exports = configuration;\n\n},{}],89:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar assign = _dereq_(\"../../../../lib/assign\").assign;\n\nfunction createMutation(config) {\n var hasAuthenticationInsight = config.hasAuthenticationInsight;\n var mutation = \"mutation TokenizeCreditCard($input: TokenizeCreditCardInput!\";\n\n if (hasAuthenticationInsight) {\n mutation += \", $authenticationInsightInput: AuthenticationInsightInput!\";\n }\n\n mutation +=\n \") { \" +\n \" tokenizeCreditCard(input: $input) { \" +\n \" token \" +\n \" creditCard { \" +\n \" bin \" +\n \" brandCode \" +\n \" last4 \" +\n \" cardholderName \" +\n \" expirationMonth\" +\n \" expirationYear\" +\n \" binData { \" +\n \" prepaid \" +\n \" healthcare \" +\n \" debit \" +\n \" durbinRegulated \" +\n \" commercial \" +\n \" payroll \" +\n \" issuingBank \" +\n \" countryOfIssuance \" +\n \" productId \" +\n \" } \" +\n \" } \";\n\n if (hasAuthenticationInsight) {\n mutation +=\n \" authenticationInsight(input: $authenticationInsightInput) {\" +\n \" customerAuthenticationRegulationEnvironment\" +\n \" }\";\n }\n\n mutation += \" } }\";\n\n return mutation;\n}\n\nfunction createCreditCardTokenizationBody(body, options) {\n var cc = body.creditCard;\n var billingAddress = cc && cc.billingAddress;\n var expDate = cc && cc.expirationDate;\n var expirationMonth =\n cc && (cc.expirationMonth || (expDate && expDate.split(\"/\")[0].trim()));\n var expirationYear =\n cc && (cc.expirationYear || (expDate && expDate.split(\"/\")[1].trim()));\n var variables = {\n input: {\n creditCard: {\n number: cc && cc.number,\n expirationMonth: expirationMonth,\n expirationYear: expirationYear,\n cvv: cc && cc.cvv,\n cardholderName: cc && cc.cardholderName,\n },\n options: {},\n },\n };\n\n if (options.hasAuthenticationInsight) {\n variables.authenticationInsightInput = {\n merchantAccountId: body.merchantAccountId,\n };\n }\n\n if (billingAddress) {\n variables.input.creditCard.billingAddress = billingAddress;\n }\n\n variables.input = addValidationRule(body, variables.input);\n\n return variables;\n}\n\nfunction addValidationRule(body, input) {\n var validate;\n\n if (\n body.creditCard &&\n body.creditCard.options &&\n typeof body.creditCard.options.validate === \"boolean\"\n ) {\n validate = body.creditCard.options.validate;\n } else if (\n (body.authorizationFingerprint && body.tokenizationKey) ||\n body.authorizationFingerprint\n ) {\n validate = true;\n } else if (body.tokenizationKey) {\n validate = false;\n }\n\n if (typeof validate === \"boolean\") {\n input.options = assign(\n {\n validate: validate,\n },\n input.options\n );\n }\n\n return input;\n}\n\nfunction creditCardTokenization(body) {\n var options = {\n hasAuthenticationInsight: Boolean(\n body.authenticationInsight && body.merchantAccountId\n ),\n };\n\n return {\n query: createMutation(options),\n variables: createCreditCardTokenizationBody(body, options),\n operationName: \"TokenizeCreditCard\",\n };\n}\n\nmodule.exports = creditCardTokenization;\n\n},{\"../../../../lib/assign\":121}],90:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar features = {\n tokenize_credit_cards: \"payment_methods/credit_cards\", // eslint-disable-line camelcase\n configuration: \"configuration\",\n};\n\nvar disallowedInputPaths = [\"creditCard.options.unionPayEnrollment\"];\n\nfunction GraphQL(config) {\n this._config = config.graphQL;\n}\n\nGraphQL.prototype.getGraphQLEndpoint = function () {\n return this._config.url;\n};\n\nGraphQL.prototype.isGraphQLRequest = function (url, body) {\n var featureEnabled;\n var path = this.getClientApiPath(url);\n\n if (!this._isGraphQLEnabled() || !path) {\n return false;\n }\n\n featureEnabled = this._config.features.some(function (feature) {\n return features[feature] === path;\n });\n\n if (containsDisallowedlistedKeys(body)) {\n return false;\n }\n\n return featureEnabled;\n};\n\nGraphQL.prototype.getClientApiPath = function (url) {\n var path;\n var clientApiPrefix = \"/client_api/v1/\";\n var pathParts = url.split(clientApiPrefix);\n\n if (pathParts.length > 1) {\n path = pathParts[1].split(\"?\")[0];\n }\n\n return path;\n};\n\nGraphQL.prototype._isGraphQLEnabled = function () {\n return Boolean(this._config);\n};\n\nfunction containsDisallowedlistedKeys(body) {\n return disallowedInputPaths.some(function (keys) {\n var value = keys.split(\".\").reduce(function (accumulator, key) {\n return accumulator && accumulator[key];\n }, body);\n\n return value !== undefined; // eslint-disable-line no-undefined\n });\n}\n\nmodule.exports = GraphQL;\n\n},{}],91:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BRAINTREE_VERSION = _dereq_(\"../../constants\").BRAINTREE_VERSION;\n\nvar assign = _dereq_(\"../../../lib/assign\").assign;\nvar snakeCaseToCamelCase = _dereq_(\"../../../lib/snake-case-to-camel-case\");\n\nvar creditCardTokenizationBodyGenerator = _dereq_(\"./generators/credit-card-tokenization\");\nvar creditCardTokenizationResponseAdapter = _dereq_(\"./adapters/credit-card-tokenization\");\n\nvar configurationBodyGenerator = _dereq_(\"./generators/configuration\");\nvar configurationResponseAdapter = _dereq_(\"./adapters/configuration\");\n\nvar generators = {\n \"payment_methods/credit_cards\": creditCardTokenizationBodyGenerator,\n configuration: configurationBodyGenerator,\n};\nvar adapters = {\n \"payment_methods/credit_cards\": creditCardTokenizationResponseAdapter,\n configuration: configurationResponseAdapter,\n};\n\nfunction GraphQLRequest(options) {\n var clientApiPath = options.graphQL.getClientApiPath(options.url);\n\n this._graphQL = options.graphQL;\n this._data = options.data;\n this._method = options.method;\n this._headers = options.headers;\n this._clientSdkMetadata = {\n source: options.metadata.source,\n integration: options.metadata.integration,\n sessionId: options.metadata.sessionId,\n };\n this._sendAnalyticsEvent = options.sendAnalyticsEvent || Function.prototype;\n\n this._generator = generators[clientApiPath];\n this._adapter = adapters[clientApiPath];\n\n this._sendAnalyticsEvent(\"graphql.init\");\n}\n\nGraphQLRequest.prototype.getUrl = function () {\n return this._graphQL.getGraphQLEndpoint();\n};\n\nGraphQLRequest.prototype.getBody = function () {\n var formattedBody = formatBodyKeys(this._data);\n var generatedBody = this._generator(formattedBody);\n var body = assign(\n { clientSdkMetadata: this._clientSdkMetadata },\n generatedBody\n );\n\n return JSON.stringify(body);\n};\n\nGraphQLRequest.prototype.getMethod = function () {\n return \"POST\";\n};\n\nGraphQLRequest.prototype.getHeaders = function () {\n var authorization, headers;\n\n if (this._data.authorizationFingerprint) {\n this._sendAnalyticsEvent(\"graphql.authorization-fingerprint\");\n authorization = this._data.authorizationFingerprint;\n } else {\n this._sendAnalyticsEvent(\"graphql.tokenization-key\");\n authorization = this._data.tokenizationKey;\n }\n\n headers = {\n Authorization: \"Bearer \" + authorization,\n \"Braintree-Version\": BRAINTREE_VERSION,\n };\n\n return assign({}, this._headers, headers);\n};\n\nGraphQLRequest.prototype.adaptResponseBody = function (parsedBody) {\n return this._adapter(parsedBody, this);\n};\n\nGraphQLRequest.prototype.determineStatus = function (\n httpStatus,\n parsedResponse\n) {\n var status, errorClass;\n\n if (httpStatus === 200) {\n errorClass =\n parsedResponse.errors &&\n parsedResponse.errors[0] &&\n parsedResponse.errors[0].extensions &&\n parsedResponse.errors[0].extensions.errorClass;\n\n if (parsedResponse.data && !parsedResponse.errors) {\n status = 200;\n } else if (errorClass === \"VALIDATION\") {\n status = 422;\n } else if (errorClass === \"AUTHORIZATION\") {\n status = 403;\n } else if (errorClass === \"AUTHENTICATION\") {\n status = 401;\n } else if (isGraphQLError(errorClass, parsedResponse)) {\n status = 403;\n } else {\n status = 500;\n }\n } else if (!httpStatus) {\n status = 500;\n } else {\n status = httpStatus;\n }\n\n this._sendAnalyticsEvent(\"graphql.status.\" + httpStatus);\n this._sendAnalyticsEvent(\"graphql.determinedStatus.\" + status);\n\n return status;\n};\n\nfunction isGraphQLError(errorClass, parsedResponse) {\n return !errorClass && parsedResponse.errors[0].message;\n}\n\nfunction formatBodyKeys(originalBody) {\n var body = {};\n\n Object.keys(originalBody).forEach(function (key) {\n var camelCaseKey = snakeCaseToCamelCase(key);\n\n if (typeof originalBody[key] === \"object\") {\n body[camelCaseKey] = formatBodyKeys(originalBody[key]);\n } else if (typeof originalBody[key] === \"number\") {\n body[camelCaseKey] = String(originalBody[key]);\n } else {\n body[camelCaseKey] = originalBody[key];\n }\n });\n\n return body;\n}\n\nmodule.exports = GraphQLRequest;\n\n},{\"../../../lib/assign\":121,\"../../../lib/snake-case-to-camel-case\":159,\"../../constants\":79,\"./adapters/configuration\":85,\"./adapters/credit-card-tokenization\":86,\"./generators/configuration\":88,\"./generators/credit-card-tokenization\":89}],92:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar once = _dereq_(\"../../lib/once\");\nvar AJAXDriver = _dereq_(\"./ajax-driver\");\n\nmodule.exports = function (options, cb) {\n cb = once(cb || Function.prototype);\n options.method = (options.method || \"GET\").toUpperCase();\n options.timeout = options.timeout == null ? 60000 : options.timeout;\n options.data = options.data || {};\n\n AJAXDriver.request(options, cb);\n};\n\n},{\"../../lib/once\":156,\"./ajax-driver\":83}],93:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (body) {\n try {\n body = JSON.parse(body);\n } catch (e) {\n /* ignored */\n }\n\n return body;\n};\n\n},{}],94:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (method, body) {\n if (typeof method !== \"string\") {\n throw new Error(\"Method must be a string\");\n }\n\n if (method.toLowerCase() !== \"get\" && body != null) {\n body = typeof body === \"string\" ? body : JSON.stringify(body);\n }\n\n return body;\n};\n\n},{}],95:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar isXHRAvailable =\n typeof window !== \"undefined\" &&\n window.XMLHttpRequest &&\n \"withCredentials\" in new window.XMLHttpRequest();\n\nfunction getRequestObject() {\n return isXHRAvailable\n ? new window.XMLHttpRequest()\n : new window.XDomainRequest();\n}\n\nmodule.exports = {\n isAvailable: isXHRAvailable,\n getRequestObject: getRequestObject,\n};\n\n},{}],96:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Data Collector - Creation Error Codes\n * @description Errors that occur when [creating the Data Collector component](./module-braintree-web_data-collector.html#.create).\n * @property {MERCHANT} DATA_COLLECTOR_KOUNT_NOT_ENABLED Occurs when Kount is enabled in creation options but is not enabled on the Braintree control panel.\n * @property {MERCHANT} DATA_COLLECTOR_KOUNT_ERROR Occurs when Kount errors while setting up.\n * @property {MERCHANT} DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS Occurs when Kount or PayPal Fraudnet could not be enabled.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n DATA_COLLECTOR_KOUNT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"DATA_COLLECTOR_KOUNT_NOT_ENABLED\",\n message: \"Kount is not enabled for this merchant.\",\n },\n DATA_COLLECTOR_KOUNT_ERROR: {\n type: BraintreeError.types.MERCHANT,\n code: \"DATA_COLLECTOR_KOUNT_ERROR\",\n },\n DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS: {\n type: BraintreeError.types.MERCHANT,\n code: \"DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS\",\n message: \"Data Collector must be created with Kount and/or PayPal.\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],97:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar FRAUDNET_FNCLS = _dereq_(\"../lib/constants\").FRAUDNET_FNCLS;\nvar FRAUDNET_SOURCE = _dereq_(\"../lib/constants\").FRAUDNET_SOURCE;\nvar FRAUDNET_URL = _dereq_(\"../lib/constants\").FRAUDNET_URL;\nvar loadScript = _dereq_(\"../lib/assets\").loadScript;\n\nvar cachedSessionId;\n\nfunction setup(options) {\n var fraudNet = new Fraudnet();\n\n options = options || {};\n\n if (!options.sessionId && cachedSessionId) {\n fraudNet.sessionId = cachedSessionId;\n\n return Promise.resolve(fraudNet);\n }\n\n return fraudNet.initialize(options);\n}\n\nfunction clearSessionIdCache() {\n cachedSessionId = null;\n}\n\nfunction Fraudnet() {}\n\nFraudnet.prototype.initialize = function (options) {\n var environment = options.environment;\n var self = this;\n\n this.sessionId = options.sessionId || _generateSessionId();\n if (!options.sessionId) {\n cachedSessionId = this.sessionId;\n }\n this._beaconId = _generateBeaconId(this.sessionId);\n this._parameterBlock = _createParameterBlock(\n this.sessionId,\n this._beaconId,\n environment\n );\n\n return loadScript({\n src: FRAUDNET_URL,\n })\n .then(function (block) {\n self._thirdPartyBlock = block;\n\n return self;\n })\n .catch(function () {\n // if the fraudnet script fails to load\n // we just resolve with nothing\n // and data collector ignores it\n return null;\n });\n};\n\nFraudnet.prototype.teardown = function () {\n removeElementIfOnPage(document.querySelector('iframe[title=\"ppfniframe\"]'));\n removeElementIfOnPage(document.querySelector('iframe[title=\"pbf\"]'));\n\n removeElementIfOnPage(this._parameterBlock);\n removeElementIfOnPage(this._thirdPartyBlock);\n};\n\nfunction removeElementIfOnPage(element) {\n if (element && element.parentNode) {\n element.parentNode.removeChild(element);\n }\n}\n\nfunction _generateSessionId() {\n var i;\n var id = \"\";\n\n for (i = 0; i < 32; i++) {\n id += Math.floor(Math.random() * 16).toString(16);\n }\n\n return id;\n}\n\nfunction _generateBeaconId(sessionId) {\n var timestamp = new Date().getTime() / 1000;\n\n return (\n \"https://b.stats.paypal.com/counter.cgi\" +\n \"?i=127.0.0.1\" +\n \"&p=\" +\n sessionId +\n \"&t=\" +\n timestamp +\n \"&a=14\"\n );\n}\n\nfunction _createParameterBlock(sessionId, beaconId, environment) {\n var el = document.body.appendChild(document.createElement(\"script\"));\n var config = {\n f: sessionId,\n s: FRAUDNET_SOURCE,\n b: beaconId,\n };\n\n // for some reason, the presence of the sandbox\n // attribute in a production environment causes\n // some weird behavior with what url paths are\n // hit, so instead, we only apply this attribute\n // when it is not a production environment\n if (environment !== \"production\") {\n config.sandbox = true;\n }\n\n el.type = \"application/json\";\n el.setAttribute(\"fncls\", FRAUDNET_FNCLS);\n el.text = JSON.stringify(config);\n\n return el;\n}\n\nmodule.exports = {\n setup: setup,\n clearSessionIdCache: clearSessionIdCache,\n};\n\n},{\"../lib/assets\":120,\"../lib/constants\":126}],98:[function(_dereq_,module,exports){\n\"use strict\";\n/** @module braintree-web/data-collector */\n\nvar kount = _dereq_(\"./kount\");\nvar fraudnet = _dereq_(\"./fraudnet\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar methods = _dereq_(\"../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar errors = _dereq_(\"./errors\");\n\n/**\n * @class\n * @global\n * @name DataCollector\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/data-collector.create|braintree-web.data-collector.create} instead.</strong>\n * @classdesc This class is used for fraud integration with PayPal and Kount. Instances of this class have {@link DataCollector#deviceData|deviceData} which is used to correlate user sessions with server transactions.\n */\n\n/**\n * @memberof DataCollector\n * @name deviceData\n * @type string\n * @description JSON string to pass with server transactions.\n * @instance\n */\n\n/**\n * @memberof DataCollector\n * @name rawDeviceData\n * @type object\n * @description The device data as an object instead of a string.\n * @instance\n */\n\n/**\n * @memberof DataCollector\n * @name teardown\n * @function\n * @description Cleanly remove anything set up by {@link module:braintree-web/data-collector.create|create}.\n * @param {callback} [callback] Called on completion. If no callback is provided, `teardown` returns a promise.\n * @instance\n * @example\n * dataCollectorInstance.teardown();\n * @example <caption>With callback</caption>\n * dataCollectorInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n/**\n * @memberof DataCollector\n * @name getDeviceData\n * @function\n * @description Resolves with device data once it is ready.\n * @param {object} [options] Options for how device data is resolved.\n * @param {boolean} [options.raw=false] When set to true, the device data will resolve as an object instead of a JSON string.\n * @param {callback} [callback] Called on completion. If no callback is provided, `getDeviceData` returns a promise.\n * @instance\n * @example\n * dataCollectorInstance.getDeviceData();\n * @example <caption>Without options</caption>\n * dataCollectorInstance.getDeviceData().then(function (deviceData) {\n * // typeof deviceData === 'string'\n * // pass onto your server with the payment method nonce\n * });\n * @example <caption>With options</caption>\n * dataCollectorInstance.getDeviceData({\n * raw: true\n * }).then(function (deviceData) {\n * // typeof deviceData === 'object'\n * // for if you'd like to parse the data before sending it to your server\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\n\n/**\n * @static\n * @function create\n * @description Creates a DataCollector instance and collects device data based on your merchant configuration. We recommend that you call this method as early as possible, e.g. as soon as your website loads. If that's too early, call it at the beginning of customer checkout.\n * **Note:** To use your own Kount ID, contact our support team ([support@braintreepayments.com](mailto:support@braintreepayments.com) or [877.434.2894](tel:877.434.2894)).\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.useDeferredClient] Used in conjunction with `authorization`, allows the Data Collector instance to be available right away by fetching the client configuration in the background. When this option is used, {@link GooglePayment#getDeviceData} must be used to collect the device data.\n * @param {boolean} [options.kount] Kount fraud data collection will occur if the merchant configuration has it enabled.\n * **Note:** the data sent to Kount is asynchronous and may not have completed by the time the data collector create call is complete. In most cases, this will not matter, but if you create the data collector instance and immediately navigate away from the page, the device information may fail to be sent to Kount.\n * @param {boolean} [options.paypal] *Deprecated:* PayPal fraud data collection will occur when the DataCollector instance is created.\n * @param {string} [options.riskCorrelationId] Pass a custom risk correlation id when creating the data collector.\n * @param {string} [options.clientMetadataId] Deprecated. Use `options.riskCorrelationId` instead.\n * @param {string} [options.correlationId] Deprecated. Use `options.riskCorrelationId` instead.\n * @param {callback} [callback] The second argument, `data`, is the {@link DataCollector} instance.\n * @returns {(Promise|void)} Returns a promise that resolves the {@link DataCollector} instance if no callback is provided.\n */\nfunction create(options) {\n var name = \"Data Collector\";\n var result = {\n _instances: [],\n };\n var data;\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n result._instantiatedWithAClient = !options.useDeferredClient;\n result._createPromise = createDeferredClient\n .create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n })\n .then(function (client) {\n var kountInstance;\n var config = client.getConfiguration();\n\n if (options.kount === true && config.gatewayConfiguration.kount) {\n try {\n kountInstance = kount.setup({\n environment: config.gatewayConfiguration.environment,\n merchantId: config.gatewayConfiguration.kount.kountMerchantId,\n });\n } catch (err) {\n return Promise.reject(\n new BraintreeError({\n type: errors.DATA_COLLECTOR_KOUNT_ERROR.type,\n code: errors.DATA_COLLECTOR_KOUNT_ERROR.code,\n message: err.message,\n })\n );\n }\n\n data = kountInstance.deviceData;\n result._instances.push(kountInstance);\n } else {\n data = {};\n }\n\n return Promise.resolve(client);\n })\n .then(function (client) {\n return fraudnet\n .setup({\n sessionId:\n options.riskCorrelationId ||\n options.clientMetadataId ||\n options.correlationId,\n environment:\n client.getConfiguration().gatewayConfiguration.environment,\n })\n .then(function (fraudnetInstance) {\n if (fraudnetInstance) {\n data.correlation_id = fraudnetInstance.sessionId; // eslint-disable-line camelcase\n result._instances.push(fraudnetInstance);\n }\n });\n })\n .then(function () {\n if (result._instances.length === 0) {\n // NEXT_MAJOR_VERSION either this should error with a specific error that\n // no data collector instances could be set up, or we should just swallow\n // the error and document that no device data will be returned if\n // data collector cannot be instantiated. We can't change the error code here\n // without possibly breaking merchant integrations relying on this inccorrect\n // behavior.\n return Promise.reject(\n new BraintreeError(errors.DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS)\n );\n }\n\n result.deviceData = JSON.stringify(data);\n result.rawDeviceData = data;\n\n return result;\n });\n\n result.teardown = createTeardownMethod(result);\n result.getDeviceData = createGetDeviceDataMethod(result);\n\n if (result._instantiatedWithAClient) {\n return result._createPromise;\n }\n\n return result;\n });\n}\n\nfunction createTeardownMethod(result) {\n return wrapPromise(function teardown() {\n return result._createPromise.then(function () {\n result._instances.forEach(function (instance) {\n if (instance) {\n instance.teardown();\n }\n });\n\n convertMethodsToError(result, methods(result));\n });\n });\n}\n\nfunction createGetDeviceDataMethod(result) {\n return wrapPromise(function getDeviceData(options) {\n options = options || {};\n\n return result._createPromise.then(function () {\n if (options.raw) {\n return Promise.resolve(result.rawDeviceData);\n }\n\n return Promise.resolve(result.deviceData);\n });\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"../lib/methods\":155,\"./errors\":96,\"./fraudnet\":97,\"./kount\":99,\"@braintree/wrap-promise\":43}],99:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar sjcl = _dereq_(\"./vendor/sjcl\");\nvar camelCaseToSnakeCase = _dereq_(\"../lib/camel-case-to-snake-case\");\n\nvar QA_URL = \"https://assets.qa.braintreepayments.com/data\";\nvar IFRAME_ID_PREFIX = \"braintreeDataFrame-\";\nvar environmentUrls = {\n development: QA_URL,\n qa: QA_URL,\n sandbox: \"https://assets.braintreegateway.com/sandbox/data\",\n production: \"https://assets.braintreegateway.com/data\",\n};\nvar cachedDeviceData = {};\n\nfunction setup(o) {\n var options = o != null ? o : {};\n\n return new Kount(options);\n}\n\nfunction Kount(options) {\n var previouslyInitializedDeviceData = Kount.getCachedDeviceData(\n options.merchantId\n );\n\n if (previouslyInitializedDeviceData) {\n this.deviceData = previouslyInitializedDeviceData;\n this._isCached = true;\n\n return;\n }\n\n this._currentEnvironment = this._initializeEnvironment(options);\n\n sjcl.random.startCollectors();\n\n this._deviceSessionId = this._generateDeviceSessionId();\n this.deviceData = this._getDeviceData();\n\n Kount.setCachedDeviceData(options.merchantId, this.deviceData);\n\n this._iframe = this._setupIFrame();\n}\n\nKount.getCachedDeviceData = function (merchantId) {\n return cachedDeviceData[merchantId];\n};\n\nKount.setCachedDeviceData = function (merchantId, data) {\n cachedDeviceData[merchantId] = data;\n};\n\nKount.prototype.teardown = function () {\n if (!this._isCached) {\n sjcl.random.stopCollectors();\n\n this._removeIframe();\n }\n};\n\nKount.prototype._removeIframe = function () {\n this._iframe.parentNode.removeChild(this._iframe);\n};\n\nKount.prototype._getDeviceData = function () {\n return camelCaseToSnakeCase({\n deviceSessionId: this._deviceSessionId,\n fraudMerchantId: this._currentEnvironment.id,\n });\n};\n\nKount.prototype._generateDeviceSessionId = function () {\n var bits, hexString;\n\n bits = sjcl.random.randomWords(4, 0);\n hexString = sjcl.codec.hex.fromBits(bits);\n\n return hexString;\n};\n\nKount.prototype._setupIFrame = function () {\n var params, iframe;\n var self = this;\n\n params = \"?m=\" + this._currentEnvironment.id + \"&s=\" + this._deviceSessionId;\n\n iframe = document.createElement(\"iframe\");\n iframe.width = 1;\n iframe.id = IFRAME_ID_PREFIX + this._deviceSessionId;\n iframe.height = 1;\n iframe.frameBorder = 0;\n iframe.scrolling = \"no\";\n iframe.style.position = \"fixed\";\n iframe.style.left = \"-999999px\";\n iframe.style.top = \"-999999px\";\n iframe.title = \"Braintree-Kount-iframe\";\n iframe.setAttribute(\"aria-hidden\", \"true\");\n\n document.body.appendChild(iframe);\n setTimeout(function () {\n iframe.src = self._currentEnvironment.url + \"/logo.htm\" + params;\n iframe.innerHTML =\n '<img src=\"' +\n self._currentEnvironment.url +\n \"/logo.gif\" +\n params +\n '\" alt=\"\" />';\n }, 10);\n\n return iframe;\n};\n\nKount.prototype._initializeEnvironment = function (options) {\n var url = environmentUrls[options.environment];\n\n if (url == null) {\n throw new Error(\n options.environment + \" is not a valid environment for kount.environment\"\n );\n }\n\n return {\n url: url,\n name: options.environment,\n id: options.merchantId,\n };\n};\n\nmodule.exports = {\n setup: setup,\n Kount: Kount,\n environmentUrls: environmentUrls,\n};\n\n},{\"../lib/camel-case-to-snake-case\":125,\"./vendor/sjcl\":100}],100:[function(_dereq_,module,exports){\n\"use strict\";\nvar sjcl = {\n cipher: {},\n hash: {},\n keyexchange: {},\n mode: {},\n misc: {},\n codec: {},\n exception: {\n corrupt: function (a) {\n this.toString = function () {\n return \"CORRUPT: \" + this.message;\n };\n this.message = a;\n },\n invalid: function (a) {\n this.toString = function () {\n return \"INVALID: \" + this.message;\n };\n this.message = a;\n },\n bug: function (a) {\n this.toString = function () {\n return \"BUG: \" + this.message;\n };\n this.message = a;\n },\n notReady: function (a) {\n this.toString = function () {\n return \"NOT READY: \" + this.message;\n };\n this.message = a;\n },\n },\n};\nsjcl.cipher.aes = function (a) {\n this.l[0][0][0] || this.G();\n var b,\n c,\n d,\n e,\n f = this.l[0][4],\n g = this.l[1];\n b = a.length;\n var k = 1;\n if (4 !== b && 6 !== b && 8 !== b)\n throw new sjcl.exception.invalid(\"invalid aes key size\");\n this.b = [(d = a.slice(0)), (e = [])];\n for (a = b; a < 4 * b + 28; a++) {\n c = d[a - 1];\n if (0 === a % b || (8 === b && 4 === a % b))\n (c =\n (f[c >>> 24] << 24) ^\n (f[(c >> 16) & 255] << 16) ^\n (f[(c >> 8) & 255] << 8) ^\n f[c & 255]),\n 0 === a % b &&\n ((c = (c << 8) ^ (c >>> 24) ^ (k << 24)),\n (k = (k << 1) ^ (283 * (k >> 7))));\n d[a] = d[a - b] ^ c;\n }\n for (b = 0; a; b++, a--)\n (c = d[b & 3 ? a : a - 4]),\n (e[b] =\n 4 >= a || 4 > b\n ? c\n : g[0][f[c >>> 24]] ^\n g[1][f[(c >> 16) & 255]] ^\n g[2][f[(c >> 8) & 255]] ^\n g[3][f[c & 255]]);\n};\nsjcl.cipher.aes.prototype = {\n encrypt: function (a) {\n return t(this, a, 0);\n },\n decrypt: function (a) {\n return t(this, a, 1);\n },\n l: [\n [[], [], [], [], []],\n [[], [], [], [], []],\n ],\n G: function () {\n var a = this.l[0],\n b = this.l[1],\n c = a[4],\n d = b[4],\n e,\n f,\n g,\n k = [],\n l = [],\n p,\n n,\n h,\n m;\n for (e = 0; 0x100 > e; e++) l[(k[e] = (e << 1) ^ (283 * (e >> 7))) ^ e] = e;\n for (f = g = 0; !c[f]; f ^= p || 1, g = l[g] || 1)\n for (\n h = g ^ (g << 1) ^ (g << 2) ^ (g << 3) ^ (g << 4),\n h = (h >> 8) ^ (h & 255) ^ 99,\n c[f] = h,\n d[h] = f,\n n = k[(e = k[(p = k[f])])],\n m = (0x1010101 * n) ^ (0x10001 * e) ^ (0x101 * p) ^ (0x1010100 * f),\n n = (0x101 * k[h]) ^ (0x1010100 * h),\n e = 0;\n 4 > e;\n e++\n )\n (a[e][f] = n = (n << 24) ^ (n >>> 8)),\n (b[e][h] = m = (m << 24) ^ (m >>> 8));\n for (e = 0; 5 > e; e++) (a[e] = a[e].slice(0)), (b[e] = b[e].slice(0));\n },\n};\nfunction t(a, b, c) {\n if (4 !== b.length)\n throw new sjcl.exception.invalid(\"invalid aes block size\");\n var d = a.b[c],\n e = b[0] ^ d[0],\n f = b[c ? 3 : 1] ^ d[1],\n g = b[2] ^ d[2];\n b = b[c ? 1 : 3] ^ d[3];\n var k,\n l,\n p,\n n = d.length / 4 - 2,\n h,\n m = 4,\n q = [0, 0, 0, 0];\n k = a.l[c];\n a = k[0];\n var r = k[1],\n v = k[2],\n w = k[3],\n x = k[4];\n for (h = 0; h < n; h++)\n (k =\n a[e >>> 24] ^ r[(f >> 16) & 255] ^ v[(g >> 8) & 255] ^ w[b & 255] ^ d[m]),\n (l =\n a[f >>> 24] ^\n r[(g >> 16) & 255] ^\n v[(b >> 8) & 255] ^\n w[e & 255] ^\n d[m + 1]),\n (p =\n a[g >>> 24] ^\n r[(b >> 16) & 255] ^\n v[(e >> 8) & 255] ^\n w[f & 255] ^\n d[m + 2]),\n (b =\n a[b >>> 24] ^\n r[(e >> 16) & 255] ^\n v[(f >> 8) & 255] ^\n w[g & 255] ^\n d[m + 3]),\n (m += 4),\n (e = k),\n (f = l),\n (g = p);\n for (h = 0; 4 > h; h++)\n (q[c ? 3 & -h : h] =\n (x[e >>> 24] << 24) ^\n (x[(f >> 16) & 255] << 16) ^\n (x[(g >> 8) & 255] << 8) ^\n x[b & 255] ^\n d[m++]),\n (k = e),\n (e = f),\n (f = g),\n (g = b),\n (b = k);\n return q;\n}\nsjcl.bitArray = {\n bitSlice: function (a, b, c) {\n a = sjcl.bitArray.M(a.slice(b / 32), 32 - (b & 31)).slice(1);\n return void 0 === c ? a : sjcl.bitArray.clamp(a, c - b);\n },\n extract: function (a, b, c) {\n var d = Math.floor((-b - c) & 31);\n return (\n (((b + c - 1) ^ b) & -32\n ? (a[(b / 32) | 0] << (32 - d)) ^ (a[(b / 32 + 1) | 0] >>> d)\n : a[(b / 32) | 0] >>> d) &\n ((1 << c) - 1)\n );\n },\n concat: function (a, b) {\n if (0 === a.length || 0 === b.length) return a.concat(b);\n var c = a[a.length - 1],\n d = sjcl.bitArray.getPartial(c);\n return 32 === d\n ? a.concat(b)\n : sjcl.bitArray.M(b, d, c | 0, a.slice(0, a.length - 1));\n },\n bitLength: function (a) {\n var b = a.length;\n return 0 === b ? 0 : 32 * (b - 1) + sjcl.bitArray.getPartial(a[b - 1]);\n },\n clamp: function (a, b) {\n if (32 * a.length < b) return a;\n a = a.slice(0, Math.ceil(b / 32));\n var c = a.length;\n b = b & 31;\n 0 < c &&\n b &&\n (a[c - 1] = sjcl.bitArray.partial(\n b,\n a[c - 1] & (2147483648 >> (b - 1)),\n 1\n ));\n return a;\n },\n partial: function (a, b, c) {\n return 32 === a ? b : (c ? b | 0 : b << (32 - a)) + 0x10000000000 * a;\n },\n getPartial: function (a) {\n return Math.round(a / 0x10000000000) || 32;\n },\n equal: function (a, b) {\n if (sjcl.bitArray.bitLength(a) !== sjcl.bitArray.bitLength(b)) return !1;\n var c = 0,\n d;\n for (d = 0; d < a.length; d++) c |= a[d] ^ b[d];\n return 0 === c;\n },\n M: function (a, b, c, d) {\n var e;\n e = 0;\n for (void 0 === d && (d = []); 32 <= b; b -= 32) d.push(c), (c = 0);\n if (0 === b) return d.concat(a);\n for (e = 0; e < a.length; e++)\n d.push(c | (a[e] >>> b)), (c = a[e] << (32 - b));\n e = a.length ? a[a.length - 1] : 0;\n a = sjcl.bitArray.getPartial(e);\n d.push(sjcl.bitArray.partial((b + a) & 31, 32 < b + a ? c : d.pop(), 1));\n return d;\n },\n Y: function (a, b) {\n return [a[0] ^ b[0], a[1] ^ b[1], a[2] ^ b[2], a[3] ^ b[3]];\n },\n byteswapM: function (a) {\n var b, c;\n for (b = 0; b < a.length; ++b)\n (c = a[b]),\n (a[b] =\n (c >>> 24) | ((c >>> 8) & 0xff00) | ((c & 0xff00) << 8) | (c << 24));\n return a;\n },\n};\nsjcl.codec.utf8String = {\n fromBits: function (a) {\n var b = \"\",\n c = sjcl.bitArray.bitLength(a),\n d,\n e;\n for (d = 0; d < c / 8; d++)\n 0 === (d & 3) && (e = a[d / 4]),\n (b += String.fromCharCode(((e >>> 8) >>> 8) >>> 8)),\n (e <<= 8);\n return decodeURIComponent(escape(b));\n },\n toBits: function (a) {\n a = unescape(encodeURIComponent(a));\n var b = [],\n c,\n d = 0;\n for (c = 0; c < a.length; c++)\n (d = (d << 8) | a.charCodeAt(c)), 3 === (c & 3) && (b.push(d), (d = 0));\n c & 3 && b.push(sjcl.bitArray.partial(8 * (c & 3), d));\n return b;\n },\n};\nsjcl.codec.hex = {\n fromBits: function (a) {\n var b = \"\",\n c;\n for (c = 0; c < a.length; c++)\n b += ((a[c] | 0) + 0xf00000000000).toString(16).substr(4);\n return b.substr(0, sjcl.bitArray.bitLength(a) / 4);\n },\n toBits: function (a) {\n var b,\n c = [],\n d;\n a = a.replace(/\\s|0x/g, \"\");\n d = a.length;\n a = a + \"00000000\";\n for (b = 0; b < a.length; b += 8) c.push(parseInt(a.substr(b, 8), 16) ^ 0);\n return sjcl.bitArray.clamp(c, 4 * d);\n },\n};\nsjcl.hash.sha256 = function (a) {\n this.b[0] || this.G();\n a\n ? ((this.u = a.u.slice(0)), (this.o = a.o.slice(0)), (this.h = a.h))\n : this.reset();\n};\nsjcl.hash.sha256.hash = function (a) {\n return new sjcl.hash.sha256().update(a).finalize();\n};\nsjcl.hash.sha256.prototype = {\n blockSize: 512,\n reset: function () {\n this.u = this.K.slice(0);\n this.o = [];\n this.h = 0;\n return this;\n },\n update: function (a) {\n \"string\" === typeof a && (a = sjcl.codec.utf8String.toBits(a));\n var b,\n c = (this.o = sjcl.bitArray.concat(this.o, a));\n b = this.h;\n a = this.h = b + sjcl.bitArray.bitLength(a);\n if (0x1fffffffffffff < a)\n throw new sjcl.exception.invalid(\"Cannot hash more than 2^53 - 1 bits\");\n if (\"undefined\" !== typeof Uint32Array) {\n var d = new Uint32Array(c),\n e = 0;\n for (b = 512 + b - ((512 + b) & 0x1ff); b <= a; b += 512)\n u(this, d.subarray(16 * e, 16 * (e + 1))), (e += 1);\n c.splice(0, 16 * e);\n } else\n for (b = 512 + b - ((512 + b) & 0x1ff); b <= a; b += 512)\n u(this, c.splice(0, 16));\n return this;\n },\n finalize: function () {\n var a,\n b = this.o,\n c = this.u,\n b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1, 1)]);\n for (a = b.length + 2; a & 15; a++) b.push(0);\n b.push(Math.floor(this.h / 0x100000000));\n for (b.push(this.h | 0); b.length; ) u(this, b.splice(0, 16));\n this.reset();\n return c;\n },\n K: [],\n b: [],\n G: function () {\n function a(a) {\n return (0x100000000 * (a - Math.floor(a))) | 0;\n }\n for (var b = 0, c = 2, d, e; 64 > b; c++) {\n e = !0;\n for (d = 2; d * d <= c; d++)\n if (0 === c % d) {\n e = !1;\n break;\n }\n e &&\n (8 > b && (this.K[b] = a(Math.pow(c, 0.5))),\n (this.b[b] = a(Math.pow(c, 1 / 3))),\n b++);\n }\n },\n};\nfunction u(a, b) {\n var c,\n d,\n e,\n f = a.u,\n g = a.b,\n k = f[0],\n l = f[1],\n p = f[2],\n n = f[3],\n h = f[4],\n m = f[5],\n q = f[6],\n r = f[7];\n for (c = 0; 64 > c; c++)\n 16 > c\n ? (d = b[c])\n : ((d = b[(c + 1) & 15]),\n (e = b[(c + 14) & 15]),\n (d = b[c & 15] =\n (((d >>> 7) ^ (d >>> 18) ^ (d >>> 3) ^ (d << 25) ^ (d << 14)) +\n ((e >>> 17) ^ (e >>> 19) ^ (e >>> 10) ^ (e << 15) ^ (e << 13)) +\n b[c & 15] +\n b[(c + 9) & 15]) |\n 0)),\n (d =\n d +\n r +\n ((h >>> 6) ^\n (h >>> 11) ^\n (h >>> 25) ^\n (h << 26) ^\n (h << 21) ^\n (h << 7)) +\n (q ^ (h & (m ^ q))) +\n g[c]),\n (r = q),\n (q = m),\n (m = h),\n (h = (n + d) | 0),\n (n = p),\n (p = l),\n (l = k),\n (k =\n (d +\n ((l & p) ^ (n & (l ^ p))) +\n ((l >>> 2) ^\n (l >>> 13) ^\n (l >>> 22) ^\n (l << 30) ^\n (l << 19) ^\n (l << 10))) |\n 0);\n f[0] = (f[0] + k) | 0;\n f[1] = (f[1] + l) | 0;\n f[2] = (f[2] + p) | 0;\n f[3] = (f[3] + n) | 0;\n f[4] = (f[4] + h) | 0;\n f[5] = (f[5] + m) | 0;\n f[6] = (f[6] + q) | 0;\n f[7] = (f[7] + r) | 0;\n}\nsjcl.prng = function (a) {\n this.c = [new sjcl.hash.sha256()];\n this.i = [0];\n this.H = 0;\n this.v = {};\n this.F = 0;\n this.J = {};\n this.L = this.f = this.j = this.T = 0;\n this.b = [0, 0, 0, 0, 0, 0, 0, 0];\n this.g = [0, 0, 0, 0];\n this.C = void 0;\n this.D = a;\n this.s = !1;\n this.B = { progress: {}, seeded: {} };\n this.m = this.S = 0;\n this.w = 1;\n this.A = 2;\n this.O = 0x10000;\n this.I = [0, 48, 64, 96, 128, 192, 0x100, 384, 512, 768, 1024];\n this.P = 3e4;\n this.N = 80;\n};\nsjcl.prng.prototype = {\n randomWords: function (a, b) {\n var c = [],\n d;\n d = this.isReady(b);\n var e;\n if (d === this.m)\n throw new sjcl.exception.notReady(\"generator isn't seeded\");\n if (d & this.A) {\n d = !(d & this.w);\n e = [];\n var f = 0,\n g;\n this.L = e[0] = new Date().valueOf() + this.P;\n for (g = 0; 16 > g; g++) e.push((0x100000000 * Math.random()) | 0);\n for (\n g = 0;\n g < this.c.length &&\n ((e = e.concat(this.c[g].finalize())),\n (f += this.i[g]),\n (this.i[g] = 0),\n d || !(this.H & (1 << g)));\n g++\n );\n this.H >= 1 << this.c.length &&\n (this.c.push(new sjcl.hash.sha256()), this.i.push(0));\n this.f -= f;\n f > this.j && (this.j = f);\n this.H++;\n this.b = sjcl.hash.sha256.hash(this.b.concat(e));\n this.C = new sjcl.cipher.aes(this.b);\n for (\n d = 0;\n 4 > d && ((this.g[d] = (this.g[d] + 1) | 0), !this.g[d]);\n d++\n );\n }\n for (d = 0; d < a; d += 4)\n 0 === (d + 1) % this.O && y(this),\n (e = z(this)),\n c.push(e[0], e[1], e[2], e[3]);\n y(this);\n return c.slice(0, a);\n },\n setDefaultParanoia: function (a, b) {\n if (\n 0 === a &&\n \"Setting paranoia=0 will ruin your security; use it only for testing\" !==\n b\n )\n throw new sjcl.exception.invalid(\n \"Setting paranoia=0 will ruin your security; use it only for testing\"\n );\n this.D = a;\n },\n addEntropy: function (a, b, c) {\n c = c || \"user\";\n var d,\n e,\n f = new Date().valueOf(),\n g = this.v[c],\n k = this.isReady(),\n l = 0;\n d = this.J[c];\n void 0 === d && (d = this.J[c] = this.T++);\n void 0 === g && (g = this.v[c] = 0);\n this.v[c] = (this.v[c] + 1) % this.c.length;\n switch (typeof a) {\n case \"number\":\n void 0 === b && (b = 1);\n this.c[g].update([d, this.F++, 1, b, f, 1, a | 0]);\n break;\n case \"object\":\n c = Object.prototype.toString.call(a);\n if (\"[object Uint32Array]\" === c) {\n e = [];\n for (c = 0; c < a.length; c++) e.push(a[c]);\n a = e;\n } else\n for (\n \"[object Array]\" !== c && (l = 1), c = 0;\n c < a.length && !l;\n c++\n )\n \"number\" !== typeof a[c] && (l = 1);\n if (!l) {\n if (void 0 === b)\n for (c = b = 0; c < a.length; c++)\n for (e = a[c]; 0 < e; ) b++, (e = e >>> 1);\n this.c[g].update([d, this.F++, 2, b, f, a.length].concat(a));\n }\n break;\n case \"string\":\n void 0 === b && (b = a.length);\n this.c[g].update([d, this.F++, 3, b, f, a.length]);\n this.c[g].update(a);\n break;\n default:\n l = 1;\n }\n if (l)\n throw new sjcl.exception.bug(\n \"random: addEntropy only supports number, array of numbers or string\"\n );\n this.i[g] += b;\n this.f += b;\n k === this.m &&\n (this.isReady() !== this.m && A(\"seeded\", Math.max(this.j, this.f)),\n A(\"progress\", this.getProgress()));\n },\n isReady: function (a) {\n a = this.I[void 0 !== a ? a : this.D];\n return this.j && this.j >= a\n ? this.i[0] > this.N && new Date().valueOf() > this.L\n ? this.A | this.w\n : this.w\n : this.f >= a\n ? this.A | this.m\n : this.m;\n },\n getProgress: function (a) {\n a = this.I[a ? a : this.D];\n return this.j >= a ? 1 : this.f > a ? 1 : this.f / a;\n },\n startCollectors: function () {\n if (!this.s) {\n this.a = {\n loadTimeCollector: B(this, this.V),\n mouseCollector: B(this, this.W),\n keyboardCollector: B(this, this.U),\n accelerometerCollector: B(this, this.R),\n touchCollector: B(this, this.X),\n };\n if (window.addEventListener)\n window.addEventListener(\"load\", this.a.loadTimeCollector, !1),\n window.addEventListener(\"mousemove\", this.a.mouseCollector, !1),\n window.addEventListener(\"keypress\", this.a.keyboardCollector, !1),\n window.addEventListener(\n \"devicemotion\",\n this.a.accelerometerCollector,\n !1\n ),\n window.addEventListener(\"touchmove\", this.a.touchCollector, !1);\n else if (document.attachEvent)\n document.attachEvent(\"onload\", this.a.loadTimeCollector),\n document.attachEvent(\"onmousemove\", this.a.mouseCollector),\n document.attachEvent(\"keypress\", this.a.keyboardCollector);\n else throw new sjcl.exception.bug(\"can't attach event\");\n this.s = !0;\n }\n },\n stopCollectors: function () {\n this.s &&\n (window.removeEventListener\n ? (window.removeEventListener(\"load\", this.a.loadTimeCollector, !1),\n window.removeEventListener(\"mousemove\", this.a.mouseCollector, !1),\n window.removeEventListener(\"keypress\", this.a.keyboardCollector, !1),\n window.removeEventListener(\n \"devicemotion\",\n this.a.accelerometerCollector,\n !1\n ),\n window.removeEventListener(\"touchmove\", this.a.touchCollector, !1))\n : document.detachEvent &&\n (document.detachEvent(\"onload\", this.a.loadTimeCollector),\n document.detachEvent(\"onmousemove\", this.a.mouseCollector),\n document.detachEvent(\"keypress\", this.a.keyboardCollector)),\n (this.s = !1));\n },\n addEventListener: function (a, b) {\n this.B[a][this.S++] = b;\n },\n removeEventListener: function (a, b) {\n var c,\n d,\n e = this.B[a],\n f = [];\n for (d in e) e.hasOwnProperty(d) && e[d] === b && f.push(d);\n for (c = 0; c < f.length; c++) (d = f[c]), delete e[d];\n },\n U: function () {\n C(this, 1);\n },\n W: function (a) {\n var b, c;\n try {\n (b = a.x || a.clientX || a.offsetX || 0),\n (c = a.y || a.clientY || a.offsetY || 0);\n } catch (d) {\n c = b = 0;\n }\n 0 != b && 0 != c && this.addEntropy([b, c], 2, \"mouse\");\n C(this, 0);\n },\n X: function (a) {\n a = a.touches[0] || a.changedTouches[0];\n this.addEntropy([a.pageX || a.clientX, a.pageY || a.clientY], 1, \"touch\");\n C(this, 0);\n },\n V: function () {\n C(this, 2);\n },\n R: function (a) {\n a =\n a.accelerationIncludingGravity.x ||\n a.accelerationIncludingGravity.y ||\n a.accelerationIncludingGravity.z;\n if (window.orientation) {\n var b = window.orientation;\n \"number\" === typeof b && this.addEntropy(b, 1, \"accelerometer\");\n }\n a && this.addEntropy(a, 2, \"accelerometer\");\n C(this, 0);\n },\n};\nfunction A(a, b) {\n var c,\n d = sjcl.random.B[a],\n e = [];\n for (c in d) d.hasOwnProperty(c) && e.push(d[c]);\n for (c = 0; c < e.length; c++) e[c](b);\n}\nfunction C(a, b) {\n \"undefined\" !== typeof window &&\n window.performance &&\n \"function\" === typeof window.performance.now\n ? a.addEntropy(window.performance.now(), b, \"loadtime\")\n : a.addEntropy(new Date().valueOf(), b, \"loadtime\");\n}\nfunction y(a) {\n a.b = z(a).concat(z(a));\n a.C = new sjcl.cipher.aes(a.b);\n}\nfunction z(a) {\n for (var b = 0; 4 > b && ((a.g[b] = (a.g[b] + 1) | 0), !a.g[b]); b++);\n return a.C.encrypt(a.g);\n}\nfunction B(a, b) {\n return function () {\n b.apply(a, arguments);\n };\n}\nsjcl.random = new sjcl.prng(6);\na: try {\n var D, E, F, G;\n if ((G = \"undefined\" !== typeof module && module.exports)) {\n var H;\n try {\n H = _dereq_(\"crypto\");\n } catch (a) {\n H = null;\n }\n G = E = H;\n }\n if (G && E.randomBytes)\n (D = E.randomBytes(128)),\n (D = new Uint32Array(new Uint8Array(D).buffer)),\n sjcl.random.addEntropy(D, 1024, \"crypto['randomBytes']\");\n else if (\n \"undefined\" !== typeof window &&\n \"undefined\" !== typeof Uint32Array\n ) {\n F = new Uint32Array(32);\n if (window.crypto && window.crypto.getRandomValues)\n window.crypto.getRandomValues(F);\n else if (window.msCrypto && window.msCrypto.getRandomValues)\n window.msCrypto.getRandomValues(F);\n else break a;\n sjcl.random.addEntropy(F, 1024, \"crypto['getRandomValues']\");\n }\n} catch (a) {\n \"undefined\" !== typeof window &&\n window.console &&\n (console.log(\"There was an error collecting entropy from the browser:\"),\n console.log(a));\n}\n\"undefined\" !== typeof module && module.exports && (module.exports = sjcl);\n\"function\" === typeof define &&\n define([], function () {\n return sjcl;\n });\n\n},{\"crypto\":undefined}],101:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Google Payment - Creation Error Codes\n * @description Errors that occur when [creating the Google Payment component](./module-braintree-web_google-payment.html#.create).\n * @property {MERCHANT} GOOGLE_PAYMENT_NOT_ENABLED Occurs when Google Pay is not enabled on the Braintree control panel.\n * @property {MERCHANT} GOOGLE_PAYMENT_UNSUPPORTED_VERSION Occurs when a Google Pay version is used that is not supported by the Braintree SDK.\n */\n\n/**\n * @name BraintreeError.Google Payment - parseResponse Error Codes\n * @description Errors that occur when [parsing the response from Google](./GooglePayment.html#parseResponse).\n * @property {UNKNOWN} GOOGLE_PAYMENT_GATEWAY_ERROR Occurs when Google Pay could not be tokenized.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n GOOGLE_PAYMENT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"GOOGLE_PAYMENT_NOT_ENABLED\",\n message: \"Google Pay is not enabled for this merchant.\",\n },\n GOOGLE_PAYMENT_GATEWAY_ERROR: {\n code: \"GOOGLE_PAYMENT_GATEWAY_ERROR\",\n message:\n \"There was an error when tokenizing the Google Pay payment method.\",\n type: BraintreeError.types.UNKNOWN,\n },\n GOOGLE_PAYMENT_UNSUPPORTED_VERSION: {\n code: \"GOOGLE_PAYMENT_UNSUPPORTED_VERSION\",\n type: BraintreeError.types.MERCHANT,\n },\n};\n\n},{\"../lib/braintree-error\":124}],102:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar assign = _dereq_(\"../lib/assign\").assign;\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar find = _dereq_(\"../lib/find\");\nvar generateGooglePayConfiguration = _dereq_(\"../lib/generate-google-pay-configuration\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar errors = _dereq_(\"./errors\");\nvar methods = _dereq_(\"../lib/methods\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\nvar CREATE_PAYMENT_DATA_REQUEST_METHODS = {\n 1: \"_createV1PaymentDataRequest\",\n 2: \"_createV2PaymentDataRequest\",\n};\n\n/**\n * @typedef {object} GooglePayment~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {boolean} details.isNetworkTokenized True if the card is network tokenized.\n * @property {string} details.bin First six digits of card number.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, `CreditCard` or `AndroidPayCard`.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n/**\n * @class GooglePayment\n * @param {object} options Google Payment {@link module:braintree-web/google-payment.create create} options.\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/google-payment.create|braintree-web.google-payment.create} instead.</strong>\n * @classdesc This class represents a Google Payment component produced by {@link module:braintree-web/google-payment.create|braintree-web/google-payment.create}. Instances of this class have methods for initializing the Google Pay flow.\n */\nfunction GooglePayment(options) {\n this._createPromise = options.createPromise;\n this._client = options.client;\n this._useDeferredClient = options.useDeferredClient;\n // NEXT_MAJOR_VERSION this should be updated to 2 (or whatever the current latest version is)\n this._googlePayVersion = options.googlePayVersion || 1;\n this._googleMerchantId = options.googleMerchantId;\n\n if (this._isUnsupportedGooglePayAPIVersion()) {\n throw new BraintreeError({\n code: errors.GOOGLE_PAYMENT_UNSUPPORTED_VERSION.code,\n message:\n \"The Braintree SDK does not support Google Pay version \" +\n this._googlePayVersion +\n \". Please upgrade the version of your Braintree SDK and contact support if this error persists.\",\n type: errors.GOOGLE_PAYMENT_UNSUPPORTED_VERSION.type,\n });\n }\n}\n\nGooglePayment.prototype._waitForClient = function () {\n if (this._client) {\n return Promise.resolve();\n }\n\n return this._createPromise.then(\n function (client) {\n this._client = client;\n }.bind(this)\n );\n};\n\nGooglePayment.prototype._isUnsupportedGooglePayAPIVersion = function () {\n // if we don't have createPaymentDatqRequest method for the specific\n // API version, then the version is not supported\n return !(this._googlePayVersion in CREATE_PAYMENT_DATA_REQUEST_METHODS);\n};\n\nGooglePayment.prototype._getDefaultConfig = function () {\n if (!this._defaultConfig) {\n this._defaultConfig = generateGooglePayConfiguration(\n this._client.getConfiguration(),\n this._googlePayVersion,\n this._googleMerchantId\n );\n }\n\n return this._defaultConfig;\n};\n\nGooglePayment.prototype._createV1PaymentDataRequest = function (\n paymentDataRequest\n) {\n var defaultConfig = this._getDefaultConfig();\n var overrideCardNetworks =\n paymentDataRequest.cardRequirements &&\n paymentDataRequest.cardRequirements.allowedCardNetworks;\n var defaultConfigCardNetworks =\n defaultConfig.cardRequirements.allowedCardNetworks;\n var allowedCardNetworks = overrideCardNetworks || defaultConfigCardNetworks;\n\n paymentDataRequest = assign({}, defaultConfig, paymentDataRequest);\n\n // this way we can preserve allowedCardNetworks from default integration\n // if merchant did not pass any in `cardRequirements`\n paymentDataRequest.cardRequirements.allowedCardNetworks = allowedCardNetworks;\n\n return paymentDataRequest;\n};\n\nGooglePayment.prototype._createV2PaymentDataRequest = function (\n paymentDataRequest\n) {\n var defaultConfig = this._getDefaultConfig();\n\n if (paymentDataRequest.allowedPaymentMethods) {\n paymentDataRequest.allowedPaymentMethods.forEach(function (paymentMethod) {\n var defaultPaymentMethod = find(\n defaultConfig.allowedPaymentMethods,\n \"type\",\n paymentMethod.type\n );\n\n if (defaultPaymentMethod) {\n applyDefaultsToPaymentMethodConfiguration(\n paymentMethod,\n defaultPaymentMethod\n );\n }\n });\n }\n\n paymentDataRequest = assign({}, defaultConfig, paymentDataRequest);\n\n return paymentDataRequest;\n};\n\n/**\n * Create a configuration object for use in the `loadPaymentData` method.\n *\n * **Note**: Version 1 of the Google Pay Api is deprecated and will become unsupported in a future version. Until then, version 1 will continue to be used by default, and version 1 schema parameters and overrides will remain functional on existing integrations. However, new integrations and all following examples will be presented in the GooglePay version 2 schema. See [Google Pay's upgrade guide](https://developers.google.com/pay/api/web/guides/resources/update-to-latest-version) to see how to update your integration.\n *\n * If `options.googlePayVersion === 2` was set during the initial {@link module:braintree-web/google-payment.create|create} call, overrides must match the Google Pay v2 schema to be valid.\n *\n * @public\n * @param {object} overrides The supplied parameters for creating the PaymentDataRequest object. Required parameters are:\n * @param {object} overrides.transactionInfo Object according to the [Google Pay Transaction Info](https://developers.google.com/pay/api/web/reference/object#TransactionInfo) spec.\n * Optionally, any of the parameters in the [PaymentDataRequest](https://developers.google.com/pay/api/web/reference/object#PaymentDataRequest) parameters can be overridden, but note that it is recommended only to override top level parameters to avoid squashing deeply nested configuration objects. An example can be found below showing how to safely edit these deeply nested objects.\n * @example\n * var paymentDataRequest = googlePaymentInstance.createPaymentDataRequest({\n * merchantInfo: {\n * merchantId: 'my-merchant-id-from-google'\n * },\n * transactionInfo: {\n * currencyCode: 'USD',\n * totalPriceStatus: 'FINAL',\n * totalPrice: '100.00'\n * }\n * });\n *\n * // Update card payment methods to require billing address\n * var cardPaymentMethod = paymentDataRequest.allowedPaymentMethods;\n * cardPaymentMethod.parameters.billingAddressRequired = true;\n * cardPaymentMethod.parameters.billingAddressParameters = {\n * format: 'FULL',\n * phoneNumberRequired: true\n * };\n *\n * var paymentsClient = new google.payments.api.PaymentsClient({\n * environment: 'TEST' // or 'PRODUCTION'\n * })\n *\n * paymentsClient.loadPaymentData(paymentDataRequest).then(function (response) {\n * // handle response with googlePaymentInstance.parseResponse\n * // (see below)\n * });\n * @example <caption>With deferred client</caption>\n * googlePaymentInstance.createPaymentDataRequest({\n * merchantInfo: {\n * merchantId: 'my-merchant-id-from-google'\n * },\n * transactionInfo: {\n * currencyCode: 'USD',\n * totalPriceStatus: 'FINAL',\n * totalPrice: '100.00'\n * }\n * }).then(function (paymentDataRequest) {\n * // Update card payment methods to require billing address\n * var cardPaymentMethod = paymentDataRequest.allowedPaymentMethods;\n * cardPaymentMethod.parameters.billingAddressRequired = true;\n * cardPaymentMethod.parameters.billingAddressParameters = {\n * format: 'FULL',\n * phoneNumberRequired: true\n * };\n *\n * var paymentsClient = new google.payments.api.PaymentsClient({\n * environment: 'TEST' // or 'PRODUCTION'\n * })\n *\n * return paymentsClient.loadPaymentData(paymentDataRequest);\n * }).then(function (response) {\n * // handle response with googlePaymentInstance.parseResponse\n * // (see below)\n * });\n * @returns {object|Promise} Returns a configuration object for Google PaymentDataRequest. If instantiated with `useDeferredClient` and an `authorization` it will return a promise that resolves with the configuration.\n */\nGooglePayment.prototype.createPaymentDataRequest = function (overrides) {\n if (!this._useDeferredClient) {\n return this._createPaymentDataRequestSyncronously(overrides);\n }\n\n return this._waitForClient().then(\n function () {\n return this._createPaymentDataRequestSyncronously(overrides);\n }.bind(this)\n );\n};\n\nGooglePayment.prototype._createPaymentDataRequestSyncronously = function (\n overrides\n) {\n var paymentDataRequest = assign({}, overrides);\n var version = this._googlePayVersion;\n var createPaymentDataRequestMethod =\n CREATE_PAYMENT_DATA_REQUEST_METHODS[version];\n\n analytics.sendEvent(\n this._createPromise,\n \"google-payment.v\" + version + \".createPaymentDataRequest\"\n );\n\n return this[createPaymentDataRequestMethod](paymentDataRequest);\n};\n\n/**\n * Parse the response from the tokenization.\n * @public\n * @param {object} response The response back from the Google Pay tokenization.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link GooglePay~tokenizePayload|tokenizePayload}. If no callback is provided, `parseResponse` returns a promise that resolves with a {@link GooglePayment~tokenizePayload|tokenizePayload}.\n * @example with callback\n * var paymentsClient = new google.payments.api.PaymentsClient({\n * environment: 'TEST' // or 'PRODUCTION'\n * })\n *\n * paymentsClient.loadPaymentData(paymentDataRequestFromCreatePaymentDataRequest).then(function (response) {\n * googlePaymentInstance.parseResponse(response, function (err, data) {\n * if (err) {\n * // handle errors\n * }\n * // send parsedResponse.nonce to your server\n * });\n * });\n * @example with promise\n * var paymentsClient = new google.payments.api.PaymentsClient({\n * environment: 'TEST' // or 'PRODUCTION'\n * })\n *\n * paymentsClient.loadPaymentData(paymentDataRequestFromCreatePaymentDataRequest).then(function (response) {\n * return googlePaymentInstance.parseResponse(response);\n * }).then(function (parsedResponse) {\n * // send parsedResponse.nonce to your server\n * }).catch(function (err) {\n * // handle errors\n * });\n * @returns {(Promise|void)} Returns a promise that resolves the parsed response if no callback is provided.\n */\nGooglePayment.prototype.parseResponse = function (response) {\n var self = this;\n\n return Promise.resolve()\n .then(function () {\n var payload;\n var rawResponse =\n response.apiVersion === 2\n ? response.paymentMethodData.tokenizationData.token\n : response.paymentMethodToken.token;\n var parsedResponse = JSON.parse(rawResponse);\n var error = parsedResponse.error;\n\n if (error) {\n return Promise.reject(error);\n }\n\n analytics.sendEvent(\n self._createPromise,\n \"google-payment.parseResponse.succeeded\"\n );\n\n if (parsedResponse.paypalAccounts) {\n payload = parsedResponse.paypalAccounts[0];\n analytics.sendEvent(\n self._createPromise,\n \"google-payment.parseResponse.succeeded.paypal\"\n );\n\n return Promise.resolve({\n nonce: payload.nonce,\n type: payload.type,\n description: payload.description,\n });\n }\n payload = parsedResponse.androidPayCards[0];\n analytics.sendEvent(\n self._createPromise,\n \"google-payment.parseResponse.succeeded.google-payment\"\n );\n\n return Promise.resolve({\n nonce: payload.nonce,\n type: payload.type,\n description: payload.description,\n details: {\n cardType: payload.details.cardType,\n lastFour: payload.details.lastFour,\n lastTwo: payload.details.lastTwo,\n isNetworkTokenized: payload.details.isNetworkTokenized,\n bin: payload.details.bin,\n },\n binData: payload.binData,\n });\n })\n .catch(function (error) {\n analytics.sendEvent(\n self._createPromise,\n \"google-payment.parseResponse.failed\"\n );\n\n return Promise.reject(\n new BraintreeError({\n code: errors.GOOGLE_PAYMENT_GATEWAY_ERROR.code,\n message: errors.GOOGLE_PAYMENT_GATEWAY_ERROR.message,\n type: errors.GOOGLE_PAYMENT_GATEWAY_ERROR.type,\n details: {\n originalError: error,\n },\n })\n );\n });\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/google-payment.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * googlePaymentInstance.teardown();\n * @example <caption>With callback</caption>\n * googlePaymentInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nGooglePayment.prototype.teardown = function () {\n convertMethodsToError(this, methods(GooglePayment.prototype));\n\n return Promise.resolve();\n};\n\nfunction applyDefaultsToPaymentMethodConfiguration(\n merchantSubmittedPaymentMethod,\n defaultPaymentMethod\n) {\n Object.keys(defaultPaymentMethod).forEach(function (parameter) {\n if (typeof defaultPaymentMethod[parameter] === \"object\") {\n merchantSubmittedPaymentMethod[parameter] = assign(\n {},\n defaultPaymentMethod[parameter],\n merchantSubmittedPaymentMethod[parameter]\n );\n } else {\n merchantSubmittedPaymentMethod[parameter] =\n merchantSubmittedPaymentMethod[parameter] ||\n defaultPaymentMethod[parameter];\n }\n });\n}\n\nmodule.exports = wrapPromise.wrapPrototype(GooglePayment);\n\n},{\"../lib/analytics\":119,\"../lib/assign\":121,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/find\":137,\"../lib/generate-google-pay-configuration\":149,\"../lib/methods\":155,\"./errors\":101,\"@braintree/wrap-promise\":43}],103:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/google-payment\n * @description A component to integrate with Google Pay. The majority of the integration uses [Google's pay.js JavaScript file](https://pay.google.com/gp/p/js/pay.js). The Braintree component generates the configuration object necessary for Google Pay to initiate the Payment Request and parse the returned data to retrieve the payment method nonce which is used to process the transaction on the server.\n */\n\nvar GooglePayment = _dereq_(\"./google-payment\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar VERSION = \"3.100.0\";\nvar errors = _dereq_(\"./errors\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.useDeferredClient] Used in conjunction with `authorization`, allows the Google Payment instance to be available right away by fetching the client configuration in the background. When this option is used, {@link GooglePayment#createPaymentDataRequest} will return a promise that resolves with the configuration instead of returning synchronously.\n * @param {number} [options.googlePayVersion] The version of the Google Pay API to use. Value of 2 is required to accept parameters documented [by Google](https://developers.google.com/pay/api/web/reference/object). Omit this parameter to use the deprecated Google Pay Version 1.\n * @param {string} [options.googleMerchantId] A Google merchant identifier issued after your website is approved by Google. Required when PaymentsClient is initialized with an environment property of PRODUCTION, but may be omitted in TEST environment.\n * @param {callback} [callback] The second argument, `data`, is the {@link GooglePayment} instance. If no callback is provided, `create` returns a promise that resolves with the {@link GooglePayment} instance.\n * @example <caption>Simple Example</caption>\n * // include https://pay.google.com/gp/p/js/pay.js in a script tag\n * // on your page to load the `google.payments.api.PaymentsClient` global object.\n *\n * var paymentButton = document.querySelector('#google-pay-button');\n * var paymentsClient = new google.payments.api.PaymentsClient({\n * environment: 'TEST' // or 'PRODUCTION'\n * });\n *\n * braintree.client.create({\n * authorization: 'tokenization-key-or-client-token'\n * }).then(function (clientInstance) {\n * return braintree.googlePayment.create({\n * client: clientInstance,\n * googlePayVersion: 2,\n * googleMerchantId: 'your-merchant-id-from-google'\n * });\n * }).then(function (googlePaymentInstance) {\n * paymentButton.addEventListener('click', function (event) {\n * var paymentDataRequest;\n *\n * event.preventDefault();\n *\n * paymentDataRequest = googlePaymentInstance.createPaymentDataRequest({\n * transactionInfo: {\n * currencyCode: 'USD',\n * totalPriceStatus: 'FINAL',\n * totalPrice: '100.00'\n * }\n * });\n *\n * paymentsClient.loadPaymentData(paymentDataRequest).then(function (paymentData) {\n * return googlePaymentInstance.parseResponse(paymentData);\n * }).then(function (result) {\n * // send result.nonce to your server\n * }).catch(function (err) {\n * // handle err\n * });\n * });\n * });\n * @example <caption>Check Browser and Customer Compatibility</caption>\n * var paymentsClient = new google.payments.api.PaymentsClient({\n * environment: 'TEST' // or 'PRODUCTION'\n * });\n *\n * function setupGooglePayButton(googlePaymentInstance) {\n * var button = document.createElement('button');\n *\n * button.id = 'google-pay';\n * button.appendChild(document.createTextNode('Google Pay'));\n * button.addEventListener('click', function (event) {\n * var paymentRequestData;\n *\n * event.preventDefault();\n *\n * paymentDataRequest = googlePaymentInstance.createPaymentDataRequest({\n * transactionInfo: {\n * currencyCode: 'USD',\n * totalPriceStatus: 'FINAL',\n * totalPrice: '100.00' // your amount\n * }\n * });\n *\n * paymentsClient.loadPaymentData(paymentDataRequest).then(function (paymentData) {\n * return googlePaymentInstance.parseResponse(paymentData);\n * }).then(function (result) {\n * // send result.nonce to your server\n * }).catch(function (err) {\n * // handle errors\n * });\n * });\n *\n * document.getElementById('container').appendChild(button);\n * }\n *\n * braintree.client.create({\n * authorization: 'tokenization-key-or-client-token'\n * }).then(function (clientInstance) {\n * return braintree.googlePayment.create({\n * client: clientInstance,\n * googlePayVersion: 2,\n * googleMerchantId: 'your-merchant-id-from-google'\n * });\n * }).then(function (googlePaymentInstance) {\n *\n * return paymentsClient.isReadyToPay({\n * // see https://developers.google.com/pay/api/web/reference/object#IsReadyToPayRequest for all options\n * apiVersion: 2,\n * apiVersionMinor: 0,\n * allowedPaymentMethods: googlePaymentInstance.createPaymentDataRequest().allowedPaymentMethods,\n * existingPaymentMethodRequired: true\n * });\n * }).then(function (response) {\n * if (response.result) {\n * setupGooglePayButton(googlePaymentInstance);\n * }\n * }).catch(function (err) {\n * // handle setup errors\n * });\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"Google Pay\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n var createPromise, instance;\n\n createPromise = createDeferredClient\n .create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n })\n .then(function (client) {\n var configuration = client.getConfiguration();\n\n options.client = client;\n if (!configuration.gatewayConfiguration.androidPay) {\n return Promise.reject(\n new BraintreeError(errors.GOOGLE_PAYMENT_NOT_ENABLED)\n );\n }\n\n return client;\n });\n\n options.createPromise = createPromise;\n instance = new GooglePayment(options);\n\n if (!options.useDeferredClient) {\n return createPromise.then(function (client) {\n instance._client = client;\n\n return instance;\n });\n }\n\n return instance;\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./errors\":101,\"./google-payment\":102,\"@braintree/wrap-promise\":43}],104:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar errors = _dereq_(\"../shared/errors\");\nvar allowedAttributes = _dereq_(\"../shared/constants\").allowedAttributes;\n\nfunction attributeValidationError(attribute, value) {\n var err;\n\n if (!allowedAttributes.hasOwnProperty(attribute)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.type,\n code: errors.HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED.code,\n message:\n 'The \"' + attribute + '\" attribute is not supported in Hosted Fields.',\n });\n } else if (value != null && !_isValid(attribute, value)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.type,\n code: errors.HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED.code,\n message:\n 'Value \"' +\n value +\n '\" is not allowed for \"' +\n attribute +\n '\" attribute.',\n });\n }\n\n return err;\n}\n\nfunction _isValid(attribute, value) {\n if (allowedAttributes[attribute] === \"string\") {\n return typeof value === \"string\" || typeof value === \"number\";\n } else if (allowedAttributes[attribute] === \"boolean\") {\n return String(value) === \"true\" || String(value) === \"false\";\n }\n\n return false;\n}\n\nmodule.exports = attributeValidationError;\n\n},{\"../../lib/braintree-error\":124,\"../shared/constants\":112,\"../shared/errors\":113}],105:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar constants = _dereq_(\"../shared/constants\");\nvar useMin = _dereq_(\"../../lib/use-min\");\n\nmodule.exports = function composeUrl(assetsUrl, componentId, isDebug) {\n return (\n assetsUrl +\n \"/web/\" +\n constants.VERSION +\n \"/html/hosted-fields-frame\" +\n useMin(isDebug) +\n \".html#\" +\n componentId\n );\n};\n\n},{\"../../lib/use-min\":160,\"../shared/constants\":112}],106:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar directions = _dereq_(\"../shared/constants\").navigationDirections;\nvar browserDetection = _dereq_(\"../shared/browser-detection\");\nvar focusIntercept = _dereq_(\"../shared/focus-intercept\");\nvar findParentTags = _dereq_(\"../shared/find-parent-tags\");\nvar userFocusableTagNames = [\"INPUT\", \"SELECT\", \"TEXTAREA\"];\n// Devices with software keyboards do not or cannot focus on input types\n// that do not require keyboard-based interaction.\nvar unfocusedInputTypes = [\n \"hidden\",\n \"button\",\n \"reset\",\n \"submit\",\n \"checkbox\",\n \"radio\",\n \"file\",\n];\n\nfunction _isUserFocusableElement(element) {\n if (!browserDetection.hasSoftwareKeyboard()) {\n // on desktop browsers, the only input type that isn't focusable\n // is the hidden input\n return element.type !== \"hidden\";\n }\n\n return (\n userFocusableTagNames.indexOf(element.tagName) > -1 &&\n unfocusedInputTypes.indexOf(element.type) < 0\n );\n}\n\nfunction _createNavigationHelper(direction, numberOfElementsInForm) {\n switch (direction) {\n case directions.BACK:\n return {\n checkIndexBounds: function (index) {\n return index < 0;\n },\n indexChange: -1,\n };\n case directions.FORWARD:\n return {\n checkIndexBounds: function (index) {\n return index > numberOfElementsInForm - 1;\n },\n indexChange: 1,\n };\n default:\n }\n\n return {};\n}\n\nfunction _findFirstFocusableElement(elementsInForm) {\n var elementsIndex, element;\n\n for (\n elementsIndex = 0;\n elementsIndex < elementsInForm.length;\n elementsIndex++\n ) {\n element = elementsInForm[elementsIndex];\n\n if (_isUserFocusableElement(element)) {\n return element;\n }\n }\n\n return null;\n}\n\nmodule.exports = {\n removeExtraFocusElements: function (checkoutForm, onRemoveFocusIntercepts) {\n var elements = Array.prototype.slice.call(checkoutForm.elements);\n var firstFocusableInput = _findFirstFocusableElement(elements);\n var lastFocusableInput = _findFirstFocusableElement(elements.reverse());\n\n // these should never be identical, because there will at least be the\n // before and the after input\n [firstFocusableInput, lastFocusableInput].forEach(function (input) {\n if (!input) {\n return;\n }\n\n if (focusIntercept.matchFocusElement(input.getAttribute(\"id\"))) {\n onRemoveFocusIntercepts(input.getAttribute(\"id\"));\n }\n });\n },\n\n createFocusChangeHandler: function (hostedFieldsId, callbacks) {\n return function (data) {\n var currentIndex, targetElement, checkoutForm, navHelper;\n var sourceElement = document.getElementById(\n \"bt-\" + data.field + \"-\" + data.direction + \"-\" + hostedFieldsId\n );\n\n if (!sourceElement) {\n return;\n }\n\n checkoutForm = findParentTags(sourceElement, \"form\")[0];\n\n if (document.forms.length < 1 || !checkoutForm) {\n callbacks.onRemoveFocusIntercepts();\n\n return;\n }\n\n checkoutForm = [].slice.call(checkoutForm.elements);\n currentIndex = checkoutForm.indexOf(sourceElement);\n navHelper = _createNavigationHelper(data.direction, checkoutForm.length);\n\n do {\n currentIndex += navHelper.indexChange;\n if (navHelper.checkIndexBounds(currentIndex)) {\n return;\n }\n targetElement = checkoutForm[currentIndex];\n } while (!_isUserFocusableElement(targetElement));\n\n if (focusIntercept.matchFocusElement(targetElement.getAttribute(\"id\"))) {\n callbacks.onTriggerInputFocus(\n targetElement.getAttribute(\"data-braintree-type\")\n );\n } else {\n targetElement.focus();\n }\n };\n },\n};\n\n},{\"../shared/browser-detection\":111,\"../shared/constants\":112,\"../shared/find-parent-tags\":114,\"../shared/focus-intercept\":115}],107:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar allowedStyles = _dereq_(\"../shared/constants\").allowedStyles;\n\nmodule.exports = function getStylesFromClass(cssClass) {\n var element = document.createElement(\"input\");\n var styles = {};\n var computedStyles;\n\n if (cssClass[0] === \".\") {\n cssClass = cssClass.substring(1);\n }\n\n element.className = cssClass;\n element.style.display = \"none !important\";\n element.style.position = \"fixed !important\";\n element.style.left = \"-99999px !important\";\n element.style.top = \"-99999px !important\";\n document.body.appendChild(element);\n\n computedStyles = window.getComputedStyle(element);\n\n allowedStyles.forEach(function (style) {\n var value = computedStyles[style];\n\n if (value) {\n styles[style] = value;\n }\n });\n\n document.body.removeChild(element);\n\n return styles;\n};\n\n},{\"../shared/constants\":112}],108:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar assign = _dereq_(\"../../lib/assign\").assign;\nvar createAssetsUrl = _dereq_(\"../../lib/create-assets-url\");\nvar isVerifiedDomain = _dereq_(\"../../lib/is-verified-domain\");\nvar Destructor = _dereq_(\"../../lib/destructor\");\nvar iFramer = _dereq_(\"@braintree/iframer\");\nvar Bus = _dereq_(\"framebus\");\nvar createDeferredClient = _dereq_(\"../../lib/create-deferred-client\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar composeUrl = _dereq_(\"./compose-url\");\nvar getStylesFromClass = _dereq_(\"./get-styles-from-class\");\nvar constants = _dereq_(\"../shared/constants\");\nvar errors = _dereq_(\"../shared/errors\");\nvar INTEGRATION_TIMEOUT_MS =\n _dereq_(\"../../lib/constants\").INTEGRATION_TIMEOUT_MS;\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar findParentTags = _dereq_(\"../shared/find-parent-tags\");\nvar browserDetection = _dereq_(\"../shared/browser-detection\");\nvar events = constants.events;\nvar EventEmitter = _dereq_(\"@braintree/event-emitter\");\nvar injectFrame = _dereq_(\"./inject-frame\");\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar allowedFields = constants.allowedFields;\nvar methods = _dereq_(\"../../lib/methods\");\nvar shadow = _dereq_(\"../../lib/shadow\");\nvar findRootNode = _dereq_(\"../../lib/find-root-node\");\nvar convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\nvar sharedErrors = _dereq_(\"../../lib/errors\");\nvar getCardTypes = _dereq_(\"../shared/get-card-types\");\nvar attributeValidationError = _dereq_(\"./attribute-validation-error\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar focusChange = _dereq_(\"./focus-change\");\nvar destroyFocusIntercept = _dereq_(\"../shared/focus-intercept\").destroy;\n\nvar SAFARI_FOCUS_TIMEOUT = 5;\n\n/**\n * @typedef {object} HostedFields~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} authenticationInsight Info about the [regulatory environment](https://developer.paypal.com/braintree/docs/guides/3d-secure/advanced-options/javascript/v3#authentication-insight) of the tokenized card. Only available if `authenticationInsight.merchantAccountId` is passed in the `tokenize` method options.\n * @property {string} authenticationInsight.regulationEnvironment The [regulation environment](https://developer.paypal.com/braintree/docs/guides/3d-secure/advanced-options/javascript/v3#authentication-insight) for the tokenized card.\n * @property {object} details Additional account details.\n * @property {string} details.bin The BIN number of the card.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.expirationMonth The expiration month of the card.\n * @property {string} details.expirationYear The expiration year of the card.\n * @property {string} details.cardholderName The cardholder name tokenized with the card.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, always `CreditCard`.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n/**\n * @typedef {object} HostedFields~stateObject\n * @description The event payload sent from {@link HostedFields#on|on} or {@link HostedFields#getState|getState}.\n * @property {HostedFields~hostedFieldsCard[]} cards\n * This will return an array of potential {@link HostedFields~hostedFieldsCard|cards}. If the card type has been determined, the array will contain only one card.\n * Internally, Hosted Fields uses <a href=\"https://github.com/braintree/credit-card-type\">credit-card-type</a>,\n * an open-source card detection library.\n * @property {string} emittedBy\n * The name of the field associated with an event. This will not be included if returned by {@link HostedFields#getState|getState}. It will be one of the following strings:<br>\n * - `\"number\"`\n * - `\"cvv\"`\n * - `\"expirationDate\"`\n * - `\"expirationMonth\"`\n * - `\"expirationYear\"`\n * - `\"postalCode\"`\n * - `\"cardholderName\"`\n * @property {object} fields\n * @property {?HostedFields~hostedFieldsFieldData} fields.number {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the number field, if it is present.\n * @property {?HostedFields~hostedFieldsFieldData} fields.cvv {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the CVV field, if it is present.\n * @property {?HostedFields~hostedFieldsFieldData} fields.expirationDate {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration date field, if it is present.\n * @property {?HostedFields~hostedFieldsFieldData} fields.expirationMonth {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration month field, if it is present.\n * @property {?HostedFields~hostedFieldsFieldData} fields.expirationYear {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the expiration year field, if it is present.\n * @property {?HostedFields~hostedFieldsFieldData} fields.postalCode {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the postal code field, if it is present.\n * @property {?HostedFields~hostedFieldsFieldData} fields.cardholderName {@link HostedFields~hostedFieldsFieldData|hostedFieldsFieldData} for the cardholder name field, if it is present.\n */\n\n/**\n * @typedef {object} HostedFields~binPayload\n * @description The event payload sent from {@link HostedFields#on|on} when the {@link HostedFields#event:binAvailable|binAvailable} event is emitted.\n * @property {string} bin The first 6 digits of the card number.\n */\n\n/**\n * @typedef {object} HostedFields~hostedFieldsFieldData\n * @description Data about Hosted Fields fields, sent in {@link HostedFields~stateObject|stateObjects}.\n * @property {HTMLElement} container Reference to the container DOM element on your page associated with the current event.\n * @property {boolean} isFocused Whether or not the input is currently focused.\n * @property {boolean} isEmpty Whether or not the user has entered a value in the input.\n * @property {boolean} isPotentiallyValid\n * A determination based on the future validity of the input value.\n * This is helpful when a user is entering a card number and types <code>\"41\"</code>.\n * While that value is not valid for submission, it is still possible for\n * it to become a fully qualified entry. However, if the user enters <code>\"4x\"</code>\n * it is clear that the card number can never become valid and isPotentiallyValid will\n * return false.\n * @property {boolean} isValid Whether or not the value of the associated input is <i>fully</i> qualified for submission.\n */\n\n/**\n * @typedef {object} HostedFields~hostedFieldsCard\n * @description Information about the card type, sent in {@link HostedFields~stateObject|stateObjects}.\n * @property {string} type The code-friendly representation of the card type. It will be one of the following strings:\n * - `american-express`\n * - `diners-club`\n * - `discover`\n * - `jcb`\n * - `maestro`\n * - `master-card`\n * - `unionpay`\n * - `visa`\n * @property {string} niceType The pretty-printed card type. It will be one of the following strings:\n * - `American Express`\n * - `Diners Club`\n * - `Discover`\n * - `JCB`\n * - `Maestro`\n * - `MasterCard`\n * - `UnionPay`\n * - `Visa`\n * @property {object} code\n * This object contains data relevant to the security code requirements of the card brand.\n * For example, on a Visa card there will be a <code>CVV</code> of 3 digits, whereas an\n * American Express card requires a 4-digit <code>CID</code>.\n * @property {string} code.name <code>\"CVV\"</code> <code>\"CID\"</code> <code>\"CVC\"</code>\n * @property {number} code.size The expected length of the security code. Typically, this is 3 or 4.\n */\n\n/**\n * @name HostedFields#on\n * @function\n * @param {string} event The name of the event to which you are subscribing.\n * @param {function} handler A callback to handle the event.\n * @description Subscribes a handler function to a named event.\n *\n * **Events that emit a {@link HostedFields~stateObject|stateObject}.**\n * * {@link HostedFields#event:blur|blur}\n * * {@link HostedFields#event:focus|focus}\n * * {@link HostedFields#event:empty|empty}\n * * {@link HostedFields#event:notEmpty|notEmpty}\n * * {@link HostedFields#event:cardTypeChange|cardTypeChange}\n * * {@link HostedFields#event:validityChange|validityChange}\n * * {@link HostedFields#event:inputSubmitRequest|inputSubmitRequest}\n *\n * **Other Events**\n * * {@link HostedFields#event:binAvailable|binAvailable} - emits a {@link HostedFields~binPayload|bin payload}. Note: If you are using a [Referrer-Policy](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy) header that prevents the origin from being sent, this event will not fire.\n * @example\n * <caption>Listening to a Hosted Field event, in this case 'focus'</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('focus', function (event) {\n * console.log(event.emittedBy, 'has been focused');\n * });\n * });\n * @returns {void}\n */\n\n/**\n * @name HostedFields#off\n * @function\n * @param {string} event The name of the event to which you are unsubscribing.\n * @param {function} handler The callback for the event you are unsubscribing from.\n * @description Unsubscribes the handler function to a named event.\n * @example\n * <caption>Subscribing and then unsubscribing from a Hosted Field event, in this case 'focus'</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * var callback = function (event) {\n * console.log(event.emittedBy, 'has been focused');\n * };\n * hostedFieldsInstance.on('focus', callback);\n *\n * // later on\n * hostedFieldsInstance.off('focus', callback);\n * });\n * @returns {void}\n */\n\n/**\n * This event is emitted when the user requests submission of an input field, such as by pressing the Enter or Return key on their keyboard, or mobile equivalent.\n * @event HostedFields#inputSubmitRequest\n * @type {HostedFields~stateObject}\n * @example\n * <caption>Clicking a submit button upon hitting Enter (or equivalent) within a Hosted Field</caption>\n * var hostedFields = require('braintree-web/hosted-fields');\n * var submitButton = document.querySelector('input[type=\"submit\"]');\n *\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('inputSubmitRequest', function () {\n * // User requested submission, e.g. by pressing Enter or equivalent\n * submitButton.click();\n * });\n * });\n */\n\n/**\n * This event is emitted when a field transitions from having data to being empty.\n * @event HostedFields#empty\n * @type {HostedFields~stateObject}\n * @example\n * <caption>Listening to an empty event</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('empty', function (event) {\n * console.log(event.emittedBy, 'is now empty');\n * });\n * });\n */\n\n/**\n * This event is emitted when a field transitions from being empty to having data.\n * @event HostedFields#notEmpty\n * @type {HostedFields~stateObject}\n * @example\n * <caption>Listening to an notEmpty event</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('notEmpty', function (event) {\n * console.log(event.emittedBy, 'is now not empty');\n * });\n * });\n */\n\n/**\n * This event is emitted when a field loses focus.\n * @event HostedFields#blur\n * @type {HostedFields~stateObject}\n * @example\n * <caption>Listening to a blur event</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('blur', function (event) {\n * console.log(event.emittedBy, 'lost focus');\n * });\n * });\n */\n\n/**\n * This event is emitted when a field gains focus.\n * @event HostedFields#focus\n * @type {HostedFields~stateObject}\n * @example\n * <caption>Listening to a focus event</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('focus', function (event) {\n * console.log(event.emittedBy, 'gained focus');\n * });\n * });\n */\n\n/**\n * This event is emitted when activity within the number field has changed such that the possible card type has changed.\n * @event HostedFields#cardTypeChange\n * @type {HostedFields~stateObject}\n * @example\n * <caption>Listening to a cardTypeChange event</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('cardTypeChange', function (event) {\n * if (event.cards.length === 1) {\n * console.log(event.cards[0].type);\n * } else {\n * console.log('Type of card not yet known');\n * }\n * });\n * });\n */\n\n/**\n * This event is emitted when the validity of a field has changed. Validity is represented in the {@link HostedFields~stateObject|stateObject} as two booleans: `isValid` and `isPotentiallyValid`.\n * @event HostedFields#validityChange\n * @type {HostedFields~stateObject}\n * @example\n * <caption>Listening to a validityChange event</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('validityChange', function (event) {\n * var field = event.fields[event.emittedBy];\n *\n * if (field.isValid) {\n * console.log(event.emittedBy, 'is fully valid');\n * } else if (field.isPotentiallyValid) {\n * console.log(event.emittedBy, 'is potentially valid');\n * } else {\n * console.log(event.emittedBy, 'is not valid');\n * }\n * });\n * });\n */\n\n/**\n * This event is emitted when the first 6 digits of the card number have been entered by the customer.\n * @event HostedFields#binAvailable\n * @type {string}\n * @example\n * <caption>Listening to a `binAvailable` event</caption>\n * hostedFields.create({ ... }, function (createErr, hostedFieldsInstance) {\n * hostedFieldsInstance.on('binAvailable', function (event) {\n * event.bin // send bin to 3rd party bin service\n * });\n * });\n */\n\nfunction createInputEventHandler(fields) {\n return function (eventData) {\n var field;\n var merchantPayload = eventData.merchantPayload;\n var emittedBy = merchantPayload.emittedBy;\n var container = fields[emittedBy].containerElement;\n\n Object.keys(merchantPayload.fields).forEach(function (key) {\n merchantPayload.fields[key].container = fields[key].containerElement;\n });\n\n field = merchantPayload.fields[emittedBy];\n\n container.classList.toggle(\n constants.externalClasses.FOCUSED,\n field.isFocused\n );\n container.classList.toggle(constants.externalClasses.VALID, field.isValid);\n\n container.classList.toggle(\n constants.externalClasses.INVALID,\n !field.isPotentiallyValid\n );\n\n // eslint-disable-next-line no-invalid-this\n this._state = {\n cards: merchantPayload.cards,\n fields: merchantPayload.fields,\n };\n\n this._emit(eventData.type, merchantPayload); // eslint-disable-line no-invalid-this\n };\n}\n\nfunction isVisibleEnough(node) {\n var boundingBox = node.getBoundingClientRect();\n var verticalMidpoint = Math.floor(boundingBox.height / 2);\n var horizontalMidpoint = Math.floor(boundingBox.width / 2);\n\n return (\n boundingBox.top <\n (window.innerHeight - verticalMidpoint ||\n document.documentElement.clientHeight - verticalMidpoint) &&\n boundingBox.right > horizontalMidpoint &&\n boundingBox.bottom > verticalMidpoint &&\n boundingBox.left <\n (window.innerWidth - horizontalMidpoint ||\n document.documentElement.clientWidth - horizontalMidpoint)\n );\n}\n\n/**\n * @class HostedFields\n * @param {object} options The Hosted Fields {@link module:braintree-web/hosted-fields.create create} options.\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/hosted-fields.create|braintree-web.hosted-fields.create} instead.</strong>\n * @classdesc This class represents a Hosted Fields component produced by {@link module:braintree-web/hosted-fields.create|braintree-web/hosted-fields.create}. Instances of this class have methods for interacting with the input fields within Hosted Fields' iframes.\n */\nfunction HostedFields(options) {\n var failureTimeout, clientConfig, assetsUrl, isDebug, hostedFieldsUrl;\n var self = this;\n var fields = {};\n var frameReadyPromiseResolveFunctions = {};\n var frameReadyPromises = [];\n var componentId = uuid();\n\n this._merchantConfigurationOptions = assign({}, options);\n\n if (options.client) {\n clientConfig = options.client.getConfiguration();\n assetsUrl = clientConfig.gatewayConfiguration.assetsUrl;\n isDebug = clientConfig.isDebug;\n } else {\n assetsUrl = createAssetsUrl.create(options.authorization);\n isDebug = Boolean(options.isDebug);\n }\n\n this._clientPromise = createDeferredClient.create({\n client: options.client,\n authorization: options.authorization,\n debug: isDebug,\n assetsUrl: assetsUrl,\n name: \"Hosted Fields\",\n });\n\n hostedFieldsUrl = composeUrl(assetsUrl, componentId, isDebug);\n\n if (!options.fields || Object.keys(options.fields).length === 0) {\n throw new BraintreeError({\n type: sharedErrors.INSTANTIATION_OPTION_REQUIRED.type,\n code: sharedErrors.INSTANTIATION_OPTION_REQUIRED.code,\n message: \"options.fields is required when instantiating Hosted Fields.\",\n });\n }\n\n EventEmitter.call(this);\n\n this._injectedNodes = [];\n this._destructor = new Destructor();\n this._fields = fields;\n this._state = {\n fields: {},\n cards: getCardTypes(\"\"),\n };\n\n this._bus = new Bus({\n channel: componentId,\n verifyDomain: isVerifiedDomain,\n targetFrames: [window],\n });\n\n this._destructor.registerFunctionForTeardown(function () {\n self._bus.teardown();\n });\n\n // NEXT_MAJOR_VERSION analytics events should have present tense verbs\n if (!options.client) {\n analytics.sendEvent(\n this._clientPromise,\n \"custom.hosted-fields.initialized.deferred-client\"\n );\n } else {\n analytics.sendEvent(\n this._clientPromise,\n \"custom.hosted-fields.initialized\"\n );\n }\n\n Object.keys(options.fields).forEach(\n function (key) {\n var field, externalContainer, internalContainer, frame, frameReadyPromise;\n\n if (!constants.allowedFields.hasOwnProperty(key)) {\n throw new BraintreeError({\n type: errors.HOSTED_FIELDS_INVALID_FIELD_KEY.type,\n code: errors.HOSTED_FIELDS_INVALID_FIELD_KEY.code,\n message: '\"' + key + '\" is not a valid field.',\n });\n }\n\n field = options.fields[key];\n // NEXT_MAJOR_VERSION remove selector as an option\n // and simply make the API take a container\n externalContainer = field.container || field.selector;\n\n if (typeof externalContainer === \"string\") {\n externalContainer = document.querySelector(externalContainer);\n }\n\n if (!externalContainer || externalContainer.nodeType !== 1) {\n throw new BraintreeError({\n type: errors.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.type,\n code: errors.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.code,\n message: errors.HOSTED_FIELDS_INVALID_FIELD_SELECTOR.message,\n details: {\n fieldSelector: field.selector,\n fieldContainer: field.container,\n fieldKey: key,\n },\n });\n } else if (\n externalContainer.querySelector('iframe[name^=\"braintree-\"]')\n ) {\n throw new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.type,\n code: errors.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.code,\n message: errors.HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME.message,\n details: {\n fieldSelector: field.selector,\n fieldContainer: field.container,\n fieldKey: key,\n },\n });\n }\n\n internalContainer = externalContainer;\n\n if (shadow.isShadowElement(internalContainer)) {\n internalContainer = shadow.transformToSlot(\n internalContainer,\n \"height: 100%\"\n );\n }\n\n if (field.maxlength && typeof field.maxlength !== \"number\") {\n throw new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,\n message: \"The value for maxlength must be a number.\",\n details: {\n fieldKey: key,\n },\n });\n }\n\n if (field.minlength && typeof field.minlength !== \"number\") {\n throw new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,\n message: \"The value for minlength must be a number.\",\n details: {\n fieldKey: key,\n },\n });\n }\n\n frame = iFramer({\n type: key,\n name: \"braintree-hosted-field-\" + key,\n style: constants.defaultIFrameStyle,\n title:\n field.iframeTitle ||\n \"Secure Credit Card Frame - \" + constants.allowedFields[key].label,\n });\n this._bus.addTargetFrame(frame);\n\n this._injectedNodes.push.apply(\n this._injectedNodes,\n injectFrame(componentId, frame, internalContainer, function () {\n self.focus(key);\n })\n );\n\n this._setupLabelFocus(key, externalContainer);\n fields[key] = {\n frameElement: frame,\n containerElement: externalContainer,\n };\n frameReadyPromise = new Promise(function (resolve) {\n frameReadyPromiseResolveFunctions[key] = resolve;\n });\n frameReadyPromises.push(frameReadyPromise);\n\n this._state.fields[key] = {\n isEmpty: true,\n isValid: false,\n isPotentiallyValid: true,\n isFocused: false,\n container: externalContainer,\n };\n\n // prevents loading the iframe from blocking the code\n setTimeout(function () {\n frame.src = hostedFieldsUrl;\n }, 0);\n }.bind(this)\n );\n\n if (this._merchantConfigurationOptions.styles) {\n Object.keys(this._merchantConfigurationOptions.styles).forEach(function (\n selector\n ) {\n var className = self._merchantConfigurationOptions.styles[selector];\n\n if (typeof className === \"string\") {\n self._merchantConfigurationOptions.styles[selector] =\n getStylesFromClass(className);\n }\n });\n }\n\n this._bus.on(events.REMOVE_FOCUS_INTERCEPTS, function (data) {\n destroyFocusIntercept(data && data.id);\n });\n\n this._bus.on(\n events.TRIGGER_FOCUS_CHANGE,\n focusChange.createFocusChangeHandler(componentId, {\n onRemoveFocusIntercepts: function (element) {\n self._bus.emit(events.REMOVE_FOCUS_INTERCEPTS, {\n id: element,\n });\n },\n onTriggerInputFocus: function (targetType) {\n self.focus(targetType);\n },\n })\n );\n\n this._bus.on(events.READY_FOR_CLIENT, function (reply) {\n self._clientPromise.then(function (client) {\n reply(client);\n });\n });\n\n this._bus.on(events.CARD_FORM_ENTRY_HAS_BEGUN, function () {\n analytics.sendEvent(self._clientPromise, \"hosted-fields.input.started\");\n });\n\n this._bus.on(events.BIN_AVAILABLE, function (bin) {\n self._emit(\"binAvailable\", {\n bin: bin,\n });\n });\n\n failureTimeout = setTimeout(function () {\n analytics.sendEvent(\n self._clientPromise,\n \"custom.hosted-fields.load.timed-out\"\n );\n self._emit(\"timeout\");\n }, INTEGRATION_TIMEOUT_MS);\n\n Promise.all(frameReadyPromises).then(function (results) {\n var reply = results[0];\n\n clearTimeout(failureTimeout);\n reply(\n formatMerchantConfigurationForIframes(self._merchantConfigurationOptions)\n );\n\n self._cleanUpFocusIntercepts();\n\n self._emit(\"ready\");\n });\n\n this._bus.on(events.FRAME_READY, function (data, reply) {\n frameReadyPromiseResolveFunctions[data.field](reply);\n });\n\n this._bus.on(events.INPUT_EVENT, createInputEventHandler(fields).bind(this));\n\n this._destructor.registerFunctionForTeardown(function () {\n var j, node, parent;\n\n for (j = 0; j < self._injectedNodes.length; j++) {\n node = self._injectedNodes[j];\n parent = node.parentNode;\n\n parent.removeChild(node);\n\n parent.classList.remove(\n constants.externalClasses.FOCUSED,\n constants.externalClasses.INVALID,\n constants.externalClasses.VALID\n );\n }\n });\n\n this._destructor.registerFunctionForTeardown(function () {\n destroyFocusIntercept();\n });\n\n this._destructor.registerFunctionForTeardown(function () {\n var methodNames = methods(HostedFields.prototype).concat(\n methods(EventEmitter.prototype)\n );\n\n convertMethodsToError(self, methodNames);\n });\n}\n\nEventEmitter.createChild(HostedFields);\n\nHostedFields.prototype._setupLabelFocus = function (type, container) {\n var labels, i;\n var self = this;\n var rootNode = findRootNode(container);\n\n if (container.id == null) {\n return;\n }\n\n function triggerFocus() {\n self.focus(type);\n }\n\n // find any labels in the normal DOM\n labels = Array.prototype.slice.call(\n document.querySelectorAll('label[for=\"' + container.id + '\"]')\n );\n if (rootNode !== document) {\n // find any labels within the shadow dom\n labels = labels.concat(\n Array.prototype.slice.call(\n rootNode.querySelectorAll('label[for=\"' + container.id + '\"]')\n )\n );\n }\n // find any labels surrounding the container that don't also have the `for` attribute\n labels = labels.concat(findParentTags(container, \"label\"));\n // filter out any accidental duplicates\n labels = labels.filter(function (label, index, arr) {\n return arr.indexOf(label) === index;\n });\n\n for (i = 0; i < labels.length; i++) {\n labels[i].addEventListener(\"click\", triggerFocus, false);\n }\n\n this._destructor.registerFunctionForTeardown(function () {\n for (i = 0; i < labels.length; i++) {\n labels[i].removeEventListener(\"click\", triggerFocus, false);\n }\n });\n};\n\nHostedFields.prototype._getAnyFieldContainer = function () {\n var self = this;\n\n return Object.keys(this._fields).reduce(function (found, field) {\n return found || self._fields[field].containerElement;\n }, null);\n};\n\nHostedFields.prototype._cleanUpFocusIntercepts = function () {\n var iframeContainer, checkoutForm;\n\n if (document.forms.length < 1) {\n this._bus.emit(events.REMOVE_FOCUS_INTERCEPTS);\n } else {\n iframeContainer = this._getAnyFieldContainer();\n checkoutForm = findParentTags(iframeContainer, \"form\")[0];\n\n if (checkoutForm) {\n focusChange.removeExtraFocusElements(\n checkoutForm,\n function (id) {\n this._bus.emit(events.REMOVE_FOCUS_INTERCEPTS, {\n id: id,\n });\n }.bind(this)\n );\n } else {\n this._bus.emit(events.REMOVE_FOCUS_INTERCEPTS);\n }\n }\n};\n\nHostedFields.prototype._attachInvalidFieldContainersToError = function (err) {\n if (\n !(\n err.details &&\n err.details.invalidFieldKeys &&\n err.details.invalidFieldKeys.length > 0\n )\n ) {\n return;\n }\n err.details.invalidFields = {};\n err.details.invalidFieldKeys.forEach(\n function (field) {\n err.details.invalidFields[field] = this._fields[field].containerElement;\n }.bind(this)\n );\n};\n\n/**\n * Get card verification challenges, such as requirements for cvv and postal code.\n * @public\n * @param {callback} [callback] Called on completion, containing an error if one occurred. If no callback is provided, `getChallenges` returns a promise.\n * @example\n * hostedFieldsInstance.getChallenges().then(function (challenges) {\n * challenges // ['cvv', 'postal_code']\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.getChallenges = function () {\n return this._clientPromise.then(function (client) {\n return client.getConfiguration().gatewayConfiguration.challenges;\n });\n};\n\n/**\n * Get supported card types configured in the Braintree Control Panel\n * @public\n * @param {callback} [callback] Called on completion, containing an error if one occurred. If no callback is provided, `getSupportedCardTypes` returns a promise.\n * @example\n * hostedFieldsInstance.getSupportedCardTypes().then(function (cardTypes) {\n * cardTypes // ['Visa', 'American Express', 'Mastercard']\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.getSupportedCardTypes = function () {\n return this._clientPromise.then(function (client) {\n var cards = client\n .getConfiguration()\n .gatewayConfiguration.creditCards.supportedCardTypes.map(function (\n cardType\n ) {\n if (cardType === \"MasterCard\") {\n // Mastercard changed their branding. We can't update our\n // config without creating a breaking change, so we just\n // hard code the change here\n return \"Mastercard\";\n }\n\n return cardType;\n });\n\n return cards;\n });\n};\n\n/**\n * Cleanly remove anything set up by {@link module:braintree-web/hosted-fields.create|create}.\n * @public\n * @param {callback} [callback] Called on completion, containing an error if one occurred. No data is returned if teardown completes successfully. If no callback is provided, `teardown` returns a promise.\n * @example\n * hostedFieldsInstance.teardown(function (teardownErr) {\n * if (teardownErr) {\n * console.error('Could not tear down Hosted Fields!');\n * } else {\n * console.info('Hosted Fields has been torn down!');\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.teardown = function () {\n var self = this;\n\n return new Promise(function (resolve, reject) {\n self._destructor.teardown(function (err) {\n analytics.sendEvent(\n self._clientPromise,\n \"custom.hosted-fields.teardown-completed\"\n );\n\n if (err) {\n reject(err);\n } else {\n resolve();\n }\n });\n });\n};\n\n/**\n * Tokenizes fields and returns a nonce payload.\n * @public\n * @param {object} [options] All tokenization options for the Hosted Fields component.\n * @param {boolean} [options.vault=false] When true, will vault the tokenized card. Cards will only be vaulted when using a client created with a client token that includes a customer ID. Note: merchants using Advanced Fraud Tools should not use this option, as device data will not be included.\n * @param {object} [options.authenticationInsight] Options for checking authentication insight - the [regulatory environment](https://developer.paypal.com/braintree/docs/guides/3d-secure/advanced-options/javascript/v3#authentication-insight) of the tokenized card.\n * @param {string} options.authenticationInsight.merchantAccountId The Braintree merchant account id to use to look up the authentication insight information.\n * @param {array} [options.fieldsToTokenize] By default, all fields will be tokenized. You may specify which fields specifically you wish to tokenize with this property. Valid options are `'number'`, `'cvv'`, `'expirationDate'`, `'expirationMonth'`, `'expirationYear'`, `'postalCode'`, `'cardholderName'`.\n * @param {string} [options.cardholderName] When supplied, the cardholder name to be tokenized with the contents of the fields.\n * @param {string} [options.billingAddress.postalCode] When supplied, this postal code will be tokenized along with the contents of the fields. If a postal code is provided as part of the Hosted Fields configuration, the value of the field will be tokenized and this value will be ignored.\n * @param {string} [options.billingAddress.firstName] When supplied, this customer first name will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.lastName] When supplied, this customer last name will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.company] When supplied, this company name will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.streetAddress] When supplied, this street address will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.extendedAddress] When supplied, this extended address will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.locality] When supplied, this locality (the city) will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.region] When supplied, this region (the state) will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.countryCodeNumeric] When supplied, this numeric country code will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.countryCodeAlpha2] When supplied, this alpha 2 representation of a country will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.countryCodeAlpha3] When supplied, this alpha 3 representation of a country will be tokenized along with the contents of the fields.\n * @param {string} [options.billingAddress.countryName] When supplied, this country name will be tokenized along with the contents of the fields.\n *\n * @param {callback} [callback] May be used as the only parameter of the function if no options are passed in. The second argument, <code>data</code>, is a {@link HostedFields~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a function that resolves with a {@link HostedFields~tokenizePayload|tokenizePayload}.\n * @example <caption>Tokenize a card</caption>\n * hostedFieldsInstance.tokenize(function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * switch (tokenizeErr.code) {\n * case 'HOSTED_FIELDS_FIELDS_EMPTY':\n * // occurs when none of the fields are filled in\n * console.error('All fields are empty! Please fill out the form.');\n * break;\n * case 'HOSTED_FIELDS_FIELDS_INVALID':\n * // occurs when certain fields do not pass client side validation\n * console.error('Some fields are invalid:', tokenizeErr.details.invalidFieldKeys);\n *\n * // you can also programmatically access the field containers for the invalid fields\n * tokenizeErr.details.invalidFields.forEach(function (fieldContainer) {\n * fieldContainer.className = 'invalid';\n * });\n * break;\n * case 'HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE':\n * // occurs when:\n * // * the client token used for client authorization was generated\n * // with a customer ID and the fail on duplicate payment method\n * // option is set to true\n * // * the card being tokenized has previously been vaulted (with any customer)\n * // See: https://developer.paypal.com/braintree/docs/reference/request/client-token/generate#options.fail_on_duplicate_payment_method\n * console.error('This payment method already exists in your vault.');\n * break;\n * case 'HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED':\n * // occurs when:\n * // * the client token used for client authorization was generated\n * // with a customer ID and the verify card option is set to true\n * // and you have credit card verification turned on in the Braintree\n * // control panel\n * // * the cvv does not pass verification (https://developer.paypal.com/braintree/docs/reference/general/testing#avs-and-cvv/cid-responses)\n * // See: https://developer.paypal.com/braintree/docs/reference/request/client-token/generate#options.verify_card\n * console.error('CVV did not pass verification');\n * break;\n * case 'HOSTED_FIELDS_FAILED_TOKENIZATION':\n * // occurs for any other tokenization error on the server\n * console.error('Tokenization failed server side. Is the card valid?');\n * break;\n * case 'HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR':\n * // occurs when the Braintree gateway cannot be contacted\n * console.error('Network error occurred when tokenizing.');\n * break;\n * default:\n * console.error('Something bad happened!', tokenizeErr);\n * }\n * } else {\n * console.log('Got nonce:', payload.nonce);\n * }\n * });\n * @example <caption>Tokenize and vault a card</caption>\n * hostedFieldsInstance.tokenize({\n * vault: true\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * console.error(tokenizeErr);\n * } else {\n * console.log('Got nonce:', payload.nonce);\n * }\n * });\n * @example <caption>Tokenize a card with non-Hosted Fields cardholder name</caption>\n * hostedFieldsInstance.tokenize({\n * cardholderName: 'First Last'\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * console.error(tokenizeErr);\n * } else {\n * console.log('Got nonce:', payload.nonce);\n * }\n * });\n * @example <caption>Tokenize a card with non-Hosted Fields postal code option</caption>\n * hostedFieldsInstance.tokenize({\n * billingAddress: {\n * postalCode: '11111'\n * }\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * console.error(tokenizeErr);\n * } else {\n * console.log('Got nonce:', payload.nonce);\n * }\n * });\n * @example <caption>Tokenize a card with additional billing address options</caption>\n * hostedFieldsInstance.tokenize({\n * billingAddress: {\n * firstName: 'First',\n * lastName: 'Last',\n * company: 'Company',\n * streetAddress: '123 Street',\n * extendedAddress: 'Unit 1',\n * // passing just one of the country options is sufficient to\n * // associate the card details with a particular country\n * // valid country names and codes can be found here:\n * // https://developer.paypal.com/braintree/docs/reference/general/countries/ruby#list-of-countries\n * countryName: 'United States',\n * countryCodeAlpha2: 'US',\n * countryCodeAlpha3: 'USA',\n * countryCodeNumeric: '840'\n * }\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * console.error(tokenizeErr);\n * } else {\n * console.log('Got nonce:', payload.nonce);\n * }\n * });\n * @example <caption>Allow tokenization with empty cardholder name field</caption>\n * var state = hostedFieldsInstance.getState();\n * var fields = Object.keys(state.fields);\n *\n * // normally, if you tried to tokenize an empty cardholder name field\n * // you would get an error, to allow making this field optional,\n * // tokenize all the fields except for the cardholder name field\n * // when the cardholder name field is empty. Otherwise, tokenize\n * // all the fields\n * if (state.fields.cardholderName.isEmpty) {\n * fields = fields.filter(function (field) {\n * return field !== 'cardholderName';\n * });\n * }\n *\n * hostedFieldsInstance.tokenize({\n * fieldsToTokenize: fields\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * console.error(tokenizeErr);\n * } else {\n * console.log('Got nonce:', payload.nonce);\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.tokenize = function (options) {\n var self = this;\n\n if (!options) {\n options = {};\n }\n\n return new Promise(function (resolve, reject) {\n self._bus.emit(events.TOKENIZATION_REQUEST, options, function (response) {\n var err = response[0];\n var payload = response[1];\n\n if (err) {\n self._attachInvalidFieldContainersToError(err);\n reject(new BraintreeError(err));\n } else {\n resolve(payload);\n }\n });\n });\n};\n\n/**\n * Add a class to a {@link module:braintree-web/hosted-fields~field field}. Useful for updating field styles when events occur elsewhere in your checkout.\n * @public\n * @param {string} field The field you wish to add a class to. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.\n * @param {string} classname The class to be added.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the class is added successfully.\n *\n * @example\n * hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr) {\n * if (addClassErr) {\n * console.error(addClassErr);\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.addClass = function (field, classname) {\n var err;\n\n if (!allowedFields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_INVALID.code,\n message:\n '\"' +\n field +\n '\" is not a valid field. You must use a valid field option when adding a class.',\n });\n } else if (!this._fields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,\n code: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,\n message:\n 'Cannot add class to \"' +\n field +\n '\" field because it is not part of the current Hosted Fields options.',\n });\n } else {\n this._bus.emit(events.ADD_CLASS, {\n field: field,\n classname: classname,\n });\n }\n\n if (err) {\n return Promise.reject(err);\n }\n\n return Promise.resolve();\n};\n\n/**\n * Removes a class to a {@link module:braintree-web/hosted-fields~field field}. Useful for updating field styles when events occur elsewhere in your checkout.\n * @public\n * @param {string} field The field you wish to remove a class from. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.\n * @param {string} classname The class to be removed.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the class is removed successfully.\n *\n * @example\n * hostedFieldsInstance.addClass('number', 'custom-class', function (addClassErr) {\n * if (addClassErr) {\n * console.error(addClassErr);\n * return;\n * }\n *\n * // some time later...\n * hostedFieldsInstance.removeClass('number', 'custom-class');\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.removeClass = function (field, classname) {\n var err;\n\n if (!allowedFields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_INVALID.code,\n message:\n '\"' +\n field +\n '\" is not a valid field. You must use a valid field option when removing a class.',\n });\n } else if (!this._fields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,\n code: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,\n message:\n 'Cannot remove class from \"' +\n field +\n '\" field because it is not part of the current Hosted Fields options.',\n });\n } else {\n this._bus.emit(events.REMOVE_CLASS, {\n field: field,\n classname: classname,\n });\n }\n\n if (err) {\n return Promise.reject(err);\n }\n\n return Promise.resolve();\n};\n\n/**\n * Sets an attribute of a {@link module:braintree-web/hosted-fields~field field}.\n * Supported attributes are `aria-invalid`, `aria-required`, `disabled`, and `placeholder`.\n *\n * @public\n * @param {object} options The options for the attribute you wish to set.\n * @param {string} options.field The field to which you wish to add an attribute. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.\n * @param {string} options.attribute The name of the attribute you wish to add to the field.\n * @param {string} options.value The value for the attribute.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the attribute is set successfully.\n *\n * @example <caption>Set the placeholder attribute of a field</caption>\n * hostedFieldsInstance.setAttribute({\n * field: 'number',\n * attribute: 'placeholder',\n * value: '1111 1111 1111 1111'\n * }, function (attributeErr) {\n * if (attributeErr) {\n * console.error(attributeErr);\n * }\n * });\n *\n * @example <caption>Set the aria-required attribute of a field</caption>\n * hostedFieldsInstance.setAttribute({\n * field: 'number',\n * attribute: 'aria-required',\n * value: true\n * }, function (attributeErr) {\n * if (attributeErr) {\n * console.error(attributeErr);\n * }\n * });\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.setAttribute = function (options) {\n var attributeErr, err;\n\n if (!allowedFields.hasOwnProperty(options.field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_INVALID.code,\n message:\n '\"' +\n options.field +\n '\" is not a valid field. You must use a valid field option when setting an attribute.',\n });\n } else if (!this._fields.hasOwnProperty(options.field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,\n code: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,\n message:\n 'Cannot set attribute for \"' +\n options.field +\n '\" field because it is not part of the current Hosted Fields options.',\n });\n } else {\n attributeErr = attributeValidationError(options.attribute, options.value);\n\n if (attributeErr) {\n err = attributeErr;\n } else {\n this._bus.emit(events.SET_ATTRIBUTE, {\n field: options.field,\n attribute: options.attribute,\n value: options.value,\n });\n }\n }\n\n if (err) {\n return Promise.reject(err);\n }\n\n return Promise.resolve();\n};\n\n/**\n * Sets the month options for the expiration month field when presented as a select element.\n *\n * @public\n * @param {array} options An array of 12 entries corresponding to the 12 months.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the options are updated successfully. Errors if expirationMonth is not configured on the Hosted Fields instance or if the expirationMonth field is not configured to be a select input.\n *\n * @example <caption>Update the month options to spanish</caption>\n * hostedFieldsInstance.setMonthOptions([\n * '01 - enero',\n * '02 - febrero',\n * '03 - marzo',\n * '04 - abril',\n * '05 - mayo',\n * '06 - junio',\n * '07 - julio',\n * '08 - agosto',\n * '09 - septiembre',\n * '10 - octubre',\n * '11 - noviembre',\n * '12 - diciembre'\n * ]);\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.setMonthOptions = function (options) {\n var self = this;\n var merchantOptions = this._merchantConfigurationOptions.fields;\n var errorMessage;\n\n if (!merchantOptions.expirationMonth) {\n errorMessage = \"Expiration month field must exist to use setMonthOptions.\";\n } else if (!merchantOptions.expirationMonth.select) {\n errorMessage = \"Expiration month field must be a select element.\";\n }\n\n if (errorMessage) {\n return Promise.reject(\n new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_PROPERTY_INVALID.code,\n message: errorMessage,\n })\n );\n }\n\n return new Promise(function (resolve) {\n self._bus.emit(events.SET_MONTH_OPTIONS, options, resolve);\n });\n};\n\n/**\n * Sets a visually hidden message (for screen readers) on a {@link module:braintree-web/hosted-fields~field field}.\n *\n * @public\n * @param {object} options The options for the attribute you wish to set.\n * @param {string} options.field The field to which you wish to add an attribute. Must be a valid {@link module:braintree-web/hosted-fields~field field}.\n * @param {string} options.message The message to set.\n *\n * @example <caption>Set an error message on a field</caption>\n * hostedFieldsInstance.setMessage({\n * field: 'number',\n * message: 'Invalid card number'\n * });\n *\n * @example <caption>Remove the message on a field</caption>\n * hostedFieldsInstance.setMessage({\n * field: 'number',\n * message: ''\n * });\n *\n * @returns {void}\n */\nHostedFields.prototype.setMessage = function (options) {\n this._bus.emit(events.SET_MESSAGE, {\n field: options.field,\n message: options.message,\n });\n};\n\n/**\n * Removes a supported attribute from a {@link module:braintree-web/hosted-fields~field field}.\n *\n * @public\n * @param {object} options The options for the attribute you wish to remove.\n * @param {string} options.field The field from which you wish to remove an attribute. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.\n * @param {string} options.attribute The name of the attribute you wish to remove from the field.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the attribute is removed successfully.\n *\n * @example <caption>Remove the placeholder attribute of a field</caption>\n * hostedFieldsInstance.removeAttribute({\n * field: 'number',\n * attribute: 'placeholder'\n * }, function (attributeErr) {\n * if (attributeErr) {\n * console.error(attributeErr);\n * }\n * });\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.removeAttribute = function (options) {\n var attributeErr, err;\n\n if (!allowedFields.hasOwnProperty(options.field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_INVALID.code,\n message:\n '\"' +\n options.field +\n '\" is not a valid field. You must use a valid field option when removing an attribute.',\n });\n } else if (!this._fields.hasOwnProperty(options.field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,\n code: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,\n message:\n 'Cannot remove attribute for \"' +\n options.field +\n '\" field because it is not part of the current Hosted Fields options.',\n });\n } else {\n attributeErr = attributeValidationError(options.attribute);\n\n if (attributeErr) {\n err = attributeErr;\n } else {\n this._bus.emit(events.REMOVE_ATTRIBUTE, {\n field: options.field,\n attribute: options.attribute,\n });\n }\n }\n\n if (err) {\n return Promise.reject(err);\n }\n\n return Promise.resolve();\n};\n\n/**\n * @deprecated since version 3.8.0. Use {@link HostedFields#setAttribute|setAttribute} instead.\n *\n * @public\n * @param {string} field The field whose placeholder you wish to change. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.\n * @param {string} placeholder Will be used as the `placeholder` attribute of the input.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the placeholder updated successfully.\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nHostedFields.prototype.setPlaceholder = function (field, placeholder) {\n return this.setAttribute({\n field: field,\n attribute: \"placeholder\",\n value: placeholder,\n });\n};\n\n/**\n * Clear the value of a {@link module:braintree-web/hosted-fields~field field}.\n * @public\n * @param {string} field The field you wish to clear. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the field cleared successfully.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * hostedFieldsInstance.clear('number', function (clearErr) {\n * if (clearErr) {\n * console.error(clearErr);\n * }\n * });\n *\n * @example <caption>Clear several fields</caption>\n * hostedFieldsInstance.clear('number');\n * hostedFieldsInstance.clear('cvv');\n * hostedFieldsInstance.clear('expirationDate');\n */\nHostedFields.prototype.clear = function (field) {\n var err;\n\n if (!allowedFields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_INVALID.code,\n message:\n '\"' +\n field +\n '\" is not a valid field. You must use a valid field option when clearing a field.',\n });\n } else if (!this._fields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,\n code: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,\n message:\n 'Cannot clear \"' +\n field +\n '\" field because it is not part of the current Hosted Fields options.',\n });\n } else {\n this._bus.emit(events.CLEAR_FIELD, {\n field: field,\n });\n }\n\n if (err) {\n return Promise.reject(err);\n }\n\n return Promise.resolve();\n};\n\n/**\n * Programmatically focus a {@link module:braintree-web/hosted-fields~field field}.\n * @public\n * @param {string} field The field you want to focus. Must be a valid {@link module:braintree-web/hosted-fields~fieldOptions fieldOption}.\n * @param {callback} [callback] Callback executed on completion, containing an error if one occurred. No data is returned if the field focused successfully.\n * @returns {void}\n * @example\n * hostedFieldsInstance.focus('number', function (focusErr) {\n * if (focusErr) {\n * console.error(focusErr);\n * }\n * });\n * @example <caption>Using an event listener</caption>\n * myElement.addEventListener('click', function (e) {\n * // In Firefox, the focus method can be suppressed\n * // if the element has a tabindex property or the element\n * // is an anchor link with an href property.\n * e.preventDefault();\n * hostedFieldsInstance.focus('number');\n * });\n */\nHostedFields.prototype.focus = function (field) {\n var err;\n var fieldConfig = this._fields[field];\n\n if (!allowedFields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_INVALID.type,\n code: errors.HOSTED_FIELDS_FIELD_INVALID.code,\n message:\n '\"' +\n field +\n '\" is not a valid field. You must use a valid field option when focusing a field.',\n });\n } else if (!this._fields.hasOwnProperty(field)) {\n err = new BraintreeError({\n type: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.type,\n code: errors.HOSTED_FIELDS_FIELD_NOT_PRESENT.code,\n message:\n 'Cannot focus \"' +\n field +\n '\" field because it is not part of the current Hosted Fields options.',\n });\n } else {\n fieldConfig.frameElement.focus();\n\n this._bus.emit(events.TRIGGER_INPUT_FOCUS, {\n field: field,\n });\n\n if (browserDetection.isIos()) {\n // Inputs outside of the viewport don't always scroll into view on\n // focus in iOS Safari. 5ms timeout gives the browser a chance to\n // do the right thing and prevents stuttering.\n setTimeout(function () {\n if (!isVisibleEnough(fieldConfig.containerElement)) {\n fieldConfig.containerElement.scrollIntoView();\n }\n }, SAFARI_FOCUS_TIMEOUT);\n }\n }\n\n if (err) {\n return Promise.reject(err);\n }\n\n return Promise.resolve();\n};\n\n/**\n * Returns an {@link HostedFields~stateObject|object} that includes the state of all fields and possible card types.\n * @public\n * @returns {object} {@link HostedFields~stateObject|stateObject}\n * @example <caption>Check if all fields are valid</caption>\n * var state = hostedFieldsInstance.getState();\n *\n * var formValid = Object.keys(state.fields).every(function (key) {\n * return state.fields[key].isValid;\n * });\n */\nHostedFields.prototype.getState = function () {\n return this._state;\n};\n\n// React adds decorations to DOM nodes that cause\n// circular dependencies, so we remove them from the\n// config before sending it to the iframes. However,\n// we don't want to mutate the original object that\n// was passed in, so we create fresh objects via assign\nfunction formatMerchantConfigurationForIframes(config) {\n var formattedConfig = assign({}, config);\n\n formattedConfig.fields = assign({}, formattedConfig.fields);\n Object.keys(formattedConfig.fields).forEach(function (field) {\n formattedConfig.fields[field] = assign({}, formattedConfig.fields[field]);\n delete formattedConfig.fields[field].container;\n });\n\n return formattedConfig;\n}\n\nmodule.exports = wrapPromise.wrapPrototype(HostedFields);\n\n},{\"../../lib/analytics\":119,\"../../lib/assign\":121,\"../../lib/braintree-error\":124,\"../../lib/constants\":126,\"../../lib/convert-methods-to-error\":127,\"../../lib/create-assets-url\":129,\"../../lib/create-deferred-client\":131,\"../../lib/destructor\":133,\"../../lib/errors\":135,\"../../lib/find-root-node\":136,\"../../lib/is-verified-domain\":153,\"../../lib/methods\":155,\"../../lib/shadow\":158,\"../shared/browser-detection\":111,\"../shared/constants\":112,\"../shared/errors\":113,\"../shared/find-parent-tags\":114,\"../shared/focus-intercept\":115,\"../shared/get-card-types\":116,\"./attribute-validation-error\":104,\"./compose-url\":105,\"./focus-change\":106,\"./get-styles-from-class\":107,\"./inject-frame\":109,\"@braintree/event-emitter\":33,\"@braintree/iframer\":35,\"@braintree/uuid\":39,\"@braintree/wrap-promise\":43,\"framebus\":52}],109:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar focusIntercept = _dereq_(\"../shared/focus-intercept\");\nvar directions = _dereq_(\"../shared/constants\").navigationDirections;\n\nmodule.exports = function injectFrame(id, frame, container, focusHandler) {\n var frameType = frame.getAttribute(\"type\");\n var clearboth = document.createElement(\"div\");\n var fragment = document.createDocumentFragment();\n var focusInterceptBefore = focusIntercept.generate(\n id,\n frameType,\n directions.BACK,\n focusHandler\n );\n var focusInterceptAfter = focusIntercept.generate(\n id,\n frameType,\n directions.FORWARD,\n focusHandler\n );\n\n clearboth.style.clear = \"both\";\n\n fragment.appendChild(focusInterceptBefore);\n fragment.appendChild(frame);\n fragment.appendChild(focusInterceptAfter);\n fragment.appendChild(clearboth);\n\n container.appendChild(fragment);\n\n return [frame, clearboth];\n};\n\n},{\"../shared/constants\":112,\"../shared/focus-intercept\":115}],110:[function(_dereq_,module,exports){\n\"use strict\";\n/** @module braintree-web/hosted-fields */\n\nvar HostedFields = _dereq_(\"./external/hosted-fields\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar errors = _dereq_(\"./shared/errors\");\nvar supportsInputFormatting = _dereq_(\"restricted-input/supports-input-formatting\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar VERSION = \"3.100.0\";\n\n/**\n * Fields used in {@link module:braintree-web/hosted-fields~fieldOptions fields options}\n * @typedef {object} field\n * @property {string} selector Deprecated: Now an alias for `options.container`.\n * @property {(string|HTMLElement)} container A DOM node or CSS selector to find the container where the hosted field will be inserted.\n * @property {string} [placeholder] Will be used as the `placeholder` attribute of the input. If `placeholder` is not natively supported by the browser, it will be polyfilled.\n * @property {string} [type] Will be used as the `type` attribute of the input. To mask `cvv` input, for instance, `type: \"password\"` can be used.\n * @property {string} [iframeTitle] The title used for the iframe containing the credit card input. By default, this will be `Secure Credit Card Frame - <the name of the specific field>`.\n * @property {string} [internalLabel] Each Hosted Field iframe has a hidden label that is used by screen readers to identify the input. The `internalLabel` property can be used to customize the field for localization purposes. The default values are:\n * * number: Credit Card Number\n * * cvv: CVV\n * * expirationDate: Expiration Date\n * * expirationMonth: Expiration Month\n * * expirationYear: Expiration Year\n * * postalCode: Postal Code\n * * cardholderName: Cardholder Name\n * @property {boolean} [formatInput=true] Enable or disable automatic formatting on this field.\n * @property {(object|boolean)} [maskInput=false] Enable or disable input masking when input is not focused. If set to `true` instead of an object, the defaults for the `maskInput` parameters will be used.\n * @property {string} [maskInput.character=•] The character to use when masking the input. The default character ('•') uses a unicode symbol, so the webpage must support UTF-8 characters when using the default.\n * @property {Boolean} [maskInput.showLastFour=false] Only applicable for the credit card field. Whether or not to show the last 4 digits of the card when masking.\n * @property {(object|boolean)} [select] If truthy, this field becomes a `<select>` dropdown list. This can only be used for `expirationMonth` and `expirationYear` fields. If you do not use a `placeholder` property for the field, the current month/year will be the default selected value.\n * @property {string[]} [select.options] An array of 12 strings, one per month. This can only be used for the `expirationMonth` field. For example, the array can look like `['01 - January', '02 - February', ...]`.\n * @property {number} [maxCardLength] This option applies only to the number field. Allows a limit to the length of the card number, even if the card brand may support numbers of a greater length. If the value passed is greater than the max length for a card brand, the smaller number of the 2 values will be used. For example, is `maxCardLength` is set to 16, but an American Express card is entered (which has a max card length of 15), a max card length of 15 will be used.\n * @property {number} [maxlength] This option applies only to the CVV and postal code fields. Will be used as the `maxlength` attribute of the input. The primary use cases for the `maxlength` option are: limiting the length of the CVV input for CVV-only verifications when the card type is known and setting the length of the postal code input when cards are coming from a known region. The default `maxlength` for the postal code input is `10`.\n * @property {number} [minlength=3] This option applies only to the cvv and postal code fields. Will be used as the `minlength` attribute of the input.\n * For postal code fields, the default value is 3, representing the Icelandic postal code length. This option's primary use case is to increase the `minlength`, e.g. for US customers, the postal code `minlength` can be set to 5.\n * For cvv fields, the default value is 3. The `minlength` attribute only applies to integrations capturing a cvv without a number field.\n * @property {string} [prefill] A value to prefill the field with. For example, when creating an update card form, you can prefill the expiration date fields with the old expiration date data.\n * @property {boolean} [rejectUnsupportedCards=false] Deprecated since version 3.46.0, use `supportedCardBrands` instead. Only allow card types that your merchant account is able to process. Unsupported card types will invalidate the card form. e.g. if you only process Visa cards, a customer entering a American Express card would get an invalid card field. This can only be used for the `number` field.\n * @property {object} [supportedCardBrands] Override card brands that are supported by the card form. Pass `'card-brand-id': true` to override the default in the merchant configuration and enable a card brand. Pass `'card-brand-id': false` to disable a card brand. Unsupported card types will invalidate the card form. e.g. if you only process Visa cards, a customer entering an American Express card would get an invalid card field. This can only be used for the `number` field. (Note: only allow card types that your merchant account is actually able to process.)\n *\n * Valid card brand ids are:\n * * visa\n * * mastercard\n * * american-express\n * * diners-club\n * * discover\n * * jcb\n * * union-pay\n * * maestro\n * * elo\n * * mir\n * * hiper\n * * hipercard\n */\n\n/**\n * An object that has {@link module:braintree-web/hosted-fields~field field objects} for each field. Used in {@link module:braintree-web/hosted-fields~create create}.\n * @typedef {object} fieldOptions\n * @property {field} [number] A field for card number.\n * @property {field} [expirationDate] A field for expiration date in `MM/YYYY` or `MM/YY` format. This should not be used with the `expirationMonth` and `expirationYear` properties.\n * @property {field} [expirationMonth] A field for expiration month in `MM` format. This should be used with the `expirationYear` property.\n * @property {field} [expirationYear] A field for expiration year in `YYYY` or `YY` format. This should be used with the `expirationMonth` property.\n * @property {field} [cvv] A field for 3 or 4 digit card verification code (like CVV or CID). If you wish to create a CVV-only payment method nonce to verify a card already stored in your Vault, omit all other fields to only collect CVV.\n * @property {field} [postalCode] A field for postal or region code.\n * @property {field} [cardholderName] A field for the cardholder name on the customer's credit card.\n */\n\n/**\n * An object that represents CSS that will be applied in each hosted field. This object looks similar to CSS. Typically, these styles involve fonts (such as `font-family` or `color`).\n *\n * You may also pass the name of a class on your site that contains the styles you would like to apply. The style properties will be automatically pulled off the class and applied to the Hosted Fields inputs. Note: this is recommended for `input` elements only. If using a `select` for the expiration date, unexpected styling may occur.\n *\n * These are the CSS properties that Hosted Fields supports. Any other CSS should be specified on your page and outside of any Braintree configuration. Trying to set unsupported properties will fail and put a warning in the console.\n *\n * Supported CSS properties are:\n * `appearance`\n * `box-shadow`\n * `color`\n * `direction`\n * `font-family`\n * `font-size-adjust`\n * `font-size`\n * `font-stretch`\n * `font-style`\n * `font-variant-alternates`\n * `font-variant-caps`\n * `font-variant-east-asian`\n * `font-variant-ligatures`\n * `font-variant-numeric`\n * `font-variant`\n * `font-weight`\n * `font`\n * `letter-spacing`\n * `line-height`\n * `opacity`\n * `outline`\n * `margin`\n * `margin-top`\n * `margin-right`\n * `margin-bottom`\n * `margin-left`\n * `padding`\n * `padding-top`\n * `padding-right`\n * `padding-bottom`\n * `padding-left`\n * `text-align`\n * `text-shadow`\n * `transition`\n * `-moz-appearance`\n * `-moz-box-shadow`\n * `-moz-osx-font-smoothing`\n * `-moz-tap-highlight-color`\n * `-moz-transition`\n * `-webkit-appearance`\n * `-webkit-box-shadow`\n * `-webkit-font-smoothing`\n * `-webkit-tap-highlight-color`\n * `-webkit-transition`\n * @typedef {object} styleOptions\n */\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {fieldOptions} options.fields A {@link module:braintree-web/hosted-fields~fieldOptions set of options for each field}.\n * @param {styleOptions} [options.styles] {@link module:braintree-web/hosted-fields~styleOptions Styles} applied to each field.\n * @param {boolean} [options.preventAutofill=false] When true, browsers will not try to prompt the customer to autofill their credit card information.\n * @param {callback} [callback] The second argument, `data`, is the {@link HostedFields} instance. If no callback is provided, `create` returns a promise that resolves with the {@link HostedFields} instance.\n * @returns {void}\n * @example\n * braintree.hostedFields.create({\n * client: clientInstance,\n * styles: {\n * 'input': {\n * 'font-size': '16pt',\n * 'color': '#3A3A3A'\n * },\n * '.number': {\n * 'font-family': 'monospace'\n * },\n * '.valid': {\n * 'color': 'green'\n * }\n * },\n * fields: {\n * number: {\n * container: '#card-number'\n * },\n * cvv: {\n * container: '#cvv',\n * placeholder: '•••'\n * },\n * expirationDate: {\n * container: '#expiration-date'\n * }\n * }\n * }, callback);\n * @example <caption>With cardholder name</caption>\n * braintree.hostedFields.create({\n * client: clientInstance,\n * fields: {\n * number: {\n * container: '#card-number'\n * },\n * cardholderName: {\n * container: '#cardholder-name'\n * },\n * cvv: {\n * container: '#cvv',\n * },\n * expirationDate: {\n * container: '#expiration-date'\n * }\n * }\n * }, callback);\n * @example <caption>Applying styles with a class name</caption>\n * // in document head\n * <style>\n * .braintree-input-class {\n * color: black;\n * }\n * .braintree-valid-class {\n * color: green;\n * }\n * .braintree-invalid-class {\n * color: red;\n * }\n * </style>\n * // in a script tag\n * braintree.hostedFields.create({\n * client: clientInstance,\n * styles: {\n * 'input': 'braintree-input-class',\n * '.invalid': 'braintree-invalid-class',\n * '.valid': {\n * // you can also use the object syntax alongside\n * // the class name syntax\n * color: green;\n * }\n * },\n * fields: {\n * number: {\n * container: '#card-number'\n * },\n * // etc...\n * }\n * }, callback);\n * @example <caption>Right to Left Language Support</caption>\n * braintree.hostedFields.create({\n * client: clientInstance,\n * styles: {\n * 'input': {\n * // other styles\n * direction: 'rtl'\n * },\n * },\n * fields: {\n * number: {\n * container: '#card-number',\n * // Credit card formatting is not currently supported\n * // with RTL languages, so we need to turn it off for the number input\n * formatInput: false\n * },\n * cvv: {\n * container: '#cvv',\n * placeholder: '•••'\n * },\n * expirationDate: {\n * container: '#expiration-date',\n * type: 'month'\n * }\n * }\n * }, callback);\n * @example <caption>Setting up Hosted Fields to tokenize CVV only</caption>\n * braintree.hostedFields.create({\n * client: clientInstance,\n * fields: {\n * // Only add the `cvv` option.\n * cvv: {\n * container: '#cvv',\n * placeholder: '•••'\n * }\n * }\n * }, callback);\n * @example <caption>Creating an expiration date update form with prefilled data</caption>\n * var storedCreditCardInformation = {\n * // get this info from your server\n * // with a payment method lookup\n * month: '09',\n * year: '2017'\n * };\n *\n * braintree.hostedFields.create({\n * client: clientInstance,\n * fields: {\n * expirationMonth: {\n * container: '#expiration-month',\n * prefill: storedCreditCardInformation.month\n * },\n * expirationYear: {\n * container: '#expiration-year',\n * prefill: storedCreditCardInformation.year\n * }\n * }\n * }, callback);\n * @example <caption>Validate the card form for supported card types</caption>\n * braintree.hostedFields.create({\n * client: clientInstance,\n * fields: {\n * number: {\n * container: '#card-number',\n * supportedCardBrands: {\n * visa: false, // prevents Visas from showing up as valid even when the Braintree control panel is configured to allow them\n * 'diners-club': true // allow Diners Club cards to be valid (processed as Discover cards on the Braintree backend)\n * }\n * },\n * cvv: {\n * container: '#cvv',\n * placeholder: '•••'\n * },\n * expirationDate: {\n * container: '#expiration-date',\n * type: 'month'\n * }\n * },\n * }, callback);\n */\nfunction create(options) {\n return basicComponentVerification\n .verify({\n name: \"Hosted Fields\",\n authorization: options.authorization,\n client: options.client,\n })\n .then(function () {\n var integration = new HostedFields(options);\n\n return new Promise(function (resolve, reject) {\n integration.on(\"ready\", function () {\n resolve(integration);\n });\n integration.on(\"timeout\", function () {\n reject(new BraintreeError(errors.HOSTED_FIELDS_TIMEOUT));\n });\n });\n });\n}\n\nmodule.exports = {\n /**\n * @static\n * @function supportsInputFormatting\n * @description Returns false if input formatting will be automatically disabled due to browser incompatibility. Otherwise, returns true. For a list of unsupported browsers, [go here](https://github.com/braintree/restricted-input/blob/main/README.md#browsers-where-formatting-is-turned-off-automatically).\n * @returns {Boolean} Returns false if input formatting will be automatically disabled due to browser incompatibility. Otherwise, returns true.\n * @example\n * <caption>Conditionally choosing split expiration date inputs if formatting is unavailable</caption>\n * var canFormat = braintree.hostedFields.supportsInputFormatting();\n * var fields = {\n * number: {\n * container: '#card-number'\n * },\n * cvv: {\n * container: '#cvv'\n * }\n * };\n *\n * if (canFormat) {\n * fields.expirationDate = {\n * selection: '#expiration-date'\n * };\n * functionToCreateAndInsertExpirationDateDivToForm();\n * } else {\n * fields.expirationMonth = {\n * selection: '#expiration-month'\n * };\n * fields.expirationYear = {\n * selection: '#expiration-year'\n * };\n * functionToCreateAndInsertExpirationMonthAndYearDivsToForm();\n * }\n *\n * braintree.hostedFields.create({\n * client: clientInstance,\n * styles: {\n * // Styles\n * },\n * fields: fields\n * }, callback);\n */\n supportsInputFormatting: supportsInputFormatting,\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"./external/hosted-fields\":108,\"./shared/errors\":113,\"@braintree/wrap-promise\":43,\"restricted-input/supports-input-formatting\":71}],111:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar isAndroid = _dereq_(\"@braintree/browser-detection/is-android\");\nvar isChromeOS = _dereq_(\"@braintree/browser-detection/is-chrome-os\");\nvar isIos = _dereq_(\"@braintree/browser-detection/is-ios\");\nvar isChrome = _dereq_(\"@braintree/browser-detection/is-chrome\");\n\nfunction hasSoftwareKeyboard() {\n return isAndroid() || isChromeOS() || isIos();\n}\n\nfunction isChromeIos() {\n return isChrome() && isIos();\n}\n\nmodule.exports = {\n isAndroid: isAndroid,\n isChromeOS: isChromeOS,\n isChromeIos: isChromeIos,\n isFirefox: _dereq_(\"@braintree/browser-detection/is-firefox\"),\n isIos: isIos,\n isIosWebview: _dereq_(\"@braintree/browser-detection/is-ios-webview\"),\n hasSoftwareKeyboard: hasSoftwareKeyboard,\n};\n\n},{\"@braintree/browser-detection/is-android\":22,\"@braintree/browser-detection/is-chrome\":24,\"@braintree/browser-detection/is-chrome-os\":23,\"@braintree/browser-detection/is-firefox\":25,\"@braintree/browser-detection/is-ios\":30,\"@braintree/browser-detection/is-ios-webview\":28}],112:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar enumerate = _dereq_(\"../../lib/enumerate\");\nvar errors = _dereq_(\"./errors\");\nvar VERSION = \"3.100.0\";\n\nvar constants = {\n VERSION: VERSION,\n maxExpirationYearAge: 19,\n externalEvents: {\n FOCUS: \"focus\",\n BLUR: \"blur\",\n EMPTY: \"empty\",\n NOT_EMPTY: \"notEmpty\",\n VALIDITY_CHANGE: \"validityChange\",\n CARD_TYPE_CHANGE: \"cardTypeChange\",\n },\n defaultMaxLengths: {\n number: 19,\n postalCode: 8,\n expirationDate: 7,\n expirationMonth: 2,\n expirationYear: 4,\n cvv: 3,\n },\n externalClasses: {\n FOCUSED: \"braintree-hosted-fields-focused\",\n INVALID: \"braintree-hosted-fields-invalid\",\n VALID: \"braintree-hosted-fields-valid\",\n },\n navigationDirections: {\n BACK: \"before\",\n FORWARD: \"after\",\n },\n defaultIFrameStyle: {\n border: \"none\",\n width: \"100%\",\n height: \"100%\",\n float: \"left\",\n },\n tokenizationErrorCodes: {\n 81724: errors.HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE,\n // NEXT_MAJOR_VERSION this error triggers for both AVS and CVV errors\n // but the code name implies that it would only trigger for CVV verification\n // failures\n 81736: errors.HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED,\n },\n allowedStyles: [\n \"-moz-appearance\",\n \"-moz-box-shadow\",\n \"-moz-osx-font-smoothing\",\n \"-moz-tap-highlight-color\",\n \"-moz-transition\",\n \"-webkit-appearance\",\n \"-webkit-box-shadow\",\n \"-webkit-font-smoothing\",\n \"-webkit-tap-highlight-color\",\n \"-webkit-transition\",\n \"appearance\",\n \"box-shadow\",\n \"color\",\n \"direction\",\n \"font\",\n \"font-family\",\n \"font-size\",\n \"font-size-adjust\",\n \"font-stretch\",\n \"font-style\",\n \"font-variant\",\n \"font-variant-alternates\",\n \"font-variant-caps\",\n \"font-variant-east-asian\",\n \"font-variant-ligatures\",\n \"font-variant-numeric\",\n \"font-weight\",\n \"letter-spacing\",\n \"line-height\",\n \"margin\",\n \"margin-top\",\n \"margin-right\",\n \"margin-bottom\",\n \"margin-left\",\n \"opacity\",\n \"outline\",\n \"padding\",\n \"padding-top\",\n \"padding-right\",\n \"padding-bottom\",\n \"padding-left\",\n \"text-align\",\n \"text-shadow\",\n \"transition\",\n ],\n allowedFields: {\n cardholderName: {\n name: \"cardholder-name\",\n label: \"Cardholder Name\",\n },\n number: {\n name: \"credit-card-number\",\n label: \"Credit Card Number\",\n },\n cvv: {\n name: \"cvv\",\n label: \"CVV\",\n },\n expirationDate: {\n name: \"expiration\",\n label: \"Expiration Date\",\n },\n expirationMonth: {\n name: \"expiration-month\",\n label: \"Expiration Month\",\n },\n expirationYear: {\n name: \"expiration-year\",\n label: \"Expiration Year\",\n },\n postalCode: {\n name: \"postal-code\",\n label: \"Postal Code\",\n },\n },\n allowedAttributes: {\n \"aria-invalid\": \"boolean\",\n \"aria-required\": \"boolean\",\n disabled: \"boolean\",\n placeholder: \"string\",\n },\n autocompleteMappings: {\n \"cardholder-name\": \"cc-name\",\n \"credit-card-number\": \"cc-number\",\n expiration: \"cc-exp\",\n \"expiration-month\": \"cc-exp-month\",\n \"expiration-year\": \"cc-exp-year\",\n cvv: \"cc-csc\",\n \"postal-code\": \"billing postal-code\",\n },\n};\n\nconstants.events = enumerate(\n [\n \"ADD_CLASS\",\n \"AUTOFILL_DATA_AVAILABLE\",\n \"BIN_AVAILABLE\",\n \"CARD_FORM_ENTRY_HAS_BEGUN\",\n \"CLEAR_FIELD\",\n \"CONFIGURATION\",\n \"FRAME_READY\",\n \"INPUT_EVENT\",\n \"READY_FOR_CLIENT\",\n \"REMOVE_ATTRIBUTE\",\n \"REMOVE_CLASS\",\n \"REMOVE_FOCUS_INTERCEPTS\",\n \"SET_ATTRIBUTE\",\n \"SET_MESSAGE\",\n \"SET_MONTH_OPTIONS\",\n \"TOKENIZATION_REQUEST\",\n \"TRIGGER_FOCUS_CHANGE\",\n \"TRIGGER_INPUT_FOCUS\",\n \"VALIDATE_STRICT\",\n ],\n \"hosted-fields:\"\n);\n\nmodule.exports = constants;\n\n},{\"../../lib/enumerate\":134,\"./errors\":113}],113:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Hosted Fields - Creation Error Codes\n * @description Errors that occur when [creating the Hosted Fields component](./module-braintree-web_hosted-fields.html#.create).\n * @property {UNKNOWN} HOSTED_FIELDS_TIMEOUT Occurs when Hosted Fields does not finish setting up within 60 seconds.\n * @property {MERCHANT} HOSTED_FIELDS_INVALID_FIELD_KEY Occurs when Hosted Fields is instantiated with an invalid Field option.\n * @property {MERCHANT} HOSTED_FIELDS_INVALID_FIELD_SELECTOR Occurs when Hosted Fields given a field selector that is not valid.\n * @property {MERCHANT} HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME Occurs when Hosted Fields given a field selector that already contains an iframe.\n * @property {MERCHANT} HOSTED_FIELDS_FIELD_PROPERTY_INVALID Occurs when a field configuration option is not valid.\n */\n\n/**\n * @name BraintreeError.Hosted Fields - Field Manipulation Error Codes\n * @description Errors that occur when modifying fields through [`addClass`](./HostedFields.html#addClass), [`removeClass`](./HostedFields.html#removeClass), [`setAttribute`](./HostedFields.html#setAttribute), [`removeAttribute`](./HostedFields.html#removeAttribute), [`clear`](./HostedFields.html#clear), [`focus`](./HostedFields.html#focus), and [`setMonthOptions`](./HostedFields.html#setMonthOptions).\n * @property {MERCHANT} HOSTED_FIELDS_FIELD_INVALID Occurs when attempting to modify a field that is not a valid Hosted Fields option.\n * @property {MERCHANT} HOSTED_FIELDS_FIELD_NOT_PRESENT Occurs when attempting to modify a field that is not configured with Hosted Fields.\n * @property {MERCHANT} HOSTED_FIELDS_FIELD_PROPERTY_INVALID Occurs when a field configuration option is not valid.\n */\n\n/**\n * @name BraintreeError.Hosted Fields - Set Attribute Error Codes\n * @description Errors that occur when using the [`setAttribute` method](./HostedFields.html#setAttribute)\n * @property {MERCHANT} HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED Occurs when trying to set an attribute that is not supported to be set.\n * @property {MERCHANT} HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED Occurs when the type of value for an attribute is not allowed to be set.\n */\n\n/**\n * @name BraintreeError.Hosted Fields - Tokenize Error Codes\n * @description Errors that occur when [tokenizing the card details with Hosted Fields](./HostedFields.html#tokenize).\n * @property {NETWORK} HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR Occurs when the Braintree gateway cannot be contacted.\n * @property {CUSTOMER} HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE Occurs when attempting to vault a card, but the client token being used is configured to fail if the card already exists in the vault.\n * @property {CUSTOMER} HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED Occurs when cvv verification is turned on in the Braintree control panel.\n * @property {CUSTOMER} HOSTED_FIELDS_FAILED_TOKENIZATION Occurs when the credit card details were sent to Braintree, but failed to tokenize.\n * @property {CUSTOMER} HOSTED_FIELDS_FIELDS_EMPTY Occurs when all the Hosted Fields inputs are empty.\n * @property {CUSTOMER} HOSTED_FIELDS_FIELDS_INVALID Occurs when one ore more fields are invalid.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n HOSTED_FIELDS_TIMEOUT: {\n type: BraintreeError.types.UNKNOWN,\n code: \"HOSTED_FIELDS_TIMEOUT\",\n message: \"Hosted Fields timed out when attempting to set up.\",\n },\n HOSTED_FIELDS_INVALID_FIELD_KEY: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_INVALID_FIELD_KEY\",\n },\n HOSTED_FIELDS_INVALID_FIELD_SELECTOR: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_INVALID_FIELD_SELECTOR\",\n message: \"Selector does not reference a valid DOM node.\",\n },\n HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME\",\n message: \"Element already contains a Braintree iframe.\",\n },\n HOSTED_FIELDS_FIELD_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_FIELD_INVALID\",\n },\n HOSTED_FIELDS_FIELD_NOT_PRESENT: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_FIELD_NOT_PRESENT\",\n },\n HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR\",\n message: \"A tokenization network error occurred.\",\n },\n HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE: {\n type: BraintreeError.types.CUSTOMER,\n code: \"HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE\",\n message: \"This credit card already exists in the merchant's vault.\",\n },\n HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED\",\n message: \"CVV verification failed during tokenization.\",\n },\n HOSTED_FIELDS_FAILED_TOKENIZATION: {\n type: BraintreeError.types.CUSTOMER,\n code: \"HOSTED_FIELDS_FAILED_TOKENIZATION\",\n message: \"The supplied card data failed tokenization.\",\n },\n HOSTED_FIELDS_FIELDS_EMPTY: {\n type: BraintreeError.types.CUSTOMER,\n code: \"HOSTED_FIELDS_FIELDS_EMPTY\",\n message: \"All fields are empty. Cannot tokenize empty card fields.\",\n },\n HOSTED_FIELDS_FIELDS_INVALID: {\n type: BraintreeError.types.CUSTOMER,\n code: \"HOSTED_FIELDS_FIELDS_INVALID\",\n message:\n \"Some payment input fields are invalid. Cannot tokenize invalid card fields.\",\n },\n HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED\",\n },\n HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED\",\n },\n HOSTED_FIELDS_FIELD_PROPERTY_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"HOSTED_FIELDS_FIELD_PROPERTY_INVALID\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],114:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction findParentTags(element, tag) {\n var parent = element.parentNode;\n var parents = [];\n\n while (parent != null) {\n if (parent.tagName != null && parent.tagName.toLowerCase() === tag) {\n parents.push(parent);\n }\n\n parent = parent.parentNode;\n }\n\n return parents;\n}\n\nmodule.exports = findParentTags;\n\n},{}],115:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar browserDetection = _dereq_(\"./browser-detection\");\nvar constants = _dereq_(\"./constants\");\nvar allowedFields = Object.keys(constants.allowedFields);\nvar directions = constants.navigationDirections;\n\nvar focusIntercept = {\n generate: function (hostedFieldsId, type, direction, handler) {\n var input = document.createElement(\"input\");\n var focusInterceptStyles = {\n border: \"none !important\",\n display: \"block !important\",\n height: \"1px !important\",\n left: \"-1px !important\",\n opacity: \"0 !important\",\n position: \"absolute !important\",\n top: \"-1px !important\",\n width: \"1px !important\",\n };\n var shouldCreateFocusIntercept =\n browserDetection.hasSoftwareKeyboard() || browserDetection.isFirefox();\n\n if (!shouldCreateFocusIntercept) {\n return document.createDocumentFragment();\n }\n\n input.setAttribute(\"aria-hidden\", \"true\");\n input.setAttribute(\"autocomplete\", \"off\");\n input.setAttribute(\"data-braintree-direction\", direction);\n input.setAttribute(\"data-braintree-type\", type);\n input.setAttribute(\n \"id\",\n \"bt-\" + type + \"-\" + direction + \"-\" + hostedFieldsId\n );\n input.setAttribute(\n \"style\",\n JSON.stringify(focusInterceptStyles)\n .replace(/[{}\"]/g, \"\")\n .replace(/,/g, \";\")\n );\n\n input.classList.add(\"focus-intercept\");\n\n input.addEventListener(\"focus\", function (event) {\n handler(event);\n\n /*\n Certain browsers without software keyboards (Firefox, Internet\n Explorer) need the focus intercept inputs that get inserted\n around the actual input to blur themselves, otherwise the\n browser gets confused about what should have focus. Can't\n apply this to browsers with software keyboards however,\n because it blurs everything, and focus on the actual input is\n also lost.\n */\n if (!browserDetection.hasSoftwareKeyboard()) {\n input.blur();\n }\n });\n\n return input;\n },\n destroy: function (idString) {\n var focusInputs;\n\n if (!idString) {\n focusInputs = document.querySelectorAll(\"[data-braintree-direction]\");\n focusInputs = [].slice.call(focusInputs);\n } else {\n focusInputs = [document.getElementById(idString)];\n }\n\n focusInputs.forEach(function (node) {\n if (\n node &&\n node.nodeType === 1 &&\n focusIntercept.matchFocusElement(node.getAttribute(\"id\"))\n ) {\n node.parentNode.removeChild(node);\n }\n });\n },\n matchFocusElement: function (idString) {\n var idComponents, hasBTPrefix, isAllowedType, isValidDirection;\n\n if (!idString) {\n return false;\n }\n\n idComponents = idString.split(\"-\");\n\n if (idComponents.length < 4) {\n return false;\n }\n\n hasBTPrefix = idComponents[0] === \"bt\";\n isAllowedType = allowedFields.indexOf(idComponents[1]) > -1;\n isValidDirection =\n idComponents[2] === directions.BACK ||\n idComponents[2] === directions.FORWARD;\n\n return Boolean(hasBTPrefix && isAllowedType && isValidDirection);\n },\n};\n\nmodule.exports = focusIntercept;\n\n},{\"./browser-detection\":111,\"./constants\":112}],116:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar creditCardType = _dereq_(\"credit-card-type\");\n\nmodule.exports = function (number) {\n var results = creditCardType(number);\n\n results.forEach(function (card) {\n // NEXT_MAJOR_VERSION credit-card-type fixed the mastercard enum\n // but we still pass master-card in the braintree API\n // in a major version bump, we can remove this and\n // this will be mastercard instead of master-card\n if (card.type === \"mastercard\") {\n card.type = \"master-card\";\n }\n });\n\n return results;\n};\n\n},{\"credit-card-type\":44}],117:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web\n * @description This is the top-level module exported by the Braintree JavaScript SDK. In a browser environment, this will be the global <code>braintree</code> object. In a CommonJS environment (like Browserify or Webpack), it will be the default export of the <code>braintree-web</code> package. In AMD environments (like RequireJS), it can be `require`d like other modules.\n * @example\n * <caption>CommonJS</caption>\n * var braintree = require('braintree-web');\n *\n * braintree.client.create(...);\n * @example\n * <caption>In the browser</caption>\n * <script src=\"https://js.braintreegateway.com/web/{@pkg version}/js/client.min.js\"></script>\n * <script>\n * window.braintree.client.create(...);\n * </script>\n * @example\n * <caption>AMD</caption>\n * // main.js\n * require.config({\n * paths: {\n * braintreeClient: 'https://js.braintreegateway.com/web/{@pkg version}/js/client.min'\n * }\n * });\n *\n * require(['braintreeClient'], function (braintreeClient) {\n * braintreeClient.create(...);\n * });\n */\n\n/**\n * @global\n * @callback callback\n * @param {?BraintreeError} [err] `null` or `undefined` if there was no error.\n * @param {?any} [data] The successful result of the asynchronous function call (if data exists).\n * @description The Node.js-style callback pattern used throughout the SDK.\n * @returns {void}\n */\n\nvar americanExpress = _dereq_(\"./american-express\");\nvar applePay = _dereq_(\"./apple-pay\");\nvar client = _dereq_(\"./client\");\nvar dataCollector = _dereq_(\"./data-collector\");\nvar hostedFields = _dereq_(\"./hosted-fields\");\nvar localPayment = _dereq_(\"./local-payment\");\nvar masterpass = _dereq_(\"./masterpass\");\nvar paymentRequest = _dereq_(\"./payment-request\");\nvar paypal = _dereq_(\"./paypal\");\nvar paypalCheckout = _dereq_(\"./paypal-checkout\");\nvar googlePayment = _dereq_(\"./google-payment\");\nvar sepa = _dereq_(\"./sepa\");\nvar threeDSecure = _dereq_(\"./three-d-secure\");\nvar unionpay = _dereq_(\"./unionpay\");\nvar usBankAccount = _dereq_(\"./us-bank-account\");\nvar vaultManager = _dereq_(\"./vault-manager\");\nvar venmo = _dereq_(\"./venmo\");\nvar visaCheckout = _dereq_(\"./visa-checkout\");\nvar preferredPaymentMethods = _dereq_(\"./preferred-payment-methods\");\nvar VERSION = \"3.100.0\";\n\nmodule.exports = {\n /** @type {module:braintree-web/american-express} */\n americanExpress: americanExpress,\n /** @type {module:braintree-web/apple-pay} */\n applePay: applePay,\n /** @type {module:braintree-web/client} */\n client: client,\n /** @type {module:braintree-web/data-collector} */\n dataCollector: dataCollector,\n /** @type {module:braintree-web/hosted-fields} */\n hostedFields: hostedFields,\n /** @type {module:braintree-web/local-payment} */\n localPayment: localPayment,\n /** @type {module:braintree-web/masterpass} */\n masterpass: masterpass,\n /** @type {module:braintree-web/google-payment} */\n googlePayment: googlePayment,\n /** @type {module:braintree-web/payment-request} */\n paymentRequest: paymentRequest,\n /** @type {module:braintree-web/paypal} */\n paypal: paypal,\n /** @type {module:braintree-web/paypal-checkout} */\n paypalCheckout: paypalCheckout,\n /** @type {module:braintree-web/three-d-secure} */\n threeDSecure: threeDSecure,\n /** @type {module:braintree-web/unionpay} */\n unionpay: unionpay,\n /** @type {module:braintree-web/us-bank-account} */\n usBankAccount: usBankAccount,\n /** @type {module:braintree-web/vault-manager} */\n vaultManager: vaultManager,\n /** @type {module:braintree-web/venmo} */\n venmo: venmo,\n /** @type {module:braintree-web/visa-checkout} */\n visaCheckout: visaCheckout,\n /** @type {module:braintree-web/sepa} */\n sepa: sepa,\n /** @type {module:braintree-web/preferred-payment-methods} */\n preferredPaymentMethods: preferredPaymentMethods,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"./american-express\":74,\"./apple-pay\":77,\"./client\":82,\"./data-collector\":98,\"./google-payment\":103,\"./hosted-fields\":110,\"./local-payment\":164,\"./masterpass\":167,\"./payment-request\":172,\"./paypal\":179,\"./paypal-checkout\":176,\"./preferred-payment-methods\":182,\"./sepa\":186,\"./three-d-secure\":198,\"./unionpay\":202,\"./us-bank-account\":208,\"./vault-manager\":211,\"./venmo\":216,\"./visa-checkout\":226}],118:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar createAuthorizationData = _dereq_(\"./create-authorization-data\");\nvar jsonClone = _dereq_(\"./json-clone\");\nvar constants = _dereq_(\"./constants\");\n\nfunction addMetadata(configuration, data) {\n var key;\n var attrs = data ? jsonClone(data) : {};\n var authAttrs = createAuthorizationData(configuration.authorization).attrs;\n var _meta = jsonClone(configuration.analyticsMetadata);\n\n attrs.braintreeLibraryVersion = constants.BRAINTREE_LIBRARY_VERSION;\n\n for (key in attrs._meta) {\n if (attrs._meta.hasOwnProperty(key)) {\n _meta[key] = attrs._meta[key];\n }\n }\n\n attrs._meta = _meta;\n\n if (authAttrs.tokenizationKey) {\n attrs.tokenizationKey = authAttrs.tokenizationKey;\n } else {\n attrs.authorizationFingerprint = authAttrs.authorizationFingerprint;\n }\n\n return attrs;\n}\n\nmodule.exports = addMetadata;\n\n},{\"./constants\":126,\"./create-authorization-data\":130,\"./json-clone\":154}],119:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar constants = _dereq_(\"./constants\");\nvar addMetadata = _dereq_(\"./add-metadata\");\n\nfunction sendAnalyticsEvent(clientInstanceOrPromise, kind, callback) {\n var timestamp = Date.now(); // milliseconds\n\n return Promise.resolve(clientInstanceOrPromise)\n .then(function (client) {\n var timestampInPromise = Date.now();\n var configuration = client.getConfiguration();\n var request = client._request;\n var url = configuration.gatewayConfiguration.analytics.url;\n var data = {\n analytics: [\n {\n kind: constants.ANALYTICS_PREFIX + kind,\n isAsync:\n Math.floor(timestampInPromise / 1000) !==\n Math.floor(timestamp / 1000),\n timestamp: timestamp,\n },\n ],\n };\n\n request(\n {\n url: url,\n method: \"post\",\n data: addMetadata(configuration, data),\n timeout: constants.ANALYTICS_REQUEST_TIMEOUT_MS,\n },\n callback\n );\n })\n .catch(function (err) {\n // for all non-test cases, we don't provide a callback,\n // so this error will always be swallowed. In this case,\n // that's fine, it should only error when the deferred\n // client fails to set up, in which case we don't want\n // that error to report over and over again via these\n // deferred analytics events\n if (callback) {\n callback(err);\n }\n });\n}\n\nmodule.exports = {\n sendEvent: sendAnalyticsEvent,\n};\n\n},{\"./add-metadata\":118,\"./constants\":126}],120:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar loadScript = _dereq_(\"@braintree/asset-loader/load-script\");\n\nmodule.exports = {\n loadScript: loadScript,\n};\n\n},{\"@braintree/asset-loader/load-script\":3}],121:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar assignNormalized =\n typeof Object.assign === \"function\" ? Object.assign : assignPolyfill;\n\nfunction assignPolyfill(destination) {\n var i, source, key;\n\n for (i = 1; i < arguments.length; i++) {\n source = arguments[i];\n for (key in source) {\n if (source.hasOwnProperty(key)) {\n destination[key] = source[key];\n }\n }\n }\n\n return destination;\n}\n\nmodule.exports = {\n assign: assignNormalized,\n _assign: assignPolyfill,\n};\n\n},{}],122:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\nvar sharedErrors = _dereq_(\"./errors\");\nvar VERSION = \"3.100.0\";\n\nfunction basicComponentVerification(options) {\n var client, authorization, name;\n\n if (!options) {\n return Promise.reject(\n new BraintreeError({\n type: sharedErrors.INVALID_USE_OF_INTERNAL_FUNCTION.type,\n code: sharedErrors.INVALID_USE_OF_INTERNAL_FUNCTION.code,\n message:\n \"Options must be passed to basicComponentVerification function.\",\n })\n );\n }\n\n name = options.name;\n client = options.client;\n authorization = options.authorization;\n\n if (!client && !authorization) {\n return Promise.reject(\n new BraintreeError({\n type: sharedErrors.INSTANTIATION_OPTION_REQUIRED.type,\n code: sharedErrors.INSTANTIATION_OPTION_REQUIRED.code,\n // NEXT_MAJOR_VERSION in major version, we expose passing in authorization for all components\n // instead of passing in a client instance. Leave this a silent feature for now.\n message: \"options.client is required when instantiating \" + name + \".\",\n })\n );\n }\n\n if (!authorization && client.getVersion() !== VERSION) {\n return Promise.reject(\n new BraintreeError({\n type: sharedErrors.INCOMPATIBLE_VERSIONS.type,\n code: sharedErrors.INCOMPATIBLE_VERSIONS.code,\n message:\n \"Client (version \" +\n client.getVersion() +\n \") and \" +\n name +\n \" (version \" +\n VERSION +\n \") components must be from the same SDK version.\",\n })\n );\n }\n\n return Promise.resolve();\n}\n\nmodule.exports = {\n verify: basicComponentVerification,\n};\n\n},{\"./braintree-error\":124,\"./errors\":135}],123:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar once = _dereq_(\"./once\");\n\nfunction call(fn, callback) {\n var isSync = fn.length === 0;\n\n if (isSync) {\n fn();\n callback(null);\n } else {\n fn(callback);\n }\n}\n\nmodule.exports = function (functions, cb) {\n var i;\n var length = functions.length;\n var remaining = length;\n var callback = once(cb);\n\n if (length === 0) {\n callback(null);\n\n return;\n }\n\n function finish(err) {\n if (err) {\n callback(err);\n\n return;\n }\n\n remaining -= 1;\n if (remaining === 0) {\n callback(null);\n }\n }\n\n for (i = 0; i < length; i++) {\n call(functions[i], finish);\n }\n};\n\n},{\"./once\":156}],124:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar enumerate = _dereq_(\"./enumerate\");\n\n/**\n * @class\n * @global\n * @param {object} options Construction options\n * @classdesc This class is used to report error conditions, frequently as the first parameter to callbacks throughout the Braintree SDK.\n * @description <strong>You cannot use this constructor directly. Interact with instances of this class through {@link callback callbacks}.</strong>\n */\nfunction BraintreeError(options) {\n if (!BraintreeError.types.hasOwnProperty(options.type)) {\n throw new Error(options.type + \" is not a valid type.\");\n }\n\n if (!options.code) {\n throw new Error(\"Error code required.\");\n }\n\n if (!options.message) {\n throw new Error(\"Error message required.\");\n }\n\n this.name = \"BraintreeError\";\n\n /**\n * @type {string}\n * @description A code that corresponds to specific errors.\n */\n this.code = options.code;\n\n /**\n * @type {string}\n * @description A short description of the error.\n */\n this.message = options.message;\n\n /**\n * @type {BraintreeError.types}\n * @description The type of error.\n */\n this.type = options.type;\n\n /**\n * @type {object=}\n * @description Additional information about the error, such as an underlying network error response.\n */\n this.details = options.details;\n}\n\nBraintreeError.prototype = Object.create(Error.prototype);\nBraintreeError.prototype.constructor = BraintreeError;\n\n/**\n * Enum for {@link BraintreeError} types.\n * @name BraintreeError.types\n * @enum\n * @readonly\n * @memberof BraintreeError\n * @property {string} CUSTOMER An error caused by the customer.\n * @property {string} MERCHANT An error that is actionable by the merchant.\n * @property {string} NETWORK An error due to a network problem.\n * @property {string} INTERNAL An error caused by Braintree code.\n * @property {string} UNKNOWN An error where the origin is unknown.\n */\nBraintreeError.types = enumerate([\n \"CUSTOMER\",\n \"MERCHANT\",\n \"NETWORK\",\n \"INTERNAL\",\n \"UNKNOWN\",\n]);\n\nBraintreeError.findRootError = function (err) {\n if (\n err instanceof BraintreeError &&\n err.details &&\n err.details.originalError\n ) {\n return BraintreeError.findRootError(err.details.originalError);\n }\n\n return err;\n};\n\nmodule.exports = BraintreeError;\n\n},{\"./enumerate\":134}],125:[function(_dereq_,module,exports){\n\"use strict\";\n\n// Taken from https://github.com/sindresorhus/decamelize/blob/95980ab6fb44c40eaca7792bdf93aff7c210c805/index.js\nfunction transformKey(key) {\n return key\n .replace(/([a-z\\d])([A-Z])/g, \"$1_$2\")\n .replace(/([A-Z]+)([A-Z][a-z\\d]+)/g, \"$1_$2\")\n .toLowerCase();\n}\n\nmodule.exports = function (obj) {\n return Object.keys(obj).reduce(function (newObj, key) {\n var transformedKey = transformKey(key);\n\n newObj[transformedKey] = obj[key];\n\n return newObj;\n }, {});\n};\n\n},{}],126:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar VERSION = \"3.100.0\";\nvar PLATFORM = \"web\";\n\nvar CLIENT_API_URLS = {\n production: \"https://api.braintreegateway.com:443\",\n sandbox: \"https://api.sandbox.braintreegateway.com:443\",\n};\n\nvar ASSETS_URLS = {\n production: \"https://assets.braintreegateway.com\",\n sandbox: \"https://assets.braintreegateway.com\",\n};\n\nvar GRAPHQL_URLS = {\n production: \"https://payments.braintree-api.com/graphql\",\n sandbox: \"https://payments.sandbox.braintree-api.com/graphql\",\n};\n\n// endRemoveIf(production)\n\nmodule.exports = {\n ANALYTICS_PREFIX: PLATFORM + \".\",\n ANALYTICS_REQUEST_TIMEOUT_MS: 2000,\n ASSETS_URLS: ASSETS_URLS,\n CLIENT_API_URLS: CLIENT_API_URLS,\n FRAUDNET_SOURCE: \"BRAINTREE_SIGNIN\",\n FRAUDNET_FNCLS: \"fnparams-dede7cc5-15fd-4c75-a9f4-36c430ee3a99\",\n FRAUDNET_URL: \"https://c.paypal.com/da/r/fb.js\",\n BUS_CONFIGURATION_REQUEST_EVENT: \"BUS_CONFIGURATION_REQUEST\",\n GRAPHQL_URLS: GRAPHQL_URLS,\n INTEGRATION_TIMEOUT_MS: 60000,\n VERSION: VERSION,\n INTEGRATION: \"custom\",\n SOURCE: \"client\",\n PLATFORM: PLATFORM,\n BRAINTREE_LIBRARY_VERSION: \"braintree/\" + PLATFORM + \"/\" + VERSION,\n};\n\n},{}],127:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\nvar sharedErrors = _dereq_(\"./errors\");\n\nmodule.exports = function (instance, methodNames) {\n methodNames.forEach(function (methodName) {\n instance[methodName] = function () {\n throw new BraintreeError({\n type: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.type,\n code: sharedErrors.METHOD_CALLED_AFTER_TEARDOWN.code,\n message: methodName + \" cannot be called after teardown.\",\n });\n };\n });\n};\n\n},{\"./braintree-error\":124,\"./errors\":135}],128:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\n\nfunction convertToBraintreeError(originalErr, btErrorObject) {\n if (originalErr instanceof BraintreeError) {\n return originalErr;\n }\n\n return new BraintreeError({\n type: btErrorObject.type,\n code: btErrorObject.code,\n message: btErrorObject.message,\n details: {\n originalError: originalErr,\n },\n });\n}\n\nmodule.exports = convertToBraintreeError;\n\n},{\"./braintree-error\":124}],129:[function(_dereq_,module,exports){\n\"use strict\";\n\n// endRemoveIf(production)\nvar ASSETS_URLS = _dereq_(\"./constants\").ASSETS_URLS;\n\nfunction createAssetsUrl(authorization) {\n // endRemoveIf(production)\n\n return ASSETS_URLS.production;\n}\n/* eslint-enable */\n\nmodule.exports = {\n create: createAssetsUrl,\n};\n\n},{\"./constants\":126}],130:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar atob = _dereq_(\"../lib/vendor/polyfill\").atob;\nvar CLIENT_API_URLS = _dereq_(\"../lib/constants\").CLIENT_API_URLS;\n\nfunction _isTokenizationKey(str) {\n return /^[a-zA-Z0-9]+_[a-zA-Z0-9]+_[a-zA-Z0-9_]+$/.test(str);\n}\n\nfunction _parseTokenizationKey(tokenizationKey) {\n var tokens = tokenizationKey.split(\"_\");\n var environment = tokens[0];\n var merchantId = tokens.slice(2).join(\"_\");\n\n return {\n merchantId: merchantId,\n environment: environment,\n };\n}\n\nfunction createAuthorizationData(authorization) {\n var parsedClientToken, parsedTokenizationKey;\n var data = {\n attrs: {},\n configUrl: \"\",\n };\n\n if (_isTokenizationKey(authorization)) {\n parsedTokenizationKey = _parseTokenizationKey(authorization);\n data.environment = parsedTokenizationKey.environment;\n data.attrs.tokenizationKey = authorization;\n data.configUrl =\n CLIENT_API_URLS[parsedTokenizationKey.environment] +\n \"/merchants/\" +\n parsedTokenizationKey.merchantId +\n \"/client_api/v1/configuration\";\n } else {\n parsedClientToken = JSON.parse(atob(authorization));\n data.environment = parsedClientToken.environment;\n data.attrs.authorizationFingerprint =\n parsedClientToken.authorizationFingerprint;\n data.configUrl = parsedClientToken.configUrl;\n data.graphQL = parsedClientToken.graphQL;\n }\n\n return data;\n}\n\nmodule.exports = createAuthorizationData;\n\n},{\"../lib/constants\":126,\"../lib/vendor/polyfill\":161}],131:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\nvar assets = _dereq_(\"./assets\");\nvar sharedErrors = _dereq_(\"./errors\");\n\nvar VERSION = \"3.100.0\";\n\nfunction createDeferredClient(options) {\n var promise = Promise.resolve();\n\n if (options.client) {\n return Promise.resolve(options.client);\n }\n\n if (!(window.braintree && window.braintree.client)) {\n promise = assets\n .loadScript({\n src: options.assetsUrl + \"/web/\" + VERSION + \"/js/client.min.js\",\n })\n .catch(function (err) {\n return Promise.reject(\n new BraintreeError({\n type: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.type,\n code: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.code,\n message: sharedErrors.CLIENT_SCRIPT_FAILED_TO_LOAD.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n }\n\n return promise.then(function () {\n if (window.braintree.client.VERSION !== VERSION) {\n return Promise.reject(\n new BraintreeError({\n type: sharedErrors.INCOMPATIBLE_VERSIONS.type,\n code: sharedErrors.INCOMPATIBLE_VERSIONS.code,\n message:\n \"Client (version \" +\n window.braintree.client.VERSION +\n \") and \" +\n options.name +\n \" (version \" +\n VERSION +\n \") components must be from the same SDK version.\",\n })\n );\n }\n\n return window.braintree.client.create({\n authorization: options.authorization,\n debug: options.debug,\n });\n });\n}\n\nmodule.exports = {\n create: createDeferredClient,\n};\n\n},{\"./assets\":120,\"./braintree-error\":124,\"./errors\":135}],132:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (fn) {\n return function () {\n // IE9 doesn't support passing arguments to setTimeout so we have to emulate it.\n var args = arguments;\n\n setTimeout(function () {\n fn.apply(null, args);\n }, 1);\n };\n};\n\n},{}],133:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar batchExecuteFunctions = _dereq_(\"./batch-execute-functions\");\n\nfunction Destructor() {\n this._teardownRegistry = [];\n\n this._isTearingDown = false;\n}\n\nDestructor.prototype.registerFunctionForTeardown = function (fn) {\n if (typeof fn === \"function\") {\n this._teardownRegistry.push(fn);\n }\n};\n\nDestructor.prototype.teardown = function (callback) {\n if (this._isTearingDown) {\n callback(new Error(\"Destructor is already tearing down\"));\n\n return;\n }\n\n this._isTearingDown = true;\n\n batchExecuteFunctions(\n this._teardownRegistry,\n function (err) {\n this._teardownRegistry = [];\n this._isTearingDown = false;\n\n if (typeof callback === \"function\") {\n callback(err);\n }\n }.bind(this)\n );\n};\n\nmodule.exports = Destructor;\n\n},{\"./batch-execute-functions\":123}],134:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction enumerate(values, prefix) {\n prefix = prefix == null ? \"\" : prefix;\n\n return values.reduce(function (enumeration, value) {\n enumeration[value] = prefix + value;\n\n return enumeration;\n }, {});\n}\n\nmodule.exports = enumerate;\n\n},{}],135:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Shared Internal Error Codes\n * @ignore\n * @description These codes should never be experienced by the merchant directly.\n * @property {INTERNAL} INVALID_USE_OF_INTERNAL_FUNCTION Occurs when the client is created without a gateway configuration. Should never happen.\n */\n\n/**\n * @name BraintreeError.Shared Errors - Component Creation Error Codes\n * @description Errors that occur when creating components.\n * @property {MERCHANT} INSTANTIATION_OPTION_REQUIRED Occurs when a component is created that is missing a required option.\n * @property {MERCHANT} INCOMPATIBLE_VERSIONS Occurs when a component is created with a client with a different version than the component.\n * @property {NETWORK} CLIENT_SCRIPT_FAILED_TO_LOAD Occurs when a component attempts to load the Braintree client script, but the request fails.\n */\n\n/**\n * @name BraintreeError.Shared Errors - Component Instance Error Codes\n * @description Errors that occur when using instances of components.\n * @property {MERCHANT} METHOD_CALLED_AFTER_TEARDOWN Occurs when a method is called on a component instance after it has been torn down.\n */\n\nvar BraintreeError = _dereq_(\"./braintree-error\");\n\nmodule.exports = {\n INVALID_USE_OF_INTERNAL_FUNCTION: {\n type: BraintreeError.types.INTERNAL,\n code: \"INVALID_USE_OF_INTERNAL_FUNCTION\",\n },\n INSTANTIATION_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"INSTANTIATION_OPTION_REQUIRED\",\n },\n INCOMPATIBLE_VERSIONS: {\n type: BraintreeError.types.MERCHANT,\n code: \"INCOMPATIBLE_VERSIONS\",\n },\n CLIENT_SCRIPT_FAILED_TO_LOAD: {\n type: BraintreeError.types.NETWORK,\n code: \"CLIENT_SCRIPT_FAILED_TO_LOAD\",\n message: \"Braintree client script could not be loaded.\",\n },\n METHOD_CALLED_AFTER_TEARDOWN: {\n type: BraintreeError.types.MERCHANT,\n code: \"METHOD_CALLED_AFTER_TEARDOWN\",\n },\n};\n\n},{\"./braintree-error\":124}],136:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function findRootNode(element) {\n while (element.parentNode) {\n element = element.parentNode;\n }\n\n return element;\n};\n\n},{}],137:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (array, key, value) {\n var i;\n\n for (i = 0; i < array.length; i++) {\n if (array[i].hasOwnProperty(key) && array[i][key] === value) {\n return array[i];\n }\n }\n\n return null;\n};\n\n},{}],138:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar Popup = _dereq_(\"./strategies/popup\");\nvar PopupBridge = _dereq_(\"./strategies/popup-bridge\");\nvar Modal = _dereq_(\"./strategies/modal\");\nvar Bus = _dereq_(\"framebus\");\nvar events = _dereq_(\"../shared/events\");\nvar errors = _dereq_(\"../shared/errors\");\nvar constants = _dereq_(\"../shared/constants\");\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar iFramer = _dereq_(\"@braintree/iframer\");\nvar BraintreeError = _dereq_(\"../../braintree-error\");\nvar browserDetection = _dereq_(\"../shared/browser-detection\");\nvar assign = _dereq_(\"./../../assign\").assign;\nvar BUS_CONFIGURATION_REQUEST_EVENT =\n _dereq_(\"../../constants\").BUS_CONFIGURATION_REQUEST_EVENT;\n\nvar REQUIRED_CONFIG_KEYS = [\"name\", \"dispatchFrameUrl\", \"openFrameUrl\"];\n\nfunction noop() {}\n\nfunction _validateFrameConfiguration(options) {\n if (!options) {\n throw new Error(\"Valid configuration is required\");\n }\n\n REQUIRED_CONFIG_KEYS.forEach(function (key) {\n if (!options.hasOwnProperty(key)) {\n throw new Error(\"A valid frame \" + key + \" must be provided\");\n }\n });\n\n if (!/^[\\w_]+$/.test(options.name)) {\n throw new Error(\"A valid frame name must be provided\");\n }\n}\n\nfunction FrameService(options) {\n _validateFrameConfiguration(options);\n\n this._serviceId = uuid().replace(/-/g, \"\");\n\n this._options = {\n name: options.name + \"_\" + this._serviceId,\n dispatchFrameUrl: options.dispatchFrameUrl,\n openFrameUrl: options.openFrameUrl,\n height: options.height,\n width: options.width,\n top: options.top,\n left: options.left,\n };\n this.state = options.state || {};\n\n this._bus = new Bus({ channel: this._serviceId });\n this._setBusEvents();\n}\n\nFrameService.prototype.initialize = function (callback) {\n var dispatchFrameReadyHandler = function () {\n callback();\n this._bus.off(events.DISPATCH_FRAME_READY, dispatchFrameReadyHandler);\n }.bind(this);\n\n this._bus.on(events.DISPATCH_FRAME_READY, dispatchFrameReadyHandler);\n this._writeDispatchFrame();\n};\n\nFrameService.prototype._writeDispatchFrame = function () {\n var frameName = constants.DISPATCH_FRAME_NAME + \"_\" + this._serviceId;\n var frameSrc = this._options.dispatchFrameUrl;\n\n this._dispatchFrame = iFramer({\n \"aria-hidden\": true,\n name: frameName,\n title: frameName,\n src: frameSrc,\n class: constants.DISPATCH_FRAME_CLASS,\n height: 0,\n width: 0,\n style: {\n position: \"absolute\",\n left: \"-9999px\",\n },\n });\n\n document.body.appendChild(this._dispatchFrame);\n};\n\nFrameService.prototype._setBusEvents = function () {\n this._bus.on(\n events.DISPATCH_FRAME_REPORT,\n function (res, reply) {\n if (this._onCompleteCallback) {\n this._onCompleteCallback.call(null, res.err, res.payload);\n }\n this._frame.close();\n\n this._onCompleteCallback = null;\n\n if (reply) {\n reply();\n }\n }.bind(this)\n );\n\n this._bus.on(\n BUS_CONFIGURATION_REQUEST_EVENT,\n function (reply) {\n reply(this.state);\n }.bind(this)\n );\n};\n\nFrameService.prototype.open = function (options, callback) {\n options = options || {};\n this._frame = this._getFrameForEnvironment(options);\n\n this._frame.initialize(callback);\n\n if (this._frame instanceof PopupBridge) {\n // Frameservice loads a spinner then redirects to the final destination url.\n // For Popupbridge it doesn't have the same rules around popups since it's deferred to the mobile side\n // therefore, skips the regular open path and instead uses `#redirect` to handle things\n return;\n }\n\n assign(this.state, options.state);\n\n this._onCompleteCallback = callback;\n this._frame.open();\n\n if (this.isFrameClosed()) {\n this._cleanupFrame();\n\n if (callback) {\n callback(new BraintreeError(errors.FRAME_SERVICE_FRAME_OPEN_FAILED));\n }\n\n return;\n }\n this._pollForPopupClose();\n};\n\nFrameService.prototype.redirect = function (url) {\n if (this._frame && !this.isFrameClosed()) {\n this._frame.redirect(url);\n }\n};\n\nFrameService.prototype.close = function () {\n if (!this.isFrameClosed()) {\n this._frame.close();\n }\n};\n\nFrameService.prototype.focus = function () {\n if (!this.isFrameClosed()) {\n this._frame.focus();\n }\n};\n\nFrameService.prototype.createHandler = function (options) {\n options = options || {};\n\n return {\n close: function () {\n if (options.beforeClose) {\n options.beforeClose();\n }\n\n this.close();\n }.bind(this),\n focus: function () {\n if (options.beforeFocus) {\n options.beforeFocus();\n }\n\n this.focus();\n }.bind(this),\n };\n};\n\nFrameService.prototype.createNoopHandler = function () {\n return {\n close: noop,\n focus: noop,\n };\n};\n\nFrameService.prototype.teardown = function () {\n this.close();\n this._dispatchFrame.parentNode.removeChild(this._dispatchFrame);\n this._dispatchFrame = null;\n this._cleanupFrame();\n};\n\nFrameService.prototype.isFrameClosed = function () {\n return this._frame == null || this._frame.isClosed();\n};\n\nFrameService.prototype._cleanupFrame = function () {\n this._frame = null;\n clearInterval(this._popupInterval);\n this._popupInterval = null;\n};\n\nFrameService.prototype._pollForPopupClose = function () {\n this._popupInterval = setInterval(\n function () {\n if (this.isFrameClosed()) {\n this._cleanupFrame();\n if (this._onCompleteCallback) {\n this._onCompleteCallback(\n new BraintreeError(errors.FRAME_SERVICE_FRAME_CLOSED)\n );\n }\n }\n }.bind(this),\n constants.POPUP_POLL_INTERVAL\n );\n\n return this._popupInterval;\n};\n\nFrameService.prototype._getFrameForEnvironment = function (options) {\n var usePopup = browserDetection.supportsPopups();\n var popupBridgeExists = Boolean(window.popupBridge);\n\n var initOptions = assign({}, this._options, options);\n\n if (popupBridgeExists) {\n return new PopupBridge(initOptions);\n } else if (usePopup) {\n return new Popup(initOptions);\n }\n\n return new Modal(initOptions);\n};\n\nmodule.exports = FrameService;\n\n},{\"../../braintree-error\":124,\"../../constants\":126,\"../shared/browser-detection\":145,\"../shared/constants\":146,\"../shared/errors\":147,\"../shared/events\":148,\"./../../assign\":121,\"./strategies/modal\":140,\"./strategies/popup\":143,\"./strategies/popup-bridge\":141,\"@braintree/iframer\":35,\"@braintree/uuid\":39,\"framebus\":52}],139:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar FrameService = _dereq_(\"./frame-service\");\n\n/**\n * @ignore\n * @function create\n * Initializing FrameService should be done at the point when the component is created, so it is ready whenever a component needs to open a popup window.\n * Browsers have varying rules around what constitutes and async action worth blocking a popup for, but the likes of Safari\n * will block the popup if `frameService#create` is invoked during any asynchronous process (such as an API request to tokenize payment details).\n *\n * The process of setting up the dispatch frame and subsequent framebus communications via event listeners are considered async by Safari's standards.\n *\n * @param {object} options The options provided to frameservice\n * @param {string} options.name The name to use for identifying the various pieces associated with frameservice.\n * @param {string} options.dispatchFrameUrl The static asset to load for use as the dispatch frame. This allows for secure communication between the iframe and the popup, since they are on the same asset domain (usually checkout.paypal.com or assets.braintreegateway.com)\n * @param {string} options.openFrameUrl The url to load in the popup. Sometimes it is the case that you'll need info that comes _after_ the popup loads in which case we load the `landing-frame` that's a loading spinner then redirect to the proper/final destination. See the PayPal component for an example.\n * Otherwise if all the info needed is ready up-front, then you can forego a landing frame and go straight to the final destination.\n * @param {string} [options.height] The desired popup height.\n * @param {string} [options.width] The desired popup width.\n * @param {string} [options.top] The desired top value of the popup for positioning.\n * @param {string} [options.left] The desired left value of the popup for positioning.\n * @param {object} [options.state] Seems to be dead code, but allows for injecting data in to popup. NEXT_MAJOR_VERSION remove this param if no usage exists.\n * @param {function} callback The function to invoke once the frameservice is created and ready to use. FrameService instance is returned.\n */\nmodule.exports = {\n create: function createFrameService(options, callback) {\n var frameService = new FrameService(options);\n\n frameService.initialize(function () {\n callback(frameService);\n });\n },\n};\n\n},{\"./frame-service\":138}],140:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar iFramer = _dereq_(\"@braintree/iframer\");\nvar assign = _dereq_(\"../../../assign\").assign;\nvar browserDetection = _dereq_(\"../../shared/browser-detection\");\n\nvar ELEMENT_STYLES = {\n position: \"fixed\",\n top: 0,\n left: 0,\n bottom: 0,\n padding: 0,\n margin: 0,\n border: 0,\n outline: \"none\",\n zIndex: 20001,\n background: \"#FFFFFF\",\n};\n\nfunction noop() {}\n\n/**\n *\n * We should not ever really use the Modal. Modals are _like_ popups, but the key difference is that the customer can't actually verify it's app domain and thus secure/valid. Old PP sdk (./src/paypal) uses this\n * to get info from webviews (e.g. facebook).\n */\n\nfunction Modal(options) {\n this._closed = null;\n this._frame = null;\n this._options = options || {};\n this._container = this._options.container || document.body;\n}\n\nModal.prototype.initialize = noop;\n\nModal.prototype.open = function () {\n var iframerConfig = {\n src: this._options.openFrameUrl,\n name: this._options.name,\n scrolling: \"yes\",\n height: \"100%\",\n width: \"100%\",\n style: assign({}, ELEMENT_STYLES),\n title: \"Lightbox Frame\",\n };\n\n if (browserDetection.isIos()) {\n // WKWebView has buggy behavior when scrolling a fixed position modal. The workaround is to lock scrolling in\n // the background. When modal is closed, we restore scrolling and return to the previous scroll position.\n if (browserDetection.isIosWKWebview()) {\n this._lockScrolling();\n // Allows WKWebView to scroll all the way down to bottom\n iframerConfig.style = {};\n }\n\n this._el = document.createElement(\"div\");\n\n assign(this._el.style, ELEMENT_STYLES, {\n height: \"100%\",\n width: \"100%\",\n overflow: \"auto\",\n \"-webkit-overflow-scrolling\": \"touch\",\n });\n\n this._frame = iFramer(iframerConfig);\n this._el.appendChild(this._frame);\n } else {\n this._el = this._frame = iFramer(iframerConfig);\n }\n this._closed = false;\n\n this._container.appendChild(this._el);\n};\n\nModal.prototype.focus = noop;\n\nModal.prototype.close = function () {\n this._container.removeChild(this._el);\n this._frame = null;\n this._closed = true;\n if (browserDetection.isIosWKWebview()) {\n this._unlockScrolling();\n }\n};\n\nModal.prototype.isClosed = function () {\n return Boolean(this._closed);\n};\n\nModal.prototype.redirect = function (redirectUrl) {\n this._frame.src = redirectUrl;\n};\n\nModal.prototype._unlockScrolling = function () {\n document.body.style.overflow = this._savedBodyProperties.overflowStyle;\n document.body.style.position = this._savedBodyProperties.positionStyle;\n window.scrollTo(\n this._savedBodyProperties.left,\n this._savedBodyProperties.top\n );\n delete this._savedBodyProperties;\n};\n\nModal.prototype._lockScrolling = function () {\n var doc = document.documentElement;\n\n // From https://stackoverflow.com/questions/9538868/prevent-body-from-scrolling-when-a-modal-is-opened#comment65626743_24727206\n this._savedBodyProperties = {\n left: (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),\n top: (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0),\n overflowStyle: document.body.style.overflow,\n positionStyle: document.body.style.position,\n };\n document.body.style.overflow = \"hidden\";\n document.body.style.position = \"fixed\";\n window.scrollTo(0, 0);\n};\n\nmodule.exports = Modal;\n\n},{\"../../../assign\":121,\"../../shared/browser-detection\":145,\"@braintree/iframer\":35}],141:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../../../braintree-error\");\nvar errors = _dereq_(\"../../shared/errors\");\n\nfunction noop() {}\n\nfunction PopupBridge(options) {\n this._closed = null;\n this._options = options;\n}\n\nPopupBridge.prototype.initialize = function (callback) {\n var self = this;\n\n window.popupBridge.onComplete = function (err, payload) {\n var popupDismissed = !payload && !err;\n\n self._closed = true;\n\n if (err || popupDismissed) {\n // User clicked \"Done\" button of browser view\n callback(new BraintreeError(errors.FRAME_SERVICE_FRAME_CLOSED));\n\n return;\n }\n // User completed popup flow (includes success and cancel cases)\n callback(null, payload);\n };\n};\n\nPopupBridge.prototype.open = function (options) {\n var url;\n\n options = options || {};\n url = options.openFrameUrl || this._options.openFrameUrl;\n\n this._closed = false;\n window.popupBridge.open(url);\n};\n\nPopupBridge.prototype.focus = noop;\n\nPopupBridge.prototype.close = noop;\n\nPopupBridge.prototype.isClosed = function () {\n return Boolean(this._closed);\n};\n\nPopupBridge.prototype.redirect = function (redirectUrl) {\n this.open({ openFrameUrl: redirectUrl });\n};\n\nmodule.exports = PopupBridge;\n\n},{\"../../../braintree-error\":124,\"../../shared/errors\":147}],142:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar constants = _dereq_(\"../../../shared/constants\");\nvar position = _dereq_(\"./position\");\n\nfunction calculatePosition(type, userDefinedPosition, size) {\n if (typeof userDefinedPosition !== \"undefined\") {\n return userDefinedPosition;\n }\n\n return position[type](size);\n}\n\nmodule.exports = function composePopupOptions(options) {\n var height = options.height || constants.DEFAULT_POPUP_HEIGHT;\n var width = options.width || constants.DEFAULT_POPUP_WIDTH;\n var top = calculatePosition(\"top\", options.top, height);\n var left = calculatePosition(\"left\", options.left, width);\n\n return [\n constants.POPUP_BASE_OPTIONS,\n \"height=\" + height,\n \"width=\" + width,\n \"top=\" + top,\n \"left=\" + left,\n ].join(\",\");\n};\n\n},{\"../../../shared/constants\":146,\"./position\":144}],143:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar composeOptions = _dereq_(\"./compose-options\");\n\nfunction noop() {}\n\nfunction Popup(options) {\n this._frame = null;\n this._options = options || {};\n}\n\nPopup.prototype.initialize = noop;\n\nPopup.prototype.open = function () {\n this._frame = window.open(\n this._options.openFrameUrl,\n this._options.name,\n composeOptions(this._options)\n );\n};\n\nPopup.prototype.focus = function () {\n this._frame.focus();\n};\n\nPopup.prototype.close = function () {\n if (this._frame.closed) {\n return;\n }\n this._frame.close();\n};\n\nPopup.prototype.isClosed = function () {\n return !this._frame || Boolean(this._frame.closed);\n};\n\nPopup.prototype.redirect = function (redirectUrl) {\n this._frame.location.href = redirectUrl;\n};\n\nmodule.exports = Popup;\n\n},{\"./compose-options\":142}],144:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction top(height) {\n var windowHeight =\n window.outerHeight || document.documentElement.clientHeight;\n var windowTop = window.screenY == null ? window.screenTop : window.screenY;\n\n return center(windowHeight, height, windowTop);\n}\n\nfunction left(width) {\n var windowWidth = window.outerWidth || document.documentElement.clientWidth;\n var windowLeft = window.screenX == null ? window.screenLeft : window.screenX;\n\n return center(windowWidth, width, windowLeft);\n}\n\nfunction center(windowMetric, popupMetric, offset) {\n return (windowMetric - popupMetric) / 2 + offset;\n}\n\nmodule.exports = {\n top: top,\n left: left,\n center: center,\n};\n\n},{}],145:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n isIos: _dereq_(\"@braintree/browser-detection/is-ios\"),\n isIosWKWebview: _dereq_(\"@braintree/browser-detection/is-ios-wkwebview\"),\n supportsPopups: _dereq_(\"@braintree/browser-detection/supports-popups\"),\n};\n\n},{\"@braintree/browser-detection/is-ios\":30,\"@braintree/browser-detection/is-ios-wkwebview\":29,\"@braintree/browser-detection/supports-popups\":32}],146:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n DISPATCH_FRAME_NAME: \"dispatch\",\n DISPATCH_FRAME_CLASS: \"braintree-dispatch-frame\",\n POPUP_BASE_OPTIONS: \"resizable,scrollbars\",\n DEFAULT_POPUP_WIDTH: 450,\n DEFAULT_POPUP_HEIGHT: 535,\n POPUP_POLL_INTERVAL: 100,\n POPUP_CLOSE_TIMEOUT: 100,\n};\n\n},{}],147:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Popup Related Error Codes\n * @ignore\n * @description Errors that occur when using a component that opens a popup window.\n * @property {INTERNAL} FRAME_SERVICE_FRAME_CLOSED - Occurs when the frame is closed before tokenization can occur.\n * @property {INTERNAL} FRAME_SERVICE_FRAME_OPEN_FAILED - Occurs when the popup could not be opened.\n */\n\nvar BraintreeError = _dereq_(\"../../braintree-error\");\n\nmodule.exports = {\n FRAME_SERVICE_FRAME_CLOSED: {\n type: BraintreeError.types.INTERNAL,\n code: \"FRAME_SERVICE_FRAME_CLOSED\",\n message: \"Frame closed before tokenization could occur.\",\n },\n FRAME_SERVICE_FRAME_OPEN_FAILED: {\n type: BraintreeError.types.INTERNAL,\n code: \"FRAME_SERVICE_FRAME_OPEN_FAILED\",\n message: \"Frame failed to open.\",\n },\n};\n\n},{\"../../braintree-error\":124}],148:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar enumerate = _dereq_(\"../../enumerate\");\n\nmodule.exports = enumerate(\n [\"DISPATCH_FRAME_READY\", \"DISPATCH_FRAME_REPORT\"],\n \"frameService:\"\n);\n\n},{\"../../enumerate\":134}],149:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar VERSION = \"3.100.0\";\nvar assign = _dereq_(\"./assign\").assign;\n\nfunction generateTokenizationParameters(configuration, overrides) {\n var metadata = configuration.analyticsMetadata;\n var basicTokenizationParameters = {\n gateway: \"braintree\",\n \"braintree:merchantId\": configuration.gatewayConfiguration.merchantId,\n \"braintree:apiVersion\": \"v1\",\n \"braintree:sdkVersion\": VERSION,\n \"braintree:metadata\": JSON.stringify({\n source: metadata.source,\n integration: metadata.integration,\n sessionId: metadata.sessionId,\n version: VERSION,\n platform: metadata.platform,\n }),\n };\n\n return assign({}, basicTokenizationParameters, overrides);\n}\n\nmodule.exports = function (configuration, googlePayVersion, googleMerchantId) {\n var data, paypalPaymentMethod;\n var androidPayConfiguration = configuration.gatewayConfiguration.androidPay;\n var environment =\n configuration.gatewayConfiguration.environment === \"production\"\n ? \"PRODUCTION\"\n : \"TEST\";\n\n if (googlePayVersion === 2) {\n data = {\n apiVersion: 2,\n apiVersionMinor: 0,\n environment: environment,\n allowedPaymentMethods: [\n {\n type: \"CARD\",\n parameters: {\n allowedAuthMethods: [\"PAN_ONLY\", \"CRYPTOGRAM_3DS\"],\n allowedCardNetworks: androidPayConfiguration.supportedNetworks.map(\n function (card) {\n return card.toUpperCase();\n }\n ),\n },\n tokenizationSpecification: {\n type: \"PAYMENT_GATEWAY\",\n parameters: generateTokenizationParameters(configuration, {\n \"braintree:authorizationFingerprint\":\n androidPayConfiguration.googleAuthorizationFingerprint,\n }),\n },\n },\n ],\n };\n\n if (googleMerchantId) {\n data.merchantInfo = {\n merchantId: googleMerchantId,\n };\n }\n\n if (androidPayConfiguration.paypalClientId) {\n paypalPaymentMethod = {\n type: \"PAYPAL\",\n parameters: {\n /* eslint-disable camelcase */\n purchase_context: {\n purchase_units: [\n {\n payee: {\n client_id: androidPayConfiguration.paypalClientId,\n },\n recurring_payment: true,\n },\n ],\n },\n /* eslint-enable camelcase */\n },\n tokenizationSpecification: {\n type: \"PAYMENT_GATEWAY\",\n parameters: generateTokenizationParameters(configuration, {\n \"braintree:paypalClientId\": androidPayConfiguration.paypalClientId,\n }),\n },\n };\n\n data.allowedPaymentMethods.push(paypalPaymentMethod);\n }\n } else {\n data = {\n environment: environment,\n allowedPaymentMethods: [\"CARD\", \"TOKENIZED_CARD\"],\n paymentMethodTokenizationParameters: {\n tokenizationType: \"PAYMENT_GATEWAY\",\n parameters: generateTokenizationParameters(configuration, {\n \"braintree:authorizationFingerprint\":\n androidPayConfiguration.googleAuthorizationFingerprint,\n }),\n },\n cardRequirements: {\n allowedCardNetworks: androidPayConfiguration.supportedNetworks.map(\n function (card) {\n return card.toUpperCase();\n }\n ),\n },\n };\n\n if (configuration.authorizationType === \"TOKENIZATION_KEY\") {\n data.paymentMethodTokenizationParameters.parameters[\n \"braintree:clientKey\"\n ] = configuration.authorization;\n }\n\n if (googleMerchantId) {\n data.merchantId = googleMerchantId;\n }\n\n if (googlePayVersion) {\n data.apiVersion = googlePayVersion;\n }\n }\n\n return data;\n};\n\n},{\"./assign\":121}],150:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function inIframe(win) {\n win = win || window;\n\n try {\n return win.self !== win.top;\n } catch (e) {\n return true;\n }\n};\n\n},{}],151:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction convertDateStringToDate(dateString) {\n var splitDate = dateString.split(\"-\");\n\n return new Date(splitDate[0], splitDate[1], splitDate[2]);\n}\n\nfunction isDateStringBeforeOrOn(firstDate, secondDate) {\n return (\n convertDateStringToDate(firstDate) <= convertDateStringToDate(secondDate)\n );\n}\n\nmodule.exports = isDateStringBeforeOrOn;\n\n},{}],152:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction isHTTPS(protocol) {\n protocol = protocol || window.location.protocol;\n\n return protocol === \"https:\";\n}\n\nmodule.exports = {\n isHTTPS: isHTTPS,\n};\n\n},{}],153:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar parser;\nvar legalHosts = {\n \"paypal.com\": 1,\n \"braintreepayments.com\": 1,\n \"braintreegateway.com\": 1,\n \"braintree-api.com\": 1,\n};\n\n// endRemoveIf(production)\n\nfunction stripSubdomains(domain) {\n return domain.split(\".\").slice(-2).join(\".\");\n}\n\nfunction isVerifiedDomain(url) {\n var mainDomain;\n\n url = url.toLowerCase();\n\n if (!/^https:/.test(url)) {\n return false;\n }\n\n parser = parser || document.createElement(\"a\");\n parser.href = url;\n mainDomain = stripSubdomains(parser.hostname);\n\n return legalHosts.hasOwnProperty(mainDomain);\n}\n\nmodule.exports = isVerifiedDomain;\n\n},{}],154:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (value) {\n return JSON.parse(JSON.stringify(value));\n};\n\n},{}],155:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (obj) {\n return Object.keys(obj).filter(function (key) {\n return typeof obj[key] === \"function\";\n });\n};\n\n},{}],156:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction once(fn) {\n var called = false;\n\n return function () {\n if (!called) {\n called = true;\n fn.apply(null, arguments);\n }\n };\n}\n\nmodule.exports = once;\n\n},{}],157:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction _notEmpty(obj) {\n var key;\n\n for (key in obj) {\n if (obj.hasOwnProperty(key)) {\n return true;\n }\n }\n\n return false;\n}\n\n/* eslint-disable no-mixed-operators */\nfunction _isArray(value) {\n return (\n (value &&\n typeof value === \"object\" &&\n typeof value.length === \"number\" &&\n Object.prototype.toString.call(value) === \"[object Array]\") ||\n false\n );\n}\n/* eslint-enable no-mixed-operators */\n\nfunction hasQueryParams(url) {\n url = url || window.location.href;\n\n return /\\?/.test(url);\n}\n\nfunction parse(url) {\n var query, params;\n\n url = url || window.location.href;\n\n if (!hasQueryParams(url)) {\n return {};\n }\n\n query = url.split(\"?\")[1] || \"\";\n query = query.replace(/#.*$/, \"\").split(\"&\");\n\n params = query.reduce(function (toReturn, keyValue) {\n var parts = keyValue.split(\"=\");\n var key = decodeURIComponent(parts[0]);\n var value = decodeURIComponent(parts[1]);\n\n toReturn[key] = value;\n\n return toReturn;\n }, {});\n\n return params;\n}\n\nfunction stringify(params, namespace) {\n var k, v, p;\n var query = [];\n\n for (p in params) {\n if (!params.hasOwnProperty(p)) {\n continue;\n }\n\n v = params[p];\n\n if (namespace) {\n if (_isArray(params)) {\n k = namespace + \"[]\";\n } else {\n k = namespace + \"[\" + p + \"]\";\n }\n } else {\n k = p;\n }\n if (typeof v === \"object\") {\n query.push(stringify(v, k));\n } else {\n query.push(encodeURIComponent(k) + \"=\" + encodeURIComponent(v));\n }\n }\n\n return query.join(\"&\");\n}\n\nfunction queryify(url, params) {\n url = url || \"\";\n\n if (params != null && typeof params === \"object\" && _notEmpty(params)) {\n url += url.indexOf(\"?\") === -1 ? \"?\" : \"\";\n url += url.indexOf(\"=\") !== -1 ? \"&\" : \"\";\n url += stringify(params);\n }\n\n return url;\n}\n\nmodule.exports = {\n parse: parse,\n stringify: stringify,\n queryify: queryify,\n hasQueryParams: hasQueryParams,\n};\n\n},{}],158:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar findRootNode = _dereq_(\"./find-root-node\");\n\n// based on https://github.com/krakenjs/belter/blob/cdddc4f8ddb172d29db9e7e1ad1eeeacfb93e215/src/dom.js#L981-L1031\n// thanks @bluepnume\n\nfunction isShadowElement(element) {\n element = findRootNode(element);\n\n return element.toString() === \"[object ShadowRoot]\";\n}\n\nfunction getShadowHost(element) {\n element = findRootNode(element);\n\n if (!isShadowElement(element)) {\n return null;\n }\n\n return element.host;\n}\n\nfunction transformToSlot(element, styles) {\n var styleNode = findRootNode(element).querySelector(\"style\");\n var shadowHost = getShadowHost(element);\n var slotName = \"shadow-slot-\" + uuid();\n var slot = document.createElement(\"slot\");\n var slotProvider = document.createElement(\"div\");\n\n slot.setAttribute(\"name\", slotName);\n element.appendChild(slot);\n\n slotProvider.setAttribute(\"slot\", slotName);\n shadowHost.appendChild(slotProvider);\n\n if (styles) {\n if (!styleNode) {\n styleNode = document.createElement(\"style\");\n element.appendChild(styleNode);\n }\n\n styleNode.sheet.insertRule(\n '::slotted([slot=\"' + slotName + '\"]) { ' + styles + \" }\"\n );\n }\n\n if (isShadowElement(shadowHost)) {\n return transformToSlot(slotProvider, styles);\n }\n\n return slotProvider;\n}\n\nmodule.exports = {\n isShadowElement: isShadowElement,\n getShadowHost: getShadowHost,\n transformToSlot: transformToSlot,\n};\n\n},{\"./find-root-node\":136,\"@braintree/uuid\":39}],159:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = function (snakeString) {\n if (snakeString.indexOf(\"_\") === -1) {\n return snakeString;\n }\n\n return snakeString.toLowerCase().replace(/(\\_\\w)/g, function (match) {\n return match[1].toUpperCase();\n });\n};\n\n},{}],160:[function(_dereq_,module,exports){\n\"use strict\";\n\nfunction useMin(isDebug) {\n return isDebug ? \"\" : \".min\";\n}\n\nmodule.exports = useMin;\n\n},{}],161:[function(_dereq_,module,exports){\n\"use strict\";\n\n// NEXT_MAJOR_VERSION old versions of IE don't have atob, in the\n// next major version, we're dropping support for those versions\n// so we can eliminate the need to have this atob polyfill\nvar atobNormalized = typeof atob === \"function\" ? atob : atobPolyfill;\n\nfunction atobPolyfill(base64String) {\n var a, b, c, b1, b2, b3, b4, i;\n var base64Matcher = new RegExp(\n \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})([=]{1,2})?$\"\n );\n var characters =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var result = \"\";\n\n if (!base64Matcher.test(base64String)) {\n throw new Error(\"Non base64 encoded input passed to window.atob polyfill\");\n }\n\n i = 0;\n do {\n b1 = characters.indexOf(base64String.charAt(i++));\n b2 = characters.indexOf(base64String.charAt(i++));\n b3 = characters.indexOf(base64String.charAt(i++));\n b4 = characters.indexOf(base64String.charAt(i++));\n\n a = ((b1 & 0x3f) << 2) | ((b2 >> 4) & 0x3);\n b = ((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf);\n c = ((b3 & 0x3) << 6) | (b4 & 0x3f);\n\n result +=\n String.fromCharCode(a) +\n (b ? String.fromCharCode(b) : \"\") +\n (c ? String.fromCharCode(c) : \"\");\n } while (i < base64String.length);\n\n return result;\n}\n\nmodule.exports = {\n atob: function (base64String) {\n return atobNormalized.call(window, base64String);\n },\n _atob: atobPolyfill,\n};\n\n},{}],162:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n REQUIRED_OPTIONS_FOR_START_PAYMENT: [\n \"givenName\",\n \"surname\",\n \"currencyCode\",\n \"onPaymentStart\",\n \"paymentType\",\n \"amount\",\n \"fallback\",\n ],\n REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE: [\n \"givenName\",\n \"surname\",\n \"currencyCode\",\n \"onPaymentStart\",\n \"paymentType\",\n \"amount\",\n \"address\",\n \"billingAddress\",\n \"birthDate\",\n \"email\",\n \"locale\",\n \"customerServiceInstructions\",\n \"correlationId\",\n \"phone\",\n \"phoneCountryCode\",\n \"lineItems\",\n ],\n REQUIRED_OPTIONS_FOR_ADDRESS: [\n \"streetAddress\",\n \"locality\",\n \"postalCode\",\n \"countryCode\",\n ],\n REQUIRED_OPTIONS_FOR_LINE_ITEMS: [\n \"category\",\n \"name\",\n \"quantity\",\n \"unitAmount\",\n \"unitTaxAmount\",\n ],\n REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE: [\n \"givenName\",\n \"surname\",\n \"currencyCode\",\n \"onPaymentStart\",\n \"paymentType\",\n \"amount\",\n ],\n REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0: [\"authCode\"],\n REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST: [\n \"authCode\",\n \"consumerReference\",\n \"aliasLabel\",\n ],\n REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT: [\n \"consumerReference\",\n \"aliasKey\",\n ],\n};\n\n},{}],163:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar frameService = _dereq_(\"../../lib/frame-service/external\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar useMin = _dereq_(\"../../lib/use-min\");\nvar VERSION = \"3.100.0\";\nvar INTEGRATION_TIMEOUT_MS =\n _dereq_(\"../../lib/constants\").INTEGRATION_TIMEOUT_MS;\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar methods = _dereq_(\"../../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\nvar convertToBraintreeError = _dereq_(\"../../lib/convert-to-braintree-error\");\nvar ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\nvar querystring = _dereq_(\"../../lib/querystring\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar constants = _dereq_(\"./constants\");\nvar errors = _dereq_(\"../shared/errors\");\n\nvar DEFAULT_WINDOW_WIDTH = 1282;\nvar DEFAULT_WINDOW_HEIGHT = 720;\n\nExtendedPromise.suppressUnhandledPromiseMessage = true;\n\n/**\n * @class\n * @param {object} options see {@link module:braintree-web/local-payment.create|local-payment.create}\n * @classdesc This class represents a LocalPayment component. Instances of this class can open a LocalPayment window for paying with alternate payments local to a specific country. Any additional UI, such as disabling the page while authentication is taking place, is up to the developer.\n *\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/local-payment.create|braintree-web.local-payment.create} instead.</strong>\n */\nfunction LocalPayment(options) {\n this._client = options.client;\n this._assetsUrl =\n options.client.getConfiguration().gatewayConfiguration.assetsUrl +\n \"/web/\" +\n VERSION;\n this._isDebug = options.client.getConfiguration().isDebug;\n this._loadingFrameUrl =\n this._assetsUrl +\n \"/html/local-payment-landing-frame\" +\n useMin(this._isDebug) +\n \".html\";\n this._authorizationInProgress = false;\n this._paymentType = \"unknown\";\n this._merchantAccountId = options.merchantAccountId;\n}\n\nLocalPayment.prototype._initialize = function () {\n var self = this;\n var client = this._client;\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(client, \"local-payment.load.timed-out\");\n }, INTEGRATION_TIMEOUT_MS);\n\n return new Promise(function (resolve) {\n frameService.create(\n {\n name: \"localpaymentlandingpage\",\n dispatchFrameUrl:\n self._assetsUrl +\n \"/html/dispatch-frame\" +\n useMin(self._isDebug) +\n \".html\",\n openFrameUrl: self._loadingFrameUrl,\n },\n function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(client, \"local-payment.load.succeeded\");\n resolve(self);\n }\n );\n });\n};\n\n/**\n * Options used for most local payment types.\n * @typedef {object} LocalPayment~StartPaymentOptions\n * @property {object} fallback Configuration for what to do when app switching back from a Bank app on a mobile device.\n * @property {string} fallback.buttonText The text to display in a button to redirect back to the merchant page.\n * @property {string} fallback.url The url to redirect to when the redirect button is pressed. Query params will be added to the url to process the data returned from the bank.\n * @property {string} fallback.cancelButtonText The text to display in a button to redirect back to the merchant page when the customer cancels. If no `cancelButtonText` is provided, `buttonText` will be used.\n * @property {string} fallback.cancelUrl The url to redirect to when the redirect button is pressed when the customer cancels. Query params will be added to the url to check the state of the payment. If no `cancelUrl` is provided, `url` will be used.\n * @property {object} [windowOptions] The options for configuring the window that is opened when starting the payment.\n * @property {number} [windowOptions.width=1282] The width in pixels of the window opened when starting the payment. The default width size is this large to allow various banking partner landing pages to display the QR Code to be scanned by the bank's mobile app. Many will not display the QR code when the window size is smaller than a standard desktop screen.\n * @property {number} [windowOptions.height=720] The height in pixels of the window opened when starting the payment.\n * @property {string} amount The amount to authorize for the transaction.\n * @property {string} currencyCode The currency to process the payment (three-character ISO-4217).\n * @property {string} [displayName] The merchant name displayed inside of the window that is opened when starting the payment.\n * @property {string} paymentType The type of local payment. See https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom\n * @property {string} paymentTypeCountryCode The country code of the local payment. This value must be one of the supported country codes for a given local payment type listed {@link https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom/javascript/v3#render-local-payment-method-buttons|here}. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.\n * @property {string} email Payer email of the customer.\n * @property {string} givenName First name of the customer.\n * @property {string} surname Last name of the customer.\n * @property {string} phone Phone number of the customer.\n * @property {string} bic Bank Identification Code of the customer (specific to iDEAL transactions).\n * @property {boolean} recurrent Enable recurrent payment.\n * @property {string} customerId The customer's id in merchant's system (required for recurrent payments).\n * @property {boolean} shippingAddressRequired Indicates whether or not the payment needs to be shipped. For digital goods, this should be false. Defaults to false.\n * @property {object} address The shipping address.\n * @property {string} address.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} address.extendedAddress Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} address.locality Customer's city.\n * @property {string} address.region Customer's region or state.\n * @property {string} address.postalCode Customer's postal code.\n * @property {string} address.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {function} onPaymentStart A function that will be called with two parameters: an object containing the `paymentId` and a `continueCallback` that must be called to launch the flow. You can use method to do any preprocessing on your server before the flow begins..\n */\n\n/**\n * Options used for the Pay Upon Invoice local payment type.\n * @typedef {object} LocalPayment~StartPaymentPayUponInvoiceOptions\n * @property {string} amount The amount to authorize for the transaction.\n * @property {string} currencyCode The currency to process the payment (three-character ISO-4217).\n * @property {string} [displayName] The merchant name displayed inside of the window that is opened when starting the payment.\n * @property {string} paymentType The type of local payment. Must be `pay_upon_invoice`.\n * @property {string} [paymentTypeCountryCode] The country code of the local payment. This value must be one of the supported country codes for a given local payment type listed {@link https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom/javascript/v3#render-local-payment-method-buttons|here}. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.\n * @property {string} email Payer email of the customer.\n * @property {string} givenName First name of the customer.\n * @property {string} surname Last name of the customer.\n * @property {string} phone Phone number of the customer.\n * @property {string} phoneCountryCode The country calling code.\n * @property {string} birthDate The birth date of the customer in `YYYY-MM-DD` format.\n * @property {object} address The shipping address.\n * @property {string} address.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} [address.extendedAddress] Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} address.locality Customer's city.\n * @property {string} [address.region] Customer's region or state.\n * @property {string} address.postalCode Customer's postal code.\n * @property {string} address.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {string} [shippingAmount] The shipping fee for all items. This value can not be a negative number.\n * @property {string} [discountAmount] The discount for all items. This value can not be a negative number.\n * @property {object} billingAddress The billing address.\n * @property {string} billingAddress.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} [billingAddress.extendedAddress] Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} billingAddress.locality Customer's city.\n * @property {string} [billingAddress.region] Customer's region or state.\n * @property {string} billingAddress.postalCode Customer's postal code.\n * @property {string} billingAddress.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {object[]} lineItems List of line items.\n * @property {string} lineItems.category The item category type: `'DIGITAL_GOODS'`, `'PHYSICAL_GOODS'`, or `'DONATION'`.\n * @property {string} lineItems.name Item name. Maximum 127 characters.\n * @property {string} lineItems.quantity Number of units of the item purchased. This value must be a whole number and can't be negative or zero.\n * @property {string} lineItems.unitAmount Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {string} lineItems.unitTaxAmount Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative.\n * @property {string} locale The BCP 47-formatted locale. PayPal supports a five-character code. For example, `en-DE`, `da-DK`, `he-IL`, `id-ID`, `ja-JP`, `no-NO`, `pt-BR`, `ru-RU`, `sv-SE`, `th-TH`, `zh-CN`, `zh-HK`, or `zh-TW`.\n * @property {string} customerServiceInstructions Instructions for how to contact the merchant's customer service. Maximum 4,000 characters.\n * @property {string} correlationId Used to correlate user sessions with server transactions.\n * @property {function} onPaymentStart A function that will be called with an object containing the `paymentId`. The `continueCallback` is not provided as it is not needed for this use case.\n */\n\n/**\n * Options used for the seamless/oneclick BLIK local payment type.\n * @typedef {object} LocalPayment~StartPaymentOptions\n * @property {string} amount The amount to authorize for the transaction.\n * @property {string} currencyCode The currency to process the payment (three-character ISO-4217).\n * @property {string} [displayName] The merchant name displayed inside of the window that is opened when starting the payment.\n * @property {string} paymentType The type of local payment. Must be `blik`.\n * @property {string} paymentTypeCountryCode The country code of the local payment. This value must be one of the supported country codes for a given local payment type listed {@link https://developer.paypal.com/braintree/docs/guides/local-payment-methods/client-side-custom/javascript/v3#render-local-payment-method-buttons|here}. For local payments supported in multiple countries, this value may determine which banks are presented to the customer.\n * @property {string} email Payer email of the customer.\n * @property {string} givenName First name of the customer.\n * @property {string} surname Last name of the customer.\n * @property {string} phone Phone number of the customer.\n * @property {boolean} shippingAddressRequired Indicates whether or not the payment needs to be shipped. For digital goods, this should be false. Defaults to false.\n * @property {object} address The shipping address.\n * @property {string} address.streetAddress Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @property {string} address.extendedAddress Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @property {string} address.locality Customer's city.\n * @property {string} address.region Customer's region or state.\n * @property {string} address.postalCode Customer's postal code.\n * @property {string} address.countryCode Customer's country code (two-character ISO 3166-1 code).\n * @property {object} blikOptions Blik seamless/oneclick specific options. Should contain only one object: `level_0` or `oneClick`.\n * @property {object} blikOptions.level_0 Blik seamless specific options.\n * @property {string} blikOptions.level_0.authCode 6-digit code used to authenticate a consumer within BLIK.\n * @property {object} blikOptions.oneClick Blik oneclick specific options.\n * @property {string} blikOptions.oneClick.authCode 6-digit code used to authenticate a consumer within BLIK.\n * @property {string} blikOptions.oneClick.consumerReference The merchant generated, unique reference serving as a primary identifier for accounts connected between Blik and a merchant.\n * @property {string} blikOptions.oneClick.aliasLabel A bank defined identifier used as a display name to allow the payer to differentiate between multiple registered bank accounts.\n * @property {string} blikOptions.oneClick.aliasKey A Blik-defined identifier for a specific Blik-enabled bank account that is associated with a given merchant. Used only in conjunction with a Consumer Reference.\n * @property {function} onPaymentStart A function that will be called with an object containing the `paymentId`. The `continueCallback` is not provided as it is not needed for this use case.\n */\n\n/**\n * Launches the local payment flow and returns a nonce payload. Only one local payment flow should be active at a time. One way to achieve this is to disable your local payment button while the flow is open.\n * @public\n * @function\n * @param {LocalPayment~StartPaymentOptions|LocalPayment~StartPaymentPayUponInvoiceOptions} options Options for initiating the local payment payment flow.\n * @param {callback} callback The second argument, <code>data</code>, is a {@link LocalPayment~startPaymentPayload|startPaymentPayload}. If no callback is provided, the method will return a Promise that resolves with a {@link LocalPayment~startPaymentPayload|startPaymentPayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * localPaymentInstance.startPayment({\n * paymentType: 'ideal',\n * paymentTypeCountryCode: 'NL',\n * fallback: {\n * buttonText: 'Return to Merchant',\n * url: 'https://example.com/my-checkout-page'\n * },\n * amount: '10.00',\n * currencyCode: 'EUR',\n * givenName: 'Joe',\n * surname: 'Doe',\n * address: {\n * countryCode: 'NL'\n * },\n * onPaymentStart: function (data, continueCallback) {\n * // Do any preprocessing before starting the flow\n * // data.paymentId is the ID of the localPayment\n * continueCallback();\n * }\n * }).then(function (payload) {\n * // Submit payload.nonce to your server\n * }).catch(function (startPaymentError) {\n * // Handle flow errors or premature flow closure\n * console.error('Error!', startPaymentError);\n * });\n * @example <caption>Pay Upon Invoice</caption>\n * localPaymentInstance.startPayment({\n * paymentType: 'pay_upon_invoice',\n * amount: '100.00',\n * currencyCode: 'EUR',\n * givenName: 'Max',\n * surname: 'Mustermann',\n * address: { // This is used as the shipping address.\n * streetAddress: 'Taunusanlage 12',\n * locality: 'Frankfurt',\n * postalCode: '60325',\n * countryCode: 'DE',\n * },\n * billingAddress: {\n * streetAddress: 'Schönhauser Allee 84',\n * locality: 'Berlin',\n * postalCode: '10439',\n * countryCode: 'DE'\n * },\n * birthDate: '1990-01-01',\n * email: 'buyer@example.com',\n * locale: 'en-DE',\n * customerServiceInstructions: 'Customer service phone is +49 6912345678.',\n * lineItems: [{\n * category: 'PHYSICAL_GOODS',\n * name: 'Basketball Shoes',\n * quantity: '1',\n * unitAmount: '81.00',\n * unitTaxAmount: '19.00',\n * }],\n * phone: '6912345678',\n * phoneCountryCode: '49',\n * correlationId: correlationId,\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n * @example <caption>BLIK seamless</caption>\n * localPaymentInstance.startPayment({\n * paymentType: 'blik',\n * paymentTypeCountryCode: 'PL',\n * amount: '10.00',\n * currencyCode: 'PLN',\n * givenName: 'Joe',\n * surname: 'Doe',\n * phone: '1234566789',\n * address: {\n * streetAddress: 'Mokotowska 1234',\n * locality: 'Warsaw',\n * postalCode: '02-697',\n * countryCode: 'PL',\n * },\n * blikOptions: {\n * level_0: {\n * authCode: \"123456\",\n * },\n * },\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n * @example <caption>BLIK oneclick first payment</caption>\n * localPaymentInstance.startPayment({\n * paymentType: 'blik',\n * paymentTypeCountryCode: 'PL',\n * amount: '10.00',\n * currencyCode: 'PLN',\n * givenName: 'Joe',\n * surname: 'Doe',\n * phone: '1234566789',\n * address: {\n * streetAddress: 'Mokotowska 1234',\n * locality: 'Warsaw',\n * postalCode: '02-697',\n * countryCode: 'PL',\n * },\n * blikOptions: {\n * oneClick: {\n * authCode: \"123456\",\n * consumerReference: \"ABCde123\",\n * aliasLabel: \"my uniq alias\",\n * },\n * },\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n * @example <caption>BLIK oneclick subsequent payment</caption>\n * localPaymentInstance.startPayment({\n * paymentType: 'blik',\n * paymentTypeCountryCode: 'PL',\n * amount: '10.00',\n * currencyCode: 'PLN',\n * givenName: 'Joe',\n * surname: 'Doe',\n * phone: '1234566789',\n * address: {\n * streetAddress: 'Mokotowska 1234',\n * locality: 'Warsaw',\n * postalCode: '02-697',\n * countryCode: 'PL',\n * },\n * blikOptions: {\n * oneClick: {\n * consumerReference: \"ABCde123\",\n * aliasKey: \"123456789\",\n * },\n * },\n * onPaymentStart: function (data) {\n * // NOTE: It is critical here to store data.paymentId on your server\n * // so it can be mapped to a webhook sent by Braintree once the\n * // buyer completes their payment.\n * console.log('Payment ID:', data.paymentId);\n * },\n * }).catch(function (err) {\n * // Handle any error calling startPayment.\n * console.error(err);\n * });\n */\nLocalPayment.prototype.startPayment = function (options) {\n var missingOption,\n missingError,\n address,\n fallback,\n params,\n promise,\n billingAddress,\n windowOptions,\n onPaymentStartPromise;\n var self = this; // eslint-disable-line no-invalid-this\n var serviceId = this._frameService._serviceId; // eslint-disable-line no-invalid-this\n\n // In order to provide the merchant with appropriate error messaging,\n // more robust validation is being done on the client-side, since some\n // option names are mapped to legacy names for the sake of the API.\n // For example, if `billingAddress.streetAddress` was missing, then\n // the API error response would say that `billing_address.line1` was\n // missing. This client-side validation will correctly tell the\n // merchant that `billingAddress.streetAddress` was missing.\n missingOption = hasMissingOption(options);\n if (missingOption) {\n missingError = new BraintreeError(\n errors.LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION\n );\n if (typeof missingOption === \"string\") {\n missingError.details = \"Missing required '\" + missingOption + \"' option.\";\n }\n\n return Promise.reject(missingError);\n }\n windowOptions = options.windowOptions || {};\n address = options.address || {};\n fallback = options.fallback || {};\n billingAddress = options.billingAddress || {};\n params = {\n amount: options.amount,\n bic: options.bic,\n billingAddress: {\n line1: billingAddress.streetAddress,\n line2: billingAddress.extendedAddress,\n city: billingAddress.locality,\n state: billingAddress.region,\n postalCode: billingAddress.postalCode,\n countryCode: billingAddress.countryCode,\n },\n birthDate: options.birthDate,\n blikOptions: options.blikOptions,\n cancelUrl: querystring.queryify(\n self._assetsUrl +\n \"/html/local-payment-redirect-frame\" +\n useMin(self._isDebug) +\n \".html\",\n {\n channel: serviceId,\n r: fallback.cancelUrl || fallback.url,\n t: fallback.cancelButtonText || fallback.buttonText,\n c: 1, // indicating we went through the cancel flow\n }\n ),\n city: address.locality,\n correlationId: options.correlationId,\n countryCode: address.countryCode,\n currencyIsoCode: options.currencyCode,\n discountAmount: options.discountAmount,\n experienceProfile: {\n brandName: options.displayName,\n customerServiceInstructions: options.customerServiceInstructions,\n locale: options.locale,\n noShipping: !options.shippingAddressRequired,\n },\n firstName: options.givenName,\n fundingSource: options.paymentType,\n intent: \"sale\",\n lastName: options.surname,\n line1: address.streetAddress,\n line2: address.extendedAddress,\n lineItems: options.lineItems,\n merchantAccountId: self._merchantAccountId,\n merchantOrPartnerCustomerId: options.customerId,\n payerEmail: options.email,\n paymentTypeCountryCode: options.paymentTypeCountryCode,\n phone: options.phone,\n phoneCountryCode: options.phoneCountryCode,\n postalCode: address.postalCode,\n recurrent: options.recurrent,\n returnUrl: querystring.queryify(\n self._assetsUrl +\n \"/html/local-payment-redirect-frame\" +\n useMin(self._isDebug) +\n \".html\",\n {\n channel: serviceId,\n r: fallback.url,\n t: fallback.buttonText,\n }\n ),\n shippingAmount: options.shippingAmount,\n state: address.region,\n };\n\n self._paymentType = options.paymentType.toLowerCase();\n if (self._authorizationInProgress) {\n analytics.sendEvent(\n self._client,\n self._paymentType + \".local-payment.start-payment.error.already-opened\"\n );\n\n return Promise.reject(\n new BraintreeError(errors.LOCAL_PAYMENT_ALREADY_IN_PROGRESS)\n );\n }\n\n self._authorizationInProgress = true;\n\n promise = new ExtendedPromise();\n\n // For deferred payment types, the popup window should not be opened,\n // since the actual payment will be done outside of this session.\n if (!isDeferredPaymentTypeOptions(options)) {\n self._startPaymentCallback = self._createStartPaymentCallback(\n function (val) {\n promise.resolve(val);\n },\n function (err) {\n promise.reject(err);\n }\n );\n\n self._frameService.open(\n {\n width: windowOptions.width || DEFAULT_WINDOW_WIDTH,\n height: windowOptions.height || DEFAULT_WINDOW_HEIGHT,\n },\n self._startPaymentCallback\n );\n }\n\n self._client\n .request({\n method: \"post\",\n endpoint: \"local_payments/create\",\n data: params,\n })\n .then(function (response) {\n var redirectUrl = response.paymentResource.redirectUrl;\n\n analytics.sendEvent(\n self._client,\n self._paymentType + \".local-payment.start-payment.opened\"\n );\n self._startPaymentOptions = options;\n\n if (isDeferredPaymentTypeOptions(options)) {\n self._authorizationInProgress = false;\n\n if (typeof redirectUrl === \"string\" && redirectUrl.length) {\n promise.reject(\n new BraintreeError(\n errors.LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED\n )\n );\n } else {\n onPaymentStartPromise = options.onPaymentStart({\n paymentId: response.paymentResource.paymentToken,\n });\n\n if (onPaymentStartPromise instanceof Promise) {\n onPaymentStartPromise.then(function () {\n promise.resolve();\n });\n } else {\n promise.resolve();\n }\n }\n } else {\n options.onPaymentStart(\n { paymentId: response.paymentResource.paymentToken },\n function () {\n self._frameService.redirect(response.paymentResource.redirectUrl);\n }\n );\n }\n })\n .catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n self._frameService.close();\n self._authorizationInProgress = false;\n\n if (status === 422) {\n promise.reject(\n new BraintreeError({\n type: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.type,\n code: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.code,\n message: errors.LOCAL_PAYMENT_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err,\n },\n })\n );\n\n return;\n }\n\n promise.reject(\n convertToBraintreeError(err, {\n type: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.type,\n code: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.code,\n message: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.message,\n })\n );\n });\n\n return promise;\n};\n\n/**\n * Manually tokenizes params for a local payment received from PayPal.When app switching back from a mobile application (such as a bank application for an iDEAL payment), the window may lose context with the parent page. In that case, a fallback url is used, and this method can be used to finish the flow.\n * @public\n * @function\n * @param {object} [params] All options for tokenizing local payment parameters. If no params are passed in, the params will be pulled off of the query string of the page.\n * @param {string} params.btLpToken The token representing the local payment. Aliased to `token` if `btLpToken` is not present.\n * @param {string} params.btLpPaymentId The payment id for the local payment. Aliased to `paymentId` if `btLpPaymentId` is not present.\n * @param {string} params.btLpPayerId The payer id for the local payment. Aliased to `PayerID` if `btLpPayerId` is not present.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link LocalPayment~startPaymentPayload|startPaymentPayload}. If no callback is provided, the method will return a Promise that resolves with a {@link LocalPayment~startPaymentPayload|startPaymentPayload}.\n * @example\n * localPaymentInstance.tokenize().then(function (payload) {\n * // send payload.nonce to your server\n * }).catch(function (err) {\n * // handle tokenization error\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nLocalPayment.prototype.tokenize = function (params) {\n var self = this;\n var client = this._client;\n\n params = params || querystring.parse();\n\n // iOS Safari parses query params by adding the params inside an object called: queryItems\n if (params.queryItems) {\n params = params.queryItems;\n }\n\n if (params.c || params.wasCanceled) {\n return Promise.reject(\n new BraintreeError({\n type: errors.LOCAL_PAYMENT_CANCELED.type,\n code: errors.LOCAL_PAYMENT_CANCELED.code,\n message: errors.LOCAL_PAYMENT_CANCELED.message,\n details: {\n originalError: {\n errorcode: params.errorcode,\n token: params.btLpToken,\n },\n },\n })\n );\n } else if (params.errorcode) {\n return Promise.reject(\n new BraintreeError({\n type: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.type,\n code: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.code,\n message: errors.LOCAL_PAYMENT_START_PAYMENT_FAILED.message,\n details: {\n originalError: {\n errorcode: params.errorcode,\n token: params.btLpToken,\n },\n },\n })\n );\n }\n\n return client\n .request({\n endpoint: \"payment_methods/paypal_accounts\",\n method: \"post\",\n data: this._formatTokenizeData(params),\n })\n .then(function (response) {\n var payload = self._formatTokenizePayload(response);\n\n if (window.popupBridge) {\n analytics.sendEvent(\n client,\n self._paymentType + \".local-payment.tokenization.success-popupbridge\"\n );\n } else {\n analytics.sendEvent(\n client,\n self._paymentType + \".local-payment.tokenization.success\"\n );\n }\n\n return payload;\n })\n .catch(function (err) {\n analytics.sendEvent(\n client,\n self._paymentType + \".local-payment.tokenization.failed\"\n );\n\n return Promise.reject(\n convertToBraintreeError(err, {\n type: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.type,\n code: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.code,\n message: errors.LOCAL_PAYMENT_TOKENIZATION_FAILED.message,\n })\n );\n });\n};\n\n/**\n * Closes the LocalPayment window if it is open.\n * @public\n * @example\n * localPaymentInstance.closeWindow();\n * @returns {void}\n */\nLocalPayment.prototype.closeWindow = function () {\n if (this._authoriztionInProgress) {\n analytics.sendEvent(\n this._client,\n this._paymentType + \".local-payment.start-payment.closed.by-merchant\"\n );\n }\n this._frameService.close();\n};\n\n/**\n * Focuses the LocalPayment window if it is open.\n * @public\n * @example\n * localPaymentInstance.focusWindow();\n * @returns {void}\n */\nLocalPayment.prototype.focusWindow = function () {\n this._frameService.focus();\n};\n\nLocalPayment.prototype._createStartPaymentCallback = function (\n resolve,\n reject\n) {\n var self = this;\n var client = this._client;\n\n return function (err, params) {\n self._authorizationInProgress = false;\n if (err) {\n if (err.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n if (params && params.errorcode === \"processing_error\") {\n // something failed within the payment window (rather than when\n // tokenizing with Braintree)\n analytics.sendEvent(\n client,\n self._paymentType + \".local-payment.failed-in-window\"\n );\n reject(new BraintreeError(errors.LOCAL_PAYMENT_START_PAYMENT_FAILED));\n\n return;\n }\n\n // its possible to have a query param with errorcode=payment_error, which\n // indicates that the customer cancelled the flow from within the UI,\n // but as there's no meaningful difference to the merchant whether the\n // customer closes via the UI or by manually closing the window, we\n // don't differentiate these\n analytics.sendEvent(\n client,\n self._paymentType + \".local-payment.tokenization.closed.by-user\"\n );\n reject(new BraintreeError(errors.LOCAL_PAYMENT_WINDOW_CLOSED));\n } else if (\n err.code &&\n err.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1\n ) {\n reject(\n new BraintreeError({\n code: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.code,\n type: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.type,\n message: errors.LOCAL_PAYMENT_WINDOW_OPEN_FAILED.message,\n details: {\n originalError: err,\n },\n })\n );\n }\n } else if (params) {\n if (!window.popupBridge) {\n self._frameService.redirect(self._loadingFrameUrl);\n }\n\n self\n .tokenize(params)\n .then(resolve)\n .catch(reject)\n .then(function () {\n self._frameService.close();\n });\n }\n };\n};\n\nLocalPayment.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type,\n };\n\n if (account.details) {\n if (account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n if (account.details.correlationId) {\n payload.correlationId = account.details.correlationId;\n }\n }\n\n return payload;\n};\n\n/**\n * Checks if required tokenization parameters are available in querystring for manual tokenization requests.\n * @public\n * @function\n * @example\n * // if query string contains\n * // ?btLpToken=token&btLpPaymentId=payment-id&btLpPayerId=payer-id\n * localPaymentInstance.hasTokenizationParams(); // true\n *\n * // if query string is missing required params\n * localPaymentInstance.hasTokenizationParams(); // false\n *\n * if (localPaymentInstance.hasTokenizationParams()) {\n * localPaymentInstance.tokenize();\n * }\n * @returns {Boolean} Returns a Boolean value for the state of the query string.\n */\nLocalPayment.prototype.hasTokenizationParams = function () {\n var params = querystring.parse();\n\n if (params.errorcode) {\n return true;\n }\n\n return Boolean(\n params.btLpToken && params.btLpPaymentId && params.btLpPayerId\n );\n};\n\nLocalPayment.prototype._formatTokenizeData = function (params) {\n var clientConfiguration = this._client.getConfiguration();\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var data = {\n merchantAccountId: this._merchantAccountId,\n paypalAccount: {\n correlationId: params.btLpToken || params.token,\n paymentToken: params.btLpPaymentId || params.paymentId,\n payerId: params.btLpPayerId || params.PayerID,\n unilateral: gatewayConfiguration.paypal.unvettedMerchant,\n intent: \"sale\",\n },\n };\n\n return data;\n};\n\n// Some payment types are deferred. Meaning, the actual payment will\n// occur at a later time outside of this session. For example, with\n// Pay Upon Invoice, the customer will later receive an email that will\n// be used to make the actual payment through RatePay. This function\n// will return `true` if the given options contain `paymentType` of\n// a deferred payment type; and/or some payments, like blik, may have\n// specific extra options to be treated as deferred. Otherwise, it\n// will return `false`.\nfunction isDeferredPaymentTypeOptions(options) {\n var blikOptions = options.blikOptions || {};\n var paymentType =\n typeof options.paymentType === \"string\"\n ? options.paymentType.toLowerCase()\n : options.paymentType;\n\n if (paymentType === \"pay_upon_invoice\") {\n return true;\n } else if (paymentType === \"blik\") {\n return (\n blikOptions.hasOwnProperty(\"level_0\") ||\n blikOptions.hasOwnProperty(\"oneClick\")\n );\n }\n\n return false;\n}\n\nfunction hasMissingAddressOption(options) {\n var i, option;\n\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_ADDRESS.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_ADDRESS[i];\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n }\n\n return false;\n}\n\nfunction hasMissingLineItemsOption(items) {\n var i, j, item, option;\n\n for (j = 0; j < items.length; j++) {\n item = items[j];\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_LINE_ITEMS.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_LINE_ITEMS[i];\n if (!item.hasOwnProperty(option)) {\n return option;\n }\n }\n }\n\n return false;\n}\n\nfunction hasMissingBlikOptions(options) {\n var i, option, oneClick;\n var blikOptions = options.blikOptions || {};\n\n for (\n i = 0;\n i < constants.REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE.length;\n i++\n ) {\n option = constants.REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE[i];\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n }\n\n if (blikOptions.hasOwnProperty(\"level_0\")) {\n for (\n i = 0;\n i < constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0.length;\n i++\n ) {\n option = constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0[i];\n\n // eslint-disable-next-line camelcase\n if (!blikOptions.level_0.hasOwnProperty(option)) {\n return \"blikOptions.level_0.\" + option;\n }\n }\n } else if (blikOptions.hasOwnProperty(\"oneClick\")) {\n oneClick = blikOptions.oneClick || {};\n\n if (oneClick.hasOwnProperty(\"aliasKey\")) {\n for (\n i = 0;\n i <\n constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT.length;\n i++\n ) {\n option =\n constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT[i];\n\n if (!oneClick.hasOwnProperty(option)) {\n return \"blikOptions.oneClick.\" + option;\n }\n }\n } else {\n for (\n i = 0;\n i < constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST.length;\n i++\n ) {\n option = constants.REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST[i];\n\n if (!oneClick.hasOwnProperty(option)) {\n return \"blikOptions.oneClick.\" + option;\n }\n }\n }\n }\n\n return false;\n}\n\n// This will return the name of the first missing required option that\n// is found or `true` if `options` itself is not defined. Otherwise, it\n// will return `false`.\nfunction hasMissingOption(options) {\n var i, option, missingAddressOption, missingLineItemOption, paymentType;\n\n if (!options) {\n return true;\n }\n\n if (isDeferredPaymentTypeOptions(options)) {\n paymentType = options.paymentType || \"\";\n\n if (paymentType.toLowerCase() === \"pay_upon_invoice\") {\n for (\n i = 0;\n i < constants.REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE.length;\n i++\n ) {\n option =\n constants.REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE[i];\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n if (option === \"address\" || option === \"billingAddress\") {\n missingAddressOption = hasMissingAddressOption(options[option]);\n if (missingAddressOption) {\n return option + \".\" + missingAddressOption;\n }\n } else if (option === \"lineItems\") {\n missingLineItemOption = hasMissingLineItemsOption(options[option]);\n if (missingLineItemOption) {\n return option + \".\" + missingLineItemOption;\n }\n }\n }\n } else if (paymentType.toLowerCase() === \"blik\") {\n return hasMissingBlikOptions(options);\n }\n } else {\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_START_PAYMENT.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_START_PAYMENT[i];\n\n if (!options.hasOwnProperty(option)) {\n return option;\n }\n }\n\n if (!options.fallback.url) {\n return \"fallback.url\";\n }\n if (!options.fallback.buttonText) {\n return \"fallback.buttonText\";\n }\n if (options.recurrent === true && !options.customerId) {\n return \"customerId\";\n }\n }\n\n return false;\n}\n\n/**\n * Cleanly remove anything set up by {@link module:braintree-web/local-payment.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * localPaymentInstance.teardown();\n * @example <caption>With callback</caption>\n * localPaymentInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nLocalPayment.prototype.teardown = function () {\n var self = this; // eslint-disable-line no-invalid-this\n\n self._frameService.teardown();\n\n convertMethodsToError(self, methods(LocalPayment.prototype));\n\n analytics.sendEvent(self._client, \"local-payment.teardown-completed\");\n\n return Promise.resolve();\n};\n\nmodule.exports = wrapPromise.wrapPrototype(LocalPayment);\n\n},{\"../../lib/analytics\":119,\"../../lib/braintree-error\":124,\"../../lib/constants\":126,\"../../lib/convert-methods-to-error\":127,\"../../lib/convert-to-braintree-error\":128,\"../../lib/frame-service/external\":139,\"../../lib/methods\":155,\"../../lib/querystring\":157,\"../../lib/use-min\":160,\"../shared/errors\":165,\"./constants\":162,\"@braintree/extended-promise\":34,\"@braintree/wrap-promise\":43}],164:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/local-payment\n * @description A component to integrate with local payment methods. *This component is currently in beta and is subject to change.*\n */\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar LocalPayment = _dereq_(\"./external/local-payment\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar errors = _dereq_(\"./shared/errors\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {string} [options.merchantAccountId] A non-default merchant account ID to use for tokenization and creation of the authorizing transaction. Braintree strongly recommends specifying this parameter.\n * @param {callback} callback The second argument, `data`, is the {@link LocalPayment} instance.\n * @example <caption>Using the local payment component to set up an iDEAL button</caption>\n * var idealButton = document.querySelector('.ideal-button');\n *\n * braintree.client.create({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (clientErr, clientInstance) {\n * if (clientErr) {\n * console.error('Error creating client:', clientErr);\n * return;\n * }\n *\n * braintree.localPayment.create({\n * client: clientInstance,\n * merchantAccountId: 'merchantAccountEUR',\n * }, function (localPaymentErr, localPaymentInstance) {\n * if (localPaymentErr) {\n * console.error('Error creating local payment component:', localPaymentErr);\n * return;\n * }\n *\n * idealButton.removeAttribute('disabled');\n *\n * // When the button is clicked, attempt to start the payment flow.\n * idealButton.addEventListener('click', function (event) {\n * // Because this opens a popup, this has to be called as a result of\n * // customer action, like clicking a button. You cannot call this at any time.\n * localPaymentInstance.startPayment({\n * paymentType: 'ideal',\n * amount: '10.67',\n * city: 'Den Haag',\n * countryCode: 'NL',\n * firstName: 'Test',\n * lastName: 'McTester',\n * line1: '123 of 456 Fake Lane',\n * line2: 'Apartment 789',\n * payerEmail: 'payer@example.com',\n * phone: '123456789',\n * postalCode: '1234 AA',\n * currencyCode: 'EUR',\n * onPaymentStart: function (data, continueCallback) {\n * // Do any preprocessing to store the ID and setup webhook\n * // Call start to initiate the popup\n * continueCallback();\n * }\n ** }, function (startPaymentErr, payload) {\n * if (startPaymentErr) {\n * if (startPaymentErr.type !== 'CUSTOMER') {\n * console.error('Error starting payment:', startPaymentErr);\n * }\n * return;\n * }\n *\n * idealButton.setAttribute('disabled', true);\n *\n * console.log(payload.paymentId);\n * });\n * }, false);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"Local Payment\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n var localPaymentInstance;\n var config = client.getConfiguration();\n\n options.client = client;\n\n if (config.gatewayConfiguration.paypalEnabled !== true) {\n return Promise.reject(\n new BraintreeError(errors.LOCAL_PAYMENT_NOT_ENABLED)\n );\n }\n\n analytics.sendEvent(client, \"local-payment.initialized\");\n\n localPaymentInstance = new LocalPayment(options);\n\n return localPaymentInstance._initialize();\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./external/local-payment\":163,\"./shared/errors\":165,\"@braintree/wrap-promise\":43}],165:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.LocalPayment - Creation Error Codes\n * @description Errors that occur when [creating the Local Payment component](./module-braintree-web_local-payment.html#.create).\n * @property {MERCHANT} LOCAL_PAYMENT_NOT_ENABLED Occurs when Local Payment is not enabled on the Braintree control panel.\n */\n\n/**\n * @name BraintreeError.LocalPayment - startPayment Error Codes\n * @description Errors that occur when using the [`startPayment` method](./LocalPayment.html#startPayment).\n * @property {MERCHANT} LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION Occurs when a startPayment is missing a required option.\n * @property {MERCHANT} LOCAL_PAYMENT_ALREADY_IN_PROGRESS Occurs when a startPayment call is already in progress.\n * @property {MERCHANT} LOCAL_PAYMENT_INVALID_PAYMENT_OPTION Occurs when a startPayment call has an invalid option.\n * @property {NETWORK} LOCAL_PAYMENT_START_PAYMENT_FAILED Occurs when a startPayment call fails.\n * @property {NETWORK} LOCAL_PAYMENT_TOKENIZATION_FAILED Occurs when a startPayment call fails to tokenize the result from authorization.\n * @property {CUSTOMER} LOCAL_PAYMENT_CANCELED Occurs when the customer cancels the Local Payment.\n * @property {CUSTOMER} LOCAL_PAYMENT_WINDOW_CLOSED Occurs when the customer closes the Local Payment window.\n * @property {MERCHANT} LOCAL_PAYMENT_WINDOW_OPEN_FAILED Occurs when the Local Payment window fails to open. Usually because `startPayment` was not called as a direct result of a user action.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n LOCAL_PAYMENT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_NOT_ENABLED\",\n message: \"LocalPayment is not enabled for this merchant.\",\n },\n LOCAL_PAYMENT_ALREADY_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_ALREADY_IN_PROGRESS\",\n message: \"LocalPayment payment is already in progress.\",\n },\n LOCAL_PAYMENT_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"LOCAL_PAYMENT_CANCELED\",\n message: \"Customer canceled the LocalPayment before authorizing.\",\n },\n LOCAL_PAYMENT_WINDOW_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"LOCAL_PAYMENT_WINDOW_CLOSED\",\n message: \"Customer closed LocalPayment window before authorizing.\",\n },\n LOCAL_PAYMENT_WINDOW_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_WINDOW_OPEN_FAILED\",\n message:\n \"LocalPayment window failed to open; make sure startPayment was called in response to a user action.\",\n },\n LOCAL_PAYMENT_START_PAYMENT_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"LOCAL_PAYMENT_START_PAYMENT_FAILED\",\n message: \"LocalPayment startPayment failed.\",\n },\n LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option for startPayment.\",\n },\n LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED\",\n message: \"LocalPayment startPayment deferred payment failed.\",\n },\n LOCAL_PAYMENT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"LOCAL_PAYMENT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's local payment method.\",\n },\n LOCAL_PAYMENT_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"LOCAL_PAYMENT_INVALID_PAYMENT_OPTION\",\n message: \"Local payment options are invalid.\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],166:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar frameService = _dereq_(\"../../lib/frame-service/external\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar errors = _dereq_(\"../shared/errors\");\nvar VERSION = \"3.100.0\";\nvar methods = _dereq_(\"../../lib/methods\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\nvar convertToBraintreeError = _dereq_(\"../../lib/convert-to-braintree-error\");\nvar constants = _dereq_(\"../shared/constants\");\n\nvar INTEGRATION_TIMEOUT_MS =\n _dereq_(\"../../lib/constants\").INTEGRATION_TIMEOUT_MS;\n\n/**\n * Masterpass Address object.\n * @typedef {object} Masterpass~Address\n * @property {string} countryCodeAlpha2 The customer's country code.\n * @property {string} extendedAddress The customer's extended address.\n * @property {string} locality The customer's locality.\n * @property {string} postalCode The customer's postal code.\n * @property {string} region The customer's region.\n * @property {string} streetAddress The customer's street address.\n */\n\n/**\n * @typedef {object} Masterpass~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} description The human readable description.\n * @property {string} type The payment method type, always `MasterpassCard`.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {object} contact The customer's contact information.\n * @property {string} contact.firstName The customer's first name.\n * @property {string} contact.lastName The customer's last name.\n * @property {string} contact.phoneNumber The customer's phone number.\n * @property {string} contact.emailAddress The customer's email address.\n * @property {Masterpass~Address} billingAddress The customer's billing address.\n * @property {Masterpass~Address} shippingAddress The customer's shipping address.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n/**\n * @class\n * @param {object} options see {@link module:braintree-web/masterpass.create|masterpass.create}\n * @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/masterpass.create|braintree.masterpass.create} instead.</strong>\n * @classdesc This class represents an Masterpass component. Instances of this class have methods for launching a new window to process a transaction with Masterpass.\n */\nfunction Masterpass(options) {\n var configuration = options.client.getConfiguration();\n\n this._client = options.client;\n this._assetsUrl =\n configuration.gatewayConfiguration.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = configuration.isDebug;\n this._authInProgress = false;\n if (\n window.popupBridge &&\n typeof window.popupBridge.getReturnUrlPrefix === \"function\"\n ) {\n this._callbackUrl = window.popupBridge.getReturnUrlPrefix() + \"return\";\n } else {\n this._callbackUrl =\n this._assetsUrl +\n \"/html/redirect-frame\" +\n (this._isDebug ? \"\" : \".min\") +\n \".html\";\n }\n}\n\nMasterpass.prototype._initialize = function () {\n var self = this;\n\n return new Promise(function (resolve) {\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(self._client, \"masterpass.load.timed-out\");\n }, INTEGRATION_TIMEOUT_MS);\n\n frameService.create(\n {\n name: constants.LANDING_FRAME_NAME,\n height: constants.POPUP_HEIGHT,\n width: constants.POPUP_WIDTH,\n dispatchFrameUrl:\n self._assetsUrl +\n \"/html/dispatch-frame\" +\n (self._isDebug ? \"\" : \".min\") +\n \".html\",\n openFrameUrl:\n self._assetsUrl +\n \"/html/masterpass-landing-frame\" +\n (self._isDebug ? \"\" : \".min\") +\n \".html\",\n },\n function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(self._client, \"masterpass.load.succeeded\");\n resolve(self);\n }\n );\n });\n};\n\n/**\n * Launches the Masterpass flow and returns a nonce payload. Only one Masterpass flow should be active at a time. One way to achieve this is to disable your Masterpass button while the flow is open.\n *\n * Braintree will apply these properties in `options.config`. Merchants should not override these values, except for advanced usage.\n * - `environment`\n * - `requestToken`\n * - `callbackUrl`\n * - `merchantCheckoutId`\n * - `allowedCardTypes`\n * - `version`\n *\n * @public\n * @param {object} options All options for initiating the Masterpass payment flow.\n * @param {string} options.currencyCode The currency code to process the payment.\n * @param {string} options.subtotal The amount to authorize for the transaction.\n * @param {object} [options.config] All configuration parameters accepted by Masterpass lightbox, except `function` data type. These options will override the values set by Braintree server. Please see {@link Masterpass Lightbox Parameters|https://developer.mastercard.com/page/masterpass-lightbox-parameters} for more information.\n * @param {object} [options.frameOptions] Used to configure the window that contains the Masterpass login.\n * @param {number} [options.frameOptions.width] Popup width to be used instead of default value (450px).\n * @param {number} [options.frameOptions.height] Popup height to be used instead of default value (660px).\n * @param {number} [options.frameOptions.top] The top position of the popup window to be used instead of default value, that is calculated based on provided height, and parent window size.\n * @param {number} [options.frameOptions.left] The left position to the popup window to be used instead of default value, that is calculated based on provided width, and parent window size.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link Masterpass~tokenizePayload|tokenizePayload}. If no callback is provided, the method will return a Promise that resolves with a {@link Masterpass~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because tokenize opens a new window, this must be called\n * // as a result of a user action, such as a button click.\n * masterpassInstance.tokenize({\n * currencyCode: 'USD',\n * subtotal: '10.00'\n * }).then(function (payload) {\n * button.removeAttribute('disabled');\n * // Submit payload.nonce to your server\n * }).catch(function (tokenizeError) {\n * button.removeAttribute('disabled');\n * // Handle flow errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'MASTERPASS_POPUP_CLOSED':\n * console.error('Customer closed Masterpass popup.');\n * break;\n * case 'MASTERPASS_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('Masterpass tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'MASTERPASS_FLOW_FAILED':\n * console.error('Unable to initialize Masterpass flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * });\n * });\n */\nMasterpass.prototype.tokenize = function (options) {\n var self = this;\n\n if (!options || hasMissingOption(options)) {\n return Promise.reject(\n new BraintreeError(errors.MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION)\n );\n }\n\n if (self._authInProgress) {\n return Promise.reject(\n new BraintreeError(errors.MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS)\n );\n }\n\n return new Promise(function (resolve, reject) {\n self._navigateFrameToLoadingPage(options).catch(reject);\n // This MUST happen after _navigateFrameToLoadingPage for Metro browsers to work.\n self._frameService.open(\n options.frameOptions,\n self._createFrameOpenHandler(resolve, reject)\n );\n });\n};\n\nMasterpass.prototype._navigateFrameToLoadingPage = function (options) {\n var self = this;\n\n this._authInProgress = true;\n\n return this._client\n .request({\n method: \"post\",\n endpoint: \"masterpass/request_token\",\n data: {\n requestToken: {\n originUrl: window.location.protocol + \"//\" + window.location.hostname,\n subtotal: options.subtotal,\n currencyCode: options.currencyCode,\n callbackUrl: this._callbackUrl,\n },\n },\n })\n .then(function (response) {\n var redirectUrl =\n self._assetsUrl +\n \"/html/masterpass-loading-frame\" +\n (self._isDebug ? \"\" : \".min\") +\n \".html?\";\n var gatewayConfiguration =\n self._client.getConfiguration().gatewayConfiguration;\n var config = options.config || {};\n var queryParams;\n\n queryParams = {\n environment: gatewayConfiguration.environment,\n requestToken: response.requestToken,\n callbackUrl: self._callbackUrl,\n merchantCheckoutId: gatewayConfiguration.masterpass.merchantCheckoutId,\n allowedCardTypes: gatewayConfiguration.masterpass.supportedNetworks,\n version: constants.MASTERPASS_VERSION,\n };\n\n Object.keys(config).forEach(function (key) {\n if (typeof config[key] !== \"function\") {\n queryParams[key] = config[key];\n }\n });\n\n redirectUrl += Object.keys(queryParams)\n .map(function (key) {\n return key + \"=\" + queryParams[key];\n })\n .join(\"&\");\n\n self._frameService.redirect(redirectUrl);\n })\n .catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n self._closeWindow();\n\n if (status === 422) {\n return Promise.reject(\n convertToBraintreeError(err, errors.MASTERPASS_INVALID_PAYMENT_OPTION)\n );\n }\n\n return Promise.reject(\n convertToBraintreeError(err, errors.MASTERPASS_FLOW_FAILED)\n );\n });\n};\n\nMasterpass.prototype._createFrameOpenHandler = function (resolve, reject) {\n var self = this;\n\n if (window.popupBridge) {\n return function (popupBridgeErr, payload) {\n self._authInProgress = false;\n\n if (popupBridgeErr) {\n analytics.sendEvent(\n self._client,\n \"masterpass.tokenization.closed-popupbridge.by-user\"\n );\n reject(\n convertToBraintreeError(\n popupBridgeErr,\n errors.MASTERPASS_POPUP_CLOSED\n )\n );\n\n return;\n } else if (!payload.queryItems) {\n analytics.sendEvent(\n self._client,\n \"masterpass.tokenization.failed-popupbridge\"\n );\n reject(new BraintreeError(errors.MASTERPASS_FLOW_FAILED));\n\n return;\n }\n\n self._tokenizeMasterpass(payload.queryItems).then(resolve).catch(reject);\n };\n }\n\n return function (frameServiceErr, payload) {\n if (frameServiceErr) {\n self._authInProgress = false;\n\n if (frameServiceErr.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n analytics.sendEvent(\n self._client,\n \"masterpass.tokenization.closed.by-user\"\n );\n reject(new BraintreeError(errors.MASTERPASS_POPUP_CLOSED));\n\n return;\n }\n\n if (\n frameServiceErr.code &&\n frameServiceErr.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1\n ) {\n analytics.sendEvent(\n self._client,\n \"masterpass.tokenization.failed.to-open\"\n );\n reject(\n new BraintreeError({\n code: errors.MASTERPASS_POPUP_OPEN_FAILED.code,\n type: errors.MASTERPASS_POPUP_OPEN_FAILED.type,\n message: errors.MASTERPASS_POPUP_OPEN_FAILED.message,\n details: {\n originalError: frameServiceErr,\n },\n })\n );\n\n return;\n }\n\n analytics.sendEvent(self._client, \"masterpass.tokenization.failed\");\n self._closeWindow();\n reject(\n convertToBraintreeError(frameServiceErr, errors.MASTERPASS_FLOW_FAILED)\n );\n\n return;\n }\n\n self._tokenizeMasterpass(payload).then(resolve).catch(reject);\n };\n};\n\nMasterpass.prototype._tokenizeMasterpass = function (payload) {\n var self = this;\n\n if (payload.mpstatus !== \"success\") {\n analytics.sendEvent(self._client, \"masterpass.tokenization.closed.by-user\");\n self._closeWindow();\n\n return Promise.reject(new BraintreeError(errors.MASTERPASS_POPUP_CLOSED));\n }\n\n if (isMissingRequiredPayload(payload)) {\n analytics.sendEvent(\n self._client,\n \"masterpass.tokenization.closed.missing-payload\"\n );\n self._closeWindow();\n\n return Promise.reject(\n new BraintreeError(errors.MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS)\n );\n }\n\n return self._client\n .request({\n endpoint: \"payment_methods/masterpass_cards\",\n method: \"post\",\n data: {\n masterpassCard: {\n checkoutResourceUrl: payload.checkout_resource_url,\n requestToken: payload.oauth_token,\n verifierToken: payload.oauth_verifier,\n },\n },\n })\n .then(function (response) {\n self._closeWindow();\n if (window.popupBridge) {\n analytics.sendEvent(\n self._client,\n \"masterpass.tokenization.success-popupbridge\"\n );\n } else {\n analytics.sendEvent(self._client, \"masterpass.tokenization.success\");\n }\n\n return response.masterpassCards[0];\n })\n .catch(function (tokenizeErr) {\n self._closeWindow();\n if (window.popupBridge) {\n analytics.sendEvent(\n self._client,\n \"masterpass.tokenization.failed-popupbridge\"\n );\n } else {\n analytics.sendEvent(self._client, \"masterpass.tokenization.failed\");\n }\n\n return Promise.reject(\n convertToBraintreeError(\n tokenizeErr,\n errors.MASTERPASS_ACCOUNT_TOKENIZATION_FAILED\n )\n );\n });\n};\n\nfunction isMissingRequiredPayload(payload) {\n return [\n payload.oauth_verifier,\n payload.oauth_token,\n payload.checkout_resource_url,\n ].some(function (element) {\n return element == null || element === \"null\";\n });\n}\n\nMasterpass.prototype._closeWindow = function () {\n this._authInProgress = false;\n this._frameService.close();\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/masterpass.create|create}.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is provided, `teardown` returns a promise.\n * @example\n * masterpassInstance.teardown();\n * @example <caption>With callback</caption>\n * masterpassInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nMasterpass.prototype.teardown = function () {\n var self = this;\n\n return new Promise(function (resolve) {\n self._frameService.teardown();\n\n convertMethodsToError(self, methods(Masterpass.prototype));\n\n analytics.sendEvent(self._client, \"masterpass.teardown-completed\");\n\n resolve();\n });\n};\n\nfunction hasMissingOption(options) {\n var i, option;\n\n for (i = 0; i < constants.REQUIRED_OPTIONS_FOR_TOKENIZE.length; i++) {\n option = constants.REQUIRED_OPTIONS_FOR_TOKENIZE[i];\n\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n\n return false;\n}\n\nmodule.exports = wrapPromise.wrapPrototype(Masterpass);\n\n},{\"../../lib/analytics\":119,\"../../lib/braintree-error\":124,\"../../lib/constants\":126,\"../../lib/convert-methods-to-error\":127,\"../../lib/convert-to-braintree-error\":128,\"../../lib/frame-service/external\":139,\"../../lib/methods\":155,\"../shared/constants\":169,\"../shared/errors\":170,\"@braintree/wrap-promise\":43}],167:[function(_dereq_,module,exports){\n\"use strict\";\n/** @module braintree-web/masterpass\n * @description Processes Masterpass. *This component is currently in beta and is subject to change.*\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar browserDetection = _dereq_(\"./shared/browser-detection\");\nvar Masterpass = _dereq_(\"./external/masterpass\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar VERSION = \"3.100.0\";\nvar errors = _dereq_(\"./shared/errors\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link Masterpass} instance. If no callback is passed in, the create function returns a promise that resolves the {@link Masterpass} instance.\n * @example\n * braintree.masterpass.create({\n * client: clientInstance\n * }, function (createErr, masterpassInstance) {\n * if (createErr) {\n * if (createErr.code === 'MASTERPASS_BROWSER_NOT_SUPPORTED') {\n * console.error('This browser is not supported.');\n * } else {\n * console.error('Error!', createErr);\n * }\n * return;\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"Masterpass\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n if (!isSupported()) {\n return Promise.reject(\n new BraintreeError(errors.MASTERPASS_BROWSER_NOT_SUPPORTED)\n );\n }\n\n return Promise.resolve();\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n var masterpassInstance, configuration;\n\n options.client = client;\n configuration = options.client.getConfiguration().gatewayConfiguration;\n\n if (!configuration.masterpass) {\n return Promise.reject(\n new BraintreeError(errors.MASTERPASS_NOT_ENABLED)\n );\n }\n\n masterpassInstance = new Masterpass(options);\n\n return masterpassInstance._initialize();\n });\n}\n\n/**\n * @static\n * @function isSupported\n * @description Returns true if Masterpass supports this browser.\n * @example\n * if (braintree.masterpass.isSupported()) {\n * // Add Masterpass button to the page\n * } else {\n * // Hide Masterpass payment option\n * }\n * @returns {Boolean} Returns true if Masterpass supports this browser.\n */\nfunction isSupported() {\n return Boolean(window.popupBridge || browserDetection.supportsPopups());\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./external/masterpass\":166,\"./shared/browser-detection\":168,\"./shared/errors\":170,\"@braintree/wrap-promise\":43}],168:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n supportsPopups: _dereq_(\"@braintree/browser-detection/supports-popups\"),\n};\n\n},{\"@braintree/browser-detection/supports-popups\":32}],169:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n LANDING_FRAME_NAME: \"braintreemasterpasslanding\",\n POPUP_WIDTH: 450,\n POPUP_HEIGHT: 660,\n MASTERPASS_VERSION: \"v6\",\n REQUIRED_OPTIONS_FOR_TOKENIZE: [\"subtotal\", \"currencyCode\"],\n};\n\n},{}],170:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Masterpass - Creation Error Codes\n * @description Errors that occur when [creating the Masterpass component](./module-braintree-web_masterpass#.create).\n * @property {CUSTOMER} MASTERPASS_BROWSER_NOT_SUPPORTED Occurs when browser is not a supported browser for Masterpass.\n * @property {MERCHANT} MASTERPASS_NOT_ENABLED Occurs when Masterpass is not enabled in the Braintree control panel.\n */\n\n/**\n * @name BraintreeError.Masterpass - Tokenize Error Codes\n * @description Errors that occur when [tokenizing](./Masterpass.html#tokenize).\n * @property {MERCHANT} MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION Occurs when tokenize is called without a required option.\n * @property {MERCHANT} MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS Occurs if tokenization flow is initialized while another flow is already in progress.\n * @property {NETWORK} MASTERPASS_ACCOUNT_TOKENIZATION_FAILED Occurs when tokenization of Masterpass details fails.\n * @property {MERCHANT} MASTERPASS_POPUP_OPEN_FAILED Occurs when the popup fails to open.\n * @property {MERCHANT} MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS Occurs when Masterpass is missing required parameters for tokenization.\n * @property {CUSTOMER} MASTERPASS_POPUP_CLOSED Occurs when the popup is closed by the customer.\n * @property {MERCHANT} MASTERPASS_INVALID_PAYMENT_OPTION Occurs when an invalid payment option is used to tokenize Masterpass.\n * @property {NETWORK} MASTERPASS_FLOW_FAILED Occurs when an error is returned from request to tokenize.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n MASTERPASS_BROWSER_NOT_SUPPORTED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"MASTERPASS_BROWSER_NOT_SUPPORTED\",\n message: \"Browser is not supported.\",\n },\n MASTERPASS_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_NOT_ENABLED\",\n message: \"Masterpass is not enabled for this merchant.\",\n },\n MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option for tokenize.\",\n },\n MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS\",\n message: \"Masterpass tokenization is already in progress.\",\n },\n MASTERPASS_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"MASTERPASS_ACCOUNT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's Masterpass account.\",\n },\n MASTERPASS_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_POPUP_OPEN_FAILED\",\n message:\n \"Masterpass popup failed to open. Make sure to tokenize in response to a user action, such as a click.\",\n },\n MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS\",\n message:\n \"Masterpass popup failed to return all required parameters needed to continue tokenization.\",\n },\n MASTERPASS_POPUP_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"MASTERPASS_POPUP_CLOSED\",\n message: \"Customer closed Masterpass popup before authorizing.\",\n },\n MASTERPASS_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"MASTERPASS_INVALID_PAYMENT_OPTION\",\n message: \"Masterpass payment options are invalid.\",\n },\n MASTERPASS_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"MASTERPASS_FLOW_FAILED\",\n message: \"Could not initialize Masterpass flow.\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],171:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar assign = _dereq_(\"../../lib/assign\").assign;\nvar Bus = _dereq_(\"framebus\");\nvar convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\nvar generateGooglePayConfiguration = _dereq_(\"../../lib/generate-google-pay-configuration\");\nvar iFramer = _dereq_(\"@braintree/iframer\");\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar useMin = _dereq_(\"../../lib/use-min\");\nvar methods = _dereq_(\"../../lib/methods\");\nvar EventEmitter = _dereq_(\"@braintree/event-emitter\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar VERSION = \"3.100.0\";\nvar constants = _dereq_(\"../shared/constants\");\nvar events = constants.events;\nvar errors = constants.errors;\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @typedef {object} PaymentRequestComponent~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional account details.\n * @property {string} details.bin The BIN number of the card..\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {object} details.rawPaymentResponse The raw payment response from the payment request, with sensitive card details removed.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, `CreditCard` or `AndroidPayCard`.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n/**\n * @typedef {object} PaymentRequestComponent~paymentRequestConfiguration\n * @property {object} configuration.details The payment details. For details on this object, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_payment_details).\n * @property {array} [configuration.supportedPaymentMethods] The supported payment methods. If not passed in, the supported payment methods from the merchant account that generated the authorization for the client will be used. For details on this array, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_supported_payment_methods).\n * @property {object} [configuration.options] Additional payment request options. For details on this object, see [Google's PaymentRequest API documentation](https://developers.google.com/web/fundamentals/discovery-and-monetization/payment-request/deep-dive-into-payment-request#defining_options_optional).\n */\n\n/**\n * @typedef {object} PaymentRequestComponent~shippingEventObject\n * @description The event payload sent from {@link PaymentRequestComponent#on|on}.\n * @property {object} target An object which contains data about the event.\n * @property {function} updateWith A method to call with the updated Payment Request details.\n */\n\n/**\n * @name PaymentRequestComponent#on\n * @function\n * @param {string} event The name of the event to which you are subscribing.\n * @param {function} handler A callback to handle the event.\n * @description Subscribes a handler function to a named event. `event` should be {@link PaymentRequestComponent#event:shippingAddressChange|shippingAddressChange} or {@link PaymentRequestComponent#event:shippingOptionChange|shippingOptionChange}. For convenience, you can also listen on `shippingaddresschange` or `shippingoptionchange` to match the event listeners in the [Payment Request API documentation](https://developers.google.com/web/fundamentals/payments/deep-dive-into-payment-request#shipping_in_payment_request_api). Events will emit a {@link PaymentRequestComponent~shippingEventObject|shippingEventObject}.\n * @example\n * <caption>Listening to a Payment Request event, in this case 'shippingAddressChange'</caption>\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * console.log(event.target.shippingAddress);\n * });\n * });\n * @returns {void}\n */\n\n/**\n * @name PaymentRequestComponent#off\n * @function\n * @param {string} event The name of the event to which you are unsubscribing.\n * @param {function} handler The callback for the event you are unsubscribing from.\n * @description Unsubscribes the handler function to a named event.\n * @example\n * <caption>Subscribing and then unsubscribing from a Payment Request event, in this case 'shippingAddressChange'</caption>\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * var callback = function (event) {\n * console.log(event.target.shippingAddress);\n * };\n * paymentRequestInstance.on('shippingAddressChange', callback);\n *\n * // later on\n * paymentRequestInstance.off('shippingAddressChange', callback);\n * });\n * @returns {void}\n */\n\n/**\n * This event is emitted when the customer selects a shipping address.\n * @event PaymentRequestComponent#shippingAddressChange\n * @type {PaymentRequestComponent~shippingEventObject}\n * @example\n * <caption>Listening to a shipping address change event</caption>\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * // validate event.target.shippingAddress if needed\n *\n * event.updateWith(paymentRequestDetails);\n * });\n * });\n */\n\n/**\n * This event is emitted when the customer selects a shipping option.\n * @event PaymentRequestComponent#shippingOptionChange\n * @type {PaymentRequestComponent~shippingEventObject}\n * @example\n * <caption>Listening to a shipping option change event</caption>\n * braintree.paymentRequest.create({ ... }, function (createErr, paymentRequestInstance) {\n * paymentRequestInstance.on('shippingOptionChange', function (event) {\n * // validate event.target.shippingOption if needed\n *\n * paymentRequestDetails.shippingOptions.forEach(function (option) {\n * option.selected = option.id === event.target.shippingOption;\n * });\n *\n * event.updateWith(paymentRequestDetails);\n * });\n * });\n */\n\nvar CARD_TYPE_MAPPINGS = {\n Visa: \"visa\",\n MasterCard: \"mastercard\",\n \"American Express\": \"amex\",\n \"Diners Club\": \"diners\",\n Discover: \"discover\",\n JCB: \"jcb\",\n UnionPay: \"unionpay\",\n Maestro: \"maestro\",\n};\n\nvar BRAINTREE_GOOGLE_PAY_MERCHANT_ID = \"18278000977346790994\";\n\nfunction composeUrl(assetsUrl, componentId, isDebug) {\n var baseUrl = assetsUrl;\n\n // endRemoveIf(production)\n\n return (\n baseUrl +\n \"/web/\" +\n VERSION +\n \"/html/payment-request-frame\" +\n useMin(isDebug) +\n \".html#\" +\n componentId\n );\n}\n\n/**\n * @class PaymentRequestComponent\n * @param {object} options The Payment Request Component {@link module:braintree-web/payment-request.create create} options.\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/payment-request.create|braintree-web.payment-request.create} instead.</strong>\n *\n * @classdesc This class represents a Payment Request component produced by {@link module:braintree-web/payment-request.create|braintree-web/payment-request.create}. Instances of this class have methods for initializing a Payment Request.\n *\n * **Note:** This component is currently in beta and the API may include breaking changes when upgrading. Please review the [Changelog](https://github.com/braintree/braintree-web/blob/main/CHANGELOG.md) for upgrade steps whenever you upgrade the version of braintree-web.\n */\nfunction PaymentRequestComponent(options) {\n var enabledPaymentMethods = options.enabledPaymentMethods || {};\n\n EventEmitter.call(this);\n\n this._componentId = uuid();\n this._client = options.client;\n this._enabledPaymentMethods = {\n basicCard: enabledPaymentMethods.basicCard !== false,\n googlePay: enabledPaymentMethods.googlePay !== false,\n };\n this._googlePayVersion = options.googlePayVersion === 2 ? 2 : 1;\n this._googleMerchantId = BRAINTREE_GOOGLE_PAY_MERCHANT_ID;\n this._supportedPaymentMethods =\n this._constructDefaultSupportedPaymentMethods();\n this._defaultSupportedPaymentMethods = Object.keys(\n this._supportedPaymentMethods\n ).map(\n function (key) {\n return this._supportedPaymentMethods[key];\n }.bind(this)\n );\n this._bus = new Bus({ channel: this._componentId });\n}\n\nEventEmitter.createChild(PaymentRequestComponent);\n\nPaymentRequestComponent.prototype._constructDefaultSupportedPaymentMethods =\n function () {\n var configuration = this._client.getConfiguration();\n var androidPayConfiguration = configuration.gatewayConfiguration.androidPay;\n var cardConfiguration = configuration.gatewayConfiguration.creditCards;\n var supportedPaymentMethods = {};\n\n if (\n this._enabledPaymentMethods.basicCard &&\n cardConfiguration &&\n cardConfiguration.supportedCardTypes.length > 0\n ) {\n supportedPaymentMethods.basicCard = {\n supportedMethods: \"basic-card\",\n data: {\n supportedNetworks: cardConfiguration.supportedCardTypes.reduce(\n function (types, cardType) {\n if (cardType in CARD_TYPE_MAPPINGS) {\n types.push(CARD_TYPE_MAPPINGS[cardType]);\n }\n\n return types;\n },\n []\n ),\n },\n };\n }\n\n if (\n this._enabledPaymentMethods.googlePay &&\n androidPayConfiguration &&\n androidPayConfiguration.enabled\n ) {\n supportedPaymentMethods.googlePay = {\n supportedMethods: \"https://google.com/pay\",\n data: generateGooglePayConfiguration(\n configuration,\n this._googlePayVersion,\n this._googleMerchantId\n ),\n };\n }\n\n return supportedPaymentMethods;\n };\n\nPaymentRequestComponent.prototype.initialize = function () {\n var clientConfiguration = this._client.getConfiguration();\n var self = this;\n\n this._frame = iFramer({\n allowPaymentRequest: true,\n name: \"braintree-payment-request-frame\",\n class: \"braintree-payment-request-frame\",\n height: 0,\n width: 0,\n style: {\n position: \"absolute\",\n left: \"-9999px\",\n },\n title: \"Secure Payment Frame\",\n });\n\n if (this._defaultSupportedPaymentMethods.length === 0) {\n return Promise.reject(\n new BraintreeError(\n errors.PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS\n )\n );\n }\n\n return new Promise(function (resolve) {\n self._bus.on(events.FRAME_READY, function (reply) {\n reply(self._client);\n });\n self._bus.on(events.FRAME_CAN_MAKE_REQUESTS, function () {\n analytics.sendEvent(self._client, \"payment-request.initialized\");\n self._bus.on(events.SHIPPING_ADDRESS_CHANGE, function (shippingAddress) {\n var shippingAddressChangeEvent = {\n target: {\n shippingAddress: shippingAddress,\n },\n updateWith: function (paymentDetails) {\n self._bus.emit(events.UPDATE_SHIPPING_ADDRESS, paymentDetails);\n },\n };\n\n self._emit(\"shippingAddressChange\", shippingAddressChangeEvent);\n self._emit(\"shippingaddresschange\", shippingAddressChangeEvent);\n });\n self._bus.on(events.SHIPPING_OPTION_CHANGE, function (shippingOption) {\n var shippingOptionChangeEvent = {\n target: {\n shippingOption: shippingOption,\n },\n updateWith: function (paymentDetails) {\n self._bus.emit(events.UPDATE_SHIPPING_OPTION, paymentDetails);\n },\n };\n\n self._emit(\"shippingOptionChange\", shippingOptionChangeEvent);\n self._emit(\"shippingoptionchange\", shippingOptionChangeEvent);\n });\n resolve(self);\n });\n\n // TODO - We may need to apply the same setTimeout hack that Hosted Fields\n // uses for iframes to load correctly in Edge. See:\n // https://github.com/braintree/braintree-web/blob/0c951e5f9859c606652485de14188b6bd6656677/src/hosted-fields/external/hosted-fields.js#L449-L469\n self._frame.src = composeUrl(\n clientConfiguration.gatewayConfiguration.assetsUrl,\n self._componentId,\n clientConfiguration.isDebug\n );\n document.body.appendChild(self._frame);\n });\n};\n\n/**\n * Create an object to pass into tokenize to specify a custom configuration. If no overrides are provided, the default configuration will be provided.\n * @public\n * @param {string} type The supported payment method type. Possible values are `basicCard` and `googlePay`.\n * If no type is provided, the function will throw an error. If the type provided is not an enabled payment method for the merchant account , the function will throw an error.\n * @param {object} [overrides] The configuration overrides for the [data property on the supported payment methods objects](https://developers.google.com/web/fundamentals/payments/deep-dive-into-payment-request). If not passed in, the default configuration for the specified type will be provided. If a property is not provided, the value from the default configuration will be used.\n * @example <caption>Getting the default configuration for a specified type</caption>\n * var configuration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard');\n *\n * configuration.supportedMethods; // 'basic-card'\n * configuration.data.supportedNetworks; // ['visa', 'mastercard', 'amex'] <- whatever the supported card networks for the merchant account are\n * @example <caption>Specifying overrides</caption>\n * var configuration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard', {\n * supportedNetworks: ['visa'],\n * supportedTypes: ['credit', 'debit']\n * });\n *\n * configuration.supportedMethods; // 'basic-card'\n * configuration.data.supportedNetworks; // ['visa']\n * configuration.data.supportedTypes; // ['credit', 'debit']\n * @returns {object} Returns a configuration object for use in the tokenize function.\n */\nPaymentRequestComponent.prototype.createSupportedPaymentMethodsConfiguration =\n function (type, overrides) {\n var configuration;\n\n if (!type) {\n throw new BraintreeError(\n errors.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE\n );\n }\n\n if (!this._enabledPaymentMethods[type]) {\n throw new BraintreeError(\n errors.PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED\n );\n }\n\n configuration = assign({}, this._supportedPaymentMethods[type]);\n configuration.data = assign({}, configuration.data, overrides);\n\n return configuration;\n };\n\n/**\n * Tokenizes a Payment Request\n * @public\n * @param {object} configuration A {@link PaymentRequestComponent~paymentRequestConfiguration|paymentRequestConfiguration}.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link PaymentRequest~paymentPayload|paymentPayload}. If no callback is provided, `tokenize` returns a function that resolves with a {@link PaymentRequestComponent~tokenizePayload|tokenizePayload}.\n * @example\n * paymentRequestInstance.tokenize({\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * }\n * }).then(function (payload) {\n * // send payload.nonce to server\n *\n * // examine the raw response (with card details removed for security) from the payment request\n * console.log(payload.details.rawPaymentResponse);\n * }).catch(function (err) {\n * if (err.code === 'PAYMENT_REQUEST_CANCELED') {\n * // payment request was canceled by user\n * } else {\n * // an error occurred while processing\n * }\n * });\n * @example <caption>Tokenize only Visa cards</caption>\n * var basicCardConfiguration = paymentRequestInstance.createSupportedPaymentMethodsConfiguration('basicCard', {\n * supportedNetworks: ['visa']\n * };\n *\n * paymentRequestInstance.tokenize({\n * supportedPaymentMethods: [basicCardConfiguration],\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * });\n * @example <caption>Include payment request options</caption>\n * paymentRequestInstance.tokenize({\n * details: {\n * total: {\n * label: 'Price',\n * amount: {\n * currency: 'USD',\n * value: '100.00'\n * }\n * }\n * },\n * options: {\n * requestPayerName: true,\n * requestPayerPhone: true,\n * requestPayerEmail: true\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * // collect additional info from the raw response\n * console.log(payload.details.rawPaymentResponse);\n * });\n * @example <caption>Request Shipping Information</caption>\n * var shippingOptions = [\n * {\n * id: 'economy',\n * label: 'Economy Shipping (5-7 Days)',\n * amount: {\n * currency: 'USD',\n * value: '0',\n * },\n * }, {\n * id: 'express',\n * label: 'Express Shipping (2-3 Days)',\n * amount: {\n * currency: 'USD',\n * value: '5',\n * },\n * }, {\n * id: 'next-day',\n * label: 'Next Day Delivery',\n * amount: {\n * currency: 'USD',\n * value: '12',\n * },\n * },\n * ];\n * var paymentDetails = {\n * \t total: {\n * label: 'Total',\n * amount: {\n * currency: 'USD',\n * value: '10.00',\n * }\n * },\n * shippingOptions: shippingOptions\n * };\n *\n * paymentRequestInstance.on('shippingAddressChange', function (event) {\n * // validate shipping address on event.target.shippingAddress\n * // make changes to the paymentDetails or shippingOptions if necessary\n *\n * event.updateWith(paymentDetails)\n * });\n *\n * paymentRequestInstance.on('shippingOptionChange', function (event) {\n * shippingOptions.forEach(function (option) {\n * option.selected = option.id === event.target.shippingOption;\n * });\n *\n * event.updateWith(paymentDetails)\n * });\n *\n * paymentRequestInstance.tokenize({\n * details: paymentDetails,\n * options: {\n * requestShipping: true\n * }\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * // collect shipping information from payload\n * console.log(payload.details.rawPaymentResponse.shippingAddress);\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPaymentRequestComponent.prototype.tokenize = function (configuration) {\n var self = this;\n\n // NEXT_MAJOR_VERSION fail early if a payment method is passed in\n // that the component does not support\n return new Promise(function (resolve, reject) {\n self._bus.emit(\n events.PAYMENT_REQUEST_INITIALIZED,\n {\n supportedPaymentMethods:\n configuration.supportedPaymentMethods ||\n self._defaultSupportedPaymentMethods,\n details: configuration.details,\n options: configuration.options,\n },\n function (response) {\n var rawError = response[0];\n var payload = response[1];\n\n if (rawError) {\n reject(self._formatTokenizationError(rawError));\n\n return;\n }\n\n analytics.sendEvent(self._client, \"payment-request.tokenize.succeeded\");\n resolve({\n nonce: payload.nonce,\n type: payload.type,\n description: payload.description,\n details: {\n rawPaymentResponse: payload.details.rawPaymentResponse,\n cardType: payload.details.cardType,\n lastFour: payload.details.lastFour,\n lastTwo: payload.details.lastTwo,\n },\n binData: payload.binData,\n });\n }\n );\n });\n};\n\n/**\n * Check if the customer can make payments.\n * @public\n * @param {object} configuration A {@link PaymentRequestComponent~paymentRequestConfiguration|paymentRequestConfiguration}.\n * @param {callback} [callback] Called on completion.\n * @example\n * var paymentDetails = {\n * \t total: {\n * label: 'Total',\n * amount: {\n * currency: 'USD',\n * value: '10.00',\n * }\n * }\n * };\n *\n * paymentRequestInstance.canMakePayment({\n * details: paymentDetails\n * }).then(function (result) {\n * if (result) {\n * // set up payment request button\n * }\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPaymentRequestComponent.prototype.canMakePayment = function (configuration) {\n var self = this;\n var unsupportedPaymentMethod;\n\n // NEXT_MAJOR_VERSION Move this check to component creation\n if (!window.PaymentRequest) {\n analytics.sendEvent(\n self._client,\n \"payment-request.can-make-payment.not-available\"\n );\n\n return Promise.resolve(false);\n }\n\n if (configuration.supportedPaymentMethods) {\n configuration.supportedPaymentMethods.forEach(function (config) {\n var supportedMethods = config.supportedMethods;\n\n if (!(supportedMethods in constants.SUPPORTED_METHODS)) {\n unsupportedPaymentMethod = supportedMethods;\n }\n });\n\n if (unsupportedPaymentMethod) {\n return Promise.reject(\n new BraintreeError({\n type: errors.PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD.type,\n code: errors.PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD.code,\n message:\n unsupportedPaymentMethod + \" is not a supported payment method.\",\n })\n );\n }\n }\n\n return new Promise(function (resolve, reject) {\n self._bus.emit(\n events.CAN_MAKE_PAYMENT,\n {\n supportedPaymentMethods:\n configuration.supportedPaymentMethods ||\n self._defaultSupportedPaymentMethods,\n details: configuration.details,\n options: configuration.options,\n },\n function (response) {\n var error = response[0];\n var payload = response[1];\n\n if (error) {\n reject(self._formatCanMakePaymentError(error));\n\n return;\n }\n\n analytics.sendEvent(\n self._client,\n \"payment-request.can-make-payment.\" + payload\n );\n\n resolve(payload);\n }\n );\n });\n};\n\n/**\n * Cleanly remove anything set up by {@link module:braintree-web/payment-request.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * paymentRequestInstance.teardown();\n * @example <caption>With callback</caption>\n * paymentRequestInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPaymentRequestComponent.prototype.teardown = function () {\n this._bus.teardown();\n this._frame.parentNode.removeChild(this._frame);\n\n convertMethodsToError(this, methods(PaymentRequestComponent.prototype));\n\n analytics.sendEvent(this._client, \"payment-request.teardown-completed\");\n\n return Promise.resolve();\n};\n\nPaymentRequestComponent.prototype._formatTokenizationError = function (error) {\n var formattedError;\n\n switch (error.name) {\n case \"AbortError\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_CANCELED.type,\n code: errors.PAYMENT_REQUEST_CANCELED.code,\n message: errors.PAYMENT_REQUEST_CANCELED.message,\n details: {\n originalError: error,\n },\n });\n\n analytics.sendEvent(this._client, \"payment-request.tokenize.canceled\");\n\n return formattedError;\n case \"PAYMENT_REQUEST_INITIALIZATION_FAILED\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.type,\n code: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.code,\n message: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.message,\n details: {\n originalError: error,\n },\n });\n break;\n case \"BRAINTREE_GATEWAY_GOOGLE_PAYMENT_TOKENIZATION_ERROR\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.type,\n code: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.code,\n message:\n errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE.message,\n details: {\n originalError: error,\n },\n });\n break;\n case \"BRAINTREE_GATEWAY_GOOGLE_PAYMENT_PARSING_ERROR\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.type,\n code: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.code,\n message: errors.PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR.message,\n details: {\n originalError: error,\n },\n });\n break;\n default:\n formattedError = new BraintreeError({\n code: errors.PAYMENT_REQUEST_NOT_COMPLETED.code,\n type: error.type || BraintreeError.types.CUSTOMER,\n message: errors.PAYMENT_REQUEST_NOT_COMPLETED.message,\n details: {\n originalError: error,\n },\n });\n }\n\n analytics.sendEvent(this._client, \"payment-request.tokenize.failed\");\n\n return formattedError;\n};\n\nPaymentRequestComponent.prototype._formatCanMakePaymentError = function (\n error\n) {\n var formattedError;\n\n switch (error.name) {\n case \"PAYMENT_REQUEST_INITIALIZATION_FAILED\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.type,\n code: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.code,\n message: errors.PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED.message,\n details: {\n originalError: error,\n },\n });\n break;\n case \"NotAllowedError\":\n formattedError = new BraintreeError({\n type: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.type,\n code: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.code,\n message: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED.message,\n details: {\n originalError: error,\n },\n });\n break;\n default:\n formattedError = new BraintreeError({\n code: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.code,\n type: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.type,\n message: errors.PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED.message,\n details: {\n originalError: error,\n },\n });\n }\n\n analytics.sendEvent(this._client, \"payment-request.can-make-payment.failed\");\n\n return formattedError;\n};\n\nmodule.exports = wrapPromise.wrapPrototype(PaymentRequestComponent);\n\n},{\"../../lib/analytics\":119,\"../../lib/assign\":121,\"../../lib/braintree-error\":124,\"../../lib/convert-methods-to-error\":127,\"../../lib/generate-google-pay-configuration\":149,\"../../lib/methods\":155,\"../../lib/use-min\":160,\"../shared/constants\":173,\"@braintree/event-emitter\":33,\"@braintree/iframer\":35,\"@braintree/uuid\":39,\"@braintree/wrap-promise\":43,\"framebus\":52}],172:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/payment-request\n * @description A component to integrate with the Payment Request API.\n *\n * **Note:** This component is currently in beta and the API may include breaking changes when upgrading. Please review the [Changelog](https://github.com/braintree/braintree-web/blob/main/CHANGELOG.md) for upgrade steps whenever you upgrade the version of braintree-web.\n * */\n\nvar PaymentRequestComponent = _dereq_(\"./external/payment-request\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar VERSION = \"3.100.0\";\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {object} [options.enabledPaymentMethods] An object representing which payment methods to display.\n * @param {boolean} [options.enabledPaymentMethods.basicCard=true] Whether or not to display credit card as an option in the Payment Request dialog. If left blank or set to true, credit cards will be displayed in the dialog if the merchant account is set up to process credit cards.\n * @param {boolean} [options.enabledPaymentMethods.googlePay=true] Whether or not to display Google Pay as an option in the Payment Request dialog. If left blank or set to true, Google Pay will be displayed in the dialog if the merchant account is set up to process Google Pay.\n * @param {Number} [options.googlePayVersion=1] Ignored if `options.enabledPaymentMethods.googlePay = false`. If `true`, this option specifies the version of Google Pay to use. Choose either 1 (default) or 2.\n * @param {callback} [callback] The second argument, `data`, is the {@link PaymentRequestComponent} instance. If no callback is provided, `create` returns a promise that resolves with the {@link PaymentRequestComponent} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * if (window.PaymentRequest) {\n * braintree.paymentRequest.create({\n * client: clientInstance\n * }, cb);\n * } else {\n * // fall back to Hosted Fields if browser does not support Payment Request API\n * braintree.hostedFields.create(hostedFieldsOptions, cb);\n * }\n * @example <caption>Explicitly turning off credit cards from Payment Request API dialog</caption>\n * braintree.paymentRequest.create({\n * client: clientInstance,\n * enabledPaymentMethods: {\n * googlePay: true,\n * basicCard: false\n * }\n * }, cb);\n * @example <caption>Using Google Pay v2 or basic card</caption>\n * braintree.paymentRequest.create({\n * client: clientInstance,\n * enabledPaymentMethods: {\n * basicCard: true,\n * googlePay: true\n * },\n * googlePayVersion: 2\n * }, cb);\n *\n */\nfunction create(options) {\n var name = \"Payment Request\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n var paymentRequestInstance;\n\n options.client = client;\n paymentRequestInstance = new PaymentRequestComponent(options);\n\n return paymentRequestInstance.initialize();\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./external/payment-request\":171,\"@braintree/wrap-promise\":43}],173:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar enumerate = _dereq_(\"../../lib/enumerate\");\nvar errors = _dereq_(\"./errors\");\n\nvar constants = {};\n\nconstants.events = enumerate(\n [\n \"CAN_MAKE_PAYMENT\",\n \"FRAME_READY\",\n \"FRAME_CAN_MAKE_REQUESTS\",\n \"PAYMENT_REQUEST_INITIALIZED\",\n \"SHIPPING_ADDRESS_CHANGE\",\n \"UPDATE_SHIPPING_ADDRESS\",\n \"SHIPPING_OPTION_CHANGE\",\n \"UPDATE_SHIPPING_OPTION\",\n ],\n \"payment-request:\"\n);\n\nconstants.errors = errors;\n\nconstants.SUPPORTED_METHODS = {\n \"basic-card\": true,\n \"https://google.com/pay\": true,\n};\n\nmodule.exports = constants;\n\n},{\"../../lib/enumerate\":134,\"./errors\":174}],174:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Payment Request - Creation Error Codes\n * @description Errors that occur when [creating the Payment Request component](./module-braintree-web_payment-request.html#.create).\n * @property {MERCHANT} PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS Occurs when there are no valid payment methods configured.\n */\n\n/**\n * @name BraintreeError.Payment Request - createSupportedPaymentMethodsConfiguration Error Codes\n * @description Errors that occur when using the [`createSupportedPaymentMethodsConfiguration` method](./PaymentRequestComponent.html#createSupportedPaymentMethodsConfiguration)\n * @property {MERCHANT} PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE Occurs when no type is supplied for method.\n * @property {MERCHANT} PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED Occurs when configured type is not enabled.\n */\n\n/**\n * @name BraintreeError.Payment Request - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./PaymentRequestComponent.html#tokenize)\n * @property {CUSTOMER} PAYMENT_REQUEST_CANCELED Occurs when customer cancels the Payment Request.\n * @property {MERCHANT} PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED Occurs when the Payment Request is closed do to the options being misconfigured.\n * @property {MERCHANT} PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE Occurs when a Google Payment payment method is unable to be tokenized.\n * @property {UNKNOWN} PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR Occurs when the result of tokenizing a Google Payment payment method could not be parsed.\n * @property {CUSTOMER} PAYMENT_REQUEST_NOT_COMPLETED Occurs when an error prevented the Payment Request from being completed.\n */\n\n/**\n * @name BraintreeError.Payment Request - canMakePayment Error Codes\n * @description Errors that occur when using the [`canMakePayment` method](./PaymentRequestComponent.html#canMakePayment)\n * @property {MERCHANT} PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED Occurs when the Payment Request is instantiated with misconfigured options.\n * @property {MERCHANT} PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED Occurs when `canMakePayment` results in a `DomException` with a `NotAllowedError`. This usually occurs when `canMakePayment` is called multiple times with different supported payment options.\n * @property {MERCHANT} PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD Occurs when `canMakePayment` is called with a `supportedPaymentMethods` array that contains a payment method that is not supported by the Braintree SDK.\n * @property {UNKNOWN} PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED Occurs when `canMakePayment` fails for any reason other than a misconfigured Payment Request object.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS\",\n message:\n \"There are no supported payment methods associated with this account.\",\n },\n PAYMENT_REQUEST_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"PAYMENT_REQUEST_CANCELED\",\n message: \"Payment request was canceled.\",\n },\n PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED\",\n message: \"Something went wrong when configuring the payment request.\",\n },\n PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED\",\n message: \"Something went wrong when calling `canMakePayment`\",\n },\n PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED\",\n message:\n \"Something went wrong when calling `canMakePayment`. Most likely, `canMakePayment` was called multiple times with different supportedMethods configurations.\",\n },\n PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD\",\n },\n PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE\",\n message: \"Something went wrong when tokenizing the Google Pay card.\",\n },\n PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR\",\n message: \"Something went wrong when tokenizing the Google Pay card.\",\n },\n PAYMENT_REQUEST_NOT_COMPLETED: {\n code: \"PAYMENT_REQUEST_NOT_COMPLETED\",\n message: \"Payment request could not be completed.\",\n },\n PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE:\n {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE\",\n message:\n \"createSupportedPaymentMethodsConfiguration must include a type parameter.\",\n },\n PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED:\n {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED\",\n message:\n \"createSupportedPaymentMethodsConfiguration type parameter must be valid or enabled.\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],175:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.PayPal Checkout - Creation Error Codes\n * @description Errors that occur when [creating the PayPal Checkout component](./module-braintree-web_paypal-checkout.html#.create).\n * @property {MERCHANT} PAYPAL_NOT_ENABLED Occurs when PayPal is not enabled on the Braintree control panel.\n * @property {MERCHANT} PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED Occurs only when testing in Sandbox, when a PayPal sandbox account is not linked to the merchant account in the Braintree control panel.\n */\n\n/**\n * @name BraintreeError.PayPal Checkout - createPayment Error Codes\n * @description Errors that occur when using the [`createPayment` method](./PayPalCheckout.html#createPayment).\n * @property {MERCHANT} PAYPAL_FLOW_OPTION_REQUIRED Occurs when a required option is missing.\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an option contains an invalid value.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when something goes wrong when initializing the flow.\n */\n\n/**\n * @name BraintreeError.PayPal Checkout - startVaultInitiatedCheckout Error Codes\n * @description Errors that occur when using the [`startVaultInitiatedCheckout` method](./PayPalCheckout.html#startVaultInitiatedCheckout).\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED Occurs when a required param is missing when calling the method.\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED Occurs when PayPal window could not be opened. This often occurs because the call to start the vault initiated flow was not triggered from a click event.\n * @property {CUSTOMER} PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED Occurs when a customer closes the PayPal flow before completion.\n * @property {MERCHANT} PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS Occurs when the flow is initialized while an authorization is already in progress.\n * @property {NETWORK} PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED Occurs when something went wrong setting up the flow.\n */\n\n/**\n * @name BraintreeError.PayPal Checkout - tokenizePayment Error Codes\n * @description Errors that occur when using the [`tokenizePayment` method](./PayPalCheckout.html#tokenizePayment).\n * @property {NETWORK} PAYPAL_ACCOUNT_TOKENIZATION_FAILED Occurs when PayPal account could not be tokenized.\n */\n\n/**\n * @name BraintreeError.Paypal Checkout - updatePayment Error Codes\n * @description Errors that occur when using the [`updatePayment` method](./PayPalCheckout.html#updatePayment).\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an option contains an invalid value.\n * @property {MERCHANT} PAYPAL_MISSING_REQUIRED_OPTION Occurs when a required option is missing.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when something goes wrong when initializing the flow or communicating with the server.\n */\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n PAYPAL_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_NOT_ENABLED\",\n message: \"PayPal is not enabled for this merchant.\",\n },\n PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED\",\n message:\n \"A linked PayPal Sandbox account is required to use PayPal Checkout in Sandbox. See https://developer.paypal.com/braintree/docs/guides/paypal/testing-go-live#linked-paypal-testing for details on linking your PayPal sandbox with Braintree.\",\n },\n PAYPAL_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_ACCOUNT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's PayPal account.\",\n },\n PAYPAL_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_FLOW_FAILED\",\n message: \"Could not initialize PayPal flow.\",\n },\n PAYPAL_FLOW_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_FLOW_OPTION_REQUIRED\",\n message: \"PayPal flow property is invalid or missing.\",\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED\",\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED\",\n message: \"Something went wrong when setting up the checkout workflow.\",\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED\",\n message:\n \"PayPal popup failed to open, make sure to initiate the vault checkout in response to a user action.\",\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED\",\n message: \"Customer closed PayPal popup before authorizing.\",\n },\n PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS\",\n message: \"Vault initiated checkout already in progress.\",\n },\n PAYPAL_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_INVALID_PAYMENT_OPTION\",\n message: \"PayPal payment options are invalid.\",\n },\n PAYPAL_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option.\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],176:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/paypal-checkout\n * @description A component to integrate with the [PayPal JS SDK](https://github.com/paypal/paypal-checkout-components).\n */\n\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar PayPalCheckout = _dereq_(\"./paypal-checkout\");\nvar VERSION = \"3.100.0\";\n\n/**\n * @static\n * @function create\n * @description There are two ways to integrate the PayPal Checkout component. See the [PayPal Checkout constructor documentation](PayPalCheckout.html#PayPalCheckout) for more information and examples.\n *\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {string} [options.merchantAccountId] A non-default merchant account ID to use for tokenization.\n * @param {boolean} [options.autoSetDataUserIdToken=false] Whether or not to render the PayPal SDK button with a customer's vaulted PayPal account. Must be used in conjunction with a Client Token generated with a customer id.\n * @param {callback} [callback] The second argument, `data`, is the {@link PayPalCheckout} instance.\n * @example\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * // set up the PayPal JS SDK\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"PayPal Checkout\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n var instance = new PayPalCheckout(options);\n\n return instance._initialize(options);\n });\n}\n\n/**\n * @static\n * @function isSupported\n * @description Returns true if PayPal Checkout [supports this browser](index.html#browser-support-webviews).\n * @deprecated Previously, this method checked for Popup support in the browser. The PayPal JS SDK now falls back to a modal if popups are not supported.\n * @returns {Boolean} Returns true if PayPal Checkout supports this browser.\n */\nfunction isSupported() {\n return true;\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"./paypal-checkout\":177,\"@braintree/wrap-promise\":43}],177:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar assign = _dereq_(\"../lib/assign\").assign;\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar convertToBraintreeError = _dereq_(\"../lib/convert-to-braintree-error\");\nvar errors = _dereq_(\"./errors\");\nvar constants = _dereq_(\"../paypal/shared/constants\");\nvar frameService = _dereq_(\"../lib/frame-service/external\");\nvar createAuthorizationData = _dereq_(\"../lib/create-authorization-data\");\nvar methods = _dereq_(\"../lib/methods\");\nvar useMin = _dereq_(\"../lib/use-min\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar querystring = _dereq_(\"../lib/querystring\");\nvar VERSION = \"3.100.0\";\nvar INTEGRATION_TIMEOUT_MS = _dereq_(\"../lib/constants\").INTEGRATION_TIMEOUT_MS;\n\nvar REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT = [\n \"amount\",\n \"currency\",\n \"vaultInitiatedCheckoutPaymentMethodToken\",\n];\n\nvar PAYPAL_SDK_PRELOAD_URL =\n \"https://www.{ENV}paypal.com/smart/buttons/preload\";\n\nExtendedPromise.suppressUnhandledPromiseMessage = true;\n\n/**\n * PayPal Checkout tokenized payload. Returned in {@link PayPalCheckout#tokenizePayment}'s callback as the second argument, `data`.\n * @typedef {object} PayPalCheckout~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `PayPalAccount`.\n * @property {object} details Additional PayPal account details.\n * @property {string} details.email User's email address.\n * @property {string} details.payerId User's payer ID, the unique identifier for each PayPal account.\n * @property {string} details.firstName User's given name.\n * @property {string} details.lastName User's surname.\n * @property {?string} details.countryCode User's 2 character country code.\n * @property {?string} details.phone User's phone number (e.g. 555-867-5309).\n * @property {?object} details.shippingAddress User's shipping address details, only available if shipping address is enabled.\n * @property {string} details.shippingAddress.recipientName Recipient of postage.\n * @property {string} details.shippingAddress.line1 Street number and name.\n * @property {string} details.shippingAddress.line2 Extended address.\n * @property {string} details.shippingAddress.city City or locality.\n * @property {string} details.shippingAddress.state State or region.\n * @property {string} details.shippingAddress.postalCode Postal code.\n * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} details.billingAddress User's billing address details.\n * Not available to all merchants; [contact support](https://developer.paypal.com/braintree/help) for details on eligibility and enabling this feature.\n * Alternatively, see `shippingAddress` above as an available client option.\n * @property {string} details.billingAddress.line1 Street number and name.\n * @property {string} details.billingAddress.line2 Extended address.\n * @property {string} details.billingAddress.city City or locality.\n * @property {string} details.billingAddress.state State or region.\n * @property {string} details.billingAddress.postalCode Postal code.\n * @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} creditFinancingOffered This property will only be present when the customer pays with PayPal Credit.\n * @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.\n * @property {string} creditFinancingOffered.totalCost.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalCost.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {number} creditFinancingOffered.term Length of financing terms in months.\n * @property {object} creditFinancingOffered.monthlyPayment This is the estimated amount per month that the customer will need to pay including fees and interest.\n * @property {string} creditFinancingOffered.monthlyPayment.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.monthlyPayment.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {object} creditFinancingOffered.totalInterest Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalInterest.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalInterest.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {boolean} creditFinancingOffered.payerAcceptance Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.\n * @property {boolean} creditFinancingOffered.cartAmountImmutable Indicates whether the cart amount is editable after payer's acceptance on PayPal side.\n */\n\n/**\n * @class\n * @param {object} options see {@link module:braintree-web/paypal-checkout.create|paypal-checkout.create}\n * @classdesc This class represents a PayPal Checkout component that coordinates with the {@link https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page|PayPal SDK}. Instances of this class can generate payment data and tokenize authorized payments.\n *\n * All UI (such as preventing actions on the parent page while authentication is in progress) is managed by the {@link https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page|PayPal SDK}. You must provide your PayPal `client-id` as a query parameter. You can [retrieve this value from the PayPal Dashboard](https://developer.paypal.com/docs/checkout/integrate/#1-get-paypal-rest-api-credentials).\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/paypal-checkout.create|braintree-web.paypal-checkout.create} instead.</strong>\n *\n * #### Integrate Checkout Flow with PayPal SDK\n *\n * You must have [PayPal's script, configured with various query parameters](https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page), loaded on your page:\n *\n * ```html\n * <script src=\"https://www.paypal.com/sdk/js?client-id=your-sandbox-or-prod-client-id\"></script>\n * <div id=\"paypal-button\"></div>\n * ```\n *\n * When passing values in the `createPayment` method, make sure they match the [corresponding parameters in the query parameters for the PayPal SDK script](https://developer.paypal.com/docs/checkout/reference/customize-sdk/).\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Buttons({\n * createOrder: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * currency: 'USD',\n * amount: '10.00',\n * intent: 'capture' // this value must either be `capture` or match the intent passed into the PayPal SDK intent query parameter\n * // your other createPayment options here\n * });\n * },\n *\n * onApprove: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * },\n *\n * onCancel: function () {\n * // handle case where user cancels\n * },\n *\n * onError: function (err) {\n * // handle case where error occurs\n * }\n * }).render('#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * #### Integrate Vault Flow with PayPal SDK\n *\n * You must have [PayPal's script, configured with various query parameters](https://developer.paypal.com/docs/checkout/integrate/#2-add-the-paypal-script-to-your-web-page), loaded on your page:\n *\n * ```html\n * <script src=\"https://www.paypal.com/sdk/js?client-id=your-sandbox-or-prod-client-id&vault=true\"></script>\n * <div id=\"paypal-button\"></div>\n * ```\n *\n * When passing values in the `createPayment` method, make sure they match the [corresponding parameters in the query parameters for the PayPal SDK script](https://developer.paypal.com/docs/checkout/reference/customize-sdk/).\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Buttons({\n * createBillingAgreement: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'vault'\n * // your other createPayment options here\n * });\n * },\n *\n * onApprove: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * },\n *\n * onCancel: function () {\n * // handle case where user cancels\n * },\n *\n * onError: function (err) {\n * // handle case where error occurs\n * }\n * }).render('#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * #### Integrate with Checkout.js (deprecated PayPal SDK)\n *\n * If you are creating a new PayPal integration, please follow the previous integration guide to use the current version of the PayPal SDK. Use this integration guide only as a reference if you are already integrated with Checkout.js.\n *\n * You must have PayPal's Checkout.js script loaded on your page.\n *\n * ```html\n * <script src=\"https://www.paypalobjects.com/api/checkout.js\" data-version-4 log-level=\"warn\"></script>\n * ```\n *\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Button.render({\n * env: 'production', // or 'sandbox'\n *\n * payment: function () {\n * return paypalCheckoutInstance.createPayment({\n * // your createPayment options here\n * });\n * },\n *\n * onAuthorize: function (data, actions) {\n * // some logic here before tokenization happens below\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * }\n * }, '#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n */\nfunction PayPalCheckout(options) {\n this._merchantAccountId = options.merchantAccountId;\n // TODO remove this requirement for it to be opt in.\n // This feature is not yet GA, so we're intentionally making\n // it opt in and not publicly documenting it yet. Once it's\n // GA, we can remove the requirement to opt in to it\n this._autoSetDataUserIdToken = Boolean(options.autoSetDataUserIdToken);\n}\n\nPayPalCheckout.prototype._initialize = function (options) {\n var config;\n\n if (options.client) {\n config = options.client.getConfiguration();\n this._authorizationInformation = {\n fingerprint: config.authorizationFingerprint,\n environment: config.gatewayConfiguration.environment,\n };\n } else {\n config = createAuthorizationData(options.authorization);\n this._authorizationInformation = {\n fingerprint: config.attrs.authorizationFingerprint,\n environment: config.environment,\n };\n }\n\n this._clientPromise = createDeferredClient\n .create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: \"PayPal Checkout\",\n })\n .then(\n function (client) {\n this._configuration = client.getConfiguration();\n\n // we skip these checks if a merchant account id is\n // passed in, because the default merchant account\n // may not have paypal enabled\n if (!this._merchantAccountId) {\n if (!this._configuration.gatewayConfiguration.paypalEnabled) {\n this._setupError = new BraintreeError(errors.PAYPAL_NOT_ENABLED);\n } else if (\n this._configuration.gatewayConfiguration.paypal\n .environmentNoNetwork === true\n ) {\n this._setupError = new BraintreeError(\n errors.PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED\n );\n }\n }\n\n if (this._setupError) {\n return Promise.reject(this._setupError);\n }\n\n analytics.sendEvent(client, \"paypal-checkout.initialized\");\n this._frameServicePromise = this._setupFrameService(client);\n\n return client;\n }.bind(this)\n );\n\n // if client was passed in, let config checks happen before\n // resolving the instance. Otherwise, just resolve the instance\n if (options.client) {\n return this._clientPromise.then(\n function () {\n return this;\n }.bind(this)\n );\n }\n\n return Promise.resolve(this);\n};\n\nPayPalCheckout.prototype._setupFrameService = function (client) {\n var frameServicePromise = new ExtendedPromise();\n var config = client.getConfiguration();\n var timeoutRef = setTimeout(function () {\n analytics.sendEvent(client, \"paypal-checkout.frame-service.timed-out\");\n frameServicePromise.reject(\n new BraintreeError(\n errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED\n )\n );\n }, INTEGRATION_TIMEOUT_MS);\n\n this._assetsUrl =\n config.gatewayConfiguration.paypal.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = config.isDebug;\n // Note: this is using the static landing frame that the deprecated PayPal component builds and uses\n this._loadingFrameUrl =\n this._assetsUrl +\n \"/html/paypal-landing-frame\" +\n useMin(this._isDebug) +\n \".html\";\n\n frameService.create(\n {\n name: \"braintreepaypallanding\",\n dispatchFrameUrl:\n this._assetsUrl +\n \"/html/dispatch-frame\" +\n useMin(this._isDebug) +\n \".html\",\n openFrameUrl: this._loadingFrameUrl,\n },\n function (service) {\n this._frameService = service;\n clearTimeout(timeoutRef);\n\n frameServicePromise.resolve();\n }.bind(this)\n );\n\n return frameServicePromise;\n};\n\n/**\n * @typedef {object} PayPalCheckout~lineItem\n * @property {string} quantity Number of units of the item purchased. This value must be a whole number and can't be negative or zero.\n * @property {string} unitAmount Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {string} name Item name. Maximum 127 characters.\n * @property {string} kind Indicates whether the line item is a debit (sale) or credit (refund) to the customer. Accepted values: `debit` and `credit`.\n * @property {?string} unitTaxAmount Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {?string} description Item description. Maximum 127 characters.\n * @property {?string} productCode Product or UPC code for the item. Maximum 127 characters.\n * @property {?string} url The URL to product information.\n */\n\n/**\n * @typedef {object} PayPalCheckout~shippingOption\n * @property {string} id A unique ID that identifies a payer-selected shipping option.\n * @property {string} label A description that the payer sees, which helps them choose an appropriate shipping option. For example, `Free Shipping`, `USPS Priority Shipping`, `Expédition prioritaire USPS`, or `USPS yÅuxiÄn fÄ huò`. Localize this description to the payer's locale.\n * @property {boolean} selected If `selected = true` is specified as part of the API request it represents the shipping option that the payee/merchant expects to be pre-selected for the payer when they first view the shipping options within the PayPal checkout experience. As part of the response if a shipping option has `selected = true` it represents the shipping option that the payer selected during the course of checkout with PayPal. Only 1 `shippingOption` can be set to `selected = true`.\n * @property {string} type The method by which the payer wants to get their items. The possible values are:\n * * `SHIPPING` - The payer intends to receive the items at a specified address.\n * * `PICKUP` - The payer intends to pick up the items at a specified address. For example, a store address.\n * @property {object} amount The shipping cost for the selected option.\n * @property {string} amount.currency The three-character ISO-4217 currency code. PayPal does not support all currencies.\n * @property {string} amount.value The amount the shipping option will cost. Includes the specified number of digits after decimal separator for the ISO-4217 currency code.\n */\n\n/**\n * Creates a PayPal payment ID or billing token using the given options. This is meant to be passed to the PayPal JS SDK.\n * When a {@link callback} is defined, the function returns undefined and invokes the callback with the id to be used with the PayPal JS SDK. Otherwise, it returns a Promise that resolves with the id.\n * @public\n * @param {object} options All options for the PayPalCheckout component.\n * @param {string} options.flow Set to 'checkout' for one-time payment flow, or 'vault' for Vault flow. If 'vault' is used with a client token generated with a customer ID, the PayPal account will be added to that customer as a saved payment method.\n * @param {string} [options.intent=authorize]\n * * `authorize` - Submits the transaction for authorization but not settlement.\n * * `order` - Validates the transaction without an authorization (i.e. without holding funds). Useful for authorizing and capturing funds up to 90 days after the order has been placed. Only available for Checkout flow.\n * * `capture` - Payment will be immediately submitted for settlement upon creating a transaction. `sale` can be used as an alias for this value.\n * @param {boolean} [options.offerCredit=false] Offers PayPal Credit as the default funding instrument for the transaction. If the customer isn't pre-approved for PayPal Credit, they will be prompted to apply for it.\n * @param {(string|number)} [options.amount] The amount of the transaction. Required when using the Checkout flow. Should not include shipping cost.\n * * Supports up to 2 digits after the decimal point\n * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account\n * @param {boolean} [options.requestBillingAgreement] If `true` and `flow = checkout`, the customer will be prompted to consent to a billing agreement during the checkout flow. This value is ignored when `flow = vault`.\n * @param {object} [options.billingAgreementDetails] When `requestBillingAgreement = true`, allows for details to be set for the billing agreement portion of the flow.\n * @param {string} [options.billingAgreementDetails.description] Description of the billing agreement to display to the customer.\n * @param {string} [options.vaultInitiatedCheckoutPaymentMethodToken] Use the payment method nonce representing a PayPal account with a Billing Agreement ID to create the payment and redirect the customer to select a new financial instrument. This option is only applicable to the `checkout` flow.\n * @param {shippingOption[]} [options.shippingOptions] List of shipping options offered by the payee or merchant to the payer to ship or pick up their items.\n * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}.\n * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow.\n * @param {string} options.shippingAddressOverride.line1 Street address.\n * @param {string} [options.shippingAddressOverride.line2] Street address (extended).\n * @param {string} options.shippingAddressOverride.city City.\n * @param {string} options.shippingAddressOverride.state State.\n * @param {string} options.shippingAddressOverride.postalCode Postal code.\n * @param {string} options.shippingAddressOverride.countryCode Country.\n * @param {string} [options.shippingAddressOverride.phone] Phone number.\n * @param {string} [options.shippingAddressOverride.recipientName] Recipient's name.\n * @param {boolean} [options.shippingAddressEditable=true] Set to false to disable user editing of the shipping address.\n * @param {string} [options.billingAgreementDescription] Use this option to set the description of the preapproved payment agreement visible to customers in their PayPal profile during Vault flows. Max 255 characters.\n * @param {string} [options.landingPageType] Use this option to specify the PayPal page to display when a user lands on the PayPal site to complete the payment.\n * * `login` - A PayPal account login page is used.\n * * `billing` - A non-PayPal account landing page is used.\n * @param {lineItem[]} [options.lineItems] The {@link PayPalCheckout~lineItem|line items} for this transaction. It can include up to 249 line items.\n * @param {callback} [callback] The second argument is a PayPal `paymentId` or `billingToken` string, depending on whether `options.flow` is `checkout` or `vault`. This is also what is resolved by the promise if no callback is provided.\n * @example\n * // this paypal object is created by the PayPal JS SDK\n * // see https://github.com/paypal/paypal-checkout-components\n * paypal.Buttons({\n * createOrder: function () {\n * // when createPayment resolves, it is automatically passed to the PayPal JS SDK\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD',\n * intent: 'capture' // this value must either be `capture` or match the intent passed into the PayPal SDK intent query parameter\n * });\n * },\n * // Add other options, e.g. onApproved, onCancel, onError\n * }).render('#paypal-button');\n *\n * @example\n * // shippingOptions are passed to createPayment. You can review the result from onAuthorize to determine which shipping option id was selected.\n * ```javascript\n * braintree.client.create({\n * authorization: 'authorization'\n * }).then(function (clientInstance) {\n * return braintree.paypalCheckout.create({\n * client: clientInstance\n * });\n * }).then(function (paypalCheckoutInstance) {\n * return paypal.Button.render({\n * env: 'production'\n *\n * payment: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'checkout',\n * amount: '10.00',\n * currency: 'USD',\n * shippingOptions: [\n * {\n * id: 'UUID-9',\n * type: 'PICKUP',\n * label: 'Store Location Five',\n * selected: true,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-fast',\n * type: 'SHIPPING',\n * label: 'Fast Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-slow',\n * type: 'SHIPPING',\n * label: 'Slow Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * }\n * ]\n * });\n * },\n *\n * onAuthorize: function (data, actions) {\n * return paypalCheckoutInstance.tokenizePayment(data).then(function (payload) {\n * // Submit payload.nonce to your server\n * });\n * }\n * }, '#paypal-button');\n * }).catch(function (err) {\n * console.error('Error!', err);\n * });\n * ```\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPalCheckout.prototype.createPayment = function (options) {\n if (!options || !constants.FLOW_ENDPOINTS.hasOwnProperty(options.flow)) {\n return Promise.reject(\n new BraintreeError(errors.PAYPAL_FLOW_OPTION_REQUIRED)\n );\n }\n\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.createPayment\");\n\n return this._createPaymentResource(options).then(function (response) {\n var flowToken, urlParams;\n\n if (options.flow === \"checkout\") {\n urlParams = querystring.parse(response.paymentResource.redirectUrl);\n flowToken = urlParams.token;\n } else {\n flowToken = response.agreementSetup.tokenId;\n }\n\n return flowToken;\n });\n};\n\nPayPalCheckout.prototype._createPaymentResource = function (options, config) {\n var self = this;\n var endpoint = \"paypal_hermes/\" + constants.FLOW_ENDPOINTS[options.flow];\n\n delete this.intentFromCreatePayment;\n\n config = config || {};\n\n if (options.offerCredit === true) {\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.credit.offered\");\n }\n\n return this._clientPromise\n .then(function (client) {\n return client\n .request({\n endpoint: endpoint,\n method: \"post\",\n data: self._formatPaymentResourceData(options, config),\n })\n .then(function (data) {\n self.intentFromCreatePayment = options.intent;\n\n return data;\n });\n })\n .catch(function (err) {\n var status;\n\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n\n status = err.details && err.details.httpStatus;\n\n if (status === 422) {\n return Promise.reject(\n new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err,\n },\n })\n );\n }\n\n return Promise.reject(\n convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message,\n })\n );\n });\n};\n\n/**\n * Use this function to update {@link PayPalCheckout~lineItem|line items} and/or {@link PayPalCheckout~shippingOption|shipping options} associated with a PayPalCheckout flow (`paymentId`).\n * When a {@link callback} is defined, this function returns undefined and invokes the callback. The second callback argument, <code>data</code>, is the returned server data. If no callback is provided, `updatePayment` returns a promise that resolves with the server data.\n * @public\n * @param {object} options All options for the PayPalCheckout component.\n * @param {string} options.paymentId This should be PayPal `paymentId`.\n * @param {(string|number)} options.amount The amount of the transaction, including the amount of the selected shipping option, and all `line_items`.\n * * Supports up to 2 decimal digits.\n * @param {string} options.currency The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {shippingOption[]} [options.shippingOptions] List of {@link PayPalCheckout~shippingOption|shipping options} offered by the payee or merchant to the payer to ship or pick up their items.\n * @param {lineItem[]} [options.lineItems] The {@link PayPalCheckout~lineItem|line items} for this transaction. It can include up to 249 line items.\n * @param {callback} [callback] The second argument is a PayPal `paymentId` or `billingToken` string, depending on whether `options.flow` is `checkout` or `vault`. This is also what is resolved by the promise if no callback is provided.\n * @example\n * // this paypal object is created by the PayPal JS SDK\n * // see https://github.com/paypal/paypal-checkout-components\n * paypal.Buttons({\n * createOrder: function () {\n * // when createPayment resolves, it is automatically passed to the PayPal JS SDK\n * return paypalCheckoutInstance.createPayment({\n * //\n * });\n * },\n * onShippingChange: function (data) {\n * // Examine data and determine if the payment needs to be updated.\n * // when updatePayment resolves, it is automatically passed to the PayPal JS SDK\n * return paypalCheckoutInstance.updatePayment({\n * paymentId: data.paymentId,\n * amount: '15.00',\n * currency: 'USD',\n * shippingOptions: [\n * {\n * id: 'shipping-speed-fast',\n * type: 'SHIPPING',\n * label: 'Fast Shipping',\n * selected: true,\n * amount: {\n * value: '5.00',\n * currency: 'USD'\n * }\n * },\n * {\n * id: 'shipping-speed-slow',\n * type: 'SHIPPING',\n * label: 'Slow Shipping',\n * selected: false,\n * amount: {\n * value: '1.00',\n * currency: 'USD'\n * }\n * }\n * ]\n * });\n * }\n * // Add other options, e.g. onApproved, onCancel, onError\n * }).render('#paypal-button');\n *\n * ```\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPalCheckout.prototype.updatePayment = function (options) {\n var self = this;\n var endpoint = \"paypal_hermes/patch_payment_resource\";\n\n if (!options || this._hasMissingOption(options, constants.REQUIRED_OPTIONS)) {\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.updatePayment.missing-options\"\n );\n\n return Promise.reject(\n new BraintreeError(errors.PAYPAL_MISSING_REQUIRED_OPTION)\n );\n }\n\n if (!this._verifyConsistentCurrency(options)) {\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.updatePayment.inconsistent-currencies\"\n );\n\n return Promise.reject(\n new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: new Error(\n \"One or more shipping option currencies differ from checkout currency.\"\n ),\n },\n })\n );\n }\n\n analytics.sendEvent(this._clientPromise, \"paypal-checkout.updatePayment\");\n\n return this._clientPromise\n .then(function (client) {\n return client.request({\n endpoint: endpoint,\n method: \"post\",\n data: self._formatUpdatePaymentData(options),\n });\n })\n .catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n if (status === 422) {\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.updatePayment.invalid\"\n );\n\n return Promise.reject(\n new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err,\n },\n })\n );\n }\n\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.updatePayment.\" + errors.PAYPAL_FLOW_FAILED.code\n );\n\n return Promise.reject(\n convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message,\n })\n );\n });\n};\n\n/**\n * Initializes the PayPal checkout flow with a payment method nonce that represents a vaulted PayPal account.\n * When a {@link callback} is defined, the function returns undefined and invokes the callback with the id to be used with the PayPal JS SDK. Otherwise, it returns a Promise that resolves with the id.\n * @public\n * @ignore\n * @param {object} options These options are identical to the {@link PayPalCheckout#createPayment|options for creating a payment resource}, except for the following:\n * * `flow` cannot be set (will always be `'checkout'`)\n * * `amount`, `currency`, and `vaultInitiatedCheckoutPaymentMethodToken` are required instead of optional\n * * Additional configuration is available (listed below)\n * @param {boolean} [options.optOutOfModalBackdrop=false] By default, the webpage will darken and become unusable while the PayPal window is open. For full control of the UI, pass `true` for this option.\n * @param {callback} [callback] The second argument, <code>payload</code>, is a {@link PayPalCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, the promise resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @example\n * paypalCheckoutInstance.startVaultInitiatedCheckout({\n * vaultInitiatedCheckoutPaymentMethodToken: 'nonce-that-represents-a-vaulted-paypal-account',\n * amount: '10.00',\n * currency: 'USD'\n * }).then(function (payload) {\n * // send payload.nonce to your server\n * }).catch(function (err) {\n * if (err.code === 'PAYPAL_POPUP_CLOSED') {\n * // indicates that customer canceled by\n * // manually closing the PayPal popup\n * }\n *\n * // handle other errors\n * });\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPalCheckout.prototype.startVaultInitiatedCheckout = function (options) {\n var missingRequiredParam;\n var self = this;\n\n if (this._vaultInitiatedCheckoutInProgress) {\n analytics.sendEvent(\n this._clientPromise,\n \"paypal-checkout.startVaultInitiatedCheckout.error.already-in-progress\"\n );\n\n return Promise.reject(\n new BraintreeError(\n errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS\n )\n );\n }\n\n REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT.forEach(function (param) {\n if (!options.hasOwnProperty(param)) {\n missingRequiredParam = param;\n }\n });\n\n if (missingRequiredParam) {\n return Promise.reject(\n new BraintreeError({\n type: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.type,\n code: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED.code,\n message: \"Required param \" + missingRequiredParam + \" is missing.\",\n })\n );\n }\n\n this._vaultInitiatedCheckoutInProgress = true;\n this._addModalBackdrop(options);\n\n options = assign({}, options, {\n flow: \"checkout\",\n });\n\n analytics.sendEvent(\n this._clientPromise,\n \"paypal-checkout.startVaultInitiatedCheckout.started\"\n );\n\n return this._waitForVaultInitiatedCheckoutDependencies()\n .then(function () {\n var frameCommunicationPromise = new ExtendedPromise();\n var startVaultInitiatedCheckoutPromise = self\n ._createPaymentResource(options, {\n returnUrl: self._constructVaultCheckutUrl(\"redirect-frame\"),\n cancelUrl: self._constructVaultCheckutUrl(\"cancel-frame\"),\n })\n .then(function (response) {\n var redirectUrl = response.paymentResource.redirectUrl;\n\n self._frameService.redirect(redirectUrl);\n\n return frameCommunicationPromise;\n });\n\n self._frameService.open(\n {},\n self._createFrameServiceCallback(frameCommunicationPromise)\n );\n\n return startVaultInitiatedCheckoutPromise;\n })\n .catch(function (err) {\n self._vaultInitiatedCheckoutInProgress = false;\n self._removeModalBackdrop();\n\n if (err.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.startVaultInitiatedCheckout.canceled.by-customer\"\n );\n\n return Promise.reject(\n new BraintreeError(\n errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED\n )\n );\n }\n\n if (self._frameService) {\n self._frameService.close();\n }\n\n if (\n err.code &&\n err.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1\n ) {\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.startVaultInitiatedCheckout.failed.popup-not-opened\"\n );\n\n return Promise.reject(\n new BraintreeError({\n code: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED\n .code,\n type: errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED\n .type,\n message:\n errors.PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED\n .message,\n details: {\n originalError: err,\n },\n })\n );\n }\n\n return Promise.reject(err);\n })\n .then(function (response) {\n self._frameService.close();\n self._vaultInitiatedCheckoutInProgress = false;\n self._removeModalBackdrop();\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.startVaultInitiatedCheckout.succeeded\"\n );\n\n return Promise.resolve(response);\n });\n};\n\nPayPalCheckout.prototype._addModalBackdrop = function (options) {\n if (options.optOutOfModalBackdrop) {\n return;\n }\n\n if (!this._modalBackdrop) {\n this._modalBackdrop = document.createElement(\"div\");\n this._modalBackdrop.setAttribute(\n \"data-braintree-paypal-vault-initiated-checkout-modal\",\n true\n );\n this._modalBackdrop.style.position = \"fixed\";\n this._modalBackdrop.style.top = 0;\n this._modalBackdrop.style.bottom = 0;\n this._modalBackdrop.style.left = 0;\n this._modalBackdrop.style.right = 0;\n this._modalBackdrop.style.zIndex = 9999;\n this._modalBackdrop.style.background = \"black\";\n this._modalBackdrop.style.opacity = \"0.7\";\n this._modalBackdrop.addEventListener(\n \"click\",\n function () {\n this.focusVaultInitiatedCheckoutWindow();\n }.bind(this)\n );\n }\n\n document.body.appendChild(this._modalBackdrop);\n};\n\nPayPalCheckout.prototype._removeModalBackdrop = function () {\n if (!(this._modalBackdrop && this._modalBackdrop.parentNode)) {\n return;\n }\n\n this._modalBackdrop.parentNode.removeChild(this._modalBackdrop);\n};\n\n/**\n * Closes the PayPal window if it is opened via `startVaultInitiatedCheckout`.\n * @public\n * @ignore\n * @param {callback} [callback] Gets called when window is closed.\n * @example\n * paypalCheckoutInstance.closeVaultInitiatedCheckoutWindow();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPalCheckout.prototype.closeVaultInitiatedCheckoutWindow = function () {\n if (this._vaultInitiatedCheckoutInProgress) {\n analytics.sendEvent(\n this._clientPromise,\n \"paypal-checkout.startVaultInitiatedCheckout.canceled.by-merchant\"\n );\n }\n\n return this._waitForVaultInitiatedCheckoutDependencies().then(\n function () {\n this._frameService.close();\n }.bind(this)\n );\n};\n\n/**\n * Focuses the PayPal window if it is opened via `startVaultInitiatedCheckout`.\n * @public\n * @ignore\n * @param {callback} [callback] Gets called when window is focused.\n * @example\n * paypalCheckoutInstance.focusVaultInitiatedCheckoutWindow();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPalCheckout.prototype.focusVaultInitiatedCheckoutWindow = function () {\n return this._waitForVaultInitiatedCheckoutDependencies().then(\n function () {\n this._frameService.focus();\n }.bind(this)\n );\n};\n\nPayPalCheckout.prototype._createFrameServiceCallback = function (\n frameCommunicationPromise\n) {\n var self = this;\n\n // TODO when a merchant integrates an iOS or Android integration\n // with a webview using the web SDK, we will have to add popupbridge\n // support\n return function (err, payload) {\n if (err) {\n frameCommunicationPromise.reject(err);\n } else if (payload) {\n self._frameService.redirect(self._loadingFrameUrl);\n self\n .tokenizePayment({\n paymentToken: payload.token,\n payerID: payload.PayerID,\n paymentID: payload.paymentId,\n orderID: payload.orderId,\n })\n .then(function (res) {\n frameCommunicationPromise.resolve(res);\n })\n .catch(function (tokenizationError) {\n frameCommunicationPromise.reject(tokenizationError);\n });\n }\n };\n};\n\nPayPalCheckout.prototype._waitForVaultInitiatedCheckoutDependencies =\n function () {\n var self = this;\n\n return this._clientPromise.then(function () {\n return self._frameServicePromise;\n });\n };\n\nPayPalCheckout.prototype._constructVaultCheckutUrl = function (frameName) {\n var serviceId = this._frameService._serviceId;\n\n return (\n this._assetsUrl +\n \"/html/\" +\n frameName +\n useMin(this._isDebug) +\n \".html?channel=\" +\n serviceId\n );\n};\n\n/**\n * Tokenizes the authorize data from the PayPal JS SDK when completing a buyer approval flow.\n * When a {@link callback} is defined, invokes the callback with {@link PayPalCheckout~tokenizePayload|tokenizePayload} and returns undefined. Otherwise, returns a Promise that resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @public\n * @param {object} tokenizeOptions Tokens and IDs required to tokenize the payment.\n * @param {string} tokenizeOptions.payerId Payer ID returned by PayPal `onApproved` callback.\n * @param {string} [tokenizeOptions.paymentId] Payment ID returned by PayPal `onApproved` callback.\n * @param {string} [tokenizeOptions.billingToken] Billing Token returned by PayPal `onApproved` callback.\n * @param {boolean} [tokenizeOptions.vault=true] Whether or not to vault the resulting PayPal account (if using a client token generated with a customer id and the vault flow).\n * @param {callback} [callback] The second argument, <code>payload</code>, is a {@link PayPalCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, the promise resolves with a {@link PayPalCheckout~tokenizePayload|tokenizePayload}.\n * @example <caption>Opt out of auto-vaulting behavior</caption>\n * // create the paypalCheckoutInstance with a client token generated with a customer id\n * paypal.Buttons({\n * createBillingAgreement: function () {\n * return paypalCheckoutInstance.createPayment({\n * flow: 'vault'\n * // your other createPayment options here\n * });\n * },\n * onApproved: function (data) {\n * data.vault = false;\n *\n * return paypalCheckoutInstance.tokenizePayment(data);\n * },\n * // Add other options, e.g. onCancel, onError\n * }).render('#paypal-button');\n *\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPalCheckout.prototype.tokenizePayment = function (tokenizeOptions) {\n var self = this;\n var shouldVault = true;\n var payload;\n var options = {\n flow:\n tokenizeOptions.billingToken && !tokenizeOptions.paymentID\n ? \"vault\"\n : \"checkout\",\n intent: tokenizeOptions.intent || this.intentFromCreatePayment,\n };\n var params = {\n // The paymentToken provided by the PayPal JS SDK is the EC Token\n ecToken: tokenizeOptions.paymentToken,\n billingToken: tokenizeOptions.billingToken,\n payerId: tokenizeOptions.payerID,\n paymentId: tokenizeOptions.paymentID,\n orderId: tokenizeOptions.orderID,\n shippingOptionsId: tokenizeOptions.shippingOptionsId,\n };\n\n if (tokenizeOptions.hasOwnProperty(\"vault\")) {\n shouldVault = tokenizeOptions.vault;\n }\n\n options.vault = shouldVault;\n\n analytics.sendEvent(\n this._clientPromise,\n \"paypal-checkout.tokenization.started\"\n );\n\n return this._clientPromise\n .then(function (client) {\n return client.request({\n endpoint: \"payment_methods/paypal_accounts\",\n method: \"post\",\n data: self._formatTokenizeData(options, params),\n });\n })\n .then(function (response) {\n payload = self._formatTokenizePayload(response);\n\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.tokenization.success\"\n );\n if (payload.creditFinancingOffered) {\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.credit.accepted\"\n );\n }\n\n return payload;\n })\n .catch(function (err) {\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.tokenization.failed\"\n );\n\n return Promise.reject(\n convertToBraintreeError(err, {\n type: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,\n code: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,\n message: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message,\n })\n );\n });\n};\n\n/**\n * Resolves with the PayPal client id to be used when loading the PayPal SDK.\n * @public\n * @param {callback} [callback] The second argument, <code>id</code>, is a the PayPal client id. If no callback is provided, the promise resolves with the PayPal client id.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * paypalCheckoutInstance.getClientId().then(function (id) {\n * var script = document.createElement('script');\n *\n * script.src = 'https://www.paypal.com/sdk/js?client-id=' + id;\n * script.onload = function () {\n * // setup the PayPal SDK\n * };\n *\n * document.body.appendChild(script);\n * });\n */\nPayPalCheckout.prototype.getClientId = function () {\n return this._clientPromise.then(function (client) {\n return client.getConfiguration().gatewayConfiguration.paypal.clientId;\n });\n};\n\n/**\n * Resolves when the PayPal SDK has been successfully loaded onto the page.\n * @public\n * @param {object} [options] A configuration object to modify the query params and data-attributes on the PayPal SDK. A subset of the parameters are listed below. For a full list of query params, see the [PayPal docs](https://developer.paypal.com/docs/checkout/reference/customize-sdk/?mark=query#query-parameters).\n * @param {string} [options.client-id] By default, this will be the client id associated with the authorization used to create the Braintree component. When used in conjunction with passing `authorization` when creating the PayPal Checkout component, you can speed up the loading of the PayPal SDK.\n * @param {string} [options.intent=\"authorize\"] By default, the PayPal SDK defaults to an intent of `capture`. Since the default intent when calling {@link PayPalCheckout#createPayment|`createPayment`} is `authorize`, the PayPal SDK will be loaded with `intent=authorize`. If you wish to use a different intent when calling {@link PayPalCheckout#createPayment|`createPayment`}, make sure it matches here. If `sale` is used, it will be converted to `capture` for the PayPal SDK. If the `vault: true` param is used, `tokenize` will be passed as the default intent.\n * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown.\n *\n * Supported locales are:\n * `da_DK`,\n * `de_DE`,\n * `en_AU`,\n * `en_GB`,\n * `en_US`,\n * `es_ES`,\n * `fr_CA`,\n * `fr_FR`,\n * `id_ID`,\n * `it_IT`,\n * `ja_JP`,\n * `ko_KR`,\n * `nl_NL`,\n * `no_NO`,\n * `pl_PL`,\n * `pt_BR`,\n * `pt_PT`,\n * `ru_RU`,\n * `sv_SE`,\n * `th_TH`,\n * `zh_CN`,\n * `zh_HK`,\n * and `zh_TW`.\n *\n * @param {string} [options.currency=\"USD\"] If a currency is passed in {@link PayPalCheckout#createPayment|`createPayment`}, it must match the currency passed here.\n * @param {boolean} [options.vault] Must be `true` when using `flow: vault` in {@link PayPalCheckout#createPayment|`createPayment`}.\n * @param {string} [options.components=buttons] By default, the Braintree SDK will only load the PayPal smart buttons component. If you would like to load just the [messages component](https://developer.paypal.com/docs/business/checkout/add-capabilities/credit-messaging/), pass `messages`. If you would like to load both, pass `buttons,messages`\n * @param {object} [options.dataAttributes] The data attributes to apply to the script. Any data attribute can be passed. A subset of the parameters are listed below. For a full list of data attributes, see the [PayPal docs](https://developer.paypal.com/docs/checkout/reference/customize-sdk/#script-parameters).\n * @param {string} [options.dataAttributes.client-token] The client token to use in the script. (usually not needed)\n * @param {string} [options.dataAttributes.csp-nonce] See the [PayPal docs about content security nonces](https://developer.paypal.com/docs/checkout/reference/customize-sdk/#csp-nonce).\n * @param {callback} [callback] Called when the PayPal SDK has been loaded onto the page. The second argument is the PayPal Checkout instance. If no callback is provided, the promise resolves with the PayPal Checkout instance when the PayPal SDK has been loaded onto the page.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example <caption>Without options</caption>\n * paypalCheckoutInstance.loadPayPalSDK().then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n * @example <caption>With options</caption>\n * paypalCheckoutInstance.loadPayPalSDK({\n * 'client-id': 'PayPal Client Id', // Can speed up rendering time to hardcode this value\n *\n * intent: 'capture', // Make sure this value matches the value in createPayment\n * currency: 'USD', // Make sure this value matches the value in createPayment\n * }).then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n * @example <caption>With Vaulting</caption>\n * paypalCheckoutInstance.loadPayPalSDK({\n * vault: true\n * }).then(function () {\n * // window.paypal.Buttons is now available to use\n * });\n */\nPayPalCheckout.prototype.loadPayPalSDK = function (options) {\n var idPromise, src;\n var loadPromise = new ExtendedPromise();\n var dataAttributes = (options && options.dataAttributes) || {};\n var userIdToken =\n dataAttributes[\"user-id-token\"] || dataAttributes[\"data-user-id-token\"];\n\n if (!userIdToken) {\n userIdToken =\n this._authorizationInformation.fingerprint &&\n this._authorizationInformation.fingerprint.split(\"?\")[0];\n }\n\n this._paypalScript = document.createElement(\"script\");\n\n // NEXT_MAJOR_VERSION\n // this options object should have 2 properties:\n // * queryParams\n // * dataAttributes\n // should make organizing this better than squashing\n // all the query params at the top level and extracting\n // the data attributes\n options = assign(\n {},\n {\n components: \"buttons\",\n },\n options\n );\n delete options.dataAttributes;\n\n // NEXT_MAJOR_VERSION if merchant passes an explicit intent,\n // currency, amount, etc, save those for use in createPayment\n // if no explicit param of that type is passed in when calling\n // createPayment to reduce the number of items that need to be\n // duplicated here and in createPayment\n if (options.vault) {\n options.intent = options.intent || \"tokenize\";\n } else {\n options.intent = options.intent || \"authorize\";\n options.currency = options.currency || \"USD\";\n }\n\n src = \"https://www.paypal.com/sdk/js?\";\n this._paypalScript.onload = function () {\n loadPromise.resolve();\n };\n\n Object.keys(dataAttributes).forEach(\n function (attribute) {\n this._paypalScript.setAttribute(\n \"data-\" + attribute.replace(/^data\\-/, \"\"),\n dataAttributes[attribute]\n );\n }.bind(this)\n );\n\n if (options[\"client-id\"]) {\n idPromise = Promise.resolve(options[\"client-id\"]);\n } else {\n idPromise = this.getClientId();\n }\n\n idPromise.then(\n function (id) {\n options[\"client-id\"] = id;\n\n if (this._autoSetDataUserIdToken && userIdToken) {\n this._paypalScript.setAttribute(\"data-user-id-token\", userIdToken);\n\n // preloading improves the rendering time of the PayPal button\n this._attachPreloadPixel({\n id: id,\n userIdToken: userIdToken,\n amount: dataAttributes.amount,\n currency: options.currency,\n merchantId: options[\"merchant-id\"],\n });\n }\n\n this._paypalScript.src = querystring.queryify(src, options);\n document.head.insertBefore(\n this._paypalScript,\n document.head.firstElementChild\n );\n }.bind(this)\n );\n\n return loadPromise.then(\n function () {\n return this;\n }.bind(this)\n );\n};\n\nPayPalCheckout.prototype._attachPreloadPixel = function (options) {\n var request;\n var id = options.id;\n var userIdToken = options.userIdToken;\n var env = this._authorizationInformation.environment;\n var subdomain = env === \"production\" ? \"\" : \"sandbox.\";\n var url = PAYPAL_SDK_PRELOAD_URL.replace(\"{ENV}\", subdomain);\n var preloadOptions = {\n \"client-id\": id,\n \"user-id-token\": userIdToken,\n };\n\n if (options.amount) {\n preloadOptions.amount = options.amount;\n }\n if (options.currency) {\n preloadOptions.currency = options.currency;\n }\n if (options.merchantId) {\n preloadOptions[\"merchant-id\"] = options.merchantId;\n }\n\n request = new XMLHttpRequest();\n request.open(\"GET\", querystring.queryify(url, preloadOptions));\n request.send();\n};\n\nPayPalCheckout.prototype._formatPaymentResourceData = function (\n options,\n config\n) {\n var key;\n var gatewayConfiguration = this._configuration.gatewayConfiguration;\n // NEXT_MAJOR_VERSION default value for intent in PayPal SDK is capture\n // but our integrations default value is authorize. Default this to capture\n // in the next major version.\n var intent = options.intent;\n var paymentResource = {\n // returnUrl and cancelUrl are required in hermes create_payment_resource route\n // but are not used by the PayPal sdk, except to redirect to an error page\n returnUrl: config.returnUrl || \"https://www.paypal.com/checkoutnow/error\",\n cancelUrl: config.cancelUrl || \"https://www.paypal.com/checkoutnow/error\",\n offerPaypalCredit: options.offerCredit === true,\n merchantAccountId: this._merchantAccountId,\n experienceProfile: {\n brandName: options.displayName || gatewayConfiguration.paypal.displayName,\n localeCode: options.locale,\n noShipping: (!options.enableShippingAddress).toString(),\n addressOverride: options.shippingAddressEditable === false,\n landingPageType: options.landingPageType,\n },\n shippingOptions: options.shippingOptions,\n };\n\n if (options.flow === \"checkout\") {\n paymentResource.amount = options.amount;\n paymentResource.currencyIsoCode = options.currency;\n paymentResource.requestBillingAgreement = options.requestBillingAgreement;\n\n if (intent) {\n // 'sale' has been changed to 'capture' in PayPal's backend, but\n // we use an old version with 'sale'. We provide capture as an alias\n // to match the PayPal SDK\n if (intent === \"capture\") {\n intent = \"sale\";\n }\n paymentResource.intent = intent;\n }\n\n if (options.hasOwnProperty(\"lineItems\")) {\n paymentResource.lineItems = options.lineItems;\n }\n\n if (options.hasOwnProperty(\"vaultInitiatedCheckoutPaymentMethodToken\")) {\n paymentResource.vaultInitiatedCheckoutPaymentMethodToken =\n options.vaultInitiatedCheckoutPaymentMethodToken;\n }\n\n if (options.hasOwnProperty(\"shippingOptions\")) {\n paymentResource.shippingOptions = options.shippingOptions;\n }\n\n for (key in options.shippingAddressOverride) {\n if (options.shippingAddressOverride.hasOwnProperty(key)) {\n paymentResource[key] = options.shippingAddressOverride[key];\n }\n }\n\n if (options.hasOwnProperty(\"billingAgreementDetails\")) {\n paymentResource.billingAgreementDetails = options.billingAgreementDetails;\n }\n } else {\n paymentResource.shippingAddress = options.shippingAddressOverride;\n\n if (options.billingAgreementDescription) {\n paymentResource.description = options.billingAgreementDescription;\n }\n }\n\n // this needs to be set outside of the block where add it to the\n // payment request so that a follow up tokenization call can use it,\n // but if a second create payment resource call is made without\n // the correlation id, we want to reset it to undefined so that the\n // tokenization call does not use a stale correlation id\n this._riskCorrelationId = options.riskCorrelationId;\n if (options.riskCorrelationId) {\n paymentResource.correlationId = this._riskCorrelationId;\n }\n\n return paymentResource;\n};\n\n/**\n * @ignore\n * @static\n * @function _verifyConsistentCurrency\n * Verifies that `options.currency` and the currencies for each `shippingOption` the same.\n * @param {object} options `options` provided for `updatePayment`.\n * @returns {boolean} true is currencies match (or no shipping options); false if currencies do not match.\n */\n\nPayPalCheckout.prototype._verifyConsistentCurrency = function (options) {\n if (\n options.currency &&\n options.hasOwnProperty(\"shippingOptions\") &&\n Array.isArray(options.shippingOptions)\n ) {\n return options.shippingOptions.every(function (item) {\n return (\n item.amount &&\n item.amount.currency &&\n options.currency.toLowerCase() === item.amount.currency.toLowerCase()\n );\n });\n }\n\n return true;\n};\n\n/**\n * @ignore\n * @static\n * @function _hasMissingOption\n * @param {object} options All options provided for intiating the PayPal flow.\n * @param {array} required A list of required inputs that must be include as part of the options.\n * @returns {boolean} Returns a boolean.\n */\n\nPayPalCheckout.prototype._hasMissingOption = function (options, required) {\n var i, option;\n\n required = required || [];\n\n if (\n !options.hasOwnProperty(\"amount\") &&\n !options.hasOwnProperty(\"lineItems\")\n ) {\n return true;\n }\n\n for (i = 0; i < required.length; i++) {\n option = required[i];\n\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n\n return false;\n};\n\nPayPalCheckout.prototype._formatUpdatePaymentData = function (options) {\n var self = this;\n var paymentResource = {\n merchantAccountId: this._merchantAccountId,\n paymentId: options.paymentId || options.orderId,\n currencyIsoCode: options.currency,\n };\n\n if (options.hasOwnProperty(\"amount\")) {\n paymentResource.amount = options.amount;\n }\n\n if (options.hasOwnProperty(\"lineItems\")) {\n paymentResource.lineItems = options.lineItems;\n }\n\n if (options.hasOwnProperty(\"shippingOptions\")) {\n paymentResource.shippingOptions = options.shippingOptions;\n }\n\n /* shippingAddress not supported yet */\n if (options.hasOwnProperty(\"shippingAddress\")) {\n analytics.sendEvent(\n self._clientPromise,\n \"paypal-checkout.updatePayment.shippingAddress.provided.by-the-merchant\"\n );\n\n paymentResource.line1 = options.shippingAddress.line1;\n\n if (options.shippingAddress.hasOwnProperty(\"line2\")) {\n paymentResource.line2 = options.shippingAddress.line2;\n }\n\n paymentResource.city = options.shippingAddress.city;\n paymentResource.state = options.shippingAddress.state;\n paymentResource.postalCode = options.shippingAddress.postalCode;\n paymentResource.countryCode = options.shippingAddress.countryCode;\n\n if (options.shippingAddress.hasOwnProperty(\"phone\")) {\n paymentResource.phone = options.shippingAddress.phone;\n }\n\n if (options.shippingAddress.hasOwnProperty(\"recipientName\")) {\n paymentResource.recipientName = options.shippingAddress.recipientName;\n }\n }\n\n return paymentResource;\n};\n\nPayPalCheckout.prototype._formatTokenizeData = function (options, params) {\n var clientConfiguration = this._configuration;\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var isTokenizationKey =\n clientConfiguration.authorizationType === \"TOKENIZATION_KEY\";\n var isVaultFlow = options.flow === \"vault\";\n var correlationId =\n this._riskCorrelationId || params.billingToken || params.ecToken;\n var data = {\n paypalAccount: {\n correlationId: correlationId,\n options: {\n validate: isVaultFlow && !isTokenizationKey && options.vault,\n },\n },\n };\n\n if (isVaultFlow) {\n data.paypalAccount.billingAgreementToken = params.billingToken;\n } else {\n data.paypalAccount.paymentToken = params.paymentId || params.orderId;\n data.paypalAccount.payerId = params.payerId;\n data.paypalAccount.unilateral =\n gatewayConfiguration.paypal.unvettedMerchant;\n\n if (options.intent) {\n data.paypalAccount.intent = options.intent;\n }\n }\n\n if (this._merchantAccountId) {\n data.merchantAccountId = this._merchantAccountId;\n }\n\n return data;\n};\n\nPayPalCheckout.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type,\n };\n\n if (account.details && account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n\n if (account.details && account.details.creditFinancingOffered) {\n payload.creditFinancingOffered = account.details.creditFinancingOffered;\n }\n\n if (account.details && account.details.shippingOptionId) {\n payload.shippingOptionId = account.details.shippingOptionId;\n }\n\n if (account.details && account.details.cobrandedCardLabel) {\n payload.cobrandedCardLabel = account.details.cobrandedCardLabel;\n }\n\n return payload;\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/paypal-checkout.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * paypalCheckoutInstance.teardown();\n * @example <caption>With callback</caption>\n * paypalCheckoutInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPalCheckout.prototype.teardown = function () {\n var self = this;\n\n convertMethodsToError(this, methods(PayPalCheckout.prototype));\n\n if (this._paypalScript && this._paypalScript.parentNode) {\n this._paypalScript.parentNode.removeChild(this._paypalScript);\n }\n\n return this._frameServicePromise\n .catch(function () {\n // no need to error in teardown for an error setting up the frame service\n })\n .then(function () {\n if (!self._frameService) {\n return Promise.resolve();\n }\n\n return self._frameService.teardown();\n });\n};\n\nmodule.exports = wrapPromise.wrapPrototype(PayPalCheckout);\n\n},{\"../lib/analytics\":119,\"../lib/assign\":121,\"../lib/braintree-error\":124,\"../lib/constants\":126,\"../lib/convert-methods-to-error\":127,\"../lib/convert-to-braintree-error\":128,\"../lib/create-assets-url\":129,\"../lib/create-authorization-data\":130,\"../lib/create-deferred-client\":131,\"../lib/frame-service/external\":139,\"../lib/methods\":155,\"../lib/querystring\":157,\"../lib/use-min\":160,\"../paypal/shared/constants\":180,\"./errors\":175,\"@braintree/extended-promise\":34,\"@braintree/wrap-promise\":43}],178:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar frameService = _dereq_(\"../../lib/frame-service/external\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar convertToBraintreeError = _dereq_(\"../../lib/convert-to-braintree-error\");\nvar useMin = _dereq_(\"../../lib/use-min\");\nvar once = _dereq_(\"../../lib/once\");\nvar VERSION = \"3.100.0\";\nvar constants = _dereq_(\"../shared/constants\");\nvar INTEGRATION_TIMEOUT_MS =\n _dereq_(\"../../lib/constants\").INTEGRATION_TIMEOUT_MS;\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar methods = _dereq_(\"../../lib/methods\");\nvar deferred = _dereq_(\"../../lib/deferred\");\nvar errors = _dereq_(\"../shared/errors\");\nvar convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\nvar querystring = _dereq_(\"../../lib/querystring\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @typedef {object} PayPal~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `PayPalAccount`.\n * @property {object} details Additional PayPal account details.\n * @property {string} details.email User's email address.\n * @property {string} details.payerId User's payer ID, the unique identifier for each PayPal account.\n * @property {string} details.firstName User's given name.\n * @property {string} details.lastName User's surname.\n * @property {?string} details.countryCode User's 2 character country code.\n * @property {?string} details.phone User's phone number (e.g. 555-867-5309).\n * @property {?object} details.shippingAddress User's shipping address details, only available if shipping address is enabled.\n * @property {string} details.shippingAddress.recipientName Recipient of postage.\n * @property {string} details.shippingAddress.line1 Street number and name.\n * @property {string} details.shippingAddress.line2 Extended address.\n * @property {string} details.shippingAddress.city City or locality.\n * @property {string} details.shippingAddress.state State or region.\n * @property {string} details.shippingAddress.postalCode Postal code.\n * @property {string} details.shippingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} details.billingAddress User's billing address details.\n * Not available to all merchants; [contact support](https://developer.paypal.com/braintree/help) for details on eligibility and enabling this feature.\n * Alternatively, see `shippingAddress` above as an available client option.\n * @property {string} details.billingAddress.line1 Street number and name.\n * @property {string} details.billingAddress.line2 Extended address.\n * @property {string} details.billingAddress.city City or locality.\n * @property {string} details.billingAddress.state State or region.\n * @property {string} details.billingAddress.postalCode Postal code.\n * @property {string} details.billingAddress.countryCode 2 character country code (e.g. US).\n * @property {?object} creditFinancingOffered This property will only be present when the customer pays with PayPal Credit.\n * @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.\n * @property {string} creditFinancingOffered.totalCost.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalCost.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {number} creditFinancingOffered.term Length of financing terms in months.\n * @property {object} creditFinancingOffered.monthlyPayment This is the estimated amount per month that the customer will need to pay including fees and interest.\n * @property {string} creditFinancingOffered.monthlyPayment.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.monthlyPayment.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {object} creditFinancingOffered.totalInterest Estimated interest or fees amount the payer will have to pay during the lifetime of the loan.\n * @property {string} creditFinancingOffered.totalInterest.value An amount defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm) for the given currency.\n * @property {string} creditFinancingOffered.totalInterest.currency 3 letter currency code as defined by [ISO 4217](https://www.iso.org/iso/home/standards/currency_codes.htm).\n * @property {boolean} creditFinancingOffered.payerAcceptance Status of whether the customer ultimately was approved for and chose to make the payment using the approved installment credit.\n * @property {boolean} creditFinancingOffered.cartAmountImmutable Indicates whether the cart amount is editable after payer's acceptance on PayPal side.\n *\n */\n\n/**\n * @typedef {object} PayPal~tokenizeReturn\n * @property {Function} close A handle to close the PayPal checkout flow.\n * @property {Function} focus A handle to focus the PayPal checkout flow. Note that some browsers (notably iOS Safari) do not support focusing popups. Firefox requires the focus call to occur as the result of a user interaction, such as a button click.\n */\n\n/**\n * @class\n * @param {object} options see {@link module:braintree-web/paypal.create|paypal.create}\n * @classdesc This class represents a PayPal component. Instances of this class can open a PayPal window for authenticating a PayPal account. Any additional UI, such as disabling the page while authentication is taking place, is up to the developer.\n *\n * This component has been deprecated in favor of the {@link PayPalCheckout|PayPal Checkout component}, which provides a fully managed UI. New features will not be added to this component.\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/paypal.create|braintree-web.paypal.create} instead.</strong>\n */\nfunction PayPal(options) {\n this._client = options.client;\n this._assetsUrl =\n options.client.getConfiguration().gatewayConfiguration.paypal.assetsUrl +\n \"/web/\" +\n VERSION;\n this._isDebug = options.client.getConfiguration().isDebug;\n this._loadingFrameUrl =\n this._assetsUrl +\n \"/html/paypal-landing-frame\" +\n useMin(this._isDebug) +\n \".html\";\n this._authorizationInProgress = false;\n}\n\nPayPal.prototype._initialize = function () {\n var self = this;\n var client = this._client;\n var failureTimeout = setTimeout(function () {\n analytics.sendEvent(client, \"paypal.load.timed-out\");\n }, INTEGRATION_TIMEOUT_MS);\n\n return new Promise(function (resolve) {\n frameService.create(\n {\n name: constants.LANDING_FRAME_NAME,\n dispatchFrameUrl:\n self._assetsUrl +\n \"/html/dispatch-frame\" +\n useMin(self._isDebug) +\n \".html\",\n openFrameUrl: self._loadingFrameUrl,\n },\n function (service) {\n self._frameService = service;\n clearTimeout(failureTimeout);\n analytics.sendEvent(client, \"paypal.load.succeeded\");\n resolve(self);\n }\n );\n });\n};\n\n/**\n * Launches the PayPal login flow and returns a nonce payload. Only one PayPal login flow should be active at a time. One way to achieve this is to disable your PayPal button while the flow is open.\n * @public\n * @param {object} options All tokenization options for the PayPal component.\n * @param {string} options.flow Set to 'checkout' for one-time payment flow, or 'vault' for Vault flow. If 'vault' is used with a client token generated with a customer id, the PayPal account will be added to that customer as a saved payment method.\n * @param {string} [options.intent=authorize]\n * * `authorize` - Submits the transaction for authorization but not settlement.\n * * `order` - Validates the transaction without an authorization (i.e. without holding funds). Useful for authorizing and capturing funds up to 90 days after the order has been placed. Only available for Checkout flow.\n * * `sale` - Payment will be immediately submitted for settlement upon creating a transaction.\n * @param {boolean} [options.offerCredit=false] Offers PayPal Credit as the default funding instrument for the transaction. If the customer isn't pre-approved for PayPal Credit, they will be prompted to apply for it.\n * @param {boolean} [options.offerPayLater=false] Offers PayPal Pay Later if the customer qualifies. Defaults to false. Only available with `flow: 'checkout'`.\n * @param {string} [options.useraction]\n * Changes the call-to-action in the PayPal flow. By default the final button will show the localized\n * word for \"Continue\" and implies that the final amount billed is not yet known.\n *\n * Setting this option to `commit` changes the button text to \"Pay Now\" and page text will convey to\n * the user that billing will take place immediately.\n * @param {(string|number)} [options.amount] The amount of the transaction. Required when using the Checkout flow.\n * @param {string} [options.currency] The currency code of the amount, such as 'USD'. Required when using the Checkout flow.\n * @param {string} [options.displayName] The merchant name displayed inside of the PayPal lightbox; defaults to the company name on your Braintree account\n * @param {string} [options.locale=en_US] Use this option to change the language, links, and terminology used in the PayPal flow. This locale will be used unless the buyer has set a preferred locale for their account. If an unsupported locale is supplied, a fallback locale (determined by buyer preference or browser data) will be used and no error will be thrown.\n *\n * Supported locales are:\n * `da_DK`,\n * `de_DE`,\n * `en_AU`,\n * `en_GB`,\n * `en_US`,\n * `es_ES`,\n * `fr_CA`,\n * `fr_FR`,\n * `id_ID`,\n * `it_IT`,\n * `ja_JP`,\n * `ko_KR`,\n * `nl_NL`,\n * `no_NO`,\n * `pl_PL`,\n * `pt_BR`,\n * `pt_PT`,\n * `ru_RU`,\n * `sv_SE`,\n * `th_TH`,\n * `zh_CN`,\n * `zh_HK`,\n * and `zh_TW`.\n *\n * @param {boolean} [options.enableShippingAddress=false] Returns a shipping address object in {@link PayPal#tokenize}.\n * @param {object} [options.shippingAddressOverride] Allows you to pass a shipping address you have already collected into the PayPal payment flow.\n * @param {string} options.shippingAddressOverride.line1 Street address.\n * @param {string} [options.shippingAddressOverride.line2] Street address (extended).\n * @param {string} options.shippingAddressOverride.city City.\n * @param {string} options.shippingAddressOverride.state State.\n * @param {string} options.shippingAddressOverride.postalCode Postal code.\n * @param {string} options.shippingAddressOverride.countryCode Country.\n * @param {string} [options.shippingAddressOverride.phone] Phone number.\n * @param {string} [options.shippingAddressOverride.recipientName] Recipient's name.\n * @param {boolean} [options.shippingAddressEditable=true] Set to false to disable user editing of the shipping address.\n * @param {string} [options.billingAgreementDescription] Use this option to set the description of the preapproved payment agreement visible to customers in their PayPal profile during Vault flows. Max 255 characters.\n * @param {string} [options.landingPageType] Use this option to specify the PayPal page to display when a user lands on the PayPal site to complete the payment.\n * * `login` - A PayPal account login page is used.\n * * `billing` - A non-PayPal account landing page is used.\n * @param {callback} callback The second argument, <code>data</code>, is a {@link PayPal~tokenizePayload|tokenizePayload}.\n * @example\n * <caption>Tokenizing with the vault flow</caption>\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // if there is any other part of the page that must be disabled\n * // while authentication is in progress, do so now\n *\n * // Because PayPal tokenization opens a popup, this must be called\n * // as a result of a user action, such as a button click.\n * paypalInstance.tokenize({\n * flow: 'vault' // Required\n * // Any other tokenization options\n * }, function (tokenizeErr, payload) {\n * button.removeAttribute('disabled');\n *\n * // if any other part of the page was disabled, re-enable now\n *\n * if (tokenizeErr) {\n * // Handle tokenization errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'PAYPAL_POPUP_CLOSED':\n * console.error('Customer closed PayPal popup.');\n * break;\n * case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('PayPal tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'PAYPAL_FLOW_FAILED':\n * console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * } else {\n * // Submit payload.nonce to your server\n * }\n * });\n * });\n\n * @example\n * <caption>Tokenizing with the checkout flow</caption>\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because PayPal tokenization opens a popup, this must be called\n * // as a result of a user action, such as a button click.\n * paypalInstance.tokenize({\n * flow: 'checkout', // Required\n * amount: '10.00', // Required\n * currency: 'USD' // Required\n * // Any other tokenization options\n * }, function (tokenizeErr, payload) {\n * button.removeAttribute('disabled');\n *\n * if (tokenizeErr) {\n * // Handle tokenization errors or premature flow closure\n *\n * switch (tokenizeErr.code) {\n * case 'PAYPAL_POPUP_CLOSED':\n * console.error('Customer closed PayPal popup.');\n * break;\n * case 'PAYPAL_ACCOUNT_TOKENIZATION_FAILED':\n * console.error('PayPal tokenization failed. See details:', tokenizeErr.details);\n * break;\n * case 'PAYPAL_FLOW_FAILED':\n * console.error('Unable to initialize PayPal flow. Are your options correct?', tokenizeErr.details);\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * } else {\n * // Submit payload.nonce to your server\n * }\n * });\n * });\n * @returns {Promise|PayPal~tokenizeReturn} A handle to manage the PayPal checkout frame. If no callback is provided, returns a promise.\n */\nPayPal.prototype.tokenize = function (options, callback) {\n var self = this;\n var client = this._client;\n var tokenizePromise, optionError;\n\n if (callback) {\n callback = once(deferred(callback));\n }\n\n if (!options || !constants.FLOW_ENDPOINTS.hasOwnProperty(options.flow)) {\n optionError = new BraintreeError(errors.PAYPAL_FLOW_OPTION_REQUIRED);\n\n if (callback) {\n callback(optionError);\n\n return this._frameService.createNoopHandler();\n }\n\n return Promise.reject(optionError);\n }\n\n tokenizePromise = new Promise(function (resolve, reject) {\n if (self._authorizationInProgress) {\n analytics.sendEvent(client, \"paypal.tokenization.error.already-opened\");\n\n reject(new BraintreeError(errors.PAYPAL_TOKENIZATION_REQUEST_ACTIVE));\n } else {\n self._authorizationInProgress = true;\n\n if (!window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.opened\");\n }\n\n if (options.offerCredit === true) {\n analytics.sendEvent(client, \"paypal.credit.offered\");\n }\n\n if (options.offerPayLater === true) {\n analytics.sendEvent(client, \"paypal.paylater.offered\");\n }\n\n self._navigateFrameToAuth(options).catch(reject);\n // self MUST happen after _navigateFrameToAuth for Metro browsers to work.\n self._frameService.open(\n {},\n self._createFrameServiceCallback(options, resolve, reject)\n );\n }\n });\n\n if (callback) {\n tokenizePromise\n .then(function (res) {\n callback(null, res);\n })\n .catch(callback);\n\n return this._frameService.createHandler({\n beforeClose: function () {\n analytics.sendEvent(client, \"paypal.tokenization.closed.by-merchant\");\n },\n });\n }\n\n return tokenizePromise;\n};\n\nPayPal.prototype._createFrameServiceCallback = function (\n options,\n resolve,\n reject\n) {\n var self = this;\n var client = this._client;\n\n if (window.popupBridge) {\n return function (err, payload) {\n var canceled =\n payload && payload.path && payload.path.substring(0, 7) === \"/cancel\";\n\n self._authorizationInProgress = false;\n\n // `err` exists when the user clicks \"Done\" button of browser view\n if (err || canceled) {\n analytics.sendEvent(\n client,\n \"paypal.tokenization.closed-popupbridge.by-user\"\n );\n // Call merchant's tokenize callback with an error\n reject(new BraintreeError(errors.PAYPAL_POPUP_CLOSED));\n } else if (payload) {\n self\n ._tokenizePayPal(options, payload.queryItems)\n .then(resolve)\n .catch(reject);\n }\n };\n }\n\n return function (err, params) {\n self._authorizationInProgress = false;\n\n if (err) {\n if (err.code === \"FRAME_SERVICE_FRAME_CLOSED\") {\n analytics.sendEvent(client, \"paypal.tokenization.closed.by-user\");\n reject(new BraintreeError(errors.PAYPAL_POPUP_CLOSED));\n } else if (\n err.code &&\n err.code.indexOf(\"FRAME_SERVICE_FRAME_OPEN_FAILED\") > -1\n ) {\n reject(\n new BraintreeError({\n code: errors.PAYPAL_POPUP_OPEN_FAILED.code,\n type: errors.PAYPAL_POPUP_OPEN_FAILED.type,\n message: errors.PAYPAL_POPUP_OPEN_FAILED.message,\n details: {\n originalError: err,\n },\n })\n );\n }\n } else if (params) {\n self._tokenizePayPal(options, params).then(resolve).catch(reject);\n }\n };\n};\n\nPayPal.prototype._tokenizePayPal = function (options, params) {\n var self = this;\n var client = this._client;\n\n if (!window.popupBridge) {\n this._frameService.redirect(this._loadingFrameUrl);\n }\n\n return client\n .request({\n endpoint: \"payment_methods/paypal_accounts\",\n method: \"post\",\n data: this._formatTokenizeData(options, params),\n })\n .then(function (response) {\n var payload = self._formatTokenizePayload(response);\n\n if (window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.success-popupbridge\");\n } else {\n analytics.sendEvent(client, \"paypal.tokenization.success\");\n }\n\n if (payload.creditFinancingOffered) {\n analytics.sendEvent(client, \"paypal.credit.accepted\");\n }\n\n self._frameService.close();\n\n return payload;\n })\n .catch(function (err) {\n if (window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.failed-popupbridge\");\n } else {\n analytics.sendEvent(client, \"paypal.tokenization.failed\");\n }\n\n self._frameService.close();\n\n return Promise.reject(\n convertToBraintreeError(err, {\n type: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.type,\n code: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.code,\n message: errors.PAYPAL_ACCOUNT_TOKENIZATION_FAILED.message,\n })\n );\n });\n};\n\nPayPal.prototype._formatTokenizePayload = function (response) {\n var payload;\n var account = {};\n\n if (response.paypalAccounts) {\n account = response.paypalAccounts[0];\n }\n\n payload = {\n nonce: account.nonce,\n details: {},\n type: account.type,\n };\n\n if (account.details && account.details.payerInfo) {\n payload.details = account.details.payerInfo;\n }\n\n if (account.details && account.details.creditFinancingOffered) {\n payload.creditFinancingOffered = account.details.creditFinancingOffered;\n }\n\n return payload;\n};\n\nPayPal.prototype._formatTokenizeData = function (options, params) {\n var clientConfiguration = this._client.getConfiguration();\n var gatewayConfiguration = clientConfiguration.gatewayConfiguration;\n var isTokenizationKey =\n clientConfiguration.authorizationType === \"TOKENIZATION_KEY\";\n var data = {\n paypalAccount: {\n correlationId: params.ba_token || params.token,\n options: {\n validate: options.flow === \"vault\" && !isTokenizationKey,\n },\n },\n };\n\n if (params.ba_token) {\n data.paypalAccount.billingAgreementToken = params.ba_token;\n } else {\n data.paypalAccount.paymentToken = params.paymentId;\n data.paypalAccount.payerId = params.PayerID;\n data.paypalAccount.unilateral =\n gatewayConfiguration.paypal.unvettedMerchant;\n\n if (options.hasOwnProperty(\"intent\")) {\n data.paypalAccount.intent = options.intent;\n }\n }\n\n return data;\n};\n\nPayPal.prototype._navigateFrameToAuth = function (options) {\n var self = this;\n var client = this._client;\n var endpoint = \"paypal_hermes/\" + constants.FLOW_ENDPOINTS[options.flow];\n\n return client\n .request({\n endpoint: endpoint,\n method: \"post\",\n data: this._formatPaymentResourceData(options),\n })\n .then(function (response) {\n var redirectUrl;\n\n if (options.flow === \"checkout\") {\n redirectUrl = response.paymentResource.redirectUrl;\n } else {\n redirectUrl = response.agreementSetup.approvalUrl;\n }\n\n if (options.useraction === \"commit\") {\n redirectUrl = querystring.queryify(redirectUrl, {\n useraction: \"commit\",\n });\n }\n\n if (window.popupBridge) {\n analytics.sendEvent(client, \"paypal.tokenization.opened-popupbridge\");\n }\n\n self._frameService.redirect(redirectUrl);\n })\n .catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n self._frameService.close();\n self._authorizationInProgress = false;\n\n if (status === 422) {\n return Promise.reject(\n new BraintreeError({\n type: errors.PAYPAL_INVALID_PAYMENT_OPTION.type,\n code: errors.PAYPAL_INVALID_PAYMENT_OPTION.code,\n message: errors.PAYPAL_INVALID_PAYMENT_OPTION.message,\n details: {\n originalError: err,\n },\n })\n );\n }\n\n return Promise.reject(\n convertToBraintreeError(err, {\n type: errors.PAYPAL_FLOW_FAILED.type,\n code: errors.PAYPAL_FLOW_FAILED.code,\n message: errors.PAYPAL_FLOW_FAILED.message,\n })\n );\n });\n};\n\nPayPal.prototype._formatPaymentResourceData = function (options) {\n var key;\n var gatewayConfiguration =\n this._client.getConfiguration().gatewayConfiguration;\n var serviceId = this._frameService._serviceId;\n var paymentResource = {\n returnUrl:\n gatewayConfiguration.paypal.assetsUrl +\n \"/web/\" +\n VERSION +\n \"/html/redirect-frame\" +\n useMin(this._isDebug) +\n \".html?channel=\" +\n serviceId,\n cancelUrl:\n gatewayConfiguration.paypal.assetsUrl +\n \"/web/\" +\n VERSION +\n \"/html/cancel-frame\" +\n useMin(this._isDebug) +\n \".html?channel=\" +\n serviceId,\n offerPaypalCredit: options.offerCredit === true,\n offerPayLater: options.offerPayLater === true,\n experienceProfile: {\n brandName: options.displayName || gatewayConfiguration.paypal.displayName,\n localeCode: options.locale,\n noShipping: (!options.enableShippingAddress).toString(),\n addressOverride: options.shippingAddressEditable === false,\n landingPageType: options.landingPageType,\n },\n };\n\n if (\n window.popupBridge &&\n typeof window.popupBridge.getReturnUrlPrefix === \"function\"\n ) {\n paymentResource.returnUrl =\n window.popupBridge.getReturnUrlPrefix() + \"return\";\n paymentResource.cancelUrl =\n window.popupBridge.getReturnUrlPrefix() + \"cancel\";\n }\n\n if (options.flow === \"checkout\") {\n paymentResource.amount = options.amount;\n paymentResource.currencyIsoCode = options.currency;\n\n if (options.hasOwnProperty(\"intent\")) {\n paymentResource.intent = options.intent;\n }\n\n for (key in options.shippingAddressOverride) {\n if (options.shippingAddressOverride.hasOwnProperty(key)) {\n paymentResource[key] = options.shippingAddressOverride[key];\n }\n }\n } else {\n paymentResource.shippingAddress = options.shippingAddressOverride;\n\n if (options.billingAgreementDescription) {\n paymentResource.description = options.billingAgreementDescription;\n }\n }\n\n return paymentResource;\n};\n\n/**\n * Closes the PayPal window if it is open.\n * @public\n * @example\n * paypalInstance.closeWindow();\n * @returns {void}\n */\nPayPal.prototype.closeWindow = function () {\n if (this._authorizationInProgress) {\n analytics.sendEvent(this._client, \"paypal.tokenize.closed.by-merchant\");\n }\n this._frameService.close();\n};\n\n/**\n * Focuses the PayPal window if it is open.\n * @public\n * @example\n * paypalInstance.focusWindow();\n * @returns {void}\n */\nPayPal.prototype.focusWindow = function () {\n this._frameService.focus();\n};\n\n/**\n * Cleanly remove anything set up by {@link module:braintree-web/paypal.create|create}.\n * @public\n * @param {callback} [callback] Called on completion.\n * @example\n * paypalInstance.teardown();\n * @example <caption>With callback</caption>\n * paypalInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nPayPal.prototype.teardown = wrapPromise(function () {\n var self = this; // eslint-disable-line no-invalid-this\n\n self._frameService.teardown();\n\n convertMethodsToError(self, methods(PayPal.prototype));\n\n analytics.sendEvent(self._client, \"paypal.teardown-completed\");\n\n return Promise.resolve();\n});\n\nmodule.exports = PayPal;\n\n},{\"../../lib/analytics\":119,\"../../lib/braintree-error\":124,\"../../lib/constants\":126,\"../../lib/convert-methods-to-error\":127,\"../../lib/convert-to-braintree-error\":128,\"../../lib/deferred\":132,\"../../lib/frame-service/external\":139,\"../../lib/methods\":155,\"../../lib/once\":156,\"../../lib/querystring\":157,\"../../lib/use-min\":160,\"../shared/constants\":180,\"../shared/errors\":181,\"@braintree/wrap-promise\":43}],179:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/paypal\n * @description A component to integrate with PayPal.\n * @deprecated Use the {@link PayPalCheckout|PayPal Checkout component} instead.\n */\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar errors = _dereq_(\"./shared/errors\");\nvar PayPal = _dereq_(\"./external/paypal\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} callback The second argument, `data`, is the {@link PayPal} instance.\n * @example\n * // We recommend creating your PayPal button with button.js\n * // For an example, see https://codepen.io/braintree/pen/LNKJWa\n * var paypalButton = document.querySelector('.paypal-button');\n *\n * braintree.client.create({\n * authorization: CLIENT_AUTHORIZATION\n * }, function (clientErr, clientInstance) {\n * if (clientErr) {\n * console.error('Error creating client:', clientErr);\n * return;\n * }\n *\n * braintree.paypal.create({\n * client: clientInstance\n * }, function (paypalErr, paypalInstance) {\n * if (paypalErr) {\n * console.error('Error creating PayPal:', paypalErr);\n * return;\n * }\n *\n * paypalButton.removeAttribute('disabled');\n *\n * // When the button is clicked, attempt to tokenize.\n * paypalButton.addEventListener('click', function (event) {\n * // Because tokenization opens a popup, this has to be called as a result of\n * // customer action, like clicking a button. You cannot call this at any time.\n * paypalInstance.tokenize({\n * flow: 'vault'\n * // For more tokenization options, see the full PayPal tokenization documentation\n * // https://braintree.github.io/braintree-web/current/PayPal.html#tokenize\n * }, function (tokenizeErr, payload) {\n * if (tokenizeErr) {\n * if (tokenizeErr.type !== 'CUSTOMER') {\n * console.error('Error tokenizing:', tokenizeErr);\n * }\n * return;\n * }\n *\n * // Tokenization succeeded\n * paypalButton.setAttribute('disabled', true);\n * console.log('Got a nonce! You should submit this to your server.');\n * console.log(payload.nonce);\n * });\n * }, false);\n * });\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"PayPal\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n var pp;\n var config = client.getConfiguration();\n\n options.client = client;\n\n if (config.gatewayConfiguration.paypalEnabled !== true) {\n return Promise.reject(new BraintreeError(errors.PAYPAL_NOT_ENABLED));\n }\n\n analytics.sendEvent(options.client, \"paypal.initialized\");\n\n pp = new PayPal(options);\n\n return pp._initialize();\n });\n}\n\n/**\n * @static\n * @function isSupported\n * @description Returns true if PayPal [supports this browser](index.html#browser-support-webviews).\n * @example\n * if (braintree.paypal.isSupported()) {\n * // Add PayPal button to the page\n * } else {\n * // Hide PayPal payment option\n * }\n * @returns {Boolean} Returns true if PayPal supports this browser.\n */\nfunction isSupported() {\n return true;\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n isSupported: isSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./external/paypal\":178,\"./shared/errors\":181,\"@braintree/wrap-promise\":43}],180:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n LANDING_FRAME_NAME: \"braintreepaypallanding\",\n FLOW_ENDPOINTS: {\n checkout: \"create_payment_resource\",\n vault: \"setup_billing_agreement\",\n },\n REQUIRED_OPTIONS: [\"paymentId\", \"currency\"],\n};\n\n},{}],181:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.PayPal - Creation Error Codes\n * @description Errors that occur when [creating the PayPal component](./module-braintree-web_paypal.html#.create).\n * @property {MERCHANT} PAYPAL_NOT_ENABLED Occurs when PayPal is not enabled on the Braintree control panel.\n */\n\n/**\n * @name BraintreeError.PayPal - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./PayPal.html#tokenize).\n * @property {MERCHANT} PAYPAL_TOKENIZATION_REQUEST_ACTIVE Occurs when a tokenization request is already in progress.\n * @property {MERCHANT} PAYPAL_FLOW_OPTION_REQUIRED Occurs when flow option is not provided.\n * @property {NETWORK} PAYPAL_ACCOUNT_TOKENIZATION_FAILED Occurs when PayPal account could not be tokenized.\n * @property {NETWORK} PAYPAL_FLOW_FAILED Occurs when PayPal flow could not be initiated.\n * @property {MERCHANT} PAYPAL_POPUP_OPEN_FAILED Occurs when PayPal window could not be opened.\n * @property {CUSTOMER} PAYPAL_POPUP_CLOSED Occurs when customer closes the PayPal window before completing the flow.\n * @property {MERCHANT} PAYPAL_INVALID_PAYMENT_OPTION Occurs when an invalid payment option is passed.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n PAYPAL_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_NOT_ENABLED\",\n message: \"PayPal is not enabled for this merchant.\",\n },\n PAYPAL_TOKENIZATION_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_TOKENIZATION_REQUEST_ACTIVE\",\n message: \"Another tokenization request is active.\",\n },\n PAYPAL_ACCOUNT_TOKENIZATION_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_ACCOUNT_TOKENIZATION_FAILED\",\n message: \"Could not tokenize user's PayPal account.\",\n },\n PAYPAL_FLOW_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"PAYPAL_FLOW_FAILED\",\n message: \"Could not initialize PayPal flow.\",\n },\n PAYPAL_FLOW_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_FLOW_OPTION_REQUIRED\",\n message: \"PayPal flow property is invalid or missing.\",\n },\n PAYPAL_POPUP_OPEN_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_POPUP_OPEN_FAILED\",\n message:\n \"PayPal popup failed to open, make sure to tokenize in response to a user action.\",\n },\n PAYPAL_POPUP_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"PAYPAL_POPUP_CLOSED\",\n message: \"Customer closed PayPal popup before authorizing.\",\n },\n PAYPAL_INVALID_PAYMENT_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"PAYPAL_INVALID_PAYMENT_OPTION\",\n message: \"PayPal payment options are invalid.\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],182:[function(_dereq_,module,exports){\n\"use strict\";\n/** @module braintree-web/preferred-payment-methods */\n\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar PreferredPaymentMethods = _dereq_(\"./preferred-payment-methods\");\nvar VERSION = \"3.100.0\";\n\n// NEXT_MAJOR_VERSION\n// Remove this integration entirely. It doesn't work, isn't documented, and otherwise isn't going to be pursued further beyond the non-operational beta it is in.\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link PreferredPaymentMethods} instance.\n * @example\n * braintree.preferredPaymentMethods.create({\n * client: clientInstance\n * }).then(function (preferredPaymentMethodsInstance) {\n * // preferredPaymentMethodsInstance is ready to be used.\n * }).catch(function (error) {\n * // handle creation error\n * });\n * @returns {Promise|void} Returns a Promise with resolves with the PreferredPaymentMethods instance.\n */\nfunction create(options) {\n var name = \"PreferredPaymentMethods\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n var instance = new PreferredPaymentMethods();\n\n return instance.initialize(options);\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"./preferred-payment-methods\":183,\"@braintree/wrap-promise\":43}],183:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\n\n/**\n * @class\n * @param {object} options See {@link module:braintree-web/preferred-payment-methods.create|preferred-payment-methods.create}\n */\nfunction PreferredPaymentMethods() {}\n\nPreferredPaymentMethods.prototype.initialize = function (options) {\n var self = this;\n\n this._clientPromise = createDeferredClient\n .create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: \"PreferredPaymentMethods\",\n })\n .catch(function (err) {\n self._setupError = err;\n\n return Promise.reject(err);\n });\n\n analytics.sendEvent(\n this._clientPromise,\n \"preferred-payment-methods.initialized\"\n );\n\n return Promise.resolve(this);\n};\n\n/**\n * Fetches information about which payment methods are preferred on the device.\n * Used to determine which payment methods are given preference in your UI,\n * not whether they are presented entirely.\n *\n * This class is currently in beta and may change in future releases.\n * @public\n * @returns {Promise|void} Returns a promise if no callback is provided.\n * @example\n * <caption>Preferred Payment Methods</caption>\n * preferredPaymentMethodsInstance.fetchPreferredPaymentMethods().then(function (result) {\n * if (result.paypalPreferred) {\n * // PayPal preferred\n * } else {\n * // PayPal not preferred\n * }\n *\n * if (result.venmoPreferred) {\n * // Venmo preferred\n * } else {\n * // Venmo not preferred\n * }\n * });\n */\nPreferredPaymentMethods.prototype.fetchPreferredPaymentMethods = function () {\n var client;\n var self = this;\n\n return this._clientPromise\n .then(function (clientInstance) {\n client = clientInstance;\n\n return client.request({\n api: \"graphQLApi\",\n data: {\n query:\n \"query PreferredPaymentMethods { \" +\n \"preferredPaymentMethods { \" +\n \"paypalPreferred \" +\n \"venmoPreferred \" +\n \"} \" +\n \"}\",\n },\n });\n })\n .then(function (result) {\n var paypalPreferred = result.data.preferredPaymentMethods.paypalPreferred;\n var venmoPreferred = result.data.preferredPaymentMethods.venmoPreferred;\n\n analytics.sendEvent(\n client,\n \"preferred-payment-methods.paypal.api-detected.\" + paypalPreferred\n );\n analytics.sendEvent(\n client,\n \"preferred-payment-methods.venmo.api-detected.\" + venmoPreferred\n );\n\n return {\n paypalPreferred: paypalPreferred,\n venmoPreferred: venmoPreferred,\n };\n })\n .catch(function () {\n if (self._setupError) {\n return Promise.reject(self._setupError);\n }\n\n analytics.sendEvent(client, \"preferred-payment-methods.api-error\");\n\n return {\n paypalPreferred: false,\n venmoPreferred: false,\n };\n });\n};\n\nmodule.exports = wrapPromise.wrapPrototype(PreferredPaymentMethods);\n\n},{\"../lib/analytics\":119,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"@braintree/wrap-promise\":43}],184:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar sepaErrors = _dereq_(\"../shared/errors\");\nvar frameService = _dereq_(\"../../lib/frame-service/external\");\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar useMin = _dereq_(\"../../lib/use-min\");\nvar billingAddressOptions =\n _dereq_(\"../shared/constants\").BILLING_ADDRESS_OPTIONS;\nvar snakeCaseToCamelCase = _dereq_(\"../../lib/snake-case-to-camel-case\");\n\nvar POPUP_WIDTH = 400;\nvar POPUP_HEIGHT = 570;\n\n/**\n * @ignore\n * @typedef CreateMandateResponse\n * @property {string} approvalUrl The URL to present to the customer for payment approval.\n * @property {string} last4 The last four digits of the iban.\n * @property {string} bankReferenceToken The tokenized payment source to fun the payment.\n */\n\n/**\n *\n * A function that creates a mandate so that we can present the mandate to the customer via a popup.\n *\n * @ignore\n * @static\n * @function createMandate\n * @param {object} client The Braintree client.\n * @param {object} options All options for intiating the SEPA payment flow.\n * @param {string} [options.accountHolderName] The account holder name.\n * @param {object} [options.billingAddress] The customer's billing address\n * @param {string} [options.billingAddress.addressLine1] Line 1 of the Address (eg. number, street, etc). An error will occur if this address is not valid.\n * @param {string} [options.billingAddress.addressLine2] Line 2 of the Address (eg. suite, apt #, etc.). An error will occur if this address is not valid.\n * @param {string} [options.billingAddress.adminArea1] Customer's city.\n * @param {string} [options.billingAddress.adminArea2] Customer's region or state.\n * @param {string} [options.billingAddress.postalCode] Customer's postal code.\n * @param {string} [options.cancelUrl] The URL to redirect to if authorization is cancelled.\n * @param {string} [options.countryCode] The customer's country code. Also used as billing address country code.\n * @param {string} [options.customerId] The customer's id.\n * @param {string} [options.iban] The customer's International Bank Account Number.\n * @param {string} [options.locale] The BCP 47-formatted locale. See https://developer.paypal.com/reference/locale-codes/ for a list of possible values.\n * @param {string} [options.mandateType] Specify ONE_OFF or RECURRENT payment.\n * @param {string} [options.merchantAccountId] The merchant's account id.\n * @param {string} [options.merchantId] The merchant id.\n * @param {string} [options.returnUrl] The URL to redirect to if authorization is successful.\n * @returns {Promise<CreateMandateResponse|Error>} Returns a promise with the mandate response or an error.\n */\n\nfunction createMandate(client, options) {\n // Disabling eslint because api is expecting snake_case format for the keys\n /* eslint-disable */\n var data = {\n sepa_debit: {\n account_holder_name: options.accountHolderName,\n billing_address: {\n country_code: options.countryCode,\n },\n iban: options.iban,\n merchant_or_partner_customer_id: options.customerId,\n mandate_type: options.mandateType,\n },\n locale: options.locale,\n cancel_url: options.cancelUrl,\n return_url: options.returnUrl,\n merchant_account_id: options.merchantAccountId,\n };\n\n if (options.billingAddress) {\n billingAddressOptions.forEach(function (option) {\n var ccOption = snakeCaseToCamelCase(option);\n if (ccOption in options.billingAddress) {\n data.sepa_debit.billing_address[option] =\n options.billingAddress[ccOption]; // camelCase equivilent of option (eg. postal_code = postalCode) ]\n }\n });\n }\n /* eslint-enable */\n\n return client\n .request({\n api: \"clientApi\",\n method: \"post\",\n endpoint: \"sepa_debit\",\n data: data,\n })\n .then(function (response) {\n var sepaDebitAccount = response.message.body.sepaDebitAccount;\n\n if (!sepaDebitAccount) {\n throw new BraintreeError(sepaErrors.SEPA_CREATE_MANDATE_FAILED);\n }\n\n return {\n approvalUrl: sepaDebitAccount.approvalUrl,\n last4: sepaDebitAccount.last4,\n bankReferenceToken: sepaDebitAccount.bankReferenceToken,\n };\n })\n .catch(function () {\n throw new BraintreeError(sepaErrors.SEPA_CREATE_MANDATE_FAILED);\n });\n}\n\n/**\n *\n * A function for opening and managing the popup used for authorization.\n *\n * @ignore\n * @param {string} client The Braintree client.\n * @param {string} options The input options needed to manage the popup portion of the flow.\n * @param {string} [options.assetsUrl] The url to the Braintree asset to be used in frameservice.\n * @param {string} [options.approvalUrl] The url to open for SEPA authorization. It is `approvalUrl` coming back from the mandate creation, but commonly refered to as the mandate link.\n * @param {string} [options.debug] Whether to use debugging modes or not.\n * @returns {Promise<void|Error>} Returns a promise.\n */\nfunction openPopup(client, options) {\n var popupName = \"sepadirectdebit\";\n var assetsBaseUrl = options.assetsUrl + \"/html\";\n var debug = options.debug || false;\n\n return new Promise(function (resolve, reject) {\n var popupLocation = centeredPopupDimensions();\n\n frameService.create(\n {\n name: popupName,\n dispatchFrameUrl:\n assetsBaseUrl + \"/dispatch-frame\" + useMin(debug) + \".html\",\n openFrameUrl:\n assetsBaseUrl + \"/sepa-landing-frame\" + useMin(debug) + \".html\",\n top: popupLocation.top,\n left: popupLocation.left,\n height: POPUP_HEIGHT,\n width: POPUP_WIDTH,\n },\n function (frameServiceInstance) {\n analytics.sendEvent(client, \"sepa.popup.initialized\");\n frameServiceInstance.open({}, function (err, params) {\n if (mandateApproved(params)) {\n frameServiceInstance.close();\n\n return resolve();\n }\n\n if (customerCanceled(params, err)) {\n frameServiceInstance.close();\n\n return reject(\n new BraintreeError(sepaErrors.SEPA_CUSTOMER_CANCELED)\n );\n }\n\n frameServiceInstance.close();\n\n return reject(\n new BraintreeError(sepaErrors.SEPA_TOKENIZATION_FAILED)\n );\n });\n\n frameServiceInstance.redirect(options.approvalUrl);\n }\n );\n });\n}\n\nfunction mandateApproved(params) {\n return params && params.success;\n}\n\nfunction customerCanceled(params, error) {\n return (\n (params && params.cancel) ||\n (error && error.code === \"FRAME_SERVICE_FRAME_CLOSED\")\n );\n}\n\nfunction centeredPopupDimensions() {\n var popupTop =\n Math.round((window.outerHeight - POPUP_HEIGHT) / 2) + window.screenTop;\n var popupLeft =\n Math.round((window.outerWidth - POPUP_WIDTH) / 2) + window.screenLeft;\n\n return {\n top: popupTop,\n left: popupLeft,\n };\n}\n\n/**\n *\n * A function that creates a mandate so that we can present the mandate to the customer via a popup.\n *\n * @ignore\n * @static\n * @function handleApproval\n * @param {object} client The Braintree client.\n * @param {object} options All options for intiating the SEPA payment flow.\n * @param {string} [options.bankReferenceToken] The tokenized payment source to fun the payment.\n * @param {string} [options.customerId] The customer's id.\n * @param {string} [options.last4] The last four digits of iban.\n * @param {string} [options.mandateType] The mandate type being used. Specify ONE_OFF or RECURRENT payment.\n * @param {string} [options.merchantAccountId] The merchant's account id.\n * @param {string} [options.merchantId] The merchant id.\n * @returns {Promise<tokenizePayload|Error>} Returns a promise with the approval response or an error.\n */\n\nfunction handleApproval(client, options) {\n // Disabling eslint because api is expecting snake_case format for the keys\n /* eslint-disable */\n var data = {\n sepa_debit_account: {\n last_4: options.last4,\n merchant_or_partner_customer_id: options.customerId,\n bank_reference_token: options.bankReferenceToken,\n mandate_type: options.mandateType,\n },\n merchant_account_id: options.merchantAccountId,\n };\n\n /* eslint-enable */\n return client\n .request({\n api: \"clientApi\",\n method: \"post\",\n endpoint: \"payment_methods/sepa_debit_accounts\",\n data: data,\n })\n .then(function (response) {\n if (!response.nonce) {\n throw new BraintreeError(sepaErrors.SEPA_TRANSACTION_FAILED);\n }\n\n return {\n nonce: response.nonce,\n ibanLastFour: options.last4,\n customerId: options.customerId,\n mandateType: options.mandateType,\n };\n })\n .catch(function () {\n throw new BraintreeError(sepaErrors.SEPA_TRANSACTION_FAILED);\n });\n}\n\nmodule.exports = {\n createMandate: createMandate,\n openPopup: openPopup,\n handleApproval: handleApproval,\n POPUP_WIDTH: POPUP_WIDTH,\n POPUP_HEIGHT: POPUP_HEIGHT,\n};\n\n},{\"../../lib/analytics\":119,\"../../lib/braintree-error\":124,\"../../lib/frame-service/external\":139,\"../../lib/snake-case-to-camel-case\":159,\"../../lib/use-min\":160,\"../shared/constants\":187,\"../shared/errors\":188}],185:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar sepaErrors = _dereq_(\"../shared/errors\");\nvar constants = _dereq_(\"../shared/constants\");\nvar mandates = _dereq_(\"./mandate\");\nvar hasMissingOption = _dereq_(\"../shared/has-missing-option\");\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar VERSION = \"3.100.0\";\nvar assign = _dereq_(\"../../lib/assign\").assign;\n\n/**\n * @class\n * @param {object} options see {@link module:braintree-web/sepa.create|sepa.create}\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/sepa.create|braintree-web.sepa.create} instead.</strong>\n * @classdesc This class represents a SEPA component produced by {@link module:braintree-web/sepa.create|braintree-web.sepa.create}. Instances provide methods for tokenizing SEPA payments.\n */\nfunction SEPA(options) {\n var getConfiguration = options.client.getConfiguration();\n\n this._client = options.client;\n this._assetsUrl =\n getConfiguration.gatewayConfiguration.assetsUrl + \"/web/\" + VERSION;\n this._isDebug = getConfiguration.isDebug;\n this._returnUrl = this._assetsUrl + \"/html/redirect-frame.html?success=1\";\n this._cancelUrl = this._assetsUrl + \"/html/redirect-frame.html?cancel=1\";\n\n analytics.sendEvent(this._client, \"sepa.component.initialized\");\n}\n\n/**\n * SEPA tokenize payload.\n * @typedef SEPA~tokenizePayload\n * @property {string} nonce The payment nonce.\n * @property {string} ibanLastFour The last four digits of the customer's IBAN.\n * @property {string} mandateType The specified mandateType used.\n * @property {string} customerId The provided customer id.\n */\n\n/**\n * @public\n * @param {object} options All options for intiating the SEPA payment flow.\n * @param {string} [options.accountHolderName] The account holder name.\n * @param {string} [options.customerId] The customer's id.\n * @param {string} [options.iban] The customer's International Bank Account Number.\n * @param {string} [options.mandateType] Specify ONE_OFF or RECURRENT payment.\n * @param {string} [options.countryCode] The customer's country code.\n * @param {string} [options.merchantAccountId] The merchant's account id.\n * @param {callback} [callback] The first argument is an error object, where the second is a {@link SEPA~tokenizePayload|tokenizePayload}\n * @returns {(Promise<tokenizePayload|error>)} Returns a promise if no callback is provided.\n *\n * @example\n * button.addEventListener('click', function () {\n * var tokenizeInputs = {\n * accountHolderName: \"some-accnt-holder-name\",\n * customerId: \"a-customer-id\",\n * iban: \"a-full-iban\",\n * mandateType: \"ONE_OFF\",\n * countryCode: \"LI\",\n * merchantAccountId: \"a-merchant-account-id\"\n * }\n * sepaInstance.tokenize(tokenizeInputs).then(function (payload) {\n * // Submit payload.nonce to your server\n * }).catch(function(tokenizationErr) {\n * // Handle errors in the flow\n * })\n * })\n */\nSEPA.prototype.tokenize = function (options) {\n var self = this;\n var createMandateOptions = assign(\n { cancelUrl: self._cancelUrl, returnUrl: self._returnUrl },\n options\n );\n\n if (!options || hasMissingOption(options, constants.REQUIRED_OPTIONS)) {\n analytics.sendEvent(self._client, \"sepa.input-validation.missing-options\");\n\n return Promise.reject(\n new BraintreeError(sepaErrors.SEPA_TOKENIZE_MISSING_REQUIRED_OPTION)\n );\n }\n\n if (!constants.MANDATE_TYPE_ENUM.includes(options.mandateType)) {\n analytics.sendEvent(self._client, \"sepa.input-validation.invalid-mandate\");\n\n return Promise.reject(\n new BraintreeError(sepaErrors.SEPA_INVALID_MANDATE_TYPE)\n );\n }\n\n return mandates\n .createMandate(self._client, createMandateOptions)\n .then(function (mandateResponse) {\n analytics.sendEvent(self._client, \"sepa.create-mandate.success\");\n options.last4 = mandateResponse.last4;\n options.bankReferenceToken = mandateResponse.bankReferenceToken;\n\n return mandates.openPopup(self._client, {\n approvalUrl: mandateResponse.approvalUrl,\n assetsUrl: self._assetsUrl,\n });\n })\n .then(function () {\n analytics.sendEvent(self._client, \"sepa.mandate.approved\");\n\n return mandates.handleApproval(self._client, {\n bankReferenceToken: options.bankReferenceToken,\n last4: options.last4,\n customerId: options.customerId,\n mandateType: options.mandateType,\n merchantAccountId: options.merchantAccountId,\n });\n })\n .then(function (approval) {\n analytics.sendEvent(self._client, \"sepa.tokenization.success\");\n\n return Promise.resolve(approval);\n })\n .catch(function (err) {\n analytics.sendEvent(self._client, \"sepa.\" + err.details + \".failed\");\n\n return Promise.reject(err);\n });\n};\n\nmodule.exports = wrapPromise.wrapPrototype(SEPA);\n\n},{\"../../lib/analytics\":119,\"../../lib/assign\":121,\"../../lib/braintree-error\":124,\"../shared/constants\":187,\"../shared/errors\":188,\"../shared/has-missing-option\":189,\"./mandate\":184,\"@braintree/wrap-promise\":43}],186:[function(_dereq_,module,exports){\n\"use strict\";\n/** @module braintree-web/sepa */\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar SEPA = _dereq_(\"./external/sepa\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar VERSION = \"3.100.0\";\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.debug] A debug flag.\n * @param {callback} [callback] When provided, will be used instead of a promise. First argument is an error object, where the second is an instance of {@link SEPA|SEPA}.\n * @returns {Promise<void|error>} Returns the SEPA instance.\n * @example\n * braintree.sepa.create({\n * client: clientInstance\n * }).then(function (sepaInstance) {\n * // sepaInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating SEPA instance', createErr);\n * });\n * @example <caption>Creating a SEPA component</caption>\n * braintree.sepa.create({\n * client: clientInstance,\n * }).then(function (sepaInstance) {\n * // sepaInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating SEPA instance', createErr);\n * });\n */\n\nfunction create(options) {\n var name = \"SEPA\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n options.client = client;\n\n analytics.sendEvent(options.client, \"sepa.client.initialized\");\n\n return new SEPA(options);\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./external/sepa\":185,\"@braintree/wrap-promise\":43}],187:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n REQUIRED_OPTIONS: [\n \"iban\",\n \"merchantAccountId\",\n \"mandateType\",\n \"customerId\",\n \"accountHolderName\",\n \"countryCode\",\n ],\n BILLING_ADDRESS_OPTIONS: [\n \"address_line_1\",\n \"address_line_2\",\n \"admin_area_1\",\n \"admin_area_2\",\n \"postal_code\",\n ],\n MANDATE_TYPE_ENUM: [\"ONE_OFF\", \"RECURRENT\"],\n};\n\n},{}],188:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\n/**\n * @name BraintreeError.SEPA - tokenize Error Codes\n * @description Errors that occur when using the {@link module:braintree-web/sepa.tokenize|sepa.tokenize} method.\n * @property {MERCHANT} SEPA_CREATE_MANDATE_FAILED Occurs when there was an issue creating a mandate. This can occur if the request fails, or if the merchant does not have SEPA enabled.\n * @property {CUSTOMER} SEPA_CUSTOMER_CANCELED Occurs when the customer has canceled the SEPA authorization process. This can be within the mandate approval popup, or by canceling the popup itself.\n * @property {MERCHANT} SEPA_INVALID_MANDATE_TYPE Occurs when an invalid mandate type is provided.\n * @property {UNKNOWN} SEPA_TOKENIZATION_FAILED Occurs when tokenization fails during the mandate approval process for unknown reasons.\n * @property {MERCHANT} SEPA_TOKENIZE_MISSING_REQUIRED_OPTION Occurs when there are required input options not provided.\n * @property {UNKNOWN} SEPA_TRANSACTION_FAILED Occurs when final tokenization fails.\n */\n\n// Those with a \"details\" property are used in specific locations and this prop serves to identify where in the imlpementation the error originates.\nmodule.exports = {\n SEPA_CREATE_MANDATE_FAILED: {\n type: BraintreeError.types.MERCHANT,\n code: \"SEPA_CREATE_MANDATE_FAILED\",\n message: \"SEPA create mandate failed.\",\n details: \"create-mandate\",\n },\n SEPA_CUSTOMER_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"SEPA_CUSTOMER_CANCELED\",\n message: \"User canceled SEPA authorization\",\n details: \"customer-canceled\",\n },\n SEPA_INVALID_MANDATE_TYPE: {\n type: BraintreeError.types.MERCHANT,\n code: \"SEPA_INVALID_MANDATE_TYPE\",\n message: \"SEPA mandate type is invalid\",\n },\n SEPA_TOKENIZATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"SEPA_TOKENIZATION_FAILED\",\n message: \"SEPA encountered a problem\",\n details: \"open-popup\",\n },\n SEPA_TOKENIZE_MISSING_REQUIRED_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"SEPA_TOKENIZE_MISSING_REQUIRED_OPTION\",\n message: \"Missing required option for tokenize.\",\n },\n SEPA_TRANSACTION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"SEPA_TRANSACTION_FAILED\",\n message: \"SEPA transaction failed\",\n details: \"handle-approval\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],189:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @ignore\n * @static\n * @function hasMissingOption\n * @param {object} options All options provided for intiating the SEPA payment flow.\n * @param {array} required A list of required inputs that must be include as part of the options.\n * @returns {boolean} Returns a boolean.\n */\nfunction hasMissingOption(options, required) {\n var i, option;\n\n required = required || [];\n\n for (i = 0; i < required.length; i++) {\n option = required[i];\n\n if (!options.hasOwnProperty(option)) {\n return true;\n }\n }\n\n return false;\n}\n\nmodule.exports = hasMissingOption;\n\n},{}],190:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar assign = _dereq_(\"../../../lib/assign\").assign;\nvar analytics = _dereq_(\"../../../lib/analytics\");\nvar BraintreeError = _dereq_(\"../../../lib/braintree-error\");\nvar isVerifiedDomain = _dereq_(\"../../../lib/is-verified-domain\");\nvar ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\nvar EventEmitter = _dereq_(\"@braintree/event-emitter\");\nvar errors = _dereq_(\"../../shared/errors\");\nvar iFramer = _dereq_(\"@braintree/iframer\");\nvar Bus = _dereq_(\"framebus\");\nvar constants = _dereq_(\"../../shared/constants\");\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar events = _dereq_(\"../../shared/events\");\nvar useMin = _dereq_(\"../../../lib/use-min\");\nvar BUS_CONFIGURATION_REQUEST_EVENT =\n _dereq_(\"../../../lib/constants\").BUS_CONFIGURATION_REQUEST_EVENT;\n\nvar VERSION = \"3.100.0\";\nvar IFRAME_HEIGHT = 400;\nvar IFRAME_WIDTH = 400;\n\nExtendedPromise.suppressUnhandledPromiseMessage = true;\n\nfunction BaseFramework(options) {\n EventEmitter.call(this);\n\n this._client = options.client;\n this._createPromise = options.createPromise;\n this._createOptions = options;\n\n if (this._client) {\n this._isDebug = this._client.getConfiguration().isDebug;\n this._assetsUrl =\n this._client.getConfiguration().gatewayConfiguration.assetsUrl;\n } else {\n this._isDebug = Boolean(options.isDebug);\n this._assetsUrl = options.assetsUrl;\n }\n this._assetsUrl = this._assetsUrl + \"/web/\" + VERSION;\n}\n\nEventEmitter.createChild(BaseFramework);\n\nBaseFramework.prototype._waitForClient = function () {\n if (this._client) {\n return Promise.resolve();\n }\n\n return this._createPromise.then(\n function (client) {\n this._client = client;\n }.bind(this)\n );\n};\n\nBaseFramework.prototype.setUpEventListeners = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n};\n\nBaseFramework.prototype.verifyCard = function (options, privateOptions) {\n var formattedOptions, error;\n var self = this;\n\n privateOptions = privateOptions || {};\n\n error = this._checkForVerifyCardError(options, privateOptions);\n\n if (error) {\n return Promise.reject(error);\n }\n\n this._verifyCardInProgress = true;\n\n formattedOptions = this._formatVerifyCardOptions(options);\n\n return this._formatLookupData(formattedOptions)\n .then(function (data) {\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.started\"\n );\n\n return self._performLookup(formattedOptions.nonce, data);\n })\n .then(function (response) {\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.3ds-version.\" +\n response.lookup.threeDSecureVersion\n );\n\n return self._onLookupComplete(response, formattedOptions);\n })\n .then(function (response) {\n return self.initializeChallengeWithLookupResponse(\n response,\n formattedOptions\n );\n })\n .then(function (payload) {\n self._resetVerificationState();\n\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.completed\"\n );\n\n return payload;\n })\n .catch(function (err) {\n self._resetVerificationState();\n\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.failed\"\n );\n\n return Promise.reject(err);\n });\n};\n\nBaseFramework.prototype._checkForFrameworkSpecificVerifyCardErrors =\n function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n };\n\nBaseFramework.prototype._presentChallenge = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n};\n\nBaseFramework.prototype.prepareLookup = function () {\n throw new BraintreeError(errors.THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED);\n};\n\nBaseFramework.prototype._resetVerificationState = function () {\n this._verifyCardInProgress = false;\n this._verifyCardPromisePlus = null;\n\n if (typeof this._reloadThreeDSecure === \"function\") {\n this._reloadThreeDSecure();\n }\n};\n\nBaseFramework.prototype._performLookup = function (nonce, data) {\n var self = this;\n var url = \"payment_methods/\" + nonce + \"/three_d_secure/lookup\";\n\n return this._waitForClient().then(function () {\n return self._client\n .request({\n endpoint: url,\n method: \"post\",\n data: data,\n })\n .catch(function (err) {\n var status = err && err.details && err.details.httpStatus;\n var analyticsMessage = \"three-d-secure.verification-flow.lookup-failed\";\n var lookupError;\n\n if (status === 404) {\n lookupError = errors.THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR;\n analyticsMessage += \".404\";\n } else if (status === 422) {\n lookupError = errors.THREEDS_LOOKUP_VALIDATION_ERROR;\n analyticsMessage += \".422\";\n } else {\n lookupError = errors.THREEDS_LOOKUP_ERROR;\n }\n\n analytics.sendEvent(self._createPromise, analyticsMessage);\n\n return Promise.reject(\n new BraintreeError({\n type: lookupError.type,\n code: lookupError.code,\n message: lookupError.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n });\n};\n\nBaseFramework.prototype._checkForVerifyCardError = function (\n options,\n privateOptions\n) {\n var errorOption;\n\n if (this._verifyCardInProgress === true) {\n return new BraintreeError(errors.THREEDS_AUTHENTICATION_IN_PROGRESS);\n } else if (!options.nonce) {\n errorOption = \"a nonce\";\n } else if (!options.amount) {\n errorOption = \"an amount\";\n }\n\n if (!errorOption) {\n errorOption = this._checkForFrameworkSpecificVerifyCardErrors(\n options,\n privateOptions\n );\n }\n\n if (errorOption) {\n return new BraintreeError({\n type: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.type,\n code: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.code,\n message: \"verifyCard options must include \" + errorOption + \".\",\n });\n }\n\n return null;\n};\n\nBaseFramework.prototype.initializeChallengeWithLookupResponse = function (\n lookupResponse,\n options\n) {\n var self = this;\n\n options = options || {};\n\n this._lookupPaymentMethod = lookupResponse.paymentMethod;\n\n // sets this in the case that initializeChallengeWithLookupResponse is\n // called as a standalone method from a server side lookup. In a normal\n // verifyCard flow, this promise will already exist\n self._verifyCardPromisePlus =\n self._verifyCardPromisePlus || new ExtendedPromise();\n self._handleLookupResponse(lookupResponse, options);\n\n return self._verifyCardPromisePlus.then(function (payload) {\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.liability-shifted.\" +\n String(payload.liabilityShifted)\n );\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.liability-shift-possible.\" +\n String(payload.liabilityShiftPossible)\n );\n\n return payload;\n });\n};\n\nBaseFramework.prototype._handleLookupResponse = function (\n lookupResponse,\n options\n) {\n var challengeShouldBePresented = Boolean(\n lookupResponse.lookup && lookupResponse.lookup.acsUrl\n );\n var details;\n\n analytics.sendEvent(\n this._createPromise,\n \"three-d-secure.verification-flow.challenge-presented.\" +\n String(challengeShouldBePresented)\n );\n\n if (challengeShouldBePresented) {\n this._presentChallenge(lookupResponse, options);\n } else {\n details = this._formatAuthResponse(\n lookupResponse.paymentMethod,\n lookupResponse.threeDSecureInfo\n );\n details.verificationDetails = lookupResponse.threeDSecureInfo;\n\n this._verifyCardPromisePlus.resolve(details);\n }\n};\n\nBaseFramework.prototype._onLookupComplete = function (response) {\n this._lookupPaymentMethod = response.paymentMethod;\n this._verifyCardPromisePlus = new ExtendedPromise();\n\n return Promise.resolve(response);\n};\n\nBaseFramework.prototype._formatAuthResponse = function (\n paymentMethod,\n threeDSecureInfo\n) {\n return {\n nonce: paymentMethod.nonce,\n type: paymentMethod.type,\n binData: paymentMethod.binData,\n details: paymentMethod.details,\n description:\n paymentMethod.description &&\n paymentMethod.description.replace(/\\+/g, \" \"),\n liabilityShifted: threeDSecureInfo && threeDSecureInfo.liabilityShifted,\n liabilityShiftPossible:\n threeDSecureInfo && threeDSecureInfo.liabilityShiftPossible,\n threeDSecureInfo: paymentMethod.threeDSecureInfo,\n };\n};\n\nBaseFramework.prototype._formatVerifyCardOptions = function (options) {\n return assign({}, options);\n};\n\nBaseFramework.prototype._formatLookupData = function (options) {\n var data = {\n amount: options.amount,\n };\n\n if (options.collectDeviceData === true) {\n data.browserColorDepth = window.screen.colorDepth;\n data.browserJavaEnabled = window.navigator.javaEnabled();\n data.browserJavascriptEnabled = true;\n data.browserLanguage = window.navigator.language;\n data.browserScreenHeight = window.screen.height;\n data.browserScreenWidth = window.screen.width;\n data.browserTimeZone = new Date().getTimezoneOffset();\n data.deviceChannel = \"Browser\";\n }\n\n return Promise.resolve(data);\n};\n\nBaseFramework.prototype._handleV1AuthResponse = function (data) {\n var authResponse = JSON.parse(data.auth_response);\n\n if (authResponse.success) {\n this._verifyCardPromisePlus.resolve(\n this._formatAuthResponse(\n authResponse.paymentMethod,\n authResponse.threeDSecureInfo\n )\n );\n } else if (\n authResponse.threeDSecureInfo &&\n authResponse.threeDSecureInfo.liabilityShiftPossible\n ) {\n this._verifyCardPromisePlus.resolve(\n this._formatAuthResponse(\n this._lookupPaymentMethod,\n authResponse.threeDSecureInfo\n )\n );\n } else {\n this._verifyCardPromisePlus.reject(\n new BraintreeError({\n type: BraintreeError.types.UNKNOWN,\n code: \"UNKNOWN_AUTH_RESPONSE\",\n message: authResponse.error.message,\n })\n );\n }\n};\n\nBaseFramework.prototype.cancelVerifyCard = function () {\n var response, threeDSecureInfo;\n\n this._verifyCardInProgress = false;\n\n if (!this._lookupPaymentMethod) {\n return Promise.reject(\n new BraintreeError(errors.THREEDS_NO_VERIFICATION_PAYLOAD)\n );\n }\n\n threeDSecureInfo = this._lookupPaymentMethod.threeDSecureInfo;\n\n response = assign({}, this._lookupPaymentMethod, {\n liabilityShiftPossible:\n threeDSecureInfo && threeDSecureInfo.liabilityShiftPossible,\n liabilityShifted: threeDSecureInfo && threeDSecureInfo.liabilityShifted,\n verificationDetails:\n threeDSecureInfo && threeDSecureInfo.verificationDetails,\n });\n\n return Promise.resolve(response);\n};\n\nBaseFramework.prototype._setupV1Bus = function (options) {\n var clientConfiguration = this._client.getConfiguration();\n var parentURL = window.location.href.split(\"#\")[0];\n var lookupResponse = options.lookupResponse;\n var channel = uuid();\n var bus = new Bus({\n channel: channel,\n verifyDomain: isVerifiedDomain,\n });\n var authenticationCompleteBaseUrl =\n this._assetsUrl +\n \"/html/three-d-secure-authentication-complete-frame.html?channel=\" +\n encodeURIComponent(channel) +\n \"&\";\n\n bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply({\n clientConfiguration: clientConfiguration,\n nonce: options.nonce,\n acsUrl: lookupResponse.acsUrl,\n pareq: lookupResponse.pareq,\n termUrl:\n lookupResponse.termUrl +\n \"&three_d_secure_version=\" +\n VERSION +\n \"&authentication_complete_base_url=\" +\n encodeURIComponent(authenticationCompleteBaseUrl),\n md: lookupResponse.md,\n parentUrl: parentURL,\n });\n });\n\n bus.on(events.AUTHENTICATION_COMPLETE, options.handleAuthResponse);\n\n return bus;\n};\n\nBaseFramework.prototype._setupV1Iframe = function (options) {\n var url =\n this._assetsUrl +\n \"/html/three-d-secure-bank-frame\" +\n useMin(this._isDebug) +\n \".html?showLoader=\" +\n options.showLoader;\n var bankIframe = iFramer({\n src: url,\n height: IFRAME_HEIGHT,\n width: IFRAME_WIDTH,\n name: constants.LANDING_FRAME_NAME + \"_\" + this._v1Bus.channel,\n title: \"3D Secure Authorization Frame\",\n });\n\n return bankIframe;\n};\n\nBaseFramework.prototype._setupV1Elements = function (options) {\n this._v1Bus = this._setupV1Bus(options);\n this._v1Iframe = this._setupV1Iframe(options);\n};\n\nBaseFramework.prototype._teardownV1Elements = function () {\n if (this._v1Bus) {\n this._v1Bus.teardown();\n this._v1Bus = null;\n }\n\n if (this._v1Iframe && this._v1Iframe.parentNode) {\n this._v1Iframe.parentNode.removeChild(this._v1Iframe);\n this._v1Iframe = null;\n }\n\n if (this._onV1Keyup) {\n document.removeEventListener(\"keyup\", this._onV1Keyup);\n this._onV1Keyup = null;\n }\n};\n\nBaseFramework.prototype.teardown = function () {\n analytics.sendEvent(this._createPromise, \"three-d-secure.teardown-completed\");\n\n this._teardownV1Elements();\n\n return Promise.resolve();\n};\n\nmodule.exports = BaseFramework;\n\n},{\"../../../lib/analytics\":119,\"../../../lib/assign\":121,\"../../../lib/braintree-error\":124,\"../../../lib/constants\":126,\"../../../lib/is-verified-domain\":153,\"../../../lib/use-min\":160,\"../../shared/constants\":199,\"../../shared/errors\":200,\"../../shared/events\":201,\"@braintree/event-emitter\":33,\"@braintree/extended-promise\":34,\"@braintree/iframer\":35,\"@braintree/uuid\":39,\"framebus\":52}],191:[function(_dereq_,module,exports){\n\"use strict\";\n// NEXT_MAJOR_VERSION drop support for Bootstrap framework,\n// recomend using inline frame version and putting it in\n// the merchant's own bootstrap modal\n\nvar SongbirdFramework = _dereq_(\"./songbird\");\n\nfunction Bootstrap3ModalFramework(options) {\n SongbirdFramework.call(this, options);\n}\n\nBootstrap3ModalFramework.prototype = Object.create(\n SongbirdFramework.prototype,\n {\n constructor: SongbirdFramework,\n }\n);\n\nBootstrap3ModalFramework.prototype._createV1IframeModalElement = function (\n iframe\n) {\n var modal = document.createElement(\"div\");\n\n modal.innerHTML =\n '<div class=\"modal fade in\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"CCAFrameModal-label\" aria-hidden=\"true\" style=\"display: block;\">' +\n '<div class=\"modal-dialog\" style=\"width:440px;z-index:999999;\">' +\n '<div class=\"modal-content\">' +\n '<div class=\"modal-body\" data-braintree-v1-fallback-iframe-container>' +\n '<button type=\"button\" data-braintree-v1-fallback-close-button class=\"close\" data-dismiss=\"modal\" aria-hidden=\"true\">×</button>' +\n \"</div>\" +\n \"</div>\" +\n \"</div>\" +\n '<div data-braintree-v1-fallback-backdrop style=\"' +\n \"position: fixed;\" +\n \"cursor: pointer;\" +\n \"z-index: 999998;\" +\n \"top: 0;\" +\n \"left: 0;\" +\n \"width: 100%;\" +\n \"height: 100%;\" +\n '\"></div>' +\n \"</div>\";\n\n modal\n .querySelector(\"[data-braintree-v1-fallback-iframe-container]\")\n .appendChild(iframe);\n\n return modal;\n};\n\nBootstrap3ModalFramework.prototype._createCardinalConfigurationOptions =\n function (setupOptions) {\n var options =\n SongbirdFramework.prototype._createCardinalConfigurationOptions.call(\n this,\n setupOptions\n );\n\n options.payment.framework = \"bootstrap3\";\n\n return options;\n };\n\nmodule.exports = Bootstrap3ModalFramework;\n\n},{\"./songbird\":196}],192:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar SongbirdFramework = _dereq_(\"./songbird\");\n\nfunction CardinalModalFramework(options) {\n SongbirdFramework.call(this, options);\n}\n\nCardinalModalFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework,\n});\n\nCardinalModalFramework.prototype._createV1IframeModalElement = function (\n iframe\n) {\n var modal = document.createElement(\"div\");\n var addCloseButton = Boolean(\n this._createOptions &&\n this._createOptions.cardinalSDKConfig &&\n this._createOptions.cardinalSDKConfig.payment &&\n this._createOptions.cardinalSDKConfig.payment.displayExitButton\n );\n\n modal.innerHTML =\n '<div style=\"' +\n \"position: fixed;\" +\n \"z-index: 999999;\" +\n \"top: 50%;\" +\n \"left: 50%;\" +\n \"padding: 24px 20px;\" +\n \"transform: translate(-50%,-50%);\" +\n \"border-radius: 2px;\" +\n \"background: #fff;\" +\n \"max-width: 100%;\" +\n \"overflow: auto;\" +\n '\">' +\n \"<div>\" +\n \"<button data-braintree-v1-fallback-close-button \" +\n 'style=\"' +\n \"font-family: Helvetica,Arial,sans-serif;\" +\n \"font-size: 25px;\" +\n \"line-height: 12px;\" +\n \"position: absolute;\" +\n \"top: 2px;\" +\n \"right: 0px;\" +\n \"cursor: pointer;\" +\n \"color: #999;\" +\n \"border: 0;\" +\n \"outline: none;\" +\n \"background: none;\" +\n '\" ' +\n \"onMouseOver=\\\"this.style.color='#000'\\\" \" +\n \"onMouseOut=\\\"this.style.color='#999'\\\"\" +\n \">×</button>\" +\n \"</div>\" +\n // iframe container\n '<div data-braintree-v1-fallback-iframe-container style=\"' +\n \"height: 400px;\" +\n '\"></div>' +\n \"</div>\" +\n // modal backdrop\n '<div data-braintree-v1-fallback-backdrop style=\"' +\n \"position: fixed;\" +\n \"z-index: 999998;\" +\n \"cursor: pointer;\" +\n \"top: 0;\" +\n \"left: 0;\" +\n \"width: 100%;\" +\n \"height: 100%;\" +\n \"transition: opacity 1ms ease;\" +\n \"background: rgba(0,0,0,.6);\" +\n '\"></div>';\n\n if (!addCloseButton) {\n modal.querySelector(\n \"[data-braintree-v1-fallback-close-button]\"\n ).style.display = \"none\";\n }\n modal\n .querySelector(\"[data-braintree-v1-fallback-iframe-container]\")\n .appendChild(iframe);\n\n return modal;\n};\n\nmodule.exports = CardinalModalFramework;\n\n},{\"./songbird\":196}],193:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar LegacyFramework = _dereq_(\"./legacy\");\nvar CardinalModalFramework = _dereq_(\"./cardinal-modal\");\nvar Bootstrap3ModalFramework = _dereq_(\"./bootstrap3-modal\");\nvar InlineIframeFramework = _dereq_(\"./inline-iframe\");\n\nmodule.exports = {\n legacy: LegacyFramework,\n \"cardinal-modal\": CardinalModalFramework,\n \"bootstrap3-modal\": Bootstrap3ModalFramework,\n \"inline-iframe\": InlineIframeFramework,\n};\n\n},{\"./bootstrap3-modal\":191,\"./cardinal-modal\":192,\"./inline-iframe\":194,\"./legacy\":195}],194:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar SongbirdFramework = _dereq_(\"./songbird\");\nvar BraintreeError = _dereq_(\"../../../lib/braintree-error\");\nvar errors = _dereq_(\"../../shared/errors\");\nvar enumerate = _dereq_(\"../../../lib/enumerate\");\n\nfunction InlineIframeFramework(options) {\n SongbirdFramework.call(this, options);\n}\n\nInlineIframeFramework.prototype = Object.create(SongbirdFramework.prototype, {\n constructor: SongbirdFramework,\n});\n\nInlineIframeFramework.events = enumerate(\n [\"AUTHENTICATION_IFRAME_AVAILABLE\"],\n \"inline-iframe-framework:\"\n);\n\nInlineIframeFramework.prototype.setUpEventListeners = function (reply) {\n SongbirdFramework.prototype.setUpEventListeners.call(this, reply);\n\n this.on(\n InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE,\n function (payload, next) {\n reply(\"authentication-iframe-available\", payload, next);\n }\n );\n};\n\nInlineIframeFramework.prototype._createCardinalConfigurationOptions = function (\n setupOptions\n) {\n var options =\n SongbirdFramework.prototype._createCardinalConfigurationOptions.call(\n this,\n setupOptions\n );\n\n options.payment.framework = \"inline\";\n\n return options;\n};\n\nInlineIframeFramework.prototype._addV1IframeToPage = function () {\n this._emit(\n InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE,\n {\n element: this._v1Modal,\n },\n function () {\n // NOOP\n }\n );\n};\n\nInlineIframeFramework.prototype._setupFrameworkSpecificListeners = function () {\n this.setCardinalListener(\"ui.inline.setup\", this._onInlineSetup.bind(this));\n};\n\nInlineIframeFramework.prototype._onInlineSetup = function (\n htmlTemplate,\n details,\n resolve,\n reject\n) {\n var container, hasError;\n\n if (!htmlTemplate || !details) {\n hasError = true;\n } else if (details.paymentType !== \"CCA\") {\n hasError = true;\n } else if (\n !(details.data.mode === \"suppress\" || details.data.mode === \"static\")\n ) {\n hasError = true;\n }\n\n if (hasError) {\n reject(new BraintreeError(errors.THREEDS_INLINE_IFRAME_DETAILS_INCORRECT));\n\n return;\n }\n\n container = document.createElement(\"div\");\n container.innerHTML = htmlTemplate;\n\n if (details.data.mode === \"suppress\") {\n container.style.display = \"none\";\n document.body.appendChild(container);\n resolve();\n } else if (details.data.mode === \"static\") {\n this._emit(\n InlineIframeFramework.events.AUTHENTICATION_IFRAME_AVAILABLE,\n {\n element: container,\n },\n function () {\n resolve();\n }\n );\n }\n};\n\nmodule.exports = InlineIframeFramework;\n\n},{\"../../../lib/braintree-error\":124,\"../../../lib/enumerate\":134,\"../../shared/errors\":200,\"./songbird\":196}],195:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BaseFramework = _dereq_(\"./base\");\nvar deferred = _dereq_(\"../../../lib/deferred\");\n\nfunction LegacyFramework(options) {\n BaseFramework.call(this, options);\n}\n\nLegacyFramework.prototype = Object.create(BaseFramework.prototype, {\n constructor: LegacyFramework,\n});\n\nLegacyFramework.prototype.setUpEventListeners = function () {\n // noop\n};\n\nLegacyFramework.prototype.transformV1CustomerBillingAddress = function (\n customer\n) {\n customer.billingAddress.line1 = customer.billingAddress.streetAddress;\n customer.billingAddress.line2 = customer.billingAddress.extendedAddress;\n customer.billingAddress.city = customer.billingAddress.locality;\n customer.billingAddress.state = customer.billingAddress.region;\n customer.billingAddress.countryCode =\n customer.billingAddress.countryCodeAlpha2;\n delete customer.billingAddress.streetAddress;\n delete customer.billingAddress.extendedAddress;\n delete customer.billingAddress.locality;\n delete customer.billingAddress.region;\n delete customer.billingAddress.countryCodeAlpha2;\n\n return customer;\n};\n\nLegacyFramework.prototype._createIframe = function (options) {\n var self = this;\n\n this._setupV1Elements({\n nonce: options.nonce,\n lookupResponse: options.lookupResponse,\n showLoader: options.showLoader,\n handleAuthResponse: function (data) {\n self._handleAuthResponse(data, options);\n },\n });\n\n return this._v1Iframe;\n};\n\nLegacyFramework.prototype._handleAuthResponse = function (data, options) {\n this._v1Bus.teardown();\n\n options.removeFrame();\n\n // This also has to be in a setTimeout so it executes after the `removeFrame`.\n deferred(\n function () {\n this._handleV1AuthResponse(data);\n }.bind(this)\n )();\n};\n\nLegacyFramework.prototype._checkForFrameworkSpecificVerifyCardErrors =\n function (options) {\n var errorOption;\n\n if (typeof options.addFrame !== \"function\") {\n errorOption = \"an addFrame function\";\n } else if (typeof options.removeFrame !== \"function\") {\n errorOption = \"a removeFrame function\";\n }\n\n return errorOption;\n };\n\nLegacyFramework.prototype._formatVerifyCardOptions = function (options) {\n var modifiedOptions = BaseFramework.prototype._formatVerifyCardOptions.call(\n this,\n options\n );\n\n modifiedOptions.addFrame = deferred(options.addFrame);\n modifiedOptions.removeFrame = deferred(options.removeFrame);\n modifiedOptions.showLoader = options.showLoader !== false;\n\n return modifiedOptions;\n};\n\nLegacyFramework.prototype._formatLookupData = function (options) {\n var self = this;\n\n return BaseFramework.prototype._formatLookupData\n .call(this, options)\n .then(function (data) {\n if (options.customer && options.customer.billingAddress) {\n data.customer = self.transformV1CustomerBillingAddress(\n options.customer\n );\n }\n\n return data;\n });\n};\n\nLegacyFramework.prototype._presentChallenge = function (\n lookupResponse,\n options\n) {\n options.addFrame(\n null,\n this._createIframe({\n showLoader: options.showLoader,\n lookupResponse: lookupResponse.lookup,\n nonce: lookupResponse.paymentMethod.nonce,\n removeFrame: options.removeFrame,\n })\n );\n};\n\nmodule.exports = LegacyFramework;\n\n},{\"../../../lib/deferred\":132,\"./base\":190}],196:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BaseFramework = _dereq_(\"./base\");\nvar assign = _dereq_(\"../../../lib/assign\").assign;\nvar deferred = _dereq_(\"../../../lib/deferred\");\nvar BraintreeError = _dereq_(\"../../../lib/braintree-error\");\nvar convertToBraintreeError = _dereq_(\"../../../lib/convert-to-braintree-error\");\nvar analytics = _dereq_(\"../../../lib/analytics\");\nvar assets = _dereq_(\"../../../lib/assets\");\nvar errors = _dereq_(\"../../shared/errors\");\nvar enumerate = _dereq_(\"../../../lib/enumerate\");\nvar constants = _dereq_(\"../../shared/constants\");\nvar ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\n\nvar INTEGRATION_TIMEOUT_MS =\n _dereq_(\"../../../lib/constants\").INTEGRATION_TIMEOUT_MS;\nvar PLATFORM = _dereq_(\"../../../lib/constants\").PLATFORM;\nvar VERSION = \"3.100.0\";\nvar CUSTOMER_CANCELED_SONGBIRD_MODAL = \"01\";\nvar SONGBIRD_UI_EVENTS = [\n \"ui.close\",\n \"ui.render\",\n\n // TODO these events are not documented in the\n // client reference because so far we have\n // not been able to trigger them in our testing\n \"ui.renderHidden\",\n \"ui.loading.close\",\n \"ui.loading.render\",\n];\n\nvar SCA_EXEMPTION_TYPES = [\"low_value\", \"transaction_risk_analysis\"];\n\nExtendedPromise.suppressUnhandledPromiseMessage = true;\n\nfunction SongbirdFramework(options) {\n BaseFramework.call(this, options);\n\n this._songbirdInitFailed = false;\n this._clientMetadata = {\n requestedThreeDSecureVersion: \"2\",\n sdkVersion: PLATFORM + \"/\" + VERSION,\n };\n this.originalSetupOptions = options;\n this._getDfReferenceIdPromisePlus = new ExtendedPromise();\n this.setupSongbird(options);\n this._cardinalEvents = [];\n}\n\nSongbirdFramework.prototype = Object.create(BaseFramework.prototype, {\n constructor: SongbirdFramework,\n});\n\nSongbirdFramework.events = enumerate(\n [\n \"LOOKUP_COMPLETE\",\n \"CUSTOMER_CANCELED\",\n \"UI.CLOSE\",\n \"UI.RENDER\",\n \"UI.RENDERHIDDEN\",\n \"UI.LOADING.CLOSE\",\n \"UI.LOADING.RENDER\",\n ],\n \"songbird-framework:\"\n);\n\nSongbirdFramework.prototype.setUpEventListeners = function (reply) {\n this.on(SongbirdFramework.events.LOOKUP_COMPLETE, function (data, next) {\n reply(\"lookup-complete\", data, next);\n });\n this.on(SongbirdFramework.events.CUSTOMER_CANCELED, function () {\n reply(\"customer-canceled\");\n });\n this.on(SongbirdFramework.events[\"UI.CLOSE\"], function () {\n reply(\"authentication-modal-close\");\n });\n this.on(SongbirdFramework.events[\"UI.RENDER\"], function () {\n reply(\"authentication-modal-render\");\n });\n this.on(SongbirdFramework.events[\"UI.RENDERHIDDEN\"], function () {\n reply(\"authentication-modal-render-hidden\");\n });\n this.on(SongbirdFramework.events[\"UI.LOADING.CLOSE\"], function () {\n reply(\"authentication-modal-loader-close\");\n });\n this.on(SongbirdFramework.events[\"UI.LOADING.RENDER\"], function () {\n reply(\"authentication-modal-loader-render\");\n });\n};\n\nSongbirdFramework.prototype.prepareLookup = function (options) {\n var data = assign({}, options);\n var self = this;\n\n return this.getDfReferenceId()\n .then(function (id) {\n data.dfReferenceId = id;\n })\n .then(function () {\n return self._triggerCardinalBinProcess(options.bin);\n })\n .catch(function () {\n // catch and ignore errors from looking up\n // df reference and Cardinal bin process\n })\n .then(function () {\n return self._waitForClient();\n })\n .then(function () {\n data.clientMetadata = self._clientMetadata;\n data.authorizationFingerprint =\n self._client.getConfiguration().authorizationFingerprint;\n data.braintreeLibraryVersion = \"braintree/web/\" + VERSION;\n\n return data;\n });\n};\n\nSongbirdFramework.prototype.initializeChallengeWithLookupResponse = function (\n lookupResponse,\n options\n) {\n return this.setupSongbird().then(\n function () {\n return BaseFramework.prototype.initializeChallengeWithLookupResponse.call(\n this,\n lookupResponse,\n options\n );\n }.bind(this)\n );\n};\n\nSongbirdFramework.prototype.handleSongbirdError = function (errorType) {\n this._songbirdInitFailed = true;\n this._removeSongbirdListeners();\n analytics.sendEvent(\n this._createPromise,\n \"three-d-secure.cardinal-sdk.songbird-error.\" + errorType\n );\n\n if (this._songbirdPromise) {\n this._songbirdPromise.resolve();\n }\n};\n\nSongbirdFramework.prototype._triggerCardinalBinProcess = function (bin) {\n var self = this;\n var issuerStartTime = Date.now();\n\n return window.Cardinal.trigger(\"bin.process\", bin).then(function (\n binResults\n ) {\n self._clientMetadata.issuerDeviceDataCollectionTimeElapsed =\n Date.now() - issuerStartTime;\n self._clientMetadata.issuerDeviceDataCollectionResult =\n binResults && binResults.Status;\n });\n};\n\nSongbirdFramework.prototype.transformBillingAddress = function (\n additionalInformation,\n billingAddress\n) {\n if (billingAddress) {\n // map from public API to the API that the Gateway expects\n extractAddressData(billingAddress, additionalInformation, \"billing\");\n additionalInformation.billingPhoneNumber = billingAddress.phoneNumber;\n additionalInformation.billingGivenName = billingAddress.givenName;\n additionalInformation.billingSurname = billingAddress.surname;\n }\n\n return additionalInformation;\n};\n\nSongbirdFramework.prototype.transformShippingAddress = function (\n additionalInformation\n) {\n var shippingAddress = additionalInformation.shippingAddress;\n\n if (shippingAddress) {\n // map from public API to the API that the Gateway expects\n extractAddressData(shippingAddress, additionalInformation, \"shipping\");\n\n delete additionalInformation.shippingAddress;\n }\n\n return additionalInformation;\n};\n\nSongbirdFramework.prototype._createV1IframeModalElement = function (iframe) {\n var modal = document.createElement(\"div\");\n\n modal.innerHTML =\n '<div data-braintree-v1-fallback-iframe-container=\"true\" style=\"' +\n \"height: 400px;\" +\n '\"></div>';\n modal\n .querySelector('[data-braintree-v1-fallback-iframe-container=\"true\"]')\n .appendChild(iframe);\n\n return modal;\n};\n\nSongbirdFramework.prototype._createV1IframeModal = function (iframe) {\n var modal = this._createV1IframeModalElement(iframe);\n var btn = modal.querySelector(\"[data-braintree-v1-fallback-close-button]\");\n var backdrop = modal.querySelector(\"[data-braintree-v1-fallback-backdrop]\");\n var self = this;\n\n function closeHandler() {\n modal.parentNode.removeChild(modal);\n self.cancelVerifyCard(errors.THREEDS_CARDINAL_SDK_CANCELED);\n document.removeEventListener(\"keyup\", self._onV1Keyup);\n self._onV1Keyup = null;\n }\n\n this._onV1Keyup = function (e) {\n if (e.key !== \"Escape\") {\n return;\n }\n\n if (!modal.parentNode) {\n // modal not on page\n return;\n }\n\n closeHandler();\n };\n\n if (btn) {\n btn.addEventListener(\"click\", closeHandler);\n }\n\n if (backdrop) {\n backdrop.addEventListener(\"click\", closeHandler);\n }\n\n document.addEventListener(\"keyup\", this._onV1Keyup);\n\n return modal;\n};\n\nSongbirdFramework.prototype._addV1IframeToPage = function () {\n document.body.appendChild(this._v1Modal);\n};\n\nSongbirdFramework.prototype.setupSongbird = function (setupOptions) {\n var self = this;\n var startTime = Date.now();\n\n if (this._songbirdPromise) {\n return this._songbirdPromise;\n }\n\n setupOptions = setupOptions || {};\n\n this._songbirdPromise = new ExtendedPromise();\n this._v2SetupFailureReason = \"reason-unknown\";\n\n self\n ._loadCardinalScript(setupOptions)\n .then(function () {\n if (!window.Cardinal) {\n self._v2SetupFailureReason = \"cardinal-global-unavailable\";\n\n return Promise.reject(\n new BraintreeError(errors.THREEDS_CARDINAL_SDK_SETUP_FAILED)\n );\n }\n\n return self._configureCardinalSdk({\n setupOptions: setupOptions,\n setupStartTime: startTime,\n });\n })\n .catch(function (err) {\n var error = convertToBraintreeError(err, {\n type: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.type,\n code: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.code,\n message: errors.THREEDS_CARDINAL_SDK_SETUP_FAILED.message,\n });\n\n self._getDfReferenceIdPromisePlus.reject(error);\n\n window.clearTimeout(self._songbirdSetupTimeoutReference);\n analytics.sendEvent(\n self._client,\n \"three-d-secure.cardinal-sdk.init.setup-failed\"\n );\n self.handleSongbirdError(\n \"cardinal-sdk-setup-failed.\" + self._v2SetupFailureReason\n );\n });\n\n return this._songbirdPromise;\n};\n\nSongbirdFramework.prototype._configureCardinalSdk = function (config) {\n var self = this;\n\n return this._waitForClient()\n .then(function () {\n var threeDSConfig =\n self._client.getConfiguration().gatewayConfiguration.threeDSecure;\n\n return threeDSConfig;\n })\n .then(function (threeDSConfig) {\n var jwt = threeDSConfig.cardinalAuthenticationJWT;\n var setupOptions = config.setupOptions;\n var setupStartTime = config.setupStartTime;\n var cardinalConfiguration =\n self._createCardinalConfigurationOptions(setupOptions);\n\n SONGBIRD_UI_EVENTS.forEach(function (eventName) {\n self.setCardinalListener(eventName, function () {\n self._emit(SongbirdFramework.events[eventName.toUpperCase()]);\n });\n });\n self.setCardinalListener(\n \"payments.setupComplete\",\n self._createPaymentsSetupCompleteCallback()\n );\n\n self._setupFrameworkSpecificListeners();\n\n window.Cardinal.configure(cardinalConfiguration);\n\n window.Cardinal.setup(\"init\", {\n jwt: jwt,\n });\n\n self._clientMetadata.cardinalDeviceDataCollectionTimeElapsed =\n Date.now() - setupStartTime;\n\n self.setCardinalListener(\n \"payments.validated\",\n self._createPaymentsValidatedCallback()\n );\n })\n .catch(function (err) {\n self._v2SetupFailureReason = \"cardinal-configuration-threw-error\";\n\n return Promise.reject(err);\n });\n};\n\nSongbirdFramework.prototype.setCardinalListener = function (eventName, cb) {\n this._cardinalEvents.push(eventName);\n window.Cardinal.on(eventName, cb);\n};\n\nSongbirdFramework.prototype._setupFrameworkSpecificListeners = function () {\n // noop\n};\n\nSongbirdFramework.prototype._createCardinalConfigurationOptions = function (\n setupOptions\n) {\n var cardinalConfiguration = setupOptions.cardinalSDKConfig || {};\n var paymentSettings = cardinalConfiguration.payment || {};\n\n if (!cardinalConfiguration.logging && setupOptions.loggingEnabled) {\n cardinalConfiguration.logging = {\n level: \"verbose\",\n };\n }\n\n cardinalConfiguration.payment = {};\n\n if (paymentSettings.hasOwnProperty(\"displayLoading\")) {\n cardinalConfiguration.payment.displayLoading =\n paymentSettings.displayLoading;\n }\n if (paymentSettings.hasOwnProperty(\"displayExitButton\")) {\n cardinalConfiguration.payment.displayExitButton =\n paymentSettings.displayExitButton;\n }\n\n return cardinalConfiguration;\n};\n\nSongbirdFramework.prototype._loadCardinalScript = function (setupOptions) {\n var self = this;\n\n return this._waitForClient()\n .then(function () {\n var scriptSource = self._getCardinalScriptSource();\n\n self._songbirdSetupTimeoutReference = window.setTimeout(function () {\n analytics.sendEvent(\n self._client,\n \"three-d-secure.cardinal-sdk.init.setup-timeout\"\n );\n self.handleSongbirdError(\"cardinal-sdk-setup-timeout\");\n }, setupOptions.timeout || INTEGRATION_TIMEOUT_MS);\n\n return assets.loadScript({ src: scriptSource });\n })\n .catch(function (err) {\n self._v2SetupFailureReason = \"songbird-js-failed-to-load\";\n\n return Promise.reject(\n convertToBraintreeError(\n err,\n errors.THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED\n )\n );\n });\n};\n\nSongbirdFramework.prototype._getCardinalScriptSource = function () {\n var gatewayConfig = this._client.getConfiguration().gatewayConfiguration;\n\n if (gatewayConfig && gatewayConfig.environment === \"production\") {\n return constants.CARDINAL_SCRIPT_SOURCE.production;\n }\n\n return constants.CARDINAL_SCRIPT_SOURCE.sandbox;\n};\n\nSongbirdFramework.prototype._createPaymentsSetupCompleteCallback = function () {\n var self = this;\n\n return function (data) {\n self._getDfReferenceIdPromisePlus.resolve(data.sessionId);\n\n window.clearTimeout(self._songbirdSetupTimeoutReference);\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.cardinal-sdk.init.setup-completed\"\n );\n\n self._songbirdPromise.resolve();\n };\n};\n\nSongbirdFramework.prototype.getDfReferenceId = function () {\n return this._getDfReferenceIdPromisePlus;\n};\n\nSongbirdFramework.prototype._performJWTValidation = function (\n rawCardinalSDKVerificationData,\n jwt\n) {\n var self = this;\n var nonce = this._lookupPaymentMethod.nonce;\n var url =\n \"payment_methods/\" + nonce + \"/three_d_secure/authenticate_from_jwt\";\n var cancelCode =\n rawCardinalSDKVerificationData &&\n rawCardinalSDKVerificationData.Payment &&\n rawCardinalSDKVerificationData.Payment.ExtendedData &&\n rawCardinalSDKVerificationData.Payment.ExtendedData.ChallengeCancel;\n\n if (cancelCode) {\n // see ChallengeCancel docs here for different values:\n // https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects\n analytics.sendEvent(\n this._createPromise,\n \"three-d-secure.verification-flow.cardinal-sdk.cancel-code.\" + cancelCode\n );\n\n if (cancelCode === CUSTOMER_CANCELED_SONGBIRD_MODAL) {\n this._emit(SongbirdFramework.events.CUSTOMER_CANCELED);\n }\n }\n\n analytics.sendEvent(\n this._createPromise,\n \"three-d-secure.verification-flow.upgrade-payment-method.started\"\n );\n\n return this._waitForClient()\n .then(function () {\n return self._client.request({\n method: \"post\",\n endpoint: url,\n data: {\n jwt: jwt,\n paymentMethodNonce: nonce,\n },\n });\n })\n .then(function (response) {\n var paymentMethod = response.paymentMethod || self._lookupPaymentMethod;\n var formattedResponse = self._formatAuthResponse(\n paymentMethod,\n response.threeDSecureInfo\n );\n\n formattedResponse.rawCardinalSDKVerificationData =\n rawCardinalSDKVerificationData;\n analytics.sendEvent(\n self._client,\n \"three-d-secure.verification-flow.upgrade-payment-method.succeeded\"\n );\n\n return Promise.resolve(formattedResponse);\n })\n .catch(function (err) {\n var error = new BraintreeError({\n type: errors.THREEDS_JWT_AUTHENTICATION_FAILED.type,\n code: errors.THREEDS_JWT_AUTHENTICATION_FAILED.code,\n message: errors.THREEDS_JWT_AUTHENTICATION_FAILED.message,\n details: {\n originalError: err,\n },\n });\n\n analytics.sendEvent(\n self._client,\n \"three-d-secure.verification-flow.upgrade-payment-method.errored\"\n );\n\n return Promise.reject(error);\n });\n};\n\nSongbirdFramework.prototype._createPaymentsValidatedCallback = function () {\n var self = this;\n\n /**\n * @param {object} data Response Data\n * @see {@link https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects#ResponseObjects-ObjectDefinition}\n * @param {string} data.ActionCode The resulting state of the transaction.\n * @param {boolean} data.Validated Represents whether transaction was successfully or not.\n * @param {object} data.Payment Represents additional information about the verification.\n * @param {number} data.ErrorNumber A non-zero value represents the error encountered while attempting the process the message request.\n * @param {string} data.ErrorDescription Application error description for the associated error number.\n * @param {string} validatedJwt Response JWT\n * @returns {void}\n * */\n return function (data, validatedJwt) {\n var formattedError;\n\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.cardinal-sdk.action-code.\" +\n data.ActionCode.toLowerCase()\n );\n\n if (!self._verifyCardPromisePlus) {\n self.handleSongbirdError(\n \"cardinal-sdk-setup-error.number-\" + data.ErrorNumber\n );\n\n return;\n }\n\n switch (data.ActionCode) {\n // Handle these scenarios based on liability shift information in the response.\n case \"SUCCESS\":\n case \"NOACTION\":\n case \"FAILURE\":\n self\n ._performJWTValidation(data, validatedJwt)\n .then(function (result) {\n self._verifyCardPromisePlus.resolve(result);\n })\n .catch(function (err) {\n self._verifyCardPromisePlus.reject(err);\n });\n break;\n\n case \"ERROR\":\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.cardinal-sdk-error.\" +\n data.ErrorNumber\n );\n\n switch (data.ErrorNumber) {\n case 10001: // Cardinal Docs: Timeout when sending an /Init message\n case 10002: // Cardinal Docs: Timeout when sending an /Start message\n formattedError = new BraintreeError(\n errors.THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT\n );\n break;\n case 10003: // Cardinal Docs: Timeout when sending an /Validate message. Although this code exists we do not yet have a flow where a validate message is sent to Midas. This error should not yet be triggered\n case 10007: // Cardinal Docs: Timeout when sending an /Confirm message\n case 10009: // Cardinal Docs: Timeout when sending an /Continue message\n formattedError = new BraintreeError(\n errors.THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT\n );\n break;\n case 10005: // Cardinal Docs: Songbird was started without a request jwt.\n case 10006: // Cardinal Docs: This is a general configuration error. The description is populated by the specific configuration error that caused the error.\n formattedError = new BraintreeError(\n errors.THREEDS_CARDINAL_SDK_BAD_CONFIG\n );\n break;\n case 10008: // Cardinal Docs: Songbird was initialized without a merchant JWT.\n case 10010: // Cardinal Docs: The response JWT was\n formattedError = new BraintreeError(\n errors.THREEDS_CARDINAL_SDK_BAD_JWT\n );\n break;\n case 10011:\n // This may never get called, according to the Cardinal docs:\n // The user has canceled the transaction. This is generally found in alternative\n // payments that supply a cancel button on the payment brand side.\n analytics.sendEvent(\n self._createPromise,\n \"three-d-secure.verification-flow.canceled\"\n );\n formattedError = new BraintreeError(\n errors.THREEDS_CARDINAL_SDK_CANCELED\n );\n break;\n default:\n formattedError = new BraintreeError(\n errors.THREEDS_CARDINAL_SDK_ERROR\n );\n }\n\n formattedError.details = {\n originalError: {\n code: data.ErrorNumber,\n description: data.ErrorDescription,\n },\n };\n\n self._verifyCardPromisePlus.reject(formattedError);\n break;\n\n default:\n }\n };\n};\n\nSongbirdFramework.prototype._checkForVerifyCardError = function (\n options,\n privateOptions\n) {\n if (!options.bin) {\n return new BraintreeError({\n type: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.type,\n code: errors.THREEDS_MISSING_VERIFY_CARD_OPTION.code,\n message: \"verifyCard options must include a BIN.\",\n });\n }\n\n return BaseFramework.prototype._checkForVerifyCardError.call(\n this,\n options,\n privateOptions\n );\n};\n\nSongbirdFramework.prototype._checkForFrameworkSpecificVerifyCardErrors =\n function (options, privateOptions) {\n var errorOption;\n\n if (\n typeof options.onLookupComplete !== \"function\" &&\n !privateOptions.ignoreOnLookupCompleteRequirement\n ) {\n errorOption = \"an onLookupComplete function\";\n }\n\n return errorOption;\n };\n\nSongbirdFramework.prototype._formatVerifyCardOptions = function (options) {\n var modifiedOptions = BaseFramework.prototype._formatVerifyCardOptions.call(\n this,\n options\n );\n var additionalInformation = modifiedOptions.additionalInformation || {};\n\n additionalInformation = this.transformBillingAddress(\n additionalInformation,\n options.billingAddress\n );\n additionalInformation = this.transformShippingAddress(additionalInformation);\n\n if (options.onLookupComplete) {\n modifiedOptions.onLookupComplete = deferred(options.onLookupComplete);\n }\n if (options.email) {\n additionalInformation.email = options.email;\n }\n if (options.mobilePhoneNumber) {\n additionalInformation.mobilePhoneNumber = options.mobilePhoneNumber;\n }\n\n modifiedOptions.additionalInformation = additionalInformation;\n\n return modifiedOptions;\n};\n\nSongbirdFramework.prototype._onLookupComplete = function (\n lookupResponse,\n options\n) {\n var self = this;\n\n return BaseFramework.prototype._onLookupComplete\n .call(this, lookupResponse)\n .then(function (response) {\n return new Promise(function (resolve, reject) {\n // NEXT_MAJOR_VERSION format this response object to look like the mobile sdk response\n // which is basically the lookup param at the top level with some additional accessors\n response.requiresUserAuthentication = Boolean(\n response.lookup && response.lookup.acsUrl\n );\n\n function next() {\n resolve(response);\n }\n\n self._verifyCardPromisePlus.catch(reject);\n\n // If both event and callback are mistakenly used together,\n // prefer the callback when it is passed into the verifyCard options\n if (options.onLookupComplete) {\n options.onLookupComplete(response, next);\n } else {\n self._emit(SongbirdFramework.events.LOOKUP_COMPLETE, response, next);\n }\n });\n });\n};\n\nSongbirdFramework.prototype._presentChallenge = function (lookupResponse) {\n // transactionId is required for the Songbird flow, so if it\n // does not exist, we just return\n if (this._songbirdInitFailed || !lookupResponse.lookup.transactionId) {\n return;\n }\n\n // set up listener for ref id to call out to bt before calling verify callback\n window.Cardinal.continue(\n \"cca\",\n {\n AcsUrl: lookupResponse.lookup.acsUrl,\n Payload: lookupResponse.lookup.pareq,\n },\n {\n OrderDetails: { TransactionId: lookupResponse.lookup.transactionId },\n }\n );\n};\n\nSongbirdFramework.prototype._formatLookupData = function (options) {\n var self = this;\n\n return BaseFramework.prototype._formatLookupData\n .call(this, options)\n .then(function (data) {\n data.additionalInfo = options.additionalInformation;\n\n if (options.accountType) {\n data.accountType = options.accountType;\n }\n if (options.challengeRequested) {\n data.challengeRequested = options.challengeRequested;\n }\n if (options.requestedExemptionType) {\n if (!SCA_EXEMPTION_TYPES.includes(options.requestedExemptionType)) {\n throw new BraintreeError({\n code: errors.THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID.code,\n type: errors.THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID.type,\n message:\n \"requestedExemptionType `\" +\n options.requestedExemptionType +\n \"` is not a valid exemption. The accepted values are: `\" +\n SCA_EXEMPTION_TYPES.join(\"`, `\") +\n \"`\",\n });\n }\n data.requestedExemptionType = options.requestedExemptionType;\n }\n if (options.customFields) {\n data.customFields = options.customFields;\n }\n if (options.dataOnlyRequested) {\n data.dataOnlyRequested = options.dataOnlyRequested;\n }\n if (options.exemptionRequested) {\n data.exemptionRequested = options.exemptionRequested;\n }\n if (options.requestVisaDAF) {\n data.requestVisaDAF = options.requestVisaDAF;\n }\n if (options.bin) {\n data.bin = options.bin;\n }\n // NEXT_MAJOR_VERSION remove cardAdd in favor of cardAddChallengeRequested\n if (options.cardAdd != null) {\n data.cardAdd = options.cardAdd;\n }\n if (options.cardAddChallengeRequested != null) {\n data.cardAdd = options.cardAddChallengeRequested;\n }\n if (options.merchantName) {\n data.merchantName = options.merchantName;\n }\n\n return self.prepareLookup(data);\n });\n};\n\nSongbirdFramework.prototype.cancelVerifyCard = function (verifyCardError) {\n var self = this;\n\n return BaseFramework.prototype.cancelVerifyCard\n .call(this)\n .then(function (response) {\n if (self._verifyCardPromisePlus) {\n verifyCardError =\n verifyCardError ||\n new BraintreeError(errors.THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT);\n\n self._verifyCardPromisePlus.reject(verifyCardError);\n }\n\n return response;\n });\n};\n\nSongbirdFramework.prototype._removeSongbirdListeners = function () {\n this._cardinalEvents.forEach(function (eventName) {\n window.Cardinal.off(eventName);\n });\n\n this._cardinalEvents = [];\n};\n\nSongbirdFramework.prototype.teardown = function () {\n if (window.Cardinal) {\n this._removeSongbirdListeners();\n }\n\n // we intentionally do not remove the Cardinal SDK\n // from the page when tearing down. Subsequent\n // component creations will be faster because\n // the asset is already on the page\n\n return BaseFramework.prototype.teardown.call(this);\n};\n\nSongbirdFramework.prototype._reloadThreeDSecure = function () {\n var self = this;\n var startTime = Date.now();\n\n return self.teardown().then(function () {\n self._configureCardinalSdk({\n setupOptions: self.originalSetupOptions,\n setupStartTime: startTime,\n });\n });\n};\n\nfunction extractAddressData(source, target, prefix) {\n target[prefix + \"Line1\"] = source.streetAddress;\n target[prefix + \"Line2\"] = source.extendedAddress;\n target[prefix + \"Line3\"] = source.line3;\n target[prefix + \"City\"] = source.locality;\n target[prefix + \"State\"] = source.region;\n target[prefix + \"PostalCode\"] = source.postalCode;\n target[prefix + \"CountryCode\"] = source.countryCodeAlpha2;\n}\n\nmodule.exports = SongbirdFramework;\n\n},{\"../../../lib/analytics\":119,\"../../../lib/assets\":120,\"../../../lib/assign\":121,\"../../../lib/braintree-error\":124,\"../../../lib/constants\":126,\"../../../lib/convert-to-braintree-error\":128,\"../../../lib/deferred\":132,\"../../../lib/enumerate\":134,\"../../shared/constants\":199,\"../../shared/errors\":200,\"./base\":190,\"@braintree/extended-promise\":34}],197:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar methods = _dereq_(\"../../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\nvar EventEmitter = _dereq_(\"@braintree/event-emitter\");\nvar FRAMEWORKS = _dereq_(\"./frameworks\");\n\n/**\n * @deprecated\n * @callback ThreeDSecure~addFrameCallback\n * @param {?BraintreeError} [err] `null` or `undefined` if there was no error.\n * @param {HTMLIFrameElement} iframe An iframe element containing the bank's authentication page that you must put on your page.\n * @description **Deprecated** The callback used for options.addFrame in 3DS 1.0's {@link ThreeDSecure#verifyCard|verifyCard}.\n * @returns {void}\n */\n\n/**\n * @deprecated\n * @callback ThreeDSecure~removeFrameCallback\n * @description **Deprecated** The callback used for options.removeFrame in 3DS 1.0's {@link ThreeDSecure#verifyCard|verifyCard}.\n * @returns {void}\n */\n\n/**\n * @deprecated\n * @typedef {object} ThreeDSecure~verifyCardCustomerObject\n * @property {string} [customer.mobilePhoneNumber] The mobile phone number used for verification. Only numbers; remove dashes, parenthesis and other characters.\n * @property {string} [customer.email] The email used for verification.\n * @property {string} [customer.shippingMethod] The 2-digit string indicating the shipping method chosen for the transaction.\n * @property {string} [customer.billingAddress.firstName] The first name associated with the address.\n * @property {string} [customer.billingAddress.lastName] The last name associated with the address.\n * @property {string} [customer.billingAddress.streetAddress] Line 1 of the Address (eg. number, street, etc).\n * @property {string} [customer.billingAddress.extendedAddress] Line 2 of the Address (eg. suite, apt #, etc.).\n * @property {string} [customer.billingAddress.locality] The locality (city) name associated with the address.\n * @property {string} [customer.billingAddress.region] The 2 letter code for US states or an ISO-3166-2 country subdivision code of up to three letters.\n * @property {string} [customer.billingAddress.postalCode] The zip code or equivalent for countries that have them.\n * @property {string} [customer.billingAddress.countryCodeAlpha2] The 2 character country code.\n * @property {string} [customer.billingAddress.phoneNumber] The phone number associated with the address. Only numbers; remove dashes, parenthesis and other characters.\n * @description **Deprecated** Optional customer information to be passed to 3DS 1.0 for verification.\n */\n\n/**\n * @typedef {object} ThreeDSecure~verifyPayload\n * @property {string} nonce The new payment method nonce produced by the 3D Secure lookup. The original nonce passed into {@link ThreeDSecure#verifyCard|verifyCard} was consumed. This new nonce should be used to transact on your server.\n * @property {string} type The payment method type.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n * @property {boolean} liabilityShiftPossible *Deprecated:* Use `threeDSecureInfo.liabilityShiftPossible` instead.\n * @property {boolean} liabilityShifted *Deprecated:* Use `threeDSecureInfo.liabilityShifted` instead.\n * @property {object} threeDSecureInfo 3DS information about the card. Note: This information should be verified on the server by using the [payment method nonce find method](https://developer.paypal.com/braintree/docs/reference/request/payment-method-nonce/find). The values provided here are merely for convenience. Only values looked up on the server should determine the logic about how to process a transaction.\n * @property {string} threeDSecureInfo.acsTransactionId The transaction identifier from the issuing bank.\n * @property {string} threeDSecureInfo.cavv Cardholder authentication verification value or CAVV. The main encrypted message issuers and card networks use to verify authentication has occurred. Mastercard uses an AVV message and American Express uses an AEVV message, each of which should also be passed in the cavv parameter.\n * @property {string} threeDSecureInfo.dsTransactionId Transaction identifier resulting from 3D Secure 2 authentication.\n * @property {string} threeDSecureInfo.eciFlag The value of the electronic commerce indicator (ECI) flag, which indicates the outcome of the 3DS authentication. This will be a two-digit value.\n * @property {boolean} threeDSecureInfo.enrolled Indicates the status of 3D Secure authentication eligibility with the card issuer.\n * @property {boolean} threeDSecureInfo.liabilityShifted Indicates whether the liability for fraud has been shifted away from the merchant.\n * @property {boolean} threeDSecureInfo.liabilityShiftPossible Indicates whether liability shift is still possible on a retry.\n * @property {string} threeDSecureInfo.paresStatus Transaction status result identifier.\n * @property {string} threeDSecureInfo.status Indicates the outcome of the 3D Secure event.\n * @property {string} threeDSecureInfo.threeDSecureAuthenticationId ID of the 3D Secure authentication performed for this transaction. Do not provide this field as a transaction sale parameter if you are using the returned payment method nonce from the payload.\n * @property {string} threeDSecureInfo.threeDSecureServerTransactionId Transaction identifier provided by the issuing bank who recieved the 3D Secure event.\n * @property {string} threeDSecureInfo.threeDSecureVersion The version of 3D Secure authentication used for the transaction.\n * @property {string} threeDSecureInfo.xid Transaction identifier resulting from 3D Secure authentication. Uniquely identifies the transaction and sometimes required in the authorization message. This is a base64-encoded value. This field will no longer be used in 3D Secure 2 authentications for Visa and Mastercard, however it will be supported by American Express.\n * @property {string} threeDSecureInfo.lookup.transStatus Error code returned from the 3D Secure MPI provider.\n * @property {string} threeDSecureInfo.lookup.transStatusReason Description correlating to the transStatus error code.\n * @property {string} threeDSecureInfo.authentication.transStatus Error code returned from the 3D Secure MPI provider.\n * @property {string} threeDSecureInfo.authentication.transStatusReason Description correlating to the transStatus error code.\n * @property {object} rawCardinalSDKVerificationData The response back from the Cardinal SDK after verification has completed. See [Cardinal's Documentation](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/98315/Response+Objects) for more information. If the customer was not required to do a 3D Secure challenge, this object will not be available.\n */\n\n/**\n * @typedef {string} ThreeDSecure~prepareLookupPayload The client data to pass on when doing a server side lookup call.\n */\n\n/**\n * @typedef {object} ThreeDSecure~verificationData\n * @property {boolean} requiresUserAuthentication When `true`, the user will be presented with a 3D Secure challenge when calling `next` in the {@link ThreeDSecure#event:lookup-complete|`lookup-complete` event}.\n * @property {object} threeDSecureInfo Contains liability shift details.\n * @property {boolean} threeDSecureInfo.liabilityShiftPossible Indicates whether the card was eligible for 3D Secure.\n * @property {boolean} threeDSecureInfo.liabilityShifted Indicates whether the liability for fraud has been shifted away from the merchant.\n * @property {object} paymentMethod A {@link ThreeDSecure~verifyPayload|verifyPayload} object.\n * @property {object} lookup Details about the 3D Secure lookup.\n * @property {string} lookup.threeDSecureVersion The version of 3D Secure that will be used for the 3D Secure challenge.\n */\n\n/**\n * @typedef {object} ThreeDSecure~billingAddress\n * @property {string} [givenName] The first name associated with the billing address. (maximum length 50, ASCII characters)\n * @property {string} [surname] The last name associated with the billing address. (maximum length 50, ASCII characters)\n * @property {string} [phoneNumber] The phone number associated with the billing address. Only numbers; remove dashes, parenthesis and other characters.\n * @property {string} [streetAddress] Line 1 of the billing address (eg. number, street, etc). (maximum length 50)\n * @property {string} [extendedAddress] Line 2 of the billing address (eg. suite, apt #, etc.). (maximum length 50)\n * @property {string} [line3] Line 3 of the billing address if needed (eg. suite, apt #, etc). (maximum length 50)\n * @property {string} [locality] The locality (city) name associated with the billing address.\n * @property {string} [region] This field expects an ISO3166-2 subdivision code. The subdivision code is what follows the hyphen separator in the full ISO 3166-2 code. For example, the state of Ohio in the United States we expect \"OH\" as opposed to the full ISO 3166-2 code \"US-OH\".\n * @property {string} [postalCode] The zip code or equivalent for countries that have them.\n * @property {string} [countryCodeAlpha2] The 2 character country code.\n */\n\n/**\n * @typedef {object} ThreeDSecure~additionalInformation\n * @property {string} [workPhoneNumber] The work phone number used for verification. Only numbers; remove dashes, parenthesis and other characters. (maximum length 25)\n * @property {string} [shippingGivenName] The first name associated with the shipping address. (maximum length 50, ASCII characters)\n * @property {string} [shippingSurname] The last name associated with the shipping address. (maximum length 50, ASCII characters)\n * @property {object} [shippingAddress]\n * @property {string} [shippingAddress.streetAddress] Line 1 of the shipping address (eg. number, street, etc). (maximum length 50)\n * @property {string} [shippingAddress.extendedAddress] Line 2 of the shipping address (eg. suite, apt #, etc.). (maximum length 50)\n * @property {string} [shippingAddress.line3] Line 3 of the shipping address if needed (eg. suite, apt #, etc). (maximum length 50)\n * @property {string} [shippingAddress.locality] The locality (city) name associated with the shipping address. (maximum length 50)\n * @property {string} [shippingAddress.region] This field expects an ISO3166-2 subdivision code. The subdivision code is what follows the hyphen separator in the full ISO 3166-2 code. For example, the state of Ohio in the United States we expect \"OH\" as opposed to the full ISO 3166-2 code \"US-OH\".\n * @property {string} [shippingAddress.postalCode] The zip code or equivalent for countries that have them. (maximum length 10)\n * @property {string} [shippingAddress.countryCodeAlpha2] The 2 character country code. (maximum length 2)\n * @property {string} [shippingPhone] The phone number associated with the shipping address. Only numbers; remove dashes, parenthesis and other characters. (maximum length 20)\n * @property {string} [shippingMethod] The 2-digit string indicating the name of the shipping method chosen for the transaction. (maximum length 50) Possible values:\n * - `01` Same Day\n * - `02` Overnight / Expedited\n * - `03` Priority (2-3 Days)\n * - `04` Ground\n * - `05` Electronic Delivery\n * - `06` Ship to Store\n * @property {string} [shippingMethodIndicator] The 2-digit string indicating the shipping method chosen for the transaction Possible values.\n * - `01` Ship to cardholder billing address\n * - `02` Ship to another verified address on file with merchant\n * - `03` Ship to address that is different from billing address\n * - `04` Ship to store (store address should be populated on request)\n * - `05` Digital goods\n * - `06` Travel and event tickets, not shipped\n * - `07` Other\n * @property {string} [productCode] The 3-letter string representing the merchant product code. Possible values:\n * - `AIR` Airline\n * - `GEN` General Retail\n * - `DIG` Digital Goods\n * - `SVC` Services\n * - `RES` Restaurant\n * - `TRA` Travel\n * - `DSP` Cash Dispensing\n * - `REN` Car Rental\n * - `GAS` Fuel\n * - `LUX` Luxury Retail\n * - `ACC` Accommodation Retail\n * - `TBD` Other\n * @property {string} [deliveryTimeframe] The 2-digit number indicating the delivery time frame. Possible values:\n * - `01` Electronic delivery\n * - `02` Same day shipping\n * - `03` Overnight shipping\n * - `04` Two or more day shipping\n * @property {string} [deliveryEmail] For electronic delivery, email address to which the merchandise was delivered. (maximum length 254)\n * @property {string} [reorderindicator] The 2-digit number indicating whether the cardholder is reordering previously purchased merchandise. possible values:\n * - `01` First time ordered\n * - `02` Reordered\n * @property {string} [preorderIndicator] The 2-digit number indicating whether cardholder is placing an order with a future availability or release date. possible values:\n * - `01` Merchandise available\n * - `02` Future availability\n * @property {string} [preorderDate] The 8-digit number (format: YYYYMMDD) indicating expected date that a pre-ordered purchase will be available.\n * @property {string} [giftCardAmount] The purchase amount total for prepaid gift cards in major units. (maximum length 15)\n * @property {string} [giftCardCurrencyCode] ISO 4217 currency code for the gift card purchased. (maximum length 3)\n * @property {string} [giftCardCount] Total count of individual prepaid gift cards purchased. (maximum length 2)\n * @property {string} [accountAgeIndicator] The 2-digit value representing the length of time cardholder has had account. Possible values:\n * - `01` No Account\n * - `02` Created during transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [accountCreateDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder opened the account.\n * @property {string} [accountChangeIndicator] The 2-digit value representing the length of time since the last change to the cardholder account. This includes shipping address, new payment account or new user added. Possible values:\n * - `01` Changed during transaction\n * - `02` Less than 30 days\n * - `03` 30-60 days\n * - `04` More than 60 days\n * @property {string} [accountChangeDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder's account was last changed. This includes changes to the billing or shipping address, new payment accounts or new users added.\n * @property {string} [accountPwdChangeIndicator] The 2-digit value representing the length of time since the cardholder changed or reset the password on the account. Possible values:\n * - `01` No change\n * - `02` Changed during transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [accountPwdChangeDate] The 8-digit number (format: YYYYMMDD) indicating the date the cardholder last changed or reset password on account.\n * @property {string} [shippingAddressUsageIndicator] The 2-digit value indicating when the shipping address used for transaction was first used. Possible values:\n * - `01` This transaction\n * - `02` Less than 30 days\n * - `03` 30-60 days\n * - `04` More than 60 days\n * @property {string} [shippingAddressUsageDate] The 8-digit number (format: YYYYMMDD) indicating the date when the shipping address used for this transaction was first used.\n * @property {string} [transactionCountDay] Number of transactions (successful or abandoned) for this cardholder account within the last 24 hours. (maximum length 3)\n * @property {string} [transactionCountYear] Number of transactions (successful or abandoned) for this cardholder account within the last year. (maximum length 3)\n * @property {string} [addCardAttempts] Number of add card attempts in the last 24 hours. (maximum length 3)\n * @property {string} [accountPurchases] Number of purchases with this cardholder account during the previous six months.\n * @property {string} [fraudActivity] The 2-digit value indicating whether the merchant experienced suspicious activity (including previous fraud) on the account. Possible values:\n * - `01` No suspicious activity\n * - `02` Suspicious activity observed\n * @property {string} [shippingNameIndicator] The 2-digit value indicating if the cardholder name on the account is identical to the shipping name used for the transaction. Possible values:\n * - `01` Account and shipping name identical\n * - `02` Account and shipping name differ\n * @property {string} [paymentAccountIndicator] The 2-digit value indicating the length of time that the payment account was enrolled in the merchant account. Possible values:\n * - `01` No account (guest checkout)\n * - `02` During the transaction\n * - `03` Less than 30 days\n * - `04` 30-60 days\n * - `05` More than 60 days\n * @property {string} [paymentAccountAge] The 8-digit number (format: YYYYMMDD) indicating the date the payment account was added to the cardholder account.\n * @property {string} [acsWindowSize] The 2-digit number to set the challenge window size to display to the end cardholder. The ACS will reply with content that is formatted appropriately to this window size to allow for the best user experience. The sizes are width x height in pixels of the window displayed in the cardholder browser window. Possible values:\n * - `01` 250x400\n * - `02` 390x400\n * - `03` 500x600\n * - `04` 600x400\n * - `05` Full page\n * @property {string} [sdkMaxTimeout] The 2-digit number of minutes (minimum 05) to set the maximum amount of time for all 3DS 2.0 messages to be communicated between all components.\n * @property {string} [addressMatch] The 1-character value (Y/N) indicating whether cardholder billing and shipping addresses match.\n * @property {string} [accountId] Additional cardholder account information. (maximum length 64)\n * @property {string} [ipAddress] The IP address of the consumer. IPv4 and IPv6 are supported.\n * - only one IP address supported\n * - only numbers, letters, period '.' chars, or colons ':' are acceptable\n * @property {string} [orderDescription] Brief description of items purchased. (maximum length 256)\n * @property {string} [taxAmount] Unformatted tax amount without any decimalization (ie. $123.67 = 12367). (maximum length 20)\n * @property {string} [userAgent] The exact content of the HTTP user agent header. (maximum length 500)\n * @property {string} [authenticationIndicator] The 2-digit number indicating the type of authentication request. Possible values:\n * - `01` Payment\n * - `02` Recurring transaction\n * - `03` Installment\n * - `04` Add card\n * - `05` Maintain card\n * - `06` Cardholder verification as part of EMV token ID&V\n * @property {string} [installment] An integer value greater than 1 indicating the maximum number of permitted authorizations for installment payments. (maximum length 3)\n * @property {string} [purchaseDate] The 14-digit number (format: YYYYMMDDHHMMSS) indicating the date in UTC of original purchase.\n * @property {string} [recurringEnd] The 8-digit number (format: YYYYMMDD) indicating the date after which no further recurring authorizations should be performed.\n * @property {string} [recurringFrequency] Integer value indicating the minimum number of days between recurring authorizations. A frequency of monthly is indicated by the value 28. Multiple of 28 days will be used to indicate months (ex. 6 months = 168). (maximum length 3)\n */\n\n/**\n * @name ThreeDSecure#on\n * @function\n * @param {string} event The name of the event to which you are subscribing.\n * @param {function} handler A callback to handle the event.\n * @description Subscribes a handler function to a named event. The following events are available:\n * * {@link ThreeDSecure#event:lookup-complete|lookup-complete}\n * * {@link ThreeDSecure#event:customer-canceled|customer-canceled}\n * * {@link ThreeDSecure#event:authentication-iframe-available|authentication-iframe-available}\n * * {@link ThreeDSecure#event:authentication-modal-render|authentication-modal-render}\n * * {@link ThreeDSecure#event:authentication-modal-close|authentication-modal-close}\n * @example\n * <caption>Listening to a 3D Secure event</caption>\n * braintree.threeDSecure.create({ ... }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('lookup-complete', function (data, next) {\n * console.log('data from the lookup', data);\n * next();\n * });\n * threeDSecureInstance.on('customer-canceled', function () {\n * console.log('log that the customer canceled');\n * });\n * });\n * @returns {void}\n */\n\n/**\n * @name ThreeDSecure#off\n * @function\n * @param {string} event The name of the event to which you are unsubscribing.\n * @param {function} handler The callback for the event you are unsubscribing from.\n * @description Unsubscribes the handler function to a named event.\n * @example\n * <caption>Subscribing and then unsubscribing from a 3D Secure eld event</caption>\n * braintree.threeDSecure.create({ ... }, function (createErr, threeDSecureInstance) {\n * var lookupCallback = function (data, next) {\n * console.log(data);\n * next();\n * };\n * var cancelCallback = function () {\n * // log the cancelation\n * // or update UI\n * };\n *\n * threeDSecureInstance.on('lookup-complete', lookupCallback);\n * threeDSecureInstance.on('customer-canceled', cancelCallback);\n *\n * // later on\n * threeDSecureInstance.off('lookup-complete', lookupCallback);\n * threeDSecureInstance.off('customer-canceled', cancelCallback);\n * });\n * @returns {void}\n */\n\n/**\n * This event is emitted when the `2-inline-iframe` version is specified when creating the 3D Secure instance and the authentication iframe becomes available.\n * @event ThreeDSecure#authentication-iframe-available\n * @example\n * <caption>Listening for the authentication iframe to be available</caption>\n * threeDSecureInstance.on('authentication-iframe-available', function (event, next) {\n * document.body.appendChild(event.element); // add iframe element to page\n *\n * next(); // let the SDK know the iframe is ready\n * });\n * });\n */\n\n/**\n * This event is emitted when using the 3D Secure 2.0 flow and the initial lookup request completes. If this is not used, a `onLookupComplete` callback must be passed into the `verifyCard` method.\n * @event ThreeDSecure#lookup-complete\n * @example\n * <caption>Listening for when the lookup request is complete</caption>\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('lookup-complete', function (data, next) {\n * // inspect the data\n *\n * // call next when ready to proceed with the challenge\n * next();\n * });\n * });\n */\n\n/**\n * This event is emitted when using the 3D Secure 2.0 flow and the customer cancels the 3D Secure challenge.\n * @event ThreeDSecure#customer-canceled\n * @example\n * <caption>Listening for when the customer cancels the 3D Secure challenge</caption>\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('customer-canceled', function () {\n * // the customer canceled the 3D Secure challenge\n * });\n * });\n */\n\n/**\n * This event is emitted when using the 3D Secure 2.0 flow and the authentication modal closes, either because the authentication was completed or because the customer canceled the process.\n * @event ThreeDSecure#authentication-modal-close\n * @example\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('authentication-modal-close', function () {\n * // the modal was closed\n * });\n * });\n */\n\n/**\n * This event is emitted when using the 3D Secure 2.0 flow and the authentication modal is rendered.\n * @event ThreeDSecure#authentication-modal-render\n * @example\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createErr, threeDSecureInstance) {\n * threeDSecureInstance.on('authentication-modal-render', function () {\n * // the modal was rendered, presenting the authentication form to the customer\n * });\n * });\n */\n\n/**\n * @class\n * @param {object} options 3D Secure {@link module:braintree-web/three-d-secure.create create} options\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create} instead.</strong>\n * @classdesc This class represents a ThreeDSecure component produced by {@link module:braintree-web/three-d-secure.create|braintree.threeDSecure.create}. Instances of this class have a method for launching a 3D Secure authentication flow.\n *\n * If you use the Braintree SDK from within an iframe, you must not use the `sandbox` attribute on your iframe or the 3D Secure modal will not function correctly.\n *\n * **Note**: 3D Secure 2.0 is documented below and will become the default integration method in a future version of Braintree-web. Until then, version 1.0 will continue to be supported. To view 3D Secure 1.0 documentation, look at Braintree-web documentation from version [3.40.0](https://braintree.github.io/braintree-web/3.40.0/ThreeDSecure.html) and earlier, or upgrade your integration by referring to the [3D Secure 2.0 adoption guide](https://developer.paypal.com/braintree/docs/guides/3d-secure/migration/javascript/v3).\n */\nfunction ThreeDSecure(options) {\n var self = this;\n var Framework = FRAMEWORKS[options.framework];\n\n EventEmitter.call(this);\n\n this._framework = new Framework(options);\n this._framework.setUpEventListeners(function () {\n self._emit.apply(self, arguments);\n });\n}\n\nEventEmitter.createChild(ThreeDSecure);\n// NEXT_MAJOR_VERSION remove exemptionRequested entirely in favor of `requestedExemptionType`\n/**\n * Launch the 3D Secure login flow, returning a nonce payload.\n *\n * @public\n * @param {object} options Options for card verification.\n * @param {string} options.nonce The nonce representing the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.nonce`.\n * @param {string} options.bin The numeric Bank Identification Number (bin) of the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.details.bin`.\n * @param {string} options.amount The amount of the transaction in the current merchant account's currency. This must be expressed in numbers with an optional decimal (using `.`) and precision up to the hundredths place. For example, if you're processing a transaction for 1.234,56 € then `amount` should be `1234.56`.\n * @param {string} [options.accountType] The account type for the card (if known). Accepted values: `credit` or `debit`.\n * @param {boolean} [options.cardAddChallengeRequested] If set to `true`, a card-add challenge will be requested from the issuer. If set to `false`, a card-add challenge will not be requested. If the param is missing, a card-add challenge will only be requested for $0 amount. An authentication created using this flag should only be used for vaulting operations (creation of customers' credit cards or payment methods) and not for creating transactions.\n * @param {boolean} [options.cardAdd] *Deprecated:* Use `cardAddChallengeRequested` instead.\n * @param {boolean} [options.challengeRequested] If set to true, an authentication challenge will be forced if possible.\n * @param {boolean} [options.dataOnlyRequested] Indicates whether to use the data only flow. In this flow, frictionless 3DS is ensured for Mastercard cardholders as the card scheme provides a risk score for the issuer to determine whether to approve. If data only is not supported by the processor, a validation error will be raised. Non-Mastercard cardholders will fallback to a normal 3DS flow.\n * @param {boolean} [options.exemptionRequested] *Deprecated:* Use `requestedExemptionType` instead.\n * @param {boolean} [options.requestVisaDAF] Request to use VISA Digital Authentication Framework. If set to true, a Visa DAF authenticated payment credential will be created and/or used for authentication if the merchant is eligible.\n * @param {string} [options.merchantName] Allows to override the merchant name that is shown in the challenge.\n * @param {string} [options.requestedExemptionType] If an exemption is requested and the exemption's conditions are satisfied, then it will be applied. The following supported exemptions are defined as per PSD2 regulation: `low_value`, `transaction_risk_analysis`\n * @param {object} [options.customFields] Object where each key is the name of a custom field which has been configured in the Control Panel. In the Control Panel you can configure 3D Secure Rules which trigger on certain values.\n * @param {function} [options.onLookupComplete] *Deprecated:* Use {@link ThreeDSecure#event:lookup-complete|`threeDSecureInstance.on('lookup-complete')`} instead. Function to execute when lookup completes. The first argument, `data`, is a {@link ThreeDSecure~verificationData|verificationData} object, and the second argument, `next`, is a callback. `next` must be called to continue.\n * @param {string} [options.email] The email used for verification. (maximum length 255)\n * @param {string} [options.mobilePhoneNumber] The mobile phone number used for verification. Only numbers; remove dashes, parenthesis and other characters. (maximum length 25)\n * @param {object} [options.billingAddress] An {@link ThreeDSecure~billingAddress|billingAddress} object for verification.\n * @param {object} [options.additionalInformation] An {@link ThreeDSecure~additionalInformation|additionalInformation} object for verification.\n * @param {object} [options.collectDeviceData] If set to `true`, device data such as browser screen dimensions, language and time zone is submitted with lookup data.\n * @param {object} [options.customer] **Deprecated** Customer information for use in 3DS 1.0 verifications. Can contain any subset of a {@link ThreeDSecure~verifyCardCustomerObject|verifyCardCustomerObject}. Only to be used for 3DS 1.0 integrations.\n * @param {callback} options.addFrame **Deprecated** This {@link ThreeDSecure~addFrameCallback|addFrameCallback} will be called when the bank frame needs to be added to your page. Only to be used for 3DS 1.0 integrations.\n * @param {callback} options.removeFrame **Deprecated** For use in 3DS 1.0 Flows. This {@link ThreeDSecure~removeFrameCallback|removeFrameCallback} will be called when the bank frame needs to be removed from your page. Only to be used in 3DS 1.0 integrations.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link ThreeDSecure~verifyPayload|verifyPayload}. If no callback is provided, it will return a promise that resolves {@link ThreeDSecure~verifyPayload|verifyPayload}.\n\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * <caption>Verifying a payment method nonce with 3DS 2.0</caption>\n * var my3DSContainer;\n *\n * // set up listener after initialization\n * threeDSecure.on(('lookup-complete', function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * });\n *\n * // call verifyCard after tokenizing a card\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com'\n * billingAddress: {\n * givenName: 'Jill',\n * surname: 'Doe',\n * phoneNumber: '8101234567',\n * streetAddress: '555 Smith St.',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * },\n * additionalInformation: {\n * workPhoneNumber: '5555555555',\n * shippingGivenName: 'Jill',\n * shippingSurname: 'Doe',\n * shippingAddress: {\n * streetAddress: '555 Smith st',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * }\n * shippingPhone: '8101234567'\n * }\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n * @example\n * <caption>Verifying a payment method nonce with 3DS 2.0 with onLookupComplete callback</caption>\n * var my3DSContainer;\n *\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com'\n * billingAddress: {\n * givenName: 'Jill',\n * surname: 'Doe',\n * phoneNumber: '8101234567',\n * streetAddress: '555 Smith St.',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * },\n * additionalInformation: {\n * workPhoneNumber: '5555555555',\n * shippingGivenName: 'Jill',\n * shippingSurname: 'Doe',\n * shippingAddress: {\n * streetAddress: '555 Smith st',\n * extendedAddress: '#5',\n * locality: 'Oakland',\n * region: 'CA',\n * postalCode: '12345',\n * countryCodeAlpha2: 'US'\n * }\n * shippingPhone: '8101234567'\n * },\n * onLookupComplete: function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * }\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n * @example\n * <caption>Handling 3DS lookup errors</caption>\n * var my3DSContainer;\n *\n * // set up listener after initialization\n * threeDSecure.on(('lookup-complete', function (data, next) {\n * // use `data` here, then call `next()`\n * next();\n * });\n *\n * // call verifyCard after tokenizing a card\n * threeDSecure.verifyCard({\n * amount: '123.45',\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin,\n * email: 'test@example.com',\n * billingAddress: billingAddressFromCustomer,\n * additionalInformation: additionalInfoFromCustomer\n * }, function (err, payload) {\n * if (err) {\n * if (err.code.indexOf('THREEDS_LOOKUP') === 0) {\n * // an error occurred during the initial lookup request\n *\n * if (err.code === 'THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR') {\n * // either the passed payment method nonce does not exist\n * // or it was already consumed before the lookup call was made\n * } else if (err.code.indexOf('THREEDS_LOOKUP_VALIDATION') === 0) {\n * // a validation error occurred\n * // likely some non-ascii characters were included in the billing\n * // address given name or surname fields, or the cardholdername field\n *\n * // Instruct your user to check their data and try again\n * } else {\n * // an unknown lookup error occurred\n * }\n * } else {\n * // some other kind of error\n * }\n * return;\n * }\n *\n * // handle success\n * });\n */\nThreeDSecure.prototype.verifyCard = function (options) {\n var privateOptions;\n\n if (this.hasListener(\"lookup-complete\")) {\n privateOptions = {\n ignoreOnLookupCompleteRequirement: true,\n };\n }\n\n return this._framework.verifyCard(options, privateOptions);\n};\n\n/* eslint-disable-next-line valid-jsdoc */\n/**\n * Launch the iframe challenge using a 3D Secure lookup response from a server side lookup.\n *\n * @public\n * @param {(object|string)} lookupResponse The lookup response from the server side call to lookup the 3D Secure information. The raw string or a parsed object can be passed.\n * @returns {Promise} Returns a promise.\n * @example\n * var my3DSContainer;\n *\n * threeDSecure.initializeChallengeWithLookupResponse(lookupResponseFromServer).then(function (payload) {\n * if (payload.liabilityShifted) {\n * // Liability has shifted\n * submitNonceToServer(payload.nonce);\n * } else if (payload.liabilityShiftPossible) {\n * // Liability may still be shifted\n * // Decide if you want to submit the nonce\n * } else {\n * // Liability has not shifted and will not shift\n * // Decide if you want to submit the nonce\n * }\n * });\n */\nThreeDSecure.prototype.initializeChallengeWithLookupResponse = function (\n lookupResponse\n) {\n if (typeof lookupResponse === \"string\") {\n lookupResponse = JSON.parse(lookupResponse);\n }\n\n return this._framework.initializeChallengeWithLookupResponse(lookupResponse);\n};\n\n/**\n * Gather the data needed for a 3D Secure lookup call.\n *\n * @public\n * @param {object} options Options for 3D Secure lookup.\n * @param {string} options.nonce The nonce representing the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.nonce`.\n * @param {string} options.bin The numeric Bank Identification Number (bin) of the card from a tokenization payload. For example, this can be a {@link HostedFields~tokenizePayload|tokenizePayload} returned by Hosted Fields under `payload.details.bin`.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link ThreeDSecure~prepareLookupPayload|prepareLookupPayload}. If no callback is provided, it will return a promise that resolves {@link ThreeDSecure~prepareLookupPayload|prepareLookupPayload}.\n\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * <caption>Preparing data for a 3D Secure lookup</caption>\n * threeDSecure.prepareLookup({\n * nonce: hostedFieldsTokenizationPayload.nonce,\n * bin: hostedFieldsTokenizationPayload.details.bin\n * }, function (err, payload) {\n * if (err) {\n * console.error(err);\n * return;\n * }\n *\n * // send payload to server to do server side lookup\n * });\n */\nThreeDSecure.prototype.prepareLookup = function (options) {\n return this._framework.prepareLookup(options).then(function (data) {\n return JSON.stringify(data);\n });\n};\n\n/**\n * Cancel the 3DS flow and return the verification payload if available. If using 3D Secure version 2, this will not close the UI of the authentication modal. It is recommended that this method only be used in the {@link ThreeDSecure#event:lookup-complete|`lookup-complete`} event or the `onLookupComplete` callback.\n * @public\n * @param {callback} [callback] The second argument is a {@link ThreeDSecure~verifyPayload|verifyPayload}. If there is no verifyPayload (the initial lookup did not complete), an error will be returned. If no callback is passed, `cancelVerifyCard` will return a promise.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example <caption>Cancel the verification in `lookup-complete` event</caption>\n * // set up listener after instantiation\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // determine if you want to call next to start the challenge,\n * // if not, call cancelVerifyCard\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n * });\n *\n * // after tokenizing a credit card\n * threeDSecure.verifyCard({\n * amount: '100.00',\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload\n * // other fields such as billing address\n * }, function (verifyError, payload) {\n * if (verifyError) {\n * if (verifyError.code === 'THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT ') {\n * // flow was canceled by merchant, 3ds info can be found in the payload\n * // for cancelVerifyCard\n * }\n * }\n * });\n * @example <caption>Cancel the verification in onLookupComplete callback</caption>\n * threeDSecure.verifyCard({\n * amount: '100.00',\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload,\n * // other fields such as billing address\n * onLookupComplete: function (data, next) {\n * // determine if you want to call next to start the challenge,\n * // if not, call cancelVerifyCard\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n * }\n * }, function (verifyError, payload) {\n * if (verifyError) {\n * if (verifyError.code === 'THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT ') {\n * // flow was canceled by merchant, 3ds info can be found in the payload\n * // for cancelVerifyCard\n * }\n * }\n * });\n * @example <caption>Cancel the verification in 3D Secure version 1</caption>\n * // unlike with v2, this will not cause `verifyCard` to error, it will simply\n * // never call the callback\n * threeDSecure.cancelVerifyCard(function (err, verifyPayload) {\n * if (err) {\n * // Handle error\n * console.log(err.message); // No verification payload available\n * return;\n * }\n *\n * verifyPayload.nonce; // The nonce returned from the 3ds lookup call\n * verifyPayload.liabilityShifted; // boolean\n * verifyPayload.liabilityShiftPossible; // boolean\n * });\n */\nThreeDSecure.prototype.cancelVerifyCard = function () {\n return this._framework.cancelVerifyCard();\n};\n\n/**\n * Cleanly remove anything set up by {@link module:braintree-web/three-d-secure.create|create}, with the exception that the Cardinal SDK, on window.Cardinal, will remain.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is passed, `teardown` will return a promise.\n * @example\n * threeDSecure.teardown();\n * @example <caption>With callback</caption>\n * threeDSecure.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nThreeDSecure.prototype.teardown = function () {\n var methodNames = methods(ThreeDSecure.prototype).concat(\n methods(EventEmitter.prototype)\n );\n\n convertMethodsToError(this, methodNames);\n\n return this._framework.teardown();\n};\n\nmodule.exports = wrapPromise.wrapPrototype(ThreeDSecure);\n\n},{\"../../lib/convert-methods-to-error\":127,\"../../lib/methods\":155,\"./frameworks\":193,\"@braintree/event-emitter\":33,\"@braintree/wrap-promise\":43}],198:[function(_dereq_,module,exports){\n\"use strict\";\n/** @module braintree-web/three-d-secure */\n\nvar ThreeDSecure = _dereq_(\"./external/three-d-secure\");\nvar isHTTPS = _dereq_(\"../lib/is-https\").isHTTPS;\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar errors = _dereq_(\"./shared/errors\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {object} [options.cardinalSDKConfig] A config for the underlying Cardinal SDK.\n * @param {object} [options.cardinalSDKConfig.logging] The logging configuration for the Cardinal SDK. See [Cardinal's documentation for the logging object](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-Logging) for more information.\n * @param {number} [options.cardinalSDKConfig.timeout] The time in milliseconds to wait before a request to Cardinal's API times out. See [Cardinal's documentation for root level configuration](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-RootLevelConfiguration) for more information.\n * @param {number} [options.cardinalSDKConfig.maxRequestRetries] How many times a request should be re-attempted to Cardinal's API before giving up as a failure. See [Cardinal's documentation for root level configuration](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-RootLevelConfiguration) for more information.\n * @param {object} [options.cardinalSDKConfig.payment] An object to describe how you want the user interactions to behave. Only a subset of the [Cardinal SDK payment configuration object](https://cardinaldocs.atlassian.net/wiki/spaces/CC/pages/1409568/Configurations#Configurations-Payment) are supported: `displayLoading` and `displayExitButton`.\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {(number|string)} [options.version=1] The version of 3D Secure to use. Possible options:\n * * 1 - The legacy 3D Secure v1.0 integration.\n * * 2 - A 3D Secure v2.0 integration that uses a modal to host the 3D Secure iframe.\n * * 2-bootstrap3-modal - A 3D Secure v2.0 integration that uses a modal styled with Bootstrap 3 styles to host the 3D Secure iframe. Requires having the Bootstrap 3 script files and stylesheets on your page.\n * * 2-inline-iframe - A 3D Secure v2.0 integration that provides the authentication iframe directly to the merchant.\n * @param {callback} [callback] The second argument, `data`, is the {@link ThreeDSecure} instance. If no callback is provided, it returns a promise that resolves the {@link ThreeDSecure} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n@example\n * <caption>Creating a v2 3D Secure component using 2 version (Cardinal modal)</caption>\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n * @example\n * <caption>Creating a v2 3D Secure component using 2-bootstrap3-modal version</caption>\n * // must have the boostrap js, css and jquery files on your page\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2-bootstrap3-modal'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * // challenge will be presented in a bootstrap 3 modal\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n * @example\n * <caption>Creating a v2 3D Secure component using 2-inline-iframe version</caption>\n * braintree.threeDSecure.create({\n * client: clientInstance,\n * version: '2-inline-iframe'\n * }, function (createError, threeDSecure) {\n * // set up lookup-complete listener\n * threeDSecure.on('lookup-complete', function (data, next) {\n * // check lookup data\n *\n * next();\n * });\n * // set up iframe listener\n * threeDSecure.on('authentication-iframe-available', function (event, next) {\n * var element = event.element; // an html element that contains the iframe\n *\n * document.body.appendChild(element); // put it on your page\n *\n * next(); // let the sdk know the element has been added to the page\n * });\n *\n * // using Hosted Fields, use `tokenize` to get back a credit card nonce\n *\n * threeDSecure.verifyCard({\n * nonce: nonceFromTokenizationPayload,,\n * bin: binFromTokenizationPayload,\n * amount: '100.00'\n * }, function (verifyError, payload) {\n * // inspect payload\n * // send payload.nonce to your server\n * });\n * });\n */\nfunction create(options) {\n var name = \"3D Secure\";\n var framework = getFramework(options);\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n var assetsUrl = createAssetsUrl.create(options.authorization);\n var createPromise = createDeferredClient\n .create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: assetsUrl,\n name: name,\n })\n .then(function (client) {\n var error, isProduction;\n var config = client.getConfiguration();\n var gwConfig = config.gatewayConfiguration;\n\n options.client = client;\n\n if (!gwConfig.threeDSecureEnabled) {\n error = errors.THREEDS_NOT_ENABLED;\n }\n\n if (config.authorizationType === \"TOKENIZATION_KEY\") {\n error = errors.THREEDS_CAN_NOT_USE_TOKENIZATION_KEY;\n }\n\n isProduction = gwConfig.environment === \"production\";\n\n if (isProduction && !isHTTPS()) {\n error = errors.THREEDS_HTTPS_REQUIRED;\n }\n\n if (\n framework !== \"legacy\" &&\n !(\n gwConfig.threeDSecure &&\n gwConfig.threeDSecure.cardinalAuthenticationJWT\n )\n ) {\n analytics.sendEvent(\n options.client,\n \"three-d-secure.initialization.failed.missing-cardinalAuthenticationJWT\"\n );\n error = errors.THREEDS_NOT_ENABLED_FOR_V2;\n }\n\n if (error) {\n return Promise.reject(new BraintreeError(error));\n }\n\n analytics.sendEvent(options.client, \"three-d-secure.initialized\");\n\n return client;\n });\n var instance = new ThreeDSecure({\n client: options.client,\n assetsUrl: assetsUrl,\n createPromise: createPromise,\n loggingEnabled: options.loggingEnabled,\n cardinalSDKConfig: options.cardinalSDKConfig,\n framework: framework,\n });\n\n if (options.client) {\n return createPromise.then(function () {\n return instance;\n });\n }\n\n return instance;\n });\n}\n\nfunction getFramework(options) {\n var version = String(options.version || \"\");\n\n if (!version || version === \"1\") {\n throw new BraintreeError({\n code: errors.THREEDS_UNSUPPORTED_VERSION.code,\n type: errors.THREEDS_UNSUPPORTED_VERSION.type,\n message: errors.THREEDS_UNSUPPORTED_VERSION.message,\n });\n }\n\n switch (version) {\n case \"2\":\n case \"2-cardinal-modal\":\n return \"cardinal-modal\";\n case \"2-bootstrap3-modal\":\n return \"bootstrap3-modal\";\n case \"2-inline-iframe\":\n return \"inline-iframe\";\n default:\n throw new BraintreeError({\n code: errors.THREEDS_UNRECOGNIZED_VERSION.code,\n type: errors.THREEDS_UNRECOGNIZED_VERSION.type,\n message:\n \"Version `\" +\n options.version +\n \"` is not a recognized version. You may need to update the version of your Braintree SDK to support this version.\",\n });\n }\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"../lib/is-https\":152,\"./external/three-d-secure\":197,\"./shared/errors\":200,\"@braintree/wrap-promise\":43}],199:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n LANDING_FRAME_NAME: \"braintreethreedsecurelanding\",\n CARDINAL_SCRIPT_SOURCE: {\n production: \"https://songbird.cardinalcommerce.com/edge/v1/songbird.js\",\n sandbox: \"https://songbirdstag.cardinalcommerce.com/edge/v1/songbird.js\",\n },\n};\n\n},{}],200:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.3D Secure - Creation Error Codes\n * @description Errors that occur when [creating the 3D Secure component](./module-braintree-web_three-d-secure.html#.create).\n * @property {MERCHANT} THREEDS_NOT_ENABLED Occurs when 3D Secure is not enabled in the Braintree control panel.\n * @property {MERCHANT} THREEDS_CAN_NOT_USE_TOKENIZATION_KEY Occurs when 3D Secure component is created without a Client Token.\n * @property {MERCHANT} THREEDS_HTTPS_REQUIRED Occurs when 3D Secure component is created in production over HTTPS.\n * @property {MERCHANT} THREEDS_NOT_ENABLED_FOR_V2 Occurs when 3D Secure component is created with version 2 parameter, but merchant is not enabled to use version 2.\n * @property {MERCHANT} THREEDS_UNRECOGNIZED_VERSION Occurs when unrecognized version enum is passed into the create call.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_SETUP_FAILED Occurs when Cardinal's Songbird.js library fails to setup for an unknown reason.\n * @property {NETWORK} THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED Occurs when using version 2 and Cardinal's Songbird.js script could not be loaded.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT Occurs when Cardinal's Songbird.js library takes longer than 60 seconds to set up.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT Occurs when Cardinal sends a response indicating a timeout on /Validate, /Confirm, or /Continue.\n * @property {MERCHANT} THREEDS_CARDINAL_SDK_BAD_CONFIG Occurs when there is no JWT in the request. Also when there's some other malformed aspect of config.\n * @property {MERCHANT} THREEDS_CARDINAL_SDK_BAD_JWT Occurs when a malformed config causes a either a missing response JWT or a malformed Cardinal response.\n * @property {UNKNOWN} THREEDS_CARDINAL_SDK_ERROR Occurs when a \"general error\" or a Cardinal hosted fields error happens. Description contains more details.\n * @property {CUSTOMER} THREEDS_CARDINAL_SDK_CANCELED Occurs when customer cancels the transaction mid-flow, usually with alt-pays that have their own cancel buttons.\n * @property {MERCHANT} THREEDS_UNSUPPORTED_VERSION Occurs when 3D Secure component is created with version 1 (or default version) parameter.\n */\n\n/**\n * @name BraintreeError.3D Secure - verifyCard Error Codes\n * @description Errors that occur when using the [`verifyCard` method](./ThreeDSecure.html#verifyCard).\n * @property {MERCHANT} THREEDS_AUTHENTICATION_IN_PROGRESS Occurs when another verification is already in progress.\n * @property {MERCHANT} THREEDS_MISSING_VERIFY_CARD_OPTION Occurs when a required option is missing.\n * @property {UNKNOWN} THREEDS_JWT_AUTHENTICATION_FAILED Occurs when something went wrong authenticating the JWT from the Cardinal SDK.\n * @property {MERCHANT} THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR Occurs when the supplied payment method nonce does not exist or the payment method nonce has already been consumed.\n * @property {CUSTOMER} THREEDS_LOOKUP_VALIDATION_ERROR Occurs when a validation error occurs during the 3D Secure lookup.\n * @property {UNKNOWN} THREEDS_LOOKUP_ERROR An unknown error occurred while attempting the 3D Secure lookup.\n * @property {MERCHANT} THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT Occurs when the 3D Secure flow is canceled by the merchant using `cancelVerifyCard` (3D Secure v2 flows only).\n * @property {UNKNOWN} THREEDS_INLINE_IFRAME_DETAILS_INCORRECT An unknown error occurred while attempting to use the inline iframe framework.\n * @property {MERCHANT} THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID Occurs when unrecognized exemption enum value is passed into verifyCard.\n */\n\n/**\n * @name BraintreeError.3D Secure - cancelVerifyCard Error Codes\n * @description Errors that occur when using the [`cancelVerifyCard` method](./ThreeDSecure.html#cancelVerifyCard).\n * @property {MERCHANT} THREEDS_NO_VERIFICATION_PAYLOAD Occurs when the 3D Secure flow is canceled, but there is no 3D Secure information available.\n */\n\n/**\n * @name BraintreeError.3D Secure - Internal Error Codes\n * @ignore\n * @description Errors that occur internally\n * @property {INTERNAL} THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN Occurs when iframe is initialized on a non-verified domain.\n * @property {INTERNAL} THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED Occurs when a 3D Secure framework method is not implemented.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n THREEDS_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_NOT_ENABLED\",\n message: \"3D Secure is not enabled for this merchant.\",\n },\n THREEDS_CAN_NOT_USE_TOKENIZATION_KEY: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_CAN_NOT_USE_TOKENIZATION_KEY\",\n message: \"3D Secure can not use a tokenization key for authorization.\",\n },\n THREEDS_HTTPS_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_HTTPS_REQUIRED\",\n message: \"3D Secure requires HTTPS.\",\n },\n THREEDS_NOT_ENABLED_FOR_V2: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_NOT_ENABLED_FOR_V2\",\n message:\n \"3D Secure version 2 is not enabled for this merchant. Contact Braintree Support for assistance at https://help.braintreepayments.com/\",\n },\n THREEDS_UNRECOGNIZED_VERSION: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_UNRECOGNIZED_VERSION\",\n },\n THREEDS_CARDINAL_SDK_SETUP_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_SETUP_FAILED\",\n message: \"Something went wrong setting up Cardinal's Songbird.js library.\",\n },\n THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED\",\n message: \"Cardinal's Songbird.js library could not be loaded.\",\n },\n THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT\",\n message: \"Cardinal's Songbird.js took too long to setup.\",\n },\n THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT\",\n message: \"Cardinal's API took too long to respond.\",\n },\n THREEDS_CARDINAL_SDK_BAD_CONFIG: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_CARDINAL_SDK_BAD_CONFIG\",\n message:\n \"JWT or other required field missing. Please check your setup configuration.\",\n },\n THREEDS_CARDINAL_SDK_BAD_JWT: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_CARDINAL_SDK_BAD_JWT\",\n message:\n \"Cardinal JWT missing or malformed. Please check your setup configuration.\",\n },\n THREEDS_CARDINAL_SDK_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_CARDINAL_SDK_ERROR\",\n message:\n \"A general error has occurred with Cardinal. See description for more information.\",\n },\n THREEDS_CARDINAL_SDK_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"THREEDS_CARDINAL_SDK_CANCELED\",\n message: \"Canceled by user.\",\n },\n THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT\",\n message: \"3D Secure verfication canceled by merchant.\",\n },\n THREEDS_AUTHENTICATION_IN_PROGRESS: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_AUTHENTICATION_IN_PROGRESS\",\n message:\n \"Cannot call verifyCard while existing authentication is in progress.\",\n },\n THREEDS_MISSING_VERIFY_CARD_OPTION: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_MISSING_VERIFY_CARD_OPTION\",\n },\n THREEDS_JWT_AUTHENTICATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_JWT_AUTHENTICATION_FAILED\",\n message: \"Something went wrong authenticating the JWT from Cardinal\",\n },\n THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR\",\n message:\n \"Either the payment method nonce passed to `verifyCard` does not exist, or it was already consumed\",\n },\n THREEDS_LOOKUP_VALIDATION_ERROR: {\n type: BraintreeError.types.CUSTOMER,\n code: \"THREEDS_LOOKUP_VALIDATION_ERROR\",\n message:\n \"The data passed in `verifyCard` did not pass validation checks. See details for more info\",\n },\n THREEDS_LOOKUP_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_LOOKUP_ERROR\",\n message: \"Something went wrong during the 3D Secure lookup\",\n },\n THREEDS_INLINE_IFRAME_DETAILS_INCORRECT: {\n type: BraintreeError.types.UNKNOWN,\n code: \"THREEDS_INLINE_IFRAME_DETAILS_INCORRECT\",\n message:\n \"Something went wrong when attempting to add the authentication iframe to the page.\",\n },\n THREEDS_NO_VERIFICATION_PAYLOAD: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_NO_VERIFICATION_PAYLOAD\",\n message: \"No verification payload available.\",\n },\n THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN: {\n type: BraintreeError.types.INTERNAL,\n code: \"THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN\",\n message: \"Term Url must be on a Braintree domain.\",\n },\n THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED: {\n type: BraintreeError.types.INTERNAL,\n code: \"THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED\",\n message: \"Method not implemented for this framework.\",\n },\n THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID\",\n message: \"Requested Exemption Type is invalid.\",\n },\n THREEDS_UNSUPPORTED_VERSION: {\n type: BraintreeError.types.MERCHANT,\n code: \"THREEDS_UNSUPPORTED_VERSION\",\n message:\n \"3D Secure `1` is deprecated and no longer supported. See available versions at https://braintree.github.io/braintree-web/current/module-braintree-web_three-d-secure.html#.create\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],201:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar enumerate = _dereq_(\"../../lib/enumerate\");\n\nmodule.exports = enumerate([\"AUTHENTICATION_COMPLETE\"], \"threedsecure:\");\n\n},{\"../../lib/enumerate\":134}],202:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/unionpay\n * @description This module allows you to accept UnionPay payments. *It is currently in beta and is subject to change.*\n */\n\nvar UnionPay = _dereq_(\"./shared/unionpay\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar errors = _dereq_(\"./shared/errors\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link UnionPay} instance. If no callback is provided, `create` returns a promise that resolves with the {@link UnionPay} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * braintree.unionpay.create({ client: clientInstance }, function (createErr, unionpayInstance) {\n * if (createErr) {\n * console.error(createErr);\n * return;\n * }\n * // ...\n * });\n */\nfunction create(options) {\n var name = \"UnionPay\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n var config = client.getConfiguration();\n\n options.client = client;\n\n if (\n !config.gatewayConfiguration.unionPay ||\n config.gatewayConfiguration.unionPay.enabled !== true\n ) {\n return Promise.reject(new BraintreeError(errors.UNIONPAY_NOT_ENABLED));\n }\n\n analytics.sendEvent(options.client, \"unionpay.initialized\");\n\n return new UnionPay(options);\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./shared/errors\":204,\"./shared/unionpay\":205,\"@braintree/wrap-promise\":43}],203:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar enumerate = _dereq_(\"../../lib/enumerate\");\n\nmodule.exports = {\n events: enumerate(\n [\n \"HOSTED_FIELDS_FETCH_CAPABILITIES\",\n \"HOSTED_FIELDS_ENROLL\",\n \"HOSTED_FIELDS_TOKENIZE\",\n ],\n \"union-pay:\"\n ),\n HOSTED_FIELDS_FRAME_NAME: \"braintreeunionpayhostedfields\",\n};\n\n},{\"../../lib/enumerate\":134}],204:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Union Pay - Creation Error Codes\n * @description Errors that occur when [creating the Union Pay component](./module-braintree-web_union-pay.html#.create).\n * @property {MERCHANT} UNIONPAY_NOT_ENABLED Occurs when Union Pay is not enabled on the Braintree control panel.\n */\n\n/**\n * @name BraintreeError.Union Pay - Shared Error Codes\n * @description Errors that occur when starting the Union Pay Flow\n * @property {MERCHANT} UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES Occurs when a method is used with both card details and a Hosted Fields instance.\n * @property {MERCHANT} UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID Occurs when Hosted Fields instance used is not a valid Hosted Fields instance.\n * @property {MERCHANT} UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED Occurs when neither card details or Hosted Fields are used.\n * @property {MERCHANT} UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED Occurs when Hosted Fields cannot be found on the page.\n */\n\n/**\n * @name BraintreeError.Union Pay - fetchCapabilities Error Codes\n * @description Errors that occur when using the [`fetchCapabilities` method](./UnionPay.html#fetchCapabilities).\n * @property {NETWORK} UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR Occurs when there is an error looking up the Union Pay capabilities.\n */\n\n/**\n * @name BraintreeError.Union Pay - enroll Error Codes\n * @description Errors that occur when using the [`enroll` method](./UnionPay.html#enroll).\n * @property {MERCHANT} UNIONPAY_MISSING_MOBILE_PHONE_DATA Occurs when no mobile phone data is provided.\n * @property {MERCHANT} UNIONPAY_EXPIRATION_DATE_INCOMPLETE Occurs when expiration date is incomplete.\n * @property {CUSTOMER} UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID Occurs when customer enrollment input is invalid.\n * @property {NETWORK} UNIONPAY_ENROLLMENT_NETWORK_ERROR Occurs when there is an error during enrollment.\n */\n\n/**\n * @name BraintreeError.Union Pay - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./UnionPay.html#tokenize).\n * @property {CUSTOMER} UNIONPAY_FAILED_TOKENIZATION Occurs when data cannot be tokenized.\n * @property {NETWORK} UNIONPAY_TOKENIZATION_NETWORK_ERROR Occurs when the Braintree gateway cannot be reached.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n UNIONPAY_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_NOT_ENABLED\",\n message: \"UnionPay is not enabled for this merchant.\",\n },\n UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID\",\n message:\n \"Found an invalid Hosted Fields instance. Please use a valid Hosted Fields instance.\",\n },\n UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED\",\n message: \"Could not find the Hosted Fields instance.\",\n },\n UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED\",\n message:\n \"A card or a Hosted Fields instance is required. Please supply a card or a Hosted Fields instance.\",\n },\n UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES\",\n message:\n \"Please supply either a card or a Hosted Fields instance, not both.\",\n },\n UNIONPAY_EXPIRATION_DATE_INCOMPLETE: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_EXPIRATION_DATE_INCOMPLETE\",\n message: \"You must supply expiration month and year or neither.\",\n },\n UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID: {\n type: BraintreeError.types.CUSTOMER,\n code: \"UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID\",\n message: \"Enrollment failed due to user input error.\",\n },\n UNIONPAY_ENROLLMENT_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"UNIONPAY_ENROLLMENT_NETWORK_ERROR\",\n message: \"Could not enroll UnionPay card.\",\n },\n UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR\",\n message: \"Could not fetch card capabilities.\",\n },\n UNIONPAY_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"UNIONPAY_TOKENIZATION_NETWORK_ERROR\",\n message: \"A tokenization network error occurred.\",\n },\n UNIONPAY_MISSING_MOBILE_PHONE_DATA: {\n type: BraintreeError.types.MERCHANT,\n code: \"UNIONPAY_MISSING_MOBILE_PHONE_DATA\",\n message: \"A `mobile` with `countryCode` and `number` is required.\",\n },\n UNIONPAY_FAILED_TOKENIZATION: {\n type: BraintreeError.types.CUSTOMER,\n code: \"UNIONPAY_FAILED_TOKENIZATION\",\n message: \"The supplied card data failed tokenization.\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],205:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar analytics = _dereq_(\"../../lib/analytics\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\nvar Bus = _dereq_(\"framebus\");\nvar constants = _dereq_(\"./constants\");\nvar isVerifiedDomain = _dereq_(\"../../lib/is-verified-domain\");\nvar useMin = _dereq_(\"../../lib/use-min\");\nvar convertMethodsToError = _dereq_(\"../../lib/convert-methods-to-error\");\nvar errors = _dereq_(\"./errors\");\nvar events = constants.events;\nvar iFramer = _dereq_(\"@braintree/iframer\");\nvar methods = _dereq_(\"../../lib/methods\");\nvar VERSION = \"3.100.0\";\nvar uuid = _dereq_(\"@braintree/uuid\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar BUS_CONFIGURATION_REQUEST_EVENT =\n _dereq_(\"../../lib/constants\").BUS_CONFIGURATION_REQUEST_EVENT;\n\n/**\n * @class\n * @param {object} options See {@link module:braintree-web/unionpay.create|unionpay.create}.\n * @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/unionpay.create|braintree-web.unionpay.create} instead.</strong>\n * @classdesc This class represents a UnionPay component. Instances of this class have methods for {@link UnionPay#fetchCapabilities fetching capabilities} of UnionPay cards, {@link UnionPay#enroll enrolling} a UnionPay card, and {@link UnionPay#tokenize tokenizing} a UnionPay card.\n */\nfunction UnionPay(options) {\n this._options = options;\n}\n\n/**\n * @typedef {object} UnionPay~fetchCapabilitiesPayload\n * @property {boolean} isUnionPay Determines if this card is a UnionPay card.\n * @property {boolean} isDebit Determines if this card is a debit card. This property is only present if `isUnionPay` is `true`.\n * @property {object} unionPay UnionPay specific properties. This property is only present if `isUnionPay` is `true`.\n * @property {boolean} unionPay.supportsTwoStepAuthAndCapture Determines if the card allows for an authorization, but settling the transaction later.\n * @property {boolean} unionPay.isSupported Determines if Braintree can process this UnionPay card. When false, Braintree cannot process this card and the user should use a different card.\n */\n\n/**\n * Fetches the capabilities of a card, including whether or not the SMS enrollment process is required.\n * @public\n * @param {object} options UnionPay {@link UnionPay#fetchCapabilities fetchCapabilities} options\n * @param {object} [options.card] The card from which to fetch capabilities. Note that this will only have one property, `number`. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number Card number.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link UnionPay#fetchCapabilitiesPayload fetchCapabilitiesPayload}. If no callback is provided, `fetchCapabilities` returns a promise that resolves with a {@link UnionPay#fetchCapabilitiesPayload fetchCapabilitiesPayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nUnionPay.prototype.fetchCapabilities = function (options) {\n var self = this;\n var client = this._options.client;\n var cardNumber = options.card ? options.card.number : null;\n var hostedFields = options.hostedFields;\n\n if (cardNumber && hostedFields) {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES)\n );\n } else if (cardNumber) {\n return client\n .request({\n method: \"get\",\n endpoint: \"payment_methods/credit_cards/capabilities\",\n data: {\n _meta: { source: \"unionpay\" },\n creditCard: {\n number: cardNumber,\n },\n },\n })\n .then(function (response) {\n analytics.sendEvent(client, \"unionpay.capabilities-received\");\n\n return response;\n })\n .catch(function (err) {\n var status = err.details && err.details.httpStatus;\n\n analytics.sendEvent(client, \"unionpay.capabilities-failed\");\n\n if (status === 403) {\n return Promise.reject(err);\n }\n\n return Promise.reject(\n new BraintreeError({\n type: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.type,\n code: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.code,\n message: errors.UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n } else if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID)\n );\n }\n\n return self._initializeHostedFields().then(function () {\n return new Promise(function (resolve, reject) {\n self._bus.emit(\n events.HOSTED_FIELDS_FETCH_CAPABILITIES,\n { hostedFields: hostedFields },\n function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n\n return;\n }\n\n resolve(response.payload);\n }\n );\n });\n });\n }\n\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED)\n );\n};\n\n/**\n * @typedef {object} UnionPay~enrollPayload\n * @property {string} enrollmentId UnionPay enrollment ID. This value should be passed to `tokenize`.\n * @property {boolean} smsCodeRequired UnionPay `smsCodeRequired` flag.\n * </p><b>true</b> - the user will receive an SMS code that needs to be supplied for tokenization.\n * </p><b>false</b> - the card can be immediately tokenized.\n */\n\n/**\n * Enrolls a UnionPay card. Use {@link UnionPay#fetchCapabilities|fetchCapabilities} to determine if the SMS enrollment process is required.\n * @public\n * @param {object} options UnionPay enrollment options:\n * @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number The card number.\n * @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.\n * @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {object} options.mobile The mobile information collected from the customer.\n * @param {string} options.mobile.countryCode The country code of the customer's mobile phone number.\n * @param {string} options.mobile.number The customer's mobile phone number.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link UnionPay~enrollPayload|enrollPayload}. If no callback is provided, `enroll` returns a promise that resolves with {@link UnionPay~enrollPayload|enrollPayload}.\n * @returns {void}\n */\nUnionPay.prototype.enroll = function (options) {\n var self = this;\n var client = this._options.client;\n var card = options.card;\n var mobile = options.mobile;\n var hostedFields = options.hostedFields;\n var data;\n\n if (!mobile) {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_MISSING_MOBILE_PHONE_DATA)\n );\n }\n\n if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID)\n );\n } else if (card) {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES)\n );\n }\n\n return new Promise(function (resolve, reject) {\n self._initializeHostedFields().then(function () {\n self._bus.emit(\n events.HOSTED_FIELDS_ENROLL,\n { hostedFields: hostedFields, mobile: mobile },\n function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n\n return;\n }\n\n resolve(response.payload);\n }\n );\n });\n });\n } else if (card && card.number) {\n data = {\n _meta: { source: \"unionpay\" },\n unionPayEnrollment: {\n number: card.number,\n mobileCountryCode: mobile.countryCode,\n mobileNumber: mobile.number,\n },\n };\n\n if (card.expirationDate) {\n data.unionPayEnrollment.expirationDate = card.expirationDate;\n } else if (card.expirationMonth || card.expirationYear) {\n if (card.expirationMonth && card.expirationYear) {\n data.unionPayEnrollment.expirationYear = card.expirationYear;\n data.unionPayEnrollment.expirationMonth = card.expirationMonth;\n } else {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_EXPIRATION_DATE_INCOMPLETE)\n );\n }\n }\n\n return client\n .request({\n method: \"post\",\n endpoint: \"union_pay_enrollments\",\n data: data,\n })\n .then(function (response) {\n analytics.sendEvent(client, \"unionpay.enrollment-succeeded\");\n\n return {\n enrollmentId: response.unionPayEnrollmentId,\n smsCodeRequired: response.smsCodeRequired,\n };\n })\n .catch(function (err) {\n var error;\n var status = err.details && err.details.httpStatus;\n\n if (status === 403) {\n error = err;\n } else if (status < 500) {\n error = new BraintreeError(\n errors.UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID\n );\n error.details = { originalError: err };\n } else {\n error = new BraintreeError(errors.UNIONPAY_ENROLLMENT_NETWORK_ERROR);\n error.details = { originalError: err };\n }\n\n analytics.sendEvent(client, \"unionpay.enrollment-failed\");\n\n return Promise.reject(error);\n });\n }\n\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED)\n );\n};\n\n/**\n * @typedef {object} UnionPay~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type Always <code>CreditCard</code>.\n * @property {object} details Additional account details:\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n */\n\n/**\n * Tokenizes a UnionPay card and returns a nonce payload.\n * @public\n * @param {object} options UnionPay tokenization options:\n * @param {object} [options.card] The card to enroll. Required if you are not using the `hostedFields` option.\n * @param {string} options.card.number The card number.\n * @param {string} [options.card.expirationDate] The card's expiration date. May be in the form `MM/YY` or `MM/YYYY`. When defined `expirationMonth` and `expirationYear` are ignored.\n * @param {string} [options.card.expirationMonth] The card's expiration month. This should be used with the `expirationYear` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.expirationYear] The card's expiration year. This should be used with the `expirationMonth` parameter. When `expirationDate` is defined this parameter is ignored.\n * @param {string} [options.card.cvv] The card's security number.\n * @param {HostedFields} [options.hostedFields] The Hosted Fields instance used to collect card data. Required if you are not using the `card` option.\n * @param {string} options.enrollmentId The enrollment ID from {@link UnionPay#enroll}.\n * @param {string} [options.smsCode] The SMS code received from the user if {@link UnionPay#enroll} payload have `smsCodeRequired`. if `smsCodeRequired` is false, smsCode should not be passed.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link UnionPay~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with a {@link UnionPay~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nUnionPay.prototype.tokenize = function (options) {\n var data;\n var self = this;\n var client = this._options.client;\n var card = options.card;\n var hostedFields = options.hostedFields;\n\n if (card && hostedFields) {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES)\n );\n } else if (card) {\n data = {\n _meta: { source: \"unionpay\" },\n creditCard: {\n number: options.card.number,\n options: {\n unionPayEnrollment: {\n id: options.enrollmentId,\n },\n },\n },\n };\n\n if (options.smsCode) {\n data.creditCard.options.unionPayEnrollment.smsCode = options.smsCode;\n }\n\n if (card.expirationDate) {\n data.creditCard.expirationDate = card.expirationDate;\n } else if (card.expirationMonth && card.expirationYear) {\n data.creditCard.expirationYear = card.expirationYear;\n data.creditCard.expirationMonth = card.expirationMonth;\n }\n\n if (options.card.cvv) {\n data.creditCard.cvv = options.card.cvv;\n }\n\n return client\n .request({\n method: \"post\",\n endpoint: \"payment_methods/credit_cards\",\n data: data,\n })\n .then(function (response) {\n var tokenizedCard = response.creditCards[0];\n\n delete tokenizedCard.consumed;\n delete tokenizedCard.threeDSecureInfo;\n\n analytics.sendEvent(client, \"unionpay.nonce-received\");\n\n return tokenizedCard;\n })\n .catch(function (err) {\n var error;\n var status = err.details && err.details.httpStatus;\n\n analytics.sendEvent(client, \"unionpay.nonce-failed\");\n\n if (status === 403) {\n error = err;\n } else if (status < 500) {\n error = new BraintreeError(errors.UNIONPAY_FAILED_TOKENIZATION);\n error.details = { originalError: err };\n } else {\n error = new BraintreeError(\n errors.UNIONPAY_TOKENIZATION_NETWORK_ERROR\n );\n error.details = { originalError: err };\n }\n\n return Promise.reject(error);\n });\n } else if (hostedFields) {\n if (!hostedFields._bus) {\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID)\n );\n }\n\n return new Promise(function (resolve, reject) {\n self._initializeHostedFields().then(function () {\n self._bus.emit(\n events.HOSTED_FIELDS_TOKENIZE,\n options,\n function (response) {\n if (response.err) {\n reject(new BraintreeError(response.err));\n\n return;\n }\n\n resolve(response.payload);\n }\n );\n });\n });\n }\n\n return Promise.reject(\n new BraintreeError(errors.UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED)\n );\n};\n\n/**\n * Cleanly remove anything set up by {@link module:braintree-web/unionpay.create|create}. This only needs to be called when using UnionPay with Hosted Fields.\n * @public\n * @param {callback} [callback] Called on completion. If no callback is provided, returns a promise.\n * @example\n * unionpayInstance.teardown();\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nUnionPay.prototype.teardown = function () {\n if (this._bus) {\n this._hostedFieldsFrame.parentNode.removeChild(this._hostedFieldsFrame);\n this._bus.teardown();\n }\n\n convertMethodsToError(this, methods(UnionPay.prototype));\n\n return Promise.resolve();\n};\n\nUnionPay.prototype._initializeHostedFields = function () {\n var assetsUrl, isDebug;\n var componentId = uuid();\n var self = this;\n\n if (this._hostedFieldsInitializePromise) {\n return this._hostedFieldsInitializePromise;\n }\n\n this._hostedFieldsInitializePromise = new Promise(function (resolve) {\n assetsUrl =\n self._options.client.getConfiguration().gatewayConfiguration.assetsUrl;\n isDebug = self._options.client.getConfiguration().isDebug;\n\n self._bus = new Bus({\n channel: componentId,\n verifyDomain: isVerifiedDomain,\n });\n self._hostedFieldsFrame = iFramer({\n name: constants.HOSTED_FIELDS_FRAME_NAME + \"_\" + componentId,\n src:\n assetsUrl +\n \"/web/\" +\n VERSION +\n \"/html/unionpay-hosted-fields-frame\" +\n useMin(isDebug) +\n \".html\",\n height: 0,\n width: 0,\n });\n\n self._bus.on(BUS_CONFIGURATION_REQUEST_EVENT, function (reply) {\n reply(self._options.client);\n\n resolve();\n });\n\n document.body.appendChild(self._hostedFieldsFrame);\n });\n\n return this._hostedFieldsInitializePromise;\n};\n\nmodule.exports = wrapPromise.wrapPrototype(UnionPay);\n\n},{\"../../lib/analytics\":119,\"../../lib/braintree-error\":124,\"../../lib/constants\":126,\"../../lib/convert-methods-to-error\":127,\"../../lib/is-verified-domain\":153,\"../../lib/methods\":155,\"../../lib/use-min\":160,\"./constants\":203,\"./errors\":204,\"@braintree/iframer\":35,\"@braintree/uuid\":39,\"@braintree/wrap-promise\":43,\"framebus\":52}],206:[function(_dereq_,module,exports){\n\"use strict\";\n\nmodule.exports = {\n PLAID_LINK_JS: \"https://cdn.plaid.com/link/v2/stable/link-initialize.js\",\n};\n\n},{}],207:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Us Bank Account - Creation Error Codes\n * @description Errors that occur when [creating the Us Bank Account component](./module-braintree-web_us-bank-account.html#.create).\n * @property {MERCHANT} US_BANK_ACCOUNT_NOT_ENABLED Occurs when US Bank Account is not enabled in the Braintree control panel.\n */\n\n/**\n * @name BraintreeError.Us Bank Account - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./UsBankAccount.html#tokenize).\n * @property {MERCHANT} US_BANK_ACCOUNT_OPTION_REQUIRED Occurs when a required option is not passed.\n * @property {MERCHANT} US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS Occurs when 1 or more incompatible options are passed.\n * @property {NETWORK} US_BANK_ACCOUNT_LOGIN_LOAD_FAILED Occurs when bank login flow fails.\n * @property {CUSTOMER} US_BANK_ACCOUNT_LOGIN_CLOSED Occurs when bank login window is closed.\n * @property {MERCHANT} US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE Occurs when a bank login flow is already active.\n * @property {NETWORK} US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR Occurs when payment details could not be tokenized.\n * @property {CUSTOMER} US_BANK_ACCOUNT_FAILED_TOKENIZATION Occurs when payment details failed to be tokenized.\n * @property {MERCHANT} US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED Occurs when bank login flow is not enabled in the Braintree control panel.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n US_BANK_ACCOUNT_OPTION_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_OPTION_REQUIRED\",\n },\n US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS\",\n },\n US_BANK_ACCOUNT_LOGIN_LOAD_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"US_BANK_ACCOUNT_LOGIN_LOAD_FAILED\",\n message: \"Bank login flow failed to load.\",\n },\n US_BANK_ACCOUNT_LOGIN_CLOSED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"US_BANK_ACCOUNT_LOGIN_CLOSED\",\n message: \"Customer closed bank login flow before authorizing.\",\n },\n US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE\",\n message: \"Another bank login tokenization request is active.\",\n },\n US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR\",\n message: \"A tokenization network error occurred.\",\n },\n US_BANK_ACCOUNT_FAILED_TOKENIZATION: {\n type: BraintreeError.types.CUSTOMER,\n code: \"US_BANK_ACCOUNT_FAILED_TOKENIZATION\",\n message: \"The supplied data failed tokenization.\",\n },\n US_BANK_ACCOUNT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_NOT_ENABLED\",\n message: \"US bank account is not enabled.\",\n },\n US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED\",\n message: \"Bank login is not enabled.\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],208:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/us-bank-account\n * @description This module is for accepting payments of US bank accounts.\n */\n\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar errors = _dereq_(\"./errors\");\nvar USBankAccount = _dereq_(\"./us-bank-account\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link USBankAccount} instance. If no callback is provided, `create` returns a promise that resolves with the {@link USBankAccount} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"US Bank Account\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n var usBankAccount;\n\n options.client = client;\n\n usBankAccount =\n options.client.getConfiguration().gatewayConfiguration.usBankAccount;\n if (!usBankAccount) {\n return Promise.reject(\n new BraintreeError(errors.US_BANK_ACCOUNT_NOT_ENABLED)\n );\n }\n\n return new USBankAccount(options);\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./errors\":207,\"./us-bank-account\":209,\"@braintree/wrap-promise\":43}],209:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar constants = _dereq_(\"./constants\");\nvar errors = _dereq_(\"./errors\");\nvar sharedErrors = _dereq_(\"../lib/errors\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar once = _dereq_(\"../lib/once\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar methods = _dereq_(\"../lib/methods\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\nvar TOKENIZE_BANK_DETAILS_MUTATION = createGraphQLMutation(\"UsBankAccount\");\nvar TOKENIZE_BANK_LOGIN_MUTATION = createGraphQLMutation(\"UsBankLogin\");\n\n/**\n * @typedef {object} USBankAccount~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `us_bank_account`.\n * @property {object} details Additional account details. Currently empty.\n */\n\n/**\n * @class\n * @param {object} options See {@link module:braintree-web/us-bank-account.create|us-bank-account.create}.\n * @classdesc This class represents a US Bank Account component. Instances of this class can tokenize raw bank details or present a bank login. <strong>You cannot use this constructor directly. Use {@link module:braintree-web/us-bank-account.create|braintree.us-bank-account.create} instead.</strong>\n */\nfunction USBankAccount(options) {\n this._client = options.client;\n\n this._isTokenizingBankLogin = false;\n\n analytics.sendEvent(this._client, \"usbankaccount.initialized\");\n}\n\n/**\n * Tokenizes bank information to return a payment method nonce. You can tokenize bank details by providing information like account and routing numbers. You can also tokenize with a bank login UI that prompts the customer to log into their bank account.\n * @public\n * @param {object} options All tokenization options for the US Bank Account component.\n * @param {string} options.mandateText A string for proof of customer authorization. For example, `'I authorize Braintree to debit my bank account on behalf of My Online Store.'`.\n * @param {object} [options.bankDetails] Bank detail information (such as account and routing numbers). `bankDetails` or `bankLogin` option must be provided.\n * @param {string} options.bankDetails.routingNumber The customer's bank routing number, such as `'307075259'`.\n * @param {string} options.bankDetails.accountNumber The customer's bank account number, such as `'999999999'`.\n * @param {string} options.bankDetails.accountType The customer's bank account type. Must be `'checking'` or `'savings'`.\n * @param {string} options.bankDetails.ownershipType The customer's bank account ownership type. Must be `'personal'` or `'business'`.\n * @param {string} [options.bankDetails.firstName] The customer's first name. Required when account ownership type is `personal`.\n * @param {string} [options.bankDetails.lastName] The customer's last name. Required when account ownership type is `personal`.\n * @param {string} [options.bankDetails.businessName] The customer's business name. Required when account ownership type is `business`.\n * @param {object} options.bankDetails.billingAddress The customer's billing address.\n * @param {string} options.bankDetails.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`.\n * @param {string} [options.bankDetails.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`.\n * @param {string} options.bankDetails.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`.\n * @param {string} options.bankDetails.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`.\n * @param {string} options.bankDetails.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`.\n * @param {object} [options.bankLogin] Bank login information. `bankLogin` or `bankDetails` option must be provided.\n * @param {string} options.bankLogin.displayName Display name for the bank login UI, such as `'My Store'`.\n * @param {string} options.bankLogin.ownershipType The customer's bank account ownership type. Must be `'personal'` or `'business'`.\n * @param {string} [options.bankLogin.firstName] The customer's first name. Required when account ownership type is `personal`.\n * @param {string} [options.bankLogin.lastName] The customer's last name. Required when account ownership type is `personal`.\n * @param {string} [options.bankLogin.businessName] The customer's business name. Required when account ownership type is `business`.\n * @param {object} options.bankLogin.billingAddress The customer's billing address.\n * @param {string} options.bankLogin.billingAddress.streetAddress The street address for the customer's billing address, such as `'123 Fake St'`.\n * @param {string} [options.bankLogin.billingAddress.extendedAddress] The extended street address for the customer's billing address, such as `'Apartment B'`.\n * @param {string} options.bankLogin.billingAddress.locality The locality for the customer's billing address. This is typically a city, such as `'San Francisco'`.\n * @param {string} options.bankLogin.billingAddress.region The region for the customer's billing address. This is typically a state, such as `'CA'`.\n * @param {string} options.bankLogin.billingAddress.postalCode The postal code for the customer's billing address. This is typically a ZIP code, such as `'94119'`.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link USBankAccount~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with {@link USBankAccount~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * <caption>Tokenizing raw bank details</caption>\n * var routingNumberInput = document.querySelector('input[name=\"routing-number\"]');\n * var accountNumberInput = document.querySelector('input[name=\"account-number\"]');\n * var accountTypeInput = document.querySelector('input[name=\"account-type\"]:checked');\n * var ownershipTypeInput = document.querySelector('input[name=\"ownership-type\"]:checked');\n * var firstNameInput = document.querySelector('input[name=\"first-name\"]');\n * var lastNameInput = document.querySelector('input[name=\"last-name\"]');\n * var businessNameInput = document.querySelector('input[name=\"business-name\"]');\n * var billingAddressStreetInput = document.querySelector('input[name=\"street-address\"]');\n * var billingAddressExtendedInput = document.querySelector('input[name=\"extended-address\"]');\n * var billingAddressLocalityInput = document.querySelector('input[name=\"locality\"]');\n * var billingAddressRegionSelect = document.querySelector('select[name=\"region\"]');\n * var billingAddressPostalInput = document.querySelector('input[name=\"postal-code\"]');\n *\n * submitButton.addEventListener('click', function (event) {\n * var bankDetails = {\n * routingNumber: routingNumberInput.value,\n * accountNumber: accountNumberInput.value,\n * accountType: accountTypeInput.value,\n * ownershipType: ownershipTypeInput.value,\n * billingAddress: {\n * streetAddress: billingAddressStreetInput.value,\n * extendedAddress: billingAddressExtendedInput.value,\n * locality: billingAddressLocalityInput.value,\n * region: billingAddressRegionSelect.value,\n * postalCode: billingAddressPostalInput.value\n * }\n * };\n *\n * if (bankDetails.ownershipType === 'personal') {\n * bankDetails.firstName = firstNameInput.value;\n * bankDetails.lastName = lastNameInput.value;\n * } else {\n * bankDetails.businessName = businessNameInput.value;\n * }\n *\n * event.preventDefault();\n *\n * usBankAccountInstance.tokenize({\n * bankDetails: bankDetails,\n * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.'\n * }, function (tokenizeErr, tokenizedPayload) {\n * if (tokenizeErr) {\n * console.error('There was an error tokenizing the bank details.');\n * return;\n * }\n *\n * // Send tokenizePayload.nonce to your server here!\n * });\n * });\n * @example\n * <caption>Tokenizing with bank login UI</caption>\n * var ownershipTypeInput = document.querySelector('input[name=\"ownership-type\"]:checked');\n * var firstNameInput = document.querySelector('input[name=\"first-name\"]');\n * var lastNameInput = document.querySelector('input[name=\"last-name\"]');\n * var businessNameInput = document.querySelector('input[name=\"business-name\"]');\n * var billingAddressStreetInput = document.querySelector('input[name=\"street-address\"]');\n * var billingAddressExtendedInput = document.querySelector('input[name=\"extended-address\"]');\n * var billingAddressLocalityInput = document.querySelector('input[name=\"locality\"]');\n * var billingAddressRegionSelect = document.querySelector('select[name=\"region\"]');\n * var billingAddressPostalInput = document.querySelector('input[name=\"postal-code\"]');\n *\n * bankLoginButton.addEventListener('click', function (event) {\n * var bankLogin = {\n * displayName: 'My Online Store',\n * ownershipType: ownershipTypeInput.value,\n * billingAddress: {\n * streetAddress: billingAddressStreetInput.value,\n * extendedAddress: billingAddressExtendedInput.value,\n * locality: billingAddressLocalityInput.value,\n * region: billingAddressRegionSelect.value,\n * postalCode: billingAddressPostalInput.value\n * }\n * }\n * event.preventDefault();\n *\n * if (bankLogin.ownershipType === 'personal') {\n * bankLogin.firstName = firstNameInput.value;\n * bankLogin.lastName = lastNameInput.value;\n * } else {\n * bankLogin.businessName = businessNameInput.value;\n * }\n *\n * usBankAccountInstance.tokenize({\n * bankLogin: bankLogin,\n * mandateText: 'I authorize Braintree to debit my bank account on behalf of My Online Store.'\n * }, function (tokenizeErr, tokenizedPayload) {\n * if (tokenizeErr) {\n * console.error('There was an error tokenizing the bank details.');\n * return;\n * }\n *\n * // Send tokenizePayload.nonce to your server here!\n * });\n * });\n */\nUSBankAccount.prototype.tokenize = function (options) {\n options = options || {};\n\n if (!options.mandateText) {\n return Promise.reject(\n new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: \"mandateText property is required.\",\n })\n );\n }\n\n if (options.bankDetails && options.bankLogin) {\n return Promise.reject(\n new BraintreeError({\n type: errors.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.type,\n code: errors.US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS.code,\n message:\n \"tokenize must be called with bankDetails or bankLogin, not both.\",\n })\n );\n } else if (options.bankDetails) {\n return this._tokenizeBankDetails(options);\n } else if (options.bankLogin) {\n return this._tokenizeBankLogin(options);\n }\n\n return Promise.reject(\n new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: \"tokenize must be called with bankDetails or bankLogin.\",\n })\n );\n};\n\nUSBankAccount.prototype._tokenizeBankDetails = function (options) {\n var client = this._client;\n var bankDetails = options.bankDetails;\n var data = {\n achMandate: options.mandateText,\n routingNumber: bankDetails.routingNumber,\n accountNumber: bankDetails.accountNumber,\n accountType: bankDetails.accountType.toUpperCase(),\n billingAddress: formatBillingAddressForGraphQL(\n bankDetails.billingAddress || {}\n ),\n };\n\n formatDataForOwnershipType(data, bankDetails);\n\n return client\n .request({\n api: \"graphQLApi\",\n data: {\n query: TOKENIZE_BANK_DETAILS_MUTATION,\n variables: {\n input: {\n usBankAccount: data,\n },\n },\n },\n })\n .then(function (response) {\n analytics.sendEvent(\n client,\n \"usbankaccount.bankdetails.tokenization.succeeded\"\n );\n\n return Promise.resolve(\n formatTokenizeResponseFromGraphQL(response, \"tokenizeUsBankAccount\")\n );\n })\n .catch(function (err) {\n var error = errorFrom(err);\n\n analytics.sendEvent(\n client,\n \"usbankaccount.bankdetails.tokenization.failed\"\n );\n\n return Promise.reject(error);\n });\n};\n\nUSBankAccount.prototype._tokenizeBankLogin = function (options) {\n var self = this;\n var client = this._client;\n var gatewayConfiguration = client.getConfiguration().gatewayConfiguration;\n var isProduction = gatewayConfiguration.environment === \"production\";\n var plaidConfig = gatewayConfiguration.usBankAccount.plaid;\n\n if (!options.bankLogin.displayName) {\n return Promise.reject(\n new BraintreeError({\n type: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.type,\n code: errors.US_BANK_ACCOUNT_OPTION_REQUIRED.code,\n message: \"displayName property is required when using bankLogin.\",\n })\n );\n }\n\n if (!plaidConfig) {\n return Promise.reject(\n new BraintreeError(errors.US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED)\n );\n }\n\n if (this._isTokenizingBankLogin) {\n return Promise.reject(\n new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE)\n );\n }\n this._isTokenizingBankLogin = true;\n\n return new Promise(function (resolve, reject) {\n self._loadPlaid(function (plaidLoadErr, plaid) {\n if (plaidLoadErr) {\n reject(plaidLoadErr);\n\n return;\n }\n\n plaid\n .create({\n clientName: options.bankLogin.displayName,\n apiVersion: \"v2\",\n env: isProduction ? \"production\" : \"sandbox\",\n key: plaidConfig.publicKey,\n product: \"auth\",\n selectAccount: true,\n onExit: function () {\n self._isTokenizingBankLogin = false;\n\n analytics.sendEvent(\n client,\n \"usbankaccount.banklogin.tokenization.closed.by-user\"\n );\n\n reject(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_CLOSED));\n },\n onSuccess: function (publicToken, metadata) {\n var bankLogin = options.bankLogin;\n var data = {\n publicToken: publicToken,\n accountId: isProduction\n ? metadata.account_id\n : \"plaid_account_id\",\n accountType: metadata.account.subtype.toUpperCase(),\n achMandate: options.mandateText,\n billingAddress: formatBillingAddressForGraphQL(\n bankLogin.billingAddress || {}\n ),\n };\n\n formatDataForOwnershipType(data, bankLogin);\n\n client\n .request({\n api: \"graphQLApi\",\n data: {\n query: TOKENIZE_BANK_LOGIN_MUTATION,\n variables: {\n input: {\n usBankLogin: data,\n },\n },\n },\n })\n .then(function (response) {\n self._isTokenizingBankLogin = false;\n\n analytics.sendEvent(\n client,\n \"usbankaccount.banklogin.tokenization.succeeded\"\n );\n\n resolve(\n formatTokenizeResponseFromGraphQL(\n response,\n \"tokenizeUsBankLogin\"\n )\n );\n })\n .catch(function (tokenizeErr) {\n var error;\n\n self._isTokenizingBankLogin = false;\n error = errorFrom(tokenizeErr);\n\n analytics.sendEvent(\n client,\n \"usbankaccount.banklogin.tokenization.failed\"\n );\n\n reject(error);\n });\n },\n })\n .open();\n\n analytics.sendEvent(\n client,\n \"usbankaccount.banklogin.tokenization.started\"\n );\n });\n });\n};\n\nfunction errorFrom(err) {\n var error;\n var status = err.details && err.details.httpStatus;\n\n if (status === 401) {\n error = new BraintreeError(sharedErrors.BRAINTREE_API_ACCESS_RESTRICTED);\n } else if (status < 500) {\n error = new BraintreeError(errors.US_BANK_ACCOUNT_FAILED_TOKENIZATION);\n } else {\n error = new BraintreeError(\n errors.US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR\n );\n }\n error.details = { originalError: err };\n\n return error;\n}\n\nfunction formatTokenizeResponseFromGraphQL(response, type) {\n var data = response.data[type].paymentMethod;\n var last4 = data.details.last4;\n var description = \"US bank account ending in - \" + last4;\n\n return {\n nonce: data.id,\n details: {},\n description: description,\n type: \"us_bank_account\",\n };\n}\n\nUSBankAccount.prototype._loadPlaid = function (callback) {\n var existingScript, script;\n\n callback = once(callback);\n\n if (window.Plaid) {\n callback(null, window.Plaid);\n\n return;\n }\n\n existingScript = document.querySelector(\n 'script[src=\"' + constants.PLAID_LINK_JS + '\"]'\n );\n\n if (existingScript) {\n addLoadListeners(existingScript, callback);\n } else {\n script = document.createElement(\"script\");\n\n script.src = constants.PLAID_LINK_JS;\n script.async = true;\n\n addLoadListeners(script, callback);\n\n document.body.appendChild(script);\n\n this._plaidScript = script;\n }\n};\n\nfunction addLoadListeners(script, callback) {\n function loadHandler() {\n var readyState = this.readyState; // eslint-disable-line no-invalid-this\n\n if (!readyState || readyState === \"loaded\" || readyState === \"complete\") {\n removeLoadListeners();\n callback(null, window.Plaid);\n }\n }\n\n function errorHandler() {\n script.parentNode.removeChild(script);\n\n callback(new BraintreeError(errors.US_BANK_ACCOUNT_LOGIN_LOAD_FAILED));\n }\n\n function removeLoadListeners() {\n script.removeEventListener(\"error\", errorHandler);\n script.removeEventListener(\"load\", loadHandler);\n script.removeEventListener(\"readystatechange\", loadHandler);\n }\n\n script.addEventListener(\"error\", errorHandler);\n script.addEventListener(\"load\", loadHandler);\n script.addEventListener(\"readystatechange\", loadHandler);\n}\n\nfunction formatBillingAddressForGraphQL(address) {\n return {\n streetAddress: address.streetAddress,\n extendedAddress: address.extendedAddress,\n city: address.locality,\n state: address.region,\n zipCode: address.postalCode,\n };\n}\n\nfunction formatDataForOwnershipType(data, details) {\n if (details.ownershipType === \"personal\") {\n data.individualOwner = {\n firstName: details.firstName,\n lastName: details.lastName,\n };\n } else if (details.ownershipType === \"business\") {\n data.businessOwner = {\n businessName: details.businessName,\n };\n }\n}\n\nfunction createGraphQLMutation(type) {\n return (\n \"\" +\n \"mutation Tokenize\" +\n type +\n \"($input: Tokenize\" +\n type +\n \"Input!) {\" +\n \" tokenize\" +\n type +\n \"(input: $input) {\" +\n \" paymentMethod {\" +\n \" id\" +\n \" details {\" +\n \" ... on UsBankAccountDetails {\" +\n \" last4\" +\n \" }\" +\n \" }\" +\n \" }\" +\n \" }\" +\n \"}\"\n );\n}\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/us-bank-account.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * usBankAccountInstance.teardown();\n * @example <caption>With callback</caption>\n * usBankAccountInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nUSBankAccount.prototype.teardown = function () {\n if (this._plaidScript) {\n document.body.removeChild(this._plaidScript);\n }\n\n convertMethodsToError(this, methods(USBankAccount.prototype));\n\n return Promise.resolve();\n};\n\nmodule.exports = wrapPromise.wrapPrototype(USBankAccount);\n\n},{\"../lib/analytics\":119,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/errors\":135,\"../lib/methods\":155,\"../lib/once\":156,\"./constants\":206,\"./errors\":207,\"@braintree/wrap-promise\":43}],210:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Vault Manager - deletePaymentMethod Error Codes\n * @description Errors that occur when using the [`deletePaymentMethod` method](./VaultManager.html#deletePaymentMethod).\n * @property {MERCHANT} VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN Occurs when vault manager is initialized with a tokenization key instead of a Client Token.\n * @property {MERCHANT} VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND Occurs when the specified payment method can not be found.\n * @property {UNKNOWN} VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR Occurs when there is an error attempting to delete the payment method.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN: {\n type: BraintreeError.types.MERCHANT,\n code: \"VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN\",\n message:\n \"A client token with a customer id must be used to delete a payment method nonce.\",\n },\n VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND: {\n type: BraintreeError.types.MERCHANT,\n code: \"VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND\",\n },\n VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],211:[function(_dereq_,module,exports){\n\"use strict\";\n/**\n * @module braintree-web/vault-manager\n * @description Manages customer's payment methods.\n */\n\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar VaultManager = _dereq_(\"./vault-manager\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} callback The second argument, `data`, is the {@link VaultManager} instance.\n * @returns {void}\n */\nfunction create(options) {\n var name = \"Vault Manager\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return new VaultManager({\n createPromise: createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n }),\n });\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/basic-component-verification\":122,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./vault-manager\":212,\"@braintree/wrap-promise\":43}],212:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar errors = _dereq_(\"./errors\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar methods = _dereq_(\"../lib/methods\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\nvar DELETE_PAYMENT_METHOD_MUTATION =\n \"mutation DeletePaymentMethodFromSingleUseToken($input: DeletePaymentMethodFromSingleUseTokenInput!) {\" +\n \" deletePaymentMethodFromSingleUseToken(input: $input) {\" +\n \" clientMutationId\" +\n \" }\" +\n \"}\";\n\n/**\n * @typedef {array} VaultManager~fetchPaymentMethodsPayload The customer's payment methods.\n * @property {object} paymentMethod The payment method object.\n * @property {string} paymentMethod.nonce A nonce that can be sent to your server to transact on the payment method.\n * @property {boolean} paymentMethod.default Whether or not this is the default payment method for the customer.\n * @property {object} paymentMethod.details Any additional details about the payment method. Varies depending on the type of payment method.\n * @property {string} paymentMethod.type A constant indicating the type of payment method.\n * @property {?string} paymentMethod.description Additional description about the payment method.\n * @property {?object} paymentMethod.binData Bin data about the payment method.\n *\n */\n\n/**\n * @class\n * @param {object} options Options\n * @description <strong>You cannot use this constructor directly. Use {@link module:braintree-web/vault-manager.create|braintree.vault-manager.create} instead.</strong>\n * @classdesc This class allows you to manage a customer's payment methods on the client.\n */\nfunction VaultManager(options) {\n this._createPromise = options.createPromise;\n}\n\n/**\n * Fetches payment methods owned by the customer whose id was used to generate the client token used to create the {@link module:braintree-web/client|client}.\n * @public\n * @param {object} [options] Options for fetching payment methods.\n * @param {boolean} [options.defaultFirst = false] If `true`, the payment methods will be returned with the default payment method for the customer first. Otherwise, order is not guaranteed.\n * @param {callback} [callback] The second argument is a {@link VaultManager~fetchPaymentMethodsPayload|fetchPaymentMethodsPayload}. This is also what is resolved by the promise if no callback is provided.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * vaultManagerInstance.fetchPaymentMethods(function (err, paymentMethods) {\n * paymentMethods.forEach(function (paymentMethod) {\n * // add payment method to UI\n * // paymentMethod.nonce <- transactable nonce associated with payment method\n * // paymentMethod.details <- object with additional information about payment method\n * // paymentMethod.type <- a constant signifying the type\n * });\n * });\n */\nVaultManager.prototype.fetchPaymentMethods = function (options) {\n var defaultFirst;\n\n options = options || {};\n\n defaultFirst = options.defaultFirst === true ? 1 : 0;\n\n return this._createPromise\n .then(function (client) {\n return client.request({\n endpoint: \"payment_methods\",\n method: \"get\",\n data: {\n defaultFirst: defaultFirst,\n },\n });\n })\n .then(\n function (paymentMethodsPayload) {\n analytics.sendEvent(\n this._createPromise,\n \"vault-manager.fetch-payment-methods.succeeded\"\n );\n\n return paymentMethodsPayload.paymentMethods.map(\n formatPaymentMethodPayload\n );\n }.bind(this)\n );\n};\n\n/**\n * Deletes a payment method owned by the customer whose id was used to generate the client token used to create the {@link module:braintree-web/client|client}.\n * @public\n * @param {string} paymentMethodNonce The payment method nonce that references a vaulted payment method.\n * @param {callback} [callback] No data is returned if the operation is successful.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * vaultManagerInstance.deletePaymentMethod('nonce-to-delete', function (err) {\n * // handle err if it exists\n * });\n */\nVaultManager.prototype.deletePaymentMethod = function (paymentMethodNonce) {\n return this._createPromise.then(function (client) {\n var usesClientToken =\n client.getConfiguration().authorizationType === \"CLIENT_TOKEN\";\n\n if (!usesClientToken) {\n return Promise.reject(\n new BraintreeError(\n errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN\n )\n );\n }\n\n return client\n .request({\n api: \"graphQLApi\",\n data: {\n query: DELETE_PAYMENT_METHOD_MUTATION,\n variables: {\n input: {\n singleUseTokenId: paymentMethodNonce,\n },\n },\n operationName: \"DeletePaymentMethodFromSingleUseToken\",\n },\n })\n .then(function () {\n analytics.sendEvent(\n client,\n \"vault-manager.delete-payment-method.succeeded\"\n );\n\n // noop to prevent sending back the raw graphql data\n })\n .catch(function (error) {\n var originalError = error.details.originalError;\n var formattedError;\n\n analytics.sendEvent(\n client,\n \"vault-manager.delete-payment-method.failed\"\n );\n\n if (\n originalError[0] &&\n originalError[0].extensions.errorClass === \"NOT_FOUND\"\n ) {\n formattedError = new BraintreeError({\n type: errors.VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND.type,\n code: errors.VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND.code,\n message:\n \"A payment method for payment method nonce `\" +\n paymentMethodNonce +\n \"` could not be found.\",\n details: {\n originalError: originalError,\n },\n });\n }\n\n if (!formattedError) {\n formattedError = new BraintreeError({\n type: errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR.type,\n code: errors.VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR.code,\n message:\n \"An unknown error occured when attempting to delete the payment method assocaited with the payment method nonce `\" +\n paymentMethodNonce +\n \"`.\",\n details: {\n originalError: originalError,\n },\n });\n }\n\n return Promise.reject(formattedError);\n });\n });\n};\n\nfunction formatPaymentMethodPayload(paymentMethod) {\n var formattedPaymentMethod = {\n nonce: paymentMethod.nonce,\n default: paymentMethod.default,\n details: paymentMethod.details,\n hasSubscription: paymentMethod.hasSubscription,\n type: paymentMethod.type,\n };\n\n if (paymentMethod.description) {\n formattedPaymentMethod.description = paymentMethod.description;\n }\n\n if (paymentMethod.binData) {\n formattedPaymentMethod.binData = paymentMethod.binData;\n }\n\n return formattedPaymentMethod;\n}\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/vault-manager.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * vaultManagerInstance.teardown();\n * @example <caption>With callback</caption>\n * vaultManagerInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nVaultManager.prototype.teardown = function () {\n convertMethodsToError(this, methods(VaultManager.prototype));\n\n return Promise.resolve();\n};\n\nmodule.exports = wrapPromise.wrapPrototype(VaultManager);\n\n},{\"../lib/analytics\":119,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/methods\":155,\"./errors\":210,\"@braintree/wrap-promise\":43}],213:[function(_dereq_,module,exports){\n\"use strict\";\nvar __importDefault =\n (this && this.__importDefault) ||\n function (mod) {\n return mod && mod.__esModule ? mod : { default: mod };\n };\nvar venmo_desktop_1 = __importDefault(_dereq_(\"./venmo-desktop\"));\nmodule.exports = function createVenmoDesktop(options) {\n var instance = new venmo_desktop_1.default(options);\n return instance.initialize();\n};\n\n},{\"./venmo-desktop\":215}],214:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VENMO_PAYMENT_CONTEXT_STATUS_QUERY =\n exports.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY =\n exports.UPDATE_PAYMENT_CONTEXT_QUERY =\n exports.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY =\n exports.CREATE_PAYMENT_CONTEXT_QUERY =\n exports.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY =\n void 0;\nexports.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY =\n \"mutation CreateVenmoQRCodePaymentContext($input: CreateVenmoQRCodePaymentContextInput!) {\\n createVenmoQRCodePaymentContext(input: $input) {\\n clientMutationId\\n venmoQRCodePaymentContext {\\n id\\n merchantId\\n createdAt\\n expiresAt\\n }\\n }\\n}\";\nexports.CREATE_PAYMENT_CONTEXT_QUERY =\n \"mutation CreateVenmoPaymentContext($input: CreateVenmoPaymentContextInput!) {\\n createVenmoPaymentContext(input: $input) {\\n clientMutationId\\n venmoPaymentContext {\\n id\\n merchantId\\n createdAt\\n expiresAt\\n }\\n }\\n}\";\nexports.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY =\n \"mutation UpdateVenmoQRCodePaymentContext($input: UpdateVenmoQRCodePaymentContextInput!) {\\n updateVenmoQRCodePaymentContext(input: $input) {\\n clientMutationId\\n }\\n}\";\nexports.UPDATE_PAYMENT_CONTEXT_QUERY =\n \"mutation UpdateVenmoPaymentContextStatus($input: UpdateVenmoPaymentContextStatusInput!) {\\n updateVenmoPaymentContextStatus(input: $input) {\\n clientMutationId\\n }\\n}\";\nexports.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY =\n \"query PaymentContext($id: ID!) {\\n node(id: $id) {\\n ... on VenmoQRCodePaymentContext {\\n status\\n paymentMethodId\\n userName\\n }\\n }\\n}\";\nexports.VENMO_PAYMENT_CONTEXT_STATUS_QUERY =\n \"query PaymentContext($id: ID!) {\\n node(id: $id) {\\n ... on VenmoPaymentContext {\\n status\\n paymentMethodId\\n userName\\n payerInfo {\\n firstName\\n lastName\\n phoneNumber\\n email\\n externalId\\n userName\\n billingAddress {\\n fullName\\n addressLine1\\n addressLine2\\n adminArea1\\n adminArea2\\n postalCode\\n countryCode\\n }\\n shippingAddress {\\n fullName\\n addressLine1\\n addressLine2\\n adminArea1\\n adminArea2\\n postalCode\\n countryCode\\n }\\n }\\n }\\n }\\n}\";\n\n},{}],215:[function(_dereq_,module,exports){\n\"use strict\";\nvar __assign =\n (this && this.__assign) ||\n function () {\n __assign =\n Object.assign ||\n function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s)\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n };\nvar __importDefault =\n (this && this.__importDefault) ||\n function (mod) {\n return mod && mod.__esModule ? mod : { default: mod };\n };\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar framebus_1 = __importDefault(_dereq_(\"framebus\"));\nvar iframer_1 = __importDefault(_dereq_(\"@braintree/iframer\"));\nvar uuid_1 = __importDefault(_dereq_(\"@braintree/uuid\"));\nvar events_1 = _dereq_(\"../shared/events\");\nvar queries_1 = _dereq_(\"./queries\");\nvar VENMO_DESKTOP_POLLING_INTERVAL = 1000; // 1 second\nvar VISUAL_DELAY_BEFORE_SIGNALLING_COMPLETION = 2000; // 2 seconds\nvar VenmoDesktop = /** @class */ (function () {\n function VenmoDesktop(options) {\n this.isHidden = true;\n this.env = options.environment;\n this.id = uuid_1.default();\n this.profileId = options.profileId;\n this.displayName = options.displayName;\n this.paymentMethodUsage = options.paymentMethodUsage;\n this.shouldUseLegacyQRCodeMutation = !this.paymentMethodUsage;\n var frameUrl = options.url + \"#\" + this.env + \"_\" + this.id;\n this.bus = new framebus_1.default({\n channel: this.id,\n verifyDomain: options.verifyDomain,\n targetFrames: [],\n });\n this.apiRequest = options.apiRequest;\n this.sendEvent = options.sendEvent;\n this.Promise = options.Promise;\n this.alertBox = document.createElement(\"div\");\n this.alertBox.setAttribute(\"data-venmo-desktop-id\", this.id);\n this.alertBox.setAttribute(\"role\", \"alert\");\n this.alertBox.style.position = \"fixed\";\n this.alertBox.style.display = \"none\";\n this.alertBox.style.height = \"1px\";\n this.alertBox.style.width = \"1px\";\n this.alertBox.style.overflow = \"hidden\";\n this.alertBox.style.zIndex = \"0\";\n this.iframe = iframer_1.default({\n src: frameUrl,\n name: \"venmo-desktop-iframe\",\n style: {\n display: \"none\",\n position: \"fixed\",\n top: \"0\",\n bottom: \"0\",\n right: \"0\",\n left: \"0\",\n height: \"100%\",\n width: \"100%\",\n zIndex: \"9999999\",\n },\n title: \"Venmo Desktop\",\n });\n this.bus.addTargetFrame(this.iframe);\n }\n VenmoDesktop.prototype.initialize = function () {\n var _this = this;\n return new this.Promise(function (resolve) {\n _this.bus.on(events_1.VENMO_DESKTOP_IFRAME_READY, function () {\n resolve(_this);\n });\n _this.bus.on(events_1.VENMO_DESKTOP_REQUEST_NEW_QR_CODE, function () {\n _this.sendEvent(\"venmo.tokenize.desktop.restarted-from-error-view\");\n _this.startPolling();\n });\n document.body.appendChild(_this.iframe);\n document.body.appendChild(_this.alertBox);\n });\n };\n VenmoDesktop.prototype.launchDesktopFlow = function () {\n var _this = this;\n this.isHidden = false;\n var promise = new this.Promise(function (resolve, reject) {\n _this.launchDesktopPromiseRejectFunction = reject;\n var removeListeners = function () {\n /* eslint-disable @typescript-eslint/no-use-before-define */\n _this.bus.off(\n events_1.VENMO_DESKTOP_CUSTOMER_CANCELED,\n customerCancelledHandler\n );\n _this.bus.off(\n events_1.VENMO_DESKTOP_UNKNOWN_ERROR,\n unknownErrorHandler\n );\n /* eslint-enable @typescript-eslint/no-use-before-define */\n };\n var unknownErrorHandler = function (err) {\n removeListeners();\n _this.sendEvent(\"venmo.tokenize.desktop.unknown-error\");\n reject({\n allowUIToHandleError: false,\n reason: \"UNKNOWN_ERROR\",\n err: err,\n });\n };\n var customerCancelledHandler = function () {\n removeListeners();\n _this.updateVenmoDesktopPaymentContext(\"CANCELED\");\n _this.sendEvent(\n \"venmo.tokenize.desktop.status-change.canceled-from-modal\"\n );\n reject({\n allowUIToHandleError: false,\n reason: \"CUSTOMER_CANCELED\",\n });\n };\n _this.completedHandler = function (payload) {\n removeListeners();\n resolve(payload);\n };\n _this.bus.on(\n events_1.VENMO_DESKTOP_CUSTOMER_CANCELED,\n customerCancelledHandler\n );\n _this.bus.on(events_1.VENMO_DESKTOP_UNKNOWN_ERROR, unknownErrorHandler);\n });\n this.iframe.style.display = \"block\";\n this.setAlert(\"Generating a QR code, get your Venmo app ready\");\n this.iframe.focus();\n this.startPolling();\n return promise\n .then(function (result) {\n delete _this.venmoContextId;\n delete _this.launchDesktopPromiseRejectFunction;\n return result;\n })\n .catch(function (err) {\n delete _this.venmoContextId;\n delete _this.launchDesktopPromiseRejectFunction;\n return _this.Promise.reject(err);\n });\n };\n VenmoDesktop.prototype.triggerCompleted = function (result) {\n var _this = this;\n if (this.isHidden) {\n return;\n }\n setTimeout(function () {\n if (_this.completedHandler) {\n _this.completedHandler(result);\n }\n delete _this.completedHandler;\n }, VISUAL_DELAY_BEFORE_SIGNALLING_COMPLETION);\n };\n VenmoDesktop.prototype.triggerRejected = function (err) {\n if (this.launchDesktopPromiseRejectFunction) {\n this.launchDesktopPromiseRejectFunction(err);\n }\n };\n VenmoDesktop.prototype.hideDesktopFlow = function () {\n this.setAlert(\"\");\n this.iframe.style.display = \"none\";\n this.bus.emit(events_1.VENMO_DESKTOP_CLOSED_FROM_PARENT);\n this.isHidden = true;\n };\n VenmoDesktop.prototype.displayError = function (message) {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_DISPLAY_ERROR, {\n message: message,\n });\n this.setAlert(message);\n };\n VenmoDesktop.prototype.displayQRCode = function (id, merchantId) {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_DISPLAY_QR_CODE, {\n id: id,\n merchantId: merchantId,\n });\n this.setAlert(\"To scan the QR code, open your Venmo app\");\n };\n VenmoDesktop.prototype.authorize = function () {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_AUTHORIZE);\n this.setAlert(\"Venmo account authorized\");\n };\n VenmoDesktop.prototype.authorizing = function () {\n if (this.isHidden) {\n return;\n }\n this.bus.emit(events_1.VENMO_DESKTOP_AUTHORIZING);\n this.setAlert(\"Authorize on your Venmo app\");\n };\n VenmoDesktop.prototype.startPolling = function () {\n var _this = this;\n return this.createVenmoDesktopPaymentContext()\n .then(function (result) {\n var expiresIn =\n new Date(result.expiresAt).getTime() -\n new Date(result.createdAt).getTime();\n var expiredTime = Date.now() + expiresIn;\n _this.displayQRCode(result.id, result.merchantId);\n return _this.pollForStatusChange(result.status, expiredTime);\n })\n .then(function (result) {\n if (!result) {\n return;\n }\n // since we are manually adding a prepended @ sign\n // we want to make sure that the username does not\n // start giving us the @ sign up front in the future\n var username = result.userName || \"\";\n username = \"@\" + username.replace(\"@\", \"\");\n _this.triggerCompleted({\n paymentMethodNonce: result.paymentMethodId,\n username: username,\n payerInfo: result.payerInfo,\n id: _this.venmoContextId || \"\",\n });\n })\n .catch(function (err) {\n if (err.allowUIToHandleError) {\n // noop here and let the UI handle the customer error\n return;\n }\n _this.sendEvent(\"venmo.tokenize.desktop.unhandled-error\");\n _this.triggerRejected(err);\n });\n };\n VenmoDesktop.prototype.pollForStatusChange = function (status, expiredTime) {\n var _this = this;\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n if (Date.now() > expiredTime) {\n return this.updateVenmoDesktopPaymentContext(\"EXPIRED\").then(function () {\n _this.displayError(\"Something went wrong\");\n _this.sendEvent(\"venmo.tokenize.desktop.status-change.sdk-timeout\");\n return _this.Promise.reject({\n allowUIToHandleError: true,\n reason: \"TIMEOUT\",\n });\n });\n }\n return this.lookupVenmoDesktopPaymentContext().then(function (response) {\n if (!_this.venmoContextId || !response) {\n return _this.Promise.resolve();\n }\n var newStatus = response.status;\n if (newStatus !== status) {\n status = newStatus;\n _this.sendEvent(\n \"venmo.tokenize.desktop.status-change.\" + status.toLowerCase()\n );\n switch (status) {\n case \"CREATED\":\n // noop, no need to do anything here\n // should never be able to get to this point\n // but we'll keep it in to enumerate the statuses\n break;\n case \"EXPIRED\":\n case \"FAILED\":\n case \"CANCELED\":\n var message =\n status === \"CANCELED\"\n ? \"The authorization was canceled\"\n : \"Something went wrong\";\n _this.displayError(message);\n // these are all terminal states, so we end it here\n return _this.Promise.reject({\n allowUIToHandleError: true,\n reason: status,\n });\n case \"SCANNED\":\n _this.authorizing();\n break;\n case \"APPROVED\":\n _this.authorize();\n return _this.Promise.resolve(response);\n default:\n // any other statuses are irrelevant to the polling\n // and can just be ignored\n }\n }\n return new _this.Promise(function (resolve, reject) {\n setTimeout(function () {\n _this\n .pollForStatusChange(status, expiredTime)\n .then(resolve)\n .catch(reject);\n }, VENMO_DESKTOP_POLLING_INTERVAL);\n });\n });\n };\n VenmoDesktop.prototype.teardown = function () {\n this.bus.teardown();\n if (this.iframe.parentNode) {\n this.iframe.parentNode.removeChild(this.iframe);\n }\n if (this.alertBox.parentNode) {\n this.alertBox.parentNode.removeChild(this.alertBox);\n }\n };\n VenmoDesktop.prototype.setAlert = function (message) {\n this.alertBox.style.display = message ? \"block\" : \"none\";\n this.alertBox.textContent = message;\n };\n VenmoDesktop.prototype.createPaymentContextFromGraphqlLegacyQRCodeMutation =\n function (intent) {\n return this.apiRequest(queries_1.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY, {\n input: {\n environment: this.env,\n intent: intent,\n },\n }).then(function (response) {\n return response\n .createVenmoQRCodePaymentContext.venmoQRCodePaymentContext;\n });\n };\n VenmoDesktop.prototype.createPaymentContextFromGraphQL = function (intent) {\n var input = {\n intent: intent,\n paymentMethodUsage: this.paymentMethodUsage,\n customerClient: \"DESKTOP\",\n };\n if (this.profileId) {\n input.merchantProfileId = this.profileId;\n }\n if (this.displayName) {\n input.displayName = this.displayName;\n }\n return this.apiRequest(queries_1.CREATE_PAYMENT_CONTEXT_QUERY, {\n input: input,\n }).then(function (response) {\n return response.createVenmoPaymentContext.venmoPaymentContext;\n });\n };\n VenmoDesktop.prototype.createVenmoDesktopPaymentContext = function () {\n var _this = this;\n var contextPromise = this.shouldUseLegacyQRCodeMutation\n ? this.createPaymentContextFromGraphqlLegacyQRCodeMutation(\"PAY_FROM_APP\")\n : this.createPaymentContextFromGraphQL(\"PAY_FROM_APP\");\n return contextPromise.then(function (context) {\n _this.venmoContextId = context.id;\n var merchantId = _this.profileId || context.merchantId;\n return {\n id: context.id,\n status: context.status,\n merchantId: merchantId,\n createdAt: context.createdAt,\n expiresAt: context.expiresAt,\n };\n });\n };\n VenmoDesktop.prototype.updateVenmoDesktopPaymentContext = function (\n status,\n additionalOptions\n ) {\n if (additionalOptions === void 0) {\n additionalOptions = {};\n }\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n var data = {\n input: __assign(\n { id: this.venmoContextId, status: status },\n additionalOptions\n ),\n };\n var query = this.shouldUseLegacyQRCodeMutation\n ? queries_1.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY\n : queries_1.UPDATE_PAYMENT_CONTEXT_QUERY;\n return this.apiRequest(query, data).then(function () {\n // noop so we can resolve without any data to match the type\n });\n };\n VenmoDesktop.prototype.lookupVenmoDesktopPaymentContext = function () {\n if (!this.venmoContextId) {\n return this.Promise.resolve();\n }\n var query = this.shouldUseLegacyQRCodeMutation\n ? queries_1.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY\n : queries_1.VENMO_PAYMENT_CONTEXT_STATUS_QUERY;\n return this.apiRequest(query, {\n id: this.venmoContextId,\n }).then(function (response) {\n return response.node;\n });\n };\n return VenmoDesktop;\n})();\nexports.default = VenmoDesktop;\n\n},{\"../shared/events\":220,\"./queries\":214,\"@braintree/iframer\":35,\"@braintree/uuid\":39,\"framebus\":52}],216:[function(_dereq_,module,exports){\n\"use strict\";\n/** @module braintree-web/venmo */\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar errors = _dereq_(\"./shared/errors\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar Venmo = _dereq_(\"./venmo\");\nvar supportsVenmo = _dereq_(\"./shared/supports-venmo\");\nvar VERSION = \"3.100.0\";\n\n/**\n * @typedef {object} Venmo~lineItem\n * @property {number} quantity Number of units of the item purchased. This value must be a whole number and can't be negative or zero.\n * @property {string} unitAmount Per-unit price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {string} name Item name. Maximum 127 characters.\n * @property {string} kind Indicates whether the line item is a debit (sale) or credit (refund) to the customer. Accepted values: `debit` and `credit`.\n * @property {?string} unitTaxAmount Per-unit tax price of the item. Can include up to 2 decimal places. This value can't be negative or zero.\n * @property {?string} description Item description. Maximum 127 characters.\n * @property {?string} productCode Product or UPC code for the item. Maximum 127 characters.\n * @property {?string} url The URL to product information.\n */\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {boolean} [options.allowNewBrowserTab=true] This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications. Doing so causes {@link Venmo#isBrowserSupported|isBrowserSupported} to return true only for mobile web browsers that support returning from the Venmo app to the same tab.\n * @param {boolean} [options.allowWebviews=true] This should be set to false if your payment flow does not occur from within a webview that you control. Doing so causes {@link Venmo#isBrowserSupported|isBrowserSupported} to return true only for mobile web browsers that are not webviews.\n * @param {boolean} [options.ignoreHistoryChanges=false] When the Venmo app returns to the website, it will modify the hash of the url to include data about the tokenization. By default, the SDK will put the state of the hash back to where it was before the change was made. Pass `true` to handle the hash change instead of the SDK.\n * @param {string} [options.profileId] The Venmo profile ID to be used during payment authorization. Customers will see the business name and logo associated with this Venmo profile, and it will show up in the Venmo app as a \"Connected Merchant\". Venmo profile IDs can be found in the Braintree Control Panel. Omitting this value will use the default Venmo profile.\n * @param {string} [options.deepLinkReturnUrl] An override for the URL that the Venmo iOS app opens to return from an app switch.\n * @param {boolean} [options.requireManualReturn=false] When `true`, the customer will have to manually switch back to the browser/webview that is presenting Venmo to complete the payment.\n * @param {boolean} [options.useRedirectForIOS=false] Normally, the Venmo flow is launched using `window.open` and the Venmo app intercepts that call and opens the Venmo app instead. If the customer does not have the Venmo app installed, it opens the Venmo website in a new window and instructs the customer to install the app.\n \n * In iOS webviews and Safari View Controllers (a webview-like environment which is indistinguishable from Safari for JavaScript environments), this call to `window.open` will always fail to app switch to Venmo, resulting instead in a white screen. Because of this, an alternate approach is required to launch the Venmo flow.\n *\n * When `useRedirectForIOS` is `true` and the Venmo flow is started in an iOS environment, the Venmo flow will be started by setting `window.location.href` to the Venmo website (which will still be intercepted by the Venmo app and should be the same behavior as if `window.open` was called). However, if the customer does not have the Venmo app installed, the merchant page will instead be replaced with the Venmo website and the customer will need to use the browser's back button to return to the merchant's website. Ensure that your customer's checkout information will not be lost if they are navigated away from the website and return using the browser back button.\n *\n * Due to a bug in iOS's implementation of `window.open` in iOS webviews and Safari View Controllers, if `useRedirectForIOS` is not set to `true` and the flow is launched from an iOS webview or Safari View Controller, the customer will be presented with a blank screen, halting the flow and leaving the customer unable to return to the merchant's website. Setting `useRedirectForIOS` to `true` will allow the flow to continue, but the Venmo app will be unable to return back to the webview/Safari View Controller. It will instead open the merchant's site in a new window in the customer's browser, which means the merchant site must be able to process the Venmo payment. If the SDK is configured with `allowNewBrowserTab = false`, it is unlikely that the website is set up to process the Venmo payment from a new window.\n *\n * If processing the payment from a new window is not possible, use this flag in conjunction with `requireManualReturn` so that the customer may start the flow from a webview/Safari View Controller or their Safari browser and manually return to the place that originated the flow once the Venmo app has authorized the payment and instructed them to do so.\n * @param {string} [options.paymentMethodUsage] The intended usage for the Venmo payment method nonce. Possible options are:\n * * single_use - intended as a one time transaction\n * * multi_use - intended to be vaulted and used for multiple transactions\n * @param {string} [options.displayName] The business name that will be displayed in the Venmo app payment approval screen. Only applicable when used with `paymentMethodUsage` and used by merchants onboarded as PayFast channel partners.\n * @param {boolean} [options.allowDesktop] Used to support desktop users. When enabled, the default mode is to render a scannable QR-code customers scan with their phone's to approve via the mobile app.\n * @param {boolean} [options.allowDesktopWebLogin=false] When `true`, the customer will authorize payment via a window popup that allows them to sign in to their Venmo account. This is used explicitly for customers operating from desktop browsers wanting to avoid the QR Code flow.\n * @param {boolean} [options.mobileWebFallBack] Use this option when you want to use a web-login experience, such as if on mobile and the Venmo app isn't installed.\n * @param {boolean} [options.allowAndroidRecreation=true] This flag is for when your integration uses the [Android PopupBridge](https://github.com/braintree/popup-bridge-android). Setting this flag to false will avoid a page refresh when returning to your page after payment authorization. If not specified, it defaults to true and the Android activity will be recreated, resulting in a page refresh.\n * @param {boolean} [options.collectCustomerBillingAddress] When `true`, the customer's billing address will be collected and displayed on the Venmo paysheet (provided the Enriched Customer Data checkbox is also enabled for the merchant account).\n * @param {boolean} [options.collectCustomerShippingAddress] When `true`, the customer's shipping address will be collected and displayed on the Venmo paysheet (provided the Enriched Customer Data checkbox is also enabled for the merchant account).\n * @param {lineItem[]} [options.lineItems] The {@link Venmo~lineItem|line items} belonging to the transaction. It can include up to 249 line items.\n * @param {string} [options.subTotalAmount] The subtotal amount of the transaction, excluding taxes, discounts, and shipping.\n * @param {string} [options.discountAmount] The total discount amount applied on the transaction.\n * @param {string} [options.shippingAmount] Shipping amount to be charged for the transaction.\n * @param {string} [options.taxAmount] The total tax amount applied to the transaction. This value can't be negative or zero.\n * @param {string} [options.totalAmount] The grand total amount of the transaction.\n *\n * Note: This flow currently requires a full page redirect, which means to utilize this flow your page will need to be able to handle the checkout session across different pages.\n * @param {callback} [callback] The second argument, `data`, is the {@link Venmo} instance. If no callback is provided, `create` returns a promise that resolves with the {@link Venmo} instance.\n * @example\n * braintree.venmo.create({\n * client: clientInstance\n * }).then(function (venmoInstance) {\n * // venmoInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating Venmo instance', createErr);\n * });\n * @example <caption>Allow desktop flow to be used</caption>\n * braintree.venmo.create({\n * client: clientInstance,\n * allowDesktop: true\n * }).then(function (venmoInstance) {\n * // venmoInstance is ready to be used.\n * }).catch(function (createErr) {\n * console.error('Error creating Venmo instance', createErr);\n * });\n * @returns {(Promise|void)} Returns the Venmo instance.\n */\nfunction create(options) {\n var name = \"Venmo\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n var createPromise, instance;\n\n if (options.profileId && typeof options.profileId !== \"string\") {\n return Promise.reject(\n new BraintreeError(errors.VENMO_INVALID_PROFILE_ID)\n );\n }\n\n if (\n options.deepLinkReturnUrl &&\n typeof options.deepLinkReturnUrl !== \"string\"\n ) {\n return Promise.reject(\n new BraintreeError(errors.VENMO_INVALID_DEEP_LINK_RETURN_URL)\n );\n }\n\n createPromise = createDeferredClient\n .create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n })\n .then(function (client) {\n var configuration = client.getConfiguration();\n\n options.client = client;\n\n if (!configuration.gatewayConfiguration.payWithVenmo) {\n return Promise.reject(new BraintreeError(errors.VENMO_NOT_ENABLED));\n }\n\n return client;\n });\n\n options.createPromise = createPromise;\n instance = new Venmo(options);\n\n analytics.sendEvent(createPromise, \"venmo.initialized\");\n\n return createPromise.then(function () {\n return instance;\n });\n });\n}\n\n/**\n * @static\n * @function isBrowserSupported\n * @param {object} [options] browser support options:\n * @param {boolean} [options.allowNewBrowserTab=true] This should be set to false if your payment flow requires returning to the same tab, e.g. single page applications.\n * @param {boolean} [options.allowWebviews=true] This should be set to false if your payment flow does not occur from within a webview that you control.\n * @example\n * if (braintree.venmo.isBrowserSupported()) {\n * // set up Venmo\n * }\n * @example <caption>Explicitly require browser support returning to the same tab</caption>\n * if (braintree.venmo.isBrowserSupported({\n * allowNewBrowserTab: false\n * })) {\n * // set up Venmo\n * }\n * @example <caption>Explicitly set webviews as disallowed browsers</caption>\n * if (braintree.venmo.isBrowserSupported({\n * allowWebviews: false\n * })) {\n * // set up Venmo\n * }\n * @returns {boolean} Whether or not the browser supports Venmo.\n */\nfunction isBrowserSupported(options) {\n return supportsVenmo.isBrowserSupported(options);\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n isBrowserSupported: isBrowserSupported,\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./shared/errors\":219,\"./shared/supports-venmo\":222,\"./venmo\":224,\"@braintree/wrap-promise\":43}],217:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar isAndroid = _dereq_(\"@braintree/browser-detection/is-android\");\nvar isChrome = _dereq_(\"@braintree/browser-detection/is-chrome\");\nvar isIos = _dereq_(\"@braintree/browser-detection/is-ios\");\nvar isIosSafari = _dereq_(\"@braintree/browser-detection/is-ios-safari\");\nvar isIosWebview = _dereq_(\"@braintree/browser-detection/is-ios-webview\");\nvar isSamsung = _dereq_(\"@braintree/browser-detection/is-samsung\");\n\nfunction isAndroidWebview() {\n return (\n isAndroid() && window.navigator.userAgent.toLowerCase().indexOf(\"wv\") > -1\n );\n}\n\nfunction doesNotSupportWindowOpenInIos() {\n if (!isIos()) {\n return false;\n }\n\n return isIosWebview() || !isIosSafari();\n}\n\nfunction isFacebookOwnedBrowserOnAndroid() {\n var ua = window.navigator.userAgent.toLowerCase();\n\n // Huawei's Facebook useragent does not include Android\n if (ua.indexOf(\"huawei\") > -1 && ua.indexOf(\"fban\") > -1) {\n return true;\n }\n\n if (!isAndroid()) {\n return false;\n }\n\n return ua.indexOf(\"fb_iab\") > -1 || ua.indexOf(\"instagram\") > -1;\n}\n\nfunction isIosChrome() {\n return isIos() && isChrome();\n}\n\nmodule.exports = {\n isAndroid: isAndroid,\n isAndroidWebview: isAndroidWebview,\n isChrome: isChrome,\n isIos: isIos,\n isIosChrome: isIosChrome,\n isSamsung: isSamsung,\n isIosSafari: isIosSafari,\n isIosWebview: isIosWebview,\n isFacebookOwnedBrowserOnAndroid: isFacebookOwnedBrowserOnAndroid,\n doesNotSupportWindowOpenInIos: doesNotSupportWindowOpenInIos,\n};\n\n},{\"@braintree/browser-detection/is-android\":22,\"@braintree/browser-detection/is-chrome\":24,\"@braintree/browser-detection/is-ios\":30,\"@braintree/browser-detection/is-ios-safari\":27,\"@braintree/browser-detection/is-ios-webview\":28,\"@braintree/browser-detection/is-samsung\":31}],218:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * Venmo shared constants\n * @typedef {object} Venmo~venmoConstants\n * @ignore\n * @property {string} VENMO_APP_OR_MOBILE_AUTH_URL A deep-linked url that will open the Venmo app if installed, or navigate to a Venmo web-login experience if the Venmo app is not present.\n * @property {string} VENMO_MOBILE_APP_AUTH_ONLY_URL A deep-linked url that leads to a Venmo dead-end page if the Venmo app is not installed (page asks customer to download the app).\n * @property {string} VENMO_WEB_LOGIN_URL A non-deeplinked url that leads to a Venmo login page. For use when explicitly wanting to avoid using the Venmo mobile app via a deep-linked url.\n */\nmodule.exports = {\n DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY: 500,\n DEFAULT_PROCESS_RESULTS_DELAY: 1000,\n VENMO_APP_OR_MOBILE_AUTH_URL: \"https://venmo.com/go/checkout\",\n VENMO_MOBILE_APP_AUTH_ONLY_URL: \"https://venmo.com/braintree/checkout\",\n VENMO_WEB_LOGIN_URL: \"https://account.venmo.com/go/web\",\n};\n\n},{}],219:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Venmo - Creation Error Codes\n * @description Errors that occur when [creating the Venmo component](./module-braintree-web_venmo.html#.create).\n * @property {MERCHANT} VENMO_NOT_ENABLED Occurs when Venmo is not enabled on the Braintree control panel.\n * @property {MERCHANT} VENMO_INVALID_PROFILE_ID Occurs when Venmo is initialized with a profile id, but it is invalid.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_SETUP_FAILED __Deprecated__ No longer returned. Use `VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED` instead.\n * @property {UNKNOWN} VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED Occurs when the request to set up a Venmo Payment Context object fails.\n */\n\n/**\n * @name BraintreeError.Venmo - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./Venmo.html#tokenize).\n * @property {CUSTOMER} VENMO_APP_CANCELED Occurs when customer cancels flow from the Venmo app.\n * @property {UNKNOWN} VENMO_APP_FAILED Occurs when tokenization fails.\n * @property {CUSTOMER} VENMO_CANCELED Occurs when customer cancels the flow or Venmo app is not available.\n * @property {CUSTOMER} VENMO_CUSTOMER_CANCELED Occurs when customer cancels the flow.\n * @property {CUSTOMER} VENMO_DESKTOP_CANCELED Occurs when customer cancels the Venmo Desktop flow by closing the modal.\n * @property {UNKNOWN} VENMO_DESKTOP_UNKNOWN_ERROR Occurs when an unknown error causes the Venmo Desktop flow to fail.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR Occurs when an unknown network error causes the mobile polling process to fail.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED Occurs when the polling has expired and the payment cannot be completed.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED Occurs when the polling operation is canceled by the customer.\n * @property {CUSTOMER} VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT Occurs when customer takes too long to complete payment.\n * @property {UNKNOWN} VENMO_MOBILE_POLLING_TOKENIZATION_FAILED Occurs if there is an unknown error during the mobile polling process.\n * @property {NETWORK} VENMO_NETWORK_ERROR Occurs when a network error causes a request to fail.\n * @property {MERCHANT} VENMO_TOKENIZATION_CANCELED_BY_MERCHANT Occurs when `cancelTokenization` is called while tokenization is in progress.\n * @property {UNKNOWN} VENMO_TOKENIZATION_FAILED Occurs when there is an unknown error during the web login experience.\n * @property {MERCHANT} VENMO_TOKENIZATION_REQUEST_ACTIVE Occurs when `tokenize` is called when the flow is already in progress.\n * @property {MERCHANT} VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE Occurs when `cancelTokenization` is called when the flow is not in progress.\n * @property {MERCHANT} VENMO_ECD_DISABLED Occurs when the merchant tries to access customer details without enabling Enriched Customer Data.\n */\n\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nmodule.exports = {\n VENMO_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_NOT_ENABLED\",\n message: \"Venmo is not enabled for this merchant.\",\n },\n VENMO_TOKENIZATION_REQUEST_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_TOKENIZATION_REQUEST_ACTIVE\",\n message: \"Another tokenization request is active.\",\n },\n VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE\",\n message: \"No tokenization in progress.\",\n },\n VENMO_APP_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_APP_FAILED\",\n message: \"Venmo app encountered a problem.\",\n },\n VENMO_APP_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_APP_CANCELED\",\n message: \"Venmo app authorization was canceled.\",\n },\n VENMO_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_CANCELED\",\n message:\n \"User canceled Venmo authorization, or Venmo app is not available.\",\n },\n VENMO_CUSTOMER_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_CUSTOMER_CANCELED\",\n message: \"User canceled Venmo authorization.\",\n },\n VENMO_NETWORK_ERROR: {\n type: BraintreeError.types.NETWORK,\n code: \"VENMO_NETWORK_ERROR\",\n message: \"Something went wrong making the request\",\n },\n VENMO_DESKTOP_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_DESKTOP_CANCELED\",\n message:\n \"User canceled Venmo authorization by closing the Venmo Desktop modal.\",\n },\n VENMO_TOKENIZATION_CANCELED_BY_MERCHANT: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_TOKENIZATION_CANCELED_BY_MERCHANT\",\n message: \"The Venmo tokenization was canceled by the merchant.\",\n },\n VENMO_DESKTOP_UNKNOWN_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_DESKTOP_UNKNOWN_ERROR\",\n message: \"Something went wrong with the Venmo Desktop flow.\",\n },\n VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED: {\n type: BraintreeError.types.NETWORK,\n code: \"VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED\",\n message: \"Something went wrong creating the Venmo Payment Context.\",\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR\",\n message: \"Something went wrong during mobile polling.\",\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED\",\n message: \"The Venmo authorization request is expired.\",\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED\",\n message: \"The Venmo authorization was canceled\",\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT: {\n type: BraintreeError.types.CUSTOMER,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT\",\n message: \"Customer took too long to authorize Venmo payment.\",\n },\n VENMO_MOBILE_POLLING_TOKENIZATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_MOBILE_POLLING_TOKENIZATION_FAILED\",\n message: \"The Venmo authorization failed.\",\n },\n VENMO_INVALID_PROFILE_ID: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_INVALID_PROFILE_ID\",\n message: \"Venmo profile ID is invalid.\",\n },\n VENMO_INVALID_DEEP_LINK_RETURN_URL: {\n type: BraintreeError.types.MERCHANT,\n code: \"VENMO_INVALID_DEEP_LINK_RETURN_URL\",\n message: \"Venmo deep link return URL is invalid.\",\n },\n VENMO_TOKENIZATION_FAILED: {\n type: BraintreeError.types.UNKNOWN,\n code: \"VENMO_TOKENIZATION_FAILED\",\n message: \"Venmo encountered a problem\",\n },\n VENMO_ECD_DISABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"ECD_DISABLED\",\n message:\n \"Cannot collect customer data when ECD is disabled. Enable this feature in the Control Panel to collect this data.\",\n },\n};\n\n},{\"../../lib/braintree-error\":124}],220:[function(_dereq_,module,exports){\n\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VENMO_DESKTOP_UNKNOWN_ERROR =\n exports.VENMO_DESKTOP_REQUEST_NEW_QR_CODE =\n exports.VENMO_DESKTOP_CLOSED_FROM_PARENT =\n exports.VENMO_DESKTOP_IFRAME_READY =\n exports.VENMO_DESKTOP_DISPLAY_QR_CODE =\n exports.VENMO_DESKTOP_DISPLAY_ERROR =\n exports.VENMO_DESKTOP_CUSTOMER_CANCELED =\n exports.VENMO_DESKTOP_AUTHORIZING =\n exports.VENMO_DESKTOP_AUTHORIZE =\n exports.VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT =\n void 0;\nexports.VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT =\n \"VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT\";\nexports.VENMO_DESKTOP_AUTHORIZE = \"VENMO_DESKTOP_AUTHORIZE\";\nexports.VENMO_DESKTOP_AUTHORIZING = \"VENMO_DESKTOP_AUTHORIZING\";\nexports.VENMO_DESKTOP_CUSTOMER_CANCELED = \"VENMO_DESKTOP_CUSTOMER_CANCELED\";\nexports.VENMO_DESKTOP_DISPLAY_ERROR = \"VENMO_DESKTOP_DISPLAY_ERROR\";\nexports.VENMO_DESKTOP_DISPLAY_QR_CODE = \"VENMO_DESKTOP_DISPLAY_QR_CODE\";\nexports.VENMO_DESKTOP_IFRAME_READY = \"VENMO_DESKTOP_IFRAME_READY\";\nexports.VENMO_DESKTOP_CLOSED_FROM_PARENT = \"VENMO_DESKTOP_CLOSED_FROM_PARENT\";\nexports.VENMO_DESKTOP_REQUEST_NEW_QR_CODE = \"VENMO_DESKTOP_REQUEST_NEW_QR_CODE\";\nexports.VENMO_DESKTOP_UNKNOWN_ERROR = \"VENMO_DESKTOP_UNKNOWN_ERROR\";\n\n},{}],221:[function(_dereq_,module,exports){\n\"use strict\";\nvar venmoConstants = _dereq_(\"./constants\");\n\nfunction getVenmoUrl(options) {\n if (options.useAllowDesktopWebLogin)\n return venmoConstants.VENMO_WEB_LOGIN_URL;\n\n if (options.mobileWebFallBack)\n return venmoConstants.VENMO_APP_OR_MOBILE_AUTH_URL;\n\n return venmoConstants.VENMO_MOBILE_APP_AUTH_ONLY_URL;\n}\n\nmodule.exports = getVenmoUrl;\n\n},{\"./constants\":218}],222:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar browserDetection = _dereq_(\"./browser-detection\");\nvar inIframe = _dereq_(\"../../lib/in-iframe\");\n\nfunction isBrowserSupported(options) {\n var isKnownUnsupportedMobileBrowser,\n merchantAllowsDesktopBrowsers,\n merchantAllowsIosChrome,\n merchantAllowsReturningToNewBrowserTab,\n merchantAllowsWebviews;\n var isAndroid = browserDetection.isAndroid();\n var isMobileDevice = isAndroid || browserDetection.isIos();\n var isAndroidChrome = isAndroid && browserDetection.isChrome();\n var isMobileDeviceThatSupportsReturnToSameTab =\n browserDetection.isIosSafari() || isAndroidChrome;\n\n options = options || {};\n // NEXT_MAJOR_VERSION allowDesktop will default to true, but can be opted out\n merchantAllowsDesktopBrowsers =\n (options.allowDesktopWebLogin || options.allowDesktop) === true;\n merchantAllowsReturningToNewBrowserTab = options.hasOwnProperty(\n \"allowNewBrowserTab\"\n )\n ? options.allowNewBrowserTab\n : true;\n // NEXT_MAJOR_VERSION webviews are not supported, except for the case where\n // the merchant themselves is presenting venmo in a webview using the deep\n // link url to get back to their app. For the next major version, we should\n // just not have this option and instead require the merchant to determine\n // if the venmo button should be displayed when presenting it in the\n // merchant's app via a webview.\n merchantAllowsWebviews = options.hasOwnProperty(\"allowWebviews\")\n ? options.allowWebviews\n : true;\n // Venmo only works on iOS Chrome when the\n // button is not rendered in an iFrame and\n // allowNewBrowserTab is set to true\n merchantAllowsIosChrome =\n merchantAllowsReturningToNewBrowserTab && !inIframe();\n\n isKnownUnsupportedMobileBrowser =\n (!merchantAllowsIosChrome && browserDetection.isIosChrome()) ||\n browserDetection.isFacebookOwnedBrowserOnAndroid() ||\n browserDetection.isSamsung();\n\n if (isKnownUnsupportedMobileBrowser) {\n return false;\n }\n\n if (\n !merchantAllowsWebviews &&\n (browserDetection.isAndroidWebview() || browserDetection.isIosWebview())\n ) {\n return false;\n }\n\n if (!isMobileDevice) {\n return merchantAllowsDesktopBrowsers;\n }\n\n if (!merchantAllowsReturningToNewBrowserTab) {\n return isMobileDeviceThatSupportsReturnToSameTab;\n }\n\n return isMobileDevice;\n}\n\nmodule.exports = {\n isBrowserSupported: isBrowserSupported,\n};\n\n},{\"../../lib/in-iframe\":150,\"./browser-detection\":217}],223:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar frameService = _dereq_(\"../../lib/frame-service/external\");\nvar useMin = _dereq_(\"../../lib/use-min\");\nvar ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\nvar errors = _dereq_(\"../shared/errors\");\nvar BraintreeError = _dereq_(\"../../lib/braintree-error\");\n\nvar VERSION = \"3.100.0\";\nvar VENMO_LOGO_SVG =\n '<svg width=\"198\" height=\"58\" viewBox=\"0 0 198 58\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M43.0702 13.6572C44.1935 15.4585 44.6999 17.3139 44.6999 19.6576C44.6999 27.1328 38.1277 36.8436 32.7935 43.6625H20.6099L15.7236 15.2939L26.3917 14.3105L28.9751 34.4966C31.389 30.6783 34.3678 24.6779 34.3678 20.587C34.3678 18.3477 33.9727 16.8225 33.3553 15.5666L43.0702 13.6572Z\" fill=\"white\"/>\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M56.8965 26.1491C58.8596 26.1491 63.8018 25.2772 63.8018 22.5499C63.8018 21.2402 62.8481 20.587 61.7242 20.587C59.7579 20.587 57.1776 22.8763 56.8965 26.1491ZM56.6715 31.5506C56.6715 34.8807 58.5787 36.1873 61.107 36.1873C63.8603 36.1873 66.4966 35.534 69.923 33.8433L68.6324 42.3523C66.2183 43.4976 62.4559 44.2617 58.8039 44.2617C49.5403 44.2617 46.2249 38.8071 46.2249 31.9879C46.2249 23.1496 51.6179 13.765 62.7365 13.765C68.858 13.765 72.2809 17.0949 72.2809 21.7317C72.2815 29.2066 62.4005 31.4965 56.6715 31.5506Z\" fill=\"white\"/>\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M103.067 20.3142C103.067 21.4052 102.897 22.9875 102.727 24.0216L99.5262 43.6622H89.1385L92.0585 25.658C92.1139 25.1696 92.284 24.1865 92.284 23.6411C92.284 22.3314 91.4414 22.0047 90.4282 22.0047C89.0826 22.0047 87.7337 22.6042 86.8354 23.0418L83.5234 43.6625H73.0772L77.8495 14.257H86.8908L87.0052 16.6041C89.1382 15.2404 91.9469 13.7656 95.932 13.7656C101.212 13.765 103.067 16.3845 103.067 20.3142Z\" fill=\"white\"/>\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M133.906 16.9841C136.881 14.9131 139.69 13.765 143.563 13.765C148.897 13.765 150.753 16.3845 150.753 20.3142C150.753 21.4052 150.583 22.9875 150.413 24.0216L147.216 43.6622H136.825L139.801 25.2774C139.855 24.786 139.971 24.1865 139.971 23.8063C139.971 22.3317 139.128 22.0047 138.115 22.0047C136.824 22.0047 135.535 22.5501 134.577 23.0418L131.266 43.6625H120.878L123.854 25.2777C123.908 24.7863 124.02 24.1868 124.02 23.8065C124.02 22.332 123.177 22.0049 122.167 22.0049C120.819 22.0049 119.473 22.6045 118.574 23.0421L115.26 43.6628H104.817L109.589 14.2573H118.52L118.8 16.7122C120.878 15.241 123.684 13.7662 127.446 13.7662C130.704 13.765 132.837 15.129 133.906 16.9841Z\" fill=\"white\"/>\\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M171.426 25.5502C171.426 23.1496 170.808 21.513 168.956 21.513C164.857 21.513 164.015 28.55 164.015 32.1498C164.015 34.8807 164.802 36.5709 166.653 36.5709C170.528 36.5709 171.426 29.1497 171.426 25.5502ZM153.458 31.7152C153.458 22.442 158.511 13.765 170.136 13.765C178.896 13.765 182.098 18.7854 182.098 25.7148C182.098 34.8805 177.099 44.3723 165.194 44.3723C156.378 44.3723 153.458 38.7525 153.458 31.7152Z\" fill=\"white\"/>\\n</svg>';\nvar CONTINUE_OR_CANCEL_INSTRUCTIONS =\n \"Tap cancel payment to cancel and return to the business. Continue payment will relaunch the payment window.\";\n\nvar POPUP_WIDTH = 400;\nvar POPUP_HEIGHT = 570;\nvar ELEMENT_IDS = {\n backdrop: \"venmo-desktop-web-backdrop\",\n backdropHidden: \"venmo-desktop-web-backdrop.hidden\",\n backdropContainer: \"venmo-backdrop-container\",\n cancelButton: \"venmo-popup-cancel-button\",\n continueButton: \"venmo-popup-continue-button\",\n message: \"venmo-message\",\n instructions: \"venmo-instructions\",\n venmoLogo: \"venmo-full-logo\",\n};\n\nExtendedPromise.suppressUnhandledPromiseMessage = true;\n\nfunction openPopup(options) {\n var frameServiceInstance = options.frameServiceInstance;\n var venmoUrl = options.venmoUrl;\n var checkForStatusChange = options.checkForStatusChange;\n var cancelTokenization = options.cancelTokenization;\n var checkPaymentContextStatus = options.checkPaymentContextStatus;\n var extendedPromise = new ExtendedPromise();\n\n document\n .getElementById(ELEMENT_IDS.continueButton)\n .addEventListener(\"click\", function () {\n frameServiceInstance.focus();\n });\n document\n .getElementById(ELEMENT_IDS.cancelButton)\n .addEventListener(\"click\", function () {\n frameServiceInstance.close();\n cancelTokenization();\n closeBackdrop();\n });\n frameServiceInstance.open({}, function (frameServiceErr) {\n var retryStartingCount = 1;\n\n if (frameServiceErr) {\n extendedPromise.reject(frameServiceErr);\n } else {\n checkForStatusChange(retryStartingCount)\n .then(function (data) {\n extendedPromise.resolve(data);\n })\n .catch(function (statusCheckError) {\n // We add this check here because at this point\n // the status should not be in CREATED status.\n // However, there is an edge case where if a buyer\n // cancels in the popup, the popup might close itself\n // before it can send the graphQL mutation to update its status.\n // In these cases, the status will be stuck in CREATED status, and\n // tokenization would fail, incorrectly throwing a tokenization error\n // instead of informing the merchant that the customer canceled.\n checkPaymentContextStatus().then(function (node) {\n if (node.status === \"CREATED\") {\n extendedPromise.reject(\n new BraintreeError(errors.VENMO_CUSTOMER_CANCELED)\n );\n } else {\n extendedPromise.reject(statusCheckError);\n }\n });\n });\n }\n\n frameServiceInstance.close();\n closeBackdrop();\n });\n frameServiceInstance.redirect(venmoUrl);\n\n return extendedPromise;\n}\n\nfunction centeredPopupDimensions() {\n var popupTop =\n Math.round((window.outerHeight - POPUP_HEIGHT) / 2) + window.screenTop;\n var popupLeft =\n Math.round((window.outerWidth - POPUP_WIDTH) / 2) + window.screenLeft;\n\n return {\n top: popupTop,\n left: popupLeft,\n };\n}\n\nfunction closeBackdrop() {\n document.getElementById(\"venmo-desktop-web-backdrop\").classList.add(\"hidden\");\n}\n\nfunction getElementStyles() {\n var backdropStyles = [\n \"#\" + ELEMENT_IDS.backdropHidden + \" {\",\n \"display: none;\",\n \"}\",\n \"#\" + ELEMENT_IDS.backdrop + \" {\",\n \"z-index: 3141592632;\",\n \"cursor: pointer;\",\n \"position: fixed;\",\n \"top: 0;\",\n \"left: 0;\",\n \"bottom: 0;\",\n \"width: 100%;\",\n \"background: rgba(0, 0, 0, 0.8);\",\n \"}\",\n ];\n var backdropContainerStyles = [\n \"#\" + ELEMENT_IDS.backdropContainer + \" {\",\n \"display: flex;\",\n \"align-content: center;\",\n \"justify-content: center;\",\n \"align-items: center;\",\n \"width: 100%;\",\n \"height: 100%;\",\n \"flex-direction: column;\",\n \"}\",\n ];\n\n var cancelButtonStyles = [\n \"#\" + ELEMENT_IDS.cancelButton + \" {\",\n \"height: 24px;\",\n \"width: 380px;\",\n \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\",\n \"font-style: normal;\",\n \"font-weight: 700;\",\n \"font-size: 18px;\",\n \"line-height: 24px;\",\n \"text-align: center;\",\n \"background-color: transparent;\",\n \"border: none;\",\n \"color: #FFFFFF;\",\n \"margin-top: 28px;\",\n \"}\",\n ];\n\n var continueButtonStyles = [\n \"#\" + ELEMENT_IDS.continueButton + \" {\",\n \"width: 400px;\",\n \"height: 50px;\",\n \"background: #0074DE;\",\n \"border-radius: 24px;\",\n \"border: none;\",\n \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\",\n \"font-style: normal;\",\n \"font-weight: 700;\",\n \"font-size: 18px;\",\n \"color: #FFFFFF;\",\n \"margin-top: 44px;\",\n \"}\",\n ];\n\n var messageStyles = [\n \"#\" + ELEMENT_IDS.message + \" {\",\n \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\",\n \"font-style: normal;\",\n \"font-weight: 500;\",\n \"font-size: 24px;\",\n \"line-height: 32px;\",\n \"text-align: center;\",\n \"color: #FFFFFF;\",\n \"margin-top: 32px;\",\n \"}\",\n ];\n\n var instructionStyles = [\n \"#\" + ELEMENT_IDS.instructions + \" {\",\n \"font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;\",\n \"font-style: normal;\",\n \"font-weight: 400;\",\n \"font-size: 16px;\",\n \"line-height: 20px;\",\n \"text-align: center;\",\n \"color: #FFFFFF;\",\n \"margin-top: 16px;\",\n \"width: 400px;\",\n \"}\",\n ];\n\n var allStyles = backdropStyles.concat(\n backdropContainerStyles,\n cancelButtonStyles,\n continueButtonStyles,\n messageStyles,\n instructionStyles\n );\n\n return allStyles.join(\"\\n\");\n}\n\nfunction buildAndStyleElements() {\n var alreadyRenderedBackdrop = document.getElementById(ELEMENT_IDS.backdrop);\n var backdropStylesElement,\n backdropDiv,\n backDropContentContainer,\n venmoLogoDiv,\n venmoMessageDiv,\n instructionsDiv,\n continueButton,\n cancelButton;\n\n if (alreadyRenderedBackdrop) {\n alreadyRenderedBackdrop.classList.remove(\"hidden\");\n\n return;\n }\n backdropStylesElement = document.createElement(\"style\");\n backdropDiv = document.createElement(\"div\");\n backDropContentContainer = document.createElement(\"div\");\n venmoLogoDiv = document.createElement(\"div\");\n venmoMessageDiv = document.createElement(\"div\");\n instructionsDiv = document.createElement(\"div\");\n continueButton = document.createElement(\"button\");\n cancelButton = document.createElement(\"button\");\n\n backdropStylesElement.id = \"venmo-desktop-web__injected-styles\";\n backdropStylesElement.innerHTML = getElementStyles();\n\n backdropDiv.id = ELEMENT_IDS.backdrop;\n\n backDropContentContainer.id = ELEMENT_IDS.backdropContainer;\n\n venmoLogoDiv.id = ELEMENT_IDS.venmoLogo;\n venmoLogoDiv.innerHTML = VENMO_LOGO_SVG;\n\n venmoMessageDiv.id = ELEMENT_IDS.message;\n venmoMessageDiv.innerText = \"What would you like to do?\";\n\n instructionsDiv.id = ELEMENT_IDS.instructions;\n instructionsDiv.innerText = CONTINUE_OR_CANCEL_INSTRUCTIONS;\n\n continueButton.id = ELEMENT_IDS.continueButton;\n continueButton.innerText = \"Continue payment\";\n\n cancelButton.id = ELEMENT_IDS.cancelButton;\n cancelButton.innerText = \"Cancel payment\";\n\n document.head.appendChild(backdropStylesElement);\n backDropContentContainer.appendChild(venmoLogoDiv);\n backDropContentContainer.appendChild(venmoMessageDiv);\n backDropContentContainer.appendChild(instructionsDiv);\n backDropContentContainer.appendChild(continueButton);\n backDropContentContainer.appendChild(cancelButton);\n backdropDiv.appendChild(backDropContentContainer);\n document.body.appendChild(backdropDiv);\n\n backdropDiv.addEventListener(\"click\", function (event) {\n event.stopPropagation();\n });\n}\n\n/**\n * Applies a backdrop over the page, and opens a popup to the supplied url. Uses supplied status and cancel functions to handle the flow.\n * @function runWebLogin\n * @ignore\n * @param {object} options Options for running the web login flow.\n * @param {string} options.venmoUrl Venmo url that is to be used for logging in.\n * @param {Venmo~checkPaymentContextStatusAndProcessResult} options.checkForStatusChange {@link Venmo~checkPaymentContextStatusAndProcessResult} to be invoked in order to check for a payment context status update.\n * @param {Venmo~cancelTokenization} options.cancelTokenization {@link Venmo~cancelTokenization} to be invoked when the appropriate payment context status is retrieved.\n * @param {boolean} options.debug A flag to control whether to use minified assets or not.\n * @returns {Promise} Returns a promise\n */\nfunction runWebLogin(options) {\n buildAndStyleElements();\n\n return openPopup(options);\n}\n\n/**\n * When using frameservice, it needs to be created separately from the action of opening. The setup process includes\n * steps that browsers may consider async or too disconnected from the user action required to open a popup.\n *\n * This function enables us to do that setup at an appropriate time.\n * @function setupDesktopWebLogin\n * @ignore\n * @param {object} options Options use for setting up the Desktop Web Login flow.\n * @param {string} options.assetsUrl Url that points to the hosted Braintree assets.\n * @param {boolean} options.debug A flag to control whether to use minified assets or not.\n\n * @returns {Promise} Returns a promise\n */\nfunction setupDesktopWebLogin(options) {\n var extendedPromise = new ExtendedPromise();\n var popupName = \"venmoDesktopWebLogin\";\n var assetsUrl = options.assetsUrl;\n var debug = options.debug || false;\n var popupLocation = centeredPopupDimensions();\n var assetsBaseUrl = assetsUrl + \"/web/\" + VERSION + \"/html\";\n\n frameService.create(\n {\n name: popupName,\n dispatchFrameUrl:\n assetsBaseUrl + \"/dispatch-frame\" + useMin(debug) + \".html\",\n openFrameUrl:\n assetsBaseUrl + \"/venmo-landing-frame\" + useMin(debug) + \".html\",\n top: popupLocation.top,\n left: popupLocation.left,\n height: POPUP_HEIGHT,\n width: POPUP_WIDTH,\n },\n function (frameServiceInstance) {\n extendedPromise.resolve(frameServiceInstance);\n }\n );\n\n return extendedPromise;\n}\n\nmodule.exports = {\n runWebLogin: runWebLogin,\n openPopup: openPopup,\n setupDesktopWebLogin: setupDesktopWebLogin,\n POPUP_WIDTH: POPUP_WIDTH,\n POPUP_HEIGHT: POPUP_HEIGHT,\n};\n\n},{\"../../lib/braintree-error\":124,\"../../lib/frame-service/external\":139,\"../../lib/use-min\":160,\"../shared/errors\":219,\"@braintree/extended-promise\":34}],224:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar analytics = _dereq_(\"../lib/analytics\");\nvar isBrowserSupported = _dereq_(\"./shared/supports-venmo\");\nvar browserDetection = _dereq_(\"./shared/browser-detection\");\nvar constants = _dereq_(\"./shared/constants\");\nvar errors = _dereq_(\"./shared/errors\");\nvar querystring = _dereq_(\"../lib/querystring\");\nvar isVerifiedDomain = _dereq_(\"../lib/is-verified-domain\");\nvar methods = _dereq_(\"../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar inIframe = _dereq_(\"../lib/in-iframe\");\nvar ExtendedPromise = _dereq_(\"@braintree/extended-promise\");\nvar getVenmoUrl = _dereq_(\"./shared/get-venmo-url\");\nvar desktopWebLogin = _dereq_(\"./shared/web-login-backdrop\");\nvar snakeCaseToCamelCase = _dereq_(\"../lib/snake-case-to-camel-case\");\n\n// NEXT_MAJOR_VERSION the source code for this is actually in a\n// typescript repo called venmo-desktop, once the SDK is migrated\n// to typescript, we can move the TS files out of that separate\n// repo and into the web SDK properly\nvar createVenmoDesktop = _dereq_(\"./external/\");\nvar graphqlQueries = _dereq_(\"./external/queries\");\n\nvar VERSION = \"3.100.0\";\nvar DEFAULT_MOBILE_POLLING_INTERVAL = 250; // 1/4 second\nvar DEFAULT_MOBILE_EXPIRING_THRESHOLD = 300000; // 5 minutes\n\nExtendedPromise.suppressUnhandledPromiseMessage = true;\n\n/**\n * Venmo tokenize payload.\n * @typedef {object} Venmo~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {string} type The payment method type, always `VenmoAccount`.\n * @property {object} details Additional Venmo account details.\n * @property {string} details.username The username of the Venmo account.\n * @property {string} details.paymentContextId The context ID of the Venmo payment. Only available when used with {@link https://braintree.github.io/braintree-web/current/module-braintree-web_venmo.html#.create|`paymentMethodUsage`}.\n */\n\n/**\n * @class\n * @param {object} options The Venmo {@link module:braintree-web/venmo.create create} options.\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/venmo.create|braintree-web.venmo.create} instead.</strong>\n * @classdesc This class represents a Venmo component produced by {@link module:braintree-web/venmo.create|braintree-web/venmo.create}. Instances of this class have methods for tokenizing Venmo payments.\n */\nfunction Venmo(options) {\n var self = this;\n\n this._allowDesktopWebLogin = options.allowDesktopWebLogin || false;\n this._mobileWebFallBack = options.mobileWebFallBack || false;\n this._createPromise = options.createPromise;\n this._allowNewBrowserTab = options.allowNewBrowserTab !== false;\n this._allowWebviews = options.allowWebviews !== false;\n this._allowDesktop = options.allowDesktop === true;\n this._useRedirectForIOS = options.useRedirectForIOS === true;\n this._profileId = options.profileId;\n this._displayName = options.displayName;\n this._deepLinkReturnUrl = options.deepLinkReturnUrl;\n this._ignoreHistoryChanges = options.ignoreHistoryChanges;\n this._paymentMethodUsage = (options.paymentMethodUsage || \"\").toUpperCase();\n this._shouldUseLegacyFlow = !this._paymentMethodUsage;\n this._requireManualReturn = options.requireManualReturn === true;\n this._useDesktopQRFlow =\n this._allowDesktop && this._isDesktop() && !this._allowDesktopWebLogin;\n this._useAllowDesktopWebLogin =\n this._allowDesktopWebLogin && this._isDesktop();\n this._cannotHaveReturnUrls = inIframe() || this._requireManualReturn;\n this._allowAndroidRecreation = options.allowAndroidRecreation !== false;\n this._maxRetryCount = 3;\n this._collectCustomerBillingAddress =\n options.collectCustomerBillingAddress || false;\n this._collectCustomerShippingAddress =\n options.collectCustomerShippingAddress || false;\n this._lineItems = options.lineItems;\n this._subTotalAmount = options.subTotalAmount;\n this._discountAmount = options.discountAmount;\n this._taxAmount = options.taxAmount;\n this._shippingAmount = options.shippingAmount;\n this._totalAmount = options.totalAmount;\n\n this._shouldCreateVenmoPaymentContext =\n this._cannotHaveReturnUrls || !this._shouldUseLegacyFlow;\n\n analytics.sendEvent(\n this._createPromise,\n \"venmo.desktop-flow.configured.\" + String(Boolean(this._allowDesktop))\n );\n\n // if the url has a tokenization result, that indicates\n // that it cannot be the desktop flow or the manual return\n // flow. If it's the hash change with paymentMethodUsage\n // flow, we want to skip creating a new payment context, since\n // there is already a pending payment context waiting to be\n // processed. For the hash change flow without paymentMethodUsage,\n // no further actions are needed.\n if (this.hasTokenizationResult()) {\n analytics.sendEvent(\n this._createPromise,\n \"venmo.appswitch.return-in-new-tab\"\n );\n } else if (this._useDesktopQRFlow) {\n this._createPromise = this._createPromise.then(function (client) {\n var config = client.getConfiguration().gatewayConfiguration;\n\n return createVenmoDesktop({\n url:\n config.assetsUrl +\n \"/web/\" +\n VERSION +\n \"/html/venmo-desktop-frame.html\",\n environment:\n config.environment === \"production\" ? \"PRODUCTION\" : \"SANDBOX\",\n profileId: self._profileId || config.payWithVenmo.merchantId,\n paymentMethodUsage: self._paymentMethodUsage,\n displayName: self._displayName,\n Promise: Promise,\n apiRequest: function (query, data) {\n return client\n .request({\n api: \"graphQLApi\",\n data: {\n query: query,\n variables: data,\n },\n })\n .then(function (response) {\n return response.data;\n });\n },\n sendEvent: function (eventName) {\n analytics.sendEvent(self._createPromise, eventName);\n },\n verifyDomain: isVerifiedDomain,\n })\n .then(function (venmoDesktopInstance) {\n self._venmoDesktopInstance = venmoDesktopInstance;\n analytics.sendEvent(\n self._createPromise,\n \"venmo.desktop-flow.presented\"\n );\n\n return client;\n })\n .catch(function () {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.desktop-flow.setup-failed\"\n );\n self._useDesktopQRFlow = false;\n\n return client;\n });\n });\n } else if (this._shouldCreateVenmoPaymentContext) {\n // these variables are only relevant for the manual return flow\n // and they are only set to make testing easier (so they can\n // be overwritten with smaller values in the tests)\n this._mobilePollingInterval = DEFAULT_MOBILE_POLLING_INTERVAL;\n this._mobilePollingExpiresThreshold = DEFAULT_MOBILE_EXPIRING_THRESHOLD;\n\n this._createPromise = this._createPromise.then(function (client) {\n var paymentContextPromise, webLoginPromise;\n var analyticsCategory = self._cannotHaveReturnUrls\n ? \"manual-return\"\n : \"mobile-payment-context\";\n var config = client.getConfiguration();\n\n webLoginPromise = desktopWebLogin\n .setupDesktopWebLogin({\n assetsUrl: config.gatewayConfiguration.assetsUrl,\n debug: config.isDebug,\n })\n .then(function (frameServiceInstance) {\n self._frameServiceInstance = frameServiceInstance;\n })\n .catch(function (desktopWebErr) {\n return desktopWebErr;\n });\n\n self._mobilePollingContextEnvironment =\n config.gatewayConfiguration.environment.toUpperCase();\n\n paymentContextPromise = self\n ._createVenmoPaymentContext(client)\n .then(function () {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.\" + analyticsCategory + \".presented\"\n );\n\n return client;\n })\n .catch(function (err) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.\" + analyticsCategory + \".setup-failed\"\n );\n\n return Promise.reject(\n new BraintreeError({\n type: errors.VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED.type,\n code: errors.VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED.code,\n message: isValidationError(err)\n ? err.details.originalError[0].message\n : errors.VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n\n return ExtendedPromise.all([webLoginPromise, paymentContextPromise])\n .then(function (results) {\n var paymentContextResult = results[1]; // We only care about the returned value of the paymentContextPromise\n\n return Promise.resolve(paymentContextResult);\n })\n .catch(function (promiseErr) {\n // ExtendedPromise.all returns just one error and it's either which fails first/at all.\n return Promise.reject(promiseErr);\n });\n });\n }\n}\n\nfunction isValidationError(err) {\n return (\n err.details &&\n err.details.originalError &&\n err.details.originalError[0] &&\n err.details.originalError[0].extensions &&\n err.details.originalError[0].extensions.errorClass === \"VALIDATION\" &&\n err.details.originalError[0].extensions.errorType === \"user_error\"\n );\n}\n\nVenmo.prototype._createVenmoPaymentContext = function (\n client,\n cancelIfTokenizationInProgress\n) {\n var self = this;\n var promise, transactionDetails;\n var configuration = client.getConfiguration();\n var venmoConfiguration = configuration.gatewayConfiguration.payWithVenmo;\n var transactionDetailsPresent = false;\n\n if (!this._shouldCreateVenmoPaymentContext) {\n return Promise.resolve();\n }\n\n if (this._shouldUseLegacyFlow) {\n promise = client\n .request({\n api: \"graphQLApi\",\n data: {\n query: graphqlQueries.LEGACY_CREATE_PAYMENT_CONTEXT_QUERY,\n variables: {\n input: {\n environment: this._mobilePollingContextEnvironment,\n intent: \"PAY_FROM_APP\",\n },\n },\n },\n })\n .then(function (response) {\n return response\n .data.createVenmoQRCodePaymentContext.venmoQRCodePaymentContext;\n });\n } else {\n // Merchants are not allowed to collect user addresses unless ECD (Enriched Customer Data) is enabled on the BT Control Panel.\n if (\n (this._collectCustomerBillingAddress ||\n this._collectCustomerShippingAddress) &&\n !venmoConfiguration.enrichedCustomerDataEnabled\n ) {\n return Promise.reject(new BraintreeError(errors.VENMO_ECD_DISABLED));\n }\n\n if (this._lineItems) {\n this._lineItems.forEach(function (item) {\n item.unitTaxAmount = item.unitTaxAmount || \"0\";\n });\n }\n transactionDetails = {\n subTotalAmount: this._subTotalAmount,\n discountAmount: this._discountAmount,\n taxAmount: this._taxAmount,\n shippingAmount: this._shippingAmount,\n totalAmount: this._totalAmount,\n lineItems: this._lineItems,\n };\n transactionDetailsPresent = Object.keys(transactionDetails).some(function (\n detail\n ) {\n return transactionDetails[detail] !== undefined; // eslint-disable-line no-undefined\n });\n promise = client\n .request({\n api: \"graphQLApi\",\n data: {\n query: graphqlQueries.CREATE_PAYMENT_CONTEXT_QUERY,\n variables: {\n input: {\n paymentMethodUsage: this._paymentMethodUsage,\n intent: \"CONTINUE\",\n customerClient: \"MOBILE_WEB\",\n displayName: this._displayName,\n paysheetDetails: {\n collectCustomerBillingAddress:\n this._collectCustomerBillingAddress,\n collectCustomerShippingAddress:\n this._collectCustomerShippingAddress,\n transactionDetails: transactionDetailsPresent\n ? transactionDetails\n : undefined, // eslint-disable-line no-undefined\n },\n },\n },\n },\n })\n .then(function (response) {\n return response.data.createVenmoPaymentContext.venmoPaymentContext;\n });\n }\n\n return promise.then(function (context) {\n var expiredTime = new Date(context.expiresAt) - new Date(context.createdAt);\n var refreshIn = expiredTime * 0.6666;\n\n // prevents multiple setTimeouts from firing from separate calls\n // to create a payment context by canceling the previous one\n // if there is a pending call\n clearTimeout(self._refreshPaymentContextTimeout);\n self._refreshPaymentContextTimeout = setTimeout(function () {\n if (self._tokenizationInProgress) {\n return;\n }\n self._createVenmoPaymentContext(client, true);\n }, refreshIn);\n\n if (cancelIfTokenizationInProgress && self._tokenizationInProgress) {\n return;\n }\n\n self._venmoPaymentContextStatus = context.status;\n self._venmoPaymentContextId = context.id;\n });\n};\n\nVenmo.prototype.appSwitch = function (url) {\n if (this._deepLinkReturnUrl) {\n if (isIosWebviewInDeepLinkReturnUrlFlow()) {\n analytics.sendEvent(\n this._createPromise,\n \"venmo.appswitch.start.ios-webview\"\n );\n // Deep link URLs do not launch iOS apps from a webview when using window.open or PopupBridge.open.\n window.location.href = url;\n } else if (\n window.popupBridge &&\n typeof window.popupBridge.open === \"function\"\n ) {\n analytics.sendEvent(\n this._createPromise,\n \"venmo.appswitch.start.popup-bridge\"\n );\n window.popupBridge.open(url);\n } else {\n analytics.sendEvent(this._createPromise, \"venmo.appswitch.start.webview\");\n window.open(url);\n }\n } else {\n analytics.sendEvent(this._createPromise, \"venmo.appswitch.start.browser\");\n\n if (\n browserDetection.doesNotSupportWindowOpenInIos() ||\n this._shouldUseRedirectStrategy()\n ) {\n window.location.href = url;\n } else {\n window.open(url);\n }\n }\n};\n\nVenmo.prototype.getUrl = function () {\n return this._createPromise.then(\n function (client) {\n var configuration = client.getConfiguration();\n var params = {};\n var currentUrl =\n this._deepLinkReturnUrl ||\n window.location.href.replace(window.location.hash, \"\");\n var venmoConfiguration = configuration.gatewayConfiguration.payWithVenmo;\n var analyticsMetadata = configuration.analyticsMetadata;\n var accessToken = venmoConfiguration.accessToken;\n var braintreeData = {\n _meta: {\n version: analyticsMetadata.sdkVersion,\n integration: analyticsMetadata.integration,\n platform: analyticsMetadata.platform,\n sessionId: analyticsMetadata.sessionId,\n },\n };\n\n this._isDebug = configuration.isDebug;\n this._assetsUrl = configuration.gatewayConfiguration.assetsUrl;\n\n currentUrl = currentUrl.replace(/#*$/, \"\");\n\n /* eslint-disable camelcase */\n if (this._venmoPaymentContextId) {\n if (this._shouldUseLegacyFlow) {\n // NEXT_MAJOR_VERSION stop adding the context id to the access token.\n // the context id is placed here for backwards compatiblity\n // with versions of the venmo app that did not support\n // pulling the resource id off of the query params\n accessToken += \"|pcid:\" + this._venmoPaymentContextId;\n } else {\n params.resource_id = this._venmoPaymentContextId;\n }\n }\n\n if (this._shouldIncludeReturnUrls() || this._useAllowDesktopWebLogin) {\n if (this._useAllowDesktopWebLogin) {\n currentUrl =\n this._assetsUrl + \"/web/\" + VERSION + \"/html/redirect-frame.html\";\n }\n params[\"x-success\"] = currentUrl + \"#venmoSuccess=1\";\n params[\"x-cancel\"] = currentUrl + \"#venmoCancel=1\";\n params[\"x-error\"] = currentUrl + \"#venmoError=1\";\n } else {\n params[\"x-success\"] = \"NOOP\";\n params[\"x-cancel\"] = \"NOOP\";\n params[\"x-error\"] = \"NOOP\";\n }\n\n if (!this._allowAndroidRecreation) {\n params.allowAndroidRecreation = 0;\n } else {\n params.allowAndroidRecreation = 1;\n }\n\n params.ua = window.navigator.userAgent;\n params.braintree_merchant_id =\n this._profileId || venmoConfiguration.merchantId;\n params.braintree_access_token = accessToken;\n params.braintree_environment = venmoConfiguration.environment;\n params.braintree_sdk_data = btoa(JSON.stringify(braintreeData));\n\n return (\n getVenmoUrl({\n useAllowDesktopWebLogin: this._useAllowDesktopWebLogin,\n mobileWebFallBack: this._mobileWebFallBack,\n }) +\n \"?\" +\n querystring.stringify(params)\n );\n }.bind(this)\n );\n};\n\n/**\n * Returns a boolean indicating whether the current browser supports Venmo as a payment method. Please note that iOS Chrome is not supported when the Venmo button is rendered in an iFrame.\n *\n * If `options.allowNewBrowserTab` is false when calling {@link module:braintree-web/venmo.create|venmo.create}, this method will return true only for browsers known to support returning from the Venmo app to the same browser tab. Currently, this is limited to iOS Safari and Android Chrome.\n * If `options.allowWebviews` is false when calling {@link module:braintree-web/venmo.create|venmo.create}, this method will return true only for mobile browsers that are not webviews.\n * @public\n * @returns {boolean} True if the current browser is supported, false if not.\n */\nVenmo.prototype.isBrowserSupported = function () {\n return isBrowserSupported.isBrowserSupported({\n allowNewBrowserTab: this._allowNewBrowserTab,\n allowWebviews: this._allowWebviews,\n allowDesktop: this._allowDesktop,\n allowDesktopWebLogin: this._allowDesktopWebLogin,\n });\n};\n\n/**\n * Returns a boolean indicating whether a Venmo tokenization result is ready to be processed immediately.\n *\n * This method should be called after initialization to see if the result of Venmo authorization is available. If it returns true, call {@link Venmo#tokenize|tokenize} immediately to process the results.\n *\n * @public\n * @returns {boolean} True if the results of Venmo payment authorization are available and ready to process.\n */\nVenmo.prototype.hasTokenizationResult = function () {\n return this._hasTokenizationResult();\n};\n\n// a private version that lets us pass in a custom hash\n// when listening on a hashchange event\nVenmo.prototype._hasTokenizationResult = function (hash) {\n var params = getFragmentParameters(hash);\n\n return (\n typeof (params.venmoSuccess || params.venmoError || params.venmoCancel) !==\n \"undefined\"\n );\n};\n\nVenmo.prototype._shouldIncludeReturnUrls = function () {\n // when a deep link return url is passed, we should always\n // respect it and include the return urls so the venmo app\n // can app switch back to it\n if (this._deepLinkReturnUrl) {\n return true;\n }\n\n // when the sdk is initialized within an iframe, it's\n // impossible to return back to the correct place automatically\n // without also setting a deepLinkReturnUrl. When the return\n // urls are omitted, the Venmo app prompts the user to return\n // manually.\n return !this._cannotHaveReturnUrls;\n};\n\nVenmo.prototype._isDesktop = function () {\n return !(browserDetection.isIos() || browserDetection.isAndroid());\n};\n\n/**\n * Launches the Venmo flow and returns a nonce payload.\n *\n * If {@link Venmo#hasTokenizationResult|hasTokenizationResult} returns true, calling tokenize will immediately process and return the results without initiating the Venmo payment authorization flow.\n *\n * Only one Venmo flow can be active at a time. One way to achieve this is to disable your Venmo button while the flow is open.\n * @public\n * @param {object} [options] Options for tokenization.\n * @param {number} [options.processResultsDelay=500] The amount of time in milliseconds to delay processing the results. In most cases, this value should be left as the default.\n * @param {callback} [callback] The second argument, <code>data</code>, is a {@link Venmo~tokenizePayload|tokenizePayload}. If no callback is provided, the method will return a Promise that resolves with a {@link Venmo~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * button.addEventListener('click', function () {\n * // Disable the button so that we don't attempt to open multiple popups.\n * button.setAttribute('disabled', 'disabled');\n *\n * // Because tokenize opens a new window, this must be called\n * // as a result of a user action, such as a button click.\n * venmoInstance.tokenize().then(function (payload) {\n * // Submit payload.nonce to your server\n * // Use payload.username to get the Venmo username and display any UI\n * }).catch(function (tokenizeError) {\n * // Handle flow errors or premature flow closure\n * switch (tokenizeErr.code) {\n * case 'VENMO_APP_CANCELED':\n * console.log('User canceled Venmo flow.');\n * break;\n * case 'VENMO_CANCELED':\n * console.log('User canceled Venmo, or Venmo app is not available.');\n * break;\n * default:\n * console.error('Error!', tokenizeErr);\n * }\n * }).then(function () {\n * button.removeAttribute('disabled');\n * });\n * });\n */\nVenmo.prototype.tokenize = function (options) {\n var self = this;\n var tokenizationPromise;\n\n options = options || {};\n\n if (this._tokenizationInProgress === true) {\n return Promise.reject(\n new BraintreeError(errors.VENMO_TOKENIZATION_REQUEST_ACTIVE)\n );\n }\n\n this._tokenizationInProgress = true;\n if (this._useDesktopQRFlow) {\n // for the desktop flow, we create a venmo payment\n // context and then present a qr code modal to the\n // customer and they will open up their venmo app\n // and scan it and approve the purchase on their\n // mobile device. The sdk will start polling\n // in order to determine when the status of the\n // payment context has updated and then pass the\n // resulting nonce back to the merchant.\n tokenizationPromise = this._tokenizeForDesktopQRFlow(options);\n } else if (this._useAllowDesktopWebLogin) {\n /**\n * For Desktop Web Login, we open a browser popup to allow for authorization. Once authorized, the redirect urls are used by Venmo, and we query the API for a payment context status update.\n *\n * - Payment context is created on initialization\n * - Popup is opened to Venmo login url.\n * - The payment is authorized or canceled, and the popup is closed\n * - Once the popup is closed, we query the API for a payment context status update\n *\n * This is an alternate, opt-in flow to be used the Desktop QR Flow is not desired for Pay with Venmo desktop experiences.\n */\n tokenizationPromise = this._tokenizeWebLoginWithRedirect();\n } else if (this._cannotHaveReturnUrls) {\n // in the manual return strategy, we create the payment\n // context on initialization, then continually poll once\n // the app switch begins until we get a response indiciating\n // the payment context was approved by the customer on the\n // Venmo app. The payment context response also includes a\n // nonce. There are 2 cases where we use the manual return\n // strategy:\n // 1. the sdk is instantiated in an iframe, because\n // the venmo app is unable to redirect automatically\n // when that is the case so we rely on the customer\n // to do a manual redirect and continunally poll for\n // updates on the payment context to get the nonce\n // 2. same deal for when `requireManualReturn` is configured\n tokenizationPromise = this._tokenizeForMobileWithManualReturn();\n } else {\n // the default mobile flow is to app switch to the\n // venmo app, and then have the venmo app switch\n // back to the page with the venmo nonce details\n // encoded into the hash portion of the url. If\n // `paymentMethodUsage` is provided when instantiating\n // the sdk, we also create a payment context and pass\n // the resource id to the Venmo app during the app switch.\n // Once we get a succesful return, we ping the payment\n // context query to get any additional data needed\n // to send back to the merchant.\n tokenizationPromise =\n this._tokenizeForMobileWithHashChangeListeners(options);\n }\n\n return tokenizationPromise\n .then(function (payload) {\n return self._createPromise\n .then(function (client) {\n return self._createVenmoPaymentContext(client);\n })\n .then(function () {\n self._tokenizationInProgress = false;\n\n return formatTokenizePayload(payload);\n });\n })\n .catch(function (err) {\n return self._createPromise\n .then(function (client) {\n // We create a new Payment Context because if the last one failed, then presumably we don't want to use it again.\n // On the first pass, we create the payment context at initialization, and since we used that first one we now need to create a new one\n // for the next time someone tries to tokenize.\n return self._createVenmoPaymentContext(client);\n })\n .then(function () {\n self._tokenizationInProgress = false;\n\n return Promise.reject(err);\n });\n });\n};\n\n/**\n * Cancels the venmo tokenization process\n *\n * @public\n * @function Venmo~cancelTokenization\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n * @example\n * venmoTokenizeButton.addEventListener('click', function () {\n * venmoInstance.tokenize().then(function (payload) {\n * // handle payload\n * }).catch(function (err) {\n * if (err.code === 'VENMO_TOKENIZATION_CANCELED_BY_MERCHANT') {\n * // tokenization was canceled by calling cancelTokenization\n * }\n * });\n * });\n *\n * venmoCancelButton.addEventListener('click', function () {\n * // Hide the button when the venmo flow is not in progress\n * venmoCancelButton.style.display = \"none\";\n *\n * venmoInstance.cancelTokenization().then(function () {\n * // done canceling the flow\n * }).catch(function (err) {\n * // should only get here if there is no tokenization in progress\n * });\n * });\n */\nVenmo.prototype.cancelTokenization = function () {\n if (!this._tokenizationInProgress) {\n return Promise.reject(\n new BraintreeError(errors.VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE)\n );\n }\n\n this._removeVisibilityEventListener();\n\n // important to reject the tokenization promise first\n // so the tokenize method rejects with this error\n // rather than a customer canceled error in the mobile\n // polling and desktop flows\n if (this._tokenizePromise) {\n this._tokenizePromise.reject(\n new BraintreeError(errors.VENMO_TOKENIZATION_CANCELED_BY_MERCHANT)\n );\n }\n\n return Promise.all([\n this._cancelMobilePaymentContext(),\n this._cancelVenmoDesktopContext(),\n ]);\n};\n\nVenmo.prototype._tokenizeWebLoginWithRedirect = function () {\n var self = this;\n\n analytics.sendEvent(self._createPromise, \"venmo.tokenize.web-login.start\");\n this._tokenizePromise = new ExtendedPromise();\n\n return this.getUrl().then(function (url) {\n desktopWebLogin\n .runWebLogin({\n checkForStatusChange:\n self._checkPaymentContextStatusAndProcessResult.bind(self),\n cancelTokenization: self.cancelTokenization.bind(self),\n frameServiceInstance: self._frameServiceInstance,\n venmoUrl: url,\n debug: self._isDebug,\n checkPaymentContextStatus: self._checkPaymentContextStatus.bind(self),\n })\n .then(function (payload) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.web-login.success\"\n );\n\n self._tokenizePromise.resolve({\n paymentMethodNonce: payload.paymentMethodId,\n username: payload.userName,\n payerInfo: payload.payerInfo,\n id: self._venmoPaymentContextId,\n });\n })\n .catch(function (err) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.web-login.failure\"\n );\n\n self._tokenizePromise.reject(err);\n });\n\n return self._tokenizePromise;\n });\n};\n\nVenmo.prototype._queryPaymentContextStatus = function (id) {\n var self = this;\n\n return this._createPromise\n .then(function (client) {\n var query = self._shouldUseLegacyFlow\n ? graphqlQueries.LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY\n : graphqlQueries.VENMO_PAYMENT_CONTEXT_STATUS_QUERY;\n\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: query,\n variables: {\n id: id,\n },\n },\n });\n })\n .then(function (response) {\n return response.data.node;\n });\n};\n\n/**\n * Queries the GraphQL API to get the payment context and process the status. Retries until there is an update to the payment context status.\n * @name Venmo~checkPaymentContextStatusAndProcessResult\n * @ignore\n * @param {number} retryCount The counter for tracking number of retries made against the API.\n * @returns {Promise} Returns a promise\n */\nVenmo.prototype._checkPaymentContextStatusAndProcessResult = function (\n retryCount\n) {\n var self = this;\n\n return self._checkPaymentContextStatus().then(function (node) {\n var resultStatus = node.status;\n\n if (resultStatus !== self._venmoPaymentContextStatus) {\n self._venmoPaymentContextStatus = resultStatus;\n\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.web-login.status-change\"\n );\n\n switch (resultStatus) {\n case \"APPROVED\":\n return Promise.resolve(node);\n case \"CANCELED\":\n return Promise.reject(\n new BraintreeError(errors.VENMO_CUSTOMER_CANCELED)\n );\n case \"FAILED\":\n return Promise.reject(\n new BraintreeError(errors.VENMO_TOKENIZATION_FAILED)\n );\n default:\n }\n }\n\n return new Promise(function (resolve, reject) {\n if (retryCount < self._maxRetryCount) {\n retryCount++;\n\n return self\n ._checkPaymentContextStatusAndProcessResult(retryCount)\n .then(resolve)\n .catch(reject);\n }\n\n return reject(new BraintreeError(errors.VENMO_TOKENIZATION_FAILED));\n });\n });\n};\n\nVenmo.prototype._checkPaymentContextStatus = function () {\n var self = this;\n\n return self\n ._queryPaymentContextStatus(self._venmoPaymentContextId)\n .catch(function (networkError) {\n return Promise.reject(\n new BraintreeError({\n type: errors.VENMO_NETWORK_ERROR.type,\n code: errors.VENMO_NETWORK_ERROR.code,\n message: errors.VENMO_NETWORK_ERROR.message,\n details: networkError,\n })\n );\n })\n .then(function (node) {\n return Promise.resolve(node);\n });\n};\n\nVenmo.prototype._pollForStatusChange = function () {\n var self = this;\n\n if (Date.now() > self._mobilePollingContextExpiresIn) {\n return Promise.reject(\n new BraintreeError(errors.VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT)\n );\n }\n\n return this._queryPaymentContextStatus(this._venmoPaymentContextId)\n .catch(function (networkError) {\n return Promise.reject(\n new BraintreeError({\n type: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.type,\n code: errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.code,\n message:\n errors.VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR.message,\n details: {\n originalError: networkError,\n },\n })\n );\n })\n .then(function (node) {\n var newStatus = node.status;\n\n if (newStatus !== self._venmoPaymentContextStatus) {\n self._venmoPaymentContextStatus = newStatus;\n\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.manual-return.status-change.\" +\n newStatus.toLowerCase()\n );\n\n switch (newStatus) {\n case \"EXPIRED\":\n case \"FAILED\":\n case \"CANCELED\":\n return Promise.reject(\n new BraintreeError(\n errors[\"VENMO_MOBILE_POLLING_TOKENIZATION_\" + newStatus]\n )\n );\n case \"APPROVED\":\n return Promise.resolve(node);\n case \"CREATED\":\n case \"SCANNED\":\n default:\n // any other statuses are irrelevant to the polling\n // and can just be ignored\n }\n }\n\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n self._pollForStatusChange().then(resolve).catch(reject);\n }, self._mobilePollingInterval);\n });\n });\n};\n\nVenmo.prototype._tokenizeForMobileWithManualReturn = function () {\n var self = this;\n\n analytics.sendEvent(\n this._createPromise,\n \"venmo.tokenize.manual-return.start\"\n );\n\n this._mobilePollingContextExpiresIn =\n Date.now() + this._mobilePollingExpiresThreshold;\n this._tokenizePromise = new ExtendedPromise();\n\n this._pollForStatusChange()\n .then(function (payload) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.manual-return.success\"\n );\n\n self._tokenizePromise.resolve({\n paymentMethodNonce: payload.paymentMethodId,\n username: payload.userName,\n payerInfo: payload.payerInfo,\n id: self._venmoPaymentContextId,\n });\n })\n .catch(function (err) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.manual-return.failure\"\n );\n\n self._tokenizePromise.reject(err);\n });\n\n return this.getUrl().then(function (url) {\n self.appSwitch(url);\n\n return self._tokenizePromise;\n });\n};\n\nVenmo.prototype._shouldUseRedirectStrategy = function () {\n if (!browserDetection.isIos()) {\n return false;\n }\n\n if (this._mobileWebFallBack === true) {\n return true;\n }\n\n return this._useRedirectForIOS;\n};\n\nVenmo.prototype._tokenizeForMobileWithHashChangeListeners = function (options) {\n var self = this;\n var resultProcessingInProgress, visibilityChangeListenerTimeout;\n\n if (this.hasTokenizationResult()) {\n return this.processHashChangeFlowResults();\n }\n\n analytics.sendEvent(this._createPromise, \"venmo.tokenize.mobile.start\");\n this._tokenizePromise = new ExtendedPromise();\n\n this._previousHash = window.location.hash;\n\n function completeFlow(hash) {\n var error;\n\n self\n .processHashChangeFlowResults(hash)\n .catch(function (err) {\n error = err;\n })\n .then(function (res) {\n if (\n !self._ignoreHistoryChanges &&\n window.location.hash !== self._previousHash\n ) {\n window.location.hash = self._previousHash;\n }\n self._removeVisibilityEventListener();\n\n if (error) {\n self._tokenizePromise.reject(error);\n } else {\n self._tokenizePromise.resolve(res);\n }\n delete self._tokenizePromise;\n });\n }\n\n // The Venmo SDK app switches back with the results of the\n // tokenization encoded in the hash\n this._onHashChangeListener = function (e) {\n var hash = e.newURL.split(\"#\")[1];\n\n if (!self._hasTokenizationResult(hash)) {\n return;\n }\n\n resultProcessingInProgress = true;\n clearTimeout(visibilityChangeListenerTimeout);\n completeFlow(hash);\n };\n\n window.addEventListener(\"hashchange\", this._onHashChangeListener, false);\n\n // Subscribe to document visibility change events to detect when app switch\n // has returned. Acts as a fallback for the hashchange listener and catches\n // the cancel case via manual app switch back\n this._visibilityChangeListener = function () {\n var delay =\n options.processResultsDelay || constants.DEFAULT_PROCESS_RESULTS_DELAY;\n\n if (!window.document.hidden) {\n if (!resultProcessingInProgress) {\n visibilityChangeListenerTimeout = setTimeout(completeFlow, delay);\n }\n }\n };\n\n return this.getUrl().then(function (url) {\n self.appSwitch(url);\n\n // Add a brief delay to ignore visibility change events that occur right before app switch\n setTimeout(function () {\n window.document.addEventListener(\n documentVisibilityChangeEventName(),\n self._visibilityChangeListener\n );\n }, constants.DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY);\n\n return self._tokenizePromise;\n });\n};\n\nVenmo.prototype._tokenizeForDesktopQRFlow = function () {\n var self = this;\n\n analytics.sendEvent(this._createPromise, \"venmo.tokenize.desktop.start\");\n\n this._tokenizePromise = new ExtendedPromise();\n\n this._createPromise\n .then(function () {\n return self._venmoDesktopInstance.launchDesktopFlow();\n })\n .then(function (payload) {\n self._venmoDesktopInstance.hideDesktopFlow();\n\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.desktop.success\"\n );\n\n self._tokenizePromise.resolve(payload);\n })\n .catch(function (err) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.tokenize.desktop.failure\"\n );\n\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.hideDesktopFlow();\n }\n\n if (err && err.reason === \"CUSTOMER_CANCELED\") {\n self._tokenizePromise.reject(\n new BraintreeError(errors.VENMO_DESKTOP_CANCELED)\n );\n\n return;\n }\n\n self._tokenizePromise.reject(\n new BraintreeError({\n type: errors.VENMO_DESKTOP_UNKNOWN_ERROR.type,\n code: errors.VENMO_DESKTOP_UNKNOWN_ERROR.code,\n message: errors.VENMO_DESKTOP_UNKNOWN_ERROR.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n\n return this._tokenizePromise;\n};\n\nVenmo.prototype._cancelMobilePaymentContext = function () {\n var self = this;\n\n return this._createPromise.then(function (client) {\n var query;\n\n if (self._venmoPaymentContextId) {\n query = self._shouldUseLegacyFlow\n ? graphqlQueries.LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY\n : graphqlQueries.UPDATE_PAYMENT_CONTEXT_QUERY;\n\n return client.request({\n api: \"graphQLApi\",\n data: {\n query: query,\n variables: {\n input: {\n id: self._venmoPaymentContextId,\n status: \"CANCELED\",\n },\n },\n },\n });\n }\n\n return Promise.resolve();\n });\n};\n\nVenmo.prototype._cancelVenmoDesktopContext = function () {\n var self = this;\n\n return this._createPromise.then(function () {\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.updateVenmoDesktopPaymentContext(\"CANCELED\");\n }\n\n return Promise.resolve();\n });\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/venmo.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * venmoInstance.teardown();\n * @example <caption>With callback</caption>\n * venmoInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nVenmo.prototype.teardown = function () {\n var self = this;\n\n this._removeVisibilityEventListener();\n\n return this._createPromise.then(\n function () {\n if (self._venmoDesktopInstance) {\n self._venmoDesktopInstance.teardown();\n }\n\n clearTimeout(self._refreshPaymentContextTimeout);\n self._cancelMobilePaymentContext();\n\n convertMethodsToError(this, methods(Venmo.prototype));\n }.bind(this)\n );\n};\n\nVenmo.prototype._removeVisibilityEventListener = function () {\n window.removeEventListener(\"hashchange\", this._onHashChangeListener);\n window.document.removeEventListener(\n documentVisibilityChangeEventName(),\n this._visibilityChangeListener\n );\n\n delete this._visibilityChangeListener;\n delete this._onHashChangeListener;\n};\n\n/**\n * The hash parameter in this function is optional. If no hash parameter is passed, the `getFragmentParameters` function will default to the hash present in the website's URL instead.\n *\n * There are two scenarios where this method is called:\n *\n * 1. When called within a browser that is capable of returning to the same tab that started the Venmo flow, we set up a listener to detect hash changes in the url. Part of the return to the merchant's website from the Venmo app includes encoding the details of the purchase in the hash of the url. The callback is invoked and the hash is pulled off from the event payload. The reason we pull the hash off of the event payload instead of pulling it directly from the URL is because sometimes a single page app will use the hash parameter for it's routing system, and it's possible to hit a race condition where the routing code has already removed the Venmo specific attributes from the hash before we are able to pull it off the url. Grabbing the hash from the event handler instead ensures we get the Venmo details, no matter what the url is converted to.\n * 2. The other scenario is for browsers that cannot return to the same tab, and instead the Venmo app must open a new tab. Since there is no hash listener to pull the hash from, we pull the hash details directly from the url using the `getFragmentParameters` method.\n *\n * @ignore\n * @param {string} [hash] Optionally provided browser url hash.\n * @returns {Promise} Returns a promise\n */\nVenmo.prototype.processHashChangeFlowResults = function (hash) {\n var self = this;\n var params = getFragmentParameters(hash);\n\n // NEXT_MAJOR_VERSION only rely on payment context status call and stop relying on the\n // content of the hash\n\n return new Promise(function (resolve, reject) {\n if (!self._shouldUseLegacyFlow) {\n self\n ._pollForStatusChange()\n .then(function (payload) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.appswitch.handle.payment-context-status-query.success\"\n );\n\n return resolve({\n paymentMethodNonce: payload.paymentMethodId,\n username: payload.userName,\n payerInfo: payload.payerInfo,\n id: self._venmoPaymentContextId,\n });\n })\n .catch(function (err) {\n if (\n err.type === errors.VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED.type\n ) {\n // We want to reject in this case because if it the process was canceled, we don't want to take the happy path\n reject(err);\n }\n\n analytics.sendEvent(\n self._createPromise,\n \"venmo.process-results.payment-context-status-query-failed\"\n );\n // If the polling request fails, but not because of cancelization, we will rely on the params provided from the hash\n resolve(params);\n });\n } else if (params.venmoSuccess) {\n analytics.sendEvent(\n self._createPromise,\n \"venmo.appswitch.handle.success\"\n );\n\n resolve(params);\n } else if (params.venmoError) {\n analytics.sendEvent(self._createPromise, \"venmo.appswitch.handle.error\");\n reject(\n new BraintreeError({\n type: errors.VENMO_APP_FAILED.type,\n code: errors.VENMO_APP_FAILED.code,\n message: errors.VENMO_APP_FAILED.message,\n details: {\n originalError: {\n message: decodeURIComponent(params.errorMessage),\n code: params.errorCode,\n },\n },\n })\n );\n } else if (params.venmoCancel) {\n analytics.sendEvent(self._createPromise, \"venmo.appswitch.handle.cancel\");\n reject(new BraintreeError(errors.VENMO_APP_CANCELED));\n } else {\n // User has either manually switched back to browser, or app is not available for app switch\n analytics.sendEvent(\n self._createPromise,\n \"venmo.appswitch.cancel-or-unavailable\"\n );\n reject(new BraintreeError(errors.VENMO_CANCELED));\n }\n\n self._clearFragmentParameters();\n });\n};\n\nVenmo.prototype._clearFragmentParameters = function () {\n if (this._ignoreHistoryChanges) {\n return;\n }\n\n if (\n typeof window.history.replaceState === \"function\" &&\n window.location.hash\n ) {\n history.pushState(\n {},\n \"\",\n window.location.href.slice(0, window.location.href.indexOf(\"#\"))\n );\n }\n};\n\nfunction getFragmentParameters(hash) {\n var keyValuesArray = (hash || window.location.hash.substring(1)).split(\"&\");\n\n var parsedParams = keyValuesArray.reduce(function (toReturn, keyValue) {\n var parts = keyValue.split(\"=\");\n // some Single Page Apps may pre-pend a / to the first value\n // in the hash, assuming it's a route in their app\n // instead of information from Venmo, this removes all\n // non-alphanumeric characters from the keys in the params\n var decodedKey = decodeURIComponent(parts[0]).replace(/\\W/g, \"\");\n var key = snakeCaseToCamelCase(decodedKey);\n var value = decodeURIComponent(parts[1]);\n\n toReturn[key] = value;\n\n return toReturn;\n }, {});\n\n if (parsedParams.resourceId) {\n parsedParams.id = parsedParams.resourceId;\n }\n\n return parsedParams;\n}\n\nfunction formatUserName(username) {\n username = username || \"\";\n\n // NEXT_MAJOR_VERSION the web sdks have a prepended @ sign\n // but the ios and android ones do not. This should be standardized\n return \"@\" + username.replace(\"@\", \"\");\n}\n\nfunction formatTokenizePayload(payload) {\n var formattedPayload = {\n nonce: payload.paymentMethodNonce,\n type: \"VenmoAccount\",\n details: {\n username: formatUserName(payload.username),\n paymentContextId: payload.id,\n },\n };\n\n if (payload.payerInfo) {\n formattedPayload.details.payerInfo = payload.payerInfo;\n formattedPayload.details.payerInfo.userName = formatUserName(\n payload.payerInfo.userName\n );\n }\n\n return formattedPayload;\n}\n\n// From https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API\nfunction documentVisibilityChangeEventName() {\n var visibilityChange;\n\n if (typeof window.document.hidden !== \"undefined\") {\n // Opera 12.10 and Firefox 18 and later support\n visibilityChange = \"visibilitychange\";\n } else if (typeof window.document.msHidden !== \"undefined\") {\n visibilityChange = \"msvisibilitychange\";\n } else if (typeof window.document.webkitHidden !== \"undefined\") {\n visibilityChange = \"webkitvisibilitychange\";\n }\n\n return visibilityChange;\n}\n\nfunction isIosWebviewInDeepLinkReturnUrlFlow() {\n // we know it's a webview because this flow only gets\n // used when checking the deep link flow\n // test the platform here to get around custom useragents\n return (\n window.navigator.platform &&\n /iPhone|iPad|iPod/.test(window.navigator.platform)\n );\n}\n\nmodule.exports = wrapPromise.wrapPrototype(Venmo);\n\n},{\"../lib/analytics\":119,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/in-iframe\":150,\"../lib/is-verified-domain\":153,\"../lib/methods\":155,\"../lib/querystring\":157,\"../lib/snake-case-to-camel-case\":159,\"./external/\":213,\"./external/queries\":214,\"./shared/browser-detection\":217,\"./shared/constants\":218,\"./shared/errors\":219,\"./shared/get-venmo-url\":221,\"./shared/supports-venmo\":222,\"./shared/web-login-backdrop\":223,\"@braintree/extended-promise\":34,\"@braintree/wrap-promise\":43}],225:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @name BraintreeError.Visa Checkout - Creation Error Codes\n * @description Errors that occur when [creating the Visa Checkout component](./module-braintree-web_venmo.html#.create).\n * @property {MERCHANT} VISA_CHECKOUT_NOT_ENABLED Occurs when Visa Checkout is not enabled in the Braintree control panel.\n */\n\n/**\n * @name BraintreeError.Visa Checkout - createInitOptions Error Codes\n * @description Errors that occur when using the [`createInitOptions` method](./VisaCheckout.html#createInitOptions).\n * @property {MERCHANT} VISA_CHECKOUT_INIT_OPTIONS_REQUIRED Occurs when no options are provided to method.\n */\n\n/**\n * @name BraintreeError.Visa Checkout - tokenize Error Codes\n * @description Errors that occur when using the [`tokenize` method](./VisaCheckout.html#tokenize).\n * @property {MERCHANT} VISA_CHECKOUT_PAYMENT_REQUIRED Occurs when no payment data is not provided.\n * @property {NETWORK} VISA_CHECKOUT_TOKENIZATION Occurs when tokenization fails.\n */\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\n\nmodule.exports = {\n VISA_CHECKOUT_NOT_ENABLED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VISA_CHECKOUT_NOT_ENABLED\",\n message: \"Visa Checkout is not enabled for this merchant.\",\n },\n VISA_CHECKOUT_INIT_OPTIONS_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VISA_CHECKOUT_INIT_OPTIONS_REQUIRED\",\n message: \"initOptions requires an object.\",\n },\n VISA_CHECKOUT_PAYMENT_REQUIRED: {\n type: BraintreeError.types.MERCHANT,\n code: \"VISA_CHECKOUT_PAYMENT_REQUIRED\",\n message: \"tokenize requires callid, encKey, and encPaymentData.\",\n },\n VISA_CHECKOUT_TOKENIZATION: {\n type: BraintreeError.types.NETWORK,\n code: \"VISA_CHECKOUT_TOKENIZATION\",\n message:\n \"A network error occurred when processing the Visa Checkout payment.\",\n },\n};\n\n},{\"../lib/braintree-error\":124}],226:[function(_dereq_,module,exports){\n\"use strict\";\n\n/**\n * @module braintree-web/visa-checkout\n * @description Processes Visa Checkout. *This component is currently in beta and is subject to change.*\n */\n\nvar basicComponentVerification = _dereq_(\"../lib/basic-component-verification\");\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar createDeferredClient = _dereq_(\"../lib/create-deferred-client\");\nvar createAssetsUrl = _dereq_(\"../lib/create-assets-url\");\nvar VisaCheckout = _dereq_(\"./visa-checkout\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar errors = _dereq_(\"./errors\");\nvar VERSION = \"3.100.0\";\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\n\n/**\n * @static\n * @function create\n * @param {object} options Creation options:\n * @param {Client} [options.client] A {@link Client} instance.\n * @param {string} [options.authorization] A tokenizationKey or clientToken. Can be used in place of `options.client`.\n * @param {callback} [callback] The second argument, `data`, is the {@link VisaCheckout} instance. If no callback is provided, `create` returns a promise that resolves with the {@link VisaCheckout} instance.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nfunction create(options) {\n var name = \"Visa Checkout\";\n\n return basicComponentVerification\n .verify({\n name: name,\n client: options.client,\n authorization: options.authorization,\n })\n .then(function () {\n return createDeferredClient.create({\n authorization: options.authorization,\n client: options.client,\n debug: options.debug,\n assetsUrl: createAssetsUrl.create(options.authorization),\n name: name,\n });\n })\n .then(function (client) {\n options.client = client;\n\n if (\n !options.client.getConfiguration().gatewayConfiguration.visaCheckout\n ) {\n return Promise.reject(\n new BraintreeError(errors.VISA_CHECKOUT_NOT_ENABLED)\n );\n }\n\n analytics.sendEvent(options.client, \"visacheckout.initialized\");\n\n return new VisaCheckout(options);\n });\n}\n\nmodule.exports = {\n create: wrapPromise(create),\n /**\n * @description The current version of the SDK, i.e. `{@pkg version}`.\n * @type {string}\n */\n VERSION: VERSION,\n};\n\n},{\"../lib/analytics\":119,\"../lib/basic-component-verification\":122,\"../lib/braintree-error\":124,\"../lib/create-assets-url\":129,\"../lib/create-deferred-client\":131,\"./errors\":225,\"./visa-checkout\":227,\"@braintree/wrap-promise\":43}],227:[function(_dereq_,module,exports){\n\"use strict\";\n\nvar BraintreeError = _dereq_(\"../lib/braintree-error\");\nvar analytics = _dereq_(\"../lib/analytics\");\nvar errors = _dereq_(\"./errors\");\nvar jsonClone = _dereq_(\"../lib/json-clone\");\nvar methods = _dereq_(\"../lib/methods\");\nvar convertMethodsToError = _dereq_(\"../lib/convert-methods-to-error\");\nvar wrapPromise = _dereq_(\"@braintree/wrap-promise\");\nvar cardTypeTransformMap = {\n Visa: \"VISA\",\n MasterCard: \"MASTERCARD\",\n Discover: \"DISCOVER\",\n \"American Express\": \"AMEX\",\n};\n\n/**\n * Visa Checkout Address object.\n * @typedef {object} VisaCheckout~Address\n * @property {string} countryCode The customer's country code.\n * @property {string} extendedAddress The customer's extended address.\n * @property {string} firstName The customer's first name.\n * @property {string} lastName The customer's last name.\n * @property {string} locality The customer's locality.\n * @property {string} postalCode The customer's postal code.\n * @property {string} region The customer's region.\n * @property {string} streetAddress The customer's street address.\n * @property {string} phoneNumber The customer's phone number.\n */\n\n/**\n * Visa Checkout UserData object.\n * @typedef {object} VisaCheckout~UserData\n * @property {string} userEmail The customer's email address.\n * @property {string} userFirstName The customer's first name.\n * @property {string} userLastName The customer's last name.\n * @property {string} userFullName The customer's full name.\n * @property {string} userName The customer's username.\n */\n\n/**\n * Visa Checkout tokenize payload.\n * @typedef {object} VisaCheckout~tokenizePayload\n * @property {string} nonce The payment method nonce.\n * @property {object} details Additional account details.\n * @property {string} details.cardType Type of card, ex: Visa, MasterCard.\n * @property {string} details.lastFour Last four digits of card number.\n * @property {string} details.lastTwo Last two digits of card number.\n * @property {string} description A human-readable description.\n * @property {string} type The payment method type, always `VisaCheckoutCard`.\n * @property {VisaCheckout~Address} billingAddress The customer's billing address.\n * @property {VisaCheckout~Address} shippingAddress The customer's shipping address.\n * @property {VisaCheckout~UserData} userData Information about the customer.\n * @property {object} binData Information about the card based on the bin.\n * @property {string} binData.commercial Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.countryOfIssuance The country of issuance.\n * @property {string} binData.debit Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.durbinRegulated Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.healthcare Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.issuingBank The issuing bank.\n * @property {string} binData.payroll Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.prepaid Possible values: 'Yes', 'No', 'Unknown'.\n * @property {string} binData.productId The product id.\n */\n\n/**\n * @class\n * @param {object} options The Visa Checkout {@link module:braintree-web/visa-checkout.create create} options.\n * @description <strong>Do not use this constructor directly. Use {@link module:braintree-web/visa-checkout.create|braintree-web.visa-checkout.create} instead.</strong>\n * @classdesc This class represents a Visa Checkout component produced by {@link module:braintree-web/visa-checkout.create|braintree-web/visa-checkout.create}. Instances of this class have methods for interacting with Visa Checkout's JavaScript library.\n */\nfunction VisaCheckout(options) {\n this._client = options.client;\n}\n\nfunction transformCardTypes(cardTypes) {\n return cardTypes.reduce(function (acc, type) {\n if (cardTypeTransformMap.hasOwnProperty(type)) {\n return acc.concat(cardTypeTransformMap[type]);\n }\n\n return acc;\n }, []);\n}\n\n/**\n * Creates an `initOptions` object from the passed `options`, applying properties that Braintree needs to transact Visa Checkout.\n *\n * Braintree will apply these properties if they do not exist on the given `options`:\n * - `apikey`\n * - `externalClientId`\n * - `settings.payment.cardBrands`\n *\n * Braintree will overwrite `settings.dataLevel = 'FULL'` to access the full payment method.\n * @public\n * @param {object} options The base `initOptions` that will be used to init Visa Checkout.\n * @param {string} [options.apikey] The API key used to initialize Visa Checkout. When not supplied, Braintree will set this property.\n * @param {string} [options.externalClientId] The external client ID key used to initialize Visa Checkout. When not supplied, Braintree will set this property.\n * @param {object} [options.settings] The settings object used to initialize Visa Checkout.\n * @param {string} [options.settings.dataLevel] The data level used to initialize Visa Checkout. Braintree will overwrite this property to 'FULL'.\n * @param {object} [options.settings.payment] The payment object used to initialize Visa Checkout.\n * @param {string[]} [options.settings.payment.cardBrands] The card brands that Visa Checkout will allow the customer to pay with. When not supplied, Braintree will set this property.\n * @returns {object} `initOptions` The `initOptions` that Visa Checkout should be initialized with.\n */\nVisaCheckout.prototype.createInitOptions = function (options) {\n var initOptions;\n var gatewayConfiguration =\n this._client.getConfiguration().gatewayConfiguration;\n var visaCheckoutConfiguration = gatewayConfiguration.visaCheckout;\n\n if (!options) {\n throw new BraintreeError(errors.VISA_CHECKOUT_INIT_OPTIONS_REQUIRED);\n }\n\n initOptions = jsonClone(options);\n initOptions.apikey = initOptions.apikey || visaCheckoutConfiguration.apikey;\n initOptions.encryptionKey = visaCheckoutConfiguration.encryptionKey;\n initOptions.externalClientId =\n initOptions.externalClientId || visaCheckoutConfiguration.externalClientId;\n initOptions.settings = initOptions.settings || {};\n initOptions.settings.dataLevel = \"FULL\";\n initOptions.settings.payment = initOptions.settings.payment || {};\n\n if (!initOptions.settings.payment.cardBrands) {\n initOptions.settings.payment.cardBrands = transformCardTypes(\n gatewayConfiguration.visaCheckout.supportedCardTypes\n );\n }\n\n return initOptions;\n};\n\n/**\n * Tokenizes the Visa Checkout payload, returning a payment method nonce.\n * @public\n * @param {object} payment The object that Visa Checkout supplies on `payment.success`.\n * @param {string} payment.callid Visa Checkout transaction ID associated with this payment.\n * @param {string} payment.encKey The encrypted key used to decrypt the payment data.\n * @param {string} payment.encPaymentData The encrypted payment data.\n * @param {callback} [callback] The second argument, <code>tokenizePayload</code> is a {@link VisaCheckout~tokenizePayload|tokenizePayload}. If no callback is provided, `tokenize` returns a promise that resolves with the {@link VisaCheckout~tokenizePayload|tokenizePayload}.\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nVisaCheckout.prototype.tokenize = function (payment) {\n var self = this;\n\n if (!payment.callid || !payment.encKey || !payment.encPaymentData) {\n return Promise.reject(\n new BraintreeError(errors.VISA_CHECKOUT_PAYMENT_REQUIRED)\n );\n }\n\n return this._client\n .request({\n method: \"post\",\n endpoint: \"payment_methods/visa_checkout_cards\",\n data: {\n _meta: {\n source: \"visa-checkout\",\n },\n visaCheckoutCard: {\n callId: payment.callid,\n encryptedPaymentData: payment.encPaymentData,\n encryptedKey: payment.encKey,\n },\n },\n })\n .then(function (response) {\n analytics.sendEvent(self._client, \"visacheckout.tokenize.succeeded\");\n\n return response.visaCheckoutCards[0];\n })\n .catch(function (err) {\n analytics.sendEvent(self._client, \"visacheckout.tokenize.failed\");\n\n return Promise.reject(\n new BraintreeError({\n type: errors.VISA_CHECKOUT_TOKENIZATION.type,\n code: errors.VISA_CHECKOUT_TOKENIZATION.code,\n message: errors.VISA_CHECKOUT_TOKENIZATION.message,\n details: {\n originalError: err,\n },\n })\n );\n });\n};\n\n/**\n * Cleanly tear down anything set up by {@link module:braintree-web/visa-checkout.create|create}.\n * @public\n * @param {callback} [callback] Called once teardown is complete. No data is returned if teardown completes successfully.\n * @example\n * visaCheckoutInstance.teardown();\n * @example <caption>With callback</caption>\n * visaCheckoutInstance.teardown(function () {\n * // teardown is complete\n * });\n * @returns {(Promise|void)} Returns a promise if no callback is provided.\n */\nVisaCheckout.prototype.teardown = function () {\n convertMethodsToError(this, methods(VisaCheckout.prototype));\n\n return Promise.resolve();\n};\n\nmodule.exports = wrapPromise.wrapPrototype(VisaCheckout);\n\n},{\"../lib/analytics\":119,\"../lib/braintree-error\":124,\"../lib/convert-methods-to-error\":127,\"../lib/json-clone\":154,\"../lib/methods\":155,\"./errors\":225,\"@braintree/wrap-promise\":43}]},{},[117])(117)\n});\n"],"names":["module","exports","r","e","n","t","o","i","f","u","a","Error","code","p","call","length","_dereq_","__importDefault","this","mod","__esModule","Object","defineProperty","value","PromiseGlobal","promise_polyfill_1","Promise","default","promise_1","scriptPromiseCache","loadScript","options","scriptLoadPromise","stringifiedOptions","JSON","stringify","forceScriptReload","script","document","createElement","attrs","dataAttributes","container","head","src","id","async","crossorigin","setAttribute","keys","forEach","key","resolve","reject","addEventListener","appendChild","clearCache","ua","window","navigator","userAgent","test","isEdge","isSamsung","isDuckDuckGo","isOpera","isSilk","indexOf","isIos","isGoogleSearchApp","isIosFirefox","webkitRegexp","isWebkit","isIosChrome","isFacebook","isIosGoogleSearchApp","isIosWebview","statusBarVisible","statusbar","visible","isIpadOS","checkIpadOS","iOsTest","isAndroid","isChrome","isSamsungBrowser","isOperaMini","isAndroidWebview","match","parseInt","isUnsupportedIosChrome","isOldSamsungBrowserOrSamsungWebview","EventEmitter","_events","prototype","on","event","callback","push","off","eventCallbacks","indexOfCallback","splice","_emit","args","_i","arguments","apply","hasListener","createChild","ChildObject","create","constructor","GlobalPromise","ExtendedPromise","_this","_promise","_resolveFunction","_rejectFunction","_onResolve","onResolve","defaultOnResolve","_onReject","onReject","defaultOnReject","shouldCatchExceptions","catch","_resetState","result","err","setPromise","PromiseClass","hasOwnProperty","Boolean","suppressUnhandledPromiseMessage","all","allSettled","race","arg","then","_a","isFulfilled","_setResolved","argForResolveFunction","_setRejected","isResolved","isRejected","set_attributes_1","default_attributes_1","assign_1","iframe","config","assign","defaultAttributes","style","setAttributes","getAttribute","name","target","objs","obj","frameBorder","allowtransparency","scrolling","element","attributes","removeAttribute","replace","c","Math","random","toString","deferred","fn","setTimeout","console","log","once","called","promiseOrCallback","promise","data","deferred_1","once_1","promise_or_callback_1","wrapPromise","pop","wrapPrototype","ignoreMethods","includePrivateMethods","transformPrivateMethods","getOwnPropertyNames","filter","method","isNotPrivateMethod","isNonConstructorFunction","isNotAnIgnoredMethod","charAt","original","__assign","s","cardTypes","add_matching_cards_to_results_1","is_valid_input_type_1","find_best_match_1","clone_1","customCards","cardNames","VISA","MASTERCARD","AMERICAN_EXPRESS","DINERS_CLUB","DISCOVER","JCB","UNIONPAY","MAESTRO","ELO","MIR","HIPER","HIPERCARD","ORIGINAL_TEST_ORDER","testOrder","clone","findType","cardType","getCardPosition","ignoreErrorForNotExisting","position","creditCardType","cardNumber","results","isValidInputType","map","cardConfiguration","addMatchingCardsToResults","bestMatch","findBestMatch","getTypeInfo","removeCard","addCard","existingCardPosition","type","updateCard","updates","originalObject","clonedCard","changeOrder","currentPosition","resetModifications","types","matches_1","patternLength","patterns","pattern","matches","clonedCardConfiguration","Array","isArray","String","matchStrength","visa","niceType","gaps","lengths","size","mastercard","discover","jcb","unionpay","maestro","elo","mir","hiper","hipercard","parse","numberOfResultsWithMaxStrengthProperty","hasEnoughResultsToDetermineBestMatch","reduce","Number","min","max","maxLengthToCheck","substr","integerRepresentationOfCardNumber","matchesRange","substring","matchesPattern","Framebus","lib_1","DefaultPromise","origin","channel","verifyDomain","targetFrames","limitBroadcastToFramesArray","isDestroyed","listeners","hasAdditionalChecksForOnListeners","addTargetFrame","frame","include","childWindow","Window","childWindows","emit","eventName","reply","namespaceEvent","isntString","undefined","payload","packagePayload","targetFramesAsWindows","sendMessage","broadcast","top","self","emitAsPromise","concat","originalHandler","handler","subscriptionArgsInvalid","passesVerifyDomainCheck","hasMatchingTargetFrame","source","subscribers","listener","subscriberList","teardown","checkOrigin","HTMLIFrameElement","contentWindow","win","matchingFrame","find","postMessageOrigin","merchantHost","href","location","protocol","host","framebus_1","attach","detach","_1","isAttached","onMessage","removeEventListener","broadcastToChildWindows","closed","frameToBroadcastTo","postMessage","hasOpener","opener","frames","_","prefix","dispatch","__createBinding","m","k","k2","desc","getOwnPropertyDescriptor","writable","configurable","enumerable","get","__exportStar","str","unpackPayload","eventData","packaged","subscribeReplier","message","error","uuid_1","uuid","replier","replyOriginHandler","slice","replyOrigin_1","replySource_1","replyEvent_1","replyData","replyPayload","setTimeoutFunc","x","noop","TypeError","_state","_handled","_value","_deferreds","doResolve","handle","_immediateFn","cb","onFulfilled","onRejected","ret","newValue","finale","thisArg","_unhandledRejectionFn","len","Handler","done","reason","ex","prom","arr","remaining","res","val","status","setImmediate","warn","isIE9","isAndroidChrome","isKitKatWebview","UA","isChromeOs","KITKAT_WEBVIEW_REGEX","device_1","BraintreeError","errors","methods","convertMethodsToError","AmericanExpress","_client","client","getRewardsBalance","nonce","_meta","paymentMethodNonce","request","endpoint","AMEX_NETWORK_ERROR","details","originalError","AMEX_NONCE_REQUIRED","getExpressCheckoutProfile","MERCHANT","NETWORK","basicComponentVerification","createDeferredClient","createAssetsUrl","verify","authorization","debug","assetsUrl","VERSION","analytics","ApplePay","_instantiatedWithClient","useDeferredClient","_createPromise","createPromise","_setMerchantIdentifier","_waitForClient","bind","applePayConfig","getConfiguration","gatewayConfiguration","applePayWeb","merchantIdentifier","createPaymentRequest","paymentRequest","_createPaymentRequestSynchronously","applePay","defaults","countryCode","currencyCode","merchantCapabilities","supportedNetworks","network","performValidation","validationURL","applePayWebSession","validationUrl","domainName","hostname","displayName","response","sendEvent","APPLE_PAY_MERCHANT_VALIDATION_FAILED","APPLE_PAY_MERCHANT_VALIDATION_NETWORK","APPLE_PAY_VALIDATION_URL_REQUIRED","tokenize","token","applePaymentToken","paymentData","btoa","applePayCards","APPLE_PAY_TOKENIZATION","APPLE_PAY_PAYMENT_TOKEN_REQUIRED","APPLE_PAY_NOT_ENABLED","applePayInstance","BRAINTREE_VERSION","GraphQL","isVerifiedDomain","convertToBraintreeError","getGatewayConfiguration","createAuthorizationData","addMetadata","GRAPHQL_URLS","assets","FRAUDNET_FNCLS","FRAUDNET_SOURCE","FRAUDNET_URL","cachedClients","Client","configuration","configurationJSON","CLIENT_MISSING_GATEWAY_CONFIGURATION","property","CLIENT_GATEWAY_CONFIGURATION_INVALID_DOMAIN","_request","_configuration","_clientApiBaseUrl","clientApiUrl","graphQL","url","_graphQL","initialize","clientInstance","authData","CLIENT_INVALID_AUTHORIZATION","isDebug","_findOrCreateFraudnetJSON","clientMetadataId","additionalData","authorizationFingerprint","parameters","el","querySelector","body","rda_tenant","mid","merchantId","split","pieces","component","cid","fp","bu","text","requestPromise","optionName","api","baseUrl","requestOptions","shouldCollectData","creditCards","collectDeviceData","CLIENT_OPTION_REQUIRED","timeout","metadata","analyticsMetadata","CLIENT_OPTION_INVALID","environment","clientSdkMetadata","platform","integration","sessionId","version","headers","Authorization","sendAnalyticsEvent","kind","resolvedData","requestError","CLIENT_REQUEST_TIMEOUT","CLIENT_AUTHORIZATION_INVALID","CLIENT_AUTHORIZATION_INSUFFICIENT","CLIENT_RATE_LIMITED","CLIENT_GATEWAY_NETWORK","CLIENT_REQUEST_ERROR","httpStatus","formatRequestError","CLIENT_GRAPHQL_REQUEST_ERROR","_httpStatus","toJSON","getVersion","INTERNAL","constants","isDateStringBeforeOrOn","configUrl","reqOptions","merchantAppId","PLATFORM","sdkVersion","SOURCE","INTEGRATION","integrationType","braintreeLibraryVersion","BRAINTREE_LIBRARY_VERSION","configVersion","date","features","tokenizationKey","errorTemplate","authorizationType","sharedErrors","INSTANTIATION_OPTION_REQUIRED","querystring","prepBody","parseBody","xhr","isXHRAvailable","isAvailable","GraphQLRequest","DefaultRequest","MAX_TCP_RETRYCOUNT","TCP_PRECONNECT_BUG_STATUS_CODE","_requestWithRetry","tcpRetryCount","resBody","ajaxRequest","parsedBody","req","getRequestObject","isGraphQLRequest","getUrl","getBody","getMethod","getHeaders","queryify","onreadystatechange","readyState","responseText","adaptResponseBody","determineStatus","errorClass","extensions","graphQLRequestShouldRetryWithClientApi","requestShouldRetry","onload","onerror","onprogress","ontimeout","open","requestOpenError","headerKey","setRequestHeader","send","_url","_data","_method","_headers","errorResponseAdapter","cardTypeTransforms","creditCard","INTERNATIONAL_MAESTRO","SOLO","UK_MAESTRO","UNION_PAY","visaCheckout","googlePay","masterpass","DINERS","mapCardTypes","cardTypeTransformMap","acc","responseBody","ctx","clientConfiguration","toLowerCase","analyticsUrl","venmo","supportedFeatures","_config","feature","braintreeApi","supportedCardBrands","ideal","kount","kountMerchantId","challenges","challenge","supportedCardTypes","threeDSecureEnabled","threeDSecure","androidPay","enabled","googleAuthorizationFingerprint","googleAuthorization","paypalClientId","payWithVenmo","accessToken","enrichedCustomerDataEnabled","paypal","paypalEnabled","currencyIsoCode","unionPay","merchantAccountId","apikey","apiKey","encryptionKey","externalClientId","merchantCheckoutId","usBankAccount","routeId","plaid","publicKey","plaidPublicKey","adaptConfigurationResponseBody","CARD_BRAND_MAP","BIN_DATA_MAP","YES","NO","UNKNOWN","AUTHENTICATION_INSIGHT_MAP","PSDTWO","tokenizeCreditCard","lastTwo","last4","binData","consumed","description","cardholderName","expirationMonth","expirationYear","bin","brandCode","lastFour","threeDSecureInfo","authenticationInsight","regulationEnvironment","customerAuthenticationRegulationEnvironment","addFieldError","inputPath","errorDetail","fieldErrors","fieldError","legacyCode","inputField","candidate","field","getLegacyMessage","buildFieldErrors","userErrorResponseAdapter","errorWithClassResponseAdapter","query","operationName","createCreditCardTokenizationBody","cc","billingAddress","expDate","expirationDate","trim","variables","input","number","cvv","hasAuthenticationInsight","authenticationInsightInput","validate","addValidationRule","mutation","tokenize_credit_cards","disallowedInputPaths","getGraphQLEndpoint","featureEnabled","path","getClientApiPath","_isGraphQLEnabled","some","accumulator","containsDisallowedlistedKeys","pathParts","snakeCaseToCamelCase","creditCardTokenizationBodyGenerator","creditCardTokenizationResponseAdapter","configurationBodyGenerator","configurationResponseAdapter","generators","adapters","clientApiPath","_clientSdkMetadata","_sendAnalyticsEvent","Function","_generator","_adapter","formatBodyKeys","originalBody","camelCaseKey","formattedBody","generatedBody","parsedResponse","isGraphQLError","AJAXDriver","toUpperCase","XMLHttpRequest","XDomainRequest","DATA_COLLECTOR_KOUNT_NOT_ENABLED","DATA_COLLECTOR_KOUNT_ERROR","DATA_COLLECTOR_REQUIRES_CREATE_OPTIONS","cachedSessionId","Fraudnet","removeElementIfOnPage","parentNode","removeChild","floor","_generateSessionId","_beaconId","Date","getTime","_parameterBlock","beaconId","b","sandbox","_createParameterBlock","block","_thirdPartyBlock","setup","fraudNet","clearSessionIdCache","fraudnet","_instances","_instantiatedWithAClient","kountInstance","deviceData","riskCorrelationId","correlationId","fraudnetInstance","correlation_id","rawDeviceData","instance","createTeardownMethod","getDeviceData","raw","createGetDeviceDataMethod","sjcl","camelCaseToSnakeCase","QA_URL","environmentUrls","development","qa","production","cachedDeviceData","Kount","previouslyInitializedDeviceData","getCachedDeviceData","_isCached","_currentEnvironment","_initializeEnvironment","startCollectors","_deviceSessionId","_generateDeviceSessionId","_getDeviceData","setCachedDeviceData","_iframe","_setupIFrame","stopCollectors","_removeIframe","deviceSessionId","fraudMerchantId","bits","randomWords","codec","hex","fromBits","params","width","height","left","title","innerHTML","cipher","hash","keyexchange","mode","misc","exception","corrupt","invalid","bug","notReady","d","g","l","h","q","v","w","A","B","C","performance","now","addEntropy","valueOf","y","z","aes","encrypt","G","decrypt","bitArray","bitSlice","M","clamp","extract","getPartial","bitLength","ceil","partial","round","equal","Y","byteswapM","utf8String","fromCharCode","decodeURIComponent","escape","toBits","unescape","encodeURIComponent","charCodeAt","sha256","reset","update","finalize","blockSize","K","Uint32Array","subarray","pow","prng","H","F","J","L","j","T","D","progress","seeded","S","O","I","P","N","isReady","setDefaultParanoia","getProgress","loadTimeCollector","V","mouseCollector","W","keyboardCollector","U","accelerometerCollector","R","touchCollector","X","attachEvent","detachEvent","clientX","offsetX","clientY","offsetY","touches","changedTouches","pageX","pageY","accelerationIncludingGravity","orientation","E","randomBytes","Uint8Array","buffer","crypto","getRandomValues","msCrypto","GOOGLE_PAYMENT_NOT_ENABLED","GOOGLE_PAYMENT_GATEWAY_ERROR","GOOGLE_PAYMENT_UNSUPPORTED_VERSION","generateGooglePayConfiguration","CREATE_PAYMENT_DATA_REQUEST_METHODS","GooglePayment","_useDeferredClient","_googlePayVersion","googlePayVersion","_googleMerchantId","googleMerchantId","_isUnsupportedGooglePayAPIVersion","_getDefaultConfig","_defaultConfig","_createV1PaymentDataRequest","paymentDataRequest","defaultConfig","overrideCardNetworks","cardRequirements","allowedCardNetworks","defaultConfigCardNetworks","_createV2PaymentDataRequest","allowedPaymentMethods","paymentMethod","defaultPaymentMethod","merchantSubmittedPaymentMethod","parameter","applyDefaultsToPaymentMethodConfiguration","createPaymentDataRequest","overrides","_createPaymentDataRequestSyncronously","createPaymentDataRequestMethod","parseResponse","rawResponse","apiVersion","paymentMethodData","tokenizationData","paymentMethodToken","paypalAccounts","androidPayCards","isNetworkTokenized","allowedAttributes","attribute","_isValid","HOSTED_FIELDS_ATTRIBUTE_VALUE_NOT_ALLOWED","HOSTED_FIELDS_ATTRIBUTE_NOT_SUPPORTED","useMin","componentId","directions","navigationDirections","browserDetection","focusIntercept","findParentTags","userFocusableTagNames","unfocusedInputTypes","_isUserFocusableElement","hasSoftwareKeyboard","tagName","_findFirstFocusableElement","elementsInForm","elementsIndex","removeExtraFocusElements","checkoutForm","onRemoveFocusIntercepts","elements","reverse","matchFocusElement","createFocusChangeHandler","hostedFieldsId","callbacks","currentIndex","targetElement","navHelper","sourceElement","getElementById","direction","forms","numberOfElementsInForm","BACK","checkIndexBounds","index","indexChange","FORWARD","_createNavigationHelper","onTriggerInputFocus","focus","allowedStyles","cssClass","computedStyles","styles","className","display","getComputedStyle","Destructor","iFramer","Bus","composeUrl","getStylesFromClass","INTEGRATION_TIMEOUT_MS","events","injectFrame","allowedFields","shadow","findRootNode","getCardTypes","attributeValidationError","focusChange","destroyFocusIntercept","destroy","HostedFields","failureTimeout","clientConfig","hostedFieldsUrl","fields","frameReadyPromiseResolveFunctions","frameReadyPromises","_merchantConfigurationOptions","_clientPromise","_injectedNodes","_destructor","_fields","cards","_bus","registerFunctionForTeardown","externalContainer","internalContainer","frameReadyPromise","HOSTED_FIELDS_INVALID_FIELD_KEY","selector","nodeType","HOSTED_FIELDS_INVALID_FIELD_SELECTOR","fieldSelector","fieldContainer","fieldKey","HOSTED_FIELDS_FIELD_DUPLICATE_IFRAME","isShadowElement","transformToSlot","maxlength","HOSTED_FIELDS_FIELD_PROPERTY_INVALID","minlength","defaultIFrameStyle","iframeTitle","label","_setupLabelFocus","frameElement","containerElement","isEmpty","isValid","isPotentiallyValid","isFocused","REMOVE_FOCUS_INTERCEPTS","TRIGGER_FOCUS_CHANGE","targetType","READY_FOR_CLIENT","CARD_FORM_ENTRY_HAS_BEGUN","BIN_AVAILABLE","formattedConfig","clearTimeout","_cleanUpFocusIntercepts","FRAME_READY","INPUT_EVENT","merchantPayload","emittedBy","classList","toggle","externalClasses","FOCUSED","VALID","INVALID","createInputEventHandler","node","parent","remove","methodNames","labels","rootNode","querySelectorAll","triggerFocus","_getAnyFieldContainer","found","iframeContainer","_attachInvalidFieldContainersToError","invalidFieldKeys","invalidFields","getChallenges","getSupportedCardTypes","TOKENIZATION_REQUEST","addClass","classname","ADD_CLASS","HOSTED_FIELDS_FIELD_NOT_PRESENT","HOSTED_FIELDS_FIELD_INVALID","removeClass","REMOVE_CLASS","attributeErr","SET_ATTRIBUTE","setMonthOptions","errorMessage","merchantOptions","select","SET_MONTH_OPTIONS","setMessage","SET_MESSAGE","REMOVE_ATTRIBUTE","setPlaceholder","placeholder","clear","CLEAR_FIELD","fieldConfig","TRIGGER_INPUT_FOCUS","boundingBox","verticalMidpoint","horizontalMidpoint","getBoundingClientRect","innerHeight","documentElement","clientHeight","right","bottom","innerWidth","clientWidth","scrollIntoView","getState","focusHandler","frameType","clearboth","fragment","createDocumentFragment","focusInterceptBefore","generate","focusInterceptAfter","supportsInputFormatting","HOSTED_FIELDS_TIMEOUT","isChromeOS","isChromeIos","isFirefox","enumerate","maxExpirationYearAge","externalEvents","FOCUS","BLUR","EMPTY","NOT_EMPTY","VALIDITY_CHANGE","CARD_TYPE_CHANGE","defaultMaxLengths","postalCode","border","float","tokenizationErrorCodes","HOSTED_FIELDS_TOKENIZATION_FAIL_ON_DUPLICATE","HOSTED_FIELDS_TOKENIZATION_CVV_VERIFICATION_FAILED","disabled","autocompleteMappings","expiration","HOSTED_FIELDS_TOKENIZATION_NETWORK_ERROR","CUSTOMER","HOSTED_FIELDS_FAILED_TOKENIZATION","HOSTED_FIELDS_FIELDS_EMPTY","HOSTED_FIELDS_FIELDS_INVALID","tag","parents","opacity","add","blur","idString","focusInputs","idComponents","hasBTPrefix","isAllowedType","isValidDirection","card","americanExpress","dataCollector","hostedFields","localPayment","paypalCheckout","googlePayment","sepa","vaultManager","preferredPaymentMethods","jsonClone","authAttrs","clientInstanceOrPromise","timestamp","timestampInPromise","ANALYTICS_PREFIX","isAsync","ANALYTICS_REQUEST_TIMEOUT_MS","assignNormalized","assignPolyfill","destination","_assign","INCOMPATIBLE_VERSIONS","INVALID_USE_OF_INTERNAL_FUNCTION","functions","finish","findRootError","newObj","transformKey","ASSETS_URLS","CLIENT_API_URLS","BUS_CONFIGURATION_REQUEST_EVENT","methodName","METHOD_CALLED_AFTER_TEARDOWN","originalErr","btErrorObject","atob","parsedClientToken","parsedTokenizationKey","tokens","join","braintree","CLIENT_SCRIPT_FAILED_TO_LOAD","batchExecuteFunctions","_teardownRegistry","_isTearingDown","values","enumeration","array","Popup","PopupBridge","Modal","REQUIRED_CONFIG_KEYS","FrameService","_validateFrameConfiguration","_serviceId","_options","dispatchFrameUrl","openFrameUrl","state","_setBusEvents","dispatchFrameReadyHandler","DISPATCH_FRAME_READY","_writeDispatchFrame","frameName","DISPATCH_FRAME_NAME","frameSrc","_dispatchFrame","class","DISPATCH_FRAME_CLASS","DISPATCH_FRAME_REPORT","_onCompleteCallback","_frame","close","_getFrameForEnvironment","isFrameClosed","_cleanupFrame","FRAME_SERVICE_FRAME_OPEN_FAILED","_pollForPopupClose","redirect","createHandler","beforeClose","beforeFocus","createNoopHandler","isClosed","clearInterval","_popupInterval","setInterval","FRAME_SERVICE_FRAME_CLOSED","POPUP_POLL_INTERVAL","usePopup","supportsPopups","popupBridgeExists","popupBridge","initOptions","frameService","ELEMENT_STYLES","padding","margin","outline","zIndex","background","_closed","_container","iframerConfig","isIosWKWebview","_lockScrolling","_el","overflow","_unlockScrolling","redirectUrl","_savedBodyProperties","overflowStyle","positionStyle","scrollTo","doc","pageXOffset","scrollLeft","clientLeft","pageYOffset","scrollTop","clientTop","onComplete","popupDismissed","calculatePosition","userDefinedPosition","DEFAULT_POPUP_HEIGHT","DEFAULT_POPUP_WIDTH","POPUP_BASE_OPTIONS","composeOptions","center","windowMetric","popupMetric","offset","outerHeight","screenY","screenTop","outerWidth","screenX","screenLeft","POPUP_CLOSE_TIMEOUT","generateTokenizationParameters","basicTokenizationParameters","gateway","paypalPaymentMethod","androidPayConfiguration","apiVersionMinor","allowedAuthMethods","tokenizationSpecification","merchantInfo","purchase_context","purchase_units","payee","client_id","recurring_payment","paymentMethodTokenizationParameters","tokenizationType","convertDateStringToDate","dateString","splitDate","firstDate","secondDate","isHTTPS","parser","legalHosts","mainDomain","hasQueryParams","namespace","toReturn","keyValue","parts","_notEmpty","getShadowHost","styleNode","shadowHost","slotName","slot","slotProvider","sheet","insertRule","snakeString","atobNormalized","atobPolyfill","base64String","b2","b3","characters","RegExp","_atob","REQUIRED_OPTIONS_FOR_START_PAYMENT","REQUIRED_OPTIONS_FOR_PAY_UPON_INVOICE_PAYMENT_TYPE","REQUIRED_OPTIONS_FOR_ADDRESS","REQUIRED_OPTIONS_FOR_LINE_ITEMS","REQUIRED_OPTIONS_FOR_BLIK_SEAMLESS_PAYMENT_TYPE","REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_LEVEL_0","REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_FIRST","REQUIRED_OPTIONS_FOR_BLIK_OPTIONS_ONE_CLICK_SUBSEQUENT","LocalPayment","_assetsUrl","_isDebug","_loadingFrameUrl","_authorizationInProgress","_paymentType","_merchantAccountId","isDeferredPaymentTypeOptions","blikOptions","paymentType","hasMissingAddressOption","option","hasMissingLineItemsOption","items","item","hasMissingOption","missingAddressOption","missingLineItemOption","oneClick","level_0","hasMissingBlikOptions","fallback","buttonText","recurrent","customerId","_initialize","service","_frameService","startPayment","missingOption","missingError","address","windowOptions","onPaymentStartPromise","serviceId","LOCAL_PAYMENT_START_PAYMENT_MISSING_REQUIRED_OPTION","amount","bic","line1","streetAddress","line2","extendedAddress","city","locality","region","birthDate","cancelUrl","cancelButtonText","discountAmount","experienceProfile","brandName","customerServiceInstructions","locale","noShipping","shippingAddressRequired","firstName","givenName","fundingSource","intent","lastName","surname","lineItems","merchantOrPartnerCustomerId","payerEmail","email","paymentTypeCountryCode","phone","phoneCountryCode","returnUrl","shippingAmount","LOCAL_PAYMENT_ALREADY_IN_PROGRESS","_startPaymentCallback","_createStartPaymentCallback","paymentResource","_startPaymentOptions","LOCAL_PAYMENT_START_PAYMENT_DEFERRED_PAYMENT_FAILED","onPaymentStart","paymentId","paymentToken","LOCAL_PAYMENT_START_PAYMENT_FAILED","LOCAL_PAYMENT_INVALID_PAYMENT_OPTION","queryItems","wasCanceled","LOCAL_PAYMENT_CANCELED","errorcode","btLpToken","_formatTokenizeData","_formatTokenizePayload","LOCAL_PAYMENT_TOKENIZATION_FAILED","closeWindow","_authoriztionInProgress","focusWindow","LOCAL_PAYMENT_WINDOW_CLOSED","LOCAL_PAYMENT_WINDOW_OPEN_FAILED","account","payerInfo","hasTokenizationParams","btLpPaymentId","btLpPayerId","paypalAccount","payerId","PayerID","unilateral","unvettedMerchant","LOCAL_PAYMENT_NOT_ENABLED","Masterpass","_authInProgress","getReturnUrlPrefix","_callbackUrl","LANDING_FRAME_NAME","POPUP_HEIGHT","POPUP_WIDTH","REQUIRED_OPTIONS_FOR_TOKENIZE","MASTERPASS_TOKENIZE_MISSING_REQUIRED_OPTION","MASTERPASS_TOKENIZATION_ALREADY_IN_PROGRESS","_navigateFrameToLoadingPage","frameOptions","_createFrameOpenHandler","requestToken","originUrl","subtotal","callbackUrl","queryParams","allowedCardTypes","MASTERPASS_VERSION","_closeWindow","MASTERPASS_INVALID_PAYMENT_OPTION","MASTERPASS_FLOW_FAILED","popupBridgeErr","MASTERPASS_POPUP_CLOSED","_tokenizeMasterpass","frameServiceErr","MASTERPASS_POPUP_OPEN_FAILED","mpstatus","oauth_verifier","oauth_token","checkout_resource_url","isMissingRequiredPayload","MASTERPASS_POPUP_MISSING_REQUIRED_PARAMETERS","masterpassCard","checkoutResourceUrl","verifierToken","masterpassCards","tokenizeErr","MASTERPASS_ACCOUNT_TOKENIZATION_FAILED","isSupported","MASTERPASS_BROWSER_NOT_SUPPORTED","MASTERPASS_NOT_ENABLED","CARD_TYPE_MAPPINGS","Visa","MasterCard","Discover","UnionPay","Maestro","PaymentRequestComponent","enabledPaymentMethods","_componentId","_enabledPaymentMethods","basicCard","_supportedPaymentMethods","_constructDefaultSupportedPaymentMethods","_defaultSupportedPaymentMethods","supportedPaymentMethods","supportedMethods","allowPaymentRequest","PAYMENT_REQUEST_NO_VALID_SUPPORTED_PAYMENT_METHODS","FRAME_CAN_MAKE_REQUESTS","SHIPPING_ADDRESS_CHANGE","shippingAddress","shippingAddressChangeEvent","updateWith","paymentDetails","UPDATE_SHIPPING_ADDRESS","SHIPPING_OPTION_CHANGE","shippingOption","shippingOptionChangeEvent","UPDATE_SHIPPING_OPTION","createSupportedPaymentMethodsConfiguration","PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_MUST_INCLUDE_TYPE","PAYMENT_REQUEST_CREATE_SUPPORTED_PAYMENT_METHODS_CONFIGURATION_TYPE_NOT_ENABLED","PAYMENT_REQUEST_INITIALIZED","rawError","_formatTokenizationError","rawPaymentResponse","canMakePayment","unsupportedPaymentMethod","PaymentRequest","SUPPORTED_METHODS","PAYMENT_REQUEST_UNSUPPORTED_PAYMENT_METHOD","CAN_MAKE_PAYMENT","_formatCanMakePaymentError","formattedError","PAYMENT_REQUEST_CANCELED","PAYMENT_REQUEST_INITIALIZATION_MISCONFIGURED","PAYMENT_REQUEST_GOOGLE_PAYMENT_FAILED_TO_TOKENIZE","PAYMENT_REQUEST_GOOGLE_PAYMENT_PARSING_ERROR","PAYMENT_REQUEST_NOT_COMPLETED","PAYMENT_REQUEST_CAN_MAKE_PAYMENT_NOT_ALLOWED","PAYMENT_REQUEST_CAN_MAKE_PAYMENT_FAILED","PAYPAL_NOT_ENABLED","PAYPAL_SANDBOX_ACCOUNT_NOT_LINKED","PAYPAL_ACCOUNT_TOKENIZATION_FAILED","PAYPAL_FLOW_FAILED","PAYPAL_FLOW_OPTION_REQUIRED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_PARAM_REQUIRED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_SETUP_FAILED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_POPUP_OPEN_FAILED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_CANCELED","PAYPAL_START_VAULT_INITIATED_CHECKOUT_IN_PROGRESS","PAYPAL_INVALID_PAYMENT_OPTION","PAYPAL_MISSING_REQUIRED_OPTION","PayPalCheckout","REQUIRED_PARAMS_FOR_START_VAULT_INITIATED_CHECKOUT","_autoSetDataUserIdToken","autoSetDataUserIdToken","_authorizationInformation","fingerprint","environmentNoNetwork","_setupError","_frameServicePromise","_setupFrameService","frameServicePromise","timeoutRef","createPayment","FLOW_ENDPOINTS","flow","_createPaymentResource","agreementSetup","tokenId","intentFromCreatePayment","offerCredit","_formatPaymentResourceData","updatePayment","_hasMissingOption","REQUIRED_OPTIONS","_verifyConsistentCurrency","_formatUpdatePaymentData","startVaultInitiatedCheckout","missingRequiredParam","_vaultInitiatedCheckoutInProgress","param","_addModalBackdrop","_waitForVaultInitiatedCheckoutDependencies","frameCommunicationPromise","startVaultInitiatedCheckoutPromise","_constructVaultCheckutUrl","_createFrameServiceCallback","_removeModalBackdrop","optOutOfModalBackdrop","_modalBackdrop","focusVaultInitiatedCheckoutWindow","closeVaultInitiatedCheckoutWindow","tokenizePayment","payerID","paymentID","orderID","orderId","tokenizationError","tokenizeOptions","shouldVault","billingToken","ecToken","shippingOptionsId","vault","creditFinancingOffered","getClientId","clientId","loadPayPalSDK","loadPromise","userIdToken","_paypalScript","components","currency","_attachPreloadPixel","insertBefore","firstElementChild","subdomain","preloadOptions","offerPaypalCredit","localeCode","enableShippingAddress","addressOverride","shippingAddressEditable","landingPageType","shippingOptions","requestBillingAgreement","vaultInitiatedCheckoutPaymentMethodToken","shippingAddressOverride","billingAgreementDetails","billingAgreementDescription","_riskCorrelationId","every","required","recipientName","isTokenizationKey","isVaultFlow","billingAgreementToken","shippingOptionId","cobrandedCardLabel","PayPal","tokenizePromise","optionError","PAYPAL_TOKENIZATION_REQUEST_ACTIVE","offerPayLater","_navigateFrameToAuth","canceled","PAYPAL_POPUP_CLOSED","_tokenizePayPal","PAYPAL_POPUP_OPEN_FAILED","ba_token","approvalUrl","useraction","checkout","PreferredPaymentMethods","fetchPreferredPaymentMethods","paypalPreferred","venmoPreferred","sepaErrors","billingAddressOptions","BILLING_ADDRESS_OPTIONS","createMandate","sepa_debit","account_holder_name","accountHolderName","billing_address","country_code","iban","merchant_or_partner_customer_id","mandate_type","mandateType","cancel_url","return_url","merchant_account_id","ccOption","sepaDebitAccount","SEPA_CREATE_MANDATE_FAILED","bankReferenceToken","openPopup","assetsBaseUrl","popupLocation","frameServiceInstance","success","mandateApproved","cancel","customerCanceled","SEPA_CUSTOMER_CANCELED","SEPA_TOKENIZATION_FAILED","handleApproval","sepa_debit_account","last_4","bank_reference_token","SEPA_TRANSACTION_FAILED","ibanLastFour","mandates","SEPA","_returnUrl","_cancelUrl","createMandateOptions","SEPA_TOKENIZE_MISSING_REQUIRED_OPTION","MANDATE_TYPE_ENUM","includes","mandateResponse","approval","SEPA_INVALID_MANDATE_TYPE","BaseFramework","_createOptions","setUpEventListeners","THREEDS_FRAMEWORK_METHOD_NOT_IMPLEMENTED","verifyCard","privateOptions","formattedOptions","_checkForVerifyCardError","_verifyCardInProgress","_formatVerifyCardOptions","_formatLookupData","_performLookup","lookup","threeDSecureVersion","_onLookupComplete","initializeChallengeWithLookupResponse","_resetVerificationState","_checkForFrameworkSpecificVerifyCardErrors","_presentChallenge","prepareLookup","_verifyCardPromisePlus","_reloadThreeDSecure","lookupError","analyticsMessage","THREEDS_LOOKUP_TOKENIZED_CARD_NOT_FOUND_ERROR","THREEDS_LOOKUP_VALIDATION_ERROR","THREEDS_LOOKUP_ERROR","errorOption","THREEDS_AUTHENTICATION_IN_PROGRESS","THREEDS_MISSING_VERIFY_CARD_OPTION","lookupResponse","_lookupPaymentMethod","_handleLookupResponse","liabilityShifted","liabilityShiftPossible","challengeShouldBePresented","acsUrl","_formatAuthResponse","verificationDetails","browserColorDepth","screen","colorDepth","browserJavaEnabled","javaEnabled","browserJavascriptEnabled","browserLanguage","language","browserScreenHeight","browserScreenWidth","browserTimeZone","getTimezoneOffset","deviceChannel","_handleV1AuthResponse","authResponse","auth_response","cancelVerifyCard","THREEDS_NO_VERIFICATION_PAYLOAD","_setupV1Bus","parentURL","bus","authenticationCompleteBaseUrl","pareq","termUrl","md","parentUrl","AUTHENTICATION_COMPLETE","handleAuthResponse","_setupV1Iframe","showLoader","_v1Bus","_setupV1Elements","_v1Iframe","_teardownV1Elements","_onV1Keyup","SongbirdFramework","Bootstrap3ModalFramework","_createV1IframeModalElement","modal","_createCardinalConfigurationOptions","setupOptions","payment","framework","CardinalModalFramework","addCloseButton","cardinalSDKConfig","displayExitButton","LegacyFramework","InlineIframeFramework","legacy","AUTHENTICATION_IFRAME_AVAILABLE","next","_addV1IframeToPage","_v1Modal","_setupFrameworkSpecificListeners","setCardinalListener","_onInlineSetup","htmlTemplate","hasError","THREEDS_INLINE_IFRAME_DETAILS_INCORRECT","transformV1CustomerBillingAddress","customer","countryCodeAlpha2","_createIframe","_handleAuthResponse","removeFrame","addFrame","modifiedOptions","SONGBIRD_UI_EVENTS","SCA_EXEMPTION_TYPES","_songbirdInitFailed","_clientMetadata","requestedThreeDSecureVersion","originalSetupOptions","_getDfReferenceIdPromisePlus","setupSongbird","_cardinalEvents","extractAddressData","line3","LOOKUP_COMPLETE","CUSTOMER_CANCELED","getDfReferenceId","dfReferenceId","_triggerCardinalBinProcess","clientMetadata","handleSongbirdError","errorType","_removeSongbirdListeners","_songbirdPromise","issuerStartTime","Cardinal","trigger","binResults","issuerDeviceDataCollectionTimeElapsed","issuerDeviceDataCollectionResult","Status","transformBillingAddress","additionalInformation","billingPhoneNumber","phoneNumber","billingGivenName","billingSurname","transformShippingAddress","_createV1IframeModal","btn","backdrop","closeHandler","THREEDS_CARDINAL_SDK_CANCELED","startTime","_v2SetupFailureReason","_loadCardinalScript","_configureCardinalSdk","setupStartTime","THREEDS_CARDINAL_SDK_SETUP_FAILED","_songbirdSetupTimeoutReference","threeDSConfig","jwt","cardinalAuthenticationJWT","cardinalConfiguration","_createPaymentsSetupCompleteCallback","configure","cardinalDeviceDataCollectionTimeElapsed","_createPaymentsValidatedCallback","paymentSettings","logging","loggingEnabled","level","displayLoading","scriptSource","_getCardinalScriptSource","THREEDS_CARDINAL_SDK_SCRIPT_LOAD_FAILED","gatewayConfig","CARDINAL_SCRIPT_SOURCE","_performJWTValidation","rawCardinalSDKVerificationData","cancelCode","Payment","ExtendedData","ChallengeCancel","formattedResponse","THREEDS_JWT_AUTHENTICATION_FAILED","validatedJwt","ActionCode","ErrorNumber","THREEDS_CARDINAL_SDK_SETUP_TIMEDOUT","THREEDS_CARDINAL_SDK_RESPONSE_TIMEDOUT","THREEDS_CARDINAL_SDK_BAD_CONFIG","THREEDS_CARDINAL_SDK_BAD_JWT","THREEDS_CARDINAL_SDK_ERROR","ErrorDescription","onLookupComplete","ignoreOnLookupCompleteRequirement","mobilePhoneNumber","requiresUserAuthentication","transactionId","continue","AcsUrl","Payload","OrderDetails","TransactionId","additionalInfo","accountType","challengeRequested","requestedExemptionType","THREEDS_REQUESTED_EXEMPTION_TYPE_INVALID","customFields","dataOnlyRequested","exemptionRequested","requestVisaDAF","cardAdd","cardAddChallengeRequested","merchantName","verifyCardError","THREEDS_VERIFY_CARD_CANCELED_BY_MERCHANT","FRAMEWORKS","ThreeDSecure","Framework","_framework","THREEDS_UNSUPPORTED_VERSION","THREEDS_UNRECOGNIZED_VERSION","getFramework","gwConfig","THREEDS_NOT_ENABLED","THREEDS_CAN_NOT_USE_TOKENIZATION_KEY","THREEDS_HTTPS_REQUIRED","THREEDS_NOT_ENABLED_FOR_V2","THREEDS_TERM_URL_REQUIRES_BRAINTREE_DOMAIN","UNIONPAY_NOT_ENABLED","HOSTED_FIELDS_FRAME_NAME","UNIONPAY_HOSTED_FIELDS_INSTANCE_INVALID","UNIONPAY_HOSTED_FIELDS_INSTANCE_REQUIRED","UNIONPAY_CARD_OR_HOSTED_FIELDS_INSTANCE_REQUIRED","UNIONPAY_CARD_AND_HOSTED_FIELDS_INSTANCES","UNIONPAY_EXPIRATION_DATE_INCOMPLETE","UNIONPAY_ENROLLMENT_CUSTOMER_INPUT_INVALID","UNIONPAY_ENROLLMENT_NETWORK_ERROR","UNIONPAY_FETCH_CAPABILITIES_NETWORK_ERROR","UNIONPAY_TOKENIZATION_NETWORK_ERROR","UNIONPAY_MISSING_MOBILE_PHONE_DATA","UNIONPAY_FAILED_TOKENIZATION","fetchCapabilities","_initializeHostedFields","HOSTED_FIELDS_FETCH_CAPABILITIES","enroll","mobile","HOSTED_FIELDS_ENROLL","unionPayEnrollment","mobileCountryCode","mobileNumber","enrollmentId","unionPayEnrollmentId","smsCodeRequired","smsCode","tokenizedCard","HOSTED_FIELDS_TOKENIZE","_hostedFieldsFrame","_hostedFieldsInitializePromise","PLAID_LINK_JS","US_BANK_ACCOUNT_OPTION_REQUIRED","US_BANK_ACCOUNT_MUTUALLY_EXCLUSIVE_OPTIONS","US_BANK_ACCOUNT_LOGIN_LOAD_FAILED","US_BANK_ACCOUNT_LOGIN_CLOSED","US_BANK_ACCOUNT_LOGIN_REQUEST_ACTIVE","US_BANK_ACCOUNT_TOKENIZATION_NETWORK_ERROR","US_BANK_ACCOUNT_FAILED_TOKENIZATION","US_BANK_ACCOUNT_NOT_ENABLED","US_BANK_ACCOUNT_BANK_LOGIN_NOT_ENABLED","USBankAccount","TOKENIZE_BANK_DETAILS_MUTATION","createGraphQLMutation","TOKENIZE_BANK_LOGIN_MUTATION","_isTokenizingBankLogin","errorFrom","BRAINTREE_API_ACCESS_RESTRICTED","formatTokenizeResponseFromGraphQL","addLoadListeners","loadHandler","errorHandler","Plaid","formatBillingAddressForGraphQL","zipCode","formatDataForOwnershipType","ownershipType","individualOwner","businessOwner","businessName","mandateText","bankDetails","bankLogin","_tokenizeBankDetails","_tokenizeBankLogin","achMandate","routingNumber","accountNumber","isProduction","plaidConfig","_loadPlaid","plaidLoadErr","clientName","env","product","selectAccount","onExit","onSuccess","publicToken","accountId","account_id","subtype","usBankLogin","existingScript","_plaidScript","VAULT_MANAGER_DELETE_PAYMENT_METHOD_NONCE_REQUIRES_CLIENT_TOKEN","VAULT_MANAGER_PAYMENT_METHOD_NONCE_NOT_FOUND","VAULT_MANAGER_DELETE_PAYMENT_METHOD_UNKNOWN_ERROR","VaultManager","formatPaymentMethodPayload","formattedPaymentMethod","hasSubscription","fetchPaymentMethods","defaultFirst","paymentMethodsPayload","paymentMethods","deletePaymentMethod","singleUseTokenId","venmo_desktop_1","VENMO_PAYMENT_CONTEXT_STATUS_QUERY","LEGACY_VENMO_PAYMENT_CONTEXT_STATUS_QUERY","UPDATE_PAYMENT_CONTEXT_QUERY","LEGACY_UPDATE_PAYMENT_CONTEXT_QUERY","CREATE_PAYMENT_CONTEXT_QUERY","LEGACY_CREATE_PAYMENT_CONTEXT_QUERY","iframer_1","events_1","queries_1","VenmoDesktop","isHidden","profileId","paymentMethodUsage","shouldUseLegacyQRCodeMutation","frameUrl","apiRequest","alertBox","VENMO_DESKTOP_IFRAME_READY","VENMO_DESKTOP_REQUEST_NEW_QR_CODE","startPolling","launchDesktopFlow","launchDesktopPromiseRejectFunction","removeListeners","VENMO_DESKTOP_CUSTOMER_CANCELED","customerCancelledHandler","VENMO_DESKTOP_UNKNOWN_ERROR","unknownErrorHandler","allowUIToHandleError","updateVenmoDesktopPaymentContext","completedHandler","setAlert","venmoContextId","triggerCompleted","triggerRejected","hideDesktopFlow","VENMO_DESKTOP_CLOSED_FROM_PARENT","displayError","VENMO_DESKTOP_DISPLAY_ERROR","displayQRCode","VENMO_DESKTOP_DISPLAY_QR_CODE","authorize","VENMO_DESKTOP_AUTHORIZE","authorizing","VENMO_DESKTOP_AUTHORIZING","createVenmoDesktopPaymentContext","expiresIn","expiresAt","createdAt","expiredTime","pollForStatusChange","username","userName","paymentMethodId","lookupVenmoDesktopPaymentContext","newStatus","textContent","createPaymentContextFromGraphqlLegacyQRCodeMutation","createVenmoQRCodePaymentContext","venmoQRCodePaymentContext","createPaymentContextFromGraphQL","customerClient","merchantProfileId","createVenmoPaymentContext","venmoPaymentContext","context","additionalOptions","Venmo","supportsVenmo","VENMO_INVALID_PROFILE_ID","deepLinkReturnUrl","VENMO_INVALID_DEEP_LINK_RETURN_URL","VENMO_NOT_ENABLED","isBrowserSupported","isIosSafari","isFacebookOwnedBrowserOnAndroid","doesNotSupportWindowOpenInIos","DOCUMENT_VISIBILITY_CHANGE_EVENT_DELAY","DEFAULT_PROCESS_RESULTS_DELAY","VENMO_APP_OR_MOBILE_AUTH_URL","VENMO_MOBILE_APP_AUTH_ONLY_URL","VENMO_WEB_LOGIN_URL","VENMO_TOKENIZATION_REQUEST_ACTIVE","VENMO_TOKENIZATION_REQUEST_NOT_ACTIVE","VENMO_APP_FAILED","VENMO_APP_CANCELED","VENMO_CANCELED","VENMO_CUSTOMER_CANCELED","VENMO_NETWORK_ERROR","VENMO_DESKTOP_CANCELED","VENMO_TOKENIZATION_CANCELED_BY_MERCHANT","VENMO_MOBILE_PAYMENT_CONTEXT_SETUP_FAILED","VENMO_MOBILE_POLLING_TOKENIZATION_NETWORK_ERROR","VENMO_MOBILE_POLLING_TOKENIZATION_EXPIRED","VENMO_MOBILE_POLLING_TOKENIZATION_CANCELED","VENMO_MOBILE_POLLING_TOKENIZATION_TIMEOUT","VENMO_MOBILE_POLLING_TOKENIZATION_FAILED","VENMO_TOKENIZATION_FAILED","VENMO_ECD_DISABLED","VENMO_DESKTOP_AUTHORIZATION_TIMED_OUT","venmoConstants","useAllowDesktopWebLogin","mobileWebFallBack","inIframe","merchantAllowsDesktopBrowsers","merchantAllowsReturningToNewBrowserTab","merchantAllowsWebviews","isMobileDevice","isMobileDeviceThatSupportsReturnToSameTab","allowDesktopWebLogin","allowDesktop","allowNewBrowserTab","allowWebviews","VENMO_LOGO_SVG","CONTINUE_OR_CANCEL_INSTRUCTIONS","ELEMENT_IDS","backdropHidden","backdropContainer","cancelButton","continueButton","instructions","venmoLogo","venmoUrl","checkForStatusChange","cancelTokenization","checkPaymentContextStatus","extendedPromise","closeBackdrop","statusCheckError","buildAndStyleElements","backdropStylesElement","backdropDiv","backDropContentContainer","venmoLogoDiv","venmoMessageDiv","instructionsDiv","backdropStyles","backdropContainerStyles","cancelButtonStyles","continueButtonStyles","messageStyles","instructionStyles","alreadyRenderedBackdrop","innerText","stopPropagation","runWebLogin","setupDesktopWebLogin","getVenmoUrl","desktopWebLogin","createVenmoDesktop","graphqlQueries","_allowDesktopWebLogin","_mobileWebFallBack","_allowNewBrowserTab","_allowWebviews","_allowDesktop","_useRedirectForIOS","useRedirectForIOS","_profileId","_displayName","_deepLinkReturnUrl","_ignoreHistoryChanges","ignoreHistoryChanges","_paymentMethodUsage","_shouldUseLegacyFlow","_requireManualReturn","requireManualReturn","_useDesktopQRFlow","_isDesktop","_useAllowDesktopWebLogin","_cannotHaveReturnUrls","_allowAndroidRecreation","allowAndroidRecreation","_maxRetryCount","_collectCustomerBillingAddress","collectCustomerBillingAddress","_collectCustomerShippingAddress","collectCustomerShippingAddress","_lineItems","_subTotalAmount","subTotalAmount","_discountAmount","_taxAmount","taxAmount","_shippingAmount","_totalAmount","totalAmount","_shouldCreateVenmoPaymentContext","hasTokenizationResult","venmoDesktopInstance","_venmoDesktopInstance","_mobilePollingInterval","_mobilePollingExpiresThreshold","paymentContextPromise","webLoginPromise","analyticsCategory","_frameServiceInstance","desktopWebErr","_mobilePollingContextEnvironment","_createVenmoPaymentContext","isValidationError","paymentContextResult","promiseErr","getFragmentParameters","parsedParams","decodedKey","resourceId","formatUserName","documentVisibilityChangeEventName","visibilityChange","hidden","msHidden","webkitHidden","cancelIfTokenizationInProgress","transactionDetails","venmoConfiguration","transactionDetailsPresent","unitTaxAmount","detail","paysheetDetails","refreshIn","_refreshPaymentContextTimeout","_tokenizationInProgress","_venmoPaymentContextStatus","_venmoPaymentContextId","appSwitch","_shouldUseRedirectStrategy","currentUrl","braintreeData","resource_id","_shouldIncludeReturnUrls","braintree_merchant_id","braintree_access_token","braintree_environment","braintree_sdk_data","_hasTokenizationResult","venmoSuccess","venmoError","venmoCancel","_tokenizeForDesktopQRFlow","_tokenizeWebLoginWithRedirect","_tokenizeForMobileWithManualReturn","_tokenizeForMobileWithHashChangeListeners","formattedPayload","paymentContextId","formatTokenizePayload","_removeVisibilityEventListener","_tokenizePromise","_cancelMobilePaymentContext","_cancelVenmoDesktopContext","_checkPaymentContextStatusAndProcessResult","_checkPaymentContextStatus","_queryPaymentContextStatus","retryCount","resultStatus","networkError","_pollForStatusChange","_mobilePollingContextExpiresIn","resultProcessingInProgress","visibilityChangeListenerTimeout","processHashChangeFlowResults","completeFlow","_previousHash","_onHashChangeListener","newURL","_visibilityChangeListener","delay","processResultsDelay","errorCode","_clearFragmentParameters","history","replaceState","pushState","VISA_CHECKOUT_NOT_ENABLED","VISA_CHECKOUT_INIT_OPTIONS_REQUIRED","VISA_CHECKOUT_PAYMENT_REQUIRED","VISA_CHECKOUT_TOKENIZATION","VisaCheckout","createInitOptions","visaCheckoutConfiguration","settings","dataLevel","cardBrands","callid","encKey","encPaymentData","visaCheckoutCard","callId","encryptedPaymentData","encryptedKey","visaCheckoutCards"],"sourceRoot":""}