485 lines
26 KiB
TypeScript
485 lines
26 KiB
TypeScript
/* Metro module 12287; source: components_native/premium/EntitlementGiftGroupCard.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 4234, 1226, 8450, 3807, 4279, 661, 1880, 33, 4501, 697, 8451, 4573, 1244, 4578, 6829, 8467, 1305, 6780, 8708, 6818, 12288, 12289, 10519, 10521, 10522, 10520, 10523, 10524, 10525, 10526, 10527, 10530, 10533, 10534, 12290, 3868, 566, 8457, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import SubscriptionPlanStore from '../../stores/billing/SubscriptionPlanStore.tsx'; /* Metro dependency 3807 */
|
|
import ApplicationStore from '../../modules/applications/ApplicationStore.tsx'; /* Metro dependency 4234 */
|
|
import SKUStore from '../../stores/game_store/SKUStore.tsx'; /* Metro dependency 4279 */
|
|
import GiftCodeStore from '../../stores/GiftCodeStore.tsx'; /* Metro dependency 8450 */
|
|
import GiftCodeActionCreators from '../../actions/GiftCodeActionCreators.tsx'; /* Metro dependency 8451 */
|
|
import GiftCodeRow from './GiftCodeRow.tsx'; /* Metro dependency 12290 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumConstantsModule from '../../modules/premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as NativeModule from '../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
|
|
import * as CreateStylesModule from '../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
|
|
function _fun93864(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:6, offset: 0x020c76a7, size: 1064 bytes, params: 8, frame: 33
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const Fonts = (ConstantsModule).Fonts;
|
|
const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles;
|
|
object = {giftGroupCard: {'overflow': 'hidden', 'marginTop': 8}};
|
|
const object2 = {borderWidth: 1};
|
|
const CARD_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BORDER_DEFAULT;
|
|
object2.borderColor = CARD_BORDER_DEFAULT;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
|
|
const TABLEROW_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TABLEROW_BACKGROUND_DEFAULT;
|
|
object2.backgroundColor = TABLEROW_BACKGROUND_DEFAULT;
|
|
object.giftGroupCardRefresh = object2;
|
|
const object3 = {'fontSize': 16, 'lineHeight': 20};
|
|
const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
|
|
object3.fontFamily = PRIMARY_SEMIBOLD;
|
|
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
|
|
object3.color = MOBILE_TEXT_HEADING_PRIMARY;
|
|
object.title = object3;
|
|
const ICON_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE;
|
|
object.arrow = {color: ICON_SUBTLE};
|
|
object.subtitle = {'fontSize': 14, 'lineHeight': 18};
|
|
object.titleContainer = {'marginLeft': 8, 'flex': 1};
|
|
object.groupCardHeader = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between',
|
|
'padding': 16};
|
|
let BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object.groupCardHeaderLegacy = {backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
object.rowArrow = {'height': 8, 'width': 12, 'marginRight': 8};
|
|
const object6 = {};
|
|
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object.giftIcon = object6;
|
|
object.generateGiftRow = {'padding': 8, 'flexDirection': 'row', 'alignItems': 'center',
|
|
'justifyContent': 'space-between'};
|
|
BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object.generateGiftRowLegacy = {backgroundColor: BACKGROUND_SURFACE_HIGH};
|
|
object.generateGiftRowText = {flexShrink: 1};
|
|
object.generateGiftButton = {marginLeft: 12};
|
|
object.loading = {marginTop: 8};
|
|
object.generateButtonContainer = {'flexGrow': 1, 'flexShrink': 0};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object.groupCardHeaderOpen = {backgroundColor: BACKGROUND_BASE_LOWEST};
|
|
const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
|
|
object.groupCardHeaderOpenRefresh = {backgroundColor: BACKGROUND_MOD_MUTED};
|
|
object.subtitleContainer = {'flexDirection': 'row', 'alignItems': 'center', 'gap': 4};
|
|
object.socialLayerSubtitleContainer = {marginTop: 2};
|
|
const env0_21 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]);
|
|
const Component = value.Component;
|
|
value = _fun93868(Component);
|
|
const ThemeContext = (NativeModule).ThemeContext;
|
|
value.contextType = ThemeContext;
|
|
value = Flux.connectStores([AuthenticationStore, SKUStore, ApplicationStore, GiftCodeStore, SubscriptionPlanStore],
|
|
_fun93879)(value);
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/premium/EntitlementGiftGroupCard.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_93865() { // fn#93865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:416, offset: 0x020c7acf, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_93865_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun93868(a0) { // fn#93868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:1968, offset: 0x020c7b31, size: 203 bytes, params: 2, frame: 16
|
|
const EntitlementGiftGroupCard2 = EntitlementGiftGroupCard;
|
|
Inherits(EntitlementGiftGroupCard2, a0);
|
|
return CreateClass(EntitlementGiftGroupCard2, [{key: 'componentDidMount', value: function() {
|
|
var Date = global.Date;
|
|
this._mountedAt = Date.now();
|
|
}}, {key: 'renderGenerateGiftCodeRow', value: value_93873}, {key: 'renderHeader', value: value_93874},
|
|
{key: 'getCardHeaderThumbnail', value: value_93875}, {key: 'renderCardHeader', value: value_93876},
|
|
{key: 'render', value: value_93877}]);
|
|
function EntitlementGiftGroupCard(a0) { // fn#93869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:1980, offset: 0x020c7bfc, size: 181 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, EntitlementGiftGroupCard);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_6(EntitlementGiftGroupCard);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_93865()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value._mountedAt = null;
|
|
value.state = {isOpen: false};
|
|
value.handleToggleOpen = handleToggleOpen;
|
|
value.handleGenerateGiftCode = handleGenerateGiftCode;
|
|
return value;
|
|
function handleToggleOpen() { // fn#93870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:2295, owner: EntitlementGiftGroupCard.handleToggleOpen, offset: 0x020c7cb1, size: 138 bytes, params: 1, frame: 16
|
|
var value6;
|
|
let binding = env0_0;
|
|
const {skuId, subscriptionPlanId, loadedAt} = binding.props;
|
|
const value2 = !binding.state.isOpen;
|
|
let r1 = loadedAt != null && env0_0._mountedAt != null;
|
|
r1 = !r1 ? !value2 : r1;
|
|
if (!r1) {
|
|
value6 = environment.__proto__.__proto__;
|
|
(importDefault(8451) /* metro dependency 8451: GiftCodeActionCreators */).fetchUserGiftCodesForSKU(skuId,
|
|
subscriptionPlanId);
|
|
}
|
|
binding = env0_0;
|
|
binding.setState({isOpen: value2});
|
|
}
|
|
|
|
function handleGenerateGiftCode() { // fn#93871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:2499, owner: EntitlementGiftGroupCard.handleGenerateGiftCode, offset: 0x020c7d3b, size: 69 bytes, params: 1, frame: 16
|
|
const {skuId, subscriptionPlanId, giftStyle} = env0_0.props;
|
|
const value = environment.__proto__.__proto__;
|
|
(GiftCodeActionCreators).createGiftCode(skuId, subscriptionPlanId,
|
|
giftStyle);
|
|
}
|
|
|
|
}
|
|
|
|
function value_93873() { // fn#93873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:2774, offset: 0x020c7d9e, size: 349 bytes, params: 1, frame: 26
|
|
const value2 = env1_21(this.context);
|
|
const isRefreshEnabled = this.props.isRefreshEnabled;
|
|
const items2 = [value2.generateGiftRow];
|
|
items2[1] = isRefreshEnabled ? null : value2.generateGiftRowLegacy;
|
|
const Text = (TextModule).Text;
|
|
const generateGiftRowText = value2.generateGiftRowText;
|
|
const intl = (IndexNativeModule).intl;
|
|
const text = (
|
|
<Text
|
|
variant="text-xs/medium"
|
|
color="text-subtle"
|
|
style={generateGiftRowText}
|
|
>
|
|
{intl.string((IndexNativeModule).t.lELyPj)}
|
|
</Text>
|
|
);
|
|
const generateButtonContainer = value2.generateButtonContainer;
|
|
const generateGiftButton = value2.generateGiftButton;
|
|
const Button = (ButtonNativeModule).Button;
|
|
return (
|
|
<View style={items2}>
|
|
{text}
|
|
<View style={generateButtonContainer}>
|
|
<View style={generateGiftButton}>
|
|
<Button
|
|
text={intl.string((IndexNativeModule).t['w4+/BA'])}
|
|
size="sm"
|
|
onPress={this.handleGenerateGiftCode}
|
|
/>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function value_93874(a0, a1) { // fn#93874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:3294, offset: 0x020c7efb, size: 1044 bytes, params: 3, frame: 39
|
|
var r10;
|
|
var r8;
|
|
const Icon = require(dependencyMap[23]).Icon;
|
|
var defaultImport;
|
|
var object2;
|
|
var moduleValue2;
|
|
const value = environment.__proto__;
|
|
const value2 = env1_21(this.context);
|
|
const state = this.state;
|
|
const props = this.props;
|
|
const isOpen = state.isOpen;
|
|
const entitlements = props.entitlements;
|
|
const application = props.application;
|
|
const sku = props.sku;
|
|
const isRefreshEnabled = props.isRefreshEnabled;
|
|
let r21 = require(dependencyMap[21]).isGameItemSKU(sku) && application != null;
|
|
const r12 = isRefreshEnabled ? value2.groupCardHeaderOpenRefresh : value2.groupCardHeaderOpen;
|
|
const handleToggleOpen = this.handleToggleOpen;
|
|
const items3 = [value2.groupCardHeader];
|
|
const value4 = null;
|
|
items3[1] = isRefreshEnabled ? value4 : value2.groupCardHeaderLegacy;
|
|
items3[2] = isOpen ? r12 : value4;
|
|
if (r21) {
|
|
defaultImport = importDefault(dependencyMap[22]);
|
|
object2 = {sku: sku};
|
|
moduleValue2 = require(dependencyMap[23]);
|
|
object2.size = moduleValue2.getIconSize(require(dependencyMap[23]).Icon.Sizes.LARGE);
|
|
object2.containerStyle = value2.giftIcon;
|
|
r10 = ((Component) => <Component {...object2} />)(defaultImport);
|
|
} else {
|
|
r10 = (
|
|
value4 != a0
|
|
? (
|
|
<Icon
|
|
resizeMode="contain"
|
|
source={a0}
|
|
disableColor
|
|
size={require(dependencyMap[23]).Icon.Sizes.LARGE}
|
|
style={value2.giftIcon}
|
|
/>
|
|
)
|
|
: value4
|
|
);
|
|
}
|
|
const items2 = [r10];
|
|
const titleContainer = value2.titleContainer;
|
|
const Text = require(dependencyMap[18]).Text;
|
|
const text = (
|
|
<Text
|
|
variant="heading-sm/semibold"
|
|
color="mobile-text-heading-primary"
|
|
accessibilityRole="header"
|
|
>
|
|
{a1}
|
|
</Text>
|
|
);
|
|
const items4 = [r21 && value2.socialLayerSubtitleContainer];
|
|
items4[1] = value2.subtitleContainer;
|
|
const r18 = r21 && ((Component) => <Component game={application} size={importDefault(dependencyMap[24]).Sizes.SIZE_24} skuId={sku.id} />)(importDefault(dependencyMap[24]));
|
|
const subtitle = value2.subtitle;
|
|
const intl = require(dependencyMap[19]).intl;
|
|
const format = intl.format;
|
|
const t = require(dependencyMap[19]).t;
|
|
r21 = r21 ? Reflect.apply(format, intl, [t['6plpZi'], {applicationName: application.name,
|
|
copies: entitlements.length}]) : Reflect.apply(format, intl, [t.zMcvcA, {copies: entitlements.length}]);
|
|
items2[1] = (
|
|
<View style={titleContainer}>
|
|
{text}
|
|
<View style={items4}>
|
|
{r18}
|
|
<Text
|
|
variant="text-md/normal"
|
|
color="text-subtle"
|
|
style={subtitle}
|
|
>
|
|
{r21}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
);
|
|
if (isRefreshEnabled) {
|
|
r8 = ((Component) => <Component />)(isOpen ? require(dependencyMap[25]).ChevronSmallDownIcon : require(dependencyMap[26]).ChevronSmallRightIcon);
|
|
} else {
|
|
r8 = (
|
|
<Icon
|
|
style={value2.rowArrow}
|
|
size={require(dependencyMap[23]).Icon.Sizes.LARGE}
|
|
source={importDefault(isOpen ? dependencyMap[27] : dependencyMap[28])}
|
|
color={value2.arrow.color}
|
|
/>
|
|
);
|
|
}
|
|
items2[2] = r8;
|
|
return (
|
|
<TouchableWithoutFeedback accessibilityRole="button" onPress={handleToggleOpen}>
|
|
<View style={items3}>
|
|
{items2}
|
|
</View>
|
|
</TouchableWithoutFeedback>
|
|
);
|
|
}
|
|
|
|
function value_93875(a0, a1) { // fn#93875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:4673, offset: 0x020c830f, size: 516 bytes, params: 3, frame: 13
|
|
var object;
|
|
const STANDARD_BOX = PremiumGiftStyles.STANDARD_BOX;
|
|
if (STANDARD_BOX === a1) {
|
|
return importDefault(10519) /* metro dependency 10519 */;
|
|
}
|
|
const CAKE = PremiumGiftStyles.CAKE;
|
|
if (CAKE === a1) {
|
|
return importDefault(10521) /* metro dependency 10521 */;
|
|
}
|
|
const CHEST = PremiumGiftStyles.CHEST;
|
|
if (CHEST === a1) {
|
|
return importDefault(10522) /* metro dependency 10522 */;
|
|
}
|
|
const COFFEE = PremiumGiftStyles.COFFEE;
|
|
if (COFFEE === a1) {
|
|
return importDefault(10520) /* metro dependency 10520 */;
|
|
}
|
|
const SEASONAL_STANDARD_BOX = PremiumGiftStyles.SEASONAL_STANDARD_BOX;
|
|
if (SEASONAL_STANDARD_BOX === a1) {
|
|
return importDefault(10523) /* metro dependency 10523 */;
|
|
}
|
|
const SEASONAL_CAKE = PremiumGiftStyles.SEASONAL_CAKE;
|
|
if (SEASONAL_CAKE === a1) {
|
|
return importDefault(10524) /* metro dependency 10524 */;
|
|
}
|
|
const SEASONAL_CHEST = PremiumGiftStyles.SEASONAL_CHEST;
|
|
if (SEASONAL_CHEST === a1) {
|
|
return importDefault(10525) /* metro dependency 10525 */;
|
|
}
|
|
const SEASONAL_COFFEE = PremiumGiftStyles.SEASONAL_COFFEE;
|
|
if (SEASONAL_COFFEE === a1) {
|
|
return importDefault(10526) /* metro dependency 10526 */;
|
|
}
|
|
const NITROWEEN_STANDARD = PremiumGiftStyles.NITROWEEN_STANDARD;
|
|
if (NITROWEEN_STANDARD === a1) {
|
|
object = {};
|
|
object.uri = importDefault(10527) /* metro dependency 10527: halloweenCardSmallPng */;
|
|
return object;
|
|
}
|
|
const TIER_0 = PremiumSubscriptionSKUs.TIER_0;
|
|
if (TIER_0 === a0) {
|
|
return importDefault(10530) /* metro dependency 10530 */;
|
|
}
|
|
const TIER_1 = PremiumSubscriptionSKUs.TIER_1;
|
|
if (TIER_1 === a0) {
|
|
return importDefault(10533) /* metro dependency 10533 */;
|
|
}
|
|
const TIER_2 = PremiumSubscriptionSKUs.TIER_2;
|
|
if (TIER_2 === a0) {
|
|
return importDefault(10534) /* metro dependency 10534 */;
|
|
}
|
|
const LEGACY = PremiumSubscriptionSKUs.LEGACY;
|
|
if (LEGACY === a0) {
|
|
return importDefault(10534) /* metro dependency 10534 */;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function value_93876(a0) { // fn#93876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:5202, offset: 0x020c8513, size: 305 bytes, params: 2, frame: 21
|
|
var r2;
|
|
var renderHeader;
|
|
var iconSource;
|
|
var intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const {application, subscriptionPlan, giftStyle} = this.props;
|
|
const id = a0.id;
|
|
const name = a0.name;
|
|
let value = this.getCardHeaderThumbnail(id, giftStyle);
|
|
const Object = global.Object;
|
|
const value4 = Object.values(PremiumSubscriptionSKUs).includes(id);
|
|
const value5 = null;
|
|
if (value4) {
|
|
if (value5 == subscriptionPlan) {
|
|
return value5;
|
|
}
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return this.renderHeader(value,
|
|
intl.formatToPlainString(subscriptionPlan.interval === SubscriptionIntervalTypes.MONTH ? t.rCJvqo : t.Vd3Iu8,
|
|
|
|
{skuName: a0.name, intervalCount: subscriptionPlan.intervalCount}));
|
|
}
|
|
if (value5 == application) {
|
|
r2 = value5;
|
|
} else {
|
|
renderHeader = this.renderHeader;
|
|
iconSource = application.getIconSource(32);
|
|
value = Reflect.apply(renderHeader, this, [value5 == iconSource ? value : iconSource, name]);
|
|
r2 = value;
|
|
}
|
|
return r2;
|
|
}
|
|
|
|
function value_93877() { // fn#93877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:5663, offset: 0x020c8644, size: 303 bytes, params: 1, frame: 29
|
|
var environment;
|
|
var r9;
|
|
var r5;
|
|
var Fragment;
|
|
var items3;
|
|
const value = environment.__proto__;
|
|
const value2 = env1_21(this.context);
|
|
const {entitlements, giftCodes, sku, isFetching, isRefreshEnabled} = this.props;
|
|
const isOpen = this.state.isOpen;
|
|
const items2 = [value2.giftGroupCard];
|
|
const value3 = null;
|
|
items2[1] = isRefreshEnabled ? value2.giftGroupCardRefresh : value3;
|
|
const value4 = this.renderCardHeader(sku);
|
|
if (isOpen) {
|
|
if (isFetching) {
|
|
r9 = <ActivityIndicator style={value2.loading} />;
|
|
} else {
|
|
Fragment = env1_8.Fragment;
|
|
items3 = [giftCodes.length < entitlements.length ? this.renderGenerateGiftCodeRow() : value3];
|
|
items3[1] = giftCodes.map(_fun93878);
|
|
r9 = (
|
|
<Fragment>
|
|
{items3}
|
|
</Fragment>
|
|
);
|
|
}
|
|
r5 = (
|
|
<View>
|
|
{r9}
|
|
</View>
|
|
);
|
|
} else {
|
|
r5 = value3;
|
|
}
|
|
return (
|
|
<View style={items2}>
|
|
{value4}
|
|
{r5}
|
|
</View>
|
|
);
|
|
function _fun93878(a0, a1) { // fn#93878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:6033, offset: 0x020c8773, size: 88 bytes, params: 3, frame: 18
|
|
const value = environment.__proto__.__proto__;
|
|
return ((Component) => <Component giftCode={a0} sku={sku} isFirst={a1 === 0} isRefreshEnabled={isRefreshEnabled} key={a0.code} />)(GiftCodeRow);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun93879({skuId, subscriptionPlanId, giftStyle}) { // fn#93879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12473:6222, offset: 0x020c87cb, size: 282 bytes, params: 2, frame: 19
|
|
const value2 = SKUStore.get(skuId);
|
|
if (value2 == null) {
|
|
throw new global.Error('SKU was unavailable while rendering gift.');
|
|
}
|
|
const object = {sku: value2};
|
|
let giftCodeStoreBinding = GiftCodeStore;
|
|
object.isFetching = giftCodeStoreBinding.getUserGiftCodesFetchingForSKUAndPlan(skuId, subscriptionPlanId);
|
|
object.loadedAt = giftCodeStoreBinding.getUserGiftCodesLoadedAtForSKUAndPlan(skuId, subscriptionPlanId);
|
|
object.application = ApplicationStore.getApplication(value2.applicationId);
|
|
object.subscriptionPlan = subscriptionPlanId != null ? (require(8457) /* metro dependency 8457: SubscriptionUtils */).getOrFetchSubscriptionPlan(subscriptionPlanId) : null;
|
|
giftCodeStoreBinding = GiftCodeStore;
|
|
const getForGifterSKUAndPlan = giftCodeStoreBinding.getForGifterSKUAndPlan;
|
|
const authenticationStoreBinding = AuthenticationStore;
|
|
const getId = authenticationStoreBinding.getId;
|
|
let value = Reflect.apply(getForGifterSKUAndPlan, giftCodeStoreBinding, [Reflect.apply(getId,
|
|
authenticationStoreBinding, []), skuId, subscriptionPlanId]);
|
|
value = value.filter(function(a0) {
|
|
return !a0.isClaimed;
|
|
});
|
|
object.giftCodes = value.filter(function({giftStyle}) {
|
|
return giftStyle === giftStyle;
|
|
});
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun93864, 12287, [6, 7, 15, 17, 18, 31, 27, 4234, 1226, 8450, 3807, 4279, 661, 1880, 33, 4501, 697,
|
|
8451, 4573, 1244, 4578, 6829, 8467, 1305, 6780, 8708, 6818, 12288, 12289, 10519, 10521, 10522, 10520, 10523,
|
|
10524, 10525, 10526, 10527, 10530, 10533, 10534, 12290, 3868, 566, 8457,
|
|
2]) /* metro module 12287, dependencies: [6, 7, 15, 17, 18, 31, 27, 4234, 1226, 8450, 3807, 4279, 661, 1880, 33, 4501, 697, 8451, 4573, 1244, 4578, 6829, 8467, 1305, 6780, 8708, 6818, 12288, 12289, 10519, 10521, 10522, 10520, 10523, 10524, 10525, 10526, 10527, 10530, 10533, 10534, 12290, 3868, 566, 8457, 2] */;
|