/* 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] */ 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 var object4; const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(6) /* metro dependency 6 */; const env0_4 = importDefault(7) /* metro dependency 7 */; const env0_5 = importDefault(15) /* metro dependency 15 */; const env0_6 = importDefault(17) /* metro dependency 17 */; const env0_7 = importDefault(18) /* metro dependency 18 */; let value = importAll(31) /* metro dependency 31 */; const value2 = require(27) /* metro dependency 27 */; const env0_9 = value2.View; const env0_10 = value2.ActivityIndicator; const env0_11 = value2.TouchableWithoutFeedback; const applicationStore = importDefault(4234) /* metro dependency 4234: ApplicationStore */; const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */; const giftCodeStore = importDefault(8450) /* metro dependency 8450: GiftCodeStore */; const subscriptionPlanStore = importDefault(3807) /* metro dependency 3807: SubscriptionPlanStore */; const skuStore = importDefault(4279) /* metro dependency 4279: SKUStore */; const Fonts = (require(661) /* metro dependency 661: Constants */).Fonts; const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */; const env0_16 = premiumConstantsModule.SubscriptionIntervalTypes; const env0_17 = premiumConstantsModule.PremiumSubscriptionSKUs; const env0_18 = premiumConstantsModule.PremiumGiftStyles; const value9 = require(33) /* metro dependency 33 */; const env0_19 = value9.jsx; const env0_20 = value9.jsxs; const createStylesModule = require(4501) /* metro dependency 4501: createStyles */; const createLegacyClassComponentStyles = createStylesModule.createLegacyClassComponentStyles; object4 = {giftGroupCard: {'overflow': 'hidden', 'marginTop': 8}}; const object5 = {borderWidth: 1}; const CARD_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BORDER_DEFAULT; object5.borderColor = CARD_BORDER_DEFAULT; object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md; const TABLEROW_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TABLEROW_BACKGROUND_DEFAULT; object5.backgroundColor = TABLEROW_BACKGROUND_DEFAULT; object4.giftGroupCardRefresh = object5; const object7 = {'fontSize': 16, 'lineHeight': 20}; const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD; object7.fontFamily = PRIMARY_SEMIBOLD; const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY; object7.color = MOBILE_TEXT_HEADING_PRIMARY; object4.title = object7; const ICON_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE; object4.arrow = {color: ICON_SUBTLE}; object4.subtitle = {'fontSize': 14, 'lineHeight': 18}; object4.titleContainer = {'marginLeft': 8, 'flex': 1}; object4.groupCardHeader = {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between', 'padding': 16}; let BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; object4.groupCardHeaderLegacy = {backgroundColor: BACKGROUND_SURFACE_HIGH}; object4.rowArrow = {'height': 8, 'width': 12, 'marginRight': 8}; const object8 = {}; object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs; object4.giftIcon = object8; object4.generateGiftRow = {'padding': 8, 'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'space-between'}; BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH; object4.generateGiftRowLegacy = {backgroundColor: BACKGROUND_SURFACE_HIGH}; object4.generateGiftRowText = {flexShrink: 1}; object4.generateGiftButton = {marginLeft: 12}; object4.loading = {marginTop: 8}; object4.generateButtonContainer = {'flexGrow': 1, 'flexShrink': 0}; const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST; object4.groupCardHeaderOpen = {backgroundColor: BACKGROUND_BASE_LOWEST}; const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED; object4.groupCardHeaderOpenRefresh = {backgroundColor: BACKGROUND_MOD_MUTED}; object4.subtitleContainer = {'flexDirection': 'row', 'alignItems': 'center', 'gap': 4}; object4.socialLayerSubtitleContainer = {marginTop: 2}; const env0_21 = Reflect.apply(createLegacyClassComponentStyles, createStylesModule, [object4]); const Component = value.Component; value = _fun93868(Component); const ThemeContext = (require(3868) /* metro dependency 3868: native */).ThemeContext; value.contextType = ThemeContext; const flux = importDefault(566) /* metro dependency 566: flux */; value = flux.connectStores([authenticationStore, skuStore, applicationStore, giftCodeStore, subscriptionPlanStore], _fun93879)(value); (require(2) /* metro dependency 2 */).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 closure = EntitlementGiftGroupCard; env0_7(closure, a0); return env0_4(closure, [{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 _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 object2 = {sku: value2}; object2.isFetching = GiftCodeStore.getUserGiftCodesFetchingForSKUAndPlan(skuId, subscriptionPlanId); object2.loadedAt = GiftCodeStore.getUserGiftCodesLoadedAtForSKUAndPlan(skuId, subscriptionPlanId); object2.application = ApplicationStore.getApplication(value2.applicationId); object2.subscriptionPlan = subscriptionPlanId != null ? (require(8457) /* metro dependency 8457: SubscriptionUtils */).getOrFetchSubscriptionPlan(subscriptionPlanId) : null; const getForGifterSKUAndPlan = GiftCodeStore.getForGifterSKUAndPlan; const getId = AuthenticationStore.getId; let value = Reflect.apply(getForGifterSKUAndPlan, GiftCodeStore, [Reflect.apply(getId, AuthenticationStore, []), skuId, subscriptionPlanId]); value = value.filter(function(a0) { return !a0.isClaimed; }); object2.giftCodes = value.filter(function({giftStyle}) { return giftStyle === giftStyle; }); return object2; } 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 items = []; arraySpread(items, value, 0, items); value = env1_6(EntitlementGiftGroupCard); binding = env1_5; if (_isNativeReflectConstruct_93865()) { Reflect = global.Reflect; value = Reflect.construct(value, items, env1_6(this).constructor); r0 = value; } else { value = value.apply(this, items); r0 = value; } value = binding(this, r0); value._mountedAt = null; value.state = {isOpen: false}; value.handleToggleOpen = handleToggleOpen; value.handleGenerateGiftCode = handleGenerateGiftCode; return value; } 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 = (require(4573) /* metro dependency 4573: Text */).Text; const generateGiftRowText = value2.generateGiftRowText; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const text = {intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lELyPj)}; const generateButtonContainer = value2.generateButtonContainer; const generateGiftButton = value2.generateGiftButton; const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button; return ( {text}