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

672 lines
27 KiB
TypeScript

/* Metro module 7300; source: modules/payments/OrderActionCreators.tsx; dependencies: [5, 7, 6, 15, 17, 18, 661, 3, 3824, 507, 3817, 2] */
import Logger from '../debug/Logger.tsx'; /* Metro dependency 3 */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
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 * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun58957(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:6, offset: 0x016dc39b, size: 380 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = Logger;
value = new value('OrderActionCreators');
value = importDefault(3824) /* metro dependency 3824: BillingError */;
value = _fun58971(value);
const value4 = _fun58973(importDefault(3824) /* metro dependency 3824: BillingError */);
(FileImportTrackerModule).fileFinishedImporting('modules/payments/OrderActionCreators.tsx');
exports.OrderSigningFailedWithConstraintsError = value;
exports.OrderProcessingPendingError = value4;
exports.signOrder = function() {
return _signOrder.apply(this, arguments);
};
exports.getOrder = function() {
return _getOrder.apply(this, arguments);
};
exports.fetchOrderEntitlements = function() {
return _fetchOrderEntitlements.apply(this, arguments);
};
function _callSuper_58958(a0, a1, a2) { // fn#58958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:178, offset: 0x016dc517, size: 100 bytes, params: 4, frame: 20
var r0;
var Reflect;
let value = a2;
const value3 = Module00017(a1);
if (_isNativeReflectConstruct_58959()) {
Reflect = global.Reflect;
value = Reflect.construct(value3, value || [], Module00017(a0).constructor);
r0 = value;
} else {
value = value3.apply(a0, value);
r0 = value;
}
return PossibleConstructorReturn(a0, r0);
}
function _isNativeReflectConstruct_58959() { // fn#58959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:309, offset: 0x016dc57b, 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_58959_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _signOrder() { // fn#58962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1184, offset: 0x016dc5d9, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun58964).apply(this, arguments);
async function _fun58964(a0) { // fn#58964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1227, offset: 0x016dc61b, size: 400 bytes, params: 2, frame: 22
var r9;
var r4;
var value;
var value2;
var orderId;
var expectedRevision;
var loadId;
var value3;
var value4;
var object;
var value5;
var binding;
var binding2;
var property;
var value6;
var HTTP;
var post;
var object2;
var ORDER_SIGN;
var value7;
var value8;
var value9;
var value10;
var value11;
var value12;
var body;
var error;
var HTTPResponseError;
exceptionSkip39: while (true) {
exceptionLanding39: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
orderId = a0.orderId;
expectedRevision = a0.expectedRevision;
loadId = a0.loadId;
value = undefined;
await value;
value3 = undefined;
value4 = false;
if (value4) {
return value3;
}
object = {};
if (expectedRevision != null) {
object.expected_revision = expectedRevision;
}
value5 = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
break exceptionLanding39;
}
try {
binding2 = env2_1;
} catch (error) {
break exceptionLanding39;
}
try {
property = binding2[9];
} catch (error) {
break exceptionLanding39;
}
try {
value6 = binding(property);
} catch (error) {
break exceptionLanding39;
}
try {
HTTP = value6.HTTP;
} catch (error) {
break exceptionLanding39;
}
try {
post = HTTP.post;
} catch (error) {
break exceptionLanding39;
}
try {
object2 = {};
} catch (error) {
break exceptionLanding39;
}
try {
binding = env2_8;
} catch (error) {
break exceptionLanding39;
}
try {
ORDER_SIGN = binding.ORDER_SIGN;
} catch (error) {
break exceptionLanding39;
}
try {
value7 = Reflect.apply(ORDER_SIGN, binding, [orderId]);
} catch (error) {
break exceptionLanding39;
}
try {
object2.url = value7;
} catch (error) {
break exceptionLanding39;
}
try {
object2.body = object;
} catch (error) {
break exceptionLanding39;
}
try {
value8 = loadId != null;
} catch (error) {
break exceptionLanding39;
}
if (value8) {
try {
value9 = loadId === '';
} catch (error) {
break exceptionLanding39;
}
if (value9) {
r9 = value;
break;
}
try {
object = {};
} catch (error) {
break exceptionLanding39;
}
try {
object.load_id = loadId;
} catch (error) {
break exceptionLanding39;
}
r9 = object;
break;
}
r9 = value;
try {
object2.context = r9;
} catch (error) {
break exceptionLanding39;
}
try {
object2.rejectWithError = true;
} catch (error) {
break exceptionLanding39;
}
try {
value10 = Reflect.apply(post, HTTP, [object2]);
} catch (error) {
break exceptionLanding39;
}
await value10;
try {
value11 = undefined;
value12 = false;
} catch (error) {
break exceptionLanding39;
}
if (value12) {
return value11;
}
body = value11.body;
if (body == null) {
throw new global.Error('Invalid sign order response');
}
return value11.body;
break exceptionSkip39;
}
binding = env2_0;
HTTPResponseError = binding(env2_1[9]).HTTPResponseError;
if (error instanceof HTTPResponseError) {
if (error.status !== 400) {
throw error;
}
body = error.body;
value = body != null;
if (value) {
r4 = typeof body === 'object';
if (r4) {
r4 = 'id' in body;
if (r4) {
if ('status' in body) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
if (r4) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
if (r4) {
if ('status' in body) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
if (r4) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
r4 = value;
if (r4) {
r4 = 'id' in body;
if (r4) {
if ('status' in body) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
if (r4) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
if (r4) {
if ('status' in body) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
if (r4) {
binding = env2_10;
body = error.body;
throw new binding();
}
throw error;
}
throw error;
break exceptionSkip39;
}
}
}
function _getOrder() { // fn#58965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1736, offset: 0x016dc7ab, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun58967).apply(this, arguments);
function* _fun58967(a0) { // fn#58967, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:1777, offset: 0x016dc7e4, size: 225 bytes, params: 2, frame: 18
var binding;
var binding2;
var property;
var value3;
var HTTP;
var get;
var object;
var ORDER_GET;
var value4;
var value5;
var value6;
var value7;
var body;
var error;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
binding2 = env2_1;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
property = binding2[9];
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
value3 = binding(property);
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
HTTP = value3.HTTP;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
get = HTTP.get;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
object = {};
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
binding = env2_8;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
ORDER_GET = binding.ORDER_GET;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
value4 = Reflect.apply(ORDER_GET, binding, [a0]);
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
object.url = value4;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
object.rejectWithError = true;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
try {
value5 = Reflect.apply(get, HTTP, [object]);
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
if (value7) {
return value6;
}
try {
body = value6.body;
} catch (error) {
binding = env2_9;
binding.error('failed to fetch order', {error: error, orderId: a0});
binding = env2_0;
value = binding(env2_1[10]);
value.captureBillingException(error, {tags: {source: 'OrderActionCreators_getOrder'}, extra: {orderId: a0}});
return null;
}
return body || null;
}
}
function _fetchOrderEntitlements() { // fn#58968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:2079, offset: 0x016dc8c5, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun58970).apply(this, arguments);
function* _fun58970(a0) { // fn#58970, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:2148, offset: 0x016dc8fe, size: 135 bytes, params: 2, frame: 16
var r2;
var binding;
var binding2;
var property;
var value3;
var HTTP;
var get;
var object;
var ORDER_ENTITLEMENTS;
var value4;
var body;
var value5;
var error;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
try {
binding = env2_0;
} catch (error) {
return [];
}
try {
binding2 = env2_1;
} catch (error) {
return [];
}
try {
property = binding2[9];
} catch (error) {
return [];
}
try {
value3 = binding(property);
} catch (error) {
return [];
}
try {
HTTP = value3.HTTP;
} catch (error) {
return [];
}
try {
get = HTTP.get;
} catch (error) {
return [];
}
try {
object = {};
} catch (error) {
return [];
}
try {
binding = env2_8;
} catch (error) {
return [];
}
try {
ORDER_ENTITLEMENTS = binding.ORDER_ENTITLEMENTS;
} catch (error) {
return [];
}
try {
value = Reflect.apply(ORDER_ENTITLEMENTS, binding, [a0]);
} catch (error) {
return [];
}
try {
object.url = value;
} catch (error) {
return [];
}
try {
object.rejectWithError = false;
} catch (error) {
return [];
}
try {
value = Reflect.apply(get, HTTP, [object]);
} catch (error) {
return [];
}
yield value;
try {
value = undefined;
value4 = false;
} catch (error) {
return [];
}
if (value4) {
return value;
}
try {
body = value.body;
} catch (error) {
return [];
}
try {
value5 = body != null;
} catch (error) {
return [];
}
if (value5) {
try {
body = value.body;
} catch (error) {
return [];
}
r2 = body;
} else {
try {
object = [];
} catch (error) {
return [];
}
r2 = object;
}
return r2;
}
}
function _fun58971(a0) { // fn#58971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:546, offset: 0x016dc985, size: 40 bytes, params: 2, frame: 14
const OrderSigningFailedWithConstraintsError2 = OrderSigningFailedWithConstraintsError;
Inherits(OrderSigningFailedWithConstraintsError2, a0);
return CreateClass(OrderSigningFailedWithConstraintsError2);
function OrderSigningFailedWithConstraintsError(a0) { // fn#58972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:558, offset: 0x016dc9ad, size: 57 bytes, params: 2, frame: 15
let value = environment.__proto__;
env1_4(this, OrderSigningFailedWithConstraintsError);
value = _callSuper_58958(this, OrderSigningFailedWithConstraintsError,
['Order signing failed due to unsatisfied constraints']);
value.order = a0;
return value;
}
}
function _fun58973(a0) { // fn#58973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:900, offset: 0x016dc9e6, size: 40 bytes, params: 2, frame: 14
const OrderProcessingPendingError2 = OrderProcessingPendingError;
Inherits(OrderProcessingPendingError2, a0);
return CreateClass(OrderProcessingPendingError2);
function OrderProcessingPendingError() { // fn#58974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7478:912, offset: 0x016dca0e, size: 48 bytes, params: 1, frame: 15
env1_4(this, OrderProcessingPendingError);
return _callSuper_58958(this, OrderProcessingPendingError,
['Order signed but entitlements not yet visible after polling']);
}
}
}
global.__d(_fun58957, 7300, [5, 7, 6, 15, 17, 18, 661, 3, 3824, 507, 3817,
2]) /* metro module 7300, dependencies: [5, 7, 6, 15, 17, 18, 661, 3, 3824, 507, 3817, 2] */;