Files
2026-07-28 01:06:53 +03:00

284 lines
13 KiB
TypeScript

/* Metro module 3805; source: stores/billing/PaymentSourceStore.tsx; dependencies: [6, 7, 15, 17, 18, 3806, 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 PaymentSourceRecord from '../../records/PaymentSourceRecord.tsx'; /* Metro dependency 3806 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun29260(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29260, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:6, offset: 0x00fbdb6d, size: 353 bytes, params: 8, frame: 19
const _arrayLikeToArray_29266 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const BILLING_PAYMENT_SOURCE_CREATE_SUCCESS2 = BILLING_PAYMENT_SOURCE_CREATE_SUCCESS;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let env0_6 = {};
const Store = (Flux).Store;
let value = _fun29268(Store);
value.displayName = 'PaymentSourceStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{BILLING_PAYMENT_SOURCE_CREATE_SUCCESS: BILLING_PAYMENT_SOURCE_CREATE_SUCCESS2,
BILLING_PAYMENT_SOURCE_UPDATE_SUCCESS: BILLING_PAYMENT_SOURCE_CREATE_SUCCESS2,
BILLING_PAYMENT_SOURCE_FETCH_SUCCESS: BILLING_PAYMENT_SOURCE_CREATE_SUCCESS2,
BILLING_PAYMENT_SOURCES_FETCH_SUCCESS: BILLING_PAYMENT_SOURCES_FETCH_SUCCESS,
BILLING_PAYMENT_SOURCE_REMOVE_SUCCESS: BILLING_PAYMENT_SOURCE_REMOVE_SUCCESS_29278, LOGOUT: function() {
env0_6 = {};
env0_7 = null;
env0_8 = false;
}});
(FileImportTrackerModule).fileFinishedImporting('stores/billing/PaymentSourceStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_29261() { // fn#29261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:160, offset: 0x00fbdcce, 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_29261_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_29264(a0, a1) { // fn#29264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:353, offset: 0x00fbdd2c, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun29265;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_29266(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_29266(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_29266(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun29265;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun29265() { // fn#29265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:924, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return CreateClass >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof CreateClass === 'bigint' ? CreateClass : +CreateClass]};
}
}
function BILLING_PAYMENT_SOURCE_CREATE_SUCCESS({paymentSource}) { // fn#29267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:1284, offset: 0x00fbde9e, size: 98 bytes, params: 2, frame: 15
const object = {};
copyDataProperties(object, env0_6, undefined);
let id = paymentSource.id;
object[id] = paymentSource;
if (paymentSource.isDefault || global.Object.keys(object).length === 1) {
id = paymentSource.id;
}
}
function _fun29268(a0) { // fn#29268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:1413, offset: 0x00fbdf00, size: 214 bytes, params: 2, frame: 16
const PaymentSourceStore2 = PaymentSourceStore;
Inherits(PaymentSourceStore2, a0);
return CreateClass(PaymentSourceStore2, [{key: 'paymentSources', get: get_29270}, {key: 'paymentSourceIds',
get: get_29271}, {key: 'defaultPaymentSourceId', get: get_29272}, {key: 'defaultPaymentSource', get: get_29273},
{key: 'hasFetchedPaymentSources', get: get_29274}, {key: 'getDefaultBillingCountryCode', value: function() {
var property = this.defaultPaymentSource;
var value = null;
return value == property ? value : property.paymentMethodCountry;
}}, {key: 'getPaymentSource', value: value_29276}]);
function PaymentSourceStore() { // fn#29269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:1425, offset: 0x00fbdfd6, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_0(this, PaymentSourceStore);
const value3 = env1_3(PaymentSourceStore);
return env1_2(this, _isNativeReflectConstruct_29261() ? global.Reflect.construct(value3, arguments,
env1_3(this).constructor) : value3.apply(this, arguments));
}
function get_29270() { // fn#29270, offset: 0x00c82288, size: 9 bytes, params: 1, frame: 1
return env1_6;
}
function get_29271() { // fn#29271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:1785, offset: 0x00fbe047, size: 27 bytes, params: 1, frame: 11
const Object = global.Object;
return Object.keys(env1_6);
}
function get_29272() { // fn#29272, offset: 0x00fbd9cb, size: 9 bytes, params: 1, frame: 1
return env1_7;
}
function get_29273() { // fn#29273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:1908, offset: 0x00fbe062, size: 30 bytes, params: 1, frame: 3
const value2 = null;
return value2 != env1_7 ? env1_6[env1_7] : value2;
}
function get_29274() { // fn#29274, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
return env1_8;
}
function value_29276(a0) { // fn#29276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:2164, offset: 0x00fbe09c, size: 16 bytes, params: 2, frame: 2
return env1_6[a0];
}
}
function BILLING_PAYMENT_SOURCES_FETCH_SUCCESS({paymentSources}) { // fn#29277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:2493, offset: 0x00fbe0ac, size: 160 bytes, params: 2, frame: 19
var object2;
var r5;
var value4;
var binding;
var id;
var paymentSourceRecordBinding;
var createFromServer;
var value5;
object2 = {};
env0_7 = null;
const value2 = _createForOfIteratorHelperLoose_29264(paymentSources);
const value3 = value2();
let done = value3.done;
if (!done) {
r5 = value3;
while (true) {
value4 = r5.value;
binding = object2;
id = value4.id;
paymentSourceRecordBinding = PaymentSourceRecord;
createFromServer = paymentSourceRecordBinding.createFromServer;
binding[id] = Reflect.apply(createFromServer, paymentSourceRecordBinding, [value4]);
if (value4.default) {
id = value4.id;
env0_7 = id;
}
value5 = value2();
done = value5.done;
if (done) {
break;
}
r5 = value5;
continue;
}
}
if (env0_7 == null && paymentSources.length > 0) {
id = paymentSources[0].id;
}
}
function BILLING_PAYMENT_SOURCE_REMOVE_SUCCESS_29278({id}) { // fn#29278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3932:2763, offset: 0x00fbe14c, size: 87 bytes, params: 2, frame: 14
var object3;
var r0;
var value2;
const object = {};
copyDataProperties(object, object3, undefined);
object3 = object;
delete object[id];
if (env0_7 === id) {
value2 = global.Object.keys(object3);
r0 = value2.length === 0 ? null : value2[0];
}
}
}
global.__d(_fun29260, 3805, [6, 7, 15, 17, 18, 3806, 566, 694,
2]) /* metro module 3805, dependencies: [6, 7, 15, 17, 18, 3806, 566, 694, 2] */;