// Metro module 14613 (f14614).
import { useMemo, useCallback } from "react";
import { Image as Image2, View } from "react-native";
import CollectiblesCategoryStore from "../CollectiblesCategoryStore";
import { CollectiblesMobileShopScreen } from "../CollectiblesShopConstants";
import { AnalyticEvents, UserSettingsSections, VerticalGradient } from "../../../Constants";
import CollectiblesShopCardV2, { COLLECTIBLES_SHOP_CARD_WIDTH } from "./CollectiblesShopCardV2";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import SkeletonCard from "./SkeletonCard";
import { useCollectiblesCoachmarkScrollDismissContext } from "./CollectiblesCoachmarkScrollDismissContext";
import { useNavigation } from "../../../design/components/Navigator/native/useNavigation.native";
import { useCollectiblesAnalyticsContext, CollectiblesAnalyticsProvider } from "../CollectiblesAnalyticsContext";
import { useStateFromStores } from "../../../_bundle/Module589";
import useTheme from "../../../hooks/useTheme";
import { useTrackProductCardImpression } from "../hooks/useTrackProductCardImpression";
import useGetProductsFromSkus from "../hooks/useGetProductsFromSkus";
import { useFilteredAndSortedProducts } from "./hooks/useFilteredAndSortedProducts";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../app_analytics/AnalyticsLocation";
import FeaturedFirstCardCoachmarkAnchor from "./FeaturedFirstCardCoachmarkAnchor";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { isThemeDark } from "../../../design/shared";
import Module14617 from "../../../_bundle/Module14617";
import Module14618 from "../../../_bundle/Module14618";
import VisibilitySensor from "./VisibilitySensor";
import FramesEarlyAccessBadge from "./FramesEarlyAccessBadge";
import Module4611 from "../../../_bundle/Module4611";
import { Text } from "../../../design/components/Text/native/Text";
import { Button } from "../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../intl/index.native";
import { openQuestHome } from "../../quests/native/QuestUtils.native";
import { QuestContent } from "../../../_bundle/Module5038";
import { PressableOpacity } from "../../../design/void/Pressables/native/Pressables";
import { ChevronSmallRightIcon } from "../../../design/components/Icon/native/redesign/generated/ChevronSmallRightIcon";
import { LayerScope } from "../../../design/components/Layers/native/LayerScope.native";
import FeedProductList from "./FeedProductList";
import { FlashList } from "../../../_bundle/noop_6676";
let useStyles;
const SkeletonLoading = function SkeletonLoading(props) {
const accessibilityLabel = props.accessibilityLabel;
return
{Array.from({
length: 10
}).map((item, index) => )}
;
};
useStyles = createStyles({
heroContainer: {
width: "100%"
},
framesBadgeContainer: {
position: "absolute",
top: Module712.space.PX_24,
left: 0,
right: 0,
paddingHorizontal: Module712.space.PX_16,
alignItems: "flex-start",
zIndex: 2
},
framesBannerWrapper: {
marginTop: -250,
paddingTop: 240,
paddingBottom: Module712.space.PX_16,
paddingHorizontal: Module712.space.PX_16,
flexDirection: "row",
alignItems: "center",
borderRadius: Module712.radii.lg,
overflow: "hidden",
zIndex: 0
},
framesBannerBackgroundImage: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
resizeMode: "stretch",
borderRadius: Module712.radii.lg
},
framesBannerTextContainer: {
flex: 1,
paddingRight: Module712.space.PX_4,
marginTop: Module712.space.PX_24
},
framesBannerTitle: {
marginBottom: Module712.space.PX_4
},
framesBannerForegroundImage: {
width: 125,
height: 125,
resizeMode: "contain",
transform: [{
translateY: Module712.space.PX_16
}]
},
heroBannerContainer: {
position: "absolute",
top: 0,
left: 0,
width: "100%",
maxHeight: 240 + 0.75 * COLLECTIBLES_SHOP_CARD_WIDTH,
aspectRatio: 1.4883720930232558
},
heroBannerImage: {
width: "100%",
height: "100%",
resizeMode: "cover"
},
orbsBackgroundGradient: {
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0
},
heroInfoContainer: {
display: "flex",
justifyContent: "center",
flex: 1,
minWidth: "100%",
maxHeight: 240,
aspectRatio: 2.2
},
innerContainer: {
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
paddingHorizontal: Module712.space.PX_16,
width: "100%",
height: "100%"
},
heroLogoContainer: {
flex: 1,
maxWidth: "80%",
maxHeight: "80%"
},
heroLogo: {
resizeMode: "contain",
maxHeight: "100%",
maxWidth: "100%",
aspectRatio: 1
},
heroViewAllIcon: {
backgroundColor: Module712.colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT,
padding: Module712.space.PX_8,
borderRadius: Module712.radii.round
},
orbsInnerContainer: {
paddingHorizontal: Module712.space.PX_16,
alignItems: "flex-start",
gap: Module712.space.PX_16
},
orbsTitle: {
fontSize: 24,
lineHeight: 30
},
productCardsContainer: {
zIndex: 1
},
skeletonContainer: {
flexDirection: "row",
gap: Module712.space.PX_12,
paddingHorizontal: Module712.space.PX_16
}
});
export default ({ heroBlock, bannerBlock, preferVCPrice, screen }) => {
let c21254_5, c21254_6;
c21254_5 = void 0;
c21254_6 = void 0;
const handleDismissCoachmarkOnScroll = useCollectiblesCoachmarkScrollDismissContext().handleDismissCoachmarkOnScroll;
const navigation = useNavigation();
const collectiblesAnalyticsContext = useCollectiblesAnalyticsContext();
let mobileHeroUrl = heroBlock.mobileHeroUrl;
if (mobileHeroUrl == null) {
mobileHeroUrl = heroBlock.heroBannerUrl;
}
const heroLogoUrl = heroBlock.heroLogoUrl;
const stateFromStores = useStateFromStores([CollectiblesCategoryStore], () => CollectiblesCategoryStore.getCategory(heroBlock.categorySkuId));
const bypassAndroidUnsyncedFilter = stateFromStores != null && stateFromStores.isOrbsExclusive;
const theme = useTheme();
const handleCardVisibilityChange = useTrackProductCardImpression(heroBlock.categoryStoreListingId, "mobile_home", "hero_block").handleCardVisibilityChange;
const styles = useStyles();
const getProductsFromSkus = useGetProductsFromSkus();
c21254_5 = getProductsFromSkus;
const filteredAndSortedProducts = useFilteredAndSortedProducts({
products: useMemo(() => c21254_5(heroBlock.rankedSkuIds), [heroBlock.rankedSkuIds, getProductsFromSkus]),
bypassAndroidUnsyncedFilter
});
const r4 = screen === CollectiblesMobileShopScreen.FEATURED_PAGE;
c21254_6 = r4;
const analyticsLocations = useAnalyticsLocations(AnalyticsLocation.COLLECTIBLES_SHOP_HERO).analyticsLocations;
const callback = useCallback(({ item, index }) => {
const r18 = ;
return
{index === 0 ? c21254_6 ? {r18} : r18 : r18}
;
}, [stateFromStores?.unpublishedAt, preferVCPrice, r4]);
if (stateFromStores === void 0) {
return null;
}
const r32 = heroBlock.mobileTitle != null ? heroBlock.mobileTitle : heroBlock.title;
const r33 = heroBlock.mobileSummary != null ? heroBlock.mobileSummary : heroBlock.summary;
if (bypassAndroidUnsyncedFilter) {
mobileHeroUrl = isThemeDark(theme) ? Module14617 : Module14618;
}
return
{mobileHeroUrl != null && <>
{bypassAndroidUnsyncedFilter && }
>}
{bypassAndroidUnsyncedFilter ?
{r32 != null && {r32}}
{r33 != null && r33 !== "" && {r33}}
: {
AnalyticsUtils.track(AnalyticEvents.COLLECTIBLES_SHOP_ELEMENT_CLICKED, {
collectibles_shop_session_id: collectiblesAnalyticsContext?.sessionId,
sku_id: heroBlock.categoryStoreListingId,
page_type: "mobile_home",
page_section: collectiblesAnalyticsContext?.pageSection,
page_category: collectiblesAnalyticsContext?.pageCategory,
tile_type: "HERO_BLOCK",
tile_position: String(collectiblesAnalyticsContext?.tilePosition),
cta_name: null
});
navigation.navigate(UserSettingsSections.COLLECTIBLES_SHOP_VIEW_ALL_CATEGORY_ITEMS, {
category: stateFromStores,
analyticsContext: collectiblesAnalyticsContext
});
}}>
{heroLogoUrl != null &&
}
}
{bypassAndroidUnsyncedFilter ? : <>
{filteredAndSortedProducts.length === 0 ? : } ListFooterComponent={() => } ItemSeparatorComponent={() => } />}
>}
{bannerBlock.mobileBackgroundImage != null && }
{bannerBlock.title}
{bannerBlock.body}
{bannerBlock.mobileForegroundImage != null && }
;
};