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

@@ -0,0 +1,12 @@
// Metro module 14459 (f14460).
import { AnalyticEvents } from "../../Constants";
import { NotificationSettingsUpdateType } from "../notifications/NotificationConstants";
import { EnableFriendAnniversaryNotifications } from "../user_settings/UserSettings";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
export function onFriendAnniversaryNotificationSettingsChanged(a0) {
EnableFriendAnniversaryNotifications.updateSetting(a0);
AnalyticsUtils.track(AnalyticEvents.NOTIFICATION_SETTINGS_UPDATED, {
update_type: NotificationSettingsUpdateType.ACCOUNT,
friend_anniversary_notifications: a0
});
}
+33
View File
@@ -0,0 +1,33 @@
// Metro module 5648 (f5649).
import GuildStore from "../../stores/GuildStore";
import UserStore from "../../stores/UserStore";
import { MAX_USER_GUILDS } from "../../Constants";
import { useStateFromStores, useStateFromStoresObject } from "../../_bundle/Module589";
import { HotspotStore, HotspotLocations, hideHotspot } from "../hotspot/index";
import PremiumUtils from "../../utils/PremiumUtils";
export function useShouldShowInlineGuildCapUpsell() {
let r11 = useStateFromStores([GuildStore], () => GuildStore.getGuildCount() >= 95);
const stateFromStores = useStateFromStores([HotspotStore], () => HotspotStore.hasHotspot(HotspotLocations.GUILD_CAP_INLINE_UPSELL));
const stateFromStoresObject = useStateFromStoresObject([UserStore], () => !PremiumUtils.isPremium(UserStore.getCurrentUser()));
if (r11) {
r11 = stateFromStores;
}
if (r11) {
r11 = stateFromStoresObject;
}
return r11;
}
export function hideInlineGuildCapUpsell() {
hideHotspot(HotspotLocations.GUILD_CAP_INLINE_UPSELL);
}
export function hasIncreasedGuildCap(a0) {
return PremiumUtils.canUseIncreasedGuildCap(a0) || (a0 == null ? void 0 : a0.isStaff()) === true;
}
export function isAtGuildCapAndNonPremium() {
let r0 = GuildStore.getGuildCount() >= MAX_USER_GUILDS;
if (r0) {
const currentUser = UserStore.getCurrentUser();
r0 = !(PremiumUtils.canUseIncreasedGuildCap(currentUser) || (currentUser == null ? void 0 : currentUser.isStaff()) === true);
}
return r0;
}
@@ -0,0 +1,30 @@
// Metro module 14782 (f14783).
import UserStore from "../../stores/UserStore";
import Dispatcher from "../../Dispatcher";
import { userRecordToServer } from "../messages/createMessage";
export function updateClientPremiumTypeOverride(a0, a1) {
let user = a1;
Dispatcher.dispatch({
type: "SET_PREMIUM_TYPE_OVERRIDE",
premiumType: a0
});
if (a1 == null) {
user = UserStore.getCurrentUser();
}
if (user != null) {
Dispatcher.dispatch({
type: "UPDATE_CLIENT_PREMIUM_TYPE",
user
});
Dispatcher.dispatch({
type: "CURRENT_USER_UPDATE",
user: userRecordToServer(user)
});
}
}
export function updateClientCreatedAtOverride(a0) {
Dispatcher.dispatch({
type: "SET_CREATED_AT_OVERRIDE",
createdAt: a0
});
}
@@ -0,0 +1,66 @@
// Metro module 1875 (f1876).
import { UNSELECTED_CREATED_AT_DATE, UNSELECTED_PREMIUM_TYPE_OVERRIDE } from "./PremiumConstants";
import { getPremiumTypeFromRawValue } from "../user/UserStoreUtils";
import Module589 from "../../_bundle/Module589";
import Dispatcher from "../../Dispatcher";
let c1580_4;
const setPremiumTypeActual = function setPremiumTypeActual(a0) {
c1580_4.premiumTypeActual = getPremiumTypeFromRawValue(a0.user.premium_type);
};
c1580_4 = {
premiumTypeOverride: UNSELECTED_PREMIUM_TYPE_OVERRIDE,
premiumTypeActual: UNSELECTED_PREMIUM_TYPE_OVERRIDE,
createdAtOverride: UNSELECTED_CREATED_AT_DATE
};
class OverridePremiumTypeStore extends Module589.PersistedStore {
static displayName = "OverridePremiumTypeStore";
static persistKey = "OverridePremiumTypeStore";
static migrations = [(a0) => {
if (a0?.createdAtOverride == null) {
return {
...a0,
createdAtOverride: UNSELECTED_CREATED_AT_DATE
};
}
}];
initialize(a0) {
if (a0 != null) {
c1580_4.premiumTypeActual = a0?.premiumTypeActual;
c1580_4.premiumTypeOverride = a0?.premiumTypeOverride;
if (a0.createdAtOverride != null) {
c1580_4.createdAtOverride = new Date(a0.createdAtOverride);
} else {
c1580_4.createdAtOverride = UNSELECTED_CREATED_AT_DATE;
}
return void 0;
}
c1580_4.premiumTypeOverride = UNSELECTED_PREMIUM_TYPE_OVERRIDE;
c1580_4.createdAtOverride = UNSELECTED_CREATED_AT_DATE;
}
getPremiumTypeOverride() {
return c1580_4.premiumTypeOverride;
}
getPremiumTypeActual() {
return c1580_4.premiumTypeActual;
}
getCreatedAtOverride() {
return c1580_4.createdAtOverride;
}
getState() {
return c1580_4;
}
get premiumType() {
return c1580_4.premiumTypeOverride;
}
}
const overridePremiumTypeStore = new OverridePremiumTypeStore(Dispatcher, {
SET_PREMIUM_TYPE_OVERRIDE: function setPremiumTypeOverride(a0) {
c1580_4.premiumTypeOverride = a0.premiumType;
},
SET_CREATED_AT_OVERRIDE: function setCreatedAtOverride(a0) {
c1580_4.createdAtOverride = a0.createdAt;
},
CURRENT_USER_UPDATE: setPremiumTypeActual,
CONNECTION_OPEN: setPremiumTypeActual
});
export default overridePremiumTypeStore;
@@ -0,0 +1,222 @@
// Metro module 12497 (f12498).
import UserStore from "../../stores/UserStore";
import SubscriptionStore from "../../stores/billing/SubscriptionStore";
import UserOfferStore from "../../stores/billing/UserOfferStore";
import EntitlementStore from "../../stores/game_store/EntitlementStore";
import PromotionsStore from "./promotions/PromotionsStore";
import { PremiumTypes, PurchasedFlags } from "./PremiumConstants";
import { PaymentGateways, SubscriptionStatusTypes } from "../../Constants";
import Module3771 from "../../_bundle/Module3771";
import PremiumUtils from "../../utils/PremiumUtils";
import { isAndroid } from "../../utils/PlatformUtils";
import { isMobile } from "../../_bundle/Module4426";
import { getIsPaymentsBlocked, useIsPaymentsBlocked } from "../billing/experiments/BlockedPaymentsCountryExperiment";
import { useBogoPromotion } from "./promotions/PromotionsHooks";
import { getBogoPromotionGateEnabled, useBogoPromotionGateEnabled } from "./experiments/BogoPromotionExperiment";
import { useStateFromStoresObject } from "../../_bundle/defaultAreStatesEqual";
import { usePremiumTrialOffer } from "./hooks/usePremiumTrialOffer.android";
import { usePremiumDiscountOffer } from "./hooks/usePremiumDiscountOffer.android";
import useScheduledForcedUpdate from "./hooks/useScheduledForcedUpdate";
import { getBogoMarketingMaterialsEnabled, useBogoMarketingMaterialsEnabled } from "./experiments/BOGOPromotionMarketingMaterialsExperiments";
import { fetchMostRecentSubscription, fetchSubscriptions } from "../billing/actions/BillingActionCreators";
import { fetchActiveBogoPromotion } from "./promotions/PromotionsActionCreators";
let isEligibleForBOGOPromotion;
const isUserEligibleBasedOnCurrentOrPreviousSubs = function isUserEligibleBasedOnCurrentOrPreviousSubs({ experimentEnabled, premiumSubscription, mostRecentSubscription, previousPremiumSubscription }) {
if (experimentEnabled) {
if (mostRecentSubscription != null && mostRecentSubscription.status === SubscriptionStatusTypes.ENDED) {
const endedAt = mostRecentSubscription.endedAt;
const hasPremiumAtLeast = mostRecentSubscription.hasPremiumAtLeast(PremiumTypes.TIER_2);
if (endedAt != null && hasPremiumAtLeast && Module3771().subtract(10, "days").isBefore(endedAt)) {
return false;
}
}
if (previousPremiumSubscription != null && previousPremiumSubscription.status === SubscriptionStatusTypes.ENDED) {
const endedAt2 = previousPremiumSubscription.endedAt;
const hasPremiumAtLeast2 = previousPremiumSubscription.hasPremiumAtLeast(PremiumTypes.TIER_2);
if (endedAt2 != null && hasPremiumAtLeast2 && Module3771().subtract(10, "days").isBefore(endedAt2)) {
return false;
}
}
L22: {
if (premiumSubscription != null) {
const hasPremiumAtLeast3 = premiumSubscription.hasPremiumAtLeast(PremiumTypes.TIER_2);
const currentUser = UserStore.getCurrentUser();
const r59 = !!premiumSubscription?.hasActiveTrial && PremiumUtils.isPremiumExactly(currentUser, PremiumTypes.TIER_0);
const r71 = isAndroid() && premiumSubscription.paymentGateway !== PaymentGateways.GOOGLE;
if (!hasPremiumAtLeast3 && !r59 && !r71) {
break L22;
}
return false;
}
}
return isMobile ? !EntitlementStore.isFractionalPremiumActive() : !isMobile;
}
return false;
};
isEligibleForBOGOPromotion = async function isEligibleForBOGOPromotion(c27297_0) {
let r152;
let c27297_2;
let c30524_0, c30524_1, c30524_2, c30524_3, c30524_4, c30524_5, c30524_6, c30524_7;
L39: {
L37: {
L27: {
c27297_2 = void 0;
c30524_0 = void 0;
if (c27297_0 !== void 0) {
c30524_0 = c27297_0;
c30524_1 = void 0;
c30524_2 = void 0;
c30524_3 = void 0;
c30524_4 = void 0;
c30524_5 = void 0;
c30524_6 = void 0;
c30524_7 = void 0;
} else {
c30524_0 = true;
c30524_1 = void 0;
c30524_2 = void 0;
c30524_3 = void 0;
c30524_4 = void 0;
c30524_5 = void 0;
c30524_6 = void 0;
c30524_7 = void 0;
}
await void 0;
c30524_1 = UserStore.getCurrentUser();
const r13 = c30524_1;
c30524_2 = !(r13 == null ? void 0 : r13.isClaimed());
c30524_3 = getIsPaymentsBlocked();
c30524_4 = getBogoPromotionGateEnabled("bogo eligibility async check");
c30524_5 = getBogoMarketingMaterialsEnabled("bogo marketing eligibility async check");
let r80 = !isMobile;
if (isMobile) {
r80 = isAndroid();
}
c30524_6 = r80;
if (c30524_2) {
break L39;
}
if (c30524_3) {
break L39;
}
if (!c30524_4) {
break L39;
}
if (c30524_0 && !c30524_5) {
break L39;
}
if (!c30524_6) {
break L39;
}
if (UserOfferStore.hasFetchedOffer()) {
if (UserOfferStore.hasAnyUnexpiredOffer()) {
break L27;
}
if (UserOfferStore.hasAnyUnexpiredDiscountOffer()) {
break L27;
}
}
const hasFetchedMostRecentPremiumTypeSubscription = SubscriptionStore.hasFetchedMostRecentPremiumTypeSubscription();
let r104 = !hasFetchedMostRecentPremiumTypeSubscription;
if (!hasFetchedMostRecentPremiumTypeSubscription) {
const currentUser = UserStore.getCurrentUser();
r104 = currentUser == null ? void 0 : currentUser.hasPurchasedFlag(PurchasedFlags.PREMIUM_TIER_2);
}
if (r104) {
await fetchMostRecentSubscription();
}
if (!SubscriptionStore.hasFetchedSubscriptions()) {
await fetchSubscriptions();
}
c30524_7 = SubscriptionStore.getMostRecentPremiumTypeSubscription();
r152 = (0, isUserEligibleBasedOnCurrentOrPreviousSubs)({
experimentEnabled: c30524_4,
premiumSubscription: SubscriptionStore.getPremiumTypeSubscription(),
mostRecentSubscription: c30524_7,
previousPremiumSubscription: SubscriptionStore.getPreviousPremiumTypeSubscription()
});
break L37;
}
return false;
}
return r152;
}
return false;
};
export { isUserEligibleBasedOnCurrentOrPreviousSubs };
export function useIsEligibleForBogoPromotion(r12 = true) {
const isPaymentsBlocked = useIsPaymentsBlocked();
const promotion = useBogoPromotion().promotion;
const bogoPromotionGateEnabled = useBogoPromotionGateEnabled("bogo eligibility hook");
const stateFromStoresObject = useStateFromStoresObject([SubscriptionStore], () => ({
mostRecentSubscription: SubscriptionStore.getMostRecentPremiumTypeSubscription(),
premiumSubscription: SubscriptionStore.getPremiumTypeSubscription(),
previousPremiumSubscription: SubscriptionStore.getPreviousPremiumTypeSubscription()
}));
const { mostRecentSubscription, premiumSubscription, previousPremiumSubscription } = stateFromStoresObject;
const premiumTrialOffer = usePremiumTrialOffer();
const premiumDiscountOffer = usePremiumDiscountOffer();
const r20 = Date;
let r47 = promotion?.endDate;
if (r47 == null) {
r47 = 0;
}
const r51 = new r20(r47).valueOf();
const r54 = Date.now();
const r4 = r54 > r51;
useScheduledForcedUpdate({
delay: r4 ? -1 : r51 - r54
});
let r64 = isMobile ? isAndroid() : !isMobile;
const isUserEligibleBasedOnCurrentOrPreviousSubs2 = isUserEligibleBasedOnCurrentOrPreviousSubs({
experimentEnabled: bogoPromotionGateEnabled,
premiumSubscription,
mostRecentSubscription,
previousPremiumSubscription
});
let r75 = useBogoMarketingMaterialsEnabled("bogo marketing eligibility hook");
let r76 = !r4;
if (!r4) {
if (!r12) {
if (r64) {
r64 = isUserEligibleBasedOnCurrentOrPreviousSubs2;
}
if (r64) {
r64 = premiumTrialOffer == null;
}
if (r64) {
r64 = promotion != null;
}
if (r64) {
r64 = !isPaymentsBlocked;
}
if (r64) {
r64 = premiumDiscountOffer == null;
}
r75 = r64;
}
r76 = r75;
}
return r76;
}
export { isEligibleForBOGOPromotion };
export async function maybeFetchActiveBogoPromotion() {
let c27298_1;
let c30525_0;
L17: {
L15: {
c27298_1 = void 0;
c30525_0 = void 0;
if (await isEligibleForBOGOPromotion(false)) {
c30525_0 = PromotionsStore.bogoPromotion;
if (c30525_0 != null && new Date(c30525_0.endDate).valueOf() >= Date.now()) {
break L15;
}
await fetchActiveBogoPromotion();
break L17;
}
return void 0;
}
return void 0;
}
}
+897
View File
@@ -0,0 +1,897 @@
// Metro module 1876 (f1877).
import * as _Constants from "../../Constants";
import { DEFAULT_EMOJI_SLOTS } from "../emojis/EmojiConstants";
import { t } from "../../intl/index.native";
import { BadgeRarity } from "../../_bundle/Module1878";
import { FractionalPremiumSKUs } from "../../_bundle/Module679";
import * as _Module1879 from "../../_bundle/Module1879";
const { BoostedGuildTiers, BITRATE_MAX, MAX_ATTACHMENT_SIZE, GuildFeatures, MAX_STAGE_VIDEO_USER_LIMIT_TIER01, MAX_STAGE_VIDEO_USER_LIMIT_TIER2, MAX_STAGE_VIDEO_USER_LIMIT_TIER3 } = _Constants;
const r101 = {
PREMIUM_TRIAL: 0,
0: "PREMIUM_TRIAL",
PREMIUM_DISCOUNT: 1,
1: "PREMIUM_DISCOUNT"
};
const r100 = {
TIER_1: 1,
1: "TIER_1",
TIER_2: 2,
2: "TIER_2",
TIER_0: 3,
3: "TIER_0"
};
const r99 = [{
id: "non-nitro",
value: null,
label: "Non-Nitro"
}, {
id: "tier-0",
value: r100.TIER_0,
label: "Basic"
}, {
id: "tier-1",
value: r100.TIER_1,
label: "Classic"
}, {
id: "tier-2",
value: r100.TIER_2,
label: "Standard"
}];
const r128 = Object;
const r130 = {};
r130[r100.TIER_0] = 0;
r130[r100.TIER_1] = 1;
r130[r100.TIER_2] = 2;
const r98 = r128.freeze(r130);
const r97 = {
NONE: "628379670982688768",
TIER_0: "978380684370378762",
TIER_1: "521846918637420545",
TIER_2: "521847234246082599",
GUILD: "590663762298667008",
LEGACY: "521842865731534868"
};
const r96 = [r97.TIER_0, r97.TIER_2];
const r95 = [r97.NONE, r97.TIER_0, r97.TIER_1, r97.TIER_2, r97.GUILD];
const r147 = Object;
const r149 = {};
r149[r97.TIER_0] = r100.TIER_0;
r149[r97.TIER_1] = r100.TIER_1;
r149[r97.TIER_2] = r100.TIER_2;
r149[r97.NONE] = r100.TIER_2;
r149[r97.LEGACY] = r100.TIER_2;
const r94 = r147.freeze(r149);
const r159 = Object;
const r161 = {};
r161[r100.TIER_0] = r97.TIER_0;
r161[r100.TIER_1] = r97.TIER_1;
r161[r100.TIER_2] = r97.TIER_2;
const r93 = r159.freeze(r161);
const r92 = {
NONE_MONTH: "628379151761408000",
NONE_YEAR: "628381571568631808",
PREMIUM_MONTH_TIER_0: "978380692553465866",
PREMIUM_YEAR_TIER_0: "1024422698568122368",
PREMIUM_MONTH_TIER_1: "511651871736201216",
PREMIUM_YEAR_TIER_1: "511651876987469824",
PREMIUM_MONTH_TIER_2: "511651880837840896",
PREMIUM_YEAR_TIER_2: "511651885459963904",
PREMIUM_MONTH_GUILD: "590665532894740483",
PREMIUM_YEAR_GUILD: "590665538238152709",
NONE_3_MONTH: "944265614527037440",
NONE_6_MONTH: "944265636643602432",
PREMIUM_3_MONTH_TIER_2: "642251038925127690",
PREMIUM_6_MONTH_TIER_2: "944037208325619722",
PREMIUM_3_MONTH_GUILD: "944037355453415424",
PREMIUM_6_MONTH_GUILD: "944037391444738048",
PREMIUM_MONTH_LEGACY: "511651856145973248",
PREMIUM_YEAR_LEGACY: "511651860671627264",
PREMIUM_GROUP_MONTH: "1432523012455792640"
};
const set6 = new Set([r92.PREMIUM_MONTH_TIER_0, r92.PREMIUM_YEAR_TIER_0, r92.PREMIUM_MONTH_TIER_1, r92.PREMIUM_YEAR_TIER_1, r92.PREMIUM_MONTH_TIER_2, r92.PREMIUM_3_MONTH_TIER_2, r92.PREMIUM_6_MONTH_TIER_2, r92.PREMIUM_YEAR_TIER_2, r92.PREMIUM_GROUP_MONTH, r92.PREMIUM_MONTH_LEGACY, r92.PREMIUM_YEAR_LEGACY]);
const set5 = new Set([r92.PREMIUM_MONTH_TIER_2, r92.PREMIUM_3_MONTH_TIER_2, r92.PREMIUM_6_MONTH_TIER_2, r92.PREMIUM_YEAR_TIER_2]);
const set4 = new Set([r92.PREMIUM_MONTH_GUILD, r92.PREMIUM_3_MONTH_GUILD, r92.PREMIUM_6_MONTH_GUILD, r92.PREMIUM_YEAR_GUILD]);
const set3 = new Set([r92.PREMIUM_MONTH_TIER_0, r92.PREMIUM_MONTH_TIER_1, r92.PREMIUM_MONTH_TIER_2]);
const set2 = new Set([r92.NONE_MONTH, r92.NONE_3_MONTH, r92.NONE_6_MONTH, r92.NONE_YEAR]);
const r231 = Object;
const r233 = {};
r233[r97.TIER_0] = r92.PREMIUM_MONTH_TIER_0;
r233[r97.TIER_1] = r92.PREMIUM_MONTH_TIER_1;
r233[r97.TIER_2] = r92.PREMIUM_MONTH_TIER_2;
r233[r97.NONE] = void 0;
r233[r97.GUILD] = void 0;
r233[r97.LEGACY] = void 0;
const r81 = r231.freeze(r233);
const r243 = Object;
const r245 = {};
r245[r97.TIER_0] = r92.PREMIUM_YEAR_TIER_0;
r245[r97.TIER_1] = r92.PREMIUM_YEAR_TIER_1;
r245[r97.TIER_2] = r92.PREMIUM_YEAR_TIER_2;
r245[r97.NONE] = void 0;
r245[r97.GUILD] = void 0;
r245[r97.LEGACY] = void 0;
const r80 = r243.freeze(r245);
const r79 = {
MONTH: 1,
1: "MONTH",
YEAR: 2,
2: "YEAR",
DAY: 3,
3: "DAY"
};
const r78 = {
DAY: 1,
1: "DAY",
WEEK: 2,
2: "WEEK",
MONTH: 3,
3: "MONTH",
YEAR: 4,
4: "YEAR"
};
const r259 = Object;
const r261 = {};
r261[r100.TIER_0] = t["t9uG/o"];
r261[r100.TIER_1] = t.FSOz78;
r261[r100.TIER_2] = t.lG6a5x;
const r77 = r259.freeze(r261);
const r276 = Object;
const r278 = {};
r278[r92.NONE_MONTH] = {
id: r92.NONE_MONTH,
name: "None Monthly",
skuId: r97.NONE,
interval: r79.MONTH,
intervalCount: 1
};
r278[r92.NONE_YEAR] = {
id: r92.NONE_YEAR,
name: "None Yearly",
skuId: r97.NONE,
interval: r79.YEAR,
intervalCount: 1
};
r278[r92.PREMIUM_MONTH_TIER_0] = {
id: r92.PREMIUM_MONTH_TIER_0,
name: "Nitro Basic Monthly",
premiumType: r100.TIER_0,
skuId: r97.TIER_0,
interval: r79.MONTH,
intervalCount: 1
};
r278[r92.PREMIUM_YEAR_TIER_0] = {
id: r92.PREMIUM_YEAR_TIER_0,
name: "Nitro Basic Yearly",
premiumType: r100.TIER_0,
skuId: r97.TIER_0,
interval: r79.YEAR,
intervalCount: 1
};
r278[r92.PREMIUM_MONTH_TIER_1] = {
id: r92.PREMIUM_MONTH_TIER_1,
name: "Nitro Classic Monthly",
premiumType: r100.TIER_1,
skuId: r97.TIER_1,
interval: r79.MONTH,
intervalCount: 1
};
r278[r92.PREMIUM_YEAR_TIER_1] = {
id: r92.PREMIUM_YEAR_TIER_1,
name: "Nitro Classic Yearly",
premiumType: r100.TIER_1,
skuId: r97.TIER_1,
interval: r79.YEAR,
intervalCount: 1
};
r278[r92.PREMIUM_MONTH_TIER_2] = {
id: r92.PREMIUM_MONTH_TIER_2,
name: "Nitro Monthly",
premiumType: r100.TIER_2,
skuId: r97.TIER_2,
interval: r79.MONTH,
intervalCount: 1
};
r278[r92.PREMIUM_YEAR_TIER_2] = {
id: r92.PREMIUM_YEAR_TIER_2,
name: "Nitro Yearly",
premiumType: r100.TIER_2,
skuId: r97.TIER_2,
interval: r79.YEAR,
intervalCount: 1
};
r278[r92.PREMIUM_MONTH_GUILD] = {
id: r92.PREMIUM_MONTH_GUILD,
name: "Nitro Server Boost Monthly",
skuId: r97.GUILD,
interval: r79.MONTH,
intervalCount: 1
};
r278[r92.PREMIUM_YEAR_GUILD] = {
id: r92.PREMIUM_YEAR_GUILD,
name: "Nitro Server Boost Yearly",
skuId: r97.GUILD,
interval: r79.YEAR,
intervalCount: 1
};
r278[r92.PREMIUM_3_MONTH_TIER_2] = {
id: r92.PREMIUM_3_MONTH_TIER_2,
name: "Nitro Three Month",
premiumType: r100.TIER_2,
skuId: r97.TIER_2,
interval: r79.MONTH,
intervalCount: 3
};
r278[r92.PREMIUM_6_MONTH_TIER_2] = {
id: r92.PREMIUM_6_MONTH_TIER_2,
name: "Nitro Six Month",
premiumType: r100.TIER_2,
skuId: r97.TIER_2,
interval: r79.MONTH,
intervalCount: 6
};
r278[r92.PREMIUM_3_MONTH_GUILD] = {
id: r92.PREMIUM_3_MONTH_GUILD,
name: "Nitro Server Boost Three Month",
skuId: r97.GUILD,
interval: r79.MONTH,
intervalCount: 3
};
r278[r92.PREMIUM_6_MONTH_GUILD] = {
id: r92.PREMIUM_6_MONTH_GUILD,
name: "Nitro Server Boost Six Month",
skuId: r97.GUILD,
interval: r79.MONTH,
intervalCount: 6
};
r278[r92.NONE_3_MONTH] = {
id: r92.NONE_3_MONTH,
name: "None Three Month",
skuId: r97.NONE,
interval: r79.MONTH,
intervalCount: 3
};
r278[r92.NONE_6_MONTH] = {
id: r92.NONE_6_MONTH,
name: "None Six Month",
skuId: r97.NONE,
interval: r79.MONTH,
intervalCount: 6
};
r278[r92.PREMIUM_MONTH_LEGACY] = {
id: r92.PREMIUM_MONTH_LEGACY,
name: "Nitro Monthly (Legacy)",
premiumType: r100.TIER_2,
skuId: r97.LEGACY,
interval: r79.MONTH,
intervalCount: 1
};
r278[r92.PREMIUM_YEAR_LEGACY] = {
id: r92.PREMIUM_YEAR_LEGACY,
name: "Nitro Classic Yearly (Legacy)",
premiumType: r100.TIER_2,
skuId: r97.LEGACY,
interval: r79.YEAR,
intervalCount: 1
};
r278[r92.PREMIUM_GROUP_MONTH] = {
id: r92.PREMIUM_GROUP_MONTH,
name: "Nitro Squad Monthly",
premiumType: r100.TIER_2,
skuId: r97.TIER_2,
interval: r79.MONTH,
intervalCount: 1
};
const r76 = r276.freeze(r278);
const set = new Set([r92.PREMIUM_MONTH_TIER_2]);
const r60 = ["520373071933079552", "902329034132684800", "983601860436819968", "983601860436819969", "984244797441048577", "1004850445463584768", "1073698058383917056", "1070132870233980928", "1267968635301789696", "1267969164312576000", "1268347360493174784", "1271484512081285191", "1161363847311785984"];
const r57 = ["1223319122125783040", "1223380890109870080"];
const r54 = ["1503844767820152833", "1503844767820152834"];
const r53 = ["1161363847311785984"];
const r52 = Object.freeze({
"520373071933079552": {
id: "520373071933079552",
skus: [r97.TIER_2]
},
"902329034132684800": {
id: "902329034132684800",
skus: [r97.TIER_2]
},
"983601860436819968": {
id: "983601860436819968",
skus: [r97.TIER_2]
},
"983601860436819969": {
id: "983601860436819969",
skus: [r97.TIER_2]
},
"984244797441048577": {
id: "984244797441048577",
skus: [r97.TIER_2]
},
"1004850445463584768": {
id: "1004850445463584768",
skus: [r97.TIER_2]
},
"1070132870233980928": {
id: "1070132870233980928",
skus: [r97.TIER_0]
},
"1073698058383917056": {
id: "1073698058383917056",
skus: [r97.TIER_2]
},
"1268347360493174784": {
id: "1268347360493174784",
skus: [r97.TIER_2]
},
"1161363847311785984": {
id: "1161363847311785984",
skus: [r97.TIER_2]
}
});
const r51 = {
ANIMATED_GUILD_BANNER_TOOLTIP: "animated_guild_banner_tooltip",
EMOJI_PICKER_SEARCH: "emoji_picker_search",
EMOJI_PICKER_EMOJI_CLICKED: "emoji_picker_emoji_clicked",
EMOJI_PICKER_STICKER_CLICKED: "emoji_picker_sticker_clicked",
EMOJI_PICKER_REACTION_EMOJI_CLICKED: "emoji_picker_reaction_emoji_clicked",
EMOJI_PICKER_SUPER_REACTION_EMOJI_CLICKED: "emoji_picker_super_reaction_emoji_clicked",
EMOJI_PICKER_STATUS_EMOJI_CLICKED: "emoji_picker_status_emoji_clicked",
EMOJI_PICKER_TOP_SERVER_EMOJI_CLICKED: "emoji_picker_top_server_emoji_clicked",
EMOJI_PICKER_NEWLY_ADDED_EMOJI_CLICKED: "emoji_picker_newly_added_emoji_clicked",
EMOJI_AUTOSUGGEST_CLICKED: "emoji_autosuggest_clicked",
EMOJI_AUTOCOMPLETE_INLINE: "emoji_autocomplete_inline",
EMOJI_AUTOCOMPLETE_MODAL: "emoji_autocomplete_modal",
EMOJI_IN_MESSAGE_HOVER: "emoji_in_message_hover",
EMOJI_IN_REACTION_HOVER: "emoji_in_reaction_hover",
EMOJI_IN_BURST_REACTION_HOVER: "emoji_in_burst_reaction_hover",
EMOJI_IN_BURST_REACTION_HOVER_UPSELL: "emoji_in_burst_reaction_hover_upsell",
EMOJI_PICKER_FLOATING_UPSELL: "emoji_picker_floating_upsell",
STICKER_IN_MESSAGE_HOVER: "sticker_in_message_hover",
EMPTY_STICKER_PICKER_UPSELL: "empty_sticker_picker_upsell",
STREAM_QUALITY_INDICATOR: "stream_quality_indicator",
GIFT_STREAM_QUALITY_INDICATOR: "gift_stream_quality_indicator",
MESSAGE_LENGTH_UPSELL: "message_length_upsell",
MESSAGE_LENGTH_IN_EDITOR_UPSELL: "message_length_in_editor_upsell",
CUSTOM_PROFILE_UPSELL: "custom profiles upsell modal",
CUSTOM_PROFILE_TRY_OUT_UPSELL: "try out custom profile in settings upsell",
VIDEO_BACKGROUNDS_MODAL: "video backgrounds modal",
VIDEO_BACKGROUNDS_INLINE: "video backgrounds inline",
GUILD_CAP_INLINE_SERVER_LIST: "guild_cap_inline_server_list",
GUILD_PREMIUM_UPSELL_MODAL: "premium guild premium upsell modal",
GUILD_CAP_INLINE_INVITE_MODAL: "guild_cap_inline_invite_modal",
GUILD_CAP_MODAL_UPSELL: "guild_cap_modal_upsell",
PREMIUM_GUILD_IDENTITY_MODAL: "premium guild identity upsell alert",
CUSTOM_PROFILE_SETTINGS_BANNER_BUTTON: "custom profiles settings banner upsell",
STICKER_PICKER_UPSELL: "sticker_picker_upsell",
ANIMATED_AVATAR_PREVIEW_GIF_MODAL: "animated avatar preview gif modal",
ANIMATED_USER_AVATAR_MODAL: "animated user avatar upsell modal",
UPLOAD_ERROR_UPSELL: "upload error upsell",
PREMIUM_GUILD_MEMBER_PROFILE_UPSELL_INLINE: "premium guild member profile upsell inline",
CONCURRENT_ACTIVITIES: "Concurrent Activities",
PREMIUM_UNCANCEL_WINBACK_MODAL_VIEWED: "premium_uncancel_winback_modal_viewed",
ANIMATED_VIDEO_BACKGROUND_NEW_PRESET: "animated_video_background_new_preset",
LOW_PRICE_EXPERIMENT_TOOLTIP: "low_price_experiment_tooltip",
PREMIUM_PROFILE_BADGE_UPSELL: "premium_profile_badge_upsell",
AGGREGATE_PREMIUM_UPSELL_MODAL_FEATURE_EMOJI: "emoji",
AGGREGATE_PREMIUM_UPSELL_MODAL_FEATURE_PROFILE_CUSTOMIZATION: "profile customization",
AGGREGATE_PREMIUM_UPSELL_MODAL_FEATURE_HD_STREAMING: "hd streaming",
AGGREGATE_PREMIUM_UPSELL_MODAL_FEATURE_LARGER_FILE_UPLOADS: "larger file uploads",
AGGREGATE_PREMIUM_UPSELL_MODAL_FEATURE_BOGO: "bogo",
VOICE_CHANNEL_EFFECTS_UPSELL: "voice_channel_effects_upsell",
VOICE_CHANNEL_EFFECTS_BAR_EMOJI_UPSELL: "Voice Channel Effect Bar Emoji Upsell",
VOICE_CHANNEL_EFFECTS_TOGGLE_CLICKED: "voice_channel_effects_toggle_clicked",
VOICE_CHANNEL_EFFECTS_TOGGLE_CLICKED_EXPANDED: "voice_channel_effects_toggle_clicked_expanded",
PROFILE_EFFECTS_INLINE_SETTINGS: "profile_effects_inline_settings",
PROFILE_EFFECTS_INLINE_SETTINGS_MOBILE: "profile_effects_inline_settings_mobile",
HIGH_VIDEO_QUALITY_UPSELL: "high_video_quality_upsell",
PREMIUM_PROFILE_TRY_IT_OUT: "premium_profile_try_it_out",
BURST_REACTION_RAIL_UPSELL: "burst_reaction_rail_upsell",
BURST_REACTION_UPSELL: "burst_reaction_upsell",
BURST_REACTION_QUICK_ACTION_UPSELL: "burst_reaction_quick_action_upsell",
BURST_REACTION_CONTEXT_MENU_UPSELL: "burst_reaction_context_menu_upsell",
PREMIUM_CLIENT_THEME_TRY_IT_OUT: "premium_client_theme_try_it_out",
PREMIUM_CLIENT_THEME_SETTINGS_UPSELL: "premium_client_theme_settings_upsell",
VIDEO_STAGE_LIMIT: "video_stage_limit",
SOUND_PICKER_SOUND_CLICKED: "sound_picker_sound_clicked",
APP_ICON_UPSELL: "app_icon_upsell",
COLLECTIBLES_SHOP: "collectibles_shop",
COLLECTIBLES_PROFILE_SETTINGS_UPSELL: "collectibles_profile_settings_upsell",
COLLECTIBLES_PREMIUM_MARKETING_PAGE_UPSELL: "collectibles_premium_marketing_page_upsell",
CLIPS_GUILD_SIDEBAR_COACHMARK_PREMIUM_EARLY_ACCESS_UPSELL: "clips_guild_sidebar_coachmark_premium_early_access_upsell",
CLIPS_GO_LIVE_PREMIUM_EARLY_ACCESS_ROADBLOCK_UPSELL: "clips_go_live_premium_early_access_roadblock_upsell",
CUSTOM_NOTIFICATION_SOUNDS_UPSELL: "custom_notification_sounds_upsell",
CUSTOM_NOTIFICATION_SOUNDS_SETTINGS_UPSELL: "custom_notification_sounds_settings_inline_upsell",
HD_STREAMING_VIEWER_UPSELL: "hd_streaming_viewer_upsell",
FOR_LATER_MODAL_UPSELL: "for_later_modal_upsell",
TRY_IT_OUT_MODAL_UPSELL: "try_it_out_modal_upsell",
ANIMATED_BANNER_MODAL_UPSELL: "animated_banner_modal_upsell",
ANIMATED_AVATAR_MODAL_UPSELL: "animated_avatar_modal_upsell",
PROFILE_EFFECT_MODAL_UPSELL: "profile_effect_modal_upsell",
AVATAR_DECORATION_MODAL_UPSELL: "avatar_decoration_modal_upsell",
NAMEPLATE_MODAL_UPSELL: "nameplate_modal_upsell",
RECENT_AVATARS_ROADBLOCK_UPSELL: "recent_avatars_roadblock_upsell",
EMOJI_EVERYWHERE_INLINE_UPSELL: "emoji_everywhere_inline_upsell",
EMOJI_EVERYWHERE_UPSELL: "emoji_everywhere_upsell",
SOUNDBOARD_EVERYWHERE_INLINE_UPSELL: "soundboard_everywhere_inline_upsell",
SOUNDBOARD_EVERYWHERE_UPSELL: "soundboard_everywhere_upsell",
LARGER_FILE_UPLOAD_INLINE_UPSELL: "larger_file_upload_inline_upsell",
LARGER_FILE_UPLOAD_UPSELL: "larger_file_upload_upsell",
ANIMATED_EMOJI_UPSELL: "animated_emoji_upsell",
CLIENT_THEMES_UPSELL: "client_themes_upsell",
CUSTOM_THEMES_UPSELL: "custom_themes_upsell",
APP_ICON_INLINE_UPSELL: "app_icons_inline_upsell",
STREAM_QUALITY_UPSELL: "stream_quality_upsell"
};
const r50 = {
PREMIUM_TIER_1: 1,
1: "PREMIUM_TIER_1",
PREMIUM_TIER_2: 2,
2: "PREMIUM_TIER_2",
GUILD_BOOST: 4,
4: "GUILD_BOOST",
PREMIUM_TIER_0: 8,
8: "PREMIUM_TIER_0"
};
const r518 = Object;
const r520 = {};
r520[r97.TIER_0] = r50.PREMIUM_TIER_0;
r520[r97.TIER_1] = r50.PREMIUM_TIER_1;
r520[r97.TIER_2] = r50.PREMIUM_TIER_2;
r520[r97.GUILD] = r50.GUILD_BOOST;
const r49 = r518.freeze(r520);
const r48 = {};
r48[BoostedGuildTiers.NONE] = 5;
r48[BoostedGuildTiers.TIER_1] = 10;
r48[BoostedGuildTiers.TIER_2] = 15;
r48[BoostedGuildTiers.TIER_3] = 30;
const r47 = {};
r47[BoostedGuildTiers.NONE] = r48[BoostedGuildTiers.NONE];
r47[BoostedGuildTiers.TIER_1] = r48[BoostedGuildTiers.NONE] + r48[BoostedGuildTiers.TIER_1];
r47[BoostedGuildTiers.TIER_2] = r48[BoostedGuildTiers.NONE] + r48[BoostedGuildTiers.TIER_1] + r48[BoostedGuildTiers.TIER_2];
r47[BoostedGuildTiers.TIER_3] = r48[BoostedGuildTiers.NONE] + r48[BoostedGuildTiers.TIER_1] + r48[BoostedGuildTiers.TIER_2] + r48[BoostedGuildTiers.TIER_3];
const r46 = {};
r46[BoostedGuildTiers.NONE] = 8;
r46[BoostedGuildTiers.TIER_1] = 24;
r46[BoostedGuildTiers.TIER_2] = 36;
r46[BoostedGuildTiers.TIER_3] = 48;
const r570 = Object;
const r572 = {};
r572[BoostedGuildTiers.NONE] = {
features: [],
limits: {
emoji: DEFAULT_EMOJI_SLOTS,
bitrate: BITRATE_MAX,
fileSize: MAX_ATTACHMENT_SIZE,
screenShareQualityFramerate: 30,
screenShareQualityResolution: "720p",
soundboardSounds: r46[BoostedGuildTiers.NONE],
stickers: r47[BoostedGuildTiers.NONE],
stageVideoUsers: MAX_STAGE_VIDEO_USER_LIMIT_TIER01
}
};
r572[BoostedGuildTiers.TIER_1] = {
features: [GuildFeatures.INVITE_SPLASH, GuildFeatures.ANIMATED_ICON],
limits: {
emoji: 100,
bitrate: 128000,
fileSize: MAX_ATTACHMENT_SIZE,
screenShareQualityFramerate: 60,
screenShareQualityResolution: "720p",
soundboardSounds: r46[BoostedGuildTiers.TIER_1],
stickers: r47[BoostedGuildTiers.TIER_1],
stageVideoUsers: MAX_STAGE_VIDEO_USER_LIMIT_TIER01
}
};
r572[BoostedGuildTiers.TIER_2] = {
features: [GuildFeatures.INVITE_SPLASH, GuildFeatures.ANIMATED_ICON, GuildFeatures.BANNER, GuildFeatures.ROLE_ICONS],
limits: {
emoji: 150,
bitrate: 256000,
fileSize: 52428800,
screenShareQualityFramerate: 60,
screenShareQualityResolution: "1080p",
soundboardSounds: r46[BoostedGuildTiers.TIER_2],
stickers: r47[BoostedGuildTiers.TIER_2],
stageVideoUsers: MAX_STAGE_VIDEO_USER_LIMIT_TIER2
}
};
r572[BoostedGuildTiers.TIER_3] = {
features: [GuildFeatures.INVITE_SPLASH, GuildFeatures.ANIMATED_ICON, GuildFeatures.BANNER, GuildFeatures.ANIMATED_BANNER, GuildFeatures.VANITY_URL, GuildFeatures.ROLE_ICONS],
limits: {
emoji: 250,
bitrate: 384000,
fileSize: 104857600,
screenShareQualityFramerate: 60,
screenShareQualityResolution: "1080p",
soundboardSounds: r46[BoostedGuildTiers.TIER_3],
stickers: r47[BoostedGuildTiers.TIER_3],
stageVideoUsers: MAX_STAGE_VIDEO_USER_LIMIT_TIER3
}
};
const r45 = r570.freeze(r572);
const r44 = [r92.PREMIUM_MONTH_TIER_0, r92.PREMIUM_YEAR_TIER_0, r92.PREMIUM_MONTH_TIER_1, r92.PREMIUM_YEAR_TIER_1, r92.PREMIUM_MONTH_TIER_2, r92.PREMIUM_3_MONTH_TIER_2, r92.PREMIUM_6_MONTH_TIER_2, r92.PREMIUM_YEAR_TIER_2, r92.PREMIUM_GROUP_MONTH];
const r43 = [r92.PREMIUM_MONTH_GUILD, r92.PREMIUM_3_MONTH_GUILD, r92.PREMIUM_6_MONTH_GUILD, r92.PREMIUM_YEAR_GUILD];
const r42 = {
SOUNDBOARD_PLAY: "soundboard play",
PROFILE_THEME_COLOR: "profile_theme_color",
PROFILE_BANNER: "profile_banner",
ANIMATED_AVATAR: "animated_avatar",
AVATAR_DECORATION: "avatar_decoration",
CLIENT_THEME: "client_theme",
PROFILE_EFFECT: "profile_effect",
DISPLAY_NAME_STYLES: "display_name_styles",
PRESET: "preset"
};
const r41 = {
FREE: "free",
PREMIUM_STANDARD: "premium-standard"
};
const r40 = {};
r40[r92.PREMIUM_YEAR_TIER_0] = 16;
r40[r92.PREMIUM_YEAR_TIER_1] = 16;
r40[r92.PREMIUM_YEAR_TIER_2] = 16;
r40[r92.PREMIUM_6_MONTH_TIER_2] = 8;
r40[r92.PREMIUM_3_MONTH_TIER_2] = 5;
const r39 = {
HIGH_STREAMING_QUALITY: "high_streaming_quality",
MID_STREAMING_QUALITY: "mid_streaming_quality"
};
const r648 = Object;
const r650 = {};
r650[r39.HIGH_STREAMING_QUALITY] = r100.TIER_2;
r650[r39.MID_STREAMING_QUALITY] = r100.TIER_1;
const r38 = r648.freeze(r650);
const r37 = {
UserSettings: 0,
0: "UserSettings",
ApplicationStoreHome: 1,
1: "ApplicationStoreHome"
};
const r36 = {
SNOWGLOBE: 1,
1: "SNOWGLOBE",
BOX: 2,
2: "BOX",
CUP: 3,
3: "CUP",
STANDARD_BOX: 4,
4: "STANDARD_BOX",
CAKE: 5,
5: "CAKE",
CHEST: 6,
6: "CHEST",
COFFEE: 7,
7: "COFFEE",
SEASONAL_STANDARD_BOX: 8,
8: "SEASONAL_STANDARD_BOX",
SEASONAL_CAKE: 9,
9: "SEASONAL_CAKE",
SEASONAL_CHEST: 10,
10: "SEASONAL_CHEST",
SEASONAL_COFFEE: 11,
11: "SEASONAL_COFFEE",
NITROWEEN_STANDARD: 12,
12: "NITROWEEN_STANDARD"
};
const r35 = {
USER_NOT_VERIFIED: "user_not_verified",
NO_CODE_BODY: "no_code_body",
NO_PROMOTION: "no_promotion",
CODE_CLAIMED: "code_claimed",
EXISTING_SUBSCRIBER: "existing_subscriber",
PREVIOUS_SUBSCRIBER: "previous_subscriber",
BLOCKED_PAYMENT: "blocked_payment"
};
const r34 = Object.freeze({
IS_BLOCKED_IOS: 32,
IS_OUTBOUND_REDEEMABLE_BY_TRIAL_USERS: 64,
SUPPRESS_NOTIFICATION: 128
});
const r683 = Object;
const r685 = {};
r685[r100.TIER_0] = {
fileSize: 52428800
};
r685[r100.TIER_1] = {
fileSize: 52428800
};
r685[r100.TIER_2] = {
fileSize: 524288000
};
const r33 = r683.freeze(r685);
const r32 = {
EXPLORE_ALL_PERKS_CLICKED: "explore_all_perks_clicked",
HELPER_COLLAPSED: "helper_collapsed",
HELPER_UNCOLLAPSED: "helper_uncollapsed",
UNLOCK_EMOJI_CLICKED: "unlock_emoji_clicked",
CUSTOM_PROFILES_CLICKED: "custom_profiles_clicked",
SERVER_BOOSTS_CLICKED: "server_boosts_clicked",
HELPER_DISMISSED: "premium_feature_helper_dismissed",
HELPER_RENDERED: "premium_feature_helper_rendered"
};
const r31 = {
EMOJI_TUTORIAL_STARTED: "emoji_tutorial_started",
EMOJI_INTRO_VIEWED: "emoji_intro_viewed",
EMOJI_PROMPT_VIEWED: "emoji_prompt_viewed",
CUSTOM_PROFILE_TUTORIAL_STARTED: "custom_profile_tutorial_started",
CUSTOM_PROFILE_AVATAR_INTRO_VIEWED: "custom_profile_avatar_intro_viewed",
CUSTOM_PROFILE_AVATAR_DECORATIONS_VIEWED: "custom_profile_avatar_decorations_viewed",
CUSTOM_PROFILE_BANNER_INTRO_VIEWED: "custom_profile_banner_intro_viewed",
CUSTOM_PROFILE_THEME_INTRO_VIEWED: "custom_profile_theme_intro_viewed",
SERVER_PROFILE_INTRO_VIEWED: "server_profile_intro_viewed",
SERVER_BOOST_TUTORIAL_STARTED: "server_boost_tutorial_started",
BOOST_INTRO_VIEWED: "boost_intro_viewed",
BOOST_PROMPT_VIEWED: "boost_prompt_viewed"
};
const r30 = {
BOOST: "boost",
DISMISS: "dismiss"
};
const r714 = {
BADGE_TOOLTIP_VIEWED: "share_nitro_bagde_tooltip_viewed",
BADGE_CLICKED: "share_nitro_badge_clicked",
FLOW_STARTED: "share_nitro_flow_started",
FLOW_COMPLETED: "share_nitro_flow_completed"
};
const set7 = new Set(["PL", "TR"]);
const r725 = [r36.SNOWGLOBE, r36.BOX, r36.CUP];
const r729 = [r36.STANDARD_BOX, r36.CAKE, r36.COFFEE, r36.CHEST];
const r734 = [r36.NITROWEEN_STANDARD, r36.CAKE, r36.COFFEE, r36.CHEST];
const r739 = [r36.SEASONAL_STANDARD_BOX, r36.SEASONAL_CAKE, r36.SEASONAL_COFFEE, r36.SEASONAL_CHEST];
const r744 = r739.concat(r725);
const r745 = {
VIEW_ALL: "view_all",
SEND_MESSAGE: "send_message"
};
const r748 = {
DM_CHANNEL: 0,
0: "DM_CHANNEL",
SHOP_PAGE: 1,
1: "SHOP_PAGE",
USER_PROFILE_WISHLIST: 2,
2: "USER_PROFILE_WISHLIST",
DM_CHANNEL_WISHLIST: 3,
3: "DM_CHANNEL_WISHLIST",
GUILD_CHANNEL: 4,
4: "GUILD_CHANNEL",
BADGE_DIRECTORY: 5,
5: "BADGE_DIRECTORY"
};
const r755 = {
PREMIUM_TENURE_1_MONTH: "premium_tenure_1_month_v2",
PREMIUM_TENURE_3_MONTH: "premium_tenure_3_month_v2",
PREMIUM_TENURE_6_MONTH: "premium_tenure_6_month_v2",
PREMIUM_TENURE_12_MONTH: "premium_tenure_12_month_v2",
PREMIUM_TENURE_24_MONTH: "premium_tenure_24_month_v2",
PREMIUM_TENURE_36_MONTH: "premium_tenure_36_month_v2",
PREMIUM_TENURE_60_MONTH: "premium_tenure_60_month_v2",
PREMIUM_TENURE_72_MONTH: "premium_tenure_72_month_v2"
};
const r765 = [r755.PREMIUM_TENURE_1_MONTH, r755.PREMIUM_TENURE_3_MONTH, r755.PREMIUM_TENURE_6_MONTH, r755.PREMIUM_TENURE_12_MONTH, r755.PREMIUM_TENURE_24_MONTH, r755.PREMIUM_TENURE_36_MONTH, r755.PREMIUM_TENURE_60_MONTH, r755.PREMIUM_TENURE_72_MONTH];
const r773 = {};
r773[r755.PREMIUM_TENURE_1_MONTH] = {
id: r755.PREMIUM_TENURE_1_MONTH,
nameUnformatted: t.LR1C0a,
nameUnformattedNitro: t.tx9Fvw,
tenureReqNumMonths: 1,
hasWideArt: false,
glowColor: "#b54913",
rarity: BadgeRarity.COMMON
};
r773[r755.PREMIUM_TENURE_3_MONTH] = {
id: r755.PREMIUM_TENURE_3_MONTH,
nameUnformatted: t["rI1/3H"],
nameUnformattedNitro: t.xJNb5C,
tenureReqNumMonths: 3,
hasWideArt: false,
glowColor: "#9e9e9e",
rarity: BadgeRarity.COMMON
};
r773[r755.PREMIUM_TENURE_6_MONTH] = {
id: r755.PREMIUM_TENURE_6_MONTH,
nameUnformatted: t.VkhVKS,
nameUnformattedNitro: t["4scBFY"],
tenureReqNumMonths: 6,
hasWideArt: false,
glowColor: "#ffa813",
rarity: BadgeRarity.RARE
};
r773[r755.PREMIUM_TENURE_12_MONTH] = {
id: r755.PREMIUM_TENURE_12_MONTH,
nameUnformatted: t.gzUfNS,
nameUnformattedNitro: t["83Jw2B"],
tenureReqNumMonths: 12,
hasWideArt: false,
glowColor: "#5eacc2",
rarity: BadgeRarity.RARE
};
r773[r755.PREMIUM_TENURE_24_MONTH] = {
id: r755.PREMIUM_TENURE_24_MONTH,
nameUnformatted: t.fuwTPm,
nameUnformattedNitro: t.vRSCKv,
tenureReqNumMonths: 24,
hasWideArt: false,
glowColor: "#6d5cf2",
rarity: BadgeRarity.EPIC
};
r773[r755.PREMIUM_TENURE_36_MONTH] = {
id: r755.PREMIUM_TENURE_36_MONTH,
nameUnformatted: t.qNhNk4,
nameUnformattedNitro: t.mV86tk,
tenureReqNumMonths: 36,
hasWideArt: false,
glowColor: "#32c102",
rarity: BadgeRarity.EPIC
};
r773[r755.PREMIUM_TENURE_60_MONTH] = {
id: r755.PREMIUM_TENURE_60_MONTH,
nameUnformatted: t["wvX+eD"],
nameUnformattedNitro: t.WcsLxW,
tenureReqNumMonths: 60,
hasWideArt: true,
glowColor: "#f29cc3",
rarity: BadgeRarity.MYTHIC
};
r773[r755.PREMIUM_TENURE_72_MONTH] = {
id: r755.PREMIUM_TENURE_72_MONTH,
nameUnformatted: t["/menIw"],
nameUnformattedNitro: t["Z/qgMK"],
tenureReqNumMonths: 72,
hasWideArt: true,
glowColor: "#078292",
rarity: BadgeRarity.MYTHIC
};
const r893 = {
NONE: 0,
0: "NONE",
FP_ONLY: 1,
1: "FP_ONLY",
FP_SUB_PAUSED: 2,
2: "FP_SUB_PAUSED"
};
const r897 = {
HOUR: 1,
1: "HOUR",
DAY: 2,
2: "DAY"
};
const r899 = {};
r899[FractionalPremiumSKUs.PREMIUM_TIER_2_1_HOUR] = [r897.HOUR, 1];
r899[FractionalPremiumSKUs.PREMIUM_TIER_2_1_DAY] = [r897.DAY, 1];
r899[FractionalPremiumSKUs.PREMIUM_TIER_2_3_DAY] = [r897.DAY, 3];
export const GiftIntentType = _Module1879.GiftIntentType;
export { r101 as PremiumOfferTypes };
export { r100 as PremiumTypes };
export { r99 as PREMIUM_TYPE_OVERRIDE_OPTIONS };
export { r98 as PremiumTypeOrder };
export const PREMIUM_SUBSCRIPTION_APPLICATION = "521842831262875670";
export { r97 as PremiumSubscriptionSKUs };
export { r96 as ACTIVE_MARKETING_PREMIUM_SKUS };
export { r95 as ACTIVE_PREMIUM_SKUS };
export { r94 as PremiumSubscriptionSKUToPremiumType };
export { r93 as PremiumTypeToActivePremiumSubscriptionSKU };
export { r92 as SubscriptionPlans };
export { set6 as PREMIUM_PLANS };
export { set5 as PREMIUM_TIER_2_PLANS };
export { set4 as PREMIUM_GUILD_SUBSCRIPTION_PLANS };
export { set3 as PREMIUM_MONTHLY_PLANS };
export { set2 as NONE_PLANS };
export { r81 as PREMIUM_SKU_TO_MONTHLY_PLAN };
export { r80 as PREMIUM_SKU_TO_YEARLY_PLAN };
export { r79 as SubscriptionIntervalTypes };
export { r78 as DiscountUserUsageLimitIntervalTypes };
export { r77 as PREMIUM_TYPE_DISPLAY_NAME };
export { r76 as SubscriptionPlanInfo };
export { set as PAUSE_ELIGIBLE_PLANS };
export const PREMIUM_YEARLY_DISCOUNT_PERCENT = 16;
export const PREMIUM_6_MONTH_DISCOUNT_PERCENT = 8;
export const PREMIUM_3_MONTH_DISCOUNT_PERCENT = 5;
export const GUILD_BOOST_COST_FOR_PREMIUM_USER_DISCOUNT_PERCENT = 30;
export const STICKER_PACK_FOR_PREMIUM_USER_DISCOUNT_PERCENT = 33;
export const NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM = 2;
export const LEGAL_TERMS_FLASH_DURATION = 500;
export const DEFAULT_MAX_GRACE_PERIOD_DAYS = 3;
export const DEFAULT_MAX_BILLING_RETRY_DAYS = 3;
export const DEFAULT_APPLE_GRACE_PERIOD_DAYS = 28;
export const DEFAULT_GOOGLE_GRACE_PERIOD_DAYS = 30;
export const PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS = 30;
export const PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS = 7;
export const MAX_ACCOUNT_HOLD_DAYS = 30;
export const BLACK_FRIDAY_2020_GIFT_CODE_BATCH_ID = "775514091874680832";
export const STICKERS_GIFT_CODE_BATCH_ID = "845031178288889946";
export const USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD = 604800000;
export const USER_PREMIUM_OFFER_EXPIRES_APPROACHING_4_DAY_THRESHOLD = 345600000;
export const TRIAL_FOR_EVERYONE_OFFER_EXPIRES_APPROACHING_THRESHOLD = 280800000;
export const MAX_PAYMENT_PROCESSING_TIME_DAYS = 14;
export const PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID = "520373071933079552";
export const PREMIUM_TIER_2_REACTIVATION_TRIAL_ID = "902329034132684800";
export const PREMIUM_TIER_2_HFU_ONE_WEEK_TRIAL_ID = "983601860436819968";
export const PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID = "983601860436819969";
export const PREMIUM_TIER_2_HFU_ONE_MONTH_TRIAL_ID = "984244797441048577";
export const PREMIUM_TIER_2_AUTH3_TRIAL_ID = "1004850445463584768";
export const PREMIUM_TIER_2_REFERRAL_TRIAL_ID = "1073698058383917056";
export const PREMIUM_TIER_0_LIKELIHOOD_TRIAL_ID = "1070132870233980928";
export const PREMIUM_TIER_2_ONE_WEEK_REVERSE_TRIAL = "1267968635301789696";
export const PREMIUM_TIER_2_TWO_WEEK_REVERSE_TRIAL = "1267969164312576000";
export const PREMIUM_TIER_2_REVERSE_FOLLOWUP_TRIAL_ID = "1268347360493174784";
export const PREMIUM_TIER_2_QUEST_REWARD_REVERSE_TRIAL_ID = "1271484512081285191";
export const PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID = "1161363847311785984";
export const PREMIUM_TIER_2_GOOGLE_PLAY_SIX_MONTH_TRIAL_ID = "1149009610275815424";
export { r60 as PREMIUM_TRIAL_IDS_ALL };
export const PREMIUM_TIER_2_3P_ONE_MONTH_TRIAL_ID = "844502143447597056";
export const PREMIUM_TIER_2_LIKELIHOOD_DISCOUNT_ID = "1150904354090532864";
export const PREMIUM_TIER_2_REACTIVATION_DISCOUNT_ID = "1199128659810582528";
export const PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID = "1204865493622587392";
export const PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID = "1204867673024888832";
export const PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_30_PERCENT_DISCOUNT_ID = "1215346678383509504";
export const PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID = "1215366184820539392";
export const PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID = "1488790996522238054";
export const PREMIUM_GROUP_30_PERCENT_3_MONTH_DISCOUNT_ID = "1509344915195297792";
export const PREMIUM_TIER_2_ANNUAL_25_PERCENT_DISCOUNT_ID = "1223319122125783040";
export const PREMIUM_TIER_2_ANNUAL_20_PERCENT_DISCOUNT_ID = "1223380890109870080";
export { r57 as ANNUAL_DISCOUNT_IDS };
export const PREMIUM_TIER_2_ANNUAL_V2_20_PERCENT_DISCOUNT_ID = "1503844767820152833";
export const PREMIUM_TIER_2_ANNUAL_V2_30_PERCENT_DISCOUNT_ID = "1503844767820152834";
export { r54 as ANNUAL_V2_DISCOUNT_IDS };
export const TR_OFFER_1_CAMPAIGN_KEY = "2026-07-tr-offer-1-campaign";
export const TR_OFFER_1_ORBS_REWARD_AMOUNT = 10000;
export const TR_OFFER_1_PAYMENT_MODAL_BANNER_KEY = "tr-offer-1-payment-modal-banner";
export { r53 as TRIAL_OFFERS_REQUIRES_REMINDER_ROLLOUT };
export const DISCOUNT_OFFERS_REQUIRES_REMINDER_ROLLOUT = [];
export const DEFAULT_SOUND_SLOTS = 8;
export const MORE_SOUNDBOARD_SOUNDS = 96;
export { r52 as SubscriptionTrials };
export { r51 as PremiumUpsellTypes };
export { r50 as PurchasedFlags };
export { r49 as SKU_ID_PURCHASED_FLAGS };
export const MAX_PREMIUM_TIER_0_ATTACHMENT_SIZE = 52428800;
export const MAX_PREMIUM_TIER_1_ATTACHMENT_SIZE = 52428800;
export const MAX_PREMIUM_TIER_2_ATTACHMENT_SIZE = 524288000;
export const MAX_BOOSTED_GUILD_TIER_2_ATTACHMENT_SIZE = 52428800;
export const MAX_BOOSTED_GUILD_TIER_3_ATTACHMENT_SIZE = 104857600;
export const MAX_GUILD_FILE_SIZE_50_MB = 52428800;
export const MAX_GUILD_FILE_SIZE_100_MB = 104857600;
export const MAX_GUILD_FILE_SIZE_250_MB = 262144000;
export const DEFAULT_STICKER_SLOTS = 5;
export { r48 as IncrementalStickerCountsByTier };
export { r47 as TotalStickerCountsByTier };
export { r46 as TotalSoundboardSoundCountsByTier };
export { r45 as BoostedGuildFeatures };
export { r44 as ORDERED_PREMIUM_SUBSCRIPTION_PLANS };
export { r43 as ORDERED_PREMIUM_GUILD_SUBSCRIPTION_PLANS };
export { r42 as AnalyticsPremiumFeatureNames };
export { r41 as AnalyticsPremiumFeatureTiers };
export { r40 as DISCOUNTS };
export { r39 as StreamQualities };
export { r38 as StreamQualitiesToPremiumType };
export { r37 as PremiumMarketingEntrypoints };
export { r36 as PremiumGiftStyles };
export { r35 as InboundPromotionErrorCodes };
export { r34 as PromotionFlags };
export { r33 as PremiumUserLimits };
export { r32 as PremiumFeatureHelperActions };
export { r31 as PremiumFeatureHelperSteps };
export { r30 as BoostingUpsellAction };
export { r714 as ReferralTrialsAnalyticSteps };
export { set7 as LegacyPricingCountries };
export { r725 as LegacySeasonalGiftStyles };
export { r729 as STANDARD_GIFT_OPTIONS };
export { r734 as NITROWEEN_GIFT_OPTIONS };
export { r739 as SEASONAL_GIFT_OPTIONS };
export { r744 as AllSeasonalGiftStyles };
export const CUSTOM_GIFT_MESSAGE_MAX_LENGTH = 190;
export { r745 as GiftIntentSecondaryAction };
export { r748 as GiftingOrigin };
export const DISCOUNT_DURATION_FALLBACK = 1;
export const DISCOUNT_PERCENTAGE_FALLBACK = 30;
export const ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK = 20;
export const PRICE_PLACEHOLDER = "$...";
export { r755 as TieredTenureBadge };
export { r765 as TIERED_TENURE_BADGE_ORDER };
export { r773 as TENURE_BADGES };
export { r893 as FractionalPremiumStates };
export { r897 as FractionalPremiumIntervalTypes };
export { r899 as FRACTIONAL_PREMIUM_SKU_INTERVAL_COUNTS };
export const NAMESPACE_SNOWFLAKE_UUID = "8e884ace-bee4-12e4-8dfc-aa07a5b093db";
export const PREMIUM_PLAN_SELECTION_ACTION_SHEET_KEY = "PremiumPlanSelectionActionSheetWithOrderCTX";
+49
View File
@@ -0,0 +1,49 @@
// Metro module 7857 (f7858).
import ChannelStore from "../../stores/ChannelStore";
import { MessageSendLocation } from "../messages/MessageConstants";
import ChannelActionCreators from "../../actions/ChannelActionCreators";
import Module38 from "../../_bundle/Module38";
import { getGiftCodeURL } from "../../utils/GiftCodeUtils";
import MessageActionCreators from "../../actions/MessageActionCreators";
import MessageParser from "../messages/MessageParser";
let env4961 = {};
const r20 = {
ACTION: "action",
LOOP: "loop",
IDLE: "idle"
};
export { r20 as AnimationState };
export async function sendGiftMessage(c26044_0, c26044_1) {
let env29857;
const r30 = env4961;
let c26044_3 = r30;
const r10 = env29857 = {
$parent: r30
};
let c26044_2 = r10;
env29857[0] = c26044_1;
env29857[1] = void 0;
env29857[2] = void 0;
if (c26044_1 == null) {
throw new Error("giftCode must be defined");
}
if (c26044_0 == null) {
throw new Error("Recipient must be defined");
}
env29857[1] = await ChannelActionCreators.openPrivateChannel({
recipientIds: c26044_0.id
}).then((result) => {
const channel = ChannelStore.getChannel(result);
Module38(channel != null, "PrivateChannel is null");
if (channel == null) {
throw new Error("Channel must be defined");
}
return channel;
});
env29857[2] = getGiftCodeURL(env29857[0]);
return MessageActionCreators.sendMessage(env29857[1].id, MessageParser.parse(env29857[1], env29857[2]), void 0, {
isGiftLinkSentOnBehalfOfUser: true,
location: MessageSendLocation.GIFTING
});
}
export function unhandledGiftIntent() {}
+17
View File
@@ -0,0 +1,17 @@
// Metro module 12197 (f12198).
import { Routes, UserSettingsSections } from "../../Constants";
import { openUserSettings } from "../user_settings/core/native/openUserSettings";
import { popLayer } from "../../actions/LayerActionCreators";
import { transitionTo } from "../routing/router_utils";
export function navigateToPremiumHomePage() {
(0, openUserSettings)({
screen: UserSettingsSections.PREMIUM
});
}
export function navigateToNitroHomePage(a0) {
if (a0 != null) {
a0();
}
popLayer();
transitionTo(Routes.APPLICATION_STORE);
}
+13
View File
@@ -0,0 +1,13 @@
// Metro module 13119 (f13120).
export default class PremiumSKUFeature {
constructor(a0, a1, a2) {
this.name = a0;
this.description = a2;
this.getFeatureValue = a1;
Object.defineProperty(this, "getFeatureValue", {
value: a1,
configurable: false,
writable: false
});
}
};
+91
View File
@@ -0,0 +1,91 @@
// Metro module 3847 (f3848).
import { SubscriptionPlanInfo, SubscriptionPlans } from "./PremiumConstants";
function $mk72877($env) {
return (a0) => {
const r2 = $env.$parent;
const r6 = r2[1][a0];
let r7 = r6 != null && r6.skuId === r2[2].NONE;
const r11 = $env;
if (r7) {
r7 = r6.interval === r11[0];
}
if (r7) {
r7 = r6.intervalCount === r11[1];
}
return r7;
};
}
let $mk72878 = function() {
return (a0) => {
const r6 = SubscriptionPlanInfo[a0.planId];
return r6 != null && r6.premiumType != null;
};
};
let env2180 = {};
export function getNonePlanIdForIntervalType(a0) {
let env13682;
const r2 = env13682 = {
$parent: env2180
};
env13682[0] = a0;
let r4 = arguments[1];
if (r4 === void 0) {
r4 = 1;
}
env13682[1] = r4;
let r13 = Object.keys(SubscriptionPlanInfo).find($mk72877(r2));
if (r13 == null) {
r13 = SubscriptionPlans.NONE_MONTH;
}
return r13;
}
export function getNonePlanIdForSubscription(a0) {
let env13683;
const r10 = SubscriptionPlanInfo[a0.items[0].planId];
const interval = r10.interval;
let intervalCount = r10.intervalCount;
const r11 = env13683 = {
$parent: env2180
};
env13683[1] = void 0;
env13683[0] = interval;
if (intervalCount === void 0) {
intervalCount = 1;
}
env13683[1] = intervalCount;
let r18 = Object.keys(SubscriptionPlanInfo).find($mk72877(r11));
if (r18 == null) {
r18 = SubscriptionPlans.NONE_MONTH;
}
return r18;
}
export function getBaseSubscriptionItemForSubscriptionItems(a0) {
return a0.find($mk72878());
}
export function getBasePlanIdForSubscriptionItems(a0, a1, a2) {
const r8 = a0.find($mk72878());
if (r8 == null) {
let r10 = a1;
let r11 = a2;
if (a0.length > 0) {
const r15 = SubscriptionPlanInfo[a0[0].planId];
r10 = r15.interval;
r11 = r15.intervalCount;
}
let env13684;
const r16 = env13684 = {
$parent: env2180
};
env13684[0] = r10;
if (r11 === void 0) {
r11 = 1;
}
env13684[1] = r11;
let r24 = Object.keys(SubscriptionPlanInfo).find($mk72877(r16));
if (r24 == null) {
r24 = SubscriptionPlans.NONE_MONTH;
}
return r24;
}
return r8.planId;
}
@@ -0,0 +1,655 @@
// Metro module 6547 (f6548).
import _objectWithoutProperties from "../../_bundle/_objectWithoutProperties";
import _slicedToArray from "../../_bundle/_slicedToArray";
import { useState, useEffect, useRef, useCallback } from "react";
import InvoiceRecord from "../../records/InvoiceRecord";
import { Endpoints } from "../../Constants";
import { coerceExistingItemsToNewItemInterval } from "../../utils/PremiumUtils";
import { HTTP } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
import { BillingError } from "../../errors/index";
import Module38 from "../../_bundle/Module38";
import { httpGetWithCountryCodeQuery } from "../../utils/StoreUtils";
import { HermesBuiltin, $createGenerator } from "../../_hermes/prelude";
function $mk78770($env) {
return () => {
let env25918 = {
$parent: $env
};
env25918[1] = function _loadPreview() {
const r9 = (0, env25918.$parent.$parent[6])(function() {
let c31427_0, c31427_1, c31427_2;
let c31427_4 = 0;
let c31427_5 = 0;
let c31427_3 = 0;
return $createGenerator(function() {
let value2;
const r0 = c31427_5;
if (r0 === 2) {
c31427_5 = 3;
HermesBuiltin.throwTypeError("Generator functions may not be called on executing generators");
throw new Error("unreachable");
}
const value = arguments[1];
const r3 = arguments[0];
const r11 = env25918;
const r9 = env25918.$parent;
if (r0 === 3) {
if (r3 === 1) {
throw value;
}
if (r3 === 2) {
return {
value,
done: true
};
}
return {
value: void 0,
done: true
};
}
while (true) {
L21: {
L19: {
L15: {
L10: {
try {
c31427_5 = 2;
const r19 = c31427_4;
if (r19 === 0) {
if (r3 === 1) {
c31427_5 = 3;
throw value;
}
if (r3 === 2) {
c31427_5 = 3;
break L21;
}
let env31967;
c31427_1 = r11;
const r39 = env31967 = {};
c31427_0 = r39;
env31967[0] = void 0;
c31427_3 = 1;
(0, r9[3])(null);
value2 = (0, r9[1])();
c31427_4 = 2;
c31427_5 = 1;
break L19;
}
if (r19 === 1) {
const r29 = c31427_1;
const r30 = c31427_2;
c31427_3 = 0;
env31967[1] = r30;
if (!env25918[0]) {
const r32 = r29.$parent;
(0, r32[3])(r30);
(0, r32[2])(null);
}
} else {
if (r3 === 1) {
c31427_5 = 3;
throw value;
}
if (r3 === 2) {
c31427_3 = 0;
c31427_5 = 3;
break L10;
}
const r14 = c31427_1;
env31967[0] = value;
if (!env25918[0]) {
(0, r14.$parent[2])(env31967[0]);
}
c31427_3 = 0;
}
c31427_5 = 3;
break L15;
} catch (r49) {
c31427_2 = r49;
if (c31427_3 === 0) {
c31427_5 = 3;
throw r49;
}
c31427_4 = 1;
continue;
}
}
return {
value,
done: true
};
}
return {
value: void 0,
done: true
};
}
return {
value: value2,
done: false
};
}
return {
value,
done: true
};
}
});
});
env25918[1] = r9;
return r9.apply(this, arguments);
};
env25918[0] = false;
if (!$env[0]) {
(function loadPreview() {
return env25918[1].apply(this, arguments);
})();
}
return () => {
env25918[0] = true;
};
};
}
let updateSubscriptionInvoicePreview, createOneTimePurchaseInvoicePreview, getSubscriptionInvoice, _excluded;
let env4209 = {};
export async function createSubscriptionInvoicePreview(c25914_0) {
let r122;
let c25914_1, c25914_2, c25914_3;
let c25914_4 = 0;
const r11 = env4209;
try {
let env29795;
c25914_2 = r11;
const r31 = env29795 = {};
c25914_1 = r31;
env29795[0] = void 0;
env29795[1] = void 0;
env29795[2] = void 0;
env29795[3] = void 0;
env29795[4] = void 0;
env29795[5] = void 0;
env29795[6] = void 0;
env29795[7] = void 0;
env29795[8] = void 0;
env29795[0] = c25914_0.items;
env29795[1] = c25914_0.paymentSourceId;
env29795[2] = c25914_0.trialId;
env29795[3] = c25914_0.code;
const applyEntitlements = c25914_0.applyEntitlements;
if (applyEntitlements !== void 0) {
env29795[4] = applyEntitlements;
env29795[5] = c25914_0.currency;
env29795[6] = c25914_0.renewal;
env29795[7] = c25914_0.metadata;
env29795[8] = c25914_0.loadId;
env29795[9] = void 0;
env29795[10] = void 0;
env29795[11] = void 0;
} else {
env29795[4] = false;
env29795[5] = c25914_0.currency;
env29795[6] = c25914_0.renewal;
env29795[7] = c25914_0.metadata;
env29795[8] = c25914_0.loadId;
env29795[9] = void 0;
env29795[10] = void 0;
env29795[11] = void 0;
}
await void 0;
const r68 = coerceExistingItemsToNewItemInterval(env29795[0]);
env29795[0] = r68;
env29795[9] = {
items: r68.map(({ planId, ...rest }) => ({
...rest,
plan_id: planId
})),
payment_source_id: env29795[1],
trial_id: env29795[2],
code: env29795[3],
apply_entitlements: env29795[4],
currency: env29795[5],
renewal: env29795[6],
metadata: env29795[7],
load_id: env29795[8]
};
c25914_4 = 1;
env29795[10] = await HTTP.post({
url: Endpoints.BILLING_SUBSCRIPTIONS_PREVIEW,
body: env29795[9],
oldFormErrors: true,
rejectWithError: false
});
env29795[11] = InvoiceRecord.createInvoiceFromServer(env29795[10].body);
if (env29795[11].checkoutContext?.payment_sources != null) {
Dispatcher.dispatch({
type: "SUBSCRIPTION_PREVIEW_CHECKOUT_CONTEXT_UPDATE",
checkoutContext: env29795[11].checkoutContext,
paymentSourceId: env29795[1]
});
}
r122 = env29795[11];
c25914_4 = 0;
} catch ($e) {
const r29 = $e;
let r8 = r29;
c25914_3 = r29;
if (c25914_4 !== 0) {
while (true) {
try {
const r143 = c25914_3;
c25914_4 = 0;
env29795[12] = r143;
throw new BillingError(env29795[12]);
} catch (r139) {
r8 = r139;
c25914_3 = r139;
if (c25914_4 === 0) {
break;
}
}
}
}
throw r8;
}
return r122;
}
updateSubscriptionInvoicePreview = async function updateSubscriptionInvoicePreview(c25915_0) {
let r134;
let c25915_1, c25915_2, c25915_3;
let c25915_4 = 0;
const r11 = env4209;
try {
let env29796;
c25915_2 = r11;
const r33 = env29796 = {};
c25915_1 = r33;
env29796[0] = void 0;
env29796[1] = void 0;
env29796[2] = void 0;
env29796[3] = void 0;
env29796[4] = void 0;
env29796[5] = void 0;
env29796[6] = void 0;
env29796[7] = void 0;
env29796[8] = void 0;
env29796[9] = void 0;
env29796[0] = c25915_0.subscriptionId;
env29796[1] = c25915_0.items;
env29796[2] = c25915_0.paymentSourceId;
env29796[3] = c25915_0.renewal;
env29796[4] = c25915_0.currency;
const applyEntitlements = c25915_0.applyEntitlements;
if (applyEntitlements !== void 0) {
env29796[5] = applyEntitlements;
env29796[6] = c25915_0.analyticsLocations;
env29796[7] = c25915_0.analyticsLocation;
env29796[8] = c25915_0.userDiscountOfferId;
env29796[9] = c25915_0.loadId;
env29796[10] = void 0;
env29796[11] = void 0;
env29796[12] = void 0;
} else {
env29796[5] = false;
env29796[6] = c25915_0.analyticsLocations;
env29796[7] = c25915_0.analyticsLocation;
env29796[8] = c25915_0.userDiscountOfferId;
env29796[9] = c25915_0.loadId;
env29796[10] = void 0;
env29796[11] = void 0;
env29796[12] = void 0;
}
await void 0;
if (env29796[1] != null) {
env29796[1] = coerceExistingItemsToNewItemInterval(env29796[1]);
}
const r18 = env29796[1];
env29796[10] = {
items: r18 == null ? void 0 : r18.map(({ planId, ...rest }) => ({
...rest,
plan_id: planId
})),
payment_source_id: env29796[2],
renewal: env29796[3],
apply_entitlements: env29796[5],
currency: env29796[4],
user_discount_offer_id: env29796[8],
load_id: env29796[9]
};
c25915_4 = 1;
env29796[11] = await HTTP.patch({
url: Endpoints.BILLING_SUBSCRIPTION_PREVIEW(env29796[0]),
query: {
location: env29796[7],
location_stack: env29796[6]
},
body: env29796[10],
oldFormErrors: true,
rejectWithError: false
});
env29796[12] = InvoiceRecord.createInvoiceFromServer(env29796[11].body);
if (env29796[2] != null && env29796[12].checkoutContext?.payment_sources != null) {
Dispatcher.dispatch({
type: "SUBSCRIPTION_PREVIEW_CHECKOUT_CONTEXT_UPDATE",
checkoutContext: env29796[12].checkoutContext,
paymentSourceId: env29796[2]
});
}
r134 = env29796[12];
c25915_4 = 0;
} catch ($e) {
const r31 = $e;
let r8 = r31;
c25915_3 = r31;
if (c25915_4 !== 0) {
while (true) {
try {
const r155 = c25915_3;
c25915_4 = 0;
env29796[13] = r155;
throw new BillingError(env29796[13]);
} catch (r151) {
r8 = r151;
c25915_3 = r151;
if (c25915_4 === 0) {
break;
}
}
}
}
throw r8;
}
return r134;
};
createOneTimePurchaseInvoicePreview = async function createOneTimePurchaseInvoicePreview(c25916_0) {
let invoiceFromServer;
let c25916_3;
let c25916_4 = 0;
let c29797_0, c29797_1, c29797_2, c29797_3, c29797_4, c29797_5, c29797_6, c29797_7, c29797_8;
try {
c29797_0 = void 0;
c29797_1 = void 0;
c29797_2 = void 0;
c29797_3 = void 0;
c29797_4 = void 0;
c29797_5 = void 0;
c29797_0 = c25916_0.paymentSourceId;
c29797_1 = c25916_0.skuId;
c29797_2 = c25916_0.subscriptionPlanId;
c29797_3 = c25916_0.currency;
c29797_4 = c25916_0.loadId;
c29797_5 = c25916_0.quantity;
c29797_6 = void 0;
c29797_7 = void 0;
await void 0;
Module38(c29797_1 != null && c29797_1 !== "", "SKU ID is missing for one time purchase gift invoice preview");
c29797_6 = {
gift: true,
payment_source_id: c29797_0,
sku_subscription_plan_id: c29797_2,
currency: c29797_3,
load_id: c29797_4
};
if (c29797_5 != null) {
c29797_6.quantity = c29797_5;
}
c25916_4 = 1;
c29797_7 = await httpGetWithCountryCodeQuery({
url: Endpoints.STORE_SKU_PURCHASE(c29797_1),
query: c29797_6,
oldFormErrors: true,
rejectWithError: false
});
invoiceFromServer = InvoiceRecord.createInvoiceFromServer(c29797_7.body);
c25916_4 = 0;
} catch ($e) {
const r33 = $e;
let r8 = r33;
c25916_3 = r33;
if (c25916_4 !== 0) {
while (true) {
try {
const r123 = c25916_3;
c25916_4 = 0;
c29797_8 = r123;
throw new BillingError(c29797_8);
} catch (r119) {
r8 = r119;
c25916_3 = r119;
if (c25916_4 === 0) {
break;
}
}
}
}
throw r8;
}
return invoiceFromServer;
};
getSubscriptionInvoice = async function getSubscriptionInvoice(c25917_0) {
let c29798_0, c29798_1, c29798_2;
L14: {
c29798_0 = void 0;
c29798_1 = void 0;
c29798_0 = c25917_0.subscriptionId;
c29798_1 = c25917_0.preventFetch;
c29798_2 = void 0;
await void 0;
if (c29798_1) {
break L14;
}
c29798_2 = await HTTP.get({
url: Endpoints.BILLING_SUBSCRIPTION_INVOICE(c29798_0),
oldFormErrors: true,
rejectWithError: false
});
return InvoiceRecord.createInvoiceFromServer(c29798_2.body);
}
return null;
};
_excluded = ["subscriptionId"];
export { updateSubscriptionInvoicePreview };
export { createOneTimePurchaseInvoicePreview };
export { getSubscriptionInvoice };
export function useFetchGenericInvoicePreview({ preventFetch }, a1, a2) {
if (preventFetch === void 0) {
preventFetch = false;
}
let env15778;
const r11 = env15778 = {
$parent: env4209
};
env15778[0] = preventFetch;
env15778[1] = a1;
env15778[2] = void 0;
env15778[3] = void 0;
const r10 = _slicedToArray(useState(null), 2);
const r12 = r10[0];
env15778[2] = r10[1];
const r15 = _slicedToArray(useState(null), 2);
const r16 = r15[0];
env15778[3] = r15[1];
(0, useEffect)($mk78770(r11), [preventFetch, a1, a2]);
return [r12, r16];
}
export function useFetchSubscriptionGiftInvoicePreview(a0, a1) {
let env15780;
const current = a0;
let c15779_1 = useRef(a0);
let c15779_2 = useRef(false);
useEffect(() => {
c15779_1.current = current;
});
const r21 = (0, useCallback)(() => {
const current4 = c15779_1.current;
const r8 = c15779_2.current ? current4 : {
...current4,
paymentSourceId: null
};
c15779_2.current = true;
return createOneTimePurchaseInvoicePreview(r8);
}, [JSON.stringify(a0)]);
const r22 = env15780 = {
$parent: env4209
};
env15780[0] = void 0;
env15780[1] = void 0;
let preventFetch = a0.preventFetch;
if (preventFetch === void 0) {
preventFetch = false;
}
env15780[0] = preventFetch;
env15780[1] = r21;
env15780[2] = void 0;
env15780[3] = void 0;
const r11 = _slicedToArray(useState(null), 2);
const r28 = r11[0];
env15780[2] = r11[1];
const r31 = _slicedToArray(useState(null), 2);
const r32 = r31[0];
env15780[3] = r31[1];
useEffect($mk78770(r22), [preventFetch, r21, a1]);
return [r28, r32];
}
export function useFetchSubscriptionInvoicePreview(a0, a1) {
let c15781_3, c15781_4, c15781_5;
let current2 = a0;
const r1 = "subscriptionId" in a0;
let r15 = a0;
if (r1) {
const subscriptionId = a0.subscriptionId;
r15 = a0;
if (subscriptionId == null) {
a0.subscriptionId;
current2 = _objectWithoutProperties(a0, _excluded);
r15 = current2;
}
}
let env15783;
let c15781_1 = useRef(r15);
let c15781_2 = useRef(false);
const ref = useRef(null);
let c15782_0 = ref;
useEffect(() => {
c15782_0.current = null;
}, [a1]);
const callback = useCallback((a0, a1) => {
const current4 = c15782_0.current;
return current4 != null && a0.paymentSourceId != null && a0.paymentSourceId === current4.serverSelectedPaymentSourceId && a1 === current4.dedupeKey;
}, []);
const callback2 = useCallback((a0, a1, a2) => {
const r1 = a2 == null;
let current4 = null;
if (r1) {
const payment_sources = a0.checkoutContext?.payment_sources;
const r15 = payment_sources == null;
let serverSelectedPaymentSourceId = null;
if (!r15) {
let r19 = payment_sources.find((payment_source) => payment_source.enabled)?.id;
if (r19 == null) {
r19 = null;
}
serverSelectedPaymentSourceId = r19;
}
current4 = {
record: a0,
dedupeKey: a1,
serverSelectedPaymentSourceId
};
}
c15782_0.current = current4;
}, []);
c15781_3 = ref;
c15781_4 = callback;
c15781_5 = callback2;
useEffect(() => {
c15781_1.current = current2;
});
const callback3 = useCallback(() => {
const current4 = c15781_1.current;
const r2 = c15781_2.current ? current4 : {
...current4,
paymentSourceId: null
};
let c25919_1;
let c25919_0 = r2;
if ("subscriptionId" in r2) {
c15781_2.current = true;
return updateSubscriptionInvoicePreview(r2);
}
if ("items" in r2) {
c15781_2.current = true;
const r26 = JSON.stringify({
...r2,
paymentSourceId: "exclude_from_dedupe"
});
c25919_1 = r26;
const current5 = c15781_3.current;
return current5 != null && c15781_4(r2, r26) ? Promise.resolve(current5.record) : createSubscriptionInvoicePreview(r2).then((result) => {
c15781_5(result, c25919_1, c25919_0.paymentSourceId);
return result;
});
}
return null;
}, [JSON.stringify(r15), ref, callback, callback2]);
const r43 = env15783 = {
$parent: env4209
};
env15783[0] = void 0;
env15783[1] = void 0;
let preventFetch = r15.preventFetch;
if (preventFetch === void 0) {
preventFetch = false;
}
env15783[0] = preventFetch;
env15783[1] = callback3;
env15783[2] = void 0;
env15783[3] = void 0;
const r48 = _slicedToArray(useState(null), 2);
const r49 = r48[0];
env15783[2] = r48[1];
const r52 = _slicedToArray(useState(null), 2);
const r53 = r52[0];
env15783[3] = r52[1];
useEffect($mk78770(r43), [preventFetch, callback3, a1]);
return [r49, r53];
}
export function useGetSubscriptionInvoice(a0, a1) {
let env15785;
const current3 = a0;
let c15784_1 = (0, useRef)(a0);
useEffect(() => {
c15784_1.current = current3;
});
const r20 = (0, useCallback)(() => getSubscriptionInvoice(c15784_1.current), [JSON.stringify(a0)]);
const r21 = env15785 = {
$parent: env4209
};
env15785[0] = void 0;
env15785[1] = void 0;
let preventFetch = a0.preventFetch;
if (preventFetch === void 0) {
preventFetch = false;
}
env15785[0] = preventFetch;
env15785[1] = r20;
env15785[2] = void 0;
env15785[3] = void 0;
const r11 = _slicedToArray(useState(null), 2);
const r26 = r11[0];
env15785[2] = r11[1];
const r29 = _slicedToArray(useState(null), 2);
const r30 = r29[0];
env15785[3] = r29[1];
useEffect($mk78770(r21), [preventFetch, r20, a1]);
return [r26, r30];
}
export function getItemUnitPriceWithDiscount(a0) {
let subscriptionPlanPrice = a0.subscriptionPlanPrice;
a0.discounts.forEach((discount) => {
subscriptionPlanPrice = subscriptionPlanPrice - discount.amount / a0.quantity;
});
return subscriptionPlanPrice;
}
@@ -0,0 +1,60 @@
// Metro module 3845 (f3846).
import Module12 from "../../_bundle/Module12";
export function coalesceInvoiceItems(a0) {
const r2 = [];
let c13681_0 = r2;
let c13681_1 = new Set();
a0.map((a0) => {
for (const item of c13681_0) {
if (item.subscriptionPlanId !== a0.subscriptionPlanId) {
continue;
}
if (item.subscriptionPlanPrice !== a0.subscriptionPlanPrice) {
continue;
}
if (item.amount !== a0.amount) {
continue;
}
if (!Module12.isEqual(item.discounts, a0.discounts)) {
continue;
}
c13681_1.add(item.subscriptionPlanId);
item.quantity = item.quantity + a0.quantity;
return void 0;
}
c13681_0.push({
...a0
});
});
return r2.map((item) => {
const r1 = {
...item
};
let c24738_0 = r1;
if (c13681_1.has(item.subscriptionPlanId)) {
r1.amount = r1.amount * r1.quantity;
r1.discounts = r1.discounts.map((discount) => ({
...discount,
amount: discount.amount * c24738_0.quantity
}));
if (r1.tax != null) {
r1.tax = r1.tax * r1.quantity;
}
}
return r1;
});
}
export function createInvoiceItemFromServer(a0) {
return {
id: a0.id,
subscriptionPlanId: a0.subscription_plan_id,
subscriptionPlanPrice: a0.subscription_plan_price,
amount: a0.amount,
quantity: a0.quantity,
discounts: a0.discounts,
unitPrice: a0.unit_price,
tax: a0.tax,
taxCode: a0.tax_code,
nominalTaxRate: a0.nominal_tax_rate
};
}
@@ -0,0 +1,175 @@
// Metro module 7839 (f7840).
import { useState } from "react";
import SubscriptionStore from "../../stores/billing/SubscriptionStore";
import { PREMIUM_GROUP_30_PERCENT_3_MONTH_DISCOUNT_ID, PREMIUM_TIER_2_ANNUAL_20_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_ANNUAL_25_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_ANNUAL_V2_20_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_ANNUAL_V2_30_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID, PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID, PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_30_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_LIKELIHOOD_DISCOUNT_ID, PREMIUM_TIER_2_REACTIVATION_DISCOUNT_ID, PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID } from "./PremiumConstants";
import { usePremiumTrialOffer } from "./hooks/usePremiumTrialOffer.android";
import { useHasActiveTrial } from "./PremiumSubscriptionTrialUtil";
import { usePremiumDiscountOffer, usePremiumGroupDiscountOffer } from "./hooks/usePremiumDiscountOffer.android";
import { useStateFromStores } from "../../_bundle/Module589";
import Module3771 from "../../_bundle/Module3771";
import useDiscountOffer from "./hooks/useDiscountOffer";
import { fetchChurnDiscountOffer } from "./UserOfferActionCreators";
import { InvoiceDiscountTypes } from "../../flow/Server";
import { useIsInReverseTrial } from "./ReverseTrialUtils.native";
let $mk79310 = function() {
return () => SubscriptionStore.getPremiumTypeSubscription();
};
const useHasDiscountApplied = () => {
const stateFromStores = useStateFromStores([SubscriptionStore], $mk79310());
const r13 = stateFromStores == null ? void 0 : stateFromStores.metadata?.active_discount_expires_at;
return r13 != null && Module3771(Date.now()) <= Module3771(r13);
};
export function useIsInPremiumOfferExperience() {
const premiumTrialOffer = usePremiumTrialOffer();
const hasActiveTrial = useHasActiveTrial();
const premiumDiscountOffer = usePremiumDiscountOffer();
const premiumGroupDiscountOffer = usePremiumGroupDiscountOffer();
const stateFromStores = useStateFromStores([SubscriptionStore], $mk79310());
const r33 = stateFromStores == null ? void 0 : stateFromStores.metadata?.active_discount_expires_at;
const r36 = r33 != null && Module3771(Date.now()) <= Module3771(r33);
return premiumTrialOffer != null || hasActiveTrial || premiumDiscountOffer != null || premiumGroupDiscountOffer != null || r36;
}
export { useHasDiscountApplied };
export function useActiveDiscountInfo() {
const stateFromStores = useStateFromStores([SubscriptionStore], () => SubscriptionStore.getPremiumTypeSubscription());
const discountId = stateFromStores == null ? void 0 : stateFromStores.metadata?.active_discount_id;
if (PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID !== discountId && PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_30_PERCENT_DISCOUNT_ID !== discountId) {
if (PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID !== discountId && PREMIUM_TIER_2_LIKELIHOOD_DISCOUNT_ID !== discountId && PREMIUM_TIER_2_REACTIVATION_DISCOUNT_ID !== discountId) {
if (PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID === discountId) {
return {
duration: 1,
percentage: 40,
discountId
};
}
if (PREMIUM_TIER_2_ANNUAL_20_PERCENT_DISCOUNT_ID === discountId) {
return {
duration: 1,
percentage: 20,
discountId
};
}
if (PREMIUM_TIER_2_ANNUAL_25_PERCENT_DISCOUNT_ID === discountId) {
return {
duration: 1,
percentage: 25,
discountId
};
}
if (PREMIUM_TIER_2_ANNUAL_V2_20_PERCENT_DISCOUNT_ID === discountId) {
return {
duration: 12,
percentage: 20,
discountId
};
}
if (PREMIUM_TIER_2_ANNUAL_V2_30_PERCENT_DISCOUNT_ID === discountId) {
return {
duration: 12,
percentage: 30,
discountId
};
}
if (PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID === discountId) {
return {
duration: 1,
percentage: 40,
discountId
};
}
if (PREMIUM_GROUP_30_PERCENT_3_MONTH_DISCOUNT_ID === discountId) {
return {
duration: 3,
percentage: 30,
discountId
};
}
return void 0;
}
return {
duration: 3,
percentage: 30,
discountId
};
}
return {
duration: 1,
percentage: 30,
discountId
};
}
export function useFetchChurnUserDiscountOffer(a0) {
let churnUserDiscountOffer = useDiscountOffer(PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID);
const discountOffer = useDiscountOffer(PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID);
const [state, setState] = useState(false);
const [isFetchingChurnDiscountOffer, setState2] = useState(false);
const [churnUserDiscountOffer2, setState3] = useState(null);
if (churnUserDiscountOffer == null) {
churnUserDiscountOffer = discountOffer;
}
if (churnUserDiscountOffer == null) {
churnUserDiscountOffer = null;
}
if (churnUserDiscountOffer != null) {
return {
churnUserDiscountOffer,
isFetchingChurnDiscountOffer: false
};
}
if (a0) {
return {
churnUserDiscountOffer: churnUserDiscountOffer2,
isFetchingChurnDiscountOffer
};
}
if (!(isFetchingChurnDiscountOffer || state)) {
setState2(true);
fetchChurnDiscountOffer().then((result) => {
setState3(result);
setState(true);
setState2(false);
}).catch(() => {
setState(true);
setState2(false);
});
}
return {
churnUserDiscountOffer: churnUserDiscountOffer2,
isFetchingChurnDiscountOffer
};
}
export function useShouldFetchChurnOffer() {
const stateFromStores = useStateFromStores([SubscriptionStore], () => SubscriptionStore.getPremiumTypeSubscription());
const stateFromStores2 = useStateFromStores([SubscriptionStore], $mk79310());
const r24 = stateFromStores2 == null ? void 0 : stateFromStores2.metadata?.active_discount_expires_at;
const r27 = r24 != null && Module3771(Date.now()) <= Module3771(r24);
return stateFromStores !== null && stateFromStores.hasPremiumNitroMonthly && !r27 && !!!stateFromStores?.hasActiveTrial;
}
export function renewalInvoiceChurnDiscountInfo(a0) {
for (const invoiceItem of a0.invoiceItems) {
const r26 = invoiceItem.discounts.find((discount) => discount.type === InvoiceDiscountTypes.SUBSCRIPTION_PLAN);
if (r26 == null) {
continue;
}
const discount_id = r26.discount_id;
if (PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID !== discount_id) {
if (PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID !== discount_id) {
continue;
}
return {
duration: 3,
percentage: r26.percentage_amount,
discountId: r26.discount_id
};
}
return {
duration: 1,
percentage: r26.percentage_amount,
discountId: r26.discount_id
};
}
return null;
}
export function useIsNUXEligible() {
return useIsInReverseTrial();
}
@@ -0,0 +1,24 @@
// Metro module 7840 (f7841).
import UserStore from "../../stores/UserStore";
import SubscriptionStore from "../../stores/billing/SubscriptionStore";
import UserOfferStore from "../../stores/billing/UserOfferStore";
import { PREMIUM_TIER_2_3P_ONE_MONTH_TRIAL_ID, PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID, PREMIUM_TIER_2_REACTIVATION_TRIAL_ID, PREMIUM_TIER_2_REFERRAL_TRIAL_ID, PREMIUM_TRIAL_IDS_ALL } from "./PremiumConstants";
import { useStateFromStores } from "../../_bundle/Module589";
import { hasUserTrialOfferExpired } from "./useTrialOffer";
export function useHasActiveTrial() {
return !!useStateFromStores([SubscriptionStore], () => SubscriptionStore.getPremiumTypeSubscription())?.hasActiveTrial;
}
export function hasActiveTrial() {
return SubscriptionStore.getPremiumTypeSubscription()?.trialId != null;
}
export function isEligibleTrialSub(a0) {
return a0?.trialId != null && (a0.trialId === PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID || a0.trialId === PREMIUM_TIER_2_REACTIVATION_TRIAL_ID || a0.trialId === PREMIUM_TIER_2_3P_ONE_MONTH_TRIAL_ID || a0.trialId === PREMIUM_TIER_2_REFERRAL_TRIAL_ID);
}
export function useCurrentPremiumTrialTier() {
const stateFromStores = useStateFromStores([SubscriptionStore], () => SubscriptionStore.getPremiumTypeSubscription());
const stateFromStores2 = useStateFromStores([UserStore], () => UserStore.getCurrentUser());
return stateFromStores?.hasActiveTrial ? stateFromStores2?.premiumType : null;
}
export function getPremiumTrialOffer() {
return PREMIUM_TRIAL_IDS_ALL.map((item) => UserOfferStore.getUserTrialOffer(item)).filter((item) => item != null && !hasUserTrialOfferExpired(item)).shift();
}
+406
View File
@@ -0,0 +1,406 @@
// Metro module 13118 (f13119).
import { PremiumSubscriptionSKUs } from "./PremiumConstants";
import Logger from "../debug/Logger";
import PremiumSKUFeature from "./PremiumSKUFeature";
import { EntitlementFeatureNames } from "../../_bundle/Module6201";
import { getUserMaxFileSize } from "../../utils/PremiumFeatureUtils";
import SKUListing from "./SKUListing";
import { Perk } from "../../_bundle/Module1892";
import DenormalizedPerksReadExperiment, { DenormalizedPerksReadConfig } from "./experiments/DenormalizedPerksReadExperiment";
import * as _PerksStateUtils from "./perks_state/PerksStateUtils";
import { $callWithNewTarget } from "../../_hermes/prelude";
function $mk90840($env) {
return (a0) => {
const r3 = $env[0];
return $mk109134($env.$parent)(r3, a0);
};
}
function $mk109134($env) {
return function userHasFeatureByMeritOfPremiumSKUs(a0, a1) {
let r21;
if (a1 != null && a1.premiumType != null) {
const r11 = $env;
L9: {
try {
const r12 = r11[3][a1.premiumType];
if (r12 == null) {
r11[4].warn(`Cannot find the corresponding SKU to the user's premium type ${a1.premiumType}`);
break L9;
}
const r16 = r11[5][r12];
if (r16 == null) {
r11[4].warn(`Cannot find the corresponding product catalog entry to the user's SKU ${r12} and premium type ${a1.premiumType}`);
r21 = false;
} else {
r21 = r16.skuFeatures.includes(a0);
}
} catch (r39) {
const r40 = r11[4];
let message = r39.message;
if (message == null) {
message = JSON.stringify(r39);
}
r40.error(`Error while retrieving user's feature access: ${message}`);
return false;
}
return r21;
}
return false;
}
return false;
};
}
let c9075_10, c9076_0, c9077_0, c9078_0, c9079_0, c9080_0, c9081_0, c9082_0, c9083_0, c9084_0, c9085_0, c9086_0, c9087_0, c9088_0, c9089_0, c9090_0, c9091_0, c9092_0, c9093_0, c9094_0, c9095_0, c9096_0, c9097_0, c9098_0, c9099_0, c9100_0, c9101_0, c9102_0, c9103_0, c9075_5, c9075_6, c9075_7, c9075_8, c9075_9;
let env9075;
let env9076;
let env9077;
let env9078;
let env9079;
let env9080;
let env9081;
let env9082;
let env9083;
let env9084;
let env9085;
let env9086;
let env9087;
let env9088;
let env9089;
let env9090;
let env9091;
let env9092;
let env9093;
let env9094;
let env9095;
let env9096;
let env9097;
let env9098;
let env9099;
let env9100;
let env9101;
let env9102;
let env9103;
const r1 = env9075 = {};
const c9075_4 = new Logger("ProductCatalog.tsx");
class ProductCatalogFeature extends PremiumSKUFeature {
constructor(a0, a1) {
let env20389;
const r1 = env20389 = {
$parent: env9075
};
env20389[0] = void 0;
super(a0, $mk90840(r1), a1);
env20389[0] = this;
}
}
ProductCatalogFeature.prototype;
c9075_10 = ProductCatalogFeature;
const ANIMATED_EMOJIS = EntitlementFeatureNames.ANIMATED_EMOJIS;
const r66 = env9076 = {
$parent: r1
};
c9076_0 = void 0;
const prototypeOf4 = Object.getPrototypeOf(ProductCatalogFeature);
const r68 = Object.create(ProductCatalogFeature.prototype);
const r70 = $callWithNewTarget(prototypeOf4, r68, ProductCatalogFeature, ANIMATED_EMOJIS, $mk90840(r66), void 0);
c9076_0 = r70 instanceof Object ? r70 : r68;
const EMOJIS_EVERYWHERE = EntitlementFeatureNames.EMOJIS_EVERYWHERE;
const r75 = env9077 = {
$parent: r1
};
c9077_0 = void 0;
const prototypeOf5 = Object.getPrototypeOf(ProductCatalogFeature);
const r77 = Object.create(ProductCatalogFeature.prototype);
const r80 = $callWithNewTarget(prototypeOf5, r77, ProductCatalogFeature, EMOJIS_EVERYWHERE, $mk90840(r75), void 0);
c9077_0 = r80 instanceof Object ? r80 : r77;
const STICKERS_EVERYWHERE = EntitlementFeatureNames.STICKERS_EVERYWHERE;
const r85 = env9078 = {
$parent: r1
};
c9078_0 = void 0;
const prototypeOf6 = Object.getPrototypeOf(ProductCatalogFeature);
const r87 = Object.create(ProductCatalogFeature.prototype);
const r90 = $callWithNewTarget(prototypeOf6, r87, ProductCatalogFeature, STICKERS_EVERYWHERE, $mk90840(r85), void 0);
c9078_0 = r90 instanceof Object ? r90 : r87;
const SOUNDBOARD_EVERYWHERE = EntitlementFeatureNames.SOUNDBOARD_EVERYWHERE;
const r95 = env9079 = {
$parent: r1
};
c9079_0 = void 0;
const prototypeOf7 = Object.getPrototypeOf(ProductCatalogFeature);
const r97 = Object.create(ProductCatalogFeature.prototype);
const r100 = $callWithNewTarget(prototypeOf7, r97, ProductCatalogFeature, SOUNDBOARD_EVERYWHERE, $mk90840(r95), void 0);
c9079_0 = r100 instanceof Object ? r100 : r97;
const CUSTOM_CALL_SOUNDS = EntitlementFeatureNames.CUSTOM_CALL_SOUNDS;
const r105 = env9080 = {
$parent: r1
};
c9080_0 = void 0;
const prototypeOf8 = Object.getPrototypeOf(ProductCatalogFeature);
const r107 = Object.create(ProductCatalogFeature.prototype);
const r110 = $callWithNewTarget(prototypeOf8, r107, ProductCatalogFeature, CUSTOM_CALL_SOUNDS, $mk90840(r105), void 0);
c9080_0 = r110 instanceof Object ? r110 : r107;
const PREMIUM_VOICE_FILTERS = EntitlementFeatureNames.PREMIUM_VOICE_FILTERS;
const r115 = env9081 = {
$parent: r1
};
c9081_0 = void 0;
const prototypeOf9 = Object.getPrototypeOf(ProductCatalogFeature);
const r117 = Object.create(ProductCatalogFeature.prototype);
const r120 = $callWithNewTarget(prototypeOf9, r117, ProductCatalogFeature, PREMIUM_VOICE_FILTERS, $mk90840(r115), void 0);
c9081_0 = r120 instanceof Object ? r120 : r117;
const ANIMATED_AVATAR = EntitlementFeatureNames.ANIMATED_AVATAR;
const r125 = env9082 = {
$parent: r1
};
c9082_0 = void 0;
const prototypeOf10 = Object.getPrototypeOf(ProductCatalogFeature);
const r127 = Object.create(ProductCatalogFeature.prototype);
const r130 = $callWithNewTarget(prototypeOf10, r127, ProductCatalogFeature, ANIMATED_AVATAR, $mk90840(r125), void 0);
c9082_0 = r130 instanceof Object ? r130 : r127;
const CUSTOM_DISCRIMINATOR = EntitlementFeatureNames.CUSTOM_DISCRIMINATOR;
const r135 = env9083 = {
$parent: r1
};
c9083_0 = void 0;
const prototypeOf11 = Object.getPrototypeOf(ProductCatalogFeature);
const r137 = Object.create(ProductCatalogFeature.prototype);
const r140 = $callWithNewTarget(prototypeOf11, r137, ProductCatalogFeature, CUSTOM_DISCRIMINATOR, $mk90840(r135), void 0);
c9083_0 = r140 instanceof Object ? r140 : r137;
const PREMIUM_GUILD_MEMBER_PROFILE = EntitlementFeatureNames.PREMIUM_GUILD_MEMBER_PROFILE;
const r145 = env9084 = {
$parent: r1
};
c9084_0 = void 0;
const prototypeOf12 = Object.getPrototypeOf(ProductCatalogFeature);
const r147 = Object.create(ProductCatalogFeature.prototype);
const r150 = $callWithNewTarget(prototypeOf12, r147, ProductCatalogFeature, PREMIUM_GUILD_MEMBER_PROFILE, $mk90840(r145), void 0);
c9084_0 = r150 instanceof Object ? r150 : r147;
const r151 = env9085 = {
$parent: r1
};
c9085_0 = void 0;
const prototypeOf = Object.getPrototypeOf(ProductCatalogFeature);
const r152 = Object.create(ProductCatalogFeature.prototype);
const r156 = $callWithNewTarget(prototypeOf, r152, ProductCatalogFeature, "profileBadges", $mk90840(r151), void 0);
c9085_0 = r156 instanceof Object ? r156 : r152;
const PROFILE_PREMIUM_FEATURES = EntitlementFeatureNames.PROFILE_PREMIUM_FEATURES;
const r161 = env9086 = {
$parent: r1
};
c9086_0 = void 0;
const prototypeOf13 = Object.getPrototypeOf(ProductCatalogFeature);
const r163 = Object.create(ProductCatalogFeature.prototype);
const r167 = $callWithNewTarget(prototypeOf13, r163, ProductCatalogFeature, PROFILE_PREMIUM_FEATURES, $mk90840(r161), "custom banner and avatar decoration");
c9086_0 = r167 instanceof Object ? r167 : r163;
const r168 = env9087 = {
$parent: r1
};
c9087_0 = void 0;
const prototypeOf14 = Object.getPrototypeOf(ProductCatalogFeature);
const r170 = Object.create(ProductCatalogFeature.prototype);
const r175 = $callWithNewTarget(prototypeOf14, r170, ProductCatalogFeature, "collectibles", $mk90840(r168), void 0);
c9087_0 = r175 instanceof Object ? r175 : r170;
const r176 = env9088 = {
$parent: r1
};
c9088_0 = void 0;
const prototypeOf15 = Object.getPrototypeOf(ProductCatalogFeature);
const r178 = Object.create(ProductCatalogFeature.prototype);
const r182 = $callWithNewTarget(prototypeOf15, r178, ProductCatalogFeature, "appIcons", $mk90840(r176), void 0);
c9088_0 = r182 instanceof Object ? r182 : r178;
const CLIENT_THEMES = EntitlementFeatureNames.CLIENT_THEMES;
const r187 = env9089 = {
$parent: r1
};
c9089_0 = void 0;
const prototypeOf16 = Object.getPrototypeOf(ProductCatalogFeature);
const r189 = Object.create(ProductCatalogFeature.prototype);
const r192 = $callWithNewTarget(prototypeOf16, r189, ProductCatalogFeature, CLIENT_THEMES, $mk90840(r187), void 0);
c9089_0 = r192 instanceof Object ? r192 : r189;
const r193 = env9090 = {
$parent: r1
};
c9090_0 = void 0;
const prototypeOf17 = Object.getPrototypeOf(ProductCatalogFeature);
const r195 = Object.create(ProductCatalogFeature.prototype);
const r199 = $callWithNewTarget(prototypeOf17, r195, ProductCatalogFeature, "boostDiscount", $mk90840(r193), void 0);
c9090_0 = r199 instanceof Object ? r199 : r195;
const r200 = env9091 = {
$parent: r1
};
c9091_0 = void 0;
const prototypeOf18 = Object.getPrototypeOf(ProductCatalogFeature);
const r202 = Object.create(ProductCatalogFeature.prototype);
const r206 = $callWithNewTarget(prototypeOf18, r202, ProductCatalogFeature, "freeBoosts", $mk90840(r200), void 0);
c9091_0 = r206 instanceof Object ? r206 : r202;
const STREAM_MID_QUALITY = EntitlementFeatureNames.STREAM_MID_QUALITY;
const r211 = env9092 = {
$parent: r1
};
c9092_0 = void 0;
const prototypeOf19 = Object.getPrototypeOf(ProductCatalogFeature);
const r213 = Object.create(ProductCatalogFeature.prototype);
const r216 = $callWithNewTarget(prototypeOf19, r213, ProductCatalogFeature, STREAM_MID_QUALITY, $mk90840(r211), void 0);
c9092_0 = r216 instanceof Object ? r216 : r213;
const STREAM_HIGH_QUALITY = EntitlementFeatureNames.STREAM_HIGH_QUALITY;
const r221 = env9093 = {
$parent: r1
};
c9093_0 = void 0;
const prototypeOf20 = Object.getPrototypeOf(ProductCatalogFeature);
const r223 = Object.create(ProductCatalogFeature.prototype);
const r226 = $callWithNewTarget(prototypeOf20, r223, ProductCatalogFeature, STREAM_HIGH_QUALITY, $mk90840(r221), void 0);
c9093_0 = r226 instanceof Object ? r226 : r223;
const CUSTOM_NOTIFICATION_SOUNDS = EntitlementFeatureNames.CUSTOM_NOTIFICATION_SOUNDS;
const r231 = env9094 = {
$parent: r1
};
c9094_0 = void 0;
const prototypeOf21 = Object.getPrototypeOf(ProductCatalogFeature);
const r233 = Object.create(ProductCatalogFeature.prototype);
const r236 = $callWithNewTarget(prototypeOf21, r233, ProductCatalogFeature, CUSTOM_NOTIFICATION_SOUNDS, $mk90840(r231), void 0);
c9094_0 = r236 instanceof Object ? r236 : r233;
const r237 = env9095 = {
$parent: r1
};
c9095_0 = void 0;
const prototypeOf22 = Object.getPrototypeOf(ProductCatalogFeature);
const r239 = Object.create(ProductCatalogFeature.prototype);
const r243 = $callWithNewTarget(prototypeOf22, r239, ProductCatalogFeature, "fancyVoiceChannelReactions", $mk90840(r237), void 0);
c9095_0 = r243 instanceof Object ? r243 : r239;
const r244 = env9096 = {
$parent: r1
};
c9096_0 = void 0;
const prototypeOf23 = Object.getPrototypeOf(ProductCatalogFeature);
const r246 = Object.create(ProductCatalogFeature.prototype);
const r250 = $callWithNewTarget(prototypeOf23, r246, ProductCatalogFeature, "installPremiumApplications", $mk90840(r244), void 0);
c9096_0 = r250 instanceof Object ? r250 : r246;
const r251 = env9097 = {
$parent: r1
};
c9097_0 = void 0;
const prototypeOf24 = Object.getPrototypeOf(ProductCatalogFeature);
const r253 = Object.create(ProductCatalogFeature.prototype);
const r257 = $callWithNewTarget(prototypeOf24, r253, ProductCatalogFeature, "redeemPremiumPerks", $mk90840(r251), void 0);
c9097_0 = r257 instanceof Object ? r257 : r253;
const VIDEO_FILTER_ASSETS = EntitlementFeatureNames.VIDEO_FILTER_ASSETS;
const r262 = env9098 = {
$parent: r1
};
c9098_0 = void 0;
const prototypeOf25 = Object.getPrototypeOf(ProductCatalogFeature);
const r264 = Object.create(ProductCatalogFeature.prototype);
const r267 = $callWithNewTarget(prototypeOf25, r264, ProductCatalogFeature, VIDEO_FILTER_ASSETS, $mk90840(r262), void 0);
c9098_0 = r267 instanceof Object ? r267 : r264;
const premiumSKUFeature = new PremiumSKUFeature(EntitlementFeatureNames.INCREASED_FILE_UPLOAD_SIZE, getUserMaxFileSize);
const INCREASED_GUILD_LIMIT = EntitlementFeatureNames.INCREASED_GUILD_LIMIT;
const r283 = env9099 = {
$parent: r1
};
c9099_0 = void 0;
const prototypeOf26 = Object.getPrototypeOf(ProductCatalogFeature);
const r285 = Object.create(ProductCatalogFeature.prototype);
const r288 = $callWithNewTarget(prototypeOf26, r285, ProductCatalogFeature, INCREASED_GUILD_LIMIT, $mk90840(r283), void 0);
c9099_0 = r288 instanceof Object ? r288 : r285;
const INCREASED_MESSAGE_LENGTH = EntitlementFeatureNames.INCREASED_MESSAGE_LENGTH;
const r293 = env9100 = {
$parent: r1
};
c9100_0 = void 0;
const prototypeOf27 = Object.getPrototypeOf(ProductCatalogFeature);
const r295 = Object.create(ProductCatalogFeature.prototype);
const r298 = $callWithNewTarget(prototypeOf27, r295, ProductCatalogFeature, INCREASED_MESSAGE_LENGTH, $mk90840(r293), void 0);
c9100_0 = r298 instanceof Object ? r298 : r295;
const r300 = env9101 = {
$parent: r1
};
c9101_0 = void 0;
const prototypeOf2 = Object.getPrototypeOf(ProductCatalogFeature);
const r301 = Object.create(ProductCatalogFeature.prototype);
const r305 = $callWithNewTarget(prototypeOf2, r301, ProductCatalogFeature, "increasedVideoUploadQuality", $mk90840(r300), void 0);
c9101_0 = r305 instanceof Object ? r305 : r301;
const r307 = env9102 = {
$parent: r1
};
c9102_0 = void 0;
const prototypeOf3 = Object.getPrototypeOf(ProductCatalogFeature);
const r308 = Object.create(ProductCatalogFeature.prototype);
const r312 = $callWithNewTarget(prototypeOf3, r308, ProductCatalogFeature, "uploadLargeFiles", $mk90840(r307), void 0);
c9102_0 = r312 instanceof Object ? r312 : r308;
const QUEST_ORB_MULTIPLIER = EntitlementFeatureNames.QUEST_ORB_MULTIPLIER;
const r318 = env9103 = {
$parent: r1
};
c9103_0 = void 0;
const prototypeOf28 = Object.getPrototypeOf(ProductCatalogFeature);
const r320 = Object.create(ProductCatalogFeature.prototype);
const r323 = $callWithNewTarget(prototypeOf28, r320, ProductCatalogFeature, QUEST_ORB_MULTIPLIER, $mk90840(r318), void 0);
c9103_0 = r323 instanceof Object ? r323 : r320;
const r325 = Object;
const r327 = {};
r327[PremiumSubscriptionSKUs.TIER_0] = new SKUListing(PremiumSubscriptionSKUs.TIER_0, [c9076_0, c9077_0, c9078_0, c9085_0, c9098_0, c9101_0, c9102_0, c9088_0]);
r327[PremiumSubscriptionSKUs.TIER_1] = new SKUListing(PremiumSubscriptionSKUs.TIER_1, [c9076_0, c9077_0, c9082_0, c9083_0, c9085_0, c9090_0, c9092_0, c9095_0, c9101_0, c9102_0, c9088_0]);
r327[PremiumSubscriptionSKUs.TIER_2] = new SKUListing(PremiumSubscriptionSKUs.TIER_2, [c9076_0, c9077_0, c9078_0, c9079_0, c9080_0, c9082_0, c9083_0, c9084_0, c9085_0, c9086_0, c9089_0, c9090_0, c9091_0, c9092_0, c9093_0, c9095_0, c9096_0, c9097_0, c9098_0, c9099_0, c9100_0, c9101_0, c9102_0, c9088_0, c9087_0, c9094_0, c9081_0, c9103_0]);
c9075_5 = r325.freeze(r327);
c9075_6 = [c9090_0, c9091_0];
c9075_7 = [c9103_0];
c9075_8 = [];
c9075_9 = new Map([[c9076_0, Perk.ANIMATED_EMOJIS], [c9077_0, Perk.EMOJIS_EVERYWHERE], [c9078_0, Perk.STICKERS_EVERYWHERE], [c9079_0, Perk.SOUNDBOARD_EVERYWHERE], [c9080_0, Perk.CUSTOM_CALL_SOUNDS], [c9081_0, Perk.PREMIUM_VOICE_FILTERS], [c9082_0, Perk.ANIMATED_AVATAR], [c9083_0, Perk.CUSTOM_DISCRIMINATOR], [c9084_0, Perk.PREMIUM_GUILD_MEMBER_PROFILE], [c9086_0, Perk.PROFILE_PREMIUM_FEATURES], [c9087_0, Perk.PREMIUM_COLLECTIBLES], [c9089_0, Perk.CLIENT_THEMES], [c9092_0, Perk.STREAM_MID_QUALITY], [c9093_0, Perk.STREAM_HIGH_QUALITY], [c9098_0, Perk.VIDEO_FILTER_ASSETS], [c9099_0, Perk.INCREASED_GUILD_LIMIT], [c9100_0, Perk.INCREASED_MESSAGE_LENGTH], [c9102_0, Perk.INCREASED_FILE_UPLOAD_SIZE], [c9085_0, Perk.PROFILE_BADGES], [c9088_0, Perk.APP_ICONS], [c9090_0, Perk.BOOST_DISCOUNT], [c9091_0, Perk.FREE_BOOSTS], [c9096_0, Perk.INSTALL_PREMIUM_APPLICATIONS], [c9101_0, Perk.INCREASED_VIDEO_UPLOAD_QUALITY]]);
export { c9076_0 as ANIMATED_EMOJIS };
export { c9077_0 as EMOJIS_EVERYWHERE };
export { c9078_0 as STICKERS_EVERYWHERE };
export { c9079_0 as SOUNDBOARD_EVERYWHERE };
export { c9080_0 as CUSTOM_CALL_SOUNDS };
export { c9081_0 as PREMIUM_VOICE_FILTERS };
export { c9082_0 as ANIMATED_AVATAR };
export { c9083_0 as CUSTOM_DISCRIMINATOR };
export { c9084_0 as PREMIUM_GUILD_MEMBER_PROFILE };
export { c9085_0 as PROFILE_BADGES };
export { c9086_0 as PROFILE_PREMIUM_FEATURES };
export { c9087_0 as COLLECTIBLES };
export { c9088_0 as APP_ICONS };
export { c9089_0 as CLIENT_THEMES };
export { c9090_0 as BOOST_DISCOUNT };
export { c9091_0 as FREE_BOOSTS };
export { c9092_0 as STREAM_MID_QUALITY };
export { c9093_0 as STREAM_HIGH_QUALITY };
export { c9094_0 as CUSTOM_NOTIFICATION_SOUNDS };
export { c9095_0 as FANCY_VOICE_CHANNEL_REACTIONS };
export { c9096_0 as INSTALL_PREMIUM_APPLICATIONS };
export { c9097_0 as REDEEM_PREMIUM_PERKS };
export { c9098_0 as VIDEO_FILTER_ASSETS };
export { premiumSKUFeature as INCREASED_FILE_UPLOAD_SIZE };
export { c9099_0 as INCREASED_GUILD_LIMIT };
export { c9100_0 as INCREASED_MESSAGE_LENGTH };
export { c9101_0 as INCREASED_VIDEO_UPLOAD_QUALITY };
export { c9102_0 as UPLOAD_LARGE_FILES };
export { c9103_0 as QUEST_ORB_MULTIPLIER };
export { c9075_5 as PRODUCT_CATALOG };
export function canUserUse(a0, a1, a2) {
if (a1 != null && a1.isPremiumWithFractionalPremiumOnly() && c9075_6.includes(a0)) {
return false;
}
if (a1 != null && a1.isFractionalPremiumWithNoStandardSub() && c9075_7.includes(a0)) {
return false;
}
if (a2 && c9075_8.includes(a0)) {
return false;
}
const r10 = c9075_9.get(a0);
if (r10 != null && a1?.perks != null) {
const config = DenormalizedPerksReadExperiment.getConfig({
location: "product_catalog_can_user_use"
});
if (config !== DenormalizedPerksReadConfig.CONTROL) {
let r40 = a0.getFeatureValue(a1);
const hasPerk = _PerksStateUtils.hasPerk(a1?.perks, r10);
if (config === DenormalizedPerksReadConfig.DUAL_READ_RETURN_NEW) {
r40 = hasPerk;
}
return r40;
}
}
return a0.getFeatureValue(a1);
}
@@ -0,0 +1,415 @@
// Metro module 6213 (f6214).
import UserRecord from "../../records/UserRecord";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import { Endpoints, AbortCodes } from "../../Constants";
import { HTTP } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
import SentryUtils_native from "../../utils/SentryUtils.native";
import MessageActionCreators from "../../actions/MessageActionCreators";
function $mk114905($env) {
return (a0) => new UserRecord(a0);
}
let c3941_9;
let env3941 = {};
const r34 = {
REDEEMED: 1,
1: "REDEEMED",
PENDING: 2,
2: "PENDING",
CONVERTED: 3,
3: "CONVERTED"
};
const c3941_8 = {
SUCCESS: 1,
1: "SUCCESS",
FAIL: 2,
2: "FAIL"
};
class EligibleUserCache {
cache = new Map();
expiration = Date.now() + 600000;
set(a0, a1) {
this.cache.set(a0, a1);
}
get(a0) {
this._checkExpiration();
return this.cache.get(a0);
}
has(a0) {
this._checkExpiration();
return this.cache.has(a0);
}
_checkExpiration() {
if (this.expiration < Date.now()) {
this.cache.clear();
}
}
}
const r52 = {
__proto__: EligibleUserCache.prototype
};
r52.cache = new Map();
r52.expiration = Date.now() + 600000;
c3941_9 = r52;
export { r34 as ReferralOfferStatus };
export { c3941_8 as CreateReferralStatus };
export async function fetchReferralEligibleUsers(index, searchQuery, c25745_2) {
let r36;
let limit, c25745_4, c25745_5;
L14: {
let env29687;
const r28 = env3941;
c25745_5 = r28;
const r11 = env29687 = {
$parent: r28
};
c25745_4 = r11;
env29687[0] = void 0;
env29687[1] = void 0;
env29687[2] = void 0;
env29687[3] = void 0;
env29687[4] = void 0;
const r30 = JSON.stringify({
index,
searchQuery
});
env29687[0] = r30;
if (c3941_9.has(r30)) {
r36 = c3941_9.get(r30);
break L14;
}
limit = c25745_2;
if (c25745_2 == null) {
limit = 10;
}
env29687[1] = (await HTTP.post({
url: Endpoints.GET_REFERRAL_ELIGIBLE_USERS,
body: {
index,
limit,
search_query: searchQuery
},
oldFormErrors: true,
rejectWithError: false
})).body;
env29687[2] = env29687[1].users;
env29687[3] = env29687[1].next_index;
env29687[4] = {
users: env29687[2].map($mk114905(env3941)),
nextIndex: env29687[3]
};
c3941_9.set(env29687[0], env29687[4]);
return env29687[4];
}
return r36;
}
export function fetchReferralsRemaining() {
Dispatcher.dispatch({
type: "BILLING_REFERRALS_REMAINING_FETCH_START"
});
return HTTP.get({
url: Endpoints.GET_REFERRALS_REMAINING,
oldFormErrors: true,
rejectWithError: false
}).then((result) => {
const map = new Map();
if (result.body != null && result.body.recipient_status != null) {
const recipient_status = result.body.recipient_status;
for (const key in recipient_status) {
map.set(key, result.body.recipient_status[key]);
}
}
const referrals_remaining = result.body != null ? result.body.referrals_remaining != null ? result.body.referrals_remaining : 0 : 0;
const sent_user_ids = result.body != null && result.body.sent_user_ids != null ? result.body.sent_user_ids : [];
let refresh_at = result.body?.refresh_at;
if (refresh_at == null) {
refresh_at = null;
}
let has_eligible_friends = result.body?.has_eligible_friends;
if (has_eligible_friends == null) {
has_eligible_friends = false;
}
let reminder_state_id = result.body?.reminder_state_id;
if (reminder_state_id == null) {
reminder_state_id = null;
}
Dispatcher.dispatch({
type: "BILLING_REFERRALS_REMAINING_FETCH_SUCCESS",
referrals_remaining,
sent_user_ids,
refresh_at,
recipient_status: map,
has_eligible_friends,
reminder_state_id
});
}, (a0) => {
if (a0?.status !== 404) {
Dispatcher.dispatch({
type: "BILLING_REFERRALS_REMAINING_FETCH_FAIL"
});
}
});
}
export async function createReferralTrials(c25746_0) {
let r32, r63, r125;
let c25746_1, c25746_2, body, c25746_6;
let c25746_7 = 0;
let c29688_1, c29688_2, c29688_3, c29688_0, c29688_4;
L22: {
L21: {
try {
c29688_1 = void 0;
c29688_2 = void 0;
c29688_3 = void 0;
c29688_0 = [];
c29688_1 = new Map();
c25746_2 = c25746_0;
const r49 = c25746_0[Symbol.iterator]();
c25746_2 = r49.next;
c25746_1 = r49;
const r51 = c25746_2;
let r52 = c25746_1;
const r53 = r52 === void 0 ? void 0 : (r32 = r51.call(r52)).done ? r52 = void 0 : r32.value;
c25746_1 = r52;
if (r52 === void 0) {
Dispatcher.dispatch({
type: "CREATE_REFERRALS_SUCCESS",
userTrialOffers: c29688_0
});
r63 = c29688_1;
break L22;
}
c29688_2 = r53;
c25746_7 = 2;
let r83 = await HTTP.post({
url: Endpoints.CREATE_REFERRAL(c29688_2),
oldFormErrors: true,
rejectWithError: true
});
while (true) {
const body4 = r83.body;
body = body4;
if (body4 == null) {
body = null;
}
c29688_3 = body;
if (c29688_3 != null) {
c29688_0.push(c29688_3);
}
c29688_1.set(c29688_2, c3941_8.SUCCESS);
c25746_7 = 1;
c25746_7 = 0;
const r112 = c25746_2;
let r113 = c25746_1;
const r114 = r113 === void 0 ? void 0 : (r32 = r112.call(r113)).done ? r113 = void 0 : r32.value;
c25746_1 = r113;
if (r113 === void 0) {
Dispatcher.dispatch({
type: "CREATE_REFERRALS_SUCCESS",
userTrialOffers: c29688_0
});
r125 = c29688_1;
break;
}
c29688_2 = r114;
c25746_7 = 2;
r83 = await HTTP.post({
url: Endpoints.CREATE_REFERRAL(c29688_2),
oldFormErrors: true,
rejectWithError: true
});
}
} catch ($e) {
const r42 = $e;
let r8 = r42;
c25746_6 = r42;
let r43 = c25746_7;
if (r43 !== 0) {
while (true) {
if (r43 === 1) {
try {
const r243 = c25746_6;
c25746_7 = 0;
const r245 = c25746_1;
if (r245 !== void 0 && typeof r245.return === "function") {
try {
r245.return();
} catch {}
}
throw r243;
} catch (r242) {
r8 = r242;
c25746_6 = r242;
r43 = c25746_7;
if (r43 === 0) {
break;
}
}
} else {
try {
const r163 = c25746_6;
c25746_7 = 1;
c29688_4 = r163;
SentryUtils_native.captureException(c29688_4);
c29688_1.set(c29688_2, c3941_8.FAIL);
while (true) {
c25746_7 = 0;
const r178 = c25746_2;
let r179 = c25746_1;
const r180 = r179 === void 0 ? void 0 : (r32 = r178.call(r179)).done ? r179 = void 0 : r32.value;
c25746_1 = r179;
if (r179 === void 0) {
Dispatcher.dispatch({
type: "CREATE_REFERRALS_SUCCESS",
userTrialOffers: c29688_0
});
r125 = c29688_1;
break L21;
}
c29688_2 = r180;
c25746_7 = 2;
body = (await HTTP.post({
url: Endpoints.CREATE_REFERRAL(c29688_2),
oldFormErrors: true,
rejectWithError: true
})).body;
if (body == null) {
body = null;
}
c29688_3 = body;
if (c29688_3 != null) {
c29688_0.push(c29688_3);
}
c29688_1.set(c29688_2, c3941_8.SUCCESS);
c25746_7 = 1;
}
} catch (r160) {
r8 = r160;
c25746_6 = r160;
r43 = c25746_7;
if (r43 === 0) {
break;
}
}
}
}
}
throw r8;
}
}
return r125;
}
return r63;
}
export async function createReferralTrial(c25747_0) {
let r66;
let body2, c25747_4;
let c25747_5 = 0;
let c29689_0, c29689_1, c29689_2;
try {
c29689_0 = void 0;
c29689_1 = void 0;
c25747_5 = 1;
const body4 = (await HTTP.post({
url: Endpoints.CREATE_REFERRAL(c25747_0),
oldFormErrors: true,
rejectWithError: false
})).body;
body2 = body4;
if (body4 == null) {
body2 = null;
}
c29689_0 = body2;
Dispatcher.dispatch({
type: "BILLING_CREATE_REFERRAL_SUCCESS",
userTrialOffer: c29689_0
});
r66 = {
userTrialOffer: c29689_0
};
c25747_5 = 0;
} catch ($e) {
const r27 = $e;
let r8 = r27;
c25747_4 = r27;
if (c25747_5 !== 0) {
while (true) {
try {
const r75 = c25747_4;
c25747_5 = 0;
c29689_2 = r75;
Dispatcher.dispatch({
type: "BILLING_CREATE_REFERRAL_FAIL"
});
if (c29689_2.body.code === AbortCodes.INVALID_MESSAGE_SEND_USER) {
c29689_1 = SelectedChannelStore.getCurrentlySelectedChannelId();
if (c29689_1 != null) {
MessageActionCreators.sendClydeError(c29689_1, c29689_2.body.code);
}
}
} catch (r71) {
r8 = r71;
c25747_4 = r71;
if (c25747_5 === 0) {
break;
}
continue;
}
return void 0;
}
}
throw r8;
}
return r66;
}
export async function resolveReferralTrialOffer(c25748_0) {
let r65;
let body3;
let c25748_5 = 0;
let c29690_0, c29690_1;
try {
c29690_0 = c25748_0;
c29690_1 = void 0;
c25748_5 = 1;
const body4 = (await HTTP.get({
url: Endpoints.REFERRAL_OFFER_ID_RESOLVE(c25748_0),
oldFormErrors: true,
rejectWithError: false
})).body;
body3 = body4;
if (body4 == null) {
body3 = null;
}
c29690_1 = body3;
Dispatcher.dispatch({
type: "BILLING_REFERRAL_RESOLVE_SUCCESS",
userTrialOffer: c29690_1
});
r65 = {
userTrialOffer: c29690_1
};
c25748_5 = 0;
} catch ($e) {
let r8 = $e;
if (c25748_5 !== 0) {
while (true) {
try {
c25748_5 = 0;
Dispatcher.dispatch({
type: "BILLING_REFERRAL_RESOLVE_FAIL",
userTrialOfferId: c29690_0
});
} catch ($e) {
r8 = $e;
if (c25748_5 === 0) {
break;
}
continue;
}
return void 0;
}
}
throw r8;
}
return r65;
}
+241
View File
@@ -0,0 +1,241 @@
// Metro module 6212 (f6213).
import UserStore from "../../stores/UserStore";
import { NOOP_NULL } from "../../Constants";
import { fetchReferralsRemaining, resolveReferralTrialOffer } from "./ReferralTrialActionCreators";
import Dispatcher from "../../Dispatcher";
import { MessageTypes } from "../../_bundle/Module686";
import Module589 from "../../_bundle/Module589";
import { HermesBuiltin } from "../../_hermes/prelude";
function $mk78008($env) {
return () => {
const r1 = $env.$parent;
return (0, r1[0])(r1[2][2]).resolveReferralTrialOffer($env[0]).catch(r1[4]);
};
}
let c3940_22;
let env3940 = {};
const emitChanges = function emitChanges() {
return true;
};
const handleLoadMessages = function handleLoadMessages(a0) {
a0.messages.forEach((message) => {
const r13 = message.type === MessageTypes.PREMIUM_REFERRAL ? message.content : null;
let env25744;
const r14 = env25744 = {
$parent: env3940
};
env25744[0] = r13;
const r2 = r13 == null;
let r15 = false;
if (!r2) {
const r18 = env3940[10].has(r13) || env3940[9].has(r13);
r15 = void 0;
if (!r18) {
env3940[9].add(r13);
Dispatcher.wait($mk78008(r14));
r15 = void 0;
}
}
return r15;
});
};
env3940[5] = null;
env3940[6] = new Set();
env3940[7] = new Map();
env3940[8] = false;
env3940[9] = new Set();
env3940[10] = new Set();
env3940[11] = new Map();
env3940[12] = 0;
env3940[13] = null;
env3940[14] = [];
env3940[15] = false;
env3940[16] = 0;
env3940[17] = false;
env3940[18] = false;
env3940[19] = null;
env3940[20] = null;
class ReferralTrialStore extends Module589.Store {
static displayName = "ReferralTrialStore";
constructor() {
super(...arguments);
}
initialize() {
this.waitFor(UserStore);
this.syncWith([UserStore], emitChanges);
}
checkAndFetchReferralsRemaining() {
let r1 = env3940[5] == null && !env3940[8] && env3940[12] < 6;
if (r1) {
const r6 = env3940[13];
r1 = r6 == null || r6 < Date.now();
}
if (r1) {
fetchReferralsRemaining();
}
}
getReferralsRemaining(r1 = {}) {
let bypassFetch = r1.bypassFetch;
if (bypassFetch === void 0) {
bypassFetch = false;
}
if (!bypassFetch) {
this.checkAndFetchReferralsRemaining();
}
return env3940[5];
}
getSentUserIds() {
this.checkAndFetchReferralsRemaining();
return Array.from(env3940[6].values());
}
isFetchingReferralsRemaining() {
return env3940[8];
}
getRelevantUserTrialOffer(a0) {
return env3940[11].get(a0);
}
isResolving(a0) {
return env3940[9].has(a0);
}
getEligibleUsers() {
return env3940[14];
}
getFetchingEligibleUsers() {
return env3940[15];
}
getNextIndexOfEligibleUsers() {
return env3940[16];
}
getIsEligibleToSendReferrals() {
return env3940[17];
}
getHasEligibleFriends() {
return env3940[18];
}
getRefreshAt() {
return env3940[19];
}
getAllRelevantReferralTrialOffers() {
return Array.from(env3940[11].values());
}
getRecipientStatus() {
return env3940[7];
}
getReminderStateId() {
return env3940[20];
}
}
c3940_22 = ReferralTrialStore;
const r106 = new ReferralTrialStore(Dispatcher, {
BILLING_REFERRAL_TRIAL_OFFER_UPDATE: function handleReferralTrialOfferUpdate({ userTrialOfferId }) {
if (!env3940[8]) {
fetchReferralsRemaining();
}
if (!env3940[9].has(userTrialOfferId)) {
env3940[9].add(userTrialOfferId);
Dispatcher.wait(() => resolveReferralTrialOffer(userTrialOfferId).catch(NOOP_NULL));
}
},
BILLING_REFERRALS_REMAINING_FETCH_START: function handleReferralsRemainingFetchStart(a0) {
if (a0 == null) {
HermesBuiltin.throwTypeError("Cannot destructure 'undefined' or 'null'.");
throw new Error("unreachable");
}
env3940[19] = null;
env3940[8] = true;
},
BILLING_REFERRALS_REMAINING_FETCH_SUCCESS: function handleReferralsRemainingFetchSuccess({ referrals_remaining, sent_user_ids, refresh_at, recipient_status, has_eligible_friends, reminder_state_id }) {
env3940[17] = true;
env3940[18] = has_eligible_friends;
env3940[8] = false;
env3940[5] = referrals_remaining;
env3940[6] = new Set(sent_user_ids);
env3940[19] = refresh_at;
env3940[7] = recipient_status;
env3940[20] = reminder_state_id;
env3940[12] = 0;
env3940[13] = null;
},
BILLING_REFERRALS_REMAINING_FETCH_FAIL: function handleReferralsRemainingFetchFail(a0) {
if (a0 == null) {
HermesBuiltin.throwTypeError("Cannot destructure 'undefined' or 'null'.");
throw new Error("unreachable");
}
env3940[17] = false;
env3940[18] = false;
env3940[19] = null;
env3940[8] = false;
const r1 = env3940[12] + 1;
env3940[12] = r1;
const r19 = r1 <= 3 ? 1000 * Math.pow(2, env3940[12]) : 8000 * Math.pow(4, env3940[12] - 3);
env3940[13] = Date.now() + Math.min(300000, r19);
},
BILLING_CREATE_REFERRAL_SUCCESS: function handleCreateReferralSuccess({ userTrialOffer }) {
fetchReferralsRemaining();
env3940[11].set(userTrialOffer.id, userTrialOffer);
env3940[6].add(userTrialOffer.user_id);
},
CREATE_REFERRALS_SUCCESS: function handleCreateReferralsSuccess({ userTrialOffers }) {
fetchReferralsRemaining();
for (const item of userTrialOffers) {
env3940[11].set(item.id, item);
env3940[6].add(item.user_id);
}
},
BILLING_REFERRAL_RESOLVE_SUCCESS: function handleReferralTrialResolveSuccess({ userTrialOffer }) {
if (userTrialOffer != null) {
env3940[9].delete(userTrialOffer.id);
env3940[10].add(userTrialOffer.id);
env3940[11].set(userTrialOffer.id, userTrialOffer);
}
},
BILLING_REFERRAL_RESOLVE_FAIL: function handleReferralTrialResolveFail({ userTrialOfferId: userTrialOfferId2 }) {
env3940[9].delete(userTrialOfferId2);
env3940[10].add(userTrialOfferId2);
},
REFERRALS_FETCH_ELIGIBLE_USER_START: function handleReferralsFetchEligibleUsersStart() {
env3940[15] = true;
},
REFERRALS_FETCH_ELIGIBLE_USER_SUCCESS: function handleReferralsFetchEligibleUsersSuccess({ users, nextIndex }) {
env3940[15] = false;
env3940[14] = users;
env3940[16] = nextIndex;
},
REFERRALS_FETCH_ELIGIBLE_USER_FAIL: function handleReferralsFetchEligibleUsersFail() {
env3940[15] = false;
},
LOAD_MESSAGES_SUCCESS: handleLoadMessages,
MESSAGE_CREATE: function handleMessage({ message }) {
let env15585;
const r9 = env15585 = {
$parent: env3940
};
env15585[0] = void 0;
const r13 = message.type === MessageTypes.PREMIUM_REFERRAL ? message.content : null;
env15585[0] = r13;
if (r13 != null && !(env3940[10].has(r13) || env3940[9].has(r13))) {
env3940[9].add(r13);
Dispatcher.wait($mk78008(r9));
}
},
LOAD_MESSAGES_AROUND_SUCCESS: handleLoadMessages,
LOGOUT: function handleReset() {
env3940[5] = null;
env3940[6] = new Set();
env3940[8] = false;
env3940[9] = new Set();
env3940[10] = new Set();
env3940[11] = new Map();
env3940[12] = 0;
env3940[13] = null;
env3940[14] = [];
env3940[15] = false;
env3940[16] = 0;
env3940[17] = false;
env3940[18] = false;
env3940[19] = null;
env3940[7] = new Map();
env3940[20] = null;
}
});
export default r106;
@@ -0,0 +1,18 @@
// Metro module 7841 (f7842).
import UserStore from "../../stores/UserStore";
import { useStateFromStores } from "../../_bundle/Module589";
export function useIsInReverseTrial() {
return useStateFromStores([UserStore], () => {
const currentUser = UserStore.getCurrentUser();
let r6 = currentUser == null ? void 0 : currentUser.isOnReverseTrial();
if (r6 == null) {
r6 = false;
}
return r6;
});
}
export function useReverseTrialDaysRemaining() {
return 0;
}
export function maybeShowReverseTrialInitialUpsellModal() {}
export function maybeShowReverseTrialFollowupUpsellModal() {}
+7
View File
@@ -0,0 +1,7 @@
// Metro module 13120 (f13121).
export default class SKUListing {
constructor(a0, a1) {
this.skuId = a0;
this.skuFeatures = a1;
}
};
+93
View File
@@ -0,0 +1,93 @@
// Metro module 16323 (f16324).
import UserStore from "../../stores/UserStore";
import BillingInfoStore from "../../stores/billing/BillingInfoStore";
import SubscriptionStore from "../../stores/billing/SubscriptionStore";
import EntitlementStore from "../../stores/game_store/EntitlementStore";
import { PREMIUM_SUBSCRIPTION_APPLICATION, PremiumTypes } from "./PremiumConstants";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import * as _PremiumTypeUtils from "../../utils/PremiumTypeUtils";
import { isPremium } from "../../utils/PremiumTypeUtils";
import { fetchSubscriptions, fetchMostRecentSubscription, fetchIpCountryCode, fetchPaymentSources } from "../billing/actions/BillingActionCreators";
import { fetchUserEntitlementsForApplication } from "../../actions/EntitlementActionCreators";
class SubscriptionManager extends AutomaticLifecycleManager {
constructor() {
let c22969_0;
super(...arguments);
const _this = this;
this.actions = {
POST_CONNECTION_OPEN: () => {
_this.maybeFetchSubscriptions();
_this.maybeFetchCountryCode();
_this.maybeFetchMostRecentSubscription();
}
};
this.maybeFetchSubscriptions = async () => {
let c31028_1;
let c31813_0;
L30: {
L22: {
L23: {
c31028_1 = void 0;
c31813_0 = void 0;
if (!isPremium(UserStore.getCurrentUser())) {
break L30;
}
if (SubscriptionStore.hasFetchedSubscriptions() || BillingInfoStore.isSubscriptionFetching) {
c31813_0 = SubscriptionStore.getPremiumSubscription();
if (c31813_0?.paymentSourceId != null || EntitlementStore.applicationIdsFetched.has(PREMIUM_SUBSCRIPTION_APPLICATION)) {
break L30;
}
await fetchUserEntitlementsForApplication(PREMIUM_SUBSCRIPTION_APPLICATION);
break L22;
}
await fetchSubscriptions();
c31813_0 = SubscriptionStore.getPremiumSubscription();
if (c31813_0?.paymentSourceId != null || EntitlementStore.applicationIdsFetched.has(PREMIUM_SUBSCRIPTION_APPLICATION)) {
break L23;
}
await fetchUserEntitlementsForApplication(PREMIUM_SUBSCRIPTION_APPLICATION);
break L22;
}
return void 0;
}
return void 0;
}
};
this.maybeFetchMostRecentSubscription = () => {
const currentUser = UserStore.getCurrentUser();
let r7 = currentUser?.premiumType;
if (r7 == null) {
r7 = null;
}
const isPremiumAtMost = _PremiumTypeUtils.isPremiumAtMost(r7, PremiumTypes.TIER_1);
const isFetchingMostRecentSubscription = SubscriptionStore.getIsFetchingMostRecentSubscription();
if (currentUser != null && isPremiumAtMost && currentUser.hasHadPremium() && !isFetchingMostRecentSubscription) {
fetchMostRecentSubscription();
}
};
c22969_0 = this;
this.maybeFetchCountryCode = async () => {
L13: {
if (isPremium(UserStore.getCurrentUser()) && !BillingInfoStore.ipCountryCodeLoaded) {
await c22969_0.fetchCountryCode();
break L13;
}
return void 0;
}
};
this.fetchCountryCode = async () => {
let c31030_0;
L13: {
c31030_0 = void 0;
await fetchIpCountryCode();
if (BillingInfoStore.ipCountryCode != null) {
await fetchPaymentSources();
break L13;
}
return void 0;
}
};
}
}
const subscriptionManager = new SubscriptionManager();
export default subscriptionManager;
+307
View File
@@ -0,0 +1,307 @@
// Metro module 6504 (f6505).
import UserDiscountOfferRecord from "../user_offers/records/UserDiscountOfferRecord";
import { PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID } from "./PremiumConstants";
import { PaymentGateways, AnalyticEvents, Endpoints } from "../../Constants";
import { isAndroid, isIOS } from "../../utils/PlatformUtils";
import Dispatcher from "../../Dispatcher";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
import { HTTP } from "../../_bundle/sendRequest";
import { isAndroidTwoWeekTrialsExperimentEnabled } from "./experiments/AndroidTwoWeekTrialsExperiment";
import SentryUtils_native from "../../utils/SentryUtils.native";
import { UNSAFE_isDismissibleContentDismissed } from "../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../_bundle/Module1358";
import { removeDismissedContent } from "../user_settings/UserSettingsProtoActionCreators";
function $mk114999($env) {
return function getPaymentGateway() {
return isAndroid() ? PaymentGateways.GOOGLE : isIOS() ? PaymentGateways.APPLE : null;
};
}
let env4196 = {};
export async function fetchUserOffer(c25907_0, c25907_1, c25907_2, c25907_3, c25907_4) {
let r38;
let user_trial_offer, user_discount_offer, c25907_7, c25907_8, c25907_9;
let c25907_10 = 0;
const r13 = env4196;
L50: {
try {
let env29792;
L10: {
c25907_8 = r13;
const r36 = env29792 = {
$parent: r13
};
c25907_7 = r36;
env29792[1] = void 0;
env29792[2] = void 0;
env29792[3] = void 0;
env29792[4] = void 0;
env29792[0] = c25907_0;
if (c25907_1 !== void 0) {
env29792[1] = c25907_1;
r38 = c25907_2;
if (r38 !== void 0) {
break L10;
}
} else {
env29792[1] = true;
r38 = c25907_2;
if (r38 !== void 0) {
break L10;
}
}
r38 = {
offerId: void 0,
paymentGatewayOverride: void 0
};
}
env29792[2] = r38;
env29792[3] = c25907_3;
env29792[4] = c25907_4;
env29792[5] = void 0;
env29792[6] = void 0;
env29792[7] = void 0;
env29792[8] = void 0;
env29792[9] = void 0;
env29792[10] = void 0;
env29792[11] = void 0;
env29792[12] = void 0;
env29792[13] = void 0;
await void 0;
if (env29792[1]) {
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_FETCH_START"
});
c25907_10 = 1;
if (env29792[0] != null) {
AnalyticsUtils.track(AnalyticEvents.FETCH_USER_OFFER_STARTED, {
call_location: env29792[0]
});
}
env29792[5] = env29792[2].offerId;
env29792[6] = env29792[2].paymentGatewayOverride;
env29792[7] = env29792[6] !== void 0 ? env29792[6] : $mk114999(env4196)();
env29792[8] = env29792[7] == null && env29792[5] == null ? {} : {
payment_gateway: env29792[7],
offer_id: env29792[5]
};
const r125 = await HTTP.post({
url: Endpoints.USER_OFFER,
body: env29792[8],
rejectWithError: true,
retries: env29792[3] != null ? env29792[3].retries : void 0
});
const r135 = "Returned user discount offer does not match offer ID request parameter";
env29792[9] = r125;
const user_trial_offer2 = env29792[9].body.user_trial_offer;
user_trial_offer = user_trial_offer2;
if (user_trial_offer2 == null) {
user_trial_offer = null;
}
env29792[10] = user_trial_offer;
const user_discount_offer2 = env29792[9].body.user_discount_offer;
user_discount_offer = user_discount_offer2;
if (user_discount_offer2 == null) {
user_discount_offer = null;
}
env29792[11] = user_discount_offer;
env29792[12] = env29792[10]?.trial_id === PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID && !isAndroidTwoWeekTrialsExperimentEnabled({
location: "user_offer_action_creators"
});
if (env29792[5] != null && env29792[11] != null) {
if (env29792[11].discount_id !== env29792[5]) {
env29792[13] = new Error(r135);
SentryUtils_native.captureException(env29792[13], {
extra: {
offer_id: env29792[5],
user_discount_offer: env29792[11]
},
...env29792[4]
});
throw env29792[13];
}
}
if (env29792[10] == null && UNSAFE_isDismissibleContentDismissed(DismissibleContent.NAGBAR_NOTICE_PREMIUM_TIER_TWO_TRIAL_ENDING)) {
removeDismissedContent(DismissibleContent.NAGBAR_NOTICE_PREMIUM_TIER_TWO_TRIAL_ENDING);
}
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_FETCH_SUCCESS",
userTrialOffer: env29792[12] ? null : env29792[10],
userDiscountOffer: env29792[11] != null ? UserDiscountOfferRecord.createFromServer(env29792[11]) : null
});
c25907_10 = 0;
break L50;
}
} catch ($e) {
const r34 = $e;
let r8 = r34;
c25907_9 = r34;
if (c25907_10 !== 0) {
while (true) {
try {
c25907_10 = 0;
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_FETCH_FAIL"
});
} catch (r241) {
r8 = r241;
c25907_9 = r241;
if (c25907_10 === 0) {
break;
}
continue;
}
return false;
}
}
throw r8;
}
return false;
}
return true;
}
export async function fetchExistingChurnDiscountOffer() {
let r75;
let offer;
let c25908_4 = 0;
let c29793_0, c29793_1;
try {
c29793_0 = void 0;
c29793_1 = void 0;
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_FETCH_START"
});
c25908_4 = 1;
const offer3 = (await HTTP.get({
url: Endpoints.CHURN_USER_OFFER,
rejectWithError: true
})).body.offer;
offer = offer3;
if (offer3 == null) {
offer = null;
}
c29793_0 = offer;
c29793_1 = c29793_0 != null ? UserDiscountOfferRecord.createFromServer(c29793_0) : null;
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_FETCH_SUCCESS",
userDiscountOffer: c29793_1
});
r75 = {
userDiscountOffer: c29793_1
};
c25908_4 = 0;
} catch ($e) {
let r8 = $e;
if (c25908_4 !== 0) {
while (true) {
try {
c25908_4 = 0;
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_FETCH_FAIL"
});
} catch ($e) {
r8 = $e;
if (c25908_4 === 0) {
break;
}
continue;
}
return void 0;
}
}
throw r8;
}
return r75;
}
export async function fetchChurnDiscountOffer() {
let r70;
let offer2;
let c25909_4 = 0;
let c29794_1, c29794_0;
L14: {
try {
c29794_1 = void 0;
c29794_0 = null;
c25909_4 = 1;
const offer3 = (await HTTP.post({
url: Endpoints.CHURN_USER_OFFER,
rejectWithError: true
})).body.offer;
offer2 = offer3;
if (offer3 == null) {
offer2 = null;
}
c29794_1 = offer2;
if (c29794_1 != null) {
c29794_0 = UserDiscountOfferRecord.createFromServer(c29794_1);
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_FETCH_SUCCESS",
userDiscountOffer: c29794_0
});
}
c25909_4 = 0;
r70 = c29794_0;
} catch ($e) {
let r8 = $e;
if (c25909_4 !== 0) {
while (true) {
try {
c25909_4 = 0;
r70 = c29794_0;
break L14;
} catch ($e) {
r8 = $e;
if (c25909_4 === 0) {
break;
}
}
}
}
throw r8;
}
}
return r70;
}
export function acknowledgeUserOffer(a0, a1) {
const user_trial_offer_id = a0 != null ? a0.expires_at == null ? a0.id : void 0 : void 0;
const user_discount_offer_id = a1 == null ? void 0 : a1.hasAcknowledged() ? void 0 : a1.id;
if (user_trial_offer_id === void 0 && user_discount_offer_id === void 0) {
return void 0;
}
return HTTP.post({
url: Endpoints.USER_OFFER_ACKNOWLEDGED,
body: {
user_trial_offer_id,
user_discount_offer_id
},
oldFormErrors: true,
rejectWithError: false
}).then((result) => {
let user_discount = result.body.user_discount;
if (user_discount == null) {
user_discount = null;
}
let user_discount_offer2 = result.body.user_discount_offer;
if (user_discount_offer2 == null) {
user_discount_offer2 = null;
}
let user_trial_offer2 = result.body.user_trial_offer;
if (user_trial_offer2 == null) {
user_trial_offer2 = null;
}
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_ACKNOWLEDGED_SUCCESS",
userTrialOffer: user_trial_offer2,
userDiscount: user_discount != null ? UserDiscountOfferRecord.createFromServer(user_discount) : null,
userDiscountOffer: user_discount_offer2 != null ? UserDiscountOfferRecord.createFromServer(user_discount_offer2) : null
});
}).catch((error) => {
if (error.status === 404) {
Dispatcher.dispatch({
type: "BILLING_USER_OFFER_ACKNOWLEDGED_SUCCESS",
userTrialOffer: null,
userDiscount: null,
userDiscountOffer: null
});
}
});
}
@@ -0,0 +1,61 @@
// Metro module 6503 (f6504).
import { Endpoints, PaymentGateways } from "../../Constants";
import { HTTP, rejectWithMigratedError } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
const r19 = {
acknowledgeUserTrialOffer: async (c15773_0) => {
let c25906_2;
let c25906_3 = 0;
let c29791_0;
L13: {
try {
c29791_0 = void 0;
if (c15773_0.expires_at == null) {
c25906_3 = 1;
c29791_0 = (await HTTP.post({
url: Endpoints.USER_TRIAL_OFFER_ACKNOWLEDGED(c15773_0.id),
body: {
payment_gateway: PaymentGateways.GOOGLE
},
rejectWithError: rejectWithMigratedError()
})).body;
Dispatcher.dispatch({
type: "BILLING_USER_TRIAL_OFFER_ACKNOWLEDGED_SUCCESS",
userTrialOffer: c29791_0
});
c25906_3 = 0;
break L13;
}
} catch ($e) {
const r29 = $e;
let r8 = r29;
c25906_2 = r29;
if (c25906_3 !== 0) {
while (true) {
try {
const r84 = c25906_2;
c25906_3 = 0;
if (r84.status !== 404) {
break L13;
}
Dispatcher.dispatch({
type: "BILLING_USER_TRIAL_OFFER_ACKNOWLEDGED_SUCCESS",
userTrialOffer: null
});
break L13;
} catch (r82) {
r8 = r82;
c25906_2 = r82;
if (c25906_3 === 0) {
break;
}
}
}
}
throw r8;
}
return void 0;
}
}
};
export default r19;
@@ -0,0 +1,132 @@
// Metro module 3001 (f3002).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module3002 from "../../../_bundle/Module3002";
import * as _Module3003 from "../../../_bundle/Module3003";
import * as _Module3004 from "../../../_bundle/Module3004";
import * as _Module3005 from "../../../_bundle/Module3005";
import * as _Module3006 from "../../../_bundle/Module3006";
import * as _Module3007 from "../../../_bundle/Module3007";
import * as _Module3008 from "../../../_bundle/Module3008";
import * as _Module3009 from "../../../_bundle/Module3009";
import * as _Module3010 from "../../../_bundle/Module3010";
import * as _Module3011 from "../../../_bundle/Module3011";
import * as _Module3012 from "../../../_bundle/Module3012";
import * as _Module3013 from "../../../_bundle/Module3013";
import * as _Module3014 from "../../../_bundle/Module3014";
import * as _Module3015 from "../../../_bundle/Module3015";
import * as _Module3016 from "../../../_bundle/Module3016";
import * as _Module3017 from "../../../_bundle/Module3017";
import * as _Module3018 from "../../../_bundle/Module3018";
import * as _Module3019 from "../../../_bundle/Module3019";
import * as _Module3020 from "../../../_bundle/Module3020";
import * as _Module3021 from "../../../_bundle/Module3021";
import * as _Module3022 from "../../../_bundle/Module3022";
import * as _Module3023 from "../../../_bundle/Module3023";
import * as _Module3024 from "../../../_bundle/Module3024";
import * as _Module3025 from "../../../_bundle/Module3025";
import * as _Module3026 from "../../../_bundle/Module3026";
import * as _Module3027 from "../../../_bundle/Module3027";
import * as _Module3028 from "../../../_bundle/Module3028";
import * as _Module3029 from "../../../_bundle/Module3029";
import * as _Module3030 from "../../../_bundle/Module3030";
import * as _Module3031 from "../../../_bundle/Module3031";
import * as _Module3032 from "../../../_bundle/Module3032";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module3002).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module3003).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module3004).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module3005).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module3006).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module3007).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module3008).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module3009).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module3010).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module3011).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module3012).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module3013).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module3014).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module3015).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module3016).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module3017).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module3018).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module3019).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module3020).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module3021).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module3022).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module3023).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module3024).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module3025).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module3026).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module3027).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module3028).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module3029).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module3030).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module3031).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module3032).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,30 @@
// Metro module 8427 (f8428).
import { memo } from "react";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { NitroWheelIcon } from "../../../../design/components/Icon/native/redesign/generated/NitroWheelIcon";
import Module712 from "../../../../_bundle/Module712";
const r22 = memo(function NitroUpsellButton(props) {
const { loading, onPress, text } = props;
let shiny = props.shiny;
if (shiny === void 0) {
shiny = true;
}
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const props2 = {
text,
size: "lg",
loading,
onPress,
icon: <NitroWheelIcon color={Module712.colors.WHITE} size="sm" />,
variant: "experimental_premium-primary",
shiny: null
};
if (shiny) {
shiny = !stateFromStores;
}
props2.shiny = shiny;
return <Button {...props2} />;
});
export default r22;
@@ -0,0 +1,18 @@
// Metro module 1938 (f1939).
import { DEFAULT_ROLE_COLOR_HEX } from "../../../Constants";
import { int2hex } from "../../../_bundle/int2hslRaw";
export function extractColorStringsFromServerColors(a0) {
return {
primaryColor: a0.primary_color === 0 ? DEFAULT_ROLE_COLOR_HEX : int2hex(a0.primary_color),
secondaryColor: a0.secondary_color == null ? null : int2hex(a0.secondary_color),
tertiaryColor: a0.tertiary_color == null ? null : int2hex(a0.tertiary_color)
};
}
export function getAuthorHasGradientRole(a0) {
return a0 != null && (a0.colorStrings != null && a0.colorStrings.primaryColor != null && a0.colorStrings.secondaryColor != null);
}
export function getIsDefaultErc(a0) {
const color = a0.color;
const r1 = a0.colors != null && a0.colors.primary_color === 0 && a0.colors.secondary_color == null && a0.colors.tertiary_color == null;
return color === 0 || r1;
}
@@ -0,0 +1,79 @@
// Metro module 7744 (f7745).
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { useMemo } from "react";
import { processColor } from "react-native";
import ThemeStore from "../../../user_settings/ThemeStore";
import { ThemeTypes } from "../../../../_bundle/Module505";
import Module689 from "../../../../_bundle/Module689";
import { isNotNullish } from "../../../../utils/GlobalUtils";
import useHasEnhancedRoleColors, { getHasEnhancedRoleColors } from "../../powerups/hooks/useHasEnhancedRoleColors";
const processColorStrings = function processColorStrings(a0) {
let primaryColor2, secondaryColor2, tertiaryColor2;
if (a0 != null) {
let primaryColor = a0.primaryColor;
if (ThemeStore.theme === ThemeTypes.LIGHT && primaryColor != null) {
const r22 = _slicedToArray(Module689(primaryColor).hsl(), 3);
primaryColor2 = processColor(Module689.hsl(r22[0], r22[1], 0.85 * r22[2]).hex());
} else {
if (primaryColor == null) {
primaryColor = void 0;
}
primaryColor2 = processColor(primaryColor);
}
let secondaryColor = a0.secondaryColor;
if (ThemeStore.theme === ThemeTypes.LIGHT && secondaryColor != null) {
const r14 = _slicedToArray(Module689(secondaryColor).hsl(), 3);
secondaryColor2 = processColor(Module689.hsl(r14[0], r14[1], 0.85 * r14[2]).hex());
} else {
if (secondaryColor == null) {
secondaryColor = void 0;
}
secondaryColor2 = processColor(secondaryColor);
}
let tertiaryColor = a0.tertiaryColor;
if (ThemeStore.theme === ThemeTypes.LIGHT && tertiaryColor != null) {
const r77 = _slicedToArray(Module689(tertiaryColor).hsl(), 3);
tertiaryColor2 = processColor(Module689.hsl(r77[0], r77[1], 0.85 * r77[2]).hex());
} else {
if (tertiaryColor == null) {
tertiaryColor = void 0;
}
tertiaryColor2 = processColor(tertiaryColor);
}
return {
primaryColor: primaryColor2,
secondaryColor: secondaryColor2,
tertiaryColor: tertiaryColor2
};
}
};
export { processColorStrings };
export function processColorStringsArray(a0) {
if (a0 == null) {
return [];
}
const r6 = processColorStrings(a0);
return [r6.primaryColor, r6.secondaryColor, r6.tertiaryColor].filter(isNotNullish);
}
export function useProcessColorStringsArray(a0) {
const r9 = [a0?.primaryColor, a0?.secondaryColor, ,];
const tertiaryColor = a0?.tertiaryColor;
const r13 = () => {
let r17;
if (a0 == null) {
r17 = [];
} else {
const r7 = processColorStrings(a0);
r17 = [r7.primaryColor, r7.secondaryColor, r7.tertiaryColor].filter(isNotNullish);
}
return r17;
};
r9[2] = tertiaryColor;
return useMemo(r13, r9);
}
export function isNativeMessageEligibleForEnhancedRoleColors(a0, a1) {
return getHasEnhancedRoleColors(a0, a1);
}
export function useIsRoleStyleAndRoleColorsEligibleForERC(a0, a1, a2, a3) {
return useHasEnhancedRoleColors(a0, a1) && a2 === "username" && a3.length > 1;
}
@@ -0,0 +1,31 @@
// Metro module 6245 (f6246).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-android-two-week-trials",
kind: "user",
defaultConfig: {
enabled: false,
trialCTAEnabled: false
},
variations: {
1: {
enabled: true,
trialCTAEnabled: true
},
2: {
enabled: true,
trialCTAEnabled: false
}
}
});
export { apexExperiment as AndroidTwoWeekTrialsExperiment };
export function isAndroidTwoWeekTrialsExperimentEnabled(a0) {
return apexExperiment.getConfig({
location: a0.location
}).enabled;
}
export function isAndroidTwoWeekTrialsTrialCTAEnabled(a0) {
return apexExperiment.getConfig({
location: a0.location
}).trialCTAEnabled;
}
@@ -0,0 +1,21 @@
// Metro module 12501 (f12502).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-03-bogo-promotion-marketing-materials-v2",
kind: "user",
defaultConfig: false,
variations: {
1: true
}
});
export default apexExperiment;
export function useBogoMarketingMaterialsEnabled(a0) {
return apexExperiment.useConfig({
location: a0
});
}
export function getBogoMarketingMaterialsEnabled(a0) {
return apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,21 @@
// Metro module 12499 (f12500).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-03-bogo-promotion-gate-v2",
kind: "user",
defaultConfig: false,
variations: {
1: true
}
});
export default apexExperiment;
export function useBogoPromotionGateEnabled(a0) {
return apexExperiment.useConfig({
location: a0
});
}
export function getBogoPromotionGateEnabled(a0) {
return apexExperiment.getConfig({
location: a0
});
}
@@ -0,0 +1,22 @@
// Metro module 13121 (f13122).
import { createApexExperiment } from "../../experiments/apex/index";
const r13 = {
CONTROL: 0,
0: "CONTROL",
DUAL_READ_RETURN_OLD: 1,
1: "DUAL_READ_RETURN_OLD",
DUAL_READ_RETURN_NEW: 2,
2: "DUAL_READ_RETURN_NEW"
};
const apexExperiment = createApexExperiment({
name: "2026-03-denormalized-perks-access-read",
kind: "user",
defaultConfig: r13.CONTROL,
variations: {
0: r13.CONTROL,
1: r13.DUAL_READ_RETURN_OLD,
2: r13.DUAL_READ_RETURN_NEW
}
});
export default apexExperiment;
export { r13 as DenormalizedPerksReadConfig };
@@ -0,0 +1,23 @@
// Metro module 6180 (f6181).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
kind: "user",
name: "2026-06-friendship-anniversary-backend-persistence",
defaultConfig: {
enabled: false
},
variations: {
0: {
enabled: false
},
1: {
enabled: true
}
}
});
export { apexExperiment as FriendshipAnniversaryBackendPersistenceExperiment };
export function isFriendshipAnniversaryBackendPersistenceEnabled(a0) {
return apexExperiment.getConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,25 @@
// Metro module 12444 (f12445).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-macaron",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export function useMobileNitroManageSubscriptionsSettingsExperiment(a0) {
return apexExperiment.useConfig({
location: a0.location
}).enabled;
}
export function getMobileNitroManageSubscriptionsSettingsExperiment(a0) {
return apexExperiment.getConfig({
location: a0.location
}).enabled;
}
@@ -0,0 +1,22 @@
// Metro module 11918 (f11919).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2025-12-katsudon",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
0: {
enabled: false
},
1: {
enabled: true
}
}
});
export default function usePremiumGroupExperiment(a0) {
return apexExperiment.useConfig({
location: a0.location
}).enabled;
};
@@ -0,0 +1,20 @@
// Metro module 6215 (f6216).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-02-premium-offer-reminder-xp",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as PremiumOfferReminderExperiment };
export function isPremiumOfferReminderExperimentEnabled(a0) {
return apexExperiment.getConfig({
location: a0.location
}).enabled;
}
@@ -0,0 +1,15 @@
// Metro module 15779 (f15780).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2025-09-premium-trial-offer-action-sheet-ks",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as PremiumTrialOfferActionSheetKillSwitchExperiment };
@@ -0,0 +1,20 @@
// Metro module 7842 (f7843).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-02-referral-reminder-dc",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export { apexExperiment as ReferralReminderDCExperiment };
export function useIsReferralReminderDCExperimentEnabled(a0) {
return apexExperiment.useConfig({
location: a0.location
}).enabled;
}
@@ -0,0 +1,63 @@
// Metro module 12547 (f12548).
import { TouchableOpacity, View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
let useStyles;
const handlePress = function handlePress() {
ActionSheetActionCreators.openLazy(import("./NitroCreditEducationActionSheet"), "NitroCreditEducationActionSheet", {
aboutText: intl.string(t["07lzz7"])
});
};
useStyles = createStyles({
fractionalPremiumBanner: {
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
flexDirection: "row",
gap: 12,
padding: 12,
justifyContent: "center",
borderColor: Module712.colors.STATUS_WARNING,
borderWidth: 1,
borderRadius: Module712.radii.lg,
marginBottom: 12
},
fpDurationPill: {
flex: 1,
paddingVertical: 12,
paddingHorizontal: 27,
backgroundColor: Module712.colors.BACKGROUND_MOD_STRONG,
borderRadius: Module712.radii.xxl,
justifyContent: "center"
},
fpDurationText: {
textAlign: "center",
color: "#FFEAA0"
},
fpUnavailable: {
flex: 1,
justifyContent: "center"
},
fpUnavailableTextNoCountdown: {
textAlign: "center"
}
});
export default function BoostingCountDownPill(props) {
const { fpDurationText, isInReverseTrial, style } = props;
const styles = useStyles();
return <TouchableOpacity activeOpacity={0.7} onPress={isInReverseTrial ? void 0 : handlePress}>
<View style={[styles.fractionalPremiumBanner, style]}>
{isInReverseTrial ? !isInReverseTrial : <View style={styles.fpDurationPill}>
<Text variant="text-sm/bold" style={styles.fpDurationText}>
{fpDurationText.toUpperCase()}
</Text>
</View>}
<View style={styles.fpUnavailable}>
<Text variant="text-md/normal" color="interactive-text-active" style={isInReverseTrial ? styles.fpUnavailableTextNoCountdown : void 0}>
{intl.string(t["5nrJDO"])}
</Text>
</View>
</View>
</TouchableOpacity>;
};
@@ -0,0 +1,50 @@
// Metro module 12493 (f12494).
import { TouchableOpacity, View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import { intl, t } from "../../../../intl/index.native";
import { CircleInformationIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleInformationIcon";
import { Text } from "../../../../design/components/Text/native/Text";
const useStyles = createStyles({
largeCountdownPill: {
flexDirection: "row",
justifyContent: "center",
alignItems: "center",
borderRadius: Module712.radii.round,
backgroundColor: "rgba(255, 255, 255, 0.1)",
alignSelf: "center",
paddingHorizontal: 16,
marginBottom: 10
},
largeCountdownPillText: {
paddingVertical: 8,
color: Module712.colors.TEXT_STATUS_IDLE,
fontSize: 14,
lineHeight: 16,
marginRight: 8
},
iconStyle: {
width: 16,
height: 16
}
});
export default function LargeCountDownPill(props) {
const countdownText = props.countdownText;
const styles = useStyles();
return <TouchableOpacity onPress={function onPress() {
ToastActionCreators.open({
key: "LARGE_COUNTDOWN_PILL_TOAST",
content: intl.string(t["Mv4E/M"]),
icon: () => <CircleInformationIcon style={styles.iconStyle} color={Module712.colors.STATUS_WARNING} />,
iconColor: Module712.colors.STATUS_WARNING
});
}}>
<View style={styles.largeCountdownPill}>
<Text variant="text-xs/bold" style={styles.largeCountdownPillText}>
{countdownText.toUpperCase()}
</Text>
<CircleInformationIcon style={styles.iconStyle} color={Module712.colors.TEXT_STATUS_IDLE} />
</View>
</TouchableOpacity>;
};
@@ -0,0 +1,54 @@
// Metro module 12548 (f12549).
import { View } from "react-native";
import { HelpdeskArticles } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { CircleErrorIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleErrorIcon";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import HelpdeskUtils from "../../../../utils/HelpdeskUtils";
const useStyles = createStyles({
container: {
marginTop: 32,
marginHorizontal: 30
},
aboutContainer: {
flexDirection: "row",
backgroundColor: Module712.colors.BACKGROUND_MOD_SUBTLE,
justifyContent: "center",
borderRadius: Module712.radii.lg,
marginBottom: 12
},
warningIcon: {
margin: 16
},
aboutTextContainer: {
justifyContent: "center",
flex: 1,
marginRight: 30
},
helpdeskText: {
textAlign: "center",
marginBottom: 24
}
});
export default function NitroCreditEducationActionSheet(props) {
const aboutText = props.aboutText;
const styles = useStyles();
return <BottomSheet>
<View style={styles.container}>
<View style={styles.aboutContainer}>
<CircleErrorIcon size="lg" style={styles.warningIcon} />
<View style={styles.aboutTextContainer}>
<Text variant="text-sm/medium" color="text-overlay-light">{aboutText}</Text>
</View>
</View>
<Text variant="text-sm/medium" color="text-overlay-light" style={styles.helpdeskText}>
{intl.format(t.bg3jBj, {
helpCenterLink: HelpdeskUtils.getArticleURL(HelpdeskArticles.FRACTIONAL_PREMIUM_ABOUT)
})}
</Text>
</View>
</BottomSheet>;
};
@@ -0,0 +1,132 @@
// Metro module 2645 (f2646).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module2646 from "../../../_bundle/Module2646";
import * as _Module2647 from "../../../_bundle/Module2647";
import * as _Module2648 from "../../../_bundle/Module2648";
import * as _Module2649 from "../../../_bundle/Module2649";
import * as _Module2650 from "../../../_bundle/Module2650";
import * as _Module2651 from "../../../_bundle/Module2651";
import * as _Module2652 from "../../../_bundle/Module2652";
import * as _Module2653 from "../../../_bundle/Module2653";
import * as _Module2654 from "../../../_bundle/Module2654";
import * as _Module2655 from "../../../_bundle/Module2655";
import * as _Module2656 from "../../../_bundle/Module2656";
import * as _Module2657 from "../../../_bundle/Module2657";
import * as _Module2658 from "../../../_bundle/Module2658";
import * as _Module2659 from "../../../_bundle/Module2659";
import * as _Module2660 from "../../../_bundle/Module2660";
import * as _Module2661 from "../../../_bundle/Module2661";
import * as _Module2662 from "../../../_bundle/Module2662";
import * as _Module2663 from "../../../_bundle/Module2663";
import * as _Module2664 from "../../../_bundle/Module2664";
import * as _Module2665 from "../../../_bundle/Module2665";
import * as _Module2666 from "../../../_bundle/Module2666";
import * as _Module2667 from "../../../_bundle/Module2667";
import * as _Module2668 from "../../../_bundle/Module2668";
import * as _Module2669 from "../../../_bundle/Module2669";
import * as _Module2670 from "../../../_bundle/Module2670";
import * as _Module2671 from "../../../_bundle/Module2671";
import * as _Module2672 from "../../../_bundle/Module2672";
import * as _Module2673 from "../../../_bundle/Module2673";
import * as _Module2674 from "../../../_bundle/Module2674";
import * as _Module2675 from "../../../_bundle/Module2675";
import * as _Module2676 from "../../../_bundle/Module2676";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2646).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2647).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2648).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2649).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2650).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2651).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2652).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2653).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2654).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2655).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2656).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2657).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2658).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2659).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2660).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2661).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2662).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2663).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2664).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2665).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2666).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2667).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2668).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2669).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2670).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2671).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2672).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2673).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2674).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2675).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2676).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,329 @@
// Metro module 11574 (f11575).
import LocaleStore from "../../user_settings/LocaleStore";
import UserStore from "../../../stores/UserStore";
import OwnedGameServersStore from "./OwnedGameServersStore";
import { GAME_SERVER_COLLECTION_ID } from "./GameServerConstants";
import { AnalyticEvents, Endpoints } from "../../../Constants";
import Dispatcher from "../../../Dispatcher";
import { GAME_SERVER_GAME_MOCKS, GAME_SERVER_INSTANCE_MOCKS } from "./mocks/GameServerMocks";
import { httpGetWithCountryCodeQuery } from "../../../utils/StoreUtils";
import { rejectWithMigratedError, HTTP } from "../../../_bundle/sendRequest";
import { productToGameServerGame } from "./utils/productToGameServerGame";
import gameServerResponseToInstance from "./utils/gameServerResponseToInstance";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import regionResponseToRegion from "./utils/regionResponseToRegion";
import { GameServerStatus } from "../../../_bundle/Module11577";
let $mk87645 = function() {
return (a0) => {
let game_servers = a0.body.game_servers;
if (game_servers == null) {
game_servers = [];
}
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_MY_SERVERS_SUCCESS",
gameServers: game_servers
});
};
};
export function fetchGameServerCatalog(a0) {
const guildId = a0;
let r5 = arguments[1];
if (r5 === void 0) {
r5 = false;
}
if (r5) {
setTimeout(() => {
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_CATALOG_SUCCESS",
guildId,
catalog: GAME_SERVER_GAME_MOCKS.reduce((acc, item) => {
acc[item.id] = item;
return acc;
}, {})
});
}, 5000);
return void 0;
}
const currentUser = UserStore.getCurrentUser();
let include_unpublished_products = currentUser == null ? void 0 : currentUser.isStaff();
if (include_unpublished_products == null) {
include_unpublished_products = false;
}
return httpGetWithCountryCodeQuery({
url: Endpoints.STOREFRONT_COLLECTION_WITH_PRODUCTS(GAME_SERVER_COLLECTION_ID),
query: {
locale: LocaleStore.locale,
guild_id: a0,
include_unpublished_products,
include_unpublished_collection: include_unpublished_products
},
oldFormErrors: true,
rejectWithError: rejectWithMigratedError(),
retries: 2
}).then((result) => {
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_CATALOG_SUCCESS",
guildId,
catalog: result.body.products.reduce((acc, product) => {
const r9 = productToGameServerGame(product);
acc[r9.id] = r9;
return acc;
}, {})
});
});
}
export function fetchGameServerGlobalCatalog() {
const currentUser = UserStore.getCurrentUser();
let include_unpublished_products = currentUser == null ? void 0 : currentUser.isStaff();
if (include_unpublished_products == null) {
include_unpublished_products = false;
}
return httpGetWithCountryCodeQuery({
url: Endpoints.STOREFRONT_COLLECTION_WITH_PRODUCTS(GAME_SERVER_COLLECTION_ID),
query: {
locale: LocaleStore.locale,
include_unpublished_products,
include_unpublished_collection: include_unpublished_products
},
oldFormErrors: true,
rejectWithError: rejectWithMigratedError(),
retries: 2
}).then((result) => {
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_GLOBAL_CATALOG_SUCCESS",
catalog: result.body.products.reduce((acc, product) => {
const r9 = productToGameServerGame(product);
acc[r9.id] = r9;
return acc;
}, {})
});
});
}
export function fetchGameServerInstances(a0) {
let r21;
const guildId2 = a0;
let r3 = arguments[1];
if (r3 === void 0) {
r3 = false;
}
if (r3) {
setTimeout(() => {
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_INSTANCES_SUCCESS",
guildId: guildId2,
instances: GAME_SERVER_INSTANCE_MOCKS.reduce((acc, item) => {
acc[item.id] = item;
return acc;
}, {})
});
}, 5000);
r21 = Promise.resolve();
} else {
const signal = arguments[2];
r21 = HTTP.get({
url: Endpoints.GAME_SERVERS(a0),
rejectWithError: true,
retries: 2,
signal
}).then((result) => {
if (result.body != null) {
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_INSTANCES_SUCCESS",
guildId: guildId2,
instances: result.body.reduce((acc, item) => {
acc[item.id] = gameServerResponseToInstance(item);
return acc;
}, {})
});
}
});
}
return r21;
}
export function fetchGameServerInstructions(guildId3, a1) {
const skuId = a1;
return httpGetWithCountryCodeQuery({
url: Endpoints.STOREFRONT_PRODUCT_BY_SKU_ID(a1),
query: {
locale: LocaleStore.locale
},
rejectWithError: true,
retries: 3
}).then((result) => {
if (result.body != null) {
const tenant_metadata = result.body.tenant_metadata;
const r2 = tenant_metadata == null;
let instructions = void 0;
if (!r2) {
const guild_monetization = tenant_metadata.guild_monetization;
const r12 = guild_monetization == null;
instructions = void 0;
if (!r12) {
const game_server = guild_monetization.game_server;
instructions = game_server == null ? void 0 : game_server.instructions.pc;
}
}
if (instructions == null) {
instructions = [];
}
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_GAME_INSTRUCTIONS_SUCCESS",
guildId: guildId3,
skuId,
instructions
});
}
});
}
export function acceptGameServerToS(a0, a1) {
if (a0) {
AnalyticsUtils.track(AnalyticEvents.GAME_SERVER_HOSTING_THIRD_PARTY_CONSENT_ACCEPTED, {
user_id: UserStore.getCurrentUser()?.id,
provider: a1
});
}
}
export function resetGameServerRegionState() {
Dispatcher.dispatch({
type: "GAME_SERVER_REGION_PING_STATE_RESET"
});
}
export function updateGameServerRegionPingState(a0, a1) {
Dispatcher.dispatch({
type: "GAME_SERVER_REGION_PING_STATE_UPDATE",
pingUrl: a0,
state: a1
});
}
export function enableGameServerForGuild(a0, a1, a2, a3) {
return HTTP.post({
url: Endpoints.GUILD_POWERUP_TOGGLE(a0, a1),
body: {
game_server_name: a2,
game_server_region: a3
},
rejectWithError: true,
oldFormErrors: true
});
}
export function updateGameServerForGuild(a0, a1, a2, a3) {
return HTTP.patch({
url: Endpoints.GUILD_POWERUP_UPDATE(a0, a1),
body: {
game_server_name: a3,
sku_id: a2
},
rejectWithError: true,
oldFormErrors: true
});
}
export function disableGameServerForGuild(a0, a1, a2) {
return HTTP.del({
url: Endpoints.GUILD_POWERUP_TOGGLE(a0, a1),
query: {
entitlement_id: a2
},
rejectWithError: true,
oldFormErrors: true
});
}
export function fetchGameServerRegions(a0) {
return HTTP.get({
url: Endpoints.GAME_SERVER_REGIONS(a0),
rejectWithError: true,
oldFormErrors: true,
retries: 3
}).then((result) => {
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_REGIONS_SUCCESS",
regions: result.body.map(regionResponseToRegion).sort((a, b) => a.name.localeCompare(b.name))
});
});
}
export function fetchMyGameServerRegions() {
return HTTP.get({
url: Endpoints.GAME_SERVER_MY_REGIONS,
rejectWithError: true,
oldFormErrors: true,
retries: 3
}).then((result) => {
Dispatcher.dispatch({
type: "GAME_SERVER_FETCH_REGIONS_SUCCESS",
regions: result.body.regions.map(regionResponseToRegion).sort((a, b) => a.name.localeCompare(b.name)),
creationDisabled: result.body.creation_disabled === true
});
});
}
export function fetchMyGameServers() {
return HTTP.get({
url: Endpoints.GAME_SERVERS_ME,
rejectWithError: true,
oldFormErrors: true,
retries: 3
}).then($mk87645());
}
export function optimisticallyMarkGameServerResizing(c18995_0) {
const r7 = OwnedGameServersStore.getGameServers().find((item) => item.subscription_id === c18995_0);
if (r7 != null) {
Dispatcher.dispatch({
type: "GAME_SERVER_UPDATE",
guildId: void 0,
gameServer: {
...r7,
status: GameServerStatus.STARTING
}
});
}
}
export function updateMyGameServerName(c18996_0, a1) {
let r40;
const r5 = OwnedGameServersStore.getGameServers().find((item) => item.subscription_id === c18996_0);
if (r5 == null) {
r40 = Promise.resolve();
} else {
Dispatcher.dispatch({
type: "GAME_SERVER_UPDATE",
guildId: void 0,
gameServer: {
...r5,
name: a1
}
});
r40 = HTTP.patch({
url: Endpoints.GAME_SERVER_ME(r5.id),
body: {
name: a1
},
rejectWithError: true
}).then(() => {
HTTP.get({
url: Endpoints.GAME_SERVERS_ME,
rejectWithError: true,
oldFormErrors: true,
retries: 3
}).then($mk87645()).catch(() => {});
}).catch((error) => {
HTTP.get({
url: Endpoints.GAME_SERVERS_ME,
rejectWithError: true,
oldFormErrors: true,
retries: 3
}).then($mk87645()).catch(() => {});
throw error;
});
}
return r40;
}
export function wakeGameServer(a0, a1) {
const guildId4 = a0;
return HTTP.post({
url: Endpoints.GAME_SERVER_WAKE(a0, a1),
rejectWithError: true
}).then((result) => {
Dispatcher.dispatch({
type: "GAME_SERVER_UPDATE_INSTANCE_SUCCESS",
guildId: guildId4,
instance: gameServerResponseToInstance(result.body)
});
});
}
@@ -0,0 +1,74 @@
// Metro module 4078 (f4079).
import { Environments } from "../../user/UserStoreConstants";
import { GameServerProviderType } from "../../../_bundle/Module4079";
const r12 = {
SELECT_GAME: "select-game",
SERVER_SETTINGS: "server-settings"
};
const steps = {};
steps[r12.SELECT_GAME] = {
onBack: {
type: "close"
},
onNext: {
type: "go-to-step",
step: r12.SERVER_SETTINGS
}
};
steps[r12.SERVER_SETTINGS] = {
onBack: {
type: "go-to-step",
step: r12.SELECT_GAME
},
onNext: {
type: "save"
}
};
const r11 = {
steps
};
const r10 = window.GLOBAL_ENV.PROJECT_ENV !== "production" ? window.GLOBAL_ENV.PROJECT_ENV === "staging" ? "1415044199572832256" : "1415025086791942144" : "1425215263548117002";
const r43 = window.GLOBAL_ENV.PROJECT_ENV === "production" ? "1361763069696675961" : "1486428380437020672";
const r47 = window.GLOBAL_ENV.PROJECT_ENV !== "production" ? window.GLOBAL_ENV.PROJECT_ENV === "staging" ? "356875570916753438" : "1" : "1402418491272986635";
const r56 = window.GLOBAL_ENV.PROJECT_ENV !== "production" ? window.GLOBAL_ENV.PROJECT_ENV === "staging" ? "1458563423670501376" : "2" : "1458530944955973852";
export class NewGamesCoachmarkContent {
constructor() {
return {
__proto__: new.target.prototype
};
}
}
NewGamesCoachmarkContent.prototype;
NewGamesCoachmarkContent.FEATURED_PRODUCT_ID = window.GLOBAL_ENV.PROJECT_ENV === "production" ? "1497100850261131334" : "1497097140001046528";
NewGamesCoachmarkContent.FEATURED_GAME_ID = window.GLOBAL_ENV.PROJECT_ENV === "production" ? "1440133627899023452" : "1497095960202051584";
NewGamesCoachmarkContent.FEATURED_GAME_NAME = "Windrose";
NewGamesCoachmarkContent.SECOND_GAME_NAME = "Factorio";
NewGamesCoachmarkContent.THIRD_GAME_NAME = "V Rising";
const r74 = {
SHOCKBYTE: 0,
0: "SHOCKBYTE"
};
const SHOCKBYTE = GameServerProviderType.SHOCKBYTE;
const r84 = window.GLOBAL_ENV.RELEASE_CHANNEL === Environments.STAGING ? "https://purple-prod.shockbyte.dev/support" : "https://discord.shockbyte.com/support";
const r85 = {};
r85[SHOCKBYTE] = r84;
const r86 = {};
r86[GameServerProviderType.SHOCKBYTE] = "https://shockbyte.com/legal/acceptable-use-policy";
export { r12 as GameServerSetupStep };
export { r11 as GAME_SERVER_DEFAULT_STEP_CONFIG };
export const GAME_SERVER_SLIDE_PADDING = 24;
export const GAME_SERVER_SLIDE_WIDTH = 680;
export const GAME_SERVER_SLIDE_CONTENT_WIDTH = 632;
export const GAME_SERVER_MAX_INSTANCES = 10;
export const GAME_SERVER_MAX_SERVERS_PER_USER = 5;
export const GAME_SERVER_MAX_NAME_LENGTH = 32;
export const GAME_SERVER_MIN_DELAY_TIME_MS = 1000;
export { r10 as GAME_SERVER_COLLECTION_ID };
export { r43 as RUNESCAPE_GAME_ID };
export { r47 as MINECRAFT_GAME_ID };
export { r56 as HYTALE_GAME_ID };
export { r74 as GameServerGameProvider };
export { r85 as GAME_SERVER_SUPPORT_URLS };
export { r86 as GAME_SERVER_TOS };
export const GAME_SERVER_SURVEY_URL = (a0, a1) => `https://discord.sjc1.qualtrics.com/jfe/form/SV_2h34PnQLPTCjTTM?user_id=${a0}&guild_id=${a1}`;
export const GAME_SERVER_POWERUP_SKU_ID = "0";
@@ -0,0 +1,34 @@
// Metro module 4100 (f4101).
import { createExperiment } from "../../experiments/index";
const experiment = createExperiment({
kind: "guild",
id: "2025-08_portkey_enabled",
label: "GameServer Enabled",
defaultConfig: {
enabled: false
},
treatments: [{
id: 1,
label: "Enable GameServer",
config: {
enabled: true
}
}]
});
export { experiment as GameServerExperiment };
export function getGameServerEnabled(a0, a1) {
return experiment.getCurrentConfig({
guildId: a0,
location: a1
}, {
autoTrackExposure: false
}).enabled;
}
export function useGameServerEnabled(a0, a1) {
return experiment.useExperiment({
guildId: a0,
location: a1
}, {
autoTrackExposure: false
}).enabled;
}
@@ -0,0 +1,314 @@
// Metro module 4097 (f4098).
import getPowerupEntitlementPrice from "../powerups/utils/getPowerupEntitlementPrice";
import gameServerResponseToInstance from "./utils/gameServerResponseToInstance";
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c2360_2, c2360_3, c2360_4, $mk73585 = function() {
return (a0, a1) => {
let r8 = getPowerupEntitlementPrice(a1);
if (r8 == null) {
r8 = 0;
}
return a0 + r8;
};
};
const handleGameServerInstanceCreated = function handleGameServerInstanceCreated({ guildId, gameServer }) {
if (guildId != null) {
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
const r6 = c2360_3[guildId];
const r19 = {
...c2360_3
};
const instances = {
...r6.instances
};
instances[gameServer.id] = gameServerResponseToInstance(gameServer);
r19[guildId] = {
...r6,
instances
};
c2360_3 = r19;
}
};
c2360_2 = 86400000;
c2360_3 = {};
c2360_4 = {
catalog: {},
hasFetchedCatalog: false,
catalogLastFetchedAt: void 0
};
class GameServerStore extends Module589.PersistedStore {
static displayName = "GameServerStore";
static persistKey = "GameServerStore";
initialize(a0) {
if (a0 != null) {
c2360_3 = a0;
}
}
getState() {
return c2360_3;
}
getStateForGuild(a0) {
return a0 != null ? c2360_3[a0] : void 0;
}
getGlobalCatalogState() {
return c2360_4;
}
getGlobalCatalogGame(c13847_0) {
return Object.values(c2360_4.catalog).find((item) => item.gameId === c13847_0);
}
getLowestGameCostForGuild(a0) {
if (a0 == null) {
return null;
}
const r8 = c2360_3[a0];
const r7 = Object;
let r15 = r8?.catalog;
if (r15 == null) {
r15 = {};
}
const r9 = r7.values(r15);
const length = r9.length;
let r17 = null;
if (length !== 0) {
const r18 = Math;
r17 = r18.min.apply(r18, [...r9.map((item) => item.baseCost)]);
}
return r17;
}
hasFetchedCatalog(a0) {
return a0 != null && c2360_3[a0]?.hasFetchedCatalog === true;
}
hasFetchedInstances(a0) {
return a0 != null && c2360_3[a0]?.hasFetchedInstances === true;
}
shouldFetchCatalogForGuild(a0) {
const catalogLastFetchedAt = c2360_3[a0]?.catalogLastFetchedAt;
return catalogLastFetchedAt == null || catalogLastFetchedAt + c2360_2 < Date.now();
}
shouldFetchInstancesForGuild(a0) {
const instancesLastFetchedAt = c2360_3[a0]?.instancesLastFetchedAt;
return instancesLastFetchedAt == null || instancesLastFetchedAt + 300000 < Date.now();
}
shouldFetchGlobalCatalog() {
const catalogLastFetchedAt = c2360_4.catalogLastFetchedAt;
return catalogLastFetchedAt == null || catalogLastFetchedAt + c2360_2 < Date.now();
}
}
const gameServerStore = new GameServerStore(Dispatcher, {
LOGOUT: function handleReset() {
c2360_3 = {};
c2360_4 = {
catalog: {},
hasFetchedCatalog: false,
catalogLastFetchedAt: void 0
};
},
GAME_SERVER_FETCH_CATALOG_SUCCESS: function handleFetchCatalogSuccess({ guildId, catalog }) {
const r10 = {
...c2360_3
};
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
r10[guildId] = {
...c2360_3[guildId],
catalog,
hasFetchedCatalog: true,
catalogLastFetchedAt: Date.now()
};
c2360_3 = r10;
},
GAME_SERVER_FETCH_GLOBAL_CATALOG_SUCCESS: function handleFetchGlobalCatalogSuccess(a0) {
c2360_4 = {
catalog: a0.catalog,
hasFetchedCatalog: true,
catalogLastFetchedAt: Date.now()
};
},
GAME_SERVER_FETCH_INSTANCES_SUCCESS: function handleFetchInstancesSuccess({ guildId, instances }) {
const r10 = {
...c2360_3
};
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
r10[guildId] = {
...c2360_3[guildId],
instances,
hasFetchedInstances: true,
instancesLastFetchedAt: Date.now()
};
c2360_3 = r10;
},
GAME_SERVER_FETCH_GAME_INSTRUCTIONS_SUCCESS: function handleFetchProductSuccess({ guildId, skuId, instructions }) {
const r12 = {
...c2360_3
};
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
const instructions2 = {
...c2360_3[guildId].instructions
};
instructions2[skuId] = instructions;
r12[guildId] = {
...c2360_3[guildId],
instructions: instructions2
};
c2360_3 = r12;
},
GAME_SERVER_UPDATE_INSTANCE_SUCCESS: function handleUpdateInstanceSuccess({ guildId, instance }) {
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
const r6 = c2360_3[guildId];
const r17 = {
...c2360_3
};
const instances = {
...r6.instances
};
instances[instance.id] = instance;
r17[guildId] = {
...r6,
instances
};
c2360_3 = r17;
},
GUILD_BOOST_ENTITLEMENTS_FETCH_SUCCESS: function handleFetchBoostEntitlementsSuccess({ guildId, unlockedGameServers }) {
const appliedBoosts = Object.values(unlockedGameServers).reduce($mk73585(), 0);
const r17 = {
...c2360_3
};
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
r17[guildId] = {
...c2360_3[guildId],
entitlements: unlockedGameServers,
appliedBoosts
};
c2360_3 = r17;
},
GAME_SERVER_CREATE: handleGameServerInstanceCreated,
GAME_SERVER_UPDATE: handleGameServerInstanceCreated,
GAME_SERVER_DELETE: function handleGameServerInstanceDeleted({ guildId, gameServerId }) {
if (guildId != null) {
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
const r16 = c2360_3[guildId];
delete r16.instances[gameServerId];
const r19 = {
...c2360_3
};
r19[guildId] = {
...r16
};
c2360_3 = r19;
}
},
GUILD_POWERUP_ENTITLEMENTS_CREATE: function handleGameServerEntitlementCreated({ guildId, entitlements }) {
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
const r19 = c2360_3[guildId];
let c13848_0 = r19;
entitlements.filter(({ sku }) => {
const r2 = sku == null;
let r5 = void 0;
if (!r2) {
const tenant_metadata = sku.tenant_metadata;
r5 = tenant_metadata == null ? void 0 : tenant_metadata.guild_monetization?.game_server;
}
return r5 != null;
}).forEach((item) => {
c13848_0.entitlements[item.id] = item;
});
const appliedBoosts = Object.values(r19.entitlements).reduce($mk73585(), 0);
const r34 = {
...c2360_3
};
r34[guildId] = {
...r19,
appliedBoosts
};
c2360_3 = r34;
},
GUILD_POWERUP_ENTITLEMENTS_DELETE: function handleGameServerEntitlementDeleted({ guildId, entitlements }) {
if (c2360_3[guildId] == null) {
c2360_3[guildId] = {
catalog: {},
instances: {},
instructions: {},
entitlements: {}
};
}
const r19 = c2360_3[guildId];
let c13849_0 = r19;
entitlements.forEach((entitlement) => {
delete c13849_0.entitlements[entitlement.id];
});
const appliedBoosts = Object.values(r19.entitlements).reduce($mk73585(), 0);
const r31 = {
...c2360_3
};
r31[guildId] = {
...r19,
appliedBoosts
};
c2360_3 = r31;
}
});
export default gameServerStore;
@@ -0,0 +1,35 @@
// Metro module 11575 (f11576).
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let gameServers;
const handleGameServerUpsert = function handleGameServerUpsert({ guildId, gameServer: gameServer2 }) {
let gameServer;
gameServer = void 0;
if (guildId == null) {
gameServer = gameServer2;
gameServers = gameServers.findIndex((a0) => a0.id === gameServer.id) === -1 ? [...gameServers, gameServer] : gameServers.map((a0) => a0.id === gameServer.id ? gameServer : a0);
}
};
gameServers = [];
class OwnedGameServersStore extends Module589.Store {
static displayName = "OwnedGameServersStore";
getGameServers() {
return gameServers;
}
}
const ownedGameServersStore = new OwnedGameServersStore(Dispatcher, {
LOGOUT: function handleReset() {
gameServers = [];
},
GAME_SERVER_FETCH_MY_SERVERS_SUCCESS: function handleFetchMyServersSuccess(a0) {
gameServers = a0.gameServers;
},
GAME_SERVER_CREATE: handleGameServerUpsert,
GAME_SERVER_UPDATE: handleGameServerUpsert,
GAME_SERVER_DELETE: function handleGameServerDeleted({ guildId, gameServerId }) {
if (guildId == null) {
gameServers = gameServers.filter((gameServer) => gameServer.id !== gameServerId);
}
}
});
export default ownedGameServersStore;
@@ -0,0 +1,32 @@
// Metro module 11601 (f11602).
import { createExperiment } from "../../../experiments/index";
import { useGameServerEnabled } from "../GameServerExperiment";
const experiment = createExperiment({
kind: "guild",
id: "2026-03_game_server_pricing",
label: "Game Server Pricing",
defaultConfig: {
enabled: false
},
treatments: [{
id: 1,
label: "Enable Game Server Pricing",
config: {
enabled: true
}
}]
});
export { experiment as GameServerPricingExperiment };
export function useIsGameServerPricingEnabled(a0, a1) {
let r10 = useGameServerEnabled(a0, a1);
const enabled = experiment.useExperiment({
guildId: a0,
location: a1
}, {
autoTrackExposure: false
}).enabled;
if (r10) {
r10 = enabled;
}
return r10;
}
@@ -0,0 +1,19 @@
// Metro module 15225 (f15226).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-02-game-server-tab-always-on",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function useIsGameServerTabAlwaysOnEnabled(a0) {
return apexExperiment.useConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,19 @@
// Metro module 11600 (f11601).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-new-games-coachmark",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function useIsNewGamesCoachmarkEnabled(a0) {
return apexExperiment.useConfig({
location: a0
}).enabled;
}
@@ -0,0 +1,19 @@
// Metro module 11668 (f11669).
import { HYTALE_GAME_ID, MINECRAFT_GAME_ID } from "../GameServerConstants";
import { useGame } from "../../../games/hooks/useGame";
export default function useGameServerFeaturedGameNames() {
const data = useGame(MINECRAFT_GAME_ID).data;
const data2 = useGame(HYTALE_GAME_ID).data;
let gameName = data?.name;
if (gameName == null) {
gameName = "Minecraft";
}
let gameName2 = data2?.name;
if (gameName2 == null) {
gameName2 = "Hytale";
}
return {
gameName,
gameName2
};
};
@@ -0,0 +1,17 @@
// Metro module 11650 (f11651).
import { useMemo } from "react";
import GameServerStore from "../GameServerStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { getExpiringGuildEntitlements } from "../../powerups/utils/getExpiringGuildEntitlements";
export default function useGameServerGetExpiringEntitlements(c19052_0) {
const stateFromStores = useStateFromStores([GameServerStore], () => GameServerStore.getStateForGuild(c19052_0));
return useMemo(() => {
const r6 = Object;
let r9 = stateFromStores?.entitlements;
if (r9 == null) {
r9 = {};
}
const r10 = r6.values(r9);
return r10.length === 0 ? [] : getExpiringGuildEntitlements(r10);
}, [stateFromStores?.entitlements]);
};
@@ -0,0 +1,32 @@
// Metro module 11667 (f11668).
import { useMemo } from "react";
import GameServerStore from "../GameServerStore";
import { GuildPowerupType } from "../../powerups/constants/GuildPowerupsConstants";
import { GAME_SERVER_POWERUP_SKU_ID } from "../GameServerConstants";
import { useGameServerEnabled } from "../GameServerExperiment";
import { useStateFromStores } from "../../../../_bundle/Module589";
import useGameServerFeaturedGameNames from "./useGameServerFeaturedGameNames";
import { intl } from "../../../../intl/index.native";
import GameServer_messages from "../GameServer.messages";
import Module11669 from "../../../../_bundle/Module11669";
export default function useGameServerPerk(a0) {
let gameName, gameName2;
const gameServerEnabled = useGameServerEnabled(a0, "useGameServerPerk");
const stateFromStores = useStateFromStores([GameServerStore], () => GameServerStore.getLowestGameCostForGuild(a0));
const gameServerFeaturedGameNames = useGameServerFeaturedGameNames();
gameName = gameServerFeaturedGameNames.gameName;
gameName2 = gameServerFeaturedGameNames.gameName2;
return useMemo(() => gameServerEnabled ? stateFromStores != null ? {
skuId: GAME_SERVER_POWERUP_SKU_ID,
title: intl.string(GameServer_messages["B3OfL/"]),
description: intl.format(GameServer_messages["+UqyGU"], {
gameName,
gameName2
}),
cost: stateFromStores,
dependencies: [],
type: GuildPowerupType.PERK,
animatedImageUrl: Module11669,
staticImageUrl: Module11669
} : null : null, [gameServerEnabled, stateFromStores, gameName, gameName2]);
};
@@ -0,0 +1,29 @@
// Metro module 11666 (f11667).
import { useMemo } from "react";
import GameServerStore from "../GameServerStore";
import { useStateFromStores } from "../../../../_bundle/Module589";
import useGameServerGetExpiringEntitlements from "./useGameServerGetExpiringEntitlements";
import { intl } from "../../../../intl/index.native";
import GuildPowerups_messages from "../../powerups/GuildPowerups.messages";
export default function useGameServerPowerupStatus(a0) {
let c19066_2;
const stateFromStores = useStateFromStores([GameServerStore], () => GameServerStore.getStateForGuild(a0)?.entitlements, [a0]);
const gameServerGetExpiringEntitlements = useGameServerGetExpiringEntitlements(a0);
c19066_2 = gameServerGetExpiringEntitlements;
return useMemo(() => {
const r5 = Object;
let r8 = stateFromStores;
if (stateFromStores == null) {
r8 = {};
}
if (r5.values(r8).length !== 0) {
return c19066_2.length > 0 ? {
type: "expiring",
expiringAt: c19066_2[0].ends_at
} : {
type: "active",
statusText: intl.string(GuildPowerups_messages.FFLkmx)
};
}
}, [gameServerGetExpiringEntitlements, stateFromStores]);
};
@@ -0,0 +1,250 @@
// Metro module 11576 (f11577).
import { GameServerProviderType } from "../../../../_bundle/Module4079";
import { GameServerStatus } from "../../../../_bundle/Module11577";
function $mk87662() {
return (a0) => a0.cost;
}
const plans = [{
id: "1",
name: "GameServer #1",
cost: 3,
specifications: [{
title: "2",
description: "GB"
}, {
title: "1",
description: "vCPU"
}, {
title: "25",
description: "GB"
}]
}, {
id: "2",
name: "GameServer #2",
cost: 6,
specifications: [{
title: "2",
description: "GB"
}, {
title: "1",
description: "vCPU"
}, {
title: "25",
description: "GB"
}]
}, {
id: "3",
name: "GameServer #3",
cost: 12,
specifications: [{
title: "2",
description: "GB"
}, {
title: "1",
description: "vCPU"
}, {
title: "25",
description: "GB"
}]
}];
const r11 = Math;
const r38 = {
id: "1",
name: "GameServer Test #1",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r11.min.apply(r11, [...plans.map($mk87662())]),
gameId: "1"
};
const r52 = Math;
const r51 = {
id: "2",
name: "GameServer Test #2",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r52.min.apply(r52, [...plans.map($mk87662())]),
gameId: "1"
};
const r69 = Math;
const r68 = {
id: "3",
name: "GameServer Test #3",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r69.min.apply(r69, [...plans.map($mk87662())]),
gameId: "1"
};
const r87 = Math;
const r86 = {
id: "4",
name: "GameServer Test #4",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r87.min.apply(r87, [...plans.map($mk87662())]),
gameId: "1"
};
const r105 = Math;
const r104 = {
id: "5",
name: "GameServer Test #5",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r105.min.apply(r105, [...plans.map($mk87662())]),
gameId: "1"
};
const r123 = Math;
const r122 = {
id: "6",
name: "GameServer Test #6",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r123.min.apply(r123, [...plans.map($mk87662())]),
gameId: "1"
};
const r141 = Math;
const r140 = {
id: "7",
name: "GameServer Test #7",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r141.min.apply(r141, [...plans.map($mk87662())]),
gameId: "1"
};
const r159 = Math;
const r158 = {
id: "8",
name: "GameServer Test #8",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r159.min.apply(r159, [...plans.map($mk87662())]),
gameId: "1"
};
const r177 = Math;
const r176 = {
id: "9",
name: "GameServer Test #9",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r177.min.apply(r177, [...plans.map($mk87662())]),
gameId: "1"
};
const r195 = Math;
const r194 = {
id: "10",
name: "GameServer Test #10",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r195.min.apply(r195, [...plans.map($mk87662())]),
gameId: "1"
};
const r213 = Math;
const r212 = {
id: "11",
name: "GameServer Test #11",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r213.min.apply(r213, [...plans.map($mk87662())]),
gameId: "1"
};
const r231 = Math;
const r46 = [r38, r51, r68, r86, r104, r122, r140, r158, r176, r194, r212, {
id: "12",
name: "GameServer Test #12",
provider: GameServerProviderType.SHOCKBYTE,
plans,
baseCost: r231.min.apply(r231, [...plans.map($mk87662())]),
gameId: "1"
}];
const r252 = [{
id: "1",
gameId: "1",
name: "GameServer Test #1",
port: "25565",
regionId: "us-east",
regionName: "US East",
planId: plans[1].id,
planName: plans[1].name,
onlineConnectionsCount: 0,
maxConnectionsCount: 10,
status: GameServerStatus.ONLINE,
serverIP: "127.0.0.1",
gameServerPanelUrl: "https://google.com",
entitlementId: "1"
}, {
id: "2",
gameId: "2",
name: "GameServer Test #2",
port: "25565",
regionId: "us-east",
regionName: "US East",
planId: plans[1].id,
planName: plans[1].name,
onlineConnectionsCount: 0,
maxConnectionsCount: 10,
status: GameServerStatus.ONLINE,
serverIP: "127.0.0.1",
gameServerPanelUrl: "https://google.com",
entitlementId: "2"
}, {
id: "3",
gameId: "3",
name: "GameServer Test #3",
port: "25565",
regionId: "us-east",
regionName: "US East",
planId: plans[1].id,
planName: plans[1].name,
onlineConnectionsCount: 0,
maxConnectionsCount: 10,
status: GameServerStatus.ONLINE,
serverIP: "127.0.0.1",
gameServerPanelUrl: "https://google.com",
entitlementId: "3"
}, {
id: "4",
gameId: "4",
name: "GameServer Test #4",
port: "25565",
regionId: "us-east",
regionName: "US East",
planId: plans[1].id,
planName: plans[1].name,
onlineConnectionsCount: 0,
maxConnectionsCount: 10,
status: GameServerStatus.ONLINE,
serverIP: "127.0.0.1",
gameServerPanelUrl: "https://google.com",
entitlementId: "4"
}, {
id: "5",
gameId: "5",
name: "GameServer Test #5",
port: "25565",
regionId: "us-east",
regionName: "US East",
planId: plans[1].id,
planName: plans[1].name,
onlineConnectionsCount: 0,
maxConnectionsCount: 10,
status: GameServerStatus.ONLINE,
serverIP: "127.0.0.1",
gameServerPanelUrl: "https://google.com",
entitlementId: "5"
}, {
id: "6",
gameId: "6",
name: "GameServer Test #6",
port: "25565",
regionId: "us-east",
regionName: "US East",
planId: plans[1].id,
planName: plans[1].name,
onlineConnectionsCount: 0,
maxConnectionsCount: 10,
status: GameServerStatus.ONLINE,
serverIP: "127.0.0.1",
gameServerPanelUrl: "https://google.com",
entitlementId: "6"
}];
export { r46 as GAME_SERVER_GAME_MOCKS };
export { r252 as GAME_SERVER_INSTANCE_MOCKS };
@@ -0,0 +1,26 @@
// Metro module 4099 (f4100).
export default function gameServerResponseToInstance(a0) {
let players_count = a0.players_count;
if (players_count == null) {
players_count = 0;
}
return {
id: a0.id,
name: a0.name,
regionId: a0.region_id,
regionName: a0.region_name,
planId: a0.sku_id,
planName: a0.plan_name,
onlineConnectionsCount: players_count,
maxConnectionsCount: a0.max_players_count,
serverIP: a0.ip,
port: a0.port,
entitlementId: a0.entitlement_id,
subscriptionId: a0.subscription_id,
providerType: a0.provider_type,
gameServerPanelUrl: a0.provider_url,
status: a0.status,
gameId: a0.game_id,
gameConfig: a0.game_config
};
};
@@ -0,0 +1,67 @@
// Metro module 11578 (f11579).
export function productToGameServerGame(a0) {
const plans = a0.skus.map((sku) => ({
id: sku.id,
name: sku.name,
cost: sku.tenant_metadata.boost_price,
specifications: sku.tenant_metadata.plan_features.map((plan_feature) => ({
title: plan_feature.title,
description: plan_feature.description
}))
})).sort((a, b) => b.cost - a.cost);
const r2 = plans.length > 0;
let baseCost = 0;
if (r2) {
const r9 = Math;
baseCost = r9.min.apply(r9, [...plans.map((plan) => plan.cost)]);
}
const tenant_metadata = a0.tenant_metadata;
const r3 = tenant_metadata == null;
let gameId = void 0;
if (!r3) {
const guild_monetization = tenant_metadata.guild_monetization;
gameId = guild_monetization == null ? void 0 : guild_monetization.game_server?.game_application_id;
}
if (gameId == null) {
gameId = "";
}
const tenant_metadata2 = a0.tenant_metadata;
const r38 = tenant_metadata2 == null;
let provider = void 0;
if (!r38) {
const guild_monetization2 = tenant_metadata2.guild_monetization;
provider = guild_monetization2 == null ? void 0 : guild_monetization2.game_server?.provider;
}
const tenant_metadata3 = a0.tenant_metadata;
const r45 = tenant_metadata3 == null;
let disabled = void 0;
if (!r45) {
const guild_monetization3 = tenant_metadata3.guild_monetization;
disabled = guild_monetization3 == null ? void 0 : guild_monetization3.game_server?.disabled;
}
const tenant_metadata4 = a0.tenant_metadata;
const r52 = tenant_metadata4 == null;
let early_access = void 0;
if (!r52) {
const guild_monetization4 = tenant_metadata4.guild_monetization;
early_access = guild_monetization4 == null ? void 0 : guild_monetization4.game_server?.early_access;
}
const tenant_metadata5 = a0.tenant_metadata;
const r59 = tenant_metadata5 == null;
let can_market = void 0;
if (!r59) {
const guild_monetization5 = tenant_metadata5.guild_monetization;
can_market = guild_monetization5 == null ? void 0 : guild_monetization5.game_server?.can_market;
}
return {
id: a0.id,
name: a0.name,
gameId,
provider,
plans,
baseCost,
disabled,
early_access,
can_market
};
}
@@ -0,0 +1,10 @@
// Metro module 11579 (f11580).
export default function regionResponseToRegion(a0) {
return {
id: a0.id,
name: a0.name,
countryCode: a0.country_code,
pingUrl: a0.ping_url,
enabled: a0.enabled
};
};
@@ -0,0 +1,5 @@
// Metro module 7786 (f7787).
export default function getNumSubscriptionsPurchasedFromSystemMessage(a0) {
const r7 = Number(a0.content);
return isNaN(r7) ? 1 : r7 !== 0 ? r7 : 1;
};
@@ -0,0 +1,7 @@
// Metro module 7855 (f7856).
import MobileFriendAnniversaryExperiment from "./native/MobileFriendAnniversaryExperiment";
export function getFriendAnniversaryGateConfig(a0) {
return {
enabled: MobileFriendAnniversaryExperiment.getConfig(a0).enabled
};
}
@@ -0,0 +1,50 @@
// Metro module 6299 (f6300).
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c4014_0 = {
giftOptionsReceiptMap: {}
};
class GiftPromotionStore extends Module589.PersistedStore {
static displayName = "GiftPromotionStore";
static persistKey = "GiftPromotionStore";
static migrations = [(a0) => {
let r1 = a0;
if (a0 != null) {
let giftOptionsReceiptMap = a0.giftOptionsReceiptMap;
if (giftOptionsReceiptMap == null) {
giftOptionsReceiptMap = null;
}
r1 = {
giftOptionsReceiptMap
};
}
return r1;
}];
initialize(a0) {
if (a0 != null) {
c4014_0.giftOptionsReceiptMap = {
...a0.giftOptionsReceiptMap
};
}
}
getState() {
return c4014_0;
}
getGiftOptionsForKey(a0) {
return c4014_0.giftOptionsReceiptMap[a0];
}
}
const giftPromotionStore = new GiftPromotionStore(Dispatcher, {
LOGOUT: function handleLogout() {
c4014_0 = {
giftOptionsReceiptMap: {}
};
},
GIFT_PROMOTION_GIFT_OPTIONS_CACHE_ACTION: function handleCacheGiftOptions(a0) {
c4014_0.giftOptionsReceiptMap[a0.key] = a0.giftOptions;
},
GIFT_PROMOTION_GIFT_OPTIONS_CLEAR_CACHE_ACTION: function handleClearCachedGiftOptions(a0) {
delete c4014_0.giftOptionsReceiptMap[a0.key];
}
});
export default giftPromotionStore;
@@ -0,0 +1,132 @@
// Metro module 2319 (f2320).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module2288 from "../../../_bundle/Module2288";
import * as _Module2289 from "../../../_bundle/Module2289";
import * as _Module2290 from "../../../_bundle/Module2290";
import * as _Module2291 from "../../../_bundle/Module2291";
import * as _Module2292 from "../../../_bundle/Module2292";
import * as _Module2293 from "../../../_bundle/Module2293";
import * as _Module2294 from "../../../_bundle/Module2294";
import * as _Module2295 from "../../../_bundle/Module2295";
import * as _Module2296 from "../../../_bundle/Module2296";
import * as _Module2297 from "../../../_bundle/Module2297";
import * as _Module2298 from "../../../_bundle/Module2298";
import * as _Module2299 from "../../../_bundle/Module2299";
import * as _Module2300 from "../../../_bundle/Module2300";
import * as _Module2301 from "../../../_bundle/Module2301";
import * as _Module2302 from "../../../_bundle/Module2302";
import * as _Module2303 from "../../../_bundle/Module2303";
import * as _Module2304 from "../../../_bundle/Module2304";
import * as _Module2305 from "../../../_bundle/Module2305";
import * as _Module2306 from "../../../_bundle/Module2306";
import * as _Module2307 from "../../../_bundle/Module2307";
import * as _Module2308 from "../../../_bundle/Module2308";
import * as _Module2309 from "../../../_bundle/Module2309";
import * as _Module2310 from "../../../_bundle/Module2310";
import * as _Module2311 from "../../../_bundle/Module2311";
import * as _Module2312 from "../../../_bundle/Module2312";
import * as _Module2313 from "../../../_bundle/Module2313";
import * as _Module2314 from "../../../_bundle/Module2314";
import * as _Module2315 from "../../../_bundle/Module2315";
import * as _Module2316 from "../../../_bundle/Module2316";
import * as _Module2317 from "../../../_bundle/Module2317";
import * as _Module2320 from "../../../_bundle/Module2320";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2288).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2289).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2290).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2291).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2292).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2293).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2294).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2295).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2296).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2297).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2298).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2299).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2300).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2301).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2302).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2303).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2304).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2305).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2306).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2307).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2308).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2309).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2310).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2311).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2312).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2313).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2314).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2315).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2316).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2317).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2320).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,50 @@
// Metro module 9825 (f9826).
import { getSingleRequirementThreshold } from "../../badges/BadgeDirectoryStore";
function $mk83410($env) {
return (a0, a1) => {
let r3 = a0;
const r5 = $env.$parent[0];
const r6 = r5(a1);
const r7 = $env[0];
let r9 = a0;
if (!(r7 >= r6)) {
if (!(a0 != null && !(r6 < r5(a0)))) {
r3 = a1;
}
r9 = r3;
}
return r9;
};
}
let env6520 = {};
export function getTierForProgress(a0, c17510_0) {
return a0.reduce((acc, item) => {
let r3 = acc;
const singleRequirementThreshold = getSingleRequirementThreshold(item);
let r9 = acc;
if (!(c17510_0 < singleRequirementThreshold)) {
if (!(acc != null && !(singleRequirementThreshold > getSingleRequirementThreshold(acc)))) {
r3 = item;
}
r9 = r3;
}
return r9;
}, null);
}
export function getNextTierForProgress(a0, a1) {
let env17509;
const r1 = env17509 = {
$parent: env6520
};
env17509[0] = a1;
return a0.reduce($mk83410(r1), null);
}
export function getRemainingGiftsToNextTier(a0, a1) {
let env17511;
const r2 = env17511 = {
$parent: env6520
};
env17511[0] = a1;
const r7 = a0.reduce($mk83410(r2), null);
return r7 == null ? null : (0, getSingleRequirementThreshold)(r7) - a1;
}
@@ -0,0 +1,12 @@
// Metro module 2321 (f2322).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module2322 from "../../../_bundle/Module2322";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
"en-US": () => loadJsonAsset(_Module2322).then((result) => ({
default: result
}))
}, "en-US");
const r21 = makeMessagesProxy(loader);
export default r21;
export { loader as messagesLoader };
@@ -0,0 +1,60 @@
// Metro module 12604 (f12605).
import { getSingleRequirementThreshold } from "../../badges/BadgeDirectoryStore";
import UserStore from "../../../stores/UserStore";
import { GiftingBadgeExperiment } from "./experiments/GiftingBadgeExperiment";
import { GiftingBadgeDesktopExperiment } from "./experiments/GiftingBadgeDesktopExperiment";
import { useStateFromStores } from "../../../_bundle/Module589";
import { useIsDismissibleContentDismissed_UNSAFE } from "../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../_bundle/Module1358";
export function getGiftingBadgeProgressPercent(a0, a1, a2) {
const singleRequirementThreshold = getSingleRequirementThreshold(a1);
const singleRequirementThreshold2 = getSingleRequirementThreshold(a2);
return Math.min(Math.max(a2 != null ? singleRequirementThreshold2 > 0 ? a0 / singleRequirementThreshold2 * 100 : 100 : singleRequirementThreshold > 0 ? Math.min(singleRequirementThreshold, a0) / singleRequirementThreshold * 100 : 100, 0), 100);
}
export function useIsGiftingBadgesDesktopEnabled(a0) {
const enabled = GiftingBadgeExperiment.useConfig({
location: a0
}).enabled;
return GiftingBadgeDesktopExperiment.useConfig({
location: `${a0}${enabled ? "" : "-DISABLED"}`
}).enabled && enabled;
}
export function getIsGiftingBadgesDesktopEnabled(a0) {
return !!GiftingBadgeExperiment.getConfig({
location: a0
}).enabled && GiftingBadgeDesktopExperiment.getConfig({
location: a0
}).enabled;
}
export function useIsEligibleToShowGiftingBadgeCoachmark({ platform: platform2, location: location2 }) {
const enabled = GiftingBadgeExperiment.useConfig({
location: location2
}).enabled;
const r1 = platform2 === "web";
let enabled2 = GiftingBadgeDesktopExperiment.useConfig({
location: `${location2}${r1 ? "" : "-DISABLED"}`
}).enabled;
let r29 = enabled;
if (r1) {
if (enabled2) {
enabled2 = enabled;
}
r29 = enabled2;
}
const stateFromStores = useStateFromStores([UserStore], () => {
const currentUser = UserStore.getCurrentUser();
let r6 = currentUser == null ? void 0 : currentUser.hasHadPremium();
if (r6 == null) {
r6 = false;
}
return r6;
});
const isDismissibleContentDismissed_UNSAFE = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.NEW_GIFTING_BADGES_COACHMARK);
if (r29) {
r29 = stateFromStores;
}
if (r29) {
r29 = !isDismissibleContentDismissed_UNSAFE;
}
return r29;
}
@@ -0,0 +1,132 @@
// Metro module 2287 (f2288).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module2288 from "../../../_bundle/Module2288";
import * as _Module2289 from "../../../_bundle/Module2289";
import * as _Module2290 from "../../../_bundle/Module2290";
import * as _Module2291 from "../../../_bundle/Module2291";
import * as _Module2292 from "../../../_bundle/Module2292";
import * as _Module2293 from "../../../_bundle/Module2293";
import * as _Module2294 from "../../../_bundle/Module2294";
import * as _Module2295 from "../../../_bundle/Module2295";
import * as _Module2296 from "../../../_bundle/Module2296";
import * as _Module2297 from "../../../_bundle/Module2297";
import * as _Module2298 from "../../../_bundle/Module2298";
import * as _Module2299 from "../../../_bundle/Module2299";
import * as _Module2300 from "../../../_bundle/Module2300";
import * as _Module2301 from "../../../_bundle/Module2301";
import * as _Module2302 from "../../../_bundle/Module2302";
import * as _Module2303 from "../../../_bundle/Module2303";
import * as _Module2304 from "../../../_bundle/Module2304";
import * as _Module2305 from "../../../_bundle/Module2305";
import * as _Module2306 from "../../../_bundle/Module2306";
import * as _Module2307 from "../../../_bundle/Module2307";
import * as _Module2308 from "../../../_bundle/Module2308";
import * as _Module2309 from "../../../_bundle/Module2309";
import * as _Module2310 from "../../../_bundle/Module2310";
import * as _Module2311 from "../../../_bundle/Module2311";
import * as _Module2312 from "../../../_bundle/Module2312";
import * as _Module2313 from "../../../_bundle/Module2313";
import * as _Module2314 from "../../../_bundle/Module2314";
import * as _Module2315 from "../../../_bundle/Module2315";
import * as _Module2316 from "../../../_bundle/Module2316";
import * as _Module2317 from "../../../_bundle/Module2317";
import * as _Module2318 from "../../../_bundle/Module2318";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2288).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2289).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2290).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2291).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2292).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2293).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2294).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2295).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2296).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2297).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2298).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2299).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2300).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2301).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2302).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2303).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2304).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2305).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2306).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2307).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2308).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2309).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2310).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2311).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2312).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2313).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2314).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2315).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2316).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2317).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2318).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,17 @@
// Metro module 11891 (f11892).
import { PremiumGiftStyles } from "../PremiumConstants";
import PremiumGifting_messages from "./PremiumGifting.messages";
const r14 = {};
r14[PremiumGiftStyles.SNOWGLOBE] = PremiumGifting_messages.M6cPwB;
r14[PremiumGiftStyles.BOX] = PremiumGifting_messages.B9XqQk;
r14[PremiumGiftStyles.CUP] = PremiumGifting_messages["6dCq/u"];
r14[PremiumGiftStyles.STANDARD_BOX] = PremiumGifting_messages.GzPel1;
r14[PremiumGiftStyles.CAKE] = PremiumGifting_messages.AJ4iir;
r14[PremiumGiftStyles.CHEST] = PremiumGifting_messages.P5keo3;
r14[PremiumGiftStyles.COFFEE] = PremiumGifting_messages.w84vET;
r14[PremiumGiftStyles.SEASONAL_STANDARD_BOX] = PremiumGifting_messages["vd1fu/"];
r14[PremiumGiftStyles.SEASONAL_CAKE] = PremiumGifting_messages.aubYGR;
r14[PremiumGiftStyles.SEASONAL_CHEST] = PremiumGifting_messages.vjxYqU;
r14[PremiumGiftStyles.SEASONAL_COFFEE] = PremiumGifting_messages.bHuJLa;
r14[PremiumGiftStyles.NITROWEEN_STANDARD] = PremiumGifting_messages["+HMF8k"];
export { r14 as GIFT_STYLE_DESCRIPTIONS };
@@ -0,0 +1,127 @@
// Metro module 6179 (f6180).
import UserAffinitiesV2Store from "../../user_affinities/UserAffinitiesV2Store";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import MessageStore from "../../../stores/MessageStore";
import { GiftIntentType } from "../PremiumConstants";
import { AnalyticEvents, Endpoints } from "../../../Constants";
import { HTTP } from "../../../_bundle/sendRequest";
import Dispatcher from "../../../Dispatcher";
import SentryUtils_native from "../../../utils/SentryUtils.native";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { isFriendshipAnniversaryBackendPersistenceEnabled } from "../experiments/FriendshipAnniversaryBackendPersistenceExperiment";
let $mk77956 = function() {
return (a0) => {
SentryUtils_native.captureException(a0, {
tags: {
feature: "gift_intent"
}
});
};
};
export function fetchAndReconcileGiftIntentDismissals(settingsTimestampMs) {
const id = AuthenticationStore.getId();
return HTTP.get({
url: Endpoints.GIFT_INTENT_DISMISSALS,
oldFormErrors: true,
rejectWithError: true
}).then((result) => {
if (AuthenticationStore.getId() === id) {
let dismissals = result.body.dismissals;
if (dismissals == null) {
dismissals = [];
}
Dispatcher.dispatch({
type: "GIFT_INTENT_DISMISSALS_FETCH_SUCCESS",
dismissals: dismissals.map((dismissal) => ({
targetId: dismissal.target_id,
dismissedAtMs: Number(dismissal.dismissed_at_ms)
})),
settingsTimestampMs
});
} else {
Dispatcher.dispatch({
type: "GIFT_INTENT_DISMISSALS_FETCH_FAILURE"
});
}
}, (a0) => {
SentryUtils_native.captureException(a0, {
tags: {
feature: "gift_intent"
}
});
Dispatcher.dispatch({
type: "GIFT_INTENT_DISMISSALS_FETCH_FAILURE"
});
});
}
export function logFriendsListGiftIntentsShown() {
Dispatcher.dispatch({
type: "FRIENDS_LIST_GIFT_INTENTS_SHOWN"
});
}
export function logMessageGiftIntentShown(a0, gift_intent_type = GiftIntentType.FRIEND_ANNIVERSARY) {
Dispatcher.dispatch({
type: "MESSAGE_GIFT_INTENT_SHOWN",
recipientUserId: a0
});
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_DISMISSED, {
gift_intent_type,
dismiss_type: "shown",
affinity: UserAffinitiesV2Store.getUserAffinity(a0)?.dmProbability
});
if (isFriendshipAnniversaryBackendPersistenceEnabled("dismissGiftIntent") && gift_intent_type !== GiftIntentType.UNSPECIFIED) {
HTTP.post({
url: Endpoints.GIFT_INTENTS_DISMISS,
body: {
intent_type: gift_intent_type,
target_id: a0
},
oldFormErrors: true,
rejectWithError: true
}).catch($mk77956());
}
}
export function logGiftIntentMessageDismissed(a0, a1) {
const giftingPrompt = MessageStore.getMessage(a0, a1)?.giftingPrompt;
if (giftingPrompt != null) {
const { giftIntentType, recipientUserId } = giftingPrompt;
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_DISMISSED, {
gift_intent_type: giftIntentType,
dismiss_type: "explicit",
affinity: UserAffinitiesV2Store.getUserAffinity(recipientUserId)?.dmProbability
});
if (isFriendshipAnniversaryBackendPersistenceEnabled("dismissGiftIntent") && giftIntentType !== GiftIntentType.UNSPECIFIED) {
HTTP.post({
url: Endpoints.GIFT_INTENTS_DISMISS,
body: {
intent_type: giftIntentType,
target_id: recipientUserId
},
oldFormErrors: true,
rejectWithError: true
}).catch($mk77956());
}
}
}
export function logGiftIntentFlowPurchasedGift(a0, gift_intent_type = GiftIntentType.FRIEND_ANNIVERSARY) {
Dispatcher.dispatch({
type: "GIFT_INTENT_FLOW_PURCHASED_GIFT",
recipientUserId: a0
});
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_DISMISSED, {
gift_intent_type,
dismiss_type: "gift_sent",
affinity: UserAffinitiesV2Store.getUserAffinity(a0)?.dmProbability
});
if (isFriendshipAnniversaryBackendPersistenceEnabled("dismissGiftIntent") && gift_intent_type !== GiftIntentType.UNSPECIFIED) {
HTTP.post({
url: Endpoints.GIFT_INTENTS_DISMISS,
body: {
intent_type: gift_intent_type,
target_id: a0
},
oldFormErrors: true,
rejectWithError: true
}).catch($mk77956());
}
}
@@ -0,0 +1,374 @@
// Metro module 7853 (f7854).
import ExperimentStore from "../../experiments/ExperimentStore";
import ApexExperimentStore from "../../experiments/apex/ApexExperimentStore";
import UserAffinitiesV2Store from "../../user_affinities/UserAffinitiesV2Store";
import UserSettingsProtoStore from "../../user_settings/UserSettingsProtoStore";
import ConsentStore from "../../../stores/ConsentStore";
import RelationshipStore from "../../../stores/RelationshipStore";
import { Consents } from "../../../Constants";
import { categorizeFriendAnniversariesByAffinity, isFriendAnniversary, pruneTimestampMap, yearsSince } from "./shared/FriendAnniversaryUtils";
import { EnableFriendAnniversaryNotifications } from "../../user_settings/UserSettings";
import { getFriendAnniversaryGateConfig } from "./FriendAnniversaryGate.native";
import Module12 from "../../../_bundle/Module12";
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c4958_10, c4958_11, highestAffinity, highAffinity, c4958_14, c4958_15, c4958_16, date, categorizeTopAffinityFriendAnniversaries, updateFriendAnniversaries, resetFriendAnniversaries, generateFriendAnniversaries, $mk79328 = function() {
return (a0) => UserAffinitiesV2Store.getUserAffinity(a0)?.dmProbability;
};
const getCurrentTime = function getCurrentTime() {
let r4 = date;
if (r4 == null) {
r4 = Date.now();
}
return r4;
};
categorizeTopAffinityFriendAnniversaries = function categorizeTopAffinityFriendAnniversaries() {
const r0 = void 0 === void 0 ? false : void 0;
const r11 = categorizeFriendAnniversariesByAffinity(c4958_11, $mk79328(), r0);
const { highestAffinity: highestAffinity2, highAffinity: highAffinity2 } = r11;
highestAffinity = highestAffinity2;
highAffinity = highAffinity2;
};
updateFriendAnniversaries = function updateFriendAnniversaries() {
let r26;
if (c4958_15 == null) {
resetFriendAnniversaries();
if (ConsentStore.hasConsented(Consents.PERSONALIZATION) && EnableFriendAnniversaryNotifications.getSetting()) {
let r47 = RelationshipStore.getFriendIDs()[Symbol.iterator]();
const next = r47.next;
while (true) {
const r14 = r47 === void 0 ? void 0 : (r26 = next.call(r47)).done ? r47 = void 0 : r26.value;
if (r47 === void 0) {
if (c4958_11.length === 0) {
break;
}
if (getFriendAnniversaryGateConfig({
location: "PremiumGiftingIntentStore updateFriendAnniversaries"
}).enabled) {
c4958_11.sort((a, b) => UserAffinitiesV2Store.compareByDmProbability(a, b));
categorizeTopAffinityFriendAnniversaries();
break;
}
resetFriendAnniversaries();
break;
}
try {
const since = RelationshipStore.getSince(r14);
const userAffinity = UserAffinitiesV2Store.getUserAffinity(r14);
if (RelationshipStore.isFriend(r14) && userAffinity != null && userAffinity.dmProbability > 0 && since != null) {
const date2 = new Date(since);
if (isFriendAnniversary(date2)) {
c4958_11.push(r14);
c4958_14[r14] = {
friendsSince: date2
};
}
}
} catch (r80) {
if (r47 !== void 0 && typeof r47.return === "function") {
try {
r47.return();
} catch {}
}
throw r80;
}
}
}
} else {
generateFriendAnniversaries(c4958_15);
}
};
resetFriendAnniversaries = function resetFriendAnniversaries() {
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
};
generateFriendAnniversaries = function generateFriendAnniversaries(total) {
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
if (getFriendAnniversaryGateConfig({
location: "PremiumGiftingIntentStore generateFriendAnniversaries"
}).enabled && EnableFriendAnniversaryNotifications.getSetting()) {
let c16042_0;
c4958_15 = total;
const r40 = RelationshipStore.getFriendIDs().filter((item) => !RelationshipStore.isIgnored(item));
c16042_0 = new Set(r40);
const r57 = c4958_16 != null && (c4958_16.length === total && c4958_16.every((item) => c16042_0.has(item))) ? c4958_16 : Module12.sampleSize(r40, total);
c4958_16 = r57;
r57.forEach((item) => {
const since = RelationshipStore.getSince(item);
if (since != null) {
const date2 = new Date(since);
c4958_11.push(item);
c4958_14[item] = {
friendsSince: date2
};
}
});
c4958_11.sort((a, b) => UserAffinitiesV2Store.compareByDmProbability(a, b));
const r69 = categorizeFriendAnniversariesByAffinity(c4958_11, $mk79328(), true);
const { highestAffinity: highestAffinity2, highAffinity: highAffinity2 } = r69;
highestAffinity = highestAffinity2;
highAffinity = highAffinity2;
}
};
c4958_10 = {
messageGiftIntentLastShownMap: {},
lastShownFriendsListGiftIntents: [],
friendsTabBadgeLastDismissedTime: null,
lastKnownGiftIntentDismissedAtMs: 0
};
c4958_11 = [];
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
c4958_15 = null;
c4958_16 = null;
date = null;
class PremiumGiftingIntentStore extends Module589.PersistedStore {
static displayName = "PremiumGiftingIntentStore";
static persistKey = "PremiumGiftingIntentStore";
static migrations = [(a0) => {
let r1 = a0;
if (a0 != null) {
let friendsTabBadgeLastDismissedTime = a0.friendsTabBadgeLastDismissedTime;
if (friendsTabBadgeLastDismissedTime == null) {
friendsTabBadgeLastDismissedTime = null;
}
let lastShownFriendsListGiftIntents = a0.lastShownFriendsListGiftIntents;
if (lastShownFriendsListGiftIntents == null) {
lastShownFriendsListGiftIntents = [];
}
r1 = {
friendsTabBadgeLastDismissedTime,
lastShownFriendsListGiftIntents,
messageGiftIntentLastShownMap: {}
};
}
return r1;
}, (a0) => {
let r1 = a0;
if (a0 != null) {
let lastShownFriendsListGiftIntents = a0.lastShownFriendsListGiftIntents;
if (lastShownFriendsListGiftIntents == null) {
lastShownFriendsListGiftIntents = [];
}
let messageGiftIntentLastShownMap = a0.messageGiftIntentLastShownMap;
if (messageGiftIntentLastShownMap == null) {
messageGiftIntentLastShownMap = {};
}
r1 = {
friendsTabBadgeLastDismissedTime: null,
lastShownFriendsListGiftIntents,
messageGiftIntentLastShownMap,
giftUnreadNotificationLastDismissedTimes: []
};
}
return r1;
}, (a0) => {
let r1 = a0;
if (a0 != null) {
let lastShownFriendsListGiftIntents = a0.lastShownFriendsListGiftIntents;
if (lastShownFriendsListGiftIntents == null) {
lastShownFriendsListGiftIntents = [];
}
let messageGiftIntentLastShownMap = a0.messageGiftIntentLastShownMap;
if (messageGiftIntentLastShownMap == null) {
messageGiftIntentLastShownMap = {};
}
let giftUnreadNotificationLastDismissedTimes = a0.giftUnreadNotificationLastDismissedTimes;
if (giftUnreadNotificationLastDismissedTimes == null) {
giftUnreadNotificationLastDismissedTimes = [];
}
r1 = {
friendsTabBadgeLastDismissedTime: null,
lastShownFriendsListGiftIntents,
messageGiftIntentLastShownMap,
giftUnreadNotificationLastDismissedTimes,
profilePopoutGiftIntentsDismissMap: {}
};
}
return r1;
}, (a0) => {
let r2 = a0;
if (a0 != null) {
let lastKnownGiftIntentDismissedAtMs = a0.lastKnownGiftIntentDismissedAtMs;
if (lastKnownGiftIntentDismissedAtMs == null) {
lastKnownGiftIntentDismissedAtMs = 0;
}
r2 = {
...a0,
lastKnownGiftIntentDismissedAtMs
};
}
return r2;
}, (a0) => {
if (a0 != null) {
delete a0["profilePopoutGiftIntentsDismissMap"];
}
return a0;
}, (a0) => {
if (a0 == null) {
return a0;
}
const r2 = {
...a0
};
delete r2["giftUnreadNotificationLastDismissedTimes"];
return r2;
}];
initialize(a0) {
c4958_10 = {
messageGiftIntentLastShownMap: {},
lastShownFriendsListGiftIntents: [],
friendsTabBadgeLastDismissedTime: null,
lastKnownGiftIntentDismissedAtMs: 0
};
if (a0 != null) {
c4958_10.friendsTabBadgeLastDismissedTime = a0.friendsTabBadgeLastDismissedTime;
c4958_10.lastShownFriendsListGiftIntents = Array.from(a0.lastShownFriendsListGiftIntents);
c4958_10.messageGiftIntentLastShownMap = {
...a0.messageGiftIntentLastShownMap
};
const r23 = c4958_10;
let lastKnownGiftIntentDismissedAtMs = a0.lastKnownGiftIntentDismissedAtMs;
if (lastKnownGiftIntentDismissedAtMs == null) {
lastKnownGiftIntentDismissedAtMs = 0;
}
r23.lastKnownGiftIntentDismissedAtMs = lastKnownGiftIntentDismissedAtMs;
}
this.syncWith([RelationshipStore, UserAffinitiesV2Store, ConsentStore, ExperimentStore, ApexExperimentStore, UserSettingsProtoStore], updateFriendAnniversaries);
const r36 = c4958_10;
const messageGiftIntentLastShownMap = c4958_10.messageGiftIntentLastShownMap;
let r44 = date;
if (r44 == null) {
r44 = Date.now();
}
r36.messageGiftIntentLastShownMap = pruneTimestampMap(messageGiftIntentLastShownMap, r44, 1209600000);
}
getState() {
return c4958_10;
}
getFriendAnniversaries() {
return c4958_11;
}
canShowFriendsTabBadge() {
return Array.from(highAffinity).some((item) => !c4958_10.lastShownFriendsListGiftIntents.includes(item));
}
getFriendAnniversaryYears(a0) {
const r5 = c4958_14[a0];
return r5 == null ? 0 : yearsSince(r5.friendsSince);
}
isGiftIntentMessageInCooldown(a0) {
return c4958_10.messageGiftIntentLastShownMap[a0] != null;
}
getDevToolTotalFriendAnniversaries() {
return c4958_15;
}
getDevToolCurrentDate() {
return date;
}
getHighestAffinityFriendAnniversaries() {
return Array.from(highestAffinity);
}
getHighAffinityFriendAnniversaries() {
return Array.from(highAffinity);
}
getMessageGiftIntentLastShownMap() {
return c4958_10.messageGiftIntentLastShownMap;
}
getLastKnownGiftIntentDismissedAtMs() {
return c4958_10.lastKnownGiftIntentDismissedAtMs;
}
}
const premiumGiftingIntentStore = new PremiumGiftingIntentStore(Dispatcher, {
CONNECTION_OPEN: function handleConnectionOpen() {
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
},
LOGOUT: function handleLogout() {
c4958_10 = {
messageGiftIntentLastShownMap: {},
lastShownFriendsListGiftIntents: [],
friendsTabBadgeLastDismissedTime: null,
lastKnownGiftIntentDismissedAtMs: 0
};
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
},
MESSAGE_GIFT_INTENT_SHOWN: function handleMessageGiftIntentShown({ recipientUserId }) {
if (c4958_10.messageGiftIntentLastShownMap[recipientUserId] == null) {
const messageGiftIntentLastShownMap = c4958_10.messageGiftIntentLastShownMap;
let r11 = date;
if (r11 == null) {
r11 = Date.now();
}
messageGiftIntentLastShownMap[recipientUserId] = r11;
}
},
FRIENDS_LIST_GIFT_INTENTS_SHOWN: function handleFriendsListGiftIntentsShown() {
c4958_10.lastShownFriendsListGiftIntents = Array.from(c4958_11);
},
GIFT_INTENT_FLOW_PURCHASED_GIFT: function handleGiftIntentFlowPurchasedGift({ recipientUserId }) {
if (c4958_10.messageGiftIntentLastShownMap[recipientUserId] == null) {
const messageGiftIntentLastShownMap = c4958_10.messageGiftIntentLastShownMap;
let r11 = date;
if (r11 == null) {
r11 = Date.now();
}
messageGiftIntentLastShownMap[recipientUserId] = r11;
}
},
GIFT_INTENT_DISMISSALS_FETCH_SUCCESS: function handleGiftIntentDismissalsFetchSuccess({ dismissals, settingsTimestampMs }) {
const r8 = {
...c4958_10.messageGiftIntentLastShownMap
};
for (const item of dismissals) {
const { targetId, dismissedAtMs } = item;
const r36 = r8[targetId];
r8[targetId] = r36 == null ? dismissedAtMs : Math.max(r36, dismissedAtMs);
}
c4958_10.messageGiftIntentLastShownMap = pruneTimestampMap(r8, getCurrentTime(), 1296000000);
c4958_10.lastKnownGiftIntentDismissedAtMs = settingsTimestampMs;
},
DEV_TOOLS_FRIENDS_LIST_GIFT_INTENTS_SHOWN_RESET: function handleDevToolResetFriendsListGiftIntentsShown() {
c4958_10.lastShownFriendsListGiftIntents = [];
},
DEV_TOOLS_GIFT_MESSAGE_COOLDOWN_RESET: function handleDevToolResetGiftMessageCooldown() {
c4958_10.messageGiftIntentLastShownMap = {};
},
DEV_TOOLS_SET_FRIEND_ANNIVERSARY_COUNT: function handleDevToolSetFriendAnniversaryCount({ total }) {
if (total == null) {
c4958_15 = null;
c4958_16 = null;
updateFriendAnniversaries();
return void 0;
}
generateFriendAnniversaries(total);
},
DEV_TOOLS_RESAMPLE_FRIEND_ANNIVERSARIES: function handleDevToolResampleFriendAnniversaries() {
let r1 = c4958_15 != null;
if (r1) {
c4958_16 = null;
generateFriendAnniversaries(c4958_15);
r1 = true;
}
return r1;
},
DEV_TOOLS_SET_CURRENT_DATE: function handleDevToolSetCurrentDate(a0) {
date = a0.date;
},
DEV_TOOLS_RESET_CURRENT_DATE: function handleDevToolResetCurrentDate() {
date = null;
}
});
export default premiumGiftingIntentStore;
export const FRIENDS_LIST_ANNIVERSARY_DISPLAY_LIMIT = 5;
export const FRIENDS_TAB_BADGE_COOLDOWN_MS = 604800000;
@@ -0,0 +1,16 @@
// Metro module 8808 (f8809).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-gift-promotion-reminder",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export { apexExperiment as GiftPromotionReminderExperiment };
@@ -0,0 +1,16 @@
// Metro module 12605 (f12606).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-gifting-badge-desktop",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export { apexExperiment as GiftingBadgeDesktopExperiment };
@@ -0,0 +1,16 @@
// Metro module 8771 (f8772).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-gifting-badge",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export { apexExperiment as GiftingBadgeExperiment };
@@ -0,0 +1,29 @@
// Metro module 8805 (f8806).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-nitro-gifting-price-copy-tweaks",
kind: "user",
defaultConfig: {
showGiftPrice: true,
useNewCopy: false,
monthlyDefaultSelected: false
},
variations: {
1: {
showGiftPrice: false,
useNewCopy: false,
monthlyDefaultSelected: false
},
2: {
showGiftPrice: true,
useNewCopy: true,
monthlyDefaultSelected: false
},
3: {
showGiftPrice: true,
useNewCopy: true,
monthlyDefaultSelected: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,5 @@
// Metro module 8776 (f8777).
import { PremiumGiftStyles } from "../../PremiumConstants";
export function useGiftStyles() {
return [PremiumGiftStyles.STANDARD_BOX];
}
@@ -0,0 +1,4 @@
// Metro module 9786 (f9787).
export default function useGiftingPromotionConfig() {
return null;
};
@@ -0,0 +1,6 @@
// Metro module 9781 (f9782).
export function useGiftingPromotionDefaultSelectionV2(a0, a1) {
if (a0 != null && a0.length !== 0) {
return a1 != null && a0.includes(a1) ? a1 : a0[0];
}
}
@@ -0,0 +1,144 @@
// Metro module 11006 (f11007).
import { useRef, useState, useCallback } from "react";
import { View } from "react-native";
import ChannelStore from "../../../../stores/ChannelStore";
import { AnalyticEvents } from "../../../../Constants";
import { MessageSendLocation } from "../../../messages/MessageConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import MessageActionCreators from "../../../../actions/MessageActionCreators";
import MessageParser from "../../../messages/MessageParser";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import AnalyticsLocation from "../../../app_analytics/AnalyticsLocation";
import useSafeAreaInsetsKeyboardAware_native from "../../../safe_area/useSafeAreaInsetsKeyboardAware.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { TextArea } from "../../../../design/components/TextInput/native/TextArea.native";
import { intl, t } from "../../../../intl/index.native";
import { getGiftIntentCustomMessagePlaceholder } from "./GiftIntentMessagePlaceholder";
import GIFPicker from "../../../gif_picker/native/GIFPicker";
import { Button } from "../../../../design/components/Button/native/Button.native";
import ModalActionCreators from "../../../../actions/ModalActionCreators";
import useInitialValue from "../../../../hooks/useInitialValue";
import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native";
let useStyles, GiftIntentGifModalBody, c7415_15;
let _sendGiftIntentGif = function _sendGiftIntentGif() {
const r8 = async (c26903_0) => {
let c26903_2;
c26903_2 = void 0;
let c30330_0 = c26903_0.channel;
let c30330_1 = c26903_0.giftIntentType;
let c30330_2 = c26903_0.text;
let c30330_3 = c26903_0.gif;
await void 0;
let c30330_4 = c30330_2.trim().length > 0;
if (c30330_4) {
await MessageActionCreators.sendMessage(c30330_0.id, MessageParser.parse(c30330_0, c30330_2), true, {
location: MessageSendLocation.GIFTING
});
}
await MessageActionCreators.sendMessage(c30330_0.id, MessageParser.parse(c30330_0, c30330_3.url), true, {
location: MessageSendLocation.GIFTING
});
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_MESSAGE_SENT, {
gift_intent_type: c30330_1,
is_custom_message: c30330_4,
location_stack: [AnalyticsLocation.PREMIUM_GIFT_INTENT_CARD]
});
};
_sendGiftIntentGif = r8;
return r8.apply(this, arguments);
};
GiftIntentGifModalBody = function GiftIntentGifModalBody(props) {
let ref, state, setState;
const { channelId, giftIntentType, onClose } = props;
ref = void 0;
state = void 0;
setState = void 0;
const styles = useStyles();
const insets = useSafeAreaInsetsKeyboardAware_native().insets;
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
ref = useRef(null);
[state, setState] = useState(null);
const ref2 = useRef(null);
const callback2 = useCallback((c26904_0) => {
setState((prevState) => {
const src = prevState?.src;
return src !== c26904_0.src ? c26904_0 : null;
});
}, []);
const callback3 = useCallback(() => {
if (stateFromStores != null && state != null && state.url.length !== 0) {
const current = ref.current;
let text = current == null ? void 0 : current.getText();
if (text == null) {
text = "";
}
(function sendGiftIntentGif() {
return _sendGiftIntentGif.apply(this, arguments);
})({
channel: stateFromStores,
giftIntentType,
text,
gif: state
});
onClose();
}
}, [stateFromStores, giftIntentType, state, onClose]);
const r74 = [<View style={styles.messageContainer}>
<TextArea ref={ref} accessibilityLabel={intl.string(t.ZV02cV)} placeholder={getGiftIntentCustomMessagePlaceholder()} />
</View>, , ,];
let guildId = stateFromStores?.guild_id;
if (guildId == null) {
guildId = void 0;
}
r74[1] = <View style={styles.pickerContainer}>
<GIFPicker bottomSheetRef={ref2} channelId={channelId} guildId={guildId} initialQuery={intl.string(t.jrtJi4)} inActionSheet={false} contentHorizontalPadding={Module712.space.PX_16} selectedGifSrc={state?.src} keyboardDismissMode="on-drag" onPressGIF={callback2} />
</View>;
r74[2] = <View style={styles.footer}>
<Button grow variant="primary" text={intl.string(t.TXNS7S)} onPress={callback3} disabled={state == null} />
<Button grow variant="secondary" text={intl.string(t["ETE/oC"])} onPress={onClose} />
</View>;
return <View style={[styles.container, {
paddingBottom: insets.bottom
}]}>{r74}</View>;
};
useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
messageContainer: {
paddingHorizontal: Module712.space.PX_16,
paddingBottom: Module712.space.PX_8
},
pickerContainer: {
flex: 1
},
footer: {
gap: Module712.space.PX_8,
paddingHorizontal: Module712.space.PX_16,
paddingTop: Module712.space.PX_8
}
});
c7415_15 = {
GIFT_INTENT_GIF: "GIFT_INTENT_GIF"
};
export default function GiftIntentGifModal(props) {
const { channelId: channelId2, giftIntentType: giftIntentType2, onDismiss } = props;
const callback = useCallback(() => {
ModalActionCreators.pop();
if (onDismiss != null) {
onDismiss();
}
}, [onDismiss]);
return <Navigator initialRouteName={c7415_15.GIFT_INTENT_GIF} screens={useInitialValue(() => {
const r1 = {};
r1[c7415_15.GIFT_INTENT_GIF] = {
title: intl.string(t.PQRuGc),
headerLeft: getHeaderCloseButton(callback),
render: () => <GiftIntentGifModalBody channelId={channelId2} giftIntentType={giftIntentType2} onClose={callback} />
};
return r1;
})} />;
};
@@ -0,0 +1,5 @@
// Metro module 11007 (f11008).
import { intl, t } from "../../../../intl/index.native";
export function getGiftIntentCustomMessagePlaceholder() {
return intl.string(t.OrwKgi);
}
@@ -0,0 +1,107 @@
// Metro module 9705 (f9706).
import { useEffect } from "react";
import { View } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import BadgeDirectoryStore, { getSingleRequirementThreshold } from "../../../badges/BadgeDirectoryStore";
import { AnalyticEvents } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { BadgeId } from "../../../../_bundle/Module8106";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl } from "../../../../intl/index.native";
import GiftingBadge_messages from "../GiftingBadge.messages";
import GiftingBadgeIcon from "./views/GiftingBadgeIcon";
const useStyles = createStyles({
container: {
alignItems: "center",
paddingTop: Module712.space.PX_16,
paddingHorizontal: Module712.space.PX_16
},
headerContainer: {
paddingHorizontal: Module712.space.PX_8
},
title: {
textAlign: "center",
marginBottom: Module712.space.PX_8
},
description: {
textAlign: "center",
marginBottom: Module712.space.PX_16
},
tierCards: {
flexDirection: "row",
flexWrap: "wrap",
rowGap: Module712.space.PX_8
},
tierCard: {
width: "33.33%",
alignItems: "center",
padding: Module712.space.PX_8
},
iconWrapper: {
paddingVertical: Module712.space.PX_8
}
});
export default function GiftingBadgeInfoActionSheet() {
let stateFromStores;
const styles = useStyles();
const bottom = useSafeAreaInsets_native().bottom;
const stateFromStores2 = useStateFromStores([BadgeDirectoryStore], () => BadgeDirectoryStore.getBadgeById(BadgeId.GIFTING));
stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
useEffect(() => {
AnalyticsUtils.track(AnalyticEvents.GIFTING_BADGE_INFO_ACTION_SHEET_OPENED);
}, []);
const r80 = [<View style={styles.headerContainer}>
<Text style={styles.title} variant="heading-xl/semibold" color="text-strong" accessibilityRole="header">
{intl.string(GiftingBadge_messages["0MB2C6"])}
</Text>
<Text style={styles.description} variant="text-md/medium" color="text-default">
{intl.string(GiftingBadge_messages.k9sNVH)}
</Text>
</View>, ,];
const r2 = stateFromStores2 == null;
let r83 = void 0;
if (!r2) {
const tiers = stateFromStores2.tiers;
r83 = tiers == null ? void 0 : tiers.map((tier) => {
let icon;
if (stateFromStores) {
let complex_icon_static_url = tier.complex_icon_static_url;
if (complex_icon_static_url == null) {
complex_icon_static_url = tier.simple_icon_url;
}
icon = complex_icon_static_url;
} else {
icon = tier.complex_icon_animated_url;
if (icon == null) {
icon = tier.complex_icon_static_url;
}
if (icon == null) {
icon = tier.simple_icon_url;
}
}
const singleRequirementThreshold = getSingleRequirementThreshold(tier);
return <View key={tier.key} style={styles.tierCard}>
{icon != null && <View style={styles.iconWrapper}>
<GiftingBadgeIcon icon={icon} size={58} />
</View>}
<Text variant="text-lg/semibold" color="text-strong">{tier.name}</Text>
{singleRequirementThreshold != null && <Text variant="text-md/normal" color="text-subtle">
{intl.formatToPlainString(GiftingBadge_messages.qvx9E4, {
count: singleRequirementThreshold
})}
</Text>}
</View>;
});
}
r80[1] = <View style={styles.tierCards}>{r83}</View>;
return <BottomSheet scrollable={false} startExpanded>
<View style={[styles.container, {
paddingBottom: bottom + Module712.space.PX_16
}]}>{r80}</View>
</BottomSheet>;
};
@@ -0,0 +1,15 @@
// Metro module 7856 (f7857).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-mobile-friendship-anniversary",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,76 @@
// Metro module 16300 (f16301).
import UserAffinitiesV2Store from "../../../user_affinities/UserAffinitiesV2Store";
import ChannelStore from "../../../../stores/ChannelStore";
import MessageStore from "../../../../stores/MessageStore";
import SelectedChannelStore from "../../../../stores/SelectedChannelStore";
import PremiumGiftingIntentStore from "../PremiumGiftingIntentStore";
import { GiftIntentSecondaryAction, GiftIntentType } from "../../PremiumConstants";
import GiftIntentReconcilingManager from "../shared/GiftIntentReconcilingManager";
import { ChannelTypes } from "../../../../_bundle/Module692";
import { EnableFriendAnniversaryNotifications } from "../../../user_settings/UserSettings";
import { logMessageGiftIntentShown } from "../PremiumGiftingIntentActionCreators";
import { trackImpression } from "../../../app_analytics/useTrackImpression";
import { ImpressionNames, ImpressionTypes } from "../../../../_bundle/Module503";
import { DelayedCall } from "../../../../_bundle/Timeout";
import MobileFriendAnniversaryExperiment from "./MobileFriendAnniversaryExperiment";
import { fetchUserAffinitiesV2 } from "../../../user_affinities/UserAffinitiesActionCreators";
class MobileGiftIntentCardManager extends GiftIntentReconcilingManager {
isChannelEligible(a0) {
return a0.type === ChannelTypes.DM;
}
maybeSendCard(a0, a1) {
if (EnableFriendAnniversaryNotifications.getSetting() && !PremiumGiftingIntentStore.isGiftIntentMessageInCooldown(a1) && a0 === SelectedChannelStore.getChannelId()) {
if (MessageStore.isReady(a0)) {
if (this.trySendGiftingPromptSystemMessage(a0, GiftIntentType.FRIEND_ANNIVERSARY, a1, GiftIntentSecondaryAction.SEND_MESSAGE, "maybeSendCard")) {
logMessageGiftIntentShown(a1);
trackImpression({
name: ImpressionNames.GIFT_INTENT_UNREAD_NOTIFICATION,
type: ImpressionTypes.VIEW,
properties: {
gift_intent_type: GiftIntentType.FRIEND_ANNIVERSARY,
dm_affinity: UserAffinitiesV2Store.getUserAffinity(a1)?.dmProbability,
channel_id: a0
}
});
}
} else {
MessageStore.whenReady(a0, () => {
const channelId = SelectedChannelStore.getChannelId();
if (channelId === a0) {
this.maybeSendCard(a0, a1);
}
});
}
}
}
sendCardInSelectedChannelIfEligible(a0) {
let c22957_0, c22957_2;
const channel = ChannelStore.getChannel(a0);
if (channel != null && this.isChannelEligible(channel)) {
c22957_2 = new Set(channel.recipients);
const r24 = PremiumGiftingIntentStore.getFriendAnniversaries().find((item) => c22957_2.has(item));
c22957_0 = r24;
if (r24 != null) {
new DelayedCall(1000, () => {
this.maybeSendCard(channel.id, c22957_0);
}).delay();
}
}
}
maybeFetchUserAffinities() {
if (MobileFriendAnniversaryExperiment.getConfig({
location: "MobileGiftIntentCardManager"
}).enabled) {
fetchUserAffinitiesV2();
}
}
onChannelSelect(a0) {
this.sendCardInSelectedChannelIfEligible(a0.channelId);
}
sendGiftingPromptSystemMessagesIfEligible() {
this.maybeFetchUserAffinities();
this.sendCardInSelectedChannelIfEligible(SelectedChannelStore.getChannelId());
}
}
const mobileGiftIntentCardManager = new MobileGiftIntentCardManager();
export default mobileGiftIntentCardManager;
@@ -0,0 +1,9 @@
// Metro module 9710 (f9711).
import { PremiumTypes } from "../../../PremiumConstants";
import { useNativeGiftContext } from "../../../../payments/native/NativeGiftContext";
export default function useShouldShowGiftingPromotionDeco(a0) {
const nativeGiftContext = useNativeGiftContext();
const { claimableRewards, premiumType } = nativeGiftContext;
const r2 = a0 != null ? a0 === PremiumTypes.TIER_2 : premiumType === PremiumTypes.TIER_2;
return claimableRewards != null && claimableRewards.length > 0 && r2;
};
@@ -0,0 +1,5 @@
// Metro module 9704 (f9705).
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
export default function openGiftingBadgeInfoActionSheet() {
ActionSheetActionCreators.openLazy(import("./GiftingBadgeInfoActionSheet"), "GiftingBadgeInfoActionSheet");
};
@@ -0,0 +1,11 @@
// Metro module 9706 (f9707).
import { Image as Image2 } from "react-native";
export default function GiftingBadgeIcon(props) {
const { icon, size } = props;
return <Image2 source={{
uri: icon
}} style={[{
width: size,
height: size
}, props.style]} />;
};
@@ -0,0 +1,60 @@
// Metro module 9827 (f9828).
import { View } from "react-native";
import { getSingleRequirementThreshold } from "../../../../badges/BadgeDirectoryStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
const useStyles = createStyles({
container: {
gap: Module712.space.PX_4,
width: "100%"
},
barRow: {
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_8
},
progressBarTrack: {
flex: 1,
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
overflow: "hidden"
},
progressBarFill: {
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_BRAND
},
labels: {
flexDirection: "row",
justifyContent: "flex-end"
}
});
export default function GiftingBadgeLevelUpProgress(props) {
const { progress, currentTier, newTier, style } = props;
const styles = useStyles();
const singleRequirementThreshold = getSingleRequirementThreshold(newTier);
return <View style={[styles.container, style]}>
<View style={styles.barRow}>
{currentTier?.simple_icon_url != null && <GiftingBadgeIcon icon={currentTier.simple_icon_url} size={24} />}
<View style={styles.progressBarTrack}>
<View style={[styles.progressBarFill, {
width: `${singleRequirementThreshold > 0 ? Math.min(Math.max(progress / singleRequirementThreshold * 100, 0), 100) : 100}%`
}]} />
</View>
{newTier.simple_icon_url != null && <GiftingBadgeIcon icon={newTier.simple_icon_url} size={24} />}
</View>
<View style={styles.labels}>
<Text variant="text-xs/normal" color="text-muted">
{intl.format(GiftingBadge_messages.iIpfQe, {
count: progress,
threshold: singleRequirementThreshold
})}
</Text>
</View>
</View>;
};
@@ -0,0 +1,69 @@
// Metro module 9826 (f9827).
import { View } from "react-native";
import { getSingleRequirementThreshold } from "../../../../badges/BadgeDirectoryStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
let useStyles;
const GiftingBadgeProgressBar = function GiftingBadgeProgressBar(props) {
const percent = props.percent;
const styles = useStyles();
return <View style={styles.progressBarTrack}>
<View style={[styles.progressBarFill, {
width: `${Math.min(Math.max(percent, 0), 100)}%`
}]} />
</View>;
};
useStyles = createStyles({
container: {
flexDirection: "row",
alignItems: "center",
padding: Module712.space.PX_16
},
content: {
flex: 1,
paddingHorizontal: Module712.space.PX_8,
gap: Module712.space.PX_4
},
progressBarTrack: {
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
overflow: "hidden"
},
progressBarFill: {
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_BRAND
},
labels: {
flexDirection: "row",
justifyContent: "flex-end",
alignItems: "center",
minHeight: Module712.space.PX_16
}
});
export default function GiftingBadgeProgress(props) {
const { progress, currentTier, nextTier, iconSize = 24, title } = props;
const styles = useStyles();
const singleRequirementThreshold = getSingleRequirementThreshold(nextTier);
return <View style={styles.container}>
{currentTier?.simple_icon_url != null && <GiftingBadgeIcon icon={currentTier.simple_icon_url} size={iconSize} />}
<View style={styles.content}>
{title != null && <Text variant="text-md/semibold">{title}</Text>}
<GiftingBadgeProgressBar percent={nextTier != null && singleRequirementThreshold > 0 ? Math.min(Math.max(progress / singleRequirementThreshold * 100, 0), 100) : 100} />
<View style={styles.labels}>
{nextTier != null && <Text variant="text-xs/normal" color="text-muted">
{intl.format(GiftingBadge_messages.iIpfQe, {
count: progress,
threshold: singleRequirementThreshold
})}
</Text>}
</View>
</View>
{nextTier?.simple_icon_url != null && <GiftingBadgeIcon icon={nextTier.simple_icon_url} size={iconSize} />}
</View>;
};
@@ -0,0 +1,56 @@
// Metro module 9713 (f9714).
import { View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import useAnalyticsLocations from "../../../../app_analytics/useAnalyticsLocations";
import useTrackImpression from "../../../../app_analytics/useTrackImpression";
import { ImpressionNames, ImpressionTypes } from "../../../../../_bundle/Module503";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
const useStyles = createStyles({
container: {
flexDirection: "row",
alignItems: "center",
padding: Module712.space.PX_8,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.sm,
borderWidth: 1,
borderStyle: "solid",
borderColor: Module712.colors.BORDER_MUTED,
...Module712.shadows.SHADOW_LOW
},
iconContainer: {
alignItems: "center",
justifyContent: "center",
padding: Module712.space.PX_8,
marginInlineEnd: Module712.space.PX_8
}
});
export default function GiftingBadgeProgressBanner(props) {
const { giftsToNextTier, nextTierName, nextTierIcon, analyticsLocation } = props;
const styles = useStyles();
useTrackImpression({
name: ImpressionNames.GIFTING_BADGE_PROGRESS_BANNER,
type: ImpressionTypes.VIEW,
properties: {
gifts_to_next_tier: giftsToNextTier,
next_tier: nextTierName,
location_stack: useAnalyticsLocations.apply(void 0, [...analyticsLocation != null ? [analyticsLocation] : []]).analyticsLocations
}
}, {
trackOnInitialLoad: true
});
return <View style={styles.container}>
<View style={styles.iconContainer}>
{nextTierIcon != null && <GiftingBadgeIcon icon={nextTierIcon} size={24} />}
</View>
<Text variant="text-md/semibold">
{intl.formatToPlainString(GiftingBadge_messages["0+xfd9"], {
giftsRemaining: giftsToNextTier,
nextTier: nextTierName
})}
</Text>
</View>;
};
@@ -0,0 +1,137 @@
// Metro module 15766 (f15767).
import { useCallback } from "react";
import { Image as Image2, View } from "react-native";
import BadgeDirectoryStore from "../../../../badges/BadgeDirectoryStore";
import { ContentDismissActionType } from "../../../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { getRootNavigationRef } from "../../../../main_tabs_v2/RootNavigationRef.native";
import { BottomSheet } from "../../../../../design/components/Sheet/native/BottomSheet.native";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
import { Button } from "../../../../../design/components/Button/native/Button.native";
import { openGiftModal } from "../../../native/utils/openGiftModal";
import AnalyticsLocation from "../../../../app_analytics/AnalyticsLocation";
import Module15767 from "../../../../../_bundle/Module15767";
import { GiftIcon } from "../../../../../design/components/Icon/native/redesign/generated/GiftIcon";
import { useStateFromStoresObject } from "../../../../../_bundle/Module589";
import { BadgeId } from "../../../../../_bundle/Module8106";
let useStyles, NewBadgeCoachmark;
const HasBadgeCoachmark = function HasBadgeCoachmark(props) {
const { markAsDismissed, currentTier } = props;
let giftCount = props.giftCount;
const styles = useStyles();
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
markAsDismissed(ContentDismissActionType.TAKE_ACTION);
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.navigate("you");
}
}, [markAsDismissed]);
const callback2 = useCallback(() => {
markAsDismissed(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed]);
const r44 = [<View style={styles.graphicContainer}>
{currentTier.simple_icon_url != null && <GiftingBadgeIcon icon={currentTier.simple_icon_url} size={120} />}
</View>, , ,];
const r57 = GiftingBadge_messages["a+jfuy"];
let name = currentTier.name;
if (name == null) {
name = "";
}
const r61 = [<Text style={styles.text} variant="heading-xl/bold" color="text-strong">
{intl.format(r57, {
tierName: name
})}
</Text>, ,];
if (giftCount == null) {
giftCount = 0;
}
r61[1] = <Text style={styles.text} variant="text-sm/medium" color="text-default">
{intl.formatToPlainString(GiftingBadge_messages.QxRA6w, {
giftCount
})}
</Text>;
r44[1] = <View style={styles.textContainer}>{r61}</View>;
r44[2] = <View style={styles.footer}>
<Button grow text={intl.string(t.RzWDqY)} onPress={callback} />
</View>;
return <BottomSheet startExpanded onDismiss={callback2}>
<View style={styles.container}>{r44}</View>
</BottomSheet>;
};
NewBadgeCoachmark = function NewBadgeCoachmark(props) {
const markAsDismissed2 = props.markAsDismissed;
const styles = useStyles();
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
markAsDismissed2(ContentDismissActionType.TAKE_ACTION);
openGiftModal({
analyticsLocations: [AnalyticsLocation.GIFTING_BADGE_COACHMARK]
});
}, [markAsDismissed2]);
return <BottomSheet startExpanded onDismiss={useCallback(() => {
markAsDismissed2(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed2])}>
<View style={styles.container}>
<View style={styles.graphicContainer}>
<Image2 source={{
uri: Module15767
}} style={styles.newBadgeImage} />
</View>
<View style={styles.textContainer}>
<Text style={styles.text} variant="heading-xl/bold" color="mobile-text-heading-primary">
{intl.string(GiftingBadge_messages.Q2RQka)}
</Text>
<Text style={styles.text} variant="text-sm/medium" color="text-muted">
{intl.string(GiftingBadge_messages["3EQnkg"])}
</Text>
</View>
<View style={styles.footer}>
<Button grow text={intl.string(GiftingBadge_messages.DZnomS)} icon={<GiftIcon size="sm" color={Module712.colors.CONTROL_PRIMARY_TEXT_DEFAULT} />} onPress={callback} />
</View>
</View>
</BottomSheet>;
};
useStyles = createStyles({
container: {
alignItems: "center",
paddingHorizontal: 20,
paddingBottom: 20,
gap: Module712.space.PX_24
},
graphicContainer: {
height: 188,
width: 335,
alignItems: "center",
justifyContent: "center",
padding: Module712.space.PX_16
},
newBadgeImage: {
width: "100%",
height: "100%",
objectFit: "contain"
},
textContainer: {
gap: Module712.space.PX_8
},
text: {
textAlign: "center"
},
footer: {
width: "100%"
}
});
export default function GiftingBadgesCoachmarkActionSheet(props) {
const markAsDismissed3 = props.markAsDismissed;
const stateFromStoresObject = useStateFromStoresObject([BadgeDirectoryStore], () => ({
currentTier: BadgeDirectoryStore.getCurrentTier(BadgeId.GIFTING),
giftCount: BadgeDirectoryStore.getSingleRequirementProgress(BadgeId.GIFTING)?.current
}));
const { currentTier, giftCount } = stateFromStoresObject;
return currentTier != null ? <HasBadgeCoachmark markAsDismissed={markAsDismissed3} currentTier={currentTier} giftCount={giftCount} /> : <NewBadgeCoachmark markAsDismissed={markAsDismissed3} />;
};
@@ -0,0 +1,10 @@
// Metro module 9784 (f9785).
import AccessibilityStore from "../../../../a11y/AccessibilityStore";
import UserStore from "../../../../../stores/UserStore";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import { Avatar } from "../../../../../design/void/native";
export default function GiftingRewardPreviewAvatar(props) {
return <Avatar user={useStateFromStores([UserStore], () => UserStore.getCurrentUser())} guildId={void 0} avatarDecoration={props.asset != null ? {
asset: props.asset
} : void 0} animate={!useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion)} {...props} />;
};
@@ -0,0 +1,78 @@
// Metro module 15756 (f15757).
import { useCallback } from "react";
import { View } from "react-native";
import AccessibilityStore from "../../../../../a11y/AccessibilityStore";
import { AnalyticsObjects, AnalyticsPages, AnalyticsSections } from "../../../../../../Constants";
import { ContentDismissActionType } from "../../../../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../../../_bundle/Module589";
import { useThemeAndReducedMotionAwareAssetUrl } from "../../../../promotions/MarketingComponentHooks";
import useAnalyticsLocations from "../../../../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../../../../app_analytics/AnalyticsLocation";
import ActionSheetActionCreators from "../../../../../action_sheet/native/ActionSheetActionCreators";
import { openGiftModal } from "../../../../native/utils/openGiftModal";
import { BottomSheet } from "../../../../../../design/components/Sheet/native/BottomSheet.native";
import { isAndroid } from "../../../../../../utils/PlatformUtils";
import Module6208 from "../../../../../../_bundle/Module6208";
import FastImage from "../../../../../../components_native/common/FastImage";
import { Text } from "../../../../../../design/components/Text/native/Text";
import { Button } from "../../../../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../../../../intl/index.native";
const useStyles = createStyles({
container: {
alignItems: "center",
padding: Module712.space.PX_16
},
textContainer: {
gap: Module712.space.PX_8,
paddingHorizontal: Module712.space.PX_16,
paddingVertical: Module712.space.PX_24
},
text: {
textAlign: "center"
},
imageShared: {
height: 188,
width: 335,
borderRadius: Module712.radii.sm
},
imageWrapperAndroid: {
overflow: "hidden"
}
});
export default function GiftingPromotionCoachmarkActionSheet(props) {
let analyticsLocations;
const { coachmarkComponent, markAsDismissed } = props;
analyticsLocations = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const themeAndReducedMotionAwareAssetUrl = useThemeAndReducedMotionAwareAssetUrl(coachmarkComponent?.asset);
analyticsLocations = useAnalyticsLocations(AnalyticsLocation.GIFTING_PROMOTION_COACHMARK).analyticsLocations;
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
markAsDismissed(ContentDismissActionType.TAKE_ACTION);
openGiftModal({
analyticsLocation: {
page: AnalyticsPages.PREMUIM_UPSELL_GIFTING_PROMOTION,
section: AnalyticsSections.FOOTER,
object: AnalyticsObjects.BUTTON_CTA
},
analyticsLocations
});
}, [analyticsLocations, markAsDismissed]);
return coachmarkComponent == null ? null : <BottomSheet startExpanded onDismiss={() => markAsDismissed(ContentDismissActionType.USER_DISMISS)}>
<View style={styles.container}>
{themeAndReducedMotionAwareAssetUrl != null && (isAndroid() && !stateFromStores ? <View style={[styles.imageShared, styles.imageWrapperAndroid]}>
<Module6208 url={themeAndReducedMotionAwareAssetUrl} style={styles.imageShared} />
</View> : <FastImage source={{
uri: themeAndReducedMotionAwareAssetUrl
}} style={styles.imageShared} />)}
<View style={styles.textContainer}>
<Text style={styles.text} variant="heading-xl/extrabold" color="mobile-text-heading-primary">{coachmarkComponent.header}</Text>
<Text style={styles.text} variant="text-md/normal" color="text-default">{coachmarkComponent.body}</Text>
</View>
<Button grow text={intl.string(t.RzWDqY)} onPress={callback} />
</View>
</BottomSheet>;
};
@@ -0,0 +1,116 @@
// Metro module 9779 (f9780).
import * as Module19 from "react";
import { useMemo } from "react";
import { View } from "react-native";
import { isAvatarDecorationRecord } from "../../../../../collectibles/records/AvatarDecorationRecord";
import { isNameplateRecord } from "../../../../../collectibles/records/NameplateRecord";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { useCurrentUser } from "../../../../../collectibles/hooks/useCurrentUser";
import { useRadioA11yNative } from "../../../../../../_bundle/Module3907";
import { useFetchCollectiblesProduct } from "../../../../../collectibles/hooks/useFetchCollectiblesProduct";
import { PressableOpacity } from "../../../../../../design/void/Pressables/native/Pressables";
import NameplateCardPreview from "../../../../../collectibles/nameplates/native/NameplateCardPreview";
import AvatarDecorationSampleV2 from "../../../../../collectibles/native/AvatarDecorationSampleV2";
import { CheckmarkLargeBoldIcon } from "../../../../../../design/components/Icon/native/redesign/generated/CheckmarkLargeBoldIcon";
import { Text } from "../../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../../intl/index.native";
let useStyles2;
const useStyles = createStyles({
card: {
height: 178,
width: 150,
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
borderWidth: 1,
borderRadius: Module712.radii.sm,
overflow: "hidden",
borderColor: Module712.colors.BORDER_SUBTLE,
margin: Module712.space.PX_4
},
overlayContainer: {
position: "absolute",
top: 10,
zIndex: 2,
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "75%"
},
selected: {
borderColor: Module712.colors.BACKGROUND_BRAND
},
claimed: {
opacity: 0.4
},
checkmark: {
position: "absolute",
opacity: 1,
fontWeight: "bold"
},
checkmarkContainer: {
position: "absolute",
top: 10,
zIndex: 3,
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "75%"
},
textContainer: {
position: "absolute",
bottom: 20,
left: 0,
right: 0,
paddingHorizontal: Module712.space.PX_16,
alignItems: "flex-start"
}
});
let Component = Module19.memo(function({ rewardSkuId, claimed, onSelect, isSelected }) {
const styles = useStyles();
const currentUser = useCurrentUser();
const radioA11yNative = useRadioA11yNative({
selected: isSelected
});
const { accessibilityRole, accessibilityState } = radioA11yNative;
const product = useFetchCollectiblesProduct(rewardSkuId).product;
const memo = useMemo(() => isSelected ? currentUser.getAvatarSource(null, true, 100) : void 0, [isSelected, currentUser]);
if (product == null) {
return null;
}
const item = product.items[0];
const style = [styles.card, isSelected ? styles.selected : isSelected];
return <PressableOpacity style={style} onPress={() => onSelect(rewardSkuId)} activeOpacity={0.8} disabled={claimed} accessibilityRole={accessibilityRole} accessibilityState={accessibilityState}>
<View style={[styles.overlayContainer, claimed ? styles.claimed : claimed]}>
{isNameplateRecord(item) ? <NameplateCardPreview item={item} animate={isSelected} /> : isAvatarDecorationRecord(item) ? <AvatarDecorationSampleV2 item={item} size={100} animate={isSelected} avatarSource={memo} /> : void 0}
</View>
{claimed && <View style={styles.checkmarkContainer}>
<CheckmarkLargeBoldIcon size="lg" style={styles.checkmark} />
</View>}
<View style={styles.textContainer}>
<Text variant="heading-sm/bold" color="mobile-text-heading-primary" lineClamp={1} accessibilityRole="header">{product.name}</Text>
<Text variant="text-xs/semibold" color="mobile-text-heading-primary" lineClamp={1}>
{claimed ? intl.string(t["6cfuDj"]) : intl.string(t.QQsaCc)}
</Text>
</View>
</PressableOpacity>;
});
useStyles2 = createStyles({
grid: {
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "center"
}
});
export default function GiftingSKUCardsGrid(props) {
const { rewardsToDisplay, claimableRewards, onSelect: onSelect2, highlightedSkuId } = props;
return <View style={useStyles2().grid}>
{rewardsToDisplay.map((item) => {
return <Component key={item} rewardSkuId={item} claimed={!claimableRewards.some((claimableReward) => claimableReward === item)} isSelected={highlightedSkuId === item} onSelect={onSelect2} />;
})}
</View>;
};
@@ -0,0 +1,88 @@
// Metro module 9778 (f9779).
import { useState, useCallback, useMemo, useEffect } from "react";
import { ScrollView, View } from "react-native";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../../../../safe_area/useSafeAreaInsets.native";
import { Text } from "../../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../../intl/index.native";
import GiftingSKUCardsGrid from "./GiftingSKUCardsGrid";
import { Button } from "../../../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
scroll: {
flex: 1
},
contentContainer: {
display: "flex",
flexDirection: "column",
padding: Module712.space.PX_24
},
header: {
textAlign: "center",
padding: Module712.space.PX_8
},
subtitle: {
textAlign: "center"
},
buttonContainer: {
marginHorizontal: Module712.space.PX_16,
marginBottom: Module712.space.PX_24
},
headerContainer: {
marginBottom: Module712.space.PX_24
}
});
export default function GiftingSKUSelectScreen(props) {
let memo;
const { defaultHighlightedReward, allRewards, claimableRewards, onSelect } = props;
memo = void 0;
const styles = useStyles();
const bottom = useSafeAreaInsets_native().bottom;
const [state, setState] = useState(defaultHighlightedReward);
const [state2, setState2] = useState(false);
const callback = useCallback(() => {
const r5 = claimableRewards.find((claimableReward) => claimableReward === state);
if (r5 != null) {
onSelect(r5);
}
}, [onSelect, state, claimableRewards]);
const callback2 = useCallback((a0) => {
setState(a0);
setState2(true);
}, []);
memo = useMemo(() => state != null && claimableRewards.some((claimableReward) => claimableReward === state), [state, claimableRewards]);
useEffect(() => {
L11: {
if (claimableRewards.length === 0) {
setState(void 0);
} else {
if (memo && claimableRewards.some((claimableReward) => claimableReward === state)) {
break L11;
}
setState((state2 ? !state2 : defaultHighlightedReward != null) && claimableRewards.some((claimableReward) => claimableReward === defaultHighlightedReward) ? defaultHighlightedReward : void 0);
}
}
}, [state, claimableRewards, state2, defaultHighlightedReward, memo]);
return <View style={styles.container}>
<ScrollView style={styles.scroll} contentContainerStyle={styles.contentContainer}>
<View style={styles.headerContainer}>
<Text style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary" accessibilityRole="header">
{intl.string(t["+ByEeM"])}
</Text>
<Text style={styles.subtitle} variant="text-md/medium" color="text-default">
{intl.string(t.vPeaOS)}
</Text>
</View>
<GiftingSKUCardsGrid rewardsToDisplay={allRewards} claimableRewards={claimableRewards} onSelect={callback2} highlightedSkuId={state} />
</ScrollView>
<View style={[styles.buttonContainer, {
paddingBottom: bottom
}]}>
<Button text={intl.string(t["3d0Nmb"])} onPress={callback} disabled={state == null || !memo} />
</View>
</View>;
};
@@ -0,0 +1,59 @@
// Metro module 7854 (f7855).
import { setYear, isSameDay, differenceInDays, differenceInMonths } from "../../../../_bundle/Module3414";
export const FRIEND_ANNIVERSARY_ELIGIBILITY_WINDOW_DAYS = 7;
export function isFriendAnniversary(a0) {
const date = new Date();
const fullYear = date.getFullYear();
for (const item of [-1, 0, 1]) {
const r36 = setYear(a0, fullYear + item);
if (isSameDay(r36, a0)) {
continue;
}
if (!(Math.abs(differenceInDays(date, r36)) <= 7)) {
continue;
}
return true;
}
return false;
}
export function yearsSince(a0) {
return Math.round(differenceInMonths(new Date(), a0) / 12);
}
export function categorizeFriendAnniversariesByAffinity(a0, a1, a2) {
const set = new Set();
let c16043_0 = set;
const set2 = new Set();
let c16043_1 = set2;
if (a2) {
a0.slice(0, Math.ceil(a0.length / 2)).forEach((item) => {
c16043_0.add(item);
});
a0.forEach((item) => {
c16043_1.add(item);
});
} else {
for (const item of a0) {
const r39 = a1(item);
if (r39 != null && r39 > 0.7) {
set.add(item);
}
if (r39 != null && r39 > 0.5) {
set2.add(item);
}
}
}
return {
highestAffinity: set,
highAffinity: set2
};
}
export function pruneTimestampMap(a0, a1, a2) {
const r2 = {};
for (const key in a0) {
const r9 = a0[key];
if (a1 - r9 <= a2) {
r2[key] = r9;
}
}
return r2;
}
@@ -0,0 +1,141 @@
// Metro module 16301 (f16302).
import EphemeralMessageStore from "../../../messages/EphemeralMessageStore";
import UserSettingsProtoStore from "../../../user_settings/UserSettingsProtoStore";
import ChannelStore from "../../../../stores/ChannelStore";
import PremiumGiftingIntentStore from "../PremiumGiftingIntentStore";
import { MessageTypes } from "../../../../Constants";
import Durations from "../../../../utils/Durations";
import AutomaticLifecycleManager from "../../../../lib/AutomaticLifecycleManager";
import Backoff from "../../../../_bundle/Backoff";
import { FriendshipAnniversaryBackendPersistenceExperiment } from "../../experiments/FriendshipAnniversaryBackendPersistenceExperiment";
import { fetchAndReconcileGiftIntentDismissals } from "../PremiumGiftingIntentActionCreators";
import Dispatcher from "../../../../Dispatcher";
import MessageActionCreators from "../../../../actions/MessageActionCreators";
let c11720_8 = 10 * Durations.Millis.SECOND;
let c11720_9 = 5 * Durations.Millis.MINUTE;
class GiftIntentReconcilingManager extends AutomaticLifecycleManager {
actions = {
POST_CONNECTION_OPEN: () => this.onPostConnectionOpen(),
CHANNEL_SELECT: (a0) => this.onChannelSelect(a0),
GIFT_INTENT_DISMISSALS_FETCH_SUCCESS: (a0) => this.onReconcileSuccess(a0),
GIFT_INTENT_DISMISSALS_FETCH_FAILURE: () => this.onReconcileSettled(false),
LOGOUT: () => this.onLogout()
};
stores = new Map([[PremiumGiftingIntentStore, () => this.onPremiumGiftingIntentStoreChange()]]);
reconcileBackoff = new Backoff(c11720_8, c11720_9);
isReconciling = false;
heldGiftingPromptSystemMessage = false;
lastReconciledDismissalAtMs = new Map();
retryReconcileServerDismissals = () => {
if (this.isReconcileEligible("retryReconcileServerDismissals")) {
this.attemptReconcileFetch();
}
};
onPostConnectionOpen() {
this.lastReconciledDismissalAtMs.clear();
this.sendGiftingPromptSystemMessagesIfEligible();
}
onPremiumGiftingIntentStoreChange() {
this.maybeReconcileServerDismissals();
this.maybeRetryHeldGiftingPromptSystemMessage();
}
maybeReconcileServerDismissals() {
if (this.isReconcileEligible("maybeReconcileServerDismissals") && !this.reconcileBackoff.pending) {
this.attemptReconcileFetch();
}
}
isReconcileEligible(a0) {
return PremiumGiftingIntentStore.getFriendAnniversaries().length !== 0 && FriendshipAnniversaryBackendPersistenceExperiment.getConfig({
location: a0
}).enabled;
}
getServerDismissalTimestampMs() {
const r4 = Number;
let r9 = UserSettingsProtoStore.settings.userContent?.lastGiftIntentDismissedAtMs;
if (r9 == null) {
r9 = "0";
}
return r4(r9);
}
attemptReconcileFetch() {
const serverDismissalTimestampMs = this.getServerDismissalTimestampMs();
if (!(PremiumGiftingIntentStore.getLastKnownGiftIntentDismissedAtMs() >= serverDismissalTimestampMs || this.isReconciling)) {
this.isReconciling = true;
fetchAndReconcileGiftIntentDismissals(serverDismissalTimestampMs);
}
}
onReconcileSuccess(a0) {
this.onReconcileSettled(true);
this.removeRemotelyDismissedGiftIntentCards(a0.dismissals);
}
onReconcileSettled(a0) {
this.isReconciling = false;
const reconcileBackoff = this.reconcileBackoff;
if (a0) {
reconcileBackoff.succeed();
} else {
reconcileBackoff.fail(this.retryReconcileServerDismissals);
}
}
removeRemotelyDismissedGiftIntentCards(a0) {
for (const item of a0) {
const { targetId, dismissedAtMs } = item;
const r39 = this.lastReconciledDismissalAtMs.get(targetId);
const lastReconciledDismissalAtMs = this.lastReconciledDismissalAtMs;
const r19 = Math;
let r17 = r39;
if (r17 == null) {
r17 = 0;
}
lastReconciledDismissalAtMs.set(targetId, r19.max(r17, dismissedAtMs));
if (r39 != null && !(dismissedAtMs <= r39)) {
const dMFromUserId = ChannelStore.getDMFromUserId(targetId);
const channelId = dMFromUserId;
if (dMFromUserId != null) {
for (const item2 of EphemeralMessageStore.getMessages(channelId)) {
if (item2.type === MessageTypes.GIFTING_PROMPT && item2.giftingPrompt?.recipientUserId === targetId) {
Dispatcher.dispatch({
type: "MESSAGE_DELETE",
id: item2.id,
channelId
});
}
}
}
}
}
}
onLogout() {
this.reconcileBackoff.cancel();
this.isReconciling = false;
this.heldGiftingPromptSystemMessage = false;
this.lastReconciledDismissalAtMs.clear();
}
maybeRetryHeldGiftingPromptSystemMessage() {
if (this.heldGiftingPromptSystemMessage && !(PremiumGiftingIntentStore.getLastKnownGiftIntentDismissedAtMs() < this.getServerDismissalTimestampMs())) {
this.heldGiftingPromptSystemMessage = false;
this.sendGiftingPromptSystemMessagesIfEligible();
}
}
shouldHoldGiftingPromptSystemMessageForServerReconcile(a0) {
return !!FriendshipAnniversaryBackendPersistenceExperiment.getConfig({
location: a0
}).enabled && PremiumGiftingIntentStore.getLastKnownGiftIntentDismissedAtMs() < this.getServerDismissalTimestampMs();
}
trySendGiftingPromptSystemMessage(a0, a1, a2, a3, a4) {
let r18;
if (this.shouldHoldGiftingPromptSystemMessageForServerReconcile(a4)) {
this.heldGiftingPromptSystemMessage = true;
r18 = false;
} else {
MessageActionCreators.sendGiftingPromptSystemMessage(a0, {
giftIntentType: a1,
recipientUserId: a2,
giftIntentSecondaryAction: a3
});
r18 = true;
}
return r18;
}
}
export default GiftIntentReconcilingManager;
@@ -0,0 +1,21 @@
// Metro module 11005 (f11006).
import { GiftIntentType } from "../../PremiumConstants";
import { AnalyticsLocations } from "../../../../Constants";
let c7414_2 = new Map([[AnalyticsLocations.FRIEND_ANNIVERSARIES_CHAT, GiftIntentType.FRIEND_ANNIVERSARY], [AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON, GiftIntentType.FRIEND_ANNIVERSARY], [AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK, GiftIntentType.FRIEND_ANNIVERSARY]]);
export function getPremiumGiftingIntentAnalyticsLocation(a0) {
return a0 === GiftIntentType.FRIEND_ANNIVERSARY ? {
chat: AnalyticsLocations.FRIEND_ANNIVERSARIES_CHAT,
actionButton: AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON,
actionButtonCoachmark: AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK
} : {};
}
export function getGiftIntentTypeForLocation(a0) {
let r5 = c7414_2.get(a0);
if (r5 == null) {
r5 = null;
}
return r5;
}
export function parseGiftIntentType(a0) {
return typeof a0 === "number" ? a0 in GiftIntentType ? a0 !== GiftIntentType.UNSPECIFIED ? a0 : null : null : null;
}
@@ -0,0 +1,108 @@
// Metro module 9753 (f9754).
import { useMemo } from "react";
import { intl, t } from "../../../../intl/index.native";
import { WishlistItemSource } from "../../../wishlists/hooks/useWishlistHooks";
import { isGameItemSKU } from "../../../slayer_storefront/SlayerStorefrontUtils";
let $mk83244 = function() {
return (a0) => {
const sku = a0.sku;
return a0.source === WishlistItemSource.POPULAR && isGameItemSKU(sku);
};
};
let c6463_3 = {
FULL_WISHLIST: "FULL_WISHLIST",
MIXED: "MIXED",
SHOP_ONLY: "SHOP_ONLY",
SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY: "SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY"
};
const r30 = {
FULL_WISHLIST: {
title: intl.string(t["7lZ31J"]),
getSubtitle: (a0) => intl.formatToPlainString(t.BjEX38, {
username: a0
}),
showIcons: false
},
MIXED: {
title: intl.string(t.pWG4ze),
getSubtitle: (a0) => intl.formatToPlainString(t.dIDKgi, {
username: a0
}),
showIcons: true
},
SHOP_ONLY: {
title: intl.string(t.SK5rmi),
getSubtitle: (a0) => intl.formatToPlainString(t.wyMp1j, {
username: a0
}),
showIcons: false
},
SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY: {
title: intl.string(t.BCi1gT),
getSubtitle: (a0) => intl.formatToPlainString(t.BjEX38, {
username: a0
}),
showIcons: false
}
};
export { c6463_3 as BannerMode };
export { r30 as BANNER_CONFIG_MOBILE };
export function getBannerMode(a0) {
let FULL_WISHLIST;
L10: {
const { totalUnownedWishlistItemCount: totalUnownedWishlistItemCount2, wishlistInDmLength: wishlistInDmLength2, displayItems: displayItems2 } = a0;
if (totalUnownedWishlistItemCount2 >= wishlistInDmLength2) {
FULL_WISHLIST = c6463_3.FULL_WISHLIST;
} else if (totalUnownedWishlistItemCount2 > 0) {
FULL_WISHLIST = c6463_3.MIXED;
} else {
if (displayItems2.length > 0 && displayItems2.every($mk83244())) {
FULL_WISHLIST = c6463_3.SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY;
break L10;
}
FULL_WISHLIST = c6463_3.SHOP_ONLY;
}
}
return FULL_WISHLIST;
}
export function useWishlistBannerConfig({ totalUnownedWishlistItemCount, wishlistInDmLength, displayItems, recipientName }) {
const memo = useMemo(() => {
let FULL_WISHLIST;
L10: {
if (totalUnownedWishlistItemCount >= wishlistInDmLength) {
FULL_WISHLIST = c6463_3.FULL_WISHLIST;
} else if (totalUnownedWishlistItemCount > 0) {
FULL_WISHLIST = c6463_3.MIXED;
} else {
if (displayItems.length > 0 && displayItems.every($mk83244())) {
FULL_WISHLIST = c6463_3.SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY;
break L10;
}
FULL_WISHLIST = c6463_3.SHOP_ONLY;
}
}
return FULL_WISHLIST;
}, [totalUnownedWishlistItemCount, wishlistInDmLength, displayItems]);
return useMemo(() => {
if (c6463_3.FULL_WISHLIST === memo) {
return {
title: intl.formatToPlainString(t["YcL/Vr"], {
username: recipientName
}),
showIcons: false
};
}
if (c6463_3.MIXED === memo) {
return {
title: intl.formatToPlainString(t.dIDKgi, {
username: recipientName
}),
showIcons: true
};
}
return {
title: intl.string(t.BCi1gT),
showIcons: false
};
}, [memo, recipientName]);
}
@@ -0,0 +1,93 @@
// Metro module 8807 (f8808).
import { useState, useRef, useEffect } from "react";
import PromotionsStore from "../../../promotions/PromotionsStore";
import { SubscriptionPlans } from "../../../PremiumConstants";
import { useStateFromStoresArray } from "../../../../../_bundle/Module589";
import { useFetchPurchases } from "../../../../collectibles/hooks/useFetchCollectiblesCategoriesAndPurchases";
import { GiftPromotionReminderExperiment } from "../../experiments/GiftPromotionReminderExperiment";
import { MarketingComponentType } from "../../../../../_bundle/Module6567";
import { UNSAFE_isSnowflakeBoundDismissibleContentDismissed } from "../../../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../../../_bundle/Module1358";
export function useFetchClaimableGiftingPromotionRewardSkuIds() {
let purchases, hasPreviouslyFetched, fetchPurchasesError, ref;
const [state, setState] = useState();
const stateFromStoresArray = useStateFromStoresArray([PromotionsStore], () => PromotionsStore.getGiftPromotionRewardSkuIds());
const fetchPurchases = useFetchPurchases();
purchases = fetchPurchases.purchases;
hasPreviouslyFetched = fetchPurchases.hasPreviouslyFetched;
fetchPurchasesError = fetchPurchases.fetchPurchasesError;
ref = useRef(false);
useEffect(() => {
if (hasPreviouslyFetched && !ref.current && stateFromStoresArray.length > 0) {
setState(fetchPurchasesError == null ? stateFromStoresArray.filter((item) => purchases.get(item) == null) : []);
ref.current = true;
}
}, [stateFromStoresArray, purchases, hasPreviouslyFetched, fetchPurchasesError]);
return state;
}
export function getRewardAssetIdMap(a0) {
const map = new Map();
let c16793_0 = map;
a0.forEach((item) => c16793_0.set(item.skuId, item.assetId));
return map;
}
export function useShouldShowSelectFreeSkuStep(a0, a1, a2) {
const r12 = [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2].includes(a0?.id);
const r13 = a2 != null && a2.length >= 1;
return (a1 ? r12 : a1) && r13;
}
export function useShouldAutoSelectGiftingPromotionReward(a0, a1, a2) {
const r12 = [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2].includes(a0?.id);
return a2 != null && a2.length === 1 && r12 && a1;
}
export function useIsPlanEligibleForGiftingPromotion(a0) {
return [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2].includes(a0?.id);
}
export function createGradientStyle(a0, a1) {
if (a0 != null) {
const r4 = a1 == null ? {} : a1;
const { reverse = false, colorStops, defaultAngle = 78.98 } = r4;
const r22 = Array.isArray(a0) ? a0 : a0.gradient;
const r25 = Array.isArray(a0) ? defaultAngle : a0.angle != null ? a0.angle : defaultAngle;
return {
background: `linear-gradient(${reverse ? (r25 + 180) % 360 : r25}deg, ${colorStops != null ? r22.map((item, index) => `${item} ${colorStops[index]}%`).join(", ") : r22.join(", ")})`
};
}
}
export function createBackgroundStyle(a0) {
if (a0 != null) {
return {
backgroundImage: `url(${a0})`,
backgroundSize: "cover",
backgroundPosition: "center",
backgroundRepeat: "no-repeat"
};
}
}
export function combinePromotionStyles(a0, a1) {
if (a0 != null && a1 != null) {
a0.backgroundImage = `${a0.backgroundImage}, ${a1.background}`;
a0.backgroundColor = "lightgray";
a0.backgroundRepeat = "no-repeat, no-repeat";
if (a0.backgroundSize == null) {
a0.backgroundSize = "auto 110%, auto";
}
if (a0.backgroundPosition == null) {
a0.backgroundPosition = "right 90% center, 0% 0%";
}
return a0;
}
return a0 == null ? a1 == null ? {} : a1 : a0;
}
export function shouldShowGiftPromotionReminderNotice() {
if (GiftPromotionReminderExperiment.getConfig({
location: "shouldShowGiftPromotionReminderNotice"
}).enabled) {
if (PromotionsStore.getMarketingComponentByType(MarketingComponentType.GIFT_REMINDER_NAGBAR) == null) {
return false;
}
const id = PromotionsStore.getGiftPromotion()?.id;
return id != null && (!!UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_DESKTOP_FIRST_TIME_COACHMARK, id).isDismissed && !UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_REMINDER, id).isDismissed);
}
return false;
}
@@ -0,0 +1,48 @@
// Metro module 6243 (f6244).
import IAPStore_android from "../../../stores/native/IAPStore.android";
import { PREMIUM_TIER_0_LIKELIHOOD_TRIAL_ID, PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID, PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID, PREMIUM_TIER_2_REACTIVATION_TRIAL_ID, PREMIUM_TIER_2_REFERRAL_TRIAL_ID, PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID } from "../PremiumConstants";
import { useTrialOffer } from "../useTrialOffer";
import { TrialIdToProductOfferId } from "../native/ProductIds.android";
import { useStateFromStoresObject } from "../../../_bundle/defaultAreStatesEqual";
function $mk78076($env) {
return (a0) => $env[0].has(a0);
}
export function useAndroidAndLegacyIOSPremiumTrialOfferCandidates() {
let env15605;
const offerIds = useStateFromStoresObject([IAPStore_android], () => ({
isFetchingProducts: IAPStore_android.isFetchingProducts(),
offerIds: IAPStore_android.getOfferIds()
})).offerIds;
const r21 = env15605 = {};
env15605[0] = offerIds;
const trialOffer = useTrialOffer(PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID);
const r34 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID]).every($mk78076(r21)) ? trialOffer : null;
let env15606;
const r35 = env15606 = {};
env15606[0] = offerIds;
const trialOffer2 = useTrialOffer(PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID);
const r49 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID]).every($mk78076(r35)) ? trialOffer2 : null;
let env15607;
const r50 = env15607 = {};
env15607[0] = offerIds;
const trialOffer3 = useTrialOffer(PREMIUM_TIER_2_REACTIVATION_TRIAL_ID);
const r65 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_REACTIVATION_TRIAL_ID]).every($mk78076(r50)) ? trialOffer3 : null;
let env15608;
const r66 = env15608 = {};
env15608[0] = offerIds;
const trialOffer4 = useTrialOffer(PREMIUM_TIER_0_LIKELIHOOD_TRIAL_ID);
const r81 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_0_LIKELIHOOD_TRIAL_ID]).every($mk78076(r66)) ? trialOffer4 : null;
let env15609;
const r82 = env15609 = {};
env15609[0] = offerIds;
const trialOffer5 = useTrialOffer(PREMIUM_TIER_2_REFERRAL_TRIAL_ID);
const r97 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_REFERRAL_TRIAL_ID]).every($mk78076(r82)) ? trialOffer5 : null;
let env15610;
const r98 = [r97, r34, r49, r65, , ,];
const r100 = env15610 = {};
env15610[0] = offerIds;
const trialOffer6 = useTrialOffer(PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID);
r98[4] = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID]).every($mk78076(r100)) ? trialOffer6 : null;
r98[5] = r81;
return r98.find((item) => item != null);
}
@@ -0,0 +1,74 @@
// Metro module 6260 (f6261).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { useState, useEffect } from "react";
import UserStore from "../../../stores/UserStore";
import UserOfferStore from "../../../stores/billing/UserOfferStore";
import { PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID, PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID } from "../PremiumConstants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { isPremium } from "../../../utils/PremiumUtils";
import { Timeout } from "../../../_bundle/Timeout";
function $mk114919($env) {
return () => {
const r2 = $env.$parent;
if (!r2[2] && r2[1].hasExpired()) {
(0, r2[3])(true);
} else {
const r10 = r2[1];
if (r10 == null ? void 0 : r10.hasAcknowledged()) {
const r5 = r10.expiresAt != null ? r10.expiresAt.getTime() - Date.now() : 0;
const r24 = $env;
const r25 = r24[0];
if (r25 != null) {
r25.start(r5, $mk114919(r24));
}
}
}
};
}
let env3977 = {};
export default function useDiscountOffer(a0, a1) {
let r36;
let env15637 = {
$parent: env3977
};
env15637[0] = a0;
const stateFromStores = useStateFromStores([UserOfferStore], () => UserOfferStore.getUserDiscountOffer(env15637[0]));
env15637[1] = stateFromStores;
let r19 = stateFromStores == null ? void 0 : stateFromStores.hasExpired();
if (r19 == null) {
r19 = false;
}
L10: {
const r22 = _slicedToArray(useState(r19), 2);
const r23 = r22[0];
env15637[2] = r23;
env15637[3] = r22[1];
const stateFromStores2 = useStateFromStores([UserStore], () => isPremium(UserStore.getCurrentUser()));
useEffect(() => {
const r4 = env15637[1];
if (r4 == null ? void 0 : r4.hasAcknowledged()) {
let env25766;
const r13 = env25766 = {
$parent: env15637
};
const timeout = new Timeout();
env25766[0] = timeout;
if (r4 == null ? void 0 : r4.hasAcknowledged()) {
timeout.start(r4.expiresAt != null ? r4.expiresAt.getTime() - Date.now() : 0, $mk114919(r13));
}
return () => env25766[0].stop();
}
}, [r23, stateFromStores]);
r36 = null;
if (!r23) {
if (stateFromStores2 && !a1 && a0 !== PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID) {
r36 = null;
if (a0 !== PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID) {
break L10;
}
}
r36 = stateFromStores;
}
}
return r36;
};
@@ -0,0 +1,28 @@
// Metro module 6292 (f6293).
import { useEffect } from "react";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import BillingInfoStore from "../../../stores/billing/BillingInfoStore";
import IAPStore_android from "../../../stores/native/IAPStore.android";
import { useStateFromStores } from "../../../_bundle/Module589";
import { ProductIds } from "../native/ProductIds.ios";
import { fetchIpLocation } from "../../billing/actions/BillingActionCreators";
export default function useGeoForUser() {
let stateFromStores;
const stateFromStores2 = useStateFromStores([IAPStore_android], () => IAPStore_android.getProduct(ProductIds.PREMIUM_TIER_2_MONTHLY)?.countryCode);
const stateFromStores3 = useStateFromStores([BillingInfoStore], () => BillingInfoStore.ipLocation);
stateFromStores = useStateFromStores([AuthenticationStore], () => AuthenticationStore.isAuthenticated());
useEffect(() => {
let r3 = stateFromStores;
if (stateFromStores) {
r3 = !BillingInfoStore.ipLocationLoaded;
}
if (r3) {
fetchIpLocation();
}
}, [stateFromStores3, stateFromStores]);
return {
defaultBillingCountryCode: stateFromStores2,
ipCountryCode: stateFromStores3?.countryCode,
ipSubdivisionCode: stateFromStores3?.subdivisionCode
};
};
@@ -0,0 +1,16 @@
// Metro module 12588 (f12589).
import { useMemo } from "react";
import Module3771 from "../../../_bundle/Module3771";
import { dateFormat } from "../../../utils/DateUtils";
let c8684_4 = Module3771.duration(30, "days");
export default function useOutboundPromotionRedemptionEndDate(a0, a1) {
return useMemo(() => {
let r17;
if (a1) {
r17 = a0.outboundRedemptionEndDate != null ? Module3771(a0.outboundRedemptionEndDate) : Module3771(a0.endDate).add(c8684_4);
} else {
r17 = Module3771(a0.endDate);
}
return dateFormat(r17, "LL");
}, [a0, a1]);
};
@@ -0,0 +1,34 @@
// Metro module 6259 (f6260).
import IAPStore_android from "../../../stores/native/IAPStore.android";
import { PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID } from "../PremiumConstants";
import useDiscountOffer from "./useDiscountOffer";
import { DiscountIdToProductOfferId } from "../native/ProductIds.android";
import { useStateFromStoresObject } from "../../../_bundle/defaultAreStatesEqual";
function $mk78116($env) {
return (a0) => $env[0].has(a0);
}
export function usePremiumDiscountOffer() {
let env15635;
const offerIds = useStateFromStoresObject([IAPStore_android], () => ({
isFetchingProducts: IAPStore_android.isFetchingProducts(),
offerIds: IAPStore_android.getOfferIds()
})).offerIds;
const r9 = env15635 = {};
env15635[0] = offerIds;
const discountOffer = useDiscountOffer(PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID);
const r27 = Object.values(DiscountIdToProductOfferId[PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID]);
let r29 = r27.length !== 0 ? r27.every($mk78116(r9)) ? discountOffer : null : null;
let env15636;
const r35 = env15636 = {};
env15636[0] = offerIds;
const discountOffer2 = useDiscountOffer(PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID);
const r45 = Object.values(DiscountIdToProductOfferId[PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID]);
const r47 = r45.length !== 0 ? r45.every($mk78116(r35)) ? discountOffer2 : null : null;
if (r29 == null) {
r29 = r47;
}
return r29;
}
export function usePremiumGroupDiscountOffer() {
return null;
}
Loaded 100 of 33051 files, more files were not shown because too many files have changed in this diff. Show more