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

255 lines
13 KiB
TypeScript

/* Metro module 7301; source: components_native/premium/PremiumActivatedAlert.tsx; dependencies: [31, 27, 661, 33, 4501, 6235, 3802, 7302, 7303, 7304, 7305, 7306, 7250, 7251, 7307, 7308, 7309, 7310, 7311, 7312, 7313, 4002, 7314, 7315, 7316, 7317, 7318, 7319, 7320, 7321, 7322, 1244, 4048, 4596, 7323, 7324, 1305, 2] */
function _fun58978(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:6, offset: 0x016dca3e, size: 470 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_3 = value.Image;
const env0_4 = value.ImageBackground;
const env0_5 = value.View;
const env0_6 = (require(661) /* metro dependency 661: Constants */).SubscriptionStatusTypes;
value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const DARK_PRIMARY_300_LIGHT_PRIMARY_400 = (require(6235) /* metro dependency 6235: LegacyTokens */).DARK_PRIMARY_300_LIGHT_PRIMARY_400;
const env0_9 = Reflect.apply(createStyles, value, [{alert: {'overflow': 'hidden', 'paddingBottom': 24},
header: {'alignSelf': 'stretch', 'margin': -16, 'padding': 16, 'height': 100, 'position': 'relative'},
headerImage: {'position': 'absolute', 'left': '50%'}, body: {'paddingHorizontal': 16, 'marginTop': 40,
'maxWidth': 300, 'alignSelf': 'center', 'alignItems': 'center'}, logoPlusPremiumGuild: {'marginTop': 3,
'width': 101, 'height': 19}, description: {'fontSize': 14, 'lineHeight': 16, 'textAlign': 'center',
'marginTop': 20, color: DARK_PRIMARY_300_LIGHT_PRIMARY_400}}]);
const env0_10 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun58984);
const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun58985);
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/premium/PremiumActivatedAlert.tsx');
exports.default = PremiumActivatedAlert;
}
function getHeaderBackground(a0) { // fn#58979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:1455, offset: 0x016dcc14, size: 294 bytes, params: 2, frame: 14
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const TIER_0 = Branding.TIER_0;
if (TIER_0 === a0) {
return importDefault(7302) /* metro dependency 7302 */;
}
const TIER_1 = Branding.TIER_1;
if (TIER_1 === a0) {
return importDefault(7303) /* metro dependency 7303 */;
}
const TIER_2 = Branding.TIER_2;
if (TIER_2 === a0) {
return importDefault(7304) /* metro dependency 7304 */;
}
const BUNDLE = Branding.BUNDLE;
if (BUNDLE === a0) {
return importDefault(7305) /* metro dependency 7305 */;
}
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
if (PREMIUM_GUILD === a0) {
return importDefault(7306) /* metro dependency 7306 */;
}
}
function getHeaderImage(a0) { // fn#58980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:1727, offset: 0x016dcd3a, size: 294 bytes, params: 2, frame: 14
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const TIER_0 = Branding.TIER_0;
if (TIER_0 === a0) {
return importDefault(7250) /* metro dependency 7250 */;
}
const TIER_1 = Branding.TIER_1;
if (TIER_1 === a0) {
return importDefault(7251) /* metro dependency 7251 */;
}
const TIER_2 = Branding.TIER_2;
if (TIER_2 === a0) {
return importDefault(7307) /* metro dependency 7307 */;
}
const BUNDLE = Branding.BUNDLE;
if (BUNDLE === a0) {
return importDefault(7308) /* metro dependency 7308 */;
}
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
if (PREMIUM_GUILD === a0) {
return importDefault(7309) /* metro dependency 7309 */;
}
}
function getLogo(a0) { // fn#58981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:1997, offset: 0x016dce60, size: 272 bytes, params: 2, frame: 14
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const TIER_0 = Branding.TIER_0;
if (TIER_0 === a0) {
return importDefault(7310) /* metro dependency 7310 */;
}
const TIER_1 = Branding.TIER_1;
if (TIER_1 === a0) {
return importDefault(7311) /* metro dependency 7311 */;
}
const BUNDLE = Branding.BUNDLE;
if (BUNDLE === a0) {
return importDefault(7312) /* metro dependency 7312 */;
}
const TIER_2 = Branding.TIER_2;
if (TIER_2 === a0) {
return importDefault(7312) /* metro dependency 7312 */;
}
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
if (PREMIUM_GUILD === a0) {
return importDefault(7313) /* metro dependency 7313 */;
}
}
function getActivatedImage(a0, a1) { // fn#58982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:2244, offset: 0x016dcf70, size: 492 bytes, params: 3, frame: 15
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const TIER_0 = Branding.TIER_0;
if (TIER_0 === a0) {
return (require(4002) /* metro dependency 4002: shared */).isThemeDark(a1) ? importDefault(7314) /* metro dependency 7314 */ : importDefault(7315) /* metro dependency 7315 */;
}
const TIER_1 = Branding.TIER_1;
if (TIER_1 === a0) {
return (require(4002) /* metro dependency 4002: shared */).isThemeDark(a1) ? importDefault(7316) /* metro dependency 7316 */ : importDefault(7317) /* metro dependency 7317 */;
}
const TIER_2 = Branding.TIER_2;
if (TIER_2 === a0) {
return (require(4002) /* metro dependency 4002: shared */).isThemeDark(a1) ? importDefault(7318) /* metro dependency 7318 */ : importDefault(7319) /* metro dependency 7319 */;
}
const BUNDLE = Branding.BUNDLE;
if (BUNDLE === a0) {
return (require(4002) /* metro dependency 4002: shared */).isThemeDark(a1) ? importDefault(7320) /* metro dependency 7320 */ : importDefault(7321) /* metro dependency 7321 */;
}
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
if (PREMIUM_GUILD === a0) {
return importDefault(7322) /* metro dependency 7322 */;
}
}
function getDescription_58983(a0, a1) { // fn#58983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:2651, offset: 0x016dd15c, size: 419 bytes, params: 3, frame: 20
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var format;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var YJUUH3;
var value;
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const TIER_0 = Branding.TIER_0;
if (TIER_0 === a0) {
return intl.string(t.knvOVz);
}
const TIER_1 = Branding.TIER_1;
if (TIER_1 === a0) {
return intl.string(t.knvOVz);
}
const TIER_2 = Branding.TIER_2;
if (TIER_2 === a0) {
return intl.string(t.aTUr3Z);
}
const BUNDLE = Branding.BUNDLE;
if (BUNDLE === a0) {
format = intl.format;
YJUUH3 = t.YJUUH3;
value = require(3802) /* metro dependency 3802: PremiumUtils */;
return Reflect.apply(format, intl, [YJUUH3, {planName: value.getExternalPlanDisplayName({planId: a1.planId,
additionalPlans: a1.additionalPlans})}]);
}
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
if (PREMIUM_GUILD === a0) {
format = intl.format;
YJUUH3 = t.YJUUH3;
value = require(3802) /* metro dependency 3802: PremiumUtils */;
return Reflect.apply(format, intl, [YJUUH3, {planName: value.getExternalPlanDisplayName({planId: a1.planId,
additionalPlans: a1.additionalPlans})}]);
}
}
function _fun58984(a0) { // fn#58984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:707, offset: 0x016dd2ff, size: 299 bytes, params: 2, frame: 14
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const TIER_0 = Branding.TIER_0;
if (TIER_0 === a0) {
return {headerImage: {'marginLeft': -27, 'width': 88, 'top': 18}};
}
const TIER_1 = Branding.TIER_1;
if (TIER_1 === a0) {
return {headerImage: {'marginLeft': -27, 'width': 87, 'top': 18}};
}
const BUNDLE = Branding.BUNDLE;
if (BUNDLE === a0) {
return {headerImage: {'marginLeft': -29.5, 'width': 91, 'top': 18}};
}
const TIER_2 = Branding.TIER_2;
if (TIER_2 === a0) {
return {headerImage: {'marginLeft': -58, 'width': 122, 'height': 90, 'top': 18}};
}
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
if (PREMIUM_GUILD === a0) {
return {headerImage: {'marginLeft': -54, 'width': 140, 'top': 18}};
}
}
function _fun58985(a0) { // fn#58985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:1180, offset: 0x016dd42a, size: 232 bytes, params: 2, frame: 14
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const BUNDLE = Branding.BUNDLE;
if (BUNDLE === a0) {
return {animation: {borderRadius: 6}};
}
const TIER_0 = Branding.TIER_0;
if (TIER_0 === a0) {
return {animation: {borderRadius: 5}};
}
const TIER_1 = Branding.TIER_1;
if (TIER_1 === a0) {
return {animation: {borderRadius: 5}};
}
const TIER_2 = Branding.TIER_2;
if (TIER_2 === a0) {
return {animation: {borderRadius: 5}};
}
const PREMIUM_GUILD = Branding.PREMIUM_GUILD;
if (PREMIUM_GUILD === a0) {
return {animation: {borderRadius: 9}};
}
}
function PremiumActivatedAlert({subscription, onClose}) { // fn#58986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7479:3179, offset: 0x016dd512, size: 955 bytes, params: 2, frame: 31
const styles = useStyles();
const r2 = subscription.renewalMutations == null || global.Object.keys(subscription.renewalMutations).length === 0 || (subscription.renewalMutations.paymentGatewayPlanId === subscription.paymentGatewayPlanId || subscription.status === SubscriptionStatusTypes.CANCELED) ? subscription : subscription.renewalMutations;
const value4 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
const premiumBranding = (require(3802) /* metro dependency 3802: PremiumUtils */).getPremiumBranding(r2);
const Branding = (require(3802) /* metro dependency 3802: PremiumUtils */).Branding;
const TIER_0 = Branding.TIER_0;
const r20 = TIER_0 === premiumBranding ? {logo: {'width': 82,
'height': 44}} : (require(3802) /* metro dependency 3802: PremiumUtils */).Branding.TIER_1 === premiumBranding ? {logo: {'width': 82,
'height': 32}} : (require(3802) /* metro dependency 3802: PremiumUtils */).Branding.BUNDLE === premiumBranding || (require(3802) /* metro dependency 3802: PremiumUtils */).Branding.TIER_2 === premiumBranding ? {logo: {'width': 79,
'height': 32}} : (require(3802) /* metro dependency 3802: PremiumUtils */).Branding.PREMIUM_GUILD !== premiumBranding ? undefined : {logo: {'width': 82,
'height': 18}};
const styles2 = useStyles(premiumBranding);
const styles3 = useStyles(premiumBranding);
const Alert = importDefault(4596) /* metro dependency 4596: Alert */;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const TkTvBz = (require(1244) /* metro dependency 1244: indexNative */).t.TkTvBz;
const imageBackgroundBindingProps = {style: styles.header, source: getHeaderBackground(premiumBranding)};
const image = <Image source={getLogo(premiumBranding)} style={r20.logo} />;
const BUNDLE = Branding.BUNDLE;
const r7 = premiumBranding !== BUNDLE ? null : <Image source={importDefault(7323) /* metro dependency 7323 */} style={styles.logoPlusPremiumGuild} />;
const imageBackground = <ImageBackground {...imageBackgroundBindingProps}>{image}{r7}<Image source={getHeaderImage(premiumBranding)} style={[styles2.headerImage,
styles.headerImage]} /></ImageBackground>;
const value9 = ((Component) => <Component source={getActivatedImage(premiumBranding,
value4)} style={styles3.animation} />)(importDefault(7324) /* metro dependency 7324: ShineAnimation */);
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
return (
<Alert
onClose={onClose}
confirmText={Reflect.apply(string, intl, [TkTvBz])}
style={styles.alert}
>
{imageBackground}
<View style={styles.body}>
{value9}
<LegacyText style={styles.description}>
{getDescription_58983(premiumBranding, r2)}
</LegacyText>
</View>
</Alert>
);
}