/* Metro module 3819; source: stores/billing/BraintreeStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 477, 507, 566, 694, 2] */ import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as HTTPUtilsModule from '../../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ function _fun29541(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3946:6, offset: 0x00fc4873, size: 458 bytes, params: 8, frame: 20 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_7 = value.Endpoints; const env0_8 = value.PaymentGateways; const env0_9 = value.PaymentSourceTypes; value = require(477) /* metro dependency 477: PlatformUtils */; if (value.isDesktop()) { global.window.popupBridge = {getReturnUrlPrefix: getReturnUrlPrefix, open: open_29546}; } const Store = (Flux).Store; _fun29547(Store).displayName = 'BraintreeStore'; value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {BRAINTREE_CREATE_CLIENT_SUCCESS: function(a0) { env0_12 = a0.client; }, BRAINTREE_CREATE_PAYPAL_CLIENT_SUCCESS: function(a0) { env0_13 = a0.paypalClient; }, BILLING_POPUP_BRIDGE_CALLBACK: BILLING_POPUP_BRIDGE_CALLBACK_29555, BILLING_POPUP_BRIDGE_STATE_UPDATE: function({paymentSourceType, state}) { if (paymentSourceType === PaymentSourceTypes.PAYPAL) { env0_10 = state; } }, BRAINTREE_TEARDOWN_PAYPAL_CLIENT: function() { env0_13 = null; }, BRAINTREE_CREATE_VENMO_CLIENT_SUCCESS: function(a0) { env0_14 = a0.venmoClient; }, BRAINTREE_TEARDOWN_VENMO_CLIENT: function() { env0_14 = null; }}); (FileImportTrackerModule).fileFinishedImporting('stores/billing/BraintreeStore.tsx'); exports.default = value; function _isNativeReflectConstruct_29542() { // fn#29542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3946:215, offset: 0x00fc4a3d, size: 94 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_29542_isNativeReflectConstruct = function() { return !!result; })(); } function getReturnUrlPrefix() { // fn#29545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3946:498, offset: 0x00fc4a9b, size: 117 bytes, params: 1, frame: 14 if (env0_10 == null) { throw new global.Error('popupBridgeState is unset'); } const aPIBaseURL = (HTTPUtilsModule).getAPIBaseURL(); const BILLING_POPUP_BRIDGE_CALLBACK_REDIRECT_PREFIX = Endpoints.BILLING_POPUP_BRIDGE_CALLBACK_REDIRECT_PREFIX; const BRAINTREE = PaymentGateways.BRAINTREE; return aPIBaseURL + Reflect.apply(BILLING_POPUP_BRIDGE_CALLBACK_REDIRECT_PREFIX, Endpoints, [BRAINTREE, env0_10]); } function open_29546(a0) { // fn#29546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3946:659, offset: 0x00fc4b10, size: 47 bytes, params: 2, frame: 12 env0_11 = a0; global.window.open(a0); env0_15.emitChange(); } function _fun29547(a0) { // fn#29547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3946:706, offset: 0x00fc4b3f, size: 143 bytes, params: 2, frame: 16 const BraintreeStore2 = BraintreeStore; Inherits(BraintreeStore2, a0); return CreateClass(BraintreeStore2, [{key: 'getClient', value: value_29549}, {key: 'getPayPalClient', value: value_29550}, {key: 'getVenmoClient', value: value_29551}, {key: 'getLastURL', value: value_29552}]); function BraintreeStore() { // fn#29548, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3946:718, offset: 0x00fc4bce, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_2(this, BraintreeStore); const value3 = env1_5(BraintreeStore); return env1_4(this, _isNativeReflectConstruct_29542() ? global.Reflect.construct(value3, arguments, env1_5(this).constructor) : value3.apply(this, arguments)); } function value_29549() { // fn#29549, offset: 0x00e2f9de, size: 9 bytes, params: 1, frame: 1 return env1_12; } function value_29550() { // fn#29550, offset: 0x00e2f9d5, size: 9 bytes, params: 1, frame: 1 return env1_13; } function value_29551() { // fn#29551, offset: 0x00df0f5a, size: 9 bytes, params: 1, frame: 1 return env1_14; } function value_29552() { // fn#29552, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1 return env1_11; } } function BILLING_POPUP_BRIDGE_CALLBACK_29555({paymentSourceType, state, path, query}) { // fn#29555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3946:1479, offset: 0x00fc4c69, size: 108 bytes, params: 2, frame: 15 var onComplete; const PAYPAL = PaymentSourceTypes.PAYPAL; if (paymentSourceType === PAYPAL) { if (state === env0_10) { onComplete = global.window.popupBridge.onComplete; if (typeof onComplete === 'function') { onComplete(null, {path: path, queryItems: query}); } } } } } global.__d(_fun29541, 3819, [6, 7, 15, 17, 18, 661, 477, 507, 566, 694, 2]) /* metro module 3819, dependencies: [6, 7, 15, 17, 18, 661, 477, 507, 566, 694, 2] */;