This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
// Metro module 4229 (f4230).
const set = new Set(["500428425362931713", "451550535720501248", "471376328319303681", "466696214818193408"]);
export { set as THE_GAME_AWARD_WINNER_SKUS };
+257
View File
@@ -0,0 +1,257 @@
// Metro module 4228 (f4229).
import Record from "../../lib/Record";
import ApplicationRecord from "../../records/ApplicationRecord";
import { THE_GAME_AWARD_WINNER_SKUS } from "./SKUConstants";
import { GIFTABLE_CURRENCIES, OperatingSystems, SKUFlags, SKUTypes } from "../../Constants";
import Module3771 from "../../_bundle/Module3771";
import getPricesFromServer from "./utils/getPricesFromServer";
import transformSKUTenantMetadata from "./utils/transformSKUTenantMetadata";
import { hasFlag } from "../../_bundle/Module1384";
class SKURecord extends Record {
constructor(a0) {
super();
this.id = a0.id;
this.type = a0.type;
this.applicationId = a0.applicationId;
this.application = a0.application;
this.eligiblePaymentGateways = a0.eligiblePaymentGateways;
this.googleSkuIds = a0.googleSkuIds;
this.productLine = a0.productLine;
this.name = a0.name;
this.preorderReleaseAt = a0.preorderReleaseAt;
this.preorderApproximateReleaseDate = a0.preorderApproximateReleaseDate;
this.releaseDate = a0.releaseDate;
this.summary = a0.summary;
this.features = a0.features;
this.genres = a0.genres;
this.dependentSkuId = a0.dependentSkuId;
this.manifests = a0.manifests;
this.availableRegions = a0.availableRegions;
this.accessType = a0.accessType;
this.systemRequirements = a0.systemRequirements;
this.contentRating = a0.contentRating;
this.contentRatingAgency = a0.contentRatingAgency;
this.legalNotice = a0.legalNotice;
this.price = a0.price;
this.prices = a0.prices;
this.premium = a0.premium;
this.showAgeGate = a0.showAgeGate;
this.restricted = a0.restricted;
this.slug = a0.slug;
this.exclusive = a0.exclusive;
this.locales = a0.locales;
this.flags = a0.flags;
this.externalPurchaseUrl = a0.externalPurchaseUrl || null;
this.deleted = a0.deleted;
this.bundledSkuIds = a0.bundledSkuIds;
this.bundledSkus = a0.bundledSkus;
this.tenantMetadata = a0.tenantMetadata;
this.selectedOptions = a0.selectedOptions;
this.productId = a0.productId;
this.thumbnailAssetId = a0.thumbnailAssetId;
this.description = a0.description;
this.orbsReward = a0.orbsReward;
this.eligibleOffers = a0.eligibleOffers;
this.previewAssetPaths = a0.previewAssetPaths;
}
static createFromServer(a0) {
const price = a0.price;
const application = a0.application != null ? ApplicationRecord.createFromServer(a0.application) : null;
let eligible_payment_gateways = a0.eligible_payment_gateways;
if (eligible_payment_gateways == null) {
eligible_payment_gateways = null;
}
let google_sku_ids = a0.google_sku_ids;
if (google_sku_ids == null) {
google_sku_ids = null;
}
let name = a0.name;
if (name == null) {
name = "";
}
const r2 = {
id: a0.id,
type: a0.type,
applicationId: a0.application_id,
application,
eligiblePaymentGateways: eligible_payment_gateways,
googleSkuIds: google_sku_ids,
productLine: a0.product_line,
name,
releaseDate: a0.release_date != null ? Module3771(a0.release_date) : null,
preorderReleaseAt: a0.preorder_release_at != null ? Module3771(a0.preorder_release_at) : null,
preorderApproximateReleaseDate: a0.preorder_approximate_release_date,
summary: a0.summary,
features: new Set(a0.features),
genres: new Set(a0.genres),
dependentSkuId: a0.dependent_sku_id,
manifests: a0.manifests,
availableRegions: a0.available_regions,
accessType: a0.access_type,
systemRequirements: a0.system_requirements,
contentRating: a0.content_rating,
contentRatingAgency: a0.content_rating_agency,
legalNotice: a0.legal_notice,
price: price != null ? {
amount: price.amount,
currency: price.currency,
saleAmount: price.sale_amount,
salePercentage: price.sale_percentage,
premium: price.premium
} : null,
prices: getPricesFromServer(a0.prices),
premium: null,
showAgeGate: null,
restricted: null,
slug: null,
exclusive: null,
locales: null,
flags: null,
externalPurchaseUrl: null,
deleted: null,
bundledSkuIds: null,
bundledSkus: null,
tenantMetadata: null,
selectedOptions: null,
productId: null,
thumbnailAssetId: null,
description: null,
orbsReward: null,
eligibleOffers: null,
previewAssetPaths: null
};
let premium = a0.premium;
if (premium == null) {
premium = false;
}
r2.premium = premium;
r2.showAgeGate = a0.show_age_gate || false;
r2.restricted = a0.restricted || false;
let slug = a0.slug;
if (slug == null) {
slug = "";
}
r2.slug = slug;
r2.exclusive = a0.exclusive || false;
let locales = a0.locales;
if (locales == null) {
locales = ["en-US"];
}
r2.locales = locales;
r2.flags = a0.flags;
r2.externalPurchaseUrl = a0.external_purchase_url;
let deleted = a0.deleted;
if (deleted == null) {
deleted = false;
}
r2.deleted = deleted;
let bundled_sku_ids = a0.bundled_sku_ids;
if (bundled_sku_ids == null) {
bundled_sku_ids = [];
}
r2.bundledSkuIds = bundled_sku_ids;
const bundled_skus = a0.bundled_skus;
let bundledSkus = bundled_skus == null ? void 0 : bundled_skus.map((bundled_sku) => SKURecord.createFromServer(bundled_sku));
if (bundledSkus == null) {
bundledSkus = [];
}
r2.bundledSkus = bundledSkus;
r2.tenantMetadata = transformSKUTenantMetadata(a0.tenant_metadata);
const selected_options = a0.selected_options;
let selectedOptions = selected_options == null ? void 0 : selected_options.map((selected_option) => ({
optionName: selected_option.option_name,
optionValue: selected_option.option_value
}));
if (selectedOptions == null) {
selectedOptions = [];
}
r2.selectedOptions = selectedOptions;
r2.productId = a0.product_id;
r2.thumbnailAssetId = a0.thumbnail_asset_id;
r2.description = a0.description;
r2.orbsReward = a0.orbs_reward;
let eligible_offers = a0.eligible_offers;
if (eligible_offers == null) {
eligible_offers = [];
}
r2.eligibleOffers = eligible_offers;
r2.previewAssetPaths = a0.preview_asset_paths != null ? {
fgStatic: a0.preview_asset_paths.fg_static,
fgAnimated: a0.preview_asset_paths.fg_animated,
bgStatic: a0.preview_asset_paths.bg_static,
bgAnimated: a0.preview_asset_paths.bg_animated
} : null;
return new SKURecord(r2);
}
get supportedOperatingSystems() {
let r6 = this.systemRequirements != null ? Object.keys(this.systemRequirements) : [];
if (!(r6.length > 0)) {
r6 = [OperatingSystems.WINDOWS];
}
return r6;
}
get isOnSale() {
return this.price != null && this.price.saleAmount != null;
}
isGiftable(r3 = this.price) {
return this.type === SKUTypes.DURABLE_PRIMARY && this.available && this.requiresPayment && r3 != null && GIFTABLE_CURRENCIES.has(r3.currency) && this.externalPurchaseUrl == null;
}
getPrice(r6 = null, r2 = true) {
const price = this.price;
if (price == null) {
return null;
}
if (r6 != null) {
const premium = price.premium;
const r8 = premium == null ? void 0 : premium[r6];
if (r8 != null) {
return {
amount: r8.amount,
currency: price.currency
};
}
}
return r2 && price.saleAmount != null ? {
amount: price.saleAmount,
currency: price.currency
} : {
amount: price.amount,
currency: price.currency
};
}
getDisplaySalePercentage() {
return this.price == null ? null : this.price.salePercentage == null ? null : `-${this.price.salePercentage}%`;
}
get requiresPayment() {
const price = this.getPrice();
const premium = this.premium;
return (premium ? !premium : price != null) && price.amount > 0;
}
get isTheGameAwardsWinner() {
return THE_GAME_AWARD_WINNER_SKUS.has(this.id);
}
get available() {
return hasFlag(this.flags, SKUFlags.AVAILABLE) || this.externalPurchaseUrl != null;
}
isAvailableForDistribution() {
let r1 = this.available && this.getPrice() != null && this.externalPurchaseUrl == null;
if (r1) {
const premium = this.premium;
r1 = premium ? hasFlag(this.flags, SKUFlags.PREMIUM_AND_DISTRIBUTION) : !premium;
}
return r1;
}
isAvailable() {
return hasFlag(this.flags, SKUFlags.AVAILABLE);
}
isPremiumPerk() {
return this.premium && (hasFlag(this.flags, SKUFlags.PREMIUM_PURCHASE) || hasFlag(this.flags, SKUFlags.PREMIUM_AND_DISTRIBUTION));
}
hasFeature(a0) {
return this.features.has(a0);
}
isPreorder() {
return this.preorderReleaseAt != null || this.preorderApproximateReleaseDate != null;
}
}
export default SKURecord;
+170
View File
@@ -0,0 +1,170 @@
// 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 <View style={styles.container}>
<View style={[styles.scaler, styles.bundleContainer]}>
<BundleSampleV2 deco={itemsSortingHat.firstAvatarDecoration} pfx={itemsSortingHat.firstProfileEffect} nameplate={itemsSortingHat.firstNameplate} size="small" previewAssets={collectiblesItemData.previewAssets} disableStaticBackground targetSize={targetSize} />
</View>
</View>;
}
return null;
}
const type = collectiblesItemData.item.type;
if (CollectiblesItemType.AVATAR_DECORATION === type) {
return <View style={styles.container}>
<View style={styles.scaler}>
<AvatarDecorationSampleV2 item={collectiblesItemData.item} size={100} />
</View>
</View>;
}
if (CollectiblesItemType.PROFILE_EFFECT === type) {
return <View style={styles.container}>
<View style={styles.scaler}>
<ProfileEffectSampleV2 item={collectiblesItemData.item} hideBackground />
</View>
</View>;
}
if (CollectiblesItemType.PROFILE_FRAME === type) {
return <View style={styles.container}>
<View style={[styles.scaler, styles.profileFrameContainer]}>
<ProfileFrameSamplePreview profileFrame={collectiblesItemData.item} previewWidth={DEFAULT_ITEM_SIZE - Module712.space.PX_48} previewHeight={DEFAULT_ITEM_SIZE} />
</View>
</View>;
}
if (CollectiblesItemType.NAMEPLATE === type) {
return <View style={styles.container}>
<View style={styles.scaler}>
<NameplateCardPreview item={collectiblesItemData.item} />
</View>
</View>;
}
return null;
};
CollectiblesSKUPreview = function CollectiblesSKUPreview(props) {
const { sku, size = DEFAULT_ITEM_SIZE } = props;
const memo = useMemo(() => transformSKUToCollectiblesItem(sku), [sku]);
return memo != null ? <CollectiblesPreview collectiblesItemData={memo} size={size} /> : 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"
}) ? <SlayerStorefrontItemCard sku={sku2} containerStyle={styles.socialLayerStorefrontContainer} /> : 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 <View style={useStyles(r12.width, r12.height).premiumRiveContainer}>
<ThemeAwareNitroWishlistingWumpusRive dataBinding={{
logoColor: useToken(Module712.colors.TEXT_DEFAULT)
}} />
</View>;
};
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 <CollectiblesSKUPreview sku={sku2} size={size} />;
}
if (SKUProductLines.SOCIAL_LAYER_GAME_ITEM === productLine) {
return <SocialLayerStorefrontSKUPreview sku={sku2} size={size} />;
}
if (SKUProductLines.PREMIUM === productLine) {
return <PremiumSKUPreview size={size} />;
}
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 };
@@ -0,0 +1,15 @@
// Metro module 4230 (f4231).
import { getPriceFromServer } from "../../../records/SubscriptionPlanRecord";
export default function getPricesFromServer(a0) {
return a0 == null ? {} : Object.entries(a0).reduce((acc, item) => {
const [r24, r8] = item;
acc[r24] = {
countryPrices: {
countryCode: r8.country_prices.country_code,
prices: r8.country_prices.prices.map((price) => getPriceFromServer(price, true))
},
paymentSourcePrices: {}
};
return acc;
}, {});
};
@@ -0,0 +1,150 @@
// Metro module 4231 (f4232).
import { CollectiblesItemType } from "../../../_bundle/Module1901";
const transformProfileEffectKeyFrameFromServer = function transformProfileEffectKeyFrameFromServer(a0) {
let duration = a0.duration;
if (duration == null) {
duration = 0;
}
let start = a0.start;
if (start == null) {
start = 0;
}
const randomizedSources = a0.randomizedSources;
return {
src: a0.src,
loop: a0.loop,
height: a0.height,
width: a0.width,
duration,
start,
loopDelay: a0.loopDelay,
position: a0.position,
zIndex: a0.zIndex,
randomizedSources: randomizedSources == null ? void 0 : randomizedSources.map((randomizedSource) => ({
src: randomizedSource.src
}))
};
};
export default function transformSKUTenantMetadata(a0) {
if (a0 != null) {
const social_layer = a0.social_layer;
const r3 = social_layer != null;
let socialLayer = void 0;
if (r3) {
const carousel_items = social_layer.carousel_items;
let carouselItems = carousel_items == null ? void 0 : carousel_items.map((carousel_item) => ({
thumbnailAssetId: carousel_item.thumbnail_asset_id,
assetId: carousel_item.asset_id,
backgroundAssetId: carousel_item.background_asset_id,
youtubeVideoId: carousel_item.youtube_video_id,
label: carousel_item.label,
labelIconAssetId: carousel_item.label_icon_asset_id,
title: carousel_item.title,
description: carousel_item.description
}));
if (carouselItems == null) {
carouselItems = [];
}
socialLayer = {
carouselItems,
expiresAt: social_layer.expires_at != null ? new Date(social_layer.expires_at) : void 0,
cardImageAssetId: social_layer.card_image_asset_id,
cardBackgroundImageAssetId: social_layer.card_background_image_asset_id
};
}
const collectibles = a0.collectibles;
const r31 = collectibles != null;
let collectibles2 = void 0;
if (r31) {
const item = collectibles.item;
const r36 = item != null;
let item2 = void 0;
if (r36) {
const type = item.type;
if (CollectiblesItemType.AVATAR_DECORATION === type) {
const assets2 = item.assets;
item2 = {
id: item.id,
type: item.type,
asset: item.asset,
assets: assets2 != null ? {
staticImagePath: assets2.static_image_path,
animatedImagePath: assets2.animated_image_path,
videoPath: assets2.video_path
} : void 0,
label: item.label
};
} else if (CollectiblesItemType.NAMEPLATE === type) {
const assets = item.assets;
item2 = {
id: item.id,
type: item.type,
asset: item.asset,
assets: assets != null ? {
staticImagePath: assets.static_image_path,
animatedImagePath: assets.animated_image_path,
videoPath: assets.video_path
} : void 0,
label: item.label,
palette: item.palette
};
} else if (CollectiblesItemType.PROFILE_EFFECT === type) {
const effects = item.effects;
item2 = {
id: item.id,
type: item.type,
title: item.title,
description: item.description,
accessibilityLabel: item.accessibilityLabel,
animationType: item.animationType,
staticFrameSrc: item.staticFrameSrc,
thumbnailPreviewSrc: item.thumbnailPreviewSrc,
reducedMotionSrc: item.reducedMotionSrc,
effects: effects == null ? void 0 : effects.map(transformProfileEffectKeyFrameFromServer)
};
} else {
item2 = CollectiblesItemType.PROFILE_FRAME === type ? {
id: item.id,
type: item.type,
label: item.label,
layers: item.layers,
innerWidth: item.inner_width,
overflowTop: item.overflow_top,
overflowBottom: item.overflow_bottom,
overflowHorizontal: item.overflow_horizontal
} : void 0;
}
}
const expiresAt = collectibles.expires_at != null ? new Date(1000 * collectibles.expires_at) : void 0;
const variant = collectibles.variant;
collectibles2 = {
type: collectibles.type,
item: item2,
categorySkuId: collectibles.category_sku_id,
premiumType: collectibles.premium_type,
expiresSecondsAfterClaim: collectibles.expires_seconds_after_claim,
expiresAt,
variant: variant != null ? {
role: variant.role,
baseVariantSkuId: variant.base_variant_sku_id,
baseVariantName: variant.base_variant_name,
value: variant.value,
label: variant.label,
collapseUnder: variant.collapse_under
} : void 0,
optionSelectorDisplayValue: collectibles.option_selector_display_value,
sourceType: collectibles.source_type,
isFirstParty: collectibles.is_first_party
};
}
const plan_features = a0.plan_features;
return {
socialLayer,
collectibles: collectibles2,
gameServerPlanFeatures: plan_features == null ? void 0 : plan_features.map((plan_feature) => ({
title: plan_feature.title,
description: plan_feature.description
}))
};
}
};