373 lines
25 KiB
TypeScript
373 lines
25 KiB
TypeScript
/* Metro module 10461; source: modules/premium/native/gifting/PremiumGiftPurchaseButton.tsx; dependencies: [31, 27, 7670, 5126, 1902, 1878, 7261, 661, 33, 4501, 697, 5463, 8483, 1901, 1305, 4573, 1244, 4589, 10462, 1484, 7669, 566, 7355, 7583, 7278, 10392, 7633, 7635, 7294, 10382, 8461, 10390, 5475, 8341, 9646, 10396, 6789, 6766, 1948, 4578, 4015, 2] */
|
|
function _fun80964(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:6, offset: 0x01e91df0, size: 350 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_4 = value.StyleSheet;
|
|
const env0_5 = value.View;
|
|
const badgeDirectoryStore = importDefault(7670) /* metro dependency 7670: BadgeDirectoryStore */;
|
|
const env0_7 = (require(5126) /* metro dependency 5126: AvatarDecorationRecord */).isAvatarDecorationRecord;
|
|
const env0_8 = (require(1902) /* metro dependency 1902: NameplateRecord */).isNameplateRecord;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
|
|
const env0_11 = (require(661) /* metro dependency 661: Constants */).HelpdeskArticles;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_12 = value.jsx;
|
|
const env0_13 = value.Fragment;
|
|
const env0_14 = value.jsxs;
|
|
const env0_15 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun80966);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/native/gifting/PremiumGiftPurchaseButton.tsx');
|
|
exports.default = PremiumGiftPurchaseButton;
|
|
}
|
|
|
|
function RewardPreview({collectiblesItem, currentUser, gradientColors, gradientAngle}) { // fn#80965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:1685, offset: 0x01e91f4e, size: 791 bytes, params: 2, frame: 28
|
|
var r0;
|
|
var isAvatarDecorationRecord2;
|
|
var value2;
|
|
var jsxRuntimeEnv0_13Binding;
|
|
var items3;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var items2;
|
|
var Avatar;
|
|
const styles = useStyles((importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)().insets.bottom);
|
|
if (isNameplateRecord(collectiblesItem)) {
|
|
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
|
|
items2 = [<View style={styles.nameplateWrapper}>{((Component) => <Component nameplate={(require(1901) /* metro dependency 1901: utils */).getNameplateData(collectiblesItem)} fullOpacity animate />)(importDefault(8483) /* metro dependency 8483: Nameplate */)}</View>];
|
|
var viewBindingProps2 = {style: styles.singleAvatarContainer};
|
|
Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
|
|
var avatarProps = {user: currentUser, guildId: undefined,
|
|
size: (require(1305) /* metro dependency 1305: native */).AvatarSizes.SMALL};
|
|
avatarProps['aria-hidden'] = true;
|
|
items2[1] = <View {...viewBindingProps2}><Avatar {...avatarProps} /></View>;
|
|
items2[2] = <Text style={styles.selectedRewardText} variant="text-xs/medium">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Rh4oem)}</Text>;
|
|
r0 = <>{items2}</>;
|
|
} else {
|
|
isAvatarDecorationRecord2 = isAvatarDecorationRecord(collectiblesItem);
|
|
value2 = null;
|
|
if (isAvatarDecorationRecord2) {
|
|
jsxRuntimeEnv0_13Binding = jsxRuntimeEnv0_13;
|
|
items3 = [((Component) => <Component style={styles.selectedRewardBannerGradient} useAngle angle={value2 != gradientAngle ? gradientAngle : 90} angleCenter={{'x': 0.5,
|
|
|
|
|
|
'y': 0.5}} colors={gradientColors} />)(importDefault(4589) /* metro dependency 4589 */)];
|
|
items3[1] = <View style={styles.singleAvatarContainer}>{((Component) => <Component size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.NORMAL} asset={collectiblesItem.asset} />)(importDefault(10462) /* metro dependency 10462: GiftingRewardPreviewAvatar */)}</View>;
|
|
items3[2] = <Text style={styles.selectedRewardText} variant="text-xs/medium" color="white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Rh4oem)}</Text>;
|
|
r0 = <>{items3}</>;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun80966(a0) { // fn#80966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:324, offset: 0x01e92265, size: 753 bytes, params: 2, frame: 21
|
|
const object4 = {};
|
|
const object5 = {};
|
|
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object5.backgroundColor = BACKGROUND_BASE_LOW;
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.paddingTop = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object5.paddingBottom = PX_12 + a0;
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object5.paddingHorizontal = PX_16;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object5.gap = PX_8;
|
|
const SHADOW_TOP_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_TOP_HIGH;
|
|
copyDataProperties(object5, SHADOW_TOP_HIGH, undefined);
|
|
object4.container = object5;
|
|
object4.chooseRewardContainer = {'flexDirection': 'row', 'alignItems': 'center', 'height': 52};
|
|
const object6 = {};
|
|
copyDataProperties(object6, StyleSheet.absoluteFillObject, undefined);
|
|
object6['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object6['overflow'] = 'hidden';
|
|
object4.gradientBackdrop = object6;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.chooseRewardText = {flex: 1, marginStart: PX_8};
|
|
object4.backgroundImage = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0, 'opacity': 1};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.inAppFlowImage = {'width': 58, 'height': 58, marginStart: PX_8};
|
|
object4.inAppFlowImageLargeTilted = {'width': 86, 'height': 86, transform: [{rotate: '-4deg'}, {translateY: -11}]};
|
|
object4.singleAvatarContainer = {'flexDirection': 'row', 'paddingRight': 15, 'justifyContent': 'center',
|
|
'alignItems': 'center', 'marginLeft': 5};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.selectedRewardRow = {'flexDirection': 'row', 'alignItems': 'center', gap: PX_16};
|
|
object4.selectedRewardBannerContainer = {'flex': 1, 'flexDirection': 'row', 'alignItems': 'center', 'height': 52};
|
|
const object7 = {};
|
|
copyDataProperties(object7, StyleSheet.absoluteFillObject, -11);
|
|
object7['borderRadius'] = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object7['top'] = PX_4;
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object7['bottom'] = PX_4;
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object7['start'] = PX_4;
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object7['end'] = PX_4;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object7['marginStart'] = PX_12;
|
|
object4.selectedRewardBannerGradient = object7;
|
|
object4.selectedRewardText = {flex: 1};
|
|
const object8 = {'position': 'absolute', 'left': 0, 'right': 0, 'top': 0, 'bottom': 0, 'borderRadius': null,
|
|
'overflow': 'hidden'};
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object4.nameplateWrapper = object8;
|
|
return object4;
|
|
}
|
|
|
|
function PremiumGiftPurchaseButton({defaultSelection}) { // fn#80967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:2712, offset: 0x01e92556, size: 2182 bytes, params: 2, frame: 43
|
|
var r30;
|
|
var r18;
|
|
var r7;
|
|
var String;
|
|
var BACKGROUND_BRAND;
|
|
var items2;
|
|
const IconButton = (require(8341) /* metro dependency 8341: IconButtonNative */).IconButton;
|
|
var items3;
|
|
var items4;
|
|
var TextWithIOSLinkWorkaround;
|
|
var format;
|
|
var hYoGUM;
|
|
var defaultImport5;
|
|
const styles = useStyles((importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)().insets.bottom);
|
|
const env0_1 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const value3 = (require(7669) /* metro dependency 7669: NativeGiftContext */).useNativeGiftContext();
|
|
const env0_2 = value3.onPurchase;
|
|
const isPurchasing = value3.isPurchasing;
|
|
const productId = value3.productId;
|
|
const env0_3 = value3.allRewards;
|
|
const claimableRewards = value3.claimableRewards;
|
|
const selectedGiftingPromotionReward = value3.selectedGiftingPromotionReward;
|
|
const setSelectedGiftingPromotionReward = value3.setSelectedGiftingPromotionReward;
|
|
const env0_7 = value3.setCurrentAnalyticsStep;
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
const useStateFromStores = fluxModule.useStateFromStores;
|
|
let items = [UserStore];
|
|
const currentUser = Reflect.apply(useStateFromStores, fluxModule, [items, function() {
|
|
return UserStore.getCurrentUser();
|
|
}]);
|
|
const value4 = (require(7355) /* metro dependency 7355: IAPUtils */).useCanPurchaseIAP(productId);
|
|
const value5 = fluxModule.useStateFromStores([PromotionsStore], _fun80969);
|
|
const assetVariant = value5?.assetVariant;
|
|
const GiftCustomizationBanner_AssetVariant = (require(7278) /* metro dependency 7278: gift_customization_banner */).GiftCustomizationBanner_AssetVariant;
|
|
const LARGE_TILTED = GiftCustomizationBanner_AssetVariant.LARGE_TILTED;
|
|
const value7 = assetVariant === LARGE_TILTED;
|
|
const r14 = claimableRewards != null && claimableRewards.length > 0;
|
|
const r19 = claimableRewards != null && claimableRewards.length === 1;
|
|
const value12 = (importDefault(10392) /* metro dependency 10392: useShouldShowGiftingPromotionDeco */)();
|
|
let r6 = value12 && selectedGiftingPromotionReward == null;
|
|
const GiftingBadgeExperiment = (require(7633) /* metro dependency 7633: GiftingBadgeExperiment */).GiftingBadgeExperiment;
|
|
const useConfig = GiftingBadgeExperiment.useConfig;
|
|
const enabled = Reflect.apply(useConfig, GiftingBadgeExperiment, [{location: 'PremiumGiftPurchaseButton'}]).enabled;
|
|
const {nextTier, giftsToNextTier} = fluxModule.useStateFromStoresObject([BadgeDirectoryStore], function() {
|
|
var object = {};
|
|
object.nextTier = BadgeDirectoryStore.getNextTier(require(dependencyMap[27]).BadgeId.GIFTING);
|
|
object.giftsToNextTier = BadgeDirectoryStore.getRemainingToNextTier(require(dependencyMap[27]).BadgeId.GIFTING);
|
|
return object;
|
|
});
|
|
env0_3.useEffect(_fun80973, [r19, claimableRewards, setSelectedGiftingPromotionReward]);
|
|
let colors = value5 == null || value5.gradient == null ? undefined : value5.gradient.colors;
|
|
const r26 = colors ?? [];
|
|
if (r26.length > 0) {
|
|
r30 = r26;
|
|
} else {
|
|
String = global.String;
|
|
colors = (importDefault(697) /* metro dependency 697: native */).colors;
|
|
BACKGROUND_BRAND = colors.BACKGROUND_BRAND;
|
|
items = [String(BACKGROUND_BRAND)];
|
|
String = global.String;
|
|
colors = (importDefault(697) /* metro dependency 697: native */).colors;
|
|
BACKGROUND_BRAND = colors.BACKGROUND_BRAND;
|
|
items[1] = String(BACKGROUND_BRAND);
|
|
r30 = items;
|
|
}
|
|
const useFetchCollectiblesProductModule = require(8461) /* metro dependency 8461: useFetchCollectiblesProduct */;
|
|
const useFetchCollectiblesProduct = useFetchCollectiblesProductModule.useFetchCollectiblesProduct;
|
|
const product = Reflect.apply(useFetchCollectiblesProduct, useFetchCollectiblesProductModule,
|
|
[selectedGiftingPromotionReward]).product;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r11 = r6 ? Reflect.apply(string, intl, [t['gNZY/B']]) : Reflect.apply(string, intl, [t.ouo4FK]);
|
|
const r12 = r6 ? 'primary' : 'active';
|
|
const value20 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value5?.mobileBackgroundAsset);
|
|
const value21 = (require(10390) /* metro dependency 10390: MarketingComponentHooks */).useThemeAndReducedMotionAwareAssetUrl(value5?.asset);
|
|
const r32 = product == null ? undefined : product.items[0];
|
|
if (r6) {
|
|
if (r14) {
|
|
var viewBinding4Props = {style: styles.chooseRewardContainer};
|
|
var viewBinding5Props = {style: styles.gradientBackdrop, pointerEvents: 'none'};
|
|
items3 = [((Component) => <Component style={StyleSheet.absoluteFillObject} useAngle angle={(value5 == null || value5.gradient == null ? undefined : value5.gradient.angle) ?? 90} angleCenter={{'x': 0.5,
|
|
|
|
|
|
'y': 0.5}} colors={r26} />)(importDefault(4589) /* metro dependency 4589 */)];
|
|
items3[1] = value20 != null && ((Component) => <Component style={styles.backgroundImage} resizeMode="cover" source={{uri: value20}} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
items4 = [<View {...viewBinding5Props}>{items3}</View>];
|
|
items4[1] = value21 != null && ((Component) => <Component style={[styles.inAppFlowImage,
|
|
value7 && styles.inAppFlowImageLargeTilted]} resizeMode="contain" source={{uri: value21}} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
items4[2] = ((Text) => <Text style={styles.chooseRewardText} variant="text-xs/semibold" color="white">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cMiNit)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
|
|
r7 = <View {...viewBinding4Props}>{items4}</View>;
|
|
} else if (r32 == null) {
|
|
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
|
|
} else if (value12) {
|
|
if (selectedGiftingPromotionReward != null) {
|
|
var viewBinding2Props = {style: styles.selectedRewardRow};
|
|
items2 = [<View style={styles.selectedRewardBannerContainer}><RewardPreview collectiblesItem={r32} currentUser={currentUser} gradientColors={r30} gradientAngle={value5 == null || value5.gradient == null ? undefined : value5.gradient.angle} /></View>];
|
|
if (r19) {
|
|
r18 = !r19;
|
|
} else {
|
|
r18 = <IconButton variant="tertiary" size="sm" icon={((PencilIcon) => <PencilIcon size="sm" />)((require(9646) /* metro dependency 9646: PencilIcon */).PencilIcon)} accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bt75uw)} onPress={function() {
|
|
navigateToRewardSelection(selectedGiftingPromotionReward);
|
|
}} />;
|
|
}
|
|
items2[1] = r18;
|
|
r7 = <View {...viewBinding2Props}>{items2}</View>;
|
|
} else {
|
|
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
|
|
}
|
|
} else {
|
|
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
|
|
}
|
|
} else if (r32 == null) {
|
|
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
|
|
} else if (value12) {
|
|
if (selectedGiftingPromotionReward != null) {
|
|
var viewBinding2Props = {style: styles.selectedRewardRow};
|
|
items2 = [<View style={styles.selectedRewardBannerContainer}><RewardPreview collectiblesItem={r32} currentUser={currentUser} gradientColors={r30} gradientAngle={value5 == null || value5.gradient == null ? undefined : value5.gradient.angle} /></View>];
|
|
if (r19) {
|
|
r18 = !r19;
|
|
} else {
|
|
r18 = <IconButton variant="tertiary" size="sm" icon={((PencilIcon) => <PencilIcon size="sm" />)((require(9646) /* metro dependency 9646: PencilIcon */).PencilIcon)} accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bt75uw)} onPress={onPress_80974} />;
|
|
}
|
|
items2[1] = r18;
|
|
r7 = <View {...viewBinding2Props}>{items2}</View>;
|
|
} else {
|
|
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
|
|
}
|
|
} else {
|
|
r7 = enabled && nextTier != null ? ((Component) => <Component giftsToNextTier={giftsToNextTier} nextTierName={nextTier.name ?? ''} nextTierIcon={nextTier.simple_icon_url} analyticsLocation={(importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).PREMIUM_GIFT_CUSTOMIZATION} />)(importDefault(10396) /* metro dependency 10396: GiftingBadgeProgressBanner */) : null;
|
|
}
|
|
if (r6) {
|
|
r6 = !r6;
|
|
} else {
|
|
TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
|
|
format = intl.format;
|
|
hYoGUM = (require(1244) /* metro dependency 1244: indexNative */).t.hYoGUM;
|
|
defaultImport5 = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
|
|
r6 = <TextWithIOSLinkWorkaround variant="text-sm/normal">{Reflect.apply(format, intl, [hYoGUM,
|
|
{paidURL: defaultImport5.getArticleURL(HelpdeskArticles.PAID_TERMS)}])}</TextWithIOSLinkWorkaround>;
|
|
}
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
return (
|
|
<View style={styles.container}>
|
|
{r7}
|
|
{r6}
|
|
<Button
|
|
loading={isPurchasing}
|
|
variant={r12}
|
|
text={r11}
|
|
disabled={value4 ? isPurchasing : !value4}
|
|
onPress={isPurchasing ? undefined : _fun80975}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun80969() { // fn#80969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:3190, offset: 0x01e92ddc, size: 111 bytes, params: 1, frame: 13
|
|
var giftCustomizationBanner;
|
|
var properties;
|
|
let value = environment.__proto__;
|
|
const getMarketingComponentByType = PromotionsStore.getMarketingComponentByType;
|
|
const MarketingComponentType = (require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType;
|
|
const GIFT_CUSTOMIZATION_BANNER = MarketingComponentType.GIFT_CUSTOMIZATION_BANNER;
|
|
value = Reflect.apply(getMarketingComponentByType, PromotionsStore, [GIFT_CUSTOMIZATION_BANNER]);
|
|
const value2 = null;
|
|
if (value2 == value) {
|
|
giftCustomizationBanner = value2;
|
|
} else {
|
|
properties = value.properties;
|
|
properties = properties.properties;
|
|
if (properties.oneofKind !== 'giftCustomizationBanner') {
|
|
giftCustomizationBanner = value2;
|
|
} else {
|
|
properties = value.properties;
|
|
properties = properties.properties;
|
|
giftCustomizationBanner = properties.giftCustomizationBanner;
|
|
}
|
|
}
|
|
return giftCustomizationBanner;
|
|
}
|
|
|
|
function navigateToRewardSelection(a0) { // fn#80971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:3909, owner: PremiumGiftPurchaseButton.navigateToRewardSelection, offset: 0x01e92ead, size: 191 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var r4;
|
|
var setCurrentAnalyticsStepBinding;
|
|
var value3;
|
|
var binding;
|
|
var navigate;
|
|
var REWARD_SELECT;
|
|
var object2;
|
|
if (env0_8) {
|
|
setCurrentAnalyticsStepBinding = setCurrentAnalyticsStep;
|
|
value3 = environment.__proto__;
|
|
setCurrentAnalyticsStepBinding((require(7294) /* metro dependency 7294: PremiumAnalyticsUtils */).PaymentFlowStep.REWARD_SKU_SELECT);
|
|
r4 = a0 ?? defaultSelection;
|
|
binding = env0_1;
|
|
navigate = binding.navigate;
|
|
REWARD_SELECT = (require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens.REWARD_SELECT;
|
|
object2 = {defaultHighlightedReward: r4};
|
|
r4 = allRewards ?? [];
|
|
object2.allRewards = r4;
|
|
r4 = claimableRewards ?? [];
|
|
object2.claimableRewards = r4;
|
|
object2.onSelect = onSelect_80972;
|
|
Reflect.apply(navigate, binding, [REWARD_SELECT, object2]);
|
|
}
|
|
}
|
|
|
|
function _fun80973() { // fn#80973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:4208, offset: 0x01e92fb1, size: 35 bytes, params: 1, frame: 11
|
|
if (env0_9) {
|
|
setSelectedGiftingPromotionReward(claimableRewards[0]);
|
|
}
|
|
}
|
|
|
|
function PremiumGiftPurchaseButtonOnPress() { // fn#80974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:5802, owner: PremiumGiftPurchaseButton.onPress, offset: 0x01e92fd4, size: 20 bytes, params: 1, frame: 11
|
|
navigateToRewardSelection(selectedGiftingPromotionReward);
|
|
}
|
|
|
|
function _fun80975() { // fn#80975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:6253, offset: 0x01e92fe8, size: 82 bytes, params: 1, frame: 12
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
(require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard();
|
|
if (env0_10) {
|
|
if (env0_8) {
|
|
navigateToRewardSelection();
|
|
} else {
|
|
onPurchase(_fun80976);
|
|
}
|
|
} else {
|
|
onPurchase(_fun80976);
|
|
}
|
|
}
|
|
|
|
function navigateToRewardSelectionOnSelect(a0) { // fn#80972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:4127, owner: PremiumGiftPurchaseButton.navigateToRewardSelection.onSelect, offset: 0x01e92f6c, size: 69 bytes, params: 2, frame: 14
|
|
setSelectedGiftingPromotionReward(a0);
|
|
const binding = env1_1;
|
|
const navigate = binding.navigate;
|
|
const PremiumGiftScreens = (require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens;
|
|
const CUSTOMIZATION = PremiumGiftScreens.CUSTOMIZATION;
|
|
Reflect.apply(navigate, binding, [CUSTOMIZATION]);
|
|
}
|
|
|
|
function _fun80976() { // fn#80976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10647:6321, offset: 0x01e9303a, size: 57 bytes, params: 1, frame: 13
|
|
const binding = env1_1;
|
|
const navigate = binding.navigate;
|
|
const PremiumGiftScreens = (require(10382) /* metro dependency 10382: PremiumGiftModal */).PremiumGiftScreens;
|
|
const SUCCESS = PremiumGiftScreens.SUCCESS;
|
|
Reflect.apply(navigate, binding, [SUCCESS]);
|
|
}
|
|
|