// Metro module 8669 (f8670). import { useMemo } from "react"; import { View } from "react-native"; import { transformSKUToCollectiblesItem } from "../../collectibles/records/CollectiblesItemRecord"; import { SKUProductLines } from "../../../Constants"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import { DEFAULT_ITEM_SIZE } from "../../wishlists/native/WishlistItemCardBase"; import Module712 from "../../../_bundle/Module712"; import { isValidCollectiblesBundleItems } from "../../collectibles/utils/bundleUtils"; import { ItemsSortingHat } from "../../collectibles/hooks/useShopProductItems"; import BundleSampleV2 from "../../collectibles/native/BundleSampleV2"; import { CollectiblesItemType } from "../../../_bundle/Module1901"; import AvatarDecorationSampleV2 from "../../collectibles/native/AvatarDecorationSampleV2"; import ProfileEffectSampleV2 from "../../collectibles/native/ProfileEffectSampleV2"; import ProfileFrameSamplePreview from "../../collectibles/profile_frames/native/previews/ProfileFrameSamplePreview"; import NameplateCardPreview from "../../collectibles/nameplates/native/NameplateCardPreview"; import { useIsEligibleForSocialLayerStorefrontMobilePurchasing } from "../../slayer_storefront/experiments/SocialLayerStorefrontMobilePurchasingExperiment"; import SlayerStorefrontItemCard from "../../slayer_storefront/native/SlayerStorefrontItemCard"; import { useToken } from "../../../design/tokens/native/useToken"; import { ThemeAwareNitroWishlistingWumpusRive } from "../../../_bundle/Module3901"; import { assertNever } from "../../../utils/GlobalUtils"; let useStyles, targetSize, CollectiblesSKUPreview, SocialLayerStorefrontSKUPreview, PremiumSKUPreview; const CollectiblesPreview = function CollectiblesPreview(props) { const { collectiblesItemData, size = DEFAULT_ITEM_SIZE } = props; let r22 = size; if (typeof r22 === "number") { r22 = { width: size, height: size }; } const styles = useStyles(r22.width, r22.height); if (collectiblesItemData.type === "bundle") { if (isValidCollectiblesBundleItems(collectiblesItemData.items)) { const itemsSortingHat = new ItemsSortingHat(collectiblesItemData.items); return ; } return null; } const type = collectiblesItemData.item.type; if (CollectiblesItemType.AVATAR_DECORATION === type) { return ; } if (CollectiblesItemType.PROFILE_EFFECT === type) { return ; } if (CollectiblesItemType.PROFILE_FRAME === type) { return ; } if (CollectiblesItemType.NAMEPLATE === type) { return ; } return null; }; CollectiblesSKUPreview = function CollectiblesSKUPreview(props) { const { sku, size = DEFAULT_ITEM_SIZE } = props; const memo = useMemo(() => transformSKUToCollectiblesItem(sku), [sku]); return memo != null ? : null; }; SocialLayerStorefrontSKUPreview = function SocialLayerStorefrontSKUPreview(props) { const { sku: sku2, size = DEFAULT_ITEM_SIZE } = props; let r11 = size; if (typeof r11 === "number") { r11 = { width: size, height: size }; } const styles = useStyles(r11.width, r11.height); return useIsEligibleForSocialLayerStorefrontMobilePurchasing({ location: "sku_preview" }) ? : null; }; PremiumSKUPreview = function PremiumSKUPreview(props) { let size = props.size; if (size === void 0) { size = DEFAULT_ITEM_SIZE; } let r12 = size; if (typeof r12 === "number") { r12 = { width: size, height: size }; } return ; }; useStyles = createStyles((a0, a1) => ({ container: { width: "100%", height: "100%", display: "flex", justifyContent: "center", alignItems: "center" }, scaler: { width: DEFAULT_ITEM_SIZE, height: DEFAULT_ITEM_SIZE, justifyContent: "center", alignItems: "center", transform: [{ scaleX: a0 / DEFAULT_ITEM_SIZE }, { scaleY: a1 / DEFAULT_ITEM_SIZE }] }, bundleContainer: { paddingTop: 20 }, socialLayerStorefrontContainer: { width: a0, height: a1 }, profileFrameContainer: { padding: Module712.space.PX_8 }, premiumRiveContainer: { width: a0, height: a1 } })); targetSize = { width: DEFAULT_ITEM_SIZE, height: DEFAULT_ITEM_SIZE }; export default function SKUPreview(props) { const { sku: sku2, size = DEFAULT_ITEM_SIZE } = props; const productLine = sku2.productLine; if (SKUProductLines.COLLECTIBLES === productLine) { return ; } if (SKUProductLines.SOCIAL_LAYER_GAME_ITEM === productLine) { return ; } if (SKUProductLines.PREMIUM === productLine) { return ; } if (SKUProductLines.APPLICATION !== productLine && SKUProductLines.BOOST !== productLine && SKUProductLines.GUILD_ROLE !== productLine && SKUProductLines.GUILD_PRODUCT !== productLine) { assertNever(sku2.productLine); return void 0; } return null; }; export { CollectiblesPreview }; export { SocialLayerStorefrontSKUPreview }; export { PremiumSKUPreview };