Files
discord-decomp/sources/modules/quests/native/QuestHomeBounties.tsx
T
2026-07-28 01:06:53 +03:00

632 lines
36 KiB
TypeScript

/* Metro module 13559; source: modules/quests/native/QuestHomeBounties.tsx; dependencies: [57, 31, 27, 7092, 6528, 1376, 33, 697, 13560, 4501, 9949, 1244, 5473, 4573, 6766, 13557, 1365, 7013, 694, 4081, 7110, 7120, 6531, 13515, 5459, 7121, 13561, 10183, 8416, 9483, 566, 13562, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import BountyStore from '../BountyStore.tsx'; /* Metro dependency 7092 */
import UseIsCarouselInView from './useIsCarouselInView.tsx'; /* Metro dependency 13561 */
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 Dismissible_contentModule from '../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
import * as DismissibleContentConstantsModule from '../../dismissible_content/DismissibleContentConstants.tsx'; /* Metro dependency 1376 */
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 NativeModule from '../../../design/assets/native.tsx'; /* Metro dependency 5473 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
import * as TextWithIOSLinkWorkaroundModule from '../../a11y/native/TextWithIOSLinkWorkaround.tsx'; /* Metro dependency 6766 */
import * as AnalyticsActionsModule from '../lib/analytics/AnalyticsActions.tsx'; /* Metro dependency 7110 */
import * as AnalyticsTypesModule from '../lib/analytics/AnalyticsTypes.tsx'; /* Metro dependency 7120 */
import * as AdCreativeTypeModule from '../../../external/discord_common/js/shared/shared-constants/AdCreativeType.tsx'; /* Metro dependency 7121 */
import * as FlashListModule from '../../../external/discord_common/js/packages/flash-list/index.jsx'; /* Metro dependency 8416 */
import * as QuestHooksModule from '../hooks/QuestHooks.tsx'; /* Metro dependency 9483 */
import * as AnalyticsHooksModule from '../lib/analytics/AnalyticsHooks.tsx'; /* Metro dependency 9949 */
import * as QuestContentImpressionTrackerNativeModule from './QuestContentImpressionTracker.native.tsx'; /* Metro dependency 10183 */
import * as BountiesModalActionCreatorsModule from './BountiesModal/BountiesModalActionCreators.tsx'; /* Metro dependency 13515 */
import * as OpenBountiesNuxPromoSheetModule from './openBountiesNuxPromoSheet.tsx'; /* Metro dependency 13557 */
import * as BountyCardModule from './BountyCard.tsx'; /* Metro dependency 13560 */
function _fun102974(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:6, offset: 0x02252450, size: 421 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
const CARD_WIDTH = (BountyCardModule).CARD_WIDTH;
const env0_13 = CARD_WIDTH + PX_16;
const env0_14 = (CreateStylesModule).createStyles(_fun103003);
const keyExtractor_103005 = function(a0) {
return a0.id;
};
value = value.memo(QuestHomeBounties);
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestHomeBounties.tsx');
exports.default = value;
function EmptyState_102975({reason}) { // fn#102975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:811, offset: 0x022525f5, size: 529 bytes, params: 2, frame: 26
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const styles = useStyles();
(AnalyticsHooksModule).useBountyCarouselEmptyStateAnalytics(reason);
let COMPLETED = BountyCarouselEmptyStateReason.COMPLETED;
const r12 = reason === COMPLETED ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.O2hRaZ) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.TKuW8z);
COMPLETED = BountyCarouselEmptyStateReason.COMPLETED;
const r15 = reason === COMPLETED ? (require(1244) /* metro dependency 1244: indexNative */).t['D/790X'] : (require(1244) /* metro dependency 1244: indexNative */).t.ReqPds;
const BountiesPosterIllocon = (NativeModule).BountiesPosterIllocon;
const bountiesPosterIllocon = <BountiesPosterIllocon size={32} />;
const Text = (TextModule).Text;
const text = (
<Text variant="text-sm/semibold" color="text-default">
{r12}
</Text>
);
const TextWithIOSLinkWorkaround = (TextWithIOSLinkWorkaroundModule).TextWithIOSLinkWorkaround;
return (
<View style={styles.emptyState}>
{bountiesPosterIllocon}
<View style={styles.emptyStateText}>
{text}
<TextWithIOSLinkWorkaround variant="text-xs/medium" color="text-muted">
{(require(1244) /* metro dependency 1244: indexNative */).intl.format(r15,
{onClickLearnMore: function() {
importDefault(dependencyMap[15])();
}})}
</TextWithIOSLinkWorkaround>
</View>
</View>
);
}
function getSnapIndex({nativeEvent}) { // fn#102977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:1423, offset: 0x02252825, size: 51 bytes, params: 2, frame: 12
const Math = global.Math;
return Math.round(nativeEvent.contentOffset.x / env0_13);
}
function QuestHomeBountiesCarousel({bounties}) { // fn#102978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:1565, offset: 0x02252858, size: 1017 bytes, params: 2, frame: 33
const styles = useStyles();
const value2 = property22.useRef(null);
const [property, env0_3] = env0_3Binding(property22.useState(0), 2);
const value6 = env0_3Binding(property22.useState(0), 2);
const property2 = value6[0];
var property22 = property2;
const env0_5 = value6[1];
const [property3, env0_7] = env0_3Binding(property22.useState(false), 2);
const env0_8 = property22.useRef(null);
const env0_9 = property22.useRef(false);
const env0_10 = property22.useRef({parent: {scrollX: 0}, children: {}, axis: 'horizontal'});
const value9 = property22.useCallback(_fun102979, []);
const value10 = property22.useCallback(_fun102980, [value9]);
const value11 = property22.useMemo(_fun102981, [bounties.length]);
const value12 = property22.useCallback(_fun102983, [property]);
const env0_12 = property22.useRef(property2);
const env0_13 = property22.useRef(null);
const value13 = property22.useCallback(_fun102984, [value9]);
const env0_14 = property22.useRef(false);
const env0_15 = property22.useRef(null);
const value14 = property22.useCallback(_fun102985, []);
const value15 = property22.useCallback(_fun102986, [property2]);
const value16 = property22.useCallback(_fun102987, []);
property22.useEffect(function() {
return _fun102990;
}, []);
property22.useEffect(_fun102991, [bounties, property2, value16]);
const value17 = property22.useCallback(_fun102997, []);
const {containerRef, isInView} = (UseIsCarouselInView)();
const value19 = property22.useCallback(_fun102998, [property2, value17, isInView, property3]);
const value20 = property22.useCallback(_fun103000, [bounties, value9]);
const value21 = property22.useMemo(_fun103002, [isInView, property2, property3]);
const FlashList = (FlashListModule).FlashList;
return (
<View
ref={containerRef}
style={styles.container}
onLayout={value10}
>
<FlashList
ref={value2}
horizontal
data={bounties}
renderItem={value19}
keyExtractor={keyExtractor_103005}
contentContainerStyle={styles.listContentContainer}
estimatedItemSize={env0_13}
snapToOffsets={value11}
snapToEnd={false}
decelerationRate="fast"
showsHorizontalScrollIndicator={false}
ItemSeparatorComponent={ItemSeparator_103004}
ListFooterComponent={value12}
onScroll={value13}
onScrollBeginDrag={value14}
onMomentumScrollEnd={value15}
scrollEventThrottle={16}
extraData={value21}
CellRendererComponent={value20}
/>
</View>
);
function _fun102979(a0) { // fn#102979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:1871, offset: 0x02252c51, size: 205 bytes, params: 2, frame: 16
var r2;
var r0;
var Object;
var value;
var property;
var value3;
var calculateVisibility;
var value4;
var value5;
if (a0 != null) {
Object = global.Object;
if (Object.hasOwn(env0_10.current.children, a0)) {
property = env0_10.current.children[a0];
if (!(property == null || property.calculateVisibility == null)) {
property.calculateVisibility();
}
return undefined;
}
} else {
Object = global.Object;
value = Object.values(env0_10.current.children);
var length = value.length;
var value2 = 0;
if (value2 < length) {
r2 = value2;
while (true) {
property = value[r2];
value3 = property == null;
if (value3) {
r0 = value3;
} else {
calculateVisibility = property.calculateVisibility;
value4 = calculateVisibility == null;
r0 = value4;
}
if (r0) {
continue;
}
property.calculateVisibility();
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value.length;
if (value5 < length) {
r2 = value5;
continue;
}
break;
}
}
}
}
function _fun102980(a0) { // fn#102980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:2192, offset: 0x02252d1e, size: 76 bytes, params: 2, frame: 13
env0_3(a0.nativeEvent.layout.width);
env0_10.current.parent.layout = a0.nativeEvent.layout;
env0_11();
}
function _fun102981() { // fn#102981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:2295, offset: 0x02252d6a, size: 74 bytes, params: 1, frame: 11
const Array = global.Array;
let array = new Array(bounties.length);
array = array.fill(0);
return array.map(_fun102982);
function _fun102982(a0, a1) { // fn#102982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:2332, offset: 0x02252db4, size: 16 bytes, params: 3, frame: 2
return a1 * env2_13;
}
}
function _fun102983() { // fn#102983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:2375, offset: 0x02252dc4, size: 99 bytes, params: 1, frame: 20
const Math = global.Math;
const max = Math.max;
const binding = env0_2;
const CARD_WIDTH = (BountyCardModule).CARD_WIDTH;
return <View style={{width: Reflect.apply(max, Math, [0, binding - CARD_WIDTH - PX_16])}} />;
}
function _fun102984(a0) { // fn#102984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:2489, offset: 0x02252e27, size: 213 bytes, params: 2, frame: 16
var value4;
let value = environment.__proto__;
const snapIndex = getSnapIndex(a0);
if (snapIndex !== env0_12.current) {
env0_12.current = snapIndex;
value4 = global.Date.now();
if (env0_13.current == null || value4 - env0_13.current >= 50) {
env0_13.current = value4;
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback((require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes.IMPACT_LIGHT);
}
}
env0_10.current.parent.scrollX = a0.nativeEvent.contentOffset.x;
env0_11();
}
function _fun102985() { // fn#102985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:2801, offset: 0x01f0a720, size: 64 bytes, params: 1, frame: 13
var clearTimeout;
var binding;
env0_14.current = false;
if (env0_15.current != null) {
clearTimeout = global.clearTimeout;
binding = env0_15;
clearTimeout(binding.current);
binding.current = null;
}
}
function _fun102986(a0) { // fn#102986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:2900, offset: 0x02252efc, size: 255 bytes, params: 2, frame: 19
var r7;
var moduleValue;
var trackBountyCarouselScroll;
var object;
var BountyScrollingType;
const HorizontalScrollingDirection = (require(7120) /* metro dependency 7120: AnalyticsTypes */).HorizontalScrollingDirection;
const snapIndex = getSnapIndex(a0);
const binding = env0_14;
const current = binding.current;
binding.current = false;
if (snapIndex !== env0_4) {
moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */;
trackBountyCarouselScroll = moduleValue.trackBountyCarouselScroll;
object = {};
BountyScrollingType = (require(7120) /* metro dependency 7120: AnalyticsTypes */).BountyScrollingType;
r7 = current ? BountyScrollingType.AUTO : BountyScrollingType.MANUAL;
object.scrollingType = r7;
r7 = snapIndex > env0_4 ? HorizontalScrollingDirection.RIGHT : HorizontalScrollingDirection.LEFT;
object.scrollingDirection = r7;
object.carouselPosition = snapIndex;
object.questContent = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
Reflect.apply(trackBountyCarouselScroll, moduleValue, [object]);
env0_5(snapIndex);
}
}
function _fun102987(a0) { // fn#102987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:3304, offset: 0x02252ffb, size: 98 bytes, params: 2, frame: 16
var clearTimeout;
var binding;
const env0_0 = a0;
if (env0_15.current != null) {
clearTimeout = global.clearTimeout;
binding = env0_15;
clearTimeout(binding.current);
binding.current = null;
}
env0_15.current = global.setTimeout(_fun102988, 350);
function _fun102988() { // fn#102988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:3388, offset: 0x0225305d, size: 85 bytes, params: 1, frame: 16
var scrollToOffset;
var binding;
var value3;
env1_14.current = true;
const current = env1_1.current;
if (current != null) {
scrollToOffset = current.scrollToOffset;
binding = env0_0;
value3 = environment.__proto__.__proto__;
Reflect.apply(scrollToOffset, current, [{offset: binding * env2_13, animated: true}]);
}
env1_15.current = null;
}
}
function _fun102989() { // fn#102989, offset: 0x022530b2, size: 11 bytes, params: 1, frame: 1
return _fun102990;
function _fun102990() { // fn#102990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:3521, offset: 0x01f0a6d9, size: 52 bytes, params: 1, frame: 13
var clearTimeout;
var binding;
if (env1_15.current != null) {
clearTimeout = global.clearTimeout;
binding = env1_15;
clearTimeout(binding.current);
binding.current = null;
}
}
}
function _fun102991() { // fn#102991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:3603, offset: 0x022530bd, size: 65 bytes, params: 1, frame: 14
var environment;
const handleModalClose_1029922 = handleModalClose_102992;
const value = environment.__proto__;
(Dispatcher).subscribe('MODAL_POP', handleModalClose_1029922);
return _fun102996;
function handleModalClose_102992({key}) { // fn#102992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:3608, offset: 0x022530fe, size: 260 bytes, params: 2, frame: 17
var environment;
var r3;
var value2;
var binding;
var current;
var index2;
const value = environment.__proto__.__proto__;
const BOUNTIES_MODAL_KEY = (BountiesModalActionCreatorsModule).BOUNTIES_MODAL_KEY;
if (key === BOUNTIES_MODAL_KEY) {
value2 = environment.__proto__;
env1_7(false);
binding = env1_8;
current = binding.current;
binding.current = null;
if (current != null) {
r3 = BountyStore.isBountyCompleted(current) && !env1_9.current;
env1_9.current = false;
if (bounties.findIndex(function({id}) {
return id === current;
}) !== -1) {
index2 = bounties.findIndex(_fun102994);
r3 = r3 && index2 !== -1;
r3 = r3 && index2 <= env1_4 + 3;
if (r3) {
(require(5459) /* metro dependency 5459: RunAfterInteractionsUtils */).runAfterInteractions(_fun102995);
}
}
}
}
function _fun102994(a0, a1) { // fn#102994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:3843, offset: 0x02253202, size: 62 bytes, params: 3, frame: 12
var bountyStoreBinding;
let value = environment.__proto__.__proto__;
let r0 = a1 > env2_4 && a1 > env0_1;
if (r0) {
value = environment.__proto__.__proto__.__proto__;
bountyStoreBinding = BountyStore;
value = !bountyStoreBinding.isBountyCompleted(a0.id);
r0 = value;
}
return r0;
}
function _fun102995() { // fn#102995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:3939, offset: 0x02253240, size: 23 bytes, params: 1, frame: 11
env2_16(env0_2);
}
}
function _fun102996() { // fn#102996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:4013, offset: 0x02253257, size: 52 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('MODAL_POP', handleModalClose_102992);
}
}
function _fun102997(a0, a1) { // fn#102997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:4104, offset: 0x0225328b, size: 298 bytes, params: 3, frame: 19
let value = environment.__proto__;
const trackAdContentClicked = AnalyticsActionsModule.trackAdContentClicked;
const object = {};
object.adContentId = a0.id;
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
const BOUNTY = AdCreativeType.BOUNTY;
object.adCreativeType = BOUNTY;
const QuestContent = (QuestTypesModule).QuestContent;
let QUEST_HOME_MOBILE_CAROUSEL = QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
object.questContent = QUEST_HOME_MOBILE_CAROUSEL;
const QuestContentCTA = (AnalyticsTypesModule).QuestContentCTA;
const START_BOUNTY = QuestContentCTA.START_BOUNTY;
object.questContentCTA = START_BOUNTY;
QUEST_HOME_MOBILE_CAROUSEL = QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
object.sourceQuestContent = QUEST_HOME_MOBILE_CAROUSEL;
object.questContentPosition = a1;
Reflect.apply(trackAdContentClicked, AnalyticsActionsModule, [object]);
let binding = env0_8;
binding.current = a0.id;
binding = env0_9;
const bountyStoreBinding = BountyStore;
binding.current = bountyStoreBinding.isBountyCompleted(a0.id);
env0_7(true);
value = importDefault(13515) /* metro dependency 13515: BountiesModalActionCreators */;
const showModal = value.showModal;
QUEST_HOME_MOBILE_CAROUSEL = QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
Reflect.apply(showModal, value, [{bountyId: a0.id, sourceQuestContent: QUEST_HOME_MOBILE_CAROUSEL}]);
}
function _fun102998({item, index}) { // fn#102998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:4647, offset: 0x022533b5, size: 223 bytes, params: 2, frame: 21
var environment;
let value = environment.__proto__;
value = undefined;
const QuestContentImpressionTrackerNative = (QuestContentImpressionTrackerNativeModule).QuestContentImpressionTrackerNative;
const questContentImpressionTrackerNativeProps = {adContentId: item.id};
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
const BOUNTY = AdCreativeType.BOUNTY;
questContentImpressionTrackerNativeProps.adCreativeType = BOUNTY;
const QuestContent = (QuestTypesModule).QuestContent;
let QUEST_HOME_MOBILE_CAROUSEL = QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
questContentImpressionTrackerNativeProps.questContent = QUEST_HOME_MOBILE_CAROUSEL;
questContentImpressionTrackerNativeProps.questContentPosition = index;
questContentImpressionTrackerNativeProps.trackGuildAndChannelMetadata = false;
questContentImpressionTrackerNativeProps.visibilityRef = env0_10;
QUEST_HOME_MOBILE_CAROUSEL = QuestContent.QUEST_HOME_MOBILE_CAROUSEL;
questContentImpressionTrackerNativeProps.sourceQuestContent = QUEST_HOME_MOBILE_CAROUSEL;
const isInViewBinding = isInView;
questContentImpressionTrackerNativeProps.overrideVisibility = isInViewBinding ? value : !!isInViewBinding;
return (
<QuestContentImpressionTrackerNative {...questContentImpressionTrackerNativeProps} key={item.id}>
{children_102999}
</QuestContentImpressionTrackerNative>
);
function children_102999() { // fn#102999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:5019, offset: 0x02253494, size: 92 bytes, params: 1, frame: 16
let value = environment.__proto__.__proto__;
value = importDefault(13560) /* metro dependency 13560: BountyCard */;
const itemBinding = item;
const indexBinding = index;
return ((Component) => <Component bounty={itemBinding} index={indexBinding} isActive={indexBinding === env1_4} isModalVisible={env1_6} onPress={env1_17} />)(value);
}
}
function _fun103000(a0) { // fn#103000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:5133, offset: 0x022534f0, size: 80 bytes, params: 2, frame: 15
const env0_0 = a0;
const CellContainer = (FlashListModule).CellContainer;
return <CellContainer {...a0} {...{['onLayout']: onLayout_103001}} />;
function onLayout_103001(a0) { // fn#103001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:5176, offset: 0x02253540, size: 139 bytes, params: 2, frame: 18
var binding;
var current;
var children;
var id;
var object;
var children2;
const property = bounties[env0_0.index];
if (property != null) {
binding = env1_10;
current = binding.current;
children = current.children;
id = property.id;
object = {};
current = binding.current;
children2 = current.children;
copyDataProperties(object, children2[property.id], children2);
object['layout'] = a0.nativeEvent.layout;
children[id] = object;
binding = env1_11;
id = property.id;
binding(id);
}
env0_0.onLayout(a0);
}
}
function _fun103002() { // fn#103002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:5337, offset: 0x022535cb, size: 34 bytes, params: 1, frame: 3
return {isInView: isInView, activeIndex: env0_4, isModalVisible: env0_6};
}
}
function _fun103003() { // fn#103003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:347, offset: 0x022535ed, size: 267 bytes, params: 1, frame: 16
const object = {};
const PX_48 = (importDefault(697) /* metro dependency 697: native */).space.PX_48;
object.container = {marginBottom: PX_48};
object.listContentContainer = {paddingLeft: PX_16};
const object4 = {'flexDirection': 'row', 'alignItems': 'center', 'gap': null, 'borderWidth': 1};
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object4.gap = PX_12;
const BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
object4.borderColor = BORDER_MUTED;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object4.overflow = 'hidden';
const PX_162 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.paddingHorizontal = PX_162;
object4.paddingVertical = 14;
const PX_163 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.marginHorizontal = PX_163;
object.emptyState = object4;
object.emptyStateText = {'flex': 1, 'gap': 2};
return object;
}
function ItemSeparator_103004() { // fn#103004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:1517, offset: 0x022536f8, size: 37 bytes, params: 1, frame: 14
return <View style={{width: PX_16}} />;
}
function QuestHomeBounties({verticalScrollEnabled}) { // fn#103006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:5882, offset: 0x0225371d, size: 352 bytes, params: 2, frame: 24
var r0;
var r5;
var value;
const useQuestHomeBounties = QuestHooksModule.useQuestHomeBounties;
const questHomeBounties = Reflect.apply(useQuestHomeBounties, QuestHooksModule, []).questHomeBounties;
const styles = useStyles();
useBountiesNux(questHomeBounties.length > 0);
const value3 = questHomeBounties.length === 0;
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([BountyStore], function() {
return BountyStore.areAllBountiesCompleted();
});
if (value3) {
var viewBindingProps = {style: styles.container};
if (verticalScrollEnabled) {
value = importDefault(13562) /* metro dependency 13562: BountiesCtaHeader */;
value = ((Component) => <Component bounties={questHomeBounties} isEmptyOrCompleted={value3 || value4} />)(value);
r5 = value;
} else {
r5 = (
<EmptyState_102975
reason={value3 ? BountyCarouselEmptyStateReason.EMPTY : BountyCarouselEmptyStateReason.COMPLETED}
/>
);
}
value = (
<View {...viewBindingProps}>
{r5}
</View>
);
r0 = value;
} else if (value4) {
var viewBindingProps = {style: styles.container};
if (verticalScrollEnabled) {
value = importDefault(13562) /* metro dependency 13562: BountiesCtaHeader */;
value = ((Component) => <Component bounties={questHomeBounties} isEmptyOrCompleted={value3 || value4} />)(value);
r5 = value;
} else {
r5 = (
<EmptyState_102975
reason={value3 ? BountyCarouselEmptyStateReason.EMPTY : BountyCarouselEmptyStateReason.COMPLETED}
/>
);
}
value = (
<View {...viewBindingProps}>
{r5}
</View>
);
r0 = value;
} else if (verticalScrollEnabled) {
var viewBindingProps = {style: styles.container};
value = importDefault(13562) /* metro dependency 13562: BountiesCtaHeader */;
value = (
<View {...viewBindingProps}>
{((Component) => <Component bounties={questHomeBounties} />)(value)}
</View>
);
r0 = value;
} else {
r0 = <QuestHomeBountiesCarousel bounties={questHomeBounties} />;
}
return r0;
function useBountiesNux(a0) { // fn#103007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:5999, owner: QuestHomeBounties.useBountiesNux, offset: 0x0225387d, size: 218 bytes, params: 2, frame: 18
const value3 = env1_3((require(7013) /* metro dependency 7013: useSelectedDismissibleContent */).useSelectedDismissibleContent(a0 ? [(require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.BOUNTIES_NUX_PROMO_SHEET] : []),
2);
const property = value3[0];
const property2 = value3[1];
const env0_2 = env1_4.useRef(false);
env1_4.useEffect(_fun103008, [property]);
env1_4.useEffect(_fun103009, [property, property2]);
function _fun103008() { // fn#103008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:6187, offset: 0x02253957, size: 101 bytes, params: 1, frame: 14
const binding = env0_0;
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
const BOUNTIES_NUX_PROMO_SHEET = DismissibleContent.BOUNTIES_NUX_PROMO_SHEET;
if (!(binding !== BOUNTIES_NUX_PROMO_SHEET || env0_2.current)) {
env0_2.current = true;
(importDefault(13557) /* metro dependency 13557: openBountiesNuxPromoSheet */)();
}
}
function _fun103009() { // fn#103009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:6309, offset: 0x022539bc, size: 108 bytes, params: 1, frame: 15
var environment;
const binding = env0_0;
const value = environment.__proto__.__proto__;
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
const BOUNTIES_NUX_PROMO_SHEET = DismissibleContent.BOUNTIES_NUX_PROMO_SHEET;
if (binding === BOUNTIES_NUX_PROMO_SHEET) {
(importDefault(694) /* metro dependency 694: Dispatcher */).subscribe('HIDE_ACTION_SHEET', handleHide_103010);
return _fun103011;
}
function handleHide_103010({key}) { // fn#103010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:6390, offset: 0x02253a28, size: 67 bytes, params: 2, frame: 13
var value2;
const PROMO_SHEET_KEY = (OpenBountiesNuxPromoSheetModule).PROMO_SHEET_KEY;
if (key === PROMO_SHEET_KEY) {
value2 = environment.__proto__;
env1_1(ContentDismissActionType.USER_DISMISS);
}
}
function _fun103011() { // fn#103011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13749:6507, offset: 0x02253a6b, size: 50 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('HIDE_ACTION_SHEET', handleHide_103010);
}
}
}
}
}
global.__d(_fun102974, 13559, [57, 31, 27, 7092, 6528, 1376, 33, 697, 13560, 4501, 9949, 1244, 5473, 4573, 6766,
13557, 1365, 7013, 694, 4081, 7110, 7120, 6531, 13515, 5459, 7121, 13561, 10183, 8416, 9483, 566, 13562,
2]) /* metro module 13559, dependencies: [57, 31, 27, 7092, 6528, 1376, 33, 697, 13560, 4501, 9949, 1244, 5473, 4573, 6766, 13557, 1365, 7013, 694, 4081, 7110, 7120, 6531, 13515, 5459, 7121, 13561, 10183, 8416, 9483, 566, 13562, 2] */;