576 lines
30 KiB
TypeScript
576 lines
30 KiB
TypeScript
/* Metro module 7509; source: components_native/premium/PremiumSubscriptionDetails.tsx; dependencies: [57, 5, 31, 27, 1878, 5140, 661, 1880, 33, 697, 4501, 3802, 7305, 7510, 7511, 7302, 7303, 7304, 7306, 7512, 7513, 7514, 7250, 7515, 7516, 7517, 7518, 7519, 7307, 7520, 7521, 7522, 7523, 7524, 7525, 7526, 7310, 7527, 7528, 7529, 7312, 7530, 7531, 7532, 7294, 7355, 7533, 7534, 7026, 1484, 566, 44, 6771, 5137, 477, 1305, 4578, 1244, 4573, 7545, 6789, 7546, 7547, 2] */
|
|
function _fun60564(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:6, offset: 0x01706009, size: 3084 bytes, params: 8, frame: 40
|
|
var object3;
|
|
const env0_0 = require;
|
|
const handleCancelSubscription = function() {
|
|
return _handleCancelSubscription.apply(this, arguments);
|
|
};
|
|
const closure = onCancelClick;
|
|
const closure2 = handleManageSubscription;
|
|
const closure3 = function() {
|
|
return _onResubscribeClick.apply(this, arguments);
|
|
};
|
|
const closure4 = PremiumSubscriptionHeader;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importDefault(5) /* metro dependency 5 */;
|
|
importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value.Image;
|
|
const env0_6 = value.ImageBackground;
|
|
const env0_7 = value.Linking;
|
|
const env0_8 = value.View;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const iapStoreAndroid = importDefault(5140) /* metro dependency 5140: IAPStoreAndroid */;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_11 = value.AnalyticsPages;
|
|
const env0_12 = value.AnalyticsSections;
|
|
const env0_13 = value.SubscriptionStatusTypes;
|
|
const USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING = value.USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING;
|
|
const env0_14 = (require(1880) /* metro dependency 1880: PremiumConstants */).SubscriptionPlanInfo;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_15 = value.jsx;
|
|
const env0_16 = value.jsxs;
|
|
object3 = {imageTier2: {'height': 37, 'width': 49}, imageTier1: {'height': 35, 'width': 49},
|
|
imageTier0: {'height': 35, 'width': 29}, imageBundle: {'height': 35, 'width': 49},
|
|
imagePremiumNonActive: {'height': 36, 'width': 51}, imagePremiumGuild: {'width': 51, 'height': 36},
|
|
imagePremiumGuildNonActive: {'width': 51, 'height': 36}, logoPremiumBundle: {'height': 33, 'width': 205},
|
|
logoPremiumTier0: {'height': 32, 'width': 59}, logoPremiumTier1: {'height': 16, 'width': 156},
|
|
logoPremiumTier2: {'height': 32, 'width': 78}, logoPremiumGuild: {'height': 17, 'width': 184}};
|
|
const object4 = {};
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
object4.price = {'fontSize': 14, 'marginTop': 10, color: WHITE};
|
|
const BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
|
|
object4.priceDark = {'fontSize': 14, 'marginTop': 10, color: BLACK};
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object6 = {};
|
|
object6.title = {paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING};
|
|
object6.header = {padding: 16};
|
|
object6.wumpusImg = {marginRight: 10};
|
|
object6.logoContainer = {'flexDirection': 'row', 'alignItems': 'center'};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object6.container = {'marginTop': 8, 'overflow': 'hidden', backgroundColor: BACKGROUND_BASE_LOWEST};
|
|
object6.buttonContainer = {'marginTop': 8, 'flexDirection': 'row'};
|
|
object6.buttonWrapper = {'alignSelf': 'flex-start', 'flexGrow': 0, 'flexShrink': 0, 'marginRight': 8};
|
|
object6.cancelLink = {'alignSelf': 'flex-start', 'flexGrow': 0, 'flexShrink': 0, 'marginLeft': 16, 'marginTop': 2};
|
|
object6.desktopSubtext = {marginTop: 8, paddingHorizontal: USER_SETTINGS_CONTAINER_HORIZONTAL_PADDING};
|
|
const env0_17 = Reflect.apply(createStyles, value, [object6]);
|
|
const object7 = {ACTIVE: 'active', RESUB: 'resub', ERROR: 'error'};
|
|
const object8 = {};
|
|
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
|
|
let BUNDLE = Branding.BUNDLE;
|
|
const object9 = {};
|
|
let ACTIVE = object7.ACTIVE;
|
|
object9[ACTIVE] = importDefault(7305) /* metro dependency 7305 */;
|
|
let ERROR = object7.ERROR;
|
|
object9[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
let RESUB = object7.RESUB;
|
|
object9[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object8[BUNDLE] = object9;
|
|
let TIER_0 = Branding.TIER_0;
|
|
const object10 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object10[ACTIVE] = importDefault(7302) /* metro dependency 7302 */;
|
|
ERROR = object7.ERROR;
|
|
object10[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
RESUB = object7.RESUB;
|
|
object10[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object8[TIER_0] = object10;
|
|
let TIER_1 = Branding.TIER_1;
|
|
const object25 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object25[ACTIVE] = importDefault(7303) /* metro dependency 7303 */;
|
|
ERROR = object7.ERROR;
|
|
object25[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
RESUB = object7.RESUB;
|
|
object25[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object8[TIER_1] = object25;
|
|
let TIER_2 = Branding.TIER_2;
|
|
const object26 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object26[ACTIVE] = importDefault(7304) /* metro dependency 7304 */;
|
|
ERROR = object7.ERROR;
|
|
object26[ERROR] = importDefault(7510) /* metro dependency 7510 */;
|
|
RESUB = object7.RESUB;
|
|
object26[RESUB] = importDefault(7511) /* metro dependency 7511 */;
|
|
object8[TIER_2] = object26;
|
|
let PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
const object27 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object27[ACTIVE] = importDefault(7306) /* metro dependency 7306 */;
|
|
ERROR = object7.ERROR;
|
|
object27[ERROR] = importDefault(7512) /* metro dependency 7512 */;
|
|
RESUB = object7.RESUB;
|
|
object27[RESUB] = importDefault(7513) /* metro dependency 7513 */;
|
|
object8[PREMIUM_GUILD] = object27;
|
|
const object28 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
const object29 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object29[ACTIVE] = importDefault(7514) /* metro dependency 7514 */;
|
|
ERROR = object7.ERROR;
|
|
object29[ERROR] = importDefault(7514) /* metro dependency 7514 */;
|
|
RESUB = object7.RESUB;
|
|
object29[RESUB] = importDefault(7514) /* metro dependency 7514 */;
|
|
object28[BUNDLE] = object29;
|
|
TIER_0 = Branding.TIER_0;
|
|
const object37 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object37[ACTIVE] = importDefault(7250) /* metro dependency 7250 */;
|
|
ERROR = object7.ERROR;
|
|
object37[ERROR] = importDefault(7515) /* metro dependency 7515 */;
|
|
RESUB = object7.RESUB;
|
|
object37[RESUB] = importDefault(7516) /* metro dependency 7516 */;
|
|
object28[TIER_0] = object37;
|
|
TIER_1 = Branding.TIER_1;
|
|
const object38 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object38[ACTIVE] = importDefault(7517) /* metro dependency 7517 */;
|
|
ERROR = object7.ERROR;
|
|
object38[ERROR] = importDefault(7518) /* metro dependency 7518 */;
|
|
RESUB = object7.RESUB;
|
|
object38[RESUB] = importDefault(7519) /* metro dependency 7519 */;
|
|
object28[TIER_1] = object38;
|
|
TIER_2 = Branding.TIER_2;
|
|
const object39 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object39[ACTIVE] = importDefault(7307) /* metro dependency 7307 */;
|
|
ERROR = object7.ERROR;
|
|
object39[ERROR] = importDefault(7520) /* metro dependency 7520 */;
|
|
RESUB = object7.RESUB;
|
|
object39[RESUB] = importDefault(7521) /* metro dependency 7521 */;
|
|
object28[TIER_2] = object39;
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
const object40 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object40[ACTIVE] = importDefault(7522) /* metro dependency 7522 */;
|
|
ERROR = object7.ERROR;
|
|
object40[ERROR] = importDefault(7523) /* metro dependency 7523 */;
|
|
RESUB = object7.RESUB;
|
|
object40[RESUB] = importDefault(7524) /* metro dependency 7524 */;
|
|
object28[PREMIUM_GUILD] = object40;
|
|
const object41 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
ACTIVE = object7.ACTIVE;
|
|
ERROR = object7.ERROR;
|
|
RESUB = object7.RESUB;
|
|
object41[BUNDLE] = {[ACTIVE]: object3.imageBundle, [ERROR]: object3.imageBundle, [RESUB]: object3.imageBundle};
|
|
TIER_0 = Branding.TIER_0;
|
|
ACTIVE = object7.ACTIVE;
|
|
ERROR = object7.ERROR;
|
|
RESUB = object7.RESUB;
|
|
object41[TIER_0] = {[ACTIVE]: object3.imageTier0, [ERROR]: object3.imagePremiumNonActive,
|
|
[RESUB]: object3.imagePremiumNonActive};
|
|
TIER_1 = Branding.TIER_1;
|
|
ACTIVE = object7.ACTIVE;
|
|
ERROR = object7.ERROR;
|
|
RESUB = object7.RESUB;
|
|
object41[TIER_1] = {[ACTIVE]: object3.imageTier1, [ERROR]: object3.imagePremiumNonActive,
|
|
[RESUB]: object3.imagePremiumNonActive};
|
|
TIER_2 = Branding.TIER_2;
|
|
ACTIVE = object7.ACTIVE;
|
|
ERROR = object7.ERROR;
|
|
RESUB = object7.RESUB;
|
|
object41[TIER_2] = {[ACTIVE]: object3.imageTier2, [ERROR]: object3.imagePremiumNonActive,
|
|
[RESUB]: object3.imagePremiumNonActive};
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
ACTIVE = object7.ACTIVE;
|
|
ERROR = object7.ERROR;
|
|
RESUB = object7.RESUB;
|
|
object41[PREMIUM_GUILD] = {[ACTIVE]: object3.imagePremiumGuild, [ERROR]: object3.imagePremiumGuildNonActive,
|
|
[RESUB]: object3.imagePremiumGuildNonActive};
|
|
const object42 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
const object43 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object43[ACTIVE] = importDefault(7525) /* metro dependency 7525 */;
|
|
ERROR = object7.ERROR;
|
|
object43[ERROR] = importDefault(7525) /* metro dependency 7525 */;
|
|
RESUB = object7.RESUB;
|
|
object43[RESUB] = importDefault(7526) /* metro dependency 7526 */;
|
|
object42[BUNDLE] = object43;
|
|
TIER_0 = Branding.TIER_0;
|
|
const object44 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object44[ACTIVE] = importDefault(7310) /* metro dependency 7310 */;
|
|
ERROR = object7.ERROR;
|
|
object44[ERROR] = importDefault(7310) /* metro dependency 7310 */;
|
|
RESUB = object7.RESUB;
|
|
object44[RESUB] = importDefault(7527) /* metro dependency 7527 */;
|
|
object42[TIER_0] = object44;
|
|
TIER_1 = Branding.TIER_1;
|
|
const object45 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object45[ACTIVE] = importDefault(7528) /* metro dependency 7528 */;
|
|
ERROR = object7.ERROR;
|
|
object45[ERROR] = importDefault(7528) /* metro dependency 7528 */;
|
|
RESUB = object7.RESUB;
|
|
object45[RESUB] = importDefault(7529) /* metro dependency 7529 */;
|
|
object42[TIER_1] = object45;
|
|
TIER_2 = Branding.TIER_2;
|
|
const object46 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object46[ACTIVE] = importDefault(7312) /* metro dependency 7312 */;
|
|
ERROR = object7.ERROR;
|
|
object46[ERROR] = importDefault(7312) /* metro dependency 7312 */;
|
|
RESUB = object7.RESUB;
|
|
object46[RESUB] = importDefault(7530) /* metro dependency 7530 */;
|
|
object42[TIER_2] = object46;
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
const object47 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object47[ACTIVE] = importDefault(7531) /* metro dependency 7531 */;
|
|
ERROR = object7.ERROR;
|
|
object47[ERROR] = importDefault(7531) /* metro dependency 7531 */;
|
|
RESUB = object7.RESUB;
|
|
object47[RESUB] = importDefault(7532) /* metro dependency 7532 */;
|
|
object42[PREMIUM_GUILD] = object47;
|
|
const object48 = {};
|
|
BUNDLE = Branding.BUNDLE;
|
|
object48[BUNDLE] = object3.logoPremiumBundle;
|
|
TIER_0 = Branding.TIER_0;
|
|
object48[TIER_0] = object3.logoPremiumTier0;
|
|
TIER_1 = Branding.TIER_1;
|
|
object48[TIER_1] = object3.logoPremiumTier1;
|
|
TIER_2 = Branding.TIER_2;
|
|
object48[TIER_2] = object3.logoPremiumTier2;
|
|
PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
object48[PREMIUM_GUILD] = object3.logoPremiumGuild;
|
|
object3 = {};
|
|
ACTIVE = object7.ACTIVE;
|
|
object3[ACTIVE] = object4.price;
|
|
ERROR = object7.ERROR;
|
|
object3[ERROR] = object4.price;
|
|
RESUB = object7.RESUB;
|
|
object3[RESUB] = object4.priceDark;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/PremiumSubscriptionDetails.tsx');
|
|
exports.default = PremiumSubscriptionDetails;
|
|
exports.onCancelClick = closure;
|
|
exports.handleManageSubscription = closure2;
|
|
exports.onResubscribeClick = closure3;
|
|
exports.PremiumSubscriptionHeader = closure4;
|
|
}
|
|
|
|
function getHeaderBackground_60565(a0, a1) { // fn#60565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3850, offset: 0x01706c15, size: 23 bytes, params: 3, frame: 2
|
|
return env0_19[a0][a1];
|
|
}
|
|
|
|
function getPremiumImage(a0, a1) { // fn#60566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3899, offset: 0x01706c2c, size: 23 bytes, params: 3, frame: 2
|
|
return env0_20[a0][a1];
|
|
}
|
|
|
|
function getPremiumImageStyle(a0, a1) { // fn#60567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3944, offset: 0x01706c43, size: 23 bytes, params: 3, frame: 2
|
|
return env0_21[a0][a1];
|
|
}
|
|
|
|
function getLogo_60568(a0, a1) { // fn#60568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:3994, offset: 0x01706c5a, size: 23 bytes, params: 3, frame: 2
|
|
return env0_22[a0][a1];
|
|
}
|
|
|
|
function getPlanDescriptionStyle(a0) { // fn#60570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4068, offset: 0x01706c81, size: 16 bytes, params: 2, frame: 2
|
|
return env0_24[a0];
|
|
}
|
|
|
|
function _handleCancelSubscription() { // fn#60572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4207, offset: 0x01706c91, size: 48 bytes, params: 1, frame: 14
|
|
return env0_4(_fun60574).apply(this, arguments);
|
|
}
|
|
|
|
function onCancelClick(a0, a1) { // fn#60575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4720, offset: 0x01706dca, size: 171 bytes, params: 3, frame: 19
|
|
var r0;
|
|
var defaultImport2;
|
|
var object2;
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
(require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).trackPremiumSubscriptionCancellationStarted(a0,
|
|
a1);
|
|
const defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
if (defaultImport.isBoostOnlySubscription(a0)) {
|
|
r0 = handleCancelSubscription(a0, a1);
|
|
} else {
|
|
defaultImport2 = importDefault(7533) /* metro dependency 7533: openPremiumPlanWhatYouLoseActionSheet */;
|
|
object2 = {subscription: a0};
|
|
object2.mode = (require(7534) /* metro dependency 7534: PremiumPlanWhatYouLoseActionSheet */).WhatYouLoseMode.CANCEL;
|
|
object2.onContinue = onContinue;
|
|
r0 = defaultImport2(object2);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function handleManageSubscription(a0, a1, a2) { // fn#60577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4989, offset: 0x01706e95, size: 178 bytes, params: 4, frame: 16
|
|
var openURL;
|
|
const status = a0.status;
|
|
var value;
|
|
const ACCOUNT_HOLD = SubscriptionStatusTypes.ACCOUNT_HOLD;
|
|
if (status === ACCOUNT_HOLD) {
|
|
openURL = Linking.openURL;
|
|
value = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
Reflect.apply(openURL, Linking, [value.getExternalSubscriptionMethodUrl(a0.paymentGateway,
|
|
'PAYMENT_SOURCE_MANAGEMENT')]);
|
|
} else {
|
|
(require(7026) /* metro dependency 7026: launchPremiumPlanSelect */).launchPremiumPlanSelect({navigation: a1,
|
|
analyticsLocation: {page: AnalyticsPages.USER_SETTINGS, section: AnalyticsSections.SETTINGS_PREMIUM},
|
|
analyticsLocations: a2});
|
|
}
|
|
}
|
|
|
|
function _onResubscribeClick() { // fn#60579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5372, offset: 0x01706f65, size: 48 bytes, params: 1, frame: 14
|
|
return env0_4(_fun60581).apply(this, arguments);
|
|
}
|
|
|
|
function PremiumSubscriptionHeader({subscription, renewalInvoicePreview, onClickManagePremiumGuild, style}) { // fn#60582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5651, offset: 0x01707035, size: 1752 bytes, params: 2, frame: 43
|
|
var r6;
|
|
var r1;
|
|
var r12;
|
|
var r18;
|
|
var r15;
|
|
var statusFromInvoice;
|
|
var property;
|
|
var defaultImport3;
|
|
var value6;
|
|
var defaultImport4;
|
|
var getPlanDescription;
|
|
var moduleValue5;
|
|
var value8;
|
|
var coercedPremiumGuildSubscriptionStatus;
|
|
var premiumGuildHeaderDescription;
|
|
var isAndroid2;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var object11;
|
|
var object13;
|
|
const styles = useStyles();
|
|
const env0_1 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
const useStateFromStores = fluxModule.useStateFromStores;
|
|
let object = [UserStore];
|
|
const currentUser = Reflect.apply(useStateFromStores, fluxModule, [object, _fun60583]);
|
|
const product = fluxModule.useStateFromStores([IAPStoreAndroid], _fun60584);
|
|
const planIdFromInvoice = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getPlanIdFromInvoice(subscription,
|
|
renewalInvoicePreview);
|
|
const premiumBranding = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumBranding(subscription);
|
|
const env0_2 = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
|
|
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
|
|
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
|
|
if (premiumBranding === PREMIUM_GUILD) {
|
|
coercedPremiumGuildSubscriptionStatus = (require(3802) /* metro dependency 3802: PremiumUtils */).getCoercedPremiumGuildSubscriptionStatus(subscription);
|
|
premiumGuildHeaderDescription = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumGuildHeaderDescription({subscription: subscription,
|
|
|
|
user: currentUser, price: product?.priceString, renewalInvoicePreview: renewalInvoicePreview});
|
|
r1 = coercedPremiumGuildSubscriptionStatus;
|
|
r12 = premiumGuildHeaderDescription;
|
|
} else {
|
|
statusFromInvoice = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getStatusFromInvoice(subscription,
|
|
|
|
renewalInvoicePreview);
|
|
property = SubscriptionPlanInfo[planIdFromInvoice];
|
|
defaultImport3 = importDefault(44) /* metro dependency 44 */;
|
|
value6 = null;
|
|
defaultImport3(value6 != property, 'missing subscription planInfo');
|
|
defaultImport4 = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
|
|
getPlanDescription = defaultImport4.getPlanDescription;
|
|
object = {subscription: subscription, planId: planIdFromInvoice};
|
|
if (value6 != product) {
|
|
moduleValue5 = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
r6 = moduleValue5.formatRate(product.priceString, property.interval, property.intervalCount);
|
|
} else {
|
|
r6 = value6;
|
|
}
|
|
object.price = r6;
|
|
object.includePremiumGuilds = true;
|
|
value8 = Reflect.apply(getPlanDescription, defaultImport4, [object]);
|
|
r1 = statusFromInvoice;
|
|
r12 = value8;
|
|
}
|
|
const CANCELED = SubscriptionStatusTypes.CANCELED;
|
|
const value11 = r1 === CANCELED;
|
|
const ACTIVE = SubscriptionStatusTypes.ACTIVE;
|
|
const r21 = r1 === ACTIVE ? env0_18.ACTIVE : value11 ? env0_18.RESUB : env0_18.ERROR;
|
|
const r0 = value11 || !subscription.isOnPlatformMatchingExternalPaymentGateway;
|
|
if (r0) {
|
|
r18 = !r0;
|
|
} else {
|
|
isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
|
|
r18 = isAndroid2 ? subscription.renewalMutations == null : !isAndroid2;
|
|
}
|
|
const r14 = !value11 && subscription.isOnPlatformMatchingExternalPaymentGateway;
|
|
const items3 = [styles.container, style];
|
|
const imageBackgroundBindingProps = {source: getHeaderBackground_60565(premiumBranding, r21), style: styles.header};
|
|
const imageBindingProps = {source: getPremiumImage(premiumBranding, r21)};
|
|
const items2 = [getPremiumImageStyle(premiumBranding, r21)];
|
|
items2[1] = styles.wumpusImg;
|
|
imageBindingProps.style = items2;
|
|
const items4 = [<View style={styles.logoContainer}><Image {...imageBindingProps} /><Image source={getLogo_60568(premiumBranding,
|
|
r21)} style={getLogoStyle(premiumBranding)} /></View>];
|
|
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
|
|
items4[1] = <LegacyText style={getPlanDescriptionStyle(r21)}>{r12}</LegacyText>;
|
|
const items5 = [value11 && subscription != null && subscription.isOnPlatformMatchingExternalPaymentGateway ? <View style={styles.buttonWrapper}><Button onPress={function() {
|
|
return onResubscribeClick(subscription);
|
|
}} variant="primary-overlay" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lTCb0c)} /></View> : null];
|
|
if (r18) {
|
|
r15 = <View style={styles.buttonWrapper}><Button onPress={onPress_60586} variant="primary-overlay" text={subscription.status === SubscriptionStatusTypes.ACCOUNT_HOLD ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SgX7Ra) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.gmVtgF)} size="sm" /></View>;
|
|
} else {
|
|
r15 = null;
|
|
}
|
|
items5[1] = r15;
|
|
const premiumUtilsModule = require(3802) /* metro dependency 3802: PremiumUtils */;
|
|
if (premiumUtilsModule.subscriptionHasPremiumGuildPlan(subscription)) {
|
|
if (onClickManagePremiumGuild != null) {
|
|
r15 = <View style={styles.buttonWrapper}><Button onPress={onClickManagePremiumGuild} variant="primary-overlay" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.gIVkjm)} size="sm" /></View>;
|
|
} else {
|
|
r15 = null;
|
|
}
|
|
} else {
|
|
r15 = null;
|
|
}
|
|
items5[2] = r15;
|
|
items5[3] = r14 ? ((Text) => <Text accessibilityRole="link" style={styles.cancelLink} onPress={function() {
|
|
return onCancelClick(subscription, analyticsLocations);
|
|
}} variant="text-sm/medium" color="always-white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])}</Text>)((require(4573) /* metro dependency 4573: Text */).Text) : null;
|
|
items4[2] = <View style={styles.buttonContainer}>{items5}</View>;
|
|
return (
|
|
<View style={items3}>
|
|
<ImageBackground {...imageBackgroundBindingProps}>
|
|
{items4}
|
|
</ImageBackground>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function PremiumSubscriptionDetails({style, onClickManagePremiumGuild, subscription}) { // fn#60588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:8313, offset: 0x01707811, size: 606 bytes, params: 2, frame: 29
|
|
var r8;
|
|
var r0;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
|
|
const premiumSubscriptionInvoiceModule = require(7545) /* metro dependency 7545: PremiumSubscriptionInvoice */;
|
|
const useFetchSubscriptionInvoicePreview = premiumSubscriptionInvoiceModule.useFetchSubscriptionInvoicePreview;
|
|
let object2 = {};
|
|
object2.subscriptionId = subscription.id;
|
|
object2.renewal = true;
|
|
object2.analyticsLocations = analyticsLocations;
|
|
const PREMIUM_SUBSCRIPTION_DETAILS = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_SUBSCRIPTION_DETAILS;
|
|
object2.analyticsLocation = PREMIUM_SUBSCRIPTION_DETAILS;
|
|
const property = env0_3(Reflect.apply(useFetchSubscriptionInvoicePreview, premiumSubscriptionInvoiceModule,
|
|
[object2]), 1)[0];
|
|
if (property == null) {
|
|
r0 = null;
|
|
} else {
|
|
object2 = {style: style};
|
|
string = intl.string;
|
|
items2 = [<Text style={styles.title} accessibilityRole="header" variant="eyebrow" color="text-default">{Reflect.apply(string,
|
|
|
|
intl, [t.ITurwY])}</Text>];
|
|
r8 = subscription.renewalMutations != null && subscription.status !== SubscriptionStatusTypes.CANCELED;
|
|
r8 = r8 && ((Component) => <Component subscription={subscription} renewalMutations={subscription.renewalMutations} />)(importDefault(7546) /* metro dependency 7546: SubscriptionRenewalMutationsNotice */);
|
|
items2[1] = r8;
|
|
r8 = subscription.status === SubscriptionStatusTypes.ACCOUNT_HOLD && ((Component) => <Component subscription={subscription} />)(importDefault(7547) /* metro dependency 7547: SubscriptionAccountHoldNotice */);
|
|
items2[2] = r8;
|
|
items2[3] = <PremiumSubscriptionHeader subscription={subscription} renewalInvoicePreview={property} onClickManagePremiumGuild={onClickManagePremiumGuild} />;
|
|
string = intl.string;
|
|
items2[4] = <Text style={styles.desktopSubtext} variant="text-sm/medium">{Reflect.apply(string, intl,
|
|
[t['MTG+3O']])}</Text>;
|
|
r0 = <View {...object2}>{items2}</View>;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function* _fun60574(a0, a1, a2) { // fn#60574, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4280, offset: 0x01706cca, size: 256 bytes, params: 4, frame: 20
|
|
var openURL;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_0;
|
|
var binding2 = env2_2;
|
|
var value3 = binding(binding2[44]);
|
|
var trackPremiumSubscriptionCancellationFlowStep = value3.trackPremiumSubscriptionCancellationFlowStep;
|
|
var STEP_ANALYTICS_NAMES = binding(binding2[44]).STEP_ANALYTICS_NAMES;
|
|
var CancellationFlowSteps = binding(binding2[44]).CancellationFlowSteps;
|
|
var MOBILE_SUBSCRIPTION_MANAGE = CancellationFlowSteps.MOBILE_SUBSCRIPTION_MANAGE;
|
|
Reflect.apply(trackPremiumSubscriptionCancellationFlowStep, value3, [{subscription: a0, analyticsLocations: a1,
|
|
fromStep: a2, toStep: STEP_ANALYTICS_NAMES[MOBILE_SUBSCRIPTION_MANAGE]}]);
|
|
if (a0 != null) {
|
|
if (a0.isPurchasedViaApple) {
|
|
value = env2_0(env2_2[45]);
|
|
yield value.manageSubscription();
|
|
value = undefined;
|
|
return undefined;
|
|
}
|
|
}
|
|
if (a0 != null && a0.isPurchasedViaGoogle) {
|
|
binding = env2_7;
|
|
openURL = binding.openURL;
|
|
value = env2_0(env2_2[11]);
|
|
Reflect.apply(openURL, binding, [value.getExternalSubscriptionMethodUrl(a0.paymentGateway,
|
|
'SUBSCRIPTION_MANAGEMENT')]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function onContinue(a0) { // fn#60576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:4952, owner: onCancelClick.onContinue, offset: 0x01706e75, size: 32 bytes, params: 2, frame: 15
|
|
return handleCancelSubscription(env0_0, require, a0);
|
|
}
|
|
|
|
function* _fun60581(a0) { // fn#60581, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5433, offset: 0x01706f9e, size: 151 bytes, params: 2, frame: 16
|
|
var binding;
|
|
var openURL;
|
|
let value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
if (a0.isPurchasedViaApple) {
|
|
value = environment.__proto__.__proto__;
|
|
value = env2_0(env2_2[45]);
|
|
yield value.manageSubscription();
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
} else if (a0.isPurchasedViaGoogle) {
|
|
value = environment.__proto__.__proto__;
|
|
binding = env2_7;
|
|
openURL = binding.openURL;
|
|
value = env2_0(env2_2[11]);
|
|
Reflect.apply(openURL, binding, [value.getExternalSubscriptionMethodUrl(a0.paymentGateway,
|
|
'SUBSCRIPTION_MANAGEMENT')]);
|
|
}
|
|
}
|
|
|
|
function _fun60583() { // fn#60583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5840, offset: 0x0170770d, size: 58 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
const currentUser = UserStore.getCurrentUser();
|
|
(importDefault(44) /* metro dependency 44 */)(currentUser != null,
|
|
'PremiumSubscriptionHeader: currentUser cannot be undefined');
|
|
return currentUser;
|
|
}
|
|
|
|
function _fun60584() { // fn#60584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:5996, offset: 0x01707747, size: 118 bytes, params: 1, frame: 11
|
|
var paymentGatewayPlanId;
|
|
var value2;
|
|
var getProduct;
|
|
if (subscription.isOnPlatformMatchingExternalPaymentGateway) {
|
|
paymentGatewayPlanId = subscription.paymentGatewayPlanId;
|
|
if (paymentGatewayPlanId == null) {
|
|
throw new global.Error('Subscription missing plan ID');
|
|
}
|
|
paymentGatewayPlanId = subscription.paymentGatewayPlanId;
|
|
if (paymentGatewayPlanId === '') {
|
|
throw new global.Error('Subscription missing plan ID');
|
|
}
|
|
value2 = environment.__proto__;
|
|
getProduct = IAPStoreAndroid.getProduct;
|
|
paymentGatewayPlanId = subscription.paymentGatewayPlanId;
|
|
return Reflect.apply(getProduct, IAPStoreAndroid, [paymentGatewayPlanId]);
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function PremiumSubscriptionHeaderOnPress_60586() { // fn#60586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7687:7700, owner: PremiumSubscriptionHeader.onPress, offset: 0x017077d4, size: 33 bytes, params: 1, frame: 15
|
|
handleManageSubscription(subscription, env0_1, analyticsLocations);
|
|
}
|
|
|