Files
discord-decomp/sources/modules/premium/PremiumSubscriptionInvoice.tsx
T
2026-07-27 16:20:00 +03:00

1944 lines
76 KiB
TypeScript

/* Metro module 7545; source: modules/premium/PremiumSubscriptionInvoice.tsx; dependencies: [29, 57, 5, 31, 3811, 661, 3802, 507, 694, 4131, 44, 4141, 2] */
function _fun60640(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:6, offset: 0x01709111, size: 415 bytes, params: 8, frame: 24
let env0_0 = require;
const closure = function() {
return _createSubscriptionInvoicePreview.apply(this, arguments);
};
const closure2 = function() {
return _updateSubscriptionInvoicePreview.apply(this, arguments);
};
const closure3 = function() {
return _createOneTimePurchaseInvoicePreview.apply(this, arguments);
};
const closure4 = function() {
return _getSubscriptionInvoice.apply(this, arguments);
};
const closure5 = useFetchGenericInvoicePreview;
const getPaymentSourceIdFromInvoiceRecord = function({checkoutContext}) {
var r5;
var r2;
var r0;
var value3;
var value = null;
var value2 = undefined;
r5 = value == checkoutContext ? value2 : checkoutContext.payment_sources;
if (value == r5) {
r0 = value;
} else {
value3 = r5.find(_fun60667);
r2 = value == value3 ? value2 : value3.id;
r0 = value != r2 ? r2 : value;
}
return r0;
};
const env0_3 = ['subscriptionId'];
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(29) /* metro dependency 29 */;
const env0_5 = importDefault(57) /* metro dependency 57 */;
const env0_6 = importDefault(5) /* metro dependency 5 */;
let value = require(31) /* metro dependency 31 */;
const env0_7 = value.useCallback;
const env0_8 = value.useEffect;
const env0_9 = value.useState;
const env0_10 = value.useRef;
const invoiceRecord = importDefault(3811) /* metro dependency 3811: InvoiceRecord */;
const env0_12 = (require(661) /* metro dependency 661: Constants */).Endpoints;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/PremiumSubscriptionInvoice.tsx');
exports.createSubscriptionInvoicePreview = closure;
exports.updateSubscriptionInvoicePreview = closure2;
exports.createOneTimePurchaseInvoicePreview = closure3;
exports.getSubscriptionInvoice = closure4;
exports.useFetchGenericInvoicePreview = closure5;
exports.useFetchSubscriptionGiftInvoicePreview = function(a0, a1) {
var env0_0 = a0;
var env0_1 = useRef(a0);
var env0_2 = useRef(false);
useEffect(_fun60669);
var JSON = global.JSON;
return useFetchGenericInvoicePreview(a0, useCallback(_fun60670, [JSON.stringify(a0)]), a1);
};
exports.useFetchSubscriptionInvoicePreview = useFetchSubscriptionInvoicePreview;
exports.useGetSubscriptionInvoice = function(a0, a1) {
var env0_0 = a0;
var env0_1 = useRef(a0);
useEffect(_fun60680);
var JSON = global.JSON;
return useFetchGenericInvoicePreview(a0, useCallback(_fun60681, [JSON.stringify(a0)]), a1);
};
exports.getItemUnitPriceWithDiscount = getItemUnitPriceWithDiscount;
}
function _createSubscriptionInvoicePreview() { // fn#60642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:354, offset: 0x017092b0, size: 48 bytes, params: 1, frame: 14
return env0_6(_fun60644).apply(this, arguments);
}
function _updateSubscriptionInvoicePreview() { // fn#60647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:1302, offset: 0x017094c1, size: 48 bytes, params: 1, frame: 14
return env0_6(_fun60649).apply(this, arguments);
}
function _createOneTimePurchaseInvoicePreview() { // fn#60652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:2369, offset: 0x017096ff, size: 48 bytes, params: 1, frame: 14
return env0_6(_fun60654).apply(this, arguments);
}
function _getSubscriptionInvoice() { // fn#60656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:3022, offset: 0x01709860, size: 48 bytes, params: 1, frame: 14
return env0_6(_fun60658).apply(this, arguments);
}
function useFetchGenericInvoicePreview({preventFetch}, a1, a2) { // fn#60659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:3326, offset: 0x0170993e, size: 161 bytes, params: 4, frame: 20
preventFetch = !(preventFetch === undefined) && preventFetch;
let env0_1 = a1;
const [property, env0_2] = env0_5(useState(null), 2);
const [property2, env0_3] = env0_5(useState(null), 2);
useEffect(function() {
var env0_1 = _fun60661;
var env0_0 = false;
if (!preventFetch) {
_fun60664();
}
return _fun60665;
}, [preventFetch, a1, a2]);
return [property, property2];
}
function getPaymentSourceIdFromInvoiceRecord({checkoutContext}) { // fn#60666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:3739, offset: 0x01709ab7, size: 84 bytes, params: 2, frame: 14
const payment_sources = checkoutContext?.payment_sources;
return payment_sources == null ? null : payment_sources.find(function(a0) {
return a0.enabled;
})?.id ?? null;
}
function useFetchSubscriptionGiftInvoicePreview(a0, a1) { // fn#60668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:4382, offset: 0x01709b0b, size: 110 bytes, params: 3, frame: 17
const env0_0 = a0;
const env0_1 = useRef(a0);
const env0_2 = useRef(false);
useEffect(_fun60669);
const JSON = global.JSON;
return useFetchGenericInvoicePreview(a0, useCallback(_fun60670, [JSON.stringify(a0)]), a1);
}
function useFetchSubscriptionInvoicePreview(a0, a1) { // fn#60671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:4718, offset: 0x01709bca, size: 223 bytes, params: 3, frame: 21
var r3;
let value = a0;
if ('subscriptionId' in value) {
if (value.subscriptionId != null) {
r3 = value;
} else {
value.subscriptionId;
value = env0_4(value, env0_3);
r3 = value;
}
} else {
r3 = value;
}
const env0_1 = useRef(r3);
const env0_2 = useRef(false);
const {serverPricedPreviewRef, shouldReturnInvoiceCache,
updateServerPricedPreviewRef} = useServerProvidedInvoiceCache(a1);
useEffect(_fun60676);
const JSON = global.JSON;
return useFetchGenericInvoicePreview(r3, useCallback(_fun60677, [JSON.stringify(r3), serverPricedPreviewRef,
shouldReturnInvoiceCache, updateServerPricedPreviewRef]), a1);
}
function useGetSubscriptionInvoice(a0, a1) { // fn#60679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:5959, offset: 0x01709ec7, size: 99 bytes, params: 3, frame: 17
const env0_0 = a0;
const env0_1 = useRef(a0);
useEffect(_fun60680);
const JSON = global.JSON;
return useFetchGenericInvoicePreview(a0, useCallback(_fun60681, [JSON.stringify(a0)]), a1);
}
function getItemUnitPriceWithDiscount(a0) { // fn#60682, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:6183, offset: 0x01709f46, size: 46 bytes, params: 2, frame: 12
const env0_0 = a0;
const env0_1 = a0.subscriptionPlanPrice;
a0.discounts.forEach(_fun60683);
return env0_1;
}
async function _fun60644({items, paymentSourceId, trialId, code, applyEntitlements, currency, renewal, metadata, loadId}) { // fn#60644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:443, offset: 0x017092f2, size: 463 bytes, params: 2, frame: 28
var payment_sources;
var binding2;
var property;
var value9;
var HTTP;
var post;
var object3;
var BILLING_SUBSCRIPTIONS_PREVIEW;
var value10;
var value11;
var value12;
var createInvoiceFromServer;
var body;
var invoiceFromServer;
var checkoutContext;
var value13;
var value14;
var binding3;
var value15;
var dispatch;
var error;
var BillingError;
var prototype;
var billingError;
if (false) {
return undefined;
}
value = undefined;
applyEntitlements = !(applyEntitlements === value) && applyEntitlements;
await value;
if (false) {
return undefined;
}
let object4 = {};
let binding = env2_0;
object4.items = binding(env2_2[6]).coerceExistingItemsToNewItemInterval(items).map(function(a0) {
var planId = a0.planId;
var value = Object.create(null);
value.planId = 0;
var value2 = copyDataProperties({}, a0, value, a0);
var object = {};
copyDataProperties(object, value2, value);
object['plan_id'] = planId;
return object;
});
object4.payment_source_id = paymentSourceId;
object4.trial_id = trialId;
object4.code = code;
object4.apply_entitlements = applyEntitlements;
object4.currency = currency;
object4.renewal = renewal;
object4.metadata = metadata;
object4.load_id = loadId;
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding2 = env2_2;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
property = binding2[7];
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value9 = binding(property);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
HTTP = value9.HTTP;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
post = HTTP.post;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding = env2_12;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
BILLING_SUBSCRIPTIONS_PREVIEW = binding.BILLING_SUBSCRIPTIONS_PREVIEW;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.url = BILLING_SUBSCRIPTIONS_PREVIEW;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.body = object4;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.oldFormErrors = true;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.rejectWithError = false;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value10 = Reflect.apply(post, HTTP, [object3]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
await value10;
try {
value11 = undefined;
value12 = false;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (value12) {
return value11;
}
try {
binding = env2_11;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
createInvoiceFromServer = binding.createInvoiceFromServer;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
body = value11.body;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
invoiceFromServer = Reflect.apply(createInvoiceFromServer, binding, [body]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
checkoutContext = invoiceFromServer.checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value13 = checkoutContext == null;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (value13) {
payment_sources = value;
} else {
try {
payment_sources = checkoutContext.payment_sources;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
}
try {
value14 = payment_sources == null;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (!value14) {
try {
binding = env2_1;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding3 = env2_2;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
property = binding3[8];
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value15 = binding(property);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
dispatch = value15.dispatch;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.type = 'SUBSCRIPTION_PREVIEW_CHECKOUT_CONTEXT_UPDATE';
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
checkoutContext = invoiceFromServer.checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.checkoutContext = checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.paymentSourceId = paymentSourceId;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
Reflect.apply(dispatch, value15, [object4]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
}
return invoiceFromServer;
}
async function _fun60649({subscriptionId, items, paymentSourceId, renewal, currency, applyEntitlements, analyticsLocations, analyticsLocation, userDiscountOfferId}) { // fn#60649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:1391, offset: 0x01709503, size: 508 bytes, params: 2, frame: 28
var environment;
var r19;
var payment_sources;
var r6;
var value6;
var binding;
var binding2;
var property;
var value11;
var HTTP;
var patch;
var object4;
var BILLING_SUBSCRIPTION_PREVIEW;
var value12;
var object5;
var value13;
var value14;
var value15;
var createInvoiceFromServer;
var body;
var invoiceFromServer;
var value16;
var checkoutContext;
var value17;
var value18;
var binding3;
var value19;
var dispatch;
var error;
var BillingError;
var prototype;
var billingError;
if (false) {
return undefined;
}
value = undefined;
applyEntitlements = !(applyEntitlements === value) && applyEntitlements;
await value;
if (false) {
return undefined;
}
if (items == null) {
r19 = items;
} else {
value6 = environment.__proto__.__proto__;
binding = env2_0;
r19 = binding(env2_2[6]).coerceExistingItemsToNewItemInterval(items);
}
let object6 = {};
object6.items = r19 == null ? value : r19.map(function(a0) {
var planId = a0.planId;
var value = Object.create(null);
value.planId = 0;
var value2 = copyDataProperties({}, a0, value, a0);
var object = {};
copyDataProperties(object, value2, value);
object['plan_id'] = planId;
return object;
});
object6.payment_source_id = paymentSourceId;
object6.renewal = renewal;
object6.apply_entitlements = applyEntitlements;
object6.currency = currency;
object6.user_discount_offer_id = userDiscountOfferId;
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding2 = env2_2;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
property = binding2[7];
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value11 = binding(property);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
HTTP = value11.HTTP;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
patch = HTTP.patch;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding = env2_12;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
BILLING_SUBSCRIPTION_PREVIEW = binding.BILLING_SUBSCRIPTION_PREVIEW;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value12 = Reflect.apply(BILLING_SUBSCRIPTION_PREVIEW, binding, [subscriptionId]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.url = value12;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object5 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object5.location = analyticsLocation;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object5.location_stack = analyticsLocations;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.query = object5;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.body = object6;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.oldFormErrors = true;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.rejectWithError = false;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value13 = Reflect.apply(patch, HTTP, [object4]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
await value13;
try {
value14 = undefined;
value15 = false;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (value15) {
return value14;
}
try {
binding = env2_11;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
createInvoiceFromServer = binding.createInvoiceFromServer;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
body = value14.body;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
invoiceFromServer = Reflect.apply(createInvoiceFromServer, binding, [body]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value16 = paymentSourceId != null;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (value16) {
try {
checkoutContext = invoiceFromServer.checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value17 = checkoutContext == null;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (value17) {
try {
value18 = value != null;
r6 = value18;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (r6) {
try {
binding = env2_1;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding3 = env2_2;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
property = binding3[8];
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value19 = binding(property);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
dispatch = value19.dispatch;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.type = 'SUBSCRIPTION_PREVIEW_CHECKOUT_CONTEXT_UPDATE';
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
checkoutContext = invoiceFromServer.checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.checkoutContext = checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.paymentSourceId = paymentSourceId;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
Reflect.apply(dispatch, value19, [object6]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
return invoiceFromServer;
}
return invoiceFromServer;
}
try {
payment_sources = checkoutContext.payment_sources;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value18 = payment_sources != null;
r6 = value18;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (r6) {
try {
binding = env2_1;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding3 = env2_2;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
property = binding3[8];
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value19 = binding(property);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
dispatch = value19.dispatch;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.type = 'SUBSCRIPTION_PREVIEW_CHECKOUT_CONTEXT_UPDATE';
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
checkoutContext = invoiceFromServer.checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.checkoutContext = checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.paymentSourceId = paymentSourceId;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
Reflect.apply(dispatch, value19, [object6]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
return invoiceFromServer;
}
} else if (value16) {
try {
binding = env2_1;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding3 = env2_2;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
property = binding3[8];
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value19 = binding(property);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
dispatch = value19.dispatch;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.type = 'SUBSCRIPTION_PREVIEW_CHECKOUT_CONTEXT_UPDATE';
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
checkoutContext = invoiceFromServer.checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.checkoutContext = checkoutContext;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object6.paymentSourceId = paymentSourceId;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
Reflect.apply(dispatch, value19, [object6]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
return invoiceFromServer;
}
return invoiceFromServer;
}
async function _fun60654({paymentSourceId, skuId, subscriptionPlanId, currency, loadId}) { // fn#60654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:2464, offset: 0x01709741, size: 287 bytes, params: 2, frame: 23
var binding2;
var property;
var value5;
var httpGetWithCountryCodeQuery;
var object3;
var STORE_SKU_PURCHASE;
var value6;
var object4;
var value7;
var value8;
var value9;
var createInvoiceFromServer;
var body;
var invoiceFromServer;
var error;
var BillingError;
var prototype;
var billingError;
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_1;
binding(env2_2[10])(skuId, 'SKU ID is missing for one time purchase gift invoice preview');
try {
binding = env2_0;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding2 = env2_2;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
property = binding2[11];
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value5 = binding(property);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
httpGetWithCountryCodeQuery = value5.httpGetWithCountryCodeQuery;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
binding = env2_12;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
STORE_SKU_PURCHASE = binding.STORE_SKU_PURCHASE;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value6 = Reflect.apply(STORE_SKU_PURCHASE, binding, [skuId]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.url = value6;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4 = {};
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.gift = true;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.payment_source_id = paymentSourceId;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.sku_subscription_plan_id = subscriptionPlanId;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.currency = currency;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object4.load_id = loadId;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.query = object4;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.oldFormErrors = true;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
object3.rejectWithError = false;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
value7 = Reflect.apply(httpGetWithCountryCodeQuery, value5, [object3]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
await value7;
try {
value8 = undefined;
value9 = false;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
if (value9) {
return value8;
}
try {
binding = env2_11;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
createInvoiceFromServer = binding.createInvoiceFromServer;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
body = value8.body;
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
try {
invoiceFromServer = Reflect.apply(createInvoiceFromServer, binding, [body]);
} catch (error) {
binding = env2_0;
BillingError = binding(env2_2[9]).BillingError;
prototype = BillingError.prototype;
value = Object.create(prototype, {constructor: {value: BillingError}});
billingError = new BillingError();
value = billingError instanceof Object ? billingError : value;
throw value;
}
return invoiceFromServer;
}
async function _fun60658({subscriptionId, preventFetch}) { // fn#60658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:3091, offset: 0x017098a2, size: 156 bytes, params: 2, frame: 17
if (false) {
return undefined;
}
await undefined;
if (false) {
return undefined;
}
if (preventFetch) {
return null;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const HTTP = binding(env2_2[7]).HTTP;
const get = HTTP.get;
const object2 = {'url': null, 'oldFormErrors': true, 'rejectWithError': false};
object2.url = env2_12.BILLING_SUBSCRIPTION_INVOICE(subscriptionId);
await Reflect.apply(get, HTTP, [object2]);
if (false) {
return undefined;
}
binding = env2_11;
return binding.createInvoiceFromServer(undefined.body);
}
function _fun60660() { // fn#60660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:3470, offset: 0x017099df, size: 45 bytes, params: 1, frame: 10
if (!preventFetch) {
(function() {
return _loadPreview.apply(this, arguments);
})();
}
return function() {
env0_0 = true;
};
}
function _fun60670() { // fn#60670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:4506, offset: 0x01709b79, size: 81 bytes, params: 1, frame: 14
var r2;
var object2;
const current = env0_1.current;
if (env0_2.current) {
r2 = current;
} else {
object2 = {};
copyDataProperties(object2, current, undefined);
object2['paymentSourceId'] = null;
r2 = object2;
}
env0_2.current = true;
return createOneTimePurchaseInvoicePreview(r2);
}
function useServerProvidedInvoiceCache(a0) { // fn#60672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:4877, owner: useFetchSubscriptionInvoicePreview.useServerProvidedInvoiceCache, offset: 0x01709ca9, size: 101 bytes, params: 2, frame: 16
var environment;
const value = environment.__proto__;
const value2 = useRef(null);
useEffect(_fun60673, [a0]);
return {serverPricedPreviewRef: value2, shouldReturnInvoiceCache: useCallback(_fun60674, []),
updateServerPricedPreviewRef: useCallback(_fun60675, [])};
}
function _fun60677() { // fn#60677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:5484, offset: 0x01709d9a, size: 263 bytes, params: 1, frame: 18
var environment;
var r2;
var r1;
var object2;
var JSON;
var stringify;
var value2;
var Promise;
var value;
let current = env0_1.current;
if (env0_2.current) {
r2 = current;
} else {
object2 = {};
copyDataProperties(object2, current, undefined);
object2['paymentSourceId'] = null;
r2 = object2;
}
if ('subscriptionId' in r2) {
env0_2.current = true;
value = environment.__proto__;
return updateSubscriptionInvoicePreview(r2);
}
if ('items' in r2) {
env0_2.current = true;
JSON = global.JSON;
stringify = JSON.stringify;
object2 = {};
copyDataProperties(object2, r2, undefined);
object2['paymentSourceId'] = 'exclude_from_dedupe';
value2 = Reflect.apply(stringify, JSON, [object2]);
current = serverPricedPreviewRef.current;
if (current == null) {
value = environment.__proto__;
value = createSubscriptionInvoicePreview(r2);
value = value.then(_fun60678);
r1 = value;
} else if (shouldReturnInvoiceCache(r2, value2)) {
Promise = global.Promise;
r1 = Promise.resolve(current.record);
} else {
value = environment.__proto__;
value = createSubscriptionInvoicePreview(r2);
value = value.then(_fun60678);
r1 = value;
}
return r1;
}
return null;
}
function _fun60681() { // fn#60681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:6062, offset: 0x01709f2a, size: 28 bytes, params: 1, frame: 11
return getSubscriptionInvoice(env0_1.current);
}
function _fun60683({amount}) { // fn#60683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:6282, offset: 0x01709f74, size: 42 bytes, params: 2, frame: 3
env0_1 = subscriptionPlanPrice - amount / env0_0.quantity;
}
function _loadPreview() { // fn#60661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:3484, offset: 0x01709a0c, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__.__proto__;
return env2_6(_fun60663).apply(this, arguments);
}
function _fun60674(a0, a1) { // fn#60674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:4972, offset: 0x01709d0e, size: 71 bytes, params: 3, frame: 5
const current = env0_0.current;
return current != null && a0.paymentSourceId != null && a0.paymentSourceId === current.serverSelectedPaymentSourceId && a1 === current.dedupeKey;
}
function _fun60675(a0, a1, a2) { // fn#60675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:5117, offset: 0x01709d55, size: 69 bytes, params: 4, frame: 14
var r0;
var object2;
const binding = env0_0;
let value = null;
if (value == a2) {
object2 = {record: a0, dedupeKey: a1};
value = environment.__proto__.__proto__;
object2.serverSelectedPaymentSourceId = getPaymentSourceIdFromInvoiceRecord(a0);
r0 = object2;
} else {
r0 = value;
}
binding.current = r0;
}
function _fun60678(a0) { // fn#60678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:5826, offset: 0x01709ea1, size: 38 bytes, params: 2, frame: 15
updateServerPricedPreviewRef(a0, env0_1, env0_0.paymentSourceId);
return a0;
}
function* _fun60663() { // fn#60663, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7723:3531, offset: 0x01709a48, size: 111 bytes, params: 1, frame: 15
var binding;
var defaultImport;
var value3;
var value4;
var preventFetchBinding;
var error;
var value6;
if (true) {
value = environment.__proto__.__proto__.__proto__;
try {
binding = env3_3;
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
return undefined;
}
try {
binding(null);
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
return undefined;
}
try {
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
return undefined;
}
try {
defaultImport = importDefault();
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
return undefined;
}
yield defaultImport;
try {
value3 = undefined;
value4 = false;
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
return undefined;
}
if (value4) {
return value3;
}
try {
preventFetchBinding = preventFetch;
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
return undefined;
}
if (!preventFetchBinding) {
try {
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
return undefined;
}
try {
dependencyMap(value3);
} catch (error) {
value6 = environment.__proto__.__proto__;
if (!preventFetch) {
env3_3(error);
dependencyMap(null);
}
}
}
}
}