4322 lines
226 KiB
TypeScript
4322 lines
226 KiB
TypeScript
/* Metro module 3802; source: utils/PremiumUtils.tsx; dependencies: [57, 31, 3803, 1878, 3804, 3805, 3807, 3808, 661, 1880, 3816, 482, 3, 3817, 3814, 1900, 44, 1244, 2806, 3738, 3826, 3847, 5137, 3815, 12192, 672, 566, 8458, 4136, 12706, 5136, 1893, 1895, 7937, 2] */
|
|
import Module00044 from '../by-id/module-00044.js'; /* Metro dependency 44 */
|
|
import Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UserStore from '../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import BillingInfoStore from '../stores/billing/BillingInfoStore.tsx'; /* Metro dependency 3804 */
|
|
import PaymentSourceStore from '../stores/billing/PaymentSourceStore.tsx'; /* Metro dependency 3805 */
|
|
import SubscriptionPlanStore from '../stores/billing/SubscriptionPlanStore.tsx'; /* Metro dependency 3807 */
|
|
import SubscriptionStore from '../stores/billing/SubscriptionStore.tsx'; /* Metro dependency 3808 */
|
|
import OpenURL from '../lib/openURL.tsx'; /* Metro dependency 3847 */
|
|
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PremiumTypeUtilsModule from './PremiumTypeUtils.tsx'; /* Metro dependency 1900 */
|
|
import * as SubscriptionPlanRecordModule from '../records/SubscriptionPlanRecord.tsx'; /* Metro dependency 3803 */
|
|
import * as PremiumSubscriptionModule from '../modules/premium/PremiumSubscription.tsx'; /* Metro dependency 3814 */
|
|
import * as PremiumGroupConstantsModule from '../modules/premium/premium_group/PremiumGroupConstants.tsx'; /* Metro dependency 3816 */
|
|
import * as BillingUtilsModule from './BillingUtils.tsx'; /* Metro dependency 3817 */
|
|
import * as DateUtilsModule from './DateUtils.tsx'; /* Metro dependency 3826 */
|
|
import * as CrepeExperimentModule from '../modules/croissant/crepe/CrepeExperiment.tsx'; /* Metro dependency 5136 */
|
|
import * as PriceUtilsModule from './PriceUtils.tsx'; /* Metro dependency 5137 */
|
|
import * as PremiumFeatureUtilsModule from './PremiumFeatureUtils.tsx'; /* Metro dependency 7937 */
|
|
import * as CheckoutErrorModule from '../modules/checkout/CheckoutError.tsx'; /* Metro dependency 8458 */
|
|
import * as ProductCatalogModule from '../modules/premium/ProductCatalog.tsx'; /* Metro dependency 12706 */
|
|
|
|
function _fun29030(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#29030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6, offset: 0x00fb4eb3, size: 3033 bytes, params: 8, frame: 89
|
|
let env0_0 = require;
|
|
const _arrayLikeToArray_29033 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = function({items}) {
|
|
return items.find(_fun29035);
|
|
};
|
|
const getDefaultPrice2 = getDefaultPrice;
|
|
const closure3 = function(a0, a1) {
|
|
var r0;
|
|
var object;
|
|
var value = a0;
|
|
if (a1 == null) {
|
|
r0 = value;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, value, a1);
|
|
value = global.Object.fromEntries(a1.map(_fun29038));
|
|
object['contextPlanPrices'] = value;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
};
|
|
const getPrice2 = getPrice;
|
|
const experimentalGetPrices2 = experimentalGetPrices;
|
|
const experimentalGetPrice2 = experimentalGetPrice;
|
|
const closure7 = function(a0) {
|
|
return {amount: a0.amount, currency: a0.currency, exponent: a0.exponent};
|
|
};
|
|
const getItemPlansTotalServerPrice2 = getItemPlansTotalServerPrice;
|
|
const getInterval2 = getInterval;
|
|
const getIntervalString2 = getIntervalString;
|
|
const getIntervalStringAsNoun2 = getIntervalStringAsNoun;
|
|
const getPremiumType2 = getPremiumType;
|
|
const getDisplayName_290512 = getDisplayName_29051;
|
|
const getTierDisplayNameByPlanId2 = getTierDisplayNameByPlanId;
|
|
const getPlanDescription2 = getPlanDescription;
|
|
const getPremiumPlanOptions2 = getPremiumPlanOptions;
|
|
const getSkuIdForPlan2 = getSkuIdForPlan;
|
|
const getNumPremiumGuildSubscriptions2 = getNumPremiumGuildSubscriptions;
|
|
const subscriptionHasPremiumGuildPlan2 = subscriptionHasPremiumGuildPlan;
|
|
const isPremiumBaseSubscriptionPlan2 = isPremiumBaseSubscriptionPlan;
|
|
const closure21 = function(a0) {
|
|
return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(a0);
|
|
};
|
|
const getBillingGracePeriodDaysAndExpiresDate2 = getBillingGracePeriodDaysAndExpiresDate;
|
|
const getExpectedRenewalDate2 = getExpectedRenewalDate;
|
|
const getBillingInformationString2 = getBillingInformationString;
|
|
const extendDateWithUnconsumedFractionalPremium2 = extendDateWithUnconsumedFractionalPremium;
|
|
const getUnactivatedFractionalPremiumDurationString2 = getUnactivatedFractionalPremiumDurationString;
|
|
const isSwitchingPlansDisabled2 = isSwitchingPlansDisabled;
|
|
const getSwitchingPlansDisabledMessage2 = getSwitchingPlansDisabledMessage;
|
|
const isSubscriptionPrepaidPaymentSource2 = isSubscriptionPrepaidPaymentSource;
|
|
const isPrepaidPaymentSource2 = isPrepaidPaymentSource;
|
|
const closure31 = function({renewalMutations, additionalPlans, status}) {
|
|
var value2 = getNumPremiumGuildSubscriptions(additionalPlans);
|
|
var value3 = null;
|
|
return (value3 != renewalMutations ? getNumPremiumGuildSubscriptions(renewalMutations.additionalPlans) : value3) !== 0 || value2 === 0 ? status : SubscriptionStatusTypes.CANCELED;
|
|
};
|
|
const isPremiumGuildSubscriptionCanceled2 = isPremiumGuildSubscriptionCanceled;
|
|
const getFormattedPriceForPlan2 = getFormattedPriceForPlan;
|
|
const getPlanIdFromInvoice2 = getPlanIdFromInvoice;
|
|
const getStatusFromInvoice2 = getStatusFromInvoice;
|
|
const isBaseSubscriptionCanceled2 = isBaseSubscriptionCanceled;
|
|
const isSubscriptionStatusFailedPayment2 = isSubscriptionStatusFailedPayment;
|
|
const getFormattedPlanPriceFromInvoice2 = getFormattedPlanPriceFromInvoice;
|
|
const getPremiumGuildIntervalPrice2 = getPremiumGuildIntervalPrice;
|
|
const getBillingReviewSubheader2 = getBillingReviewSubheader;
|
|
const getIntervalForInvoice2 = getIntervalForInvoice;
|
|
const getDefaultCurrency2 = getDefaultCurrency;
|
|
const formatTrialCtaIntervalDuration2 = formatTrialCtaIntervalDuration;
|
|
const getExternalSubscriptionMethodUrl2 = getExternalSubscriptionMethodUrl;
|
|
const closure45 = function(a0, a1) {
|
|
var r5;
|
|
var env0_0 = a0;
|
|
var items = [];
|
|
var property = a0.renewalMutations;
|
|
var value = property == null;
|
|
r5 = value ? undefined : property.items;
|
|
r5 = r5 ?? a0.items;
|
|
var value3 = r5.find(_fun29093);
|
|
if (value3 != null) {
|
|
items.push(value3);
|
|
}
|
|
property = items.push;
|
|
var items2 = [];
|
|
arraySpread(items2, a1, 0, value);
|
|
apply(property, items2, items, value);
|
|
return items.map(_fun29094);
|
|
};
|
|
const closure46 = function(a0) {
|
|
return a0.filter(_fun29096);
|
|
};
|
|
const getItemsWithUpsertedPlanIdForGroup2 = getItemsWithUpsertedPlanIdForGroup;
|
|
const closure48 = function(a0) {
|
|
var value = null;
|
|
return value == a0 ? value : a0.items.find(_fun29102);
|
|
};
|
|
const isBoostOnlySubscription2 = isBoostOnlySubscription;
|
|
const getPremiumSkuIdForSubscription2 = getPremiumSkuIdForSubscription;
|
|
const closure51 = function(a0) {
|
|
if (a0 != null) {
|
|
var value2 = getPremiumPlanItem(a0);
|
|
if (value2 != null) {
|
|
return getPremiumType(value2.planId);
|
|
}
|
|
}
|
|
};
|
|
const closure52 = function(a0) {
|
|
var r0;
|
|
var property;
|
|
var value = a0 != null;
|
|
if (value) {
|
|
property = global.Date;
|
|
value = property.now();
|
|
property = a0.createdAt;
|
|
value -= property.getTime();
|
|
value = value < 2592000000;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
const canUseQuestOrbMultiplier2 = canUseQuestOrbMultiplier;
|
|
const canUseCollectibles2 = canUseCollectibles;
|
|
const formatPriceString2 = formatPriceString;
|
|
const closure56 = function(a0) {
|
|
return a0;
|
|
};
|
|
const closure57 = function(a0) {
|
|
return a0 != null && 'trial_id' in a0;
|
|
};
|
|
const closure58 = function(a0) {
|
|
return a0 != null && 'discountId' in a0;
|
|
};
|
|
const formatInterval2 = formatInterval;
|
|
const closure60 = function(a0) {
|
|
return a0 != null && !a0.isProvisional && !a0.bot;
|
|
};
|
|
const getUnactivatedFractionalPremiumHours2 = getUnactivatedFractionalPremiumHours;
|
|
const closure62 = function(a0) {
|
|
return a0.reduce(_fun29118, 0);
|
|
};
|
|
const getMonthlyPrice2 = getMonthlyPrice;
|
|
const calculateDiscountPercentageForYearlyPlan2 = calculateDiscountPercentageForYearlyPlan;
|
|
const getDaysSincePremium2 = getDaysSincePremium;
|
|
const getDaysRemainingUntilSubscriptionCurrentPeriodEnds2 = getDaysRemainingUntilSubscriptionCurrentPeriodEnds;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const isNoneSubscription = (SubscriptionPlanRecordModule).isNoneSubscription;
|
|
let value = ConstantsModule;
|
|
const env0_11 = value.InvoiceStatusTypes;
|
|
const env0_12 = value.PaymentGateways;
|
|
const env0_13 = value.PriceSetAssignmentPurchaseTypes;
|
|
const env0_14 = value.SubscriptionStatusTypes;
|
|
value = require(1880) /* metro dependency 1880: PremiumConstants */;
|
|
const env0_15 = value.DISCOUNTS;
|
|
const env0_16 = value.ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK;
|
|
const env0_17 = value.DEFAULT_APPLE_GRACE_PERIOD_DAYS;
|
|
const env0_18 = value.DEFAULT_GOOGLE_GRACE_PERIOD_DAYS;
|
|
const env0_19 = value.DEFAULT_MAX_GRACE_PERIOD_DAYS;
|
|
const env0_20 = value.DISCOUNT_DURATION_FALLBACK;
|
|
const env0_21 = value.DISCOUNT_PERCENTAGE_FALLBACK;
|
|
const env0_22 = value.DiscountUserUsageLimitIntervalTypes;
|
|
const env0_23 = value.FRACTIONAL_PREMIUM_SKU_INTERVAL_COUNTS;
|
|
const env0_24 = value.FractionalPremiumIntervalTypes;
|
|
const env0_25 = value.FractionalPremiumStates;
|
|
const env0_26 = value.MAX_ACCOUNT_HOLD_DAYS;
|
|
const env0_27 = value.MAX_PAYMENT_PROCESSING_TIME_DAYS;
|
|
const env0_28 = value.NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM;
|
|
const env0_29 = value.PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS;
|
|
const env0_30 = value.PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS;
|
|
const env0_31 = value.PREMIUM_GUILD_SUBSCRIPTION_PLANS;
|
|
const env0_32 = value.PREMIUM_PLANS;
|
|
const env0_33 = value.PREMIUM_SKU_TO_MONTHLY_PLAN;
|
|
const env0_34 = value.PREMIUM_TIER_2_PLANS;
|
|
const env0_35 = value.PREMIUM_TIER_2_REVERSE_FOLLOWUP_TRIAL_ID;
|
|
const env0_36 = value.PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID;
|
|
const env0_37 = value.PREMIUM_TYPE_DISPLAY_NAME;
|
|
const env0_38 = value.PremiumSubscriptionSKUs;
|
|
const env0_39 = value.PremiumTypes;
|
|
const env0_40 = value.PremiumUserLimits;
|
|
const env0_41 = value.SubscriptionIntervalTypes;
|
|
const env0_42 = value.SubscriptionPlanInfo;
|
|
const SubscriptionPlans = value.SubscriptionPlans;
|
|
const env0_44 = value.TRIAL_FOR_EVERYONE_OFFER_EXPIRES_APPROACHING_THRESHOLD;
|
|
const env0_45 = value.USER_PREMIUM_OFFER_EXPIRES_APPROACHING_4_DAY_THRESHOLD;
|
|
const env0_46 = value.USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD;
|
|
value = require(482) /* metro dependency 482: Constants */;
|
|
const env0_48 = value.CurrencyCodes;
|
|
const env0_49 = value.PaymentGatewayToFriendlyName;
|
|
const env0_50 = value.PREPAID_PAYMENT_SOURCES;
|
|
const env0_51 = {'PAYMENT_SOURCE_MANAGEMENT': 'https://support.apple.com/HT201266',
|
|
'BILLING_HISTORY': 'https://support.apple.com/HT201266',
|
|
'SUBSCRIPTION_MANAGEMENT': 'https://support.apple.com/HT202039'};
|
|
const env0_52 = {'SUBSCRIPTION_MANAGEMENT': 'https://play.google.com/store/account/subscriptions',
|
|
'PAYMENT_SOURCE_MANAGEMENT': 'https://play.google.com/store/paymentmethods',
|
|
'BILLING_HISTORY': 'https://play.google.com/store/account/orderhistory'};
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('PremiumUtils.tsx');
|
|
const object2 = {MID: 'mid', HIGH: 'high'};
|
|
const Set = global.Set;
|
|
const NONE_MONTH = SubscriptionPlans.NONE_MONTH;
|
|
const NONE_3_MONTH = SubscriptionPlans.NONE_3_MONTH;
|
|
const NONE_6_MONTH = SubscriptionPlans.NONE_6_MONTH;
|
|
const NONE_YEAR = SubscriptionPlans.NONE_YEAR;
|
|
const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0;
|
|
const PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1;
|
|
const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0;
|
|
const PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1;
|
|
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2;
|
|
const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2;
|
|
const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH;
|
|
let set = new Set([NONE_MONTH, NONE_3_MONTH, NONE_6_MONTH, NONE_YEAR, PREMIUM_MONTH_TIER_0, PREMIUM_MONTH_TIER_1,
|
|
PREMIUM_MONTH_TIER_2, PREMIUM_YEAR_TIER_0, PREMIUM_YEAR_TIER_1, PREMIUM_YEAR_TIER_2, PREMIUM_3_MONTH_TIER_2,
|
|
PREMIUM_6_MONTH_TIER_2, PREMIUM_GROUP_MONTH]);
|
|
Object = global.Object;
|
|
const freeze = Object.freeze;
|
|
const object3 = {isNewUser: closure52};
|
|
const isPremiumAtLeast = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremiumAtLeast;
|
|
object3.isPremiumAtLeast = isPremiumAtLeast;
|
|
const isPremium = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremium;
|
|
object3.isPremium = isPremium;
|
|
const isPremiumExactly = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremiumExactly;
|
|
object3.isPremiumExactly = isPremiumExactly;
|
|
object3.isPremiumEligible = closure60;
|
|
object3.getPrice = getPrice2;
|
|
object3.getDefaultPrice = getDefaultPrice2;
|
|
object3.getInterval = getInterval2;
|
|
object3.getIntervalString = getIntervalString2;
|
|
object3.getIntervalStringAsNoun = getIntervalStringAsNoun2;
|
|
object3.getPremiumType = getPremiumType2;
|
|
object3.getTierDisplayNameByPlanId = getTierDisplayNameByPlanId2;
|
|
object3.getDisplayName = getDisplayName_290512;
|
|
object3.getPremiumPlanOptions = getPremiumPlanOptions2;
|
|
object3.formatInterval = formatInterval2;
|
|
object3.getPlanDescription = getPlanDescription2;
|
|
object3.isPremiumSku = isPremiumSku;
|
|
object3.getIntervalMonths = getIntervalMonths;
|
|
const getUserMaxFileSize = (PremiumFeatureUtilsModule).getUserMaxFileSize;
|
|
object3.getUserMaxFileSize = getUserMaxFileSize;
|
|
object3.getSkuIdForPlan = getSkuIdForPlan2;
|
|
object3.getSkuIdForPremiumType = function(a0) {
|
|
if (PremiumTypes.TIER_0 === a0) {
|
|
return PremiumSubscriptionSKUs.TIER_0;
|
|
}
|
|
if (PremiumTypes.TIER_1 === a0) {
|
|
return PremiumSubscriptionSKUs.TIER_1;
|
|
}
|
|
if (PremiumTypes.TIER_2 === a0) {
|
|
return PremiumSubscriptionSKUs.TIER_2;
|
|
}
|
|
};
|
|
object3.getNumIncludedPremiumGuildSubscriptionSlots = function(a0) {
|
|
return getPremiumType(a0) !== PremiumTypes.TIER_2 ? 0 : NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM;
|
|
};
|
|
object3.getBillingInformationString = getBillingInformationString2;
|
|
object3.getExpectedRenewalDate = getExpectedRenewalDate2;
|
|
object3.extendDateWithUnconsumedFractionalPremium = extendDateWithUnconsumedFractionalPremium2;
|
|
object3.getUnactivatedFractionalPremiumDurationString = getUnactivatedFractionalPremiumDurationString2;
|
|
object3.isSwitchingPlansDisabled = isSwitchingPlansDisabled2;
|
|
object3.getSwitchingPlansDisabledMessage = getSwitchingPlansDisabledMessage2;
|
|
object3.isNoneSubscription = isNoneSubscription;
|
|
object3.getPlanIdFromInvoice = getPlanIdFromInvoice2;
|
|
object3.getStatusFromInvoice = getStatusFromInvoice2;
|
|
object3.isBaseSubscriptionCanceled = isBaseSubscriptionCanceled2;
|
|
object3.getPremiumGuildIntervalPrice = getPremiumGuildIntervalPrice2;
|
|
object3.hasAccountCredit = function(a0) {
|
|
var r0;
|
|
var value = a0 != null;
|
|
r0 = value && a0.size !== 0;
|
|
if (r0) {
|
|
value = global.Array.from(a0);
|
|
value = value.some(_fun29128);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
object3.hasUnconsumedGiftForSubscriptionPlan = function(a0, a1) {
|
|
var r0;
|
|
var env0_0 = a1;
|
|
var value = a0 != null;
|
|
r0 = value && a0.size !== 0 && a1 != null;
|
|
if (r0) {
|
|
value = global.Array.from(a0);
|
|
value = value.some(_fun29130);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
};
|
|
object3.getBillingReviewSubheader = getBillingReviewSubheader2;
|
|
object3.getIntervalForInvoice = getIntervalForInvoice2;
|
|
object3.getPremiumPlanItem = closure;
|
|
object3.getGuildBoostPlanItem = closure48;
|
|
object3.isBoostOnlySubscription = isBoostOnlySubscription2;
|
|
object3.getPremiumSkuIdForSubscription = getPremiumSkuIdForSubscription2;
|
|
object3.getPremiumTypeFromSubscription = closure51;
|
|
object3.getUnactivatedFractionalPremiumHours = getUnactivatedFractionalPremiumHours2;
|
|
object3.castPremiumSubscriptionAsSkuId = closure56;
|
|
object3.calculateDiscountPercentageForYearlyPlan = calculateDiscountPercentageForYearlyPlan2;
|
|
object3.getDaysSincePremium = getDaysSincePremium2;
|
|
object3.getDaysRemainingUntilSubscriptionCurrentPeriodEnds = getDaysRemainingUntilSubscriptionCurrentPeriodEnds2;
|
|
object3.canUseAnimatedEmojis = canUseAnimatedEmojis;
|
|
object3.canUseEmojisEverywhere = canUseEmojisEverywhere;
|
|
object3.canUseSoundboardEverywhere = canUseSoundboardEverywhere;
|
|
object3.canUseCustomCallSounds = canUseCustomCallSounds;
|
|
object3.canUploadLargeFiles = canUploadLargeFiles;
|
|
object3.canUseBadges = canUseBadges;
|
|
object3.canUseHighVideoUploadQuality = canUseHighVideoUploadQuality;
|
|
object3.canEditDiscriminator = canEditDiscriminator;
|
|
object3.hasBoostDiscount = hasBoostDiscount;
|
|
object3.canUseAnimatedAvatar = canUseAnimatedAvatar;
|
|
object3.canInstallPremiumApplications = canInstallPremiumApplications;
|
|
object3.canUseIncreasedMessageLength = canUseIncreasedMessageLength;
|
|
object3.canUseIncreasedGuildCap = canUseIncreasedGuildCap;
|
|
object3.canRedeemPremiumPerks = canRedeemPremiumPerks;
|
|
object3.canUsePremiumProfileCustomization = canUsePremiumProfileCustomization;
|
|
object3.canUsePremiumAppIcons = canUsePremiumAppIcons;
|
|
object3.canUsePremiumGuildMemberProfile = canUsePremiumGuildMemberProfile;
|
|
object3.canUseClientThemes = canUseClientThemes;
|
|
object3.canStreamQuality = canStreamQuality;
|
|
object3.canUseQuestOrbMultiplier = canUseQuestOrbMultiplier2;
|
|
object3.hasFreeBoosts = hasFreeBoosts;
|
|
object3.canUseCustomStickersEverywhere = canUseCustomStickersEverywhere;
|
|
object3.canUseCustomBackgrounds = canUseCustomBackgrounds;
|
|
object3.canUseCollectibles = canUseCollectibles2;
|
|
object3.canUseMonthlyOrbs = canUseMonthlyOrbs;
|
|
object3.canUseShopDiscounts = canUseShopDiscounts;
|
|
object3.canUseMoreQuestOrbs = canUseMoreQuestOrbs;
|
|
object3.formatPriceString = formatPriceString2;
|
|
object3.StreamQuality = object2;
|
|
set = Reflect.apply(freeze, Object, [object3]);
|
|
(FileImportTrackerModule).fileFinishedImporting('utils/PremiumUtils.tsx');
|
|
exports.default = set;
|
|
exports.Branding = {BUNDLE: 'bundle', TIER_0: 'tier_0', TIER_1: 'tier_1', TIER_2: 'tier_2',
|
|
PREMIUM_GUILD: 'premium_guild'};
|
|
exports.StreamQuality = object2;
|
|
exports.getPremiumBranding = getPremiumBranding;
|
|
exports.getPremiumPlanItem = closure;
|
|
exports.getDefaultPrice = getDefaultPrice2;
|
|
exports.withContextPlanPrices = closure3;
|
|
exports.usePlanSelectPriceState = usePlanSelectPriceState;
|
|
exports.getPrice = getPrice2;
|
|
exports.getCountryPrices = getCountryPrices;
|
|
exports.experimentalGetPrices = experimentalGetPrices2;
|
|
exports.experimentalGetPrice = experimentalGetPrice2;
|
|
exports.getServerPriceFromClientPrice = closure7;
|
|
exports.getItemPlansTotalServerPrice = getItemPlansTotalServerPrice2;
|
|
exports.getSubscriptionWithNewPlansTotalServerPrice = getSubscriptionWithNewPlansTotalServerPrice;
|
|
exports.getInterval = getInterval2;
|
|
exports.getDiscountIntervalString = getDiscountIntervalString;
|
|
exports.getIntervalString = getIntervalString2;
|
|
exports.getIntervalStringAsNoun = getIntervalStringAsNoun2;
|
|
exports.getPremiumType = getPremiumType2;
|
|
exports.getDisplayName = getDisplayName_290512;
|
|
exports.getDisplayNameFromSku = getDisplayNameFromSku;
|
|
exports.getTierDisplayNameByPlanId = getTierDisplayNameByPlanId2;
|
|
exports.getPremiumTypeDisplayName = getPremiumTypeDisplayName;
|
|
exports.getPlanDescriptionFromInvoice = getPlanDescriptionFromInvoice;
|
|
exports.getExternalPlanDisplayName = getExternalPlanDisplayName;
|
|
exports.getPremiumPlanOptions = getPremiumPlanOptions2;
|
|
exports.getPlanIdForPremiumType = getPlanIdForPremiumType;
|
|
exports.getNumPremiumGuildSubscriptions = getNumPremiumGuildSubscriptions2;
|
|
exports.subscriptionHasPremiumGuildPlan = subscriptionHasPremiumGuildPlan2;
|
|
exports.isPremiumBaseSubscriptionPlan = isPremiumBaseSubscriptionPlan2;
|
|
exports.isPremiumGuildSubscriptionPlan = closure21;
|
|
exports.isPremiumSubscriptionPlan = isPremiumSubscriptionPlan;
|
|
exports.isPremiumGroupSubscriptionPlan = isPremiumGroupSubscriptionPlan;
|
|
exports.getBillingGracePeriodDaysAndExpiresDate = getBillingGracePeriodDaysAndExpiresDate2;
|
|
exports.getExpectedRenewalDate = getExpectedRenewalDate2;
|
|
exports.getBillingInformationString = getBillingInformationString2;
|
|
exports.extendDateWithUnconsumedFractionalPremium = extendDateWithUnconsumedFractionalPremium2;
|
|
exports.getUnactivatedFractionalPremiumDurationString = getUnactivatedFractionalPremiumDurationString2;
|
|
exports.isSwitchingPlansDisabled = isSwitchingPlansDisabled2;
|
|
exports.getSwitchingPlansDisabledMessage = getSwitchingPlansDisabledMessage2;
|
|
exports.isSubscriptionPrepaidPaymentSource = isSubscriptionPrepaidPaymentSource2;
|
|
exports.isPrepaidPaymentSource = isPrepaidPaymentSource2;
|
|
exports.getCoercedPremiumGuildSubscriptionStatus = closure31;
|
|
exports.isPremiumGuildSubscriptionCanceled = isPremiumGuildSubscriptionCanceled2;
|
|
exports.getPremiumGuildHeaderDescription = getPremiumGuildHeaderDescription;
|
|
exports.getFormattedPriceForPlan = getFormattedPriceForPlan2;
|
|
exports.getFormattedRateForPlan = getFormattedRateForPlan;
|
|
exports.getPlanIdFromInvoice = getPlanIdFromInvoice2;
|
|
exports.getStatusFromInvoice = getStatusFromInvoice2;
|
|
exports.isBaseSubscriptionCanceled = isBaseSubscriptionCanceled2;
|
|
exports.isSubscriptionStatusFailedPayment = isSubscriptionStatusFailedPayment2;
|
|
exports.getFormattedPlanPriceFromInvoice = getFormattedPlanPriceFromInvoice2;
|
|
exports.getPremiumGuildIntervalPrice = getPremiumGuildIntervalPrice2;
|
|
exports.getBillingReviewSubheader = getBillingReviewSubheader2;
|
|
exports.getIntervalForInvoice = getIntervalForInvoice2;
|
|
exports.getDefaultCurrency = getDefaultCurrency2;
|
|
exports.formatTrialOfferIntervalDuration = formatTrialOfferIntervalDuration;
|
|
exports.formatTrialCtaIntervalDuration = formatTrialCtaIntervalDuration2;
|
|
exports.formatTrialCtaIntervalDurationFromTrialOffer = formatTrialCtaIntervalDurationFromTrialOffer;
|
|
exports.formatIntervalDuration = formatIntervalDuration;
|
|
exports.getExternalSubscriptionMethodUrl = getExternalSubscriptionMethodUrl2;
|
|
exports.hasPremiumSubscriptionToDisplay = hasPremiumSubscriptionToDisplay;
|
|
exports.useHasPremiumSubscriptionToDisplay = useHasPremiumSubscriptionToDisplay;
|
|
exports.getItemsFromNewAdditionalPlans = closure45;
|
|
exports.getItemsWithoutPremiumPlanItem = closure46;
|
|
exports.getItemsWithUpsertedPlanIdForGroup = getItemsWithUpsertedPlanIdForGroup2;
|
|
exports.getItemsWithUpsertedPremiumPlanId = function(a0, a1) {
|
|
return getItemsWithUpsertedPlanIdForGroup(a0, a1, 1, PREMIUM_PLANS);
|
|
};
|
|
exports.getItemsWithUpsertedPremiumGuildPlan = function(a0, a1, a2) {
|
|
return getItemsWithUpsertedPlanIdForGroup(a0, a2, a1, PREMIUM_GUILD_SUBSCRIPTION_PLANS);
|
|
};
|
|
exports.coerceExistingItemsToNewItemInterval = coerceExistingItemsToNewItemInterval;
|
|
exports.getMaxFileSizeForPremiumType = getMaxFileSizeForPremiumType;
|
|
exports.getGuildBoostPlanItem = closure48;
|
|
exports.isBoostOnlySubscription = isBoostOnlySubscription2;
|
|
exports.getPremiumSkuIdForSubscription = getPremiumSkuIdForSubscription2;
|
|
exports.getPremiumTypeFromSubscription = closure51;
|
|
exports.isNewUser = closure52;
|
|
exports.formatPriceString = formatPriceString2;
|
|
exports.castPremiumSubscriptionAsSkuId = closure56;
|
|
exports.getPremiumTypeFromPlanId = getPremiumTypeFromPlanId;
|
|
exports.isNitroLockedState = function(a0) {
|
|
return 'isNitroLocked' in a0;
|
|
};
|
|
exports.isPremiumAtLeast = isPremiumAtLeast;
|
|
exports.isPremiumAtMost = (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremiumAtMost;
|
|
exports.isPremium = isPremium;
|
|
exports.isPremiumExactly = isPremiumExactly;
|
|
exports.useHasTier2Premium = function() {
|
|
return require(dependencyMap[15]).isPremiumExactly(require(dependencyMap[26]).useStateFromStores([UserStore],
|
|
_fun29192), PremiumTypes.TIER_2);
|
|
};
|
|
exports.getOfferNoticeThreshold = function(a0) {
|
|
var trial_id;
|
|
if (isTrialOffer(a0)) {
|
|
trial_id = a0.trial_id;
|
|
if (PREMIUM_TIER_2_REVERSE_FOLLOWUP_TRIAL_ID === trial_id) {
|
|
return USER_PREMIUM_OFFER_EXPIRES_APPROACHING_4_DAY_THRESHOLD;
|
|
}
|
|
if (PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID === trial_id) {
|
|
return TRIAL_FOR_EVERYONE_OFFER_EXPIRES_APPROACHING_THRESHOLD;
|
|
}
|
|
return USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD;
|
|
}
|
|
return isDiscountOffer(a0) ? USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD : USER_PREMIUM_OFFER_EXPIRES_APPROACHING_7_DAY_THRESHOLD;
|
|
};
|
|
exports.isTrialOffer = closure57;
|
|
exports.isDiscountOffer = closure58;
|
|
exports.formatInterval = formatInterval2;
|
|
exports.isPremiumEligible = closure60;
|
|
exports.getFractionalPremiumUnitsHours = getUnactivatedFractionalPremiumHours2;
|
|
exports.getFractionalPremiumUnitsHoursFromSkuIds = closure62;
|
|
exports.getMonthlyPrice = getMonthlyPrice2;
|
|
exports.getSavingsPercent = getSavingsPercent;
|
|
exports.calculateMonthlyPriceEquivalentTotal = calculateMonthlyPriceEquivalentTotal;
|
|
exports.calculateDiscountPercentageForYearlyPlan = calculateDiscountPercentageForYearlyPlan2;
|
|
exports.getDaysSincePremium = getDaysSincePremium2;
|
|
exports.getDaysRemainingUntilSubscriptionCurrentPeriodEnds = getDaysRemainingUntilSubscriptionCurrentPeriodEnds2;
|
|
function _createForOfIteratorHelperLoose_29031(a0, a1) { // fn#29031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:1580, offset: 0x00fb5a8c, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun29032;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_29033(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_29033(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_29033(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun29032;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun29032() { // fn#29032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:2151, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function getPremiumPlanItem({items}) { // fn#29034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3126, offset: 0x00fb5bfe, size: 29 bytes, params: 2, frame: 11
|
|
return items.find(function(a0) {
|
|
return PREMIUM_PLANS.has(a0.planId);
|
|
});
|
|
function _fun29035({planId}) { // fn#29035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3178, offset: 0x00fb5c1b, size: 28 bytes, params: 2, frame: 11
|
|
return PREMIUM_PLANS.has(planId);
|
|
}
|
|
|
|
}
|
|
|
|
function getDefaultPrice(a0) { // fn#29036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3199, offset: 0x00fb5c37, size: 144 bytes, params: 2, frame: 23
|
|
const value = a1;
|
|
const value2 = a2;
|
|
const value3 = a3;
|
|
const value4 = a4;
|
|
const value5 = undefined;
|
|
const r6 = value !== value5 ? value : false;
|
|
const r5 = value2 !== value5 ? value2 : false;
|
|
const r0 = value3 !== value5 ? value3 : value5;
|
|
const r4 = !(value4 !== value5) || value4;
|
|
let r7 = PaymentSourceStore.defaultPaymentSourceId ?? value5;
|
|
const premiumTypeSubscription = SubscriptionStore.getPremiumTypeSubscription();
|
|
r7 = premiumTypeSubscription != null && premiumTypeSubscription.paymentSourceId != null ? premiumTypeSubscription.paymentSourceId : r7;
|
|
return getPrice(a0, r6, r5, {paymentSourceId: r7, currency: r0}, r4);
|
|
}
|
|
|
|
function withContextPlanPrices(a0, a1) { // fn#29037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3448, offset: 0x00fb5cc7, size: 79 bytes, params: 3, frame: 16
|
|
var r0;
|
|
var object;
|
|
var Object;
|
|
let value = a0;
|
|
if (a1 == null) {
|
|
r0 = value;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, value, a1);
|
|
Object = global.Object;
|
|
value = Object.fromEntries(a1.map(function(a0) {
|
|
return [a0.id, a0.price];
|
|
}));
|
|
object['contextPlanPrices'] = value;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getPrice(a0) { // fn#29039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3573, offset: 0x00fb5d32, size: 508 bytes, params: 2, frame: 26
|
|
var r9;
|
|
var object;
|
|
var subscriptionPlanStoreBinding;
|
|
var error;
|
|
var captureBillingException;
|
|
var value7;
|
|
var object3;
|
|
var experimentalGetPriceBinding;
|
|
var value9;
|
|
var object5;
|
|
let value = a1;
|
|
const value2 = a2;
|
|
const value3 = a3;
|
|
const value4 = a4;
|
|
const r0 = value !== undefined ? value : false;
|
|
const r4 = value2 !== undefined ? value2 : false;
|
|
const r14 = value3 !== undefined ? value3 : {};
|
|
const r2 = !(value4 !== undefined) || value4;
|
|
const paymentSourceId = r14.paymentSourceId;
|
|
const currency = r14.currency;
|
|
const contextPlanPrices = r14.contextPlanPrices;
|
|
if (contextPlanPrices == null) {
|
|
subscriptionPlanStoreBinding = SubscriptionPlanStore;
|
|
if (subscriptionPlanStoreBinding.get(a0) != null) {
|
|
r9 = r4 ? PriceSetAssignmentPurchaseTypes.GIFT : r0 ? PriceSetAssignmentPurchaseTypes.PREMIUM_TIER_1 : PriceSetAssignmentPurchaseTypes.DEFAULT;
|
|
experimentalGetPriceBinding = experimentalGetPrice;
|
|
object = {paymentSourceId: paymentSourceId, purchaseType: r9, currency: currency};
|
|
value9 = experimentalGetPriceBinding(a0, object);
|
|
if (value9 == null) {
|
|
error = new global.Error("Couldn't find price");
|
|
if (r2) {
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
object = {};
|
|
object.extra = {paymentSourceId: paymentSourceId};
|
|
object5 = {};
|
|
object5.purchaseType = r9.toString();
|
|
object5.planId = a0;
|
|
object5.currency = currency ?? 'unknown';
|
|
object.tags = object5;
|
|
Reflect.apply(captureBillingException, value, [error, object]);
|
|
}
|
|
throw error;
|
|
}
|
|
return value9;
|
|
}
|
|
error = new global.Error('Plan not found');
|
|
if (r2) {
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
object = {};
|
|
value7 = currency != null;
|
|
object.tags = {planId: a0, currency: value7 ? currency : 'unknown'};
|
|
object3 = {};
|
|
copyDataProperties(object3, r14, value7);
|
|
object3['isGift'] = r4;
|
|
object.extra = object3;
|
|
Reflect.apply(captureBillingException, value, [error, object]);
|
|
}
|
|
throw error;
|
|
}
|
|
const property = contextPlanPrices[a0];
|
|
const r1 = currency != null && property != null && property.currency !== currency;
|
|
if (property == null) {
|
|
subscriptionPlanStoreBinding = SubscriptionPlanStore;
|
|
if (subscriptionPlanStoreBinding.get(a0) != null) {
|
|
r9 = r4 ? PriceSetAssignmentPurchaseTypes.GIFT : r0 ? PriceSetAssignmentPurchaseTypes.PREMIUM_TIER_1 : PriceSetAssignmentPurchaseTypes.DEFAULT;
|
|
experimentalGetPriceBinding = experimentalGetPrice;
|
|
object = {paymentSourceId: paymentSourceId, purchaseType: r9, currency: currency};
|
|
value9 = experimentalGetPriceBinding(a0, object);
|
|
if (value9 == null) {
|
|
error = new global.Error("Couldn't find price");
|
|
if (r2) {
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
object = {};
|
|
object.extra = {paymentSourceId: paymentSourceId};
|
|
object5 = {};
|
|
object5.purchaseType = r9.toString();
|
|
object5.planId = a0;
|
|
object5.currency = currency ?? 'unknown';
|
|
object.tags = object5;
|
|
Reflect.apply(captureBillingException, value, [error, object]);
|
|
}
|
|
throw error;
|
|
}
|
|
return value9;
|
|
}
|
|
error = new global.Error('Plan not found');
|
|
if (r2) {
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
object = {};
|
|
value7 = currency != null;
|
|
object.tags = {planId: a0, currency: value7 ? currency : 'unknown'};
|
|
object3 = {};
|
|
copyDataProperties(object3, r14, value7);
|
|
object3['isGift'] = r4;
|
|
object.extra = object3;
|
|
Reflect.apply(captureBillingException, value, [error, object]);
|
|
}
|
|
throw error;
|
|
}
|
|
if (r1) {
|
|
subscriptionPlanStoreBinding = SubscriptionPlanStore;
|
|
if (subscriptionPlanStoreBinding.get(a0) != null) {
|
|
r9 = r4 ? PriceSetAssignmentPurchaseTypes.GIFT : r0 ? PriceSetAssignmentPurchaseTypes.PREMIUM_TIER_1 : PriceSetAssignmentPurchaseTypes.DEFAULT;
|
|
experimentalGetPriceBinding = experimentalGetPrice;
|
|
object = {paymentSourceId: paymentSourceId, purchaseType: r9, currency: currency};
|
|
value9 = experimentalGetPriceBinding(a0, object);
|
|
if (value9 == null) {
|
|
error = new global.Error("Couldn't find price");
|
|
if (r2) {
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
object = {};
|
|
object.extra = {paymentSourceId: paymentSourceId};
|
|
object5 = {};
|
|
object5.purchaseType = r9.toString();
|
|
object5.planId = a0;
|
|
object5.currency = currency ?? 'unknown';
|
|
object.tags = object5;
|
|
Reflect.apply(captureBillingException, value, [error, object]);
|
|
}
|
|
throw error;
|
|
}
|
|
return value9;
|
|
}
|
|
error = new global.Error('Plan not found');
|
|
if (r2) {
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
object = {};
|
|
value7 = currency != null;
|
|
object.tags = {planId: a0, currency: value7 ? currency : 'unknown'};
|
|
object3 = {};
|
|
copyDataProperties(object3, r14, value7);
|
|
object3['isGift'] = r4;
|
|
object.extra = object3;
|
|
Reflect.apply(captureBillingException, value, [error, object]);
|
|
}
|
|
throw error;
|
|
}
|
|
return {amount: property.amount, currency: property.currency, exponent: property.exponent, tax: 0,
|
|
taxInclusive: false};
|
|
}
|
|
|
|
function getPurchaseTypePrices(a0, a1) { // fn#29040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:4336, offset: 0x00fb5f2e, size: 354 bytes, params: 3, frame: 21
|
|
var binding;
|
|
var info;
|
|
var JSON;
|
|
var stringify;
|
|
var Object;
|
|
var Error;
|
|
var error;
|
|
var captureBillingException;
|
|
var object2;
|
|
var value;
|
|
const value2 = SubscriptionPlanStore.get(a0);
|
|
if (value2 == null) {
|
|
error = new global.Error('Plan not found');
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
object2 = {planId: a0};
|
|
object2.purchaseType = a1.toString();
|
|
Reflect.apply(captureBillingException, value, [error, {tags: object2}]);
|
|
throw error;
|
|
}
|
|
if (value2.prices == null) {
|
|
Error = global.Error;
|
|
value = 'No prices returned for ' + a0 + ', is your user in the experiment?';
|
|
throw new Error();
|
|
}
|
|
const property = value2.prices[a1];
|
|
if (property == null) {
|
|
binding = env0_53;
|
|
info = binding.info;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
Object = global.Object;
|
|
value = Reflect.apply(stringify, JSON, [Object.keys(value2.prices)]);
|
|
Reflect.apply(info, binding, ['Purchase types: ' + value]);
|
|
Error = global.Error;
|
|
value = 'No prices returned for purchase type ' + a1 + ' for plan ' + a0;
|
|
throw new Error();
|
|
}
|
|
return property;
|
|
}
|
|
|
|
function experimentalGetPrices(a0) { // fn#29041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:4801, offset: 0x00fb6090, size: 507 bytes, params: 2, frame: 25
|
|
var object;
|
|
var binding;
|
|
var info;
|
|
var JSON;
|
|
var stringify;
|
|
var Object;
|
|
var error;
|
|
var moduleValue;
|
|
var captureBillingException;
|
|
var object3;
|
|
var countryPrices;
|
|
let value = a1;
|
|
const r0 = value !== undefined ? value : {purchaseType: PriceSetAssignmentPurchaseTypes.DEFAULT};
|
|
const paymentSourceId = r0.paymentSourceId;
|
|
const purchaseType = r0.purchaseType;
|
|
const purchaseTypePrices = getPurchaseTypePrices(a0, purchaseType);
|
|
if (paymentSourceId == null) {
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
if (countryPrices.prices == null) {
|
|
binding = env0_53;
|
|
info = binding.info;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
Reflect.apply(info, binding, ['countryPrices: ' + Reflect.apply(stringify, JSON, [countryPrices])]);
|
|
error = new global.Error('Missing prices for country');
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
Reflect.apply(captureBillingException, value, [error, {tags: {countryCode: countryPrices.countryCode,
|
|
planId: a0}}]);
|
|
throw error;
|
|
}
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
return countryPrices.prices;
|
|
}
|
|
const property = purchaseTypePrices.paymentSourcePrices[paymentSourceId];
|
|
if (property == null) {
|
|
binding = env0_53;
|
|
info = binding.info;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
Object = global.Object;
|
|
Reflect.apply(info, binding, ['Payment sources IDs: ' + Reflect.apply(stringify, JSON,
|
|
[Object.keys(purchaseTypePrices.paymentSourcePrices)])]);
|
|
binding = env0_53;
|
|
binding.info('prices: ' + property);
|
|
error = new global.Error('Missing prices for payment source on subscription plan');
|
|
moduleValue = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = moduleValue.captureBillingException;
|
|
object = {};
|
|
object.extra = {paymentSourceId: paymentSourceId};
|
|
object3 = {};
|
|
object3.purchaseType = purchaseType.toString();
|
|
object3.planId = a0;
|
|
object.tags = object3;
|
|
Reflect.apply(captureBillingException, moduleValue, [error, object]);
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
if (countryPrices.prices == null) {
|
|
binding = env0_53;
|
|
info = binding.info;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
Reflect.apply(info, binding, ['countryPrices: ' + Reflect.apply(stringify, JSON, [countryPrices])]);
|
|
error = new global.Error('Missing prices for country');
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
Reflect.apply(captureBillingException, value, [error, {tags: {countryCode: countryPrices.countryCode,
|
|
planId: a0}}]);
|
|
throw error;
|
|
}
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
return countryPrices.prices;
|
|
}
|
|
if (property.length === 0) {
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
if (countryPrices.prices == null) {
|
|
binding = env0_53;
|
|
info = binding.info;
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
Reflect.apply(info, binding, ['countryPrices: ' + Reflect.apply(stringify, JSON, [countryPrices])]);
|
|
error = new global.Error('Missing prices for country');
|
|
value = require(3817) /* metro dependency 3817: BillingUtils */;
|
|
captureBillingException = value.captureBillingException;
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
Reflect.apply(captureBillingException, value, [error, {tags: {countryCode: countryPrices.countryCode,
|
|
planId: a0}}]);
|
|
throw error;
|
|
}
|
|
countryPrices = purchaseTypePrices.countryPrices;
|
|
return countryPrices.prices;
|
|
}
|
|
return property;
|
|
}
|
|
|
|
function experimentalGetPrice(a0) { // fn#29042, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:5577, offset: 0x00fb628b, size: 232 bytes, params: 2, frame: 27
|
|
var r1;
|
|
var value4;
|
|
let value = a1;
|
|
const value2 = undefined;
|
|
let r0 = value !== value2 ? value : {purchaseType: PriceSetAssignmentPurchaseTypes.DEFAULT};
|
|
const paymentSourceId = r0.paymentSourceId;
|
|
const purchaseType = r0.purchaseType;
|
|
const currency = r0.currency;
|
|
const value3 = experimentalGetPrices(a0, {paymentSourceId: paymentSourceId, purchaseType: purchaseType});
|
|
if (value3.length === 0) {
|
|
env0_53.warn('No prices found for planId: ' + a0 + ', paymentSourceId: ' + paymentSourceId + ', purchaseType: ' + purchaseType);
|
|
}
|
|
if (currency != null) {
|
|
value4 = value3.find(function({currency}) {
|
|
return currency === currency.toLowerCase();
|
|
});
|
|
if (value4 != null) {
|
|
r0 = value4;
|
|
} else {
|
|
if (paymentSourceId != null) {
|
|
value = experimentalGetPrices(a0, {purchaseType: purchaseType});
|
|
value = value.find(_fun29044);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value2;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
return value3[0];
|
|
function _fun29044({currency}) { // fn#29044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:5981, offset: 0x00fb6373, size: 32 bytes, params: 2, frame: 10
|
|
const currencyBinding = currency;
|
|
return currency === currencyBinding.toLowerCase();
|
|
}
|
|
|
|
}
|
|
|
|
function getItemPlansTotalServerPrice(a0, a1, a2) { // fn#29046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6140, offset: 0x00fb63bb, size: 383 bytes, params: 4, frame: 27
|
|
var premiumType;
|
|
var r4;
|
|
var r11;
|
|
var r14;
|
|
var r12;
|
|
var planId;
|
|
var value6;
|
|
var has;
|
|
var value7;
|
|
var value8;
|
|
var getPriceBinding;
|
|
var priceBinding;
|
|
var getDefaultPriceBinding;
|
|
var defaultPriceBinding;
|
|
var amount;
|
|
var amount2;
|
|
var quantity;
|
|
var value11;
|
|
const object = {'currency': null, 'amount': 0, 'tax': 0, 'taxInclusive': false};
|
|
object.currency = a1;
|
|
const value2 = undefined;
|
|
const baseSubscriptionItemForSubscriptionItems = (PremiumSubscriptionModule).getBaseSubscriptionItemForSubscriptionItems(a0);
|
|
if (baseSubscriptionItemForSubscriptionItems != null) {
|
|
planId = baseSubscriptionItemForSubscriptionItems.planId;
|
|
premiumType = SubscriptionPlanInfo[planId].premiumType;
|
|
} else {
|
|
premiumType = value2;
|
|
}
|
|
let isPremiumAtLeast = PremiumTypeUtilsModule.isPremiumAtLeast;
|
|
const TIER_0 = PremiumTypes.TIER_0;
|
|
const isPremiumAtLeast2 = Reflect.apply(isPremiumAtLeast, PremiumTypeUtilsModule, [premiumType, TIER_0]);
|
|
isPremiumAtLeast = PremiumTypeUtilsModule.isPremiumAtLeast;
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
const isPremiumAtLeast3 = Reflect.apply(isPremiumAtLeast, PremiumTypeUtilsModule, [premiumType, TIER_2]);
|
|
const value4 = _createForOfIteratorHelperLoose_29031(a0);
|
|
const value5 = value4();
|
|
let done = value5.done;
|
|
if (!done) {
|
|
r4 = value5;
|
|
while (true) {
|
|
value6 = r4.value;
|
|
has = PREMIUM_GUILD_SUBSCRIPTION_PLANS.has;
|
|
planId = value6.planId;
|
|
if (Reflect.apply(has, PREMIUM_GUILD_SUBSCRIPTION_PLANS, [planId])) {
|
|
r14 = isPremiumAtLeast3;
|
|
} else {
|
|
value7 = PREMIUM_PLANS.has(value6.planId);
|
|
value8 = !value7;
|
|
if (value7) {
|
|
r11 = value8;
|
|
continue;
|
|
}
|
|
r11 = isPremiumAtLeast2;
|
|
continue;
|
|
r14 = r11;
|
|
}
|
|
if (value2 === a2) {
|
|
getDefaultPriceBinding = getDefaultPrice;
|
|
planId = value6.planId;
|
|
defaultPriceBinding = getDefaultPriceBinding(planId, r14, false, a1);
|
|
r12 = defaultPriceBinding;
|
|
} else {
|
|
getPriceBinding = getPrice;
|
|
planId = value6.planId;
|
|
priceBinding = getPriceBinding(planId, r14, false, {paymentSourceId: a2, currency: a1});
|
|
r12 = priceBinding;
|
|
}
|
|
amount = object.amount;
|
|
amount2 = r12.amount;
|
|
quantity = value6.quantity;
|
|
object.amount = amount + amount2 * quantity;
|
|
value11 = value4();
|
|
done = value11.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value11;
|
|
continue;
|
|
}
|
|
}
|
|
return getServerPriceFromClientPrice(object);
|
|
}
|
|
|
|
function getInterval(a0) { // fn#29047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6718, offset: 0x00fb653a, size: 130 bytes, params: 2, frame: 16
|
|
const property = SubscriptionPlanInfo[a0];
|
|
if (property != null) {
|
|
return {intervalType: property.interval, intervalCount: property.intervalCount};
|
|
}
|
|
const Error = global.Error;
|
|
const error = new Error('Unsupported plan');
|
|
(BillingUtilsModule).captureBillingException(error, {tags: {planId: a0}});
|
|
throw error;
|
|
}
|
|
|
|
function getIntervalString(a0, a1, a2) { // fn#29048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:6925, offset: 0x00fb65bc, size: 839 bytes, params: 4, frame: 22
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
var formatToPlainString;
|
|
const intl2 = (IndexNativeModule).intl;
|
|
const intl3 = (IndexNativeModule).intl;
|
|
const value = a3;
|
|
const value2 = a4;
|
|
const value3 = a5;
|
|
const r9 = value !== undefined ? value : 1;
|
|
const r2 = value2 !== undefined ? value2 : false;
|
|
let r3 = value3 !== undefined ? value3 : PremiumTypes.TIER_2;
|
|
if (a1) {
|
|
if (SubscriptionIntervalTypes.MONTH === a0) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
r3 = r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT;
|
|
return r2 ? Reflect.apply(formatToPlainString, intl, [r3,
|
|
{timeInterval: intl3.string(t.FPybU7)}]) : intl.string(t.Mh9bTt);
|
|
}
|
|
if (SubscriptionIntervalTypes.YEAR === a0) {
|
|
return r2 ? intl.formatToPlainString(r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT,
|
|
{timeInterval: intl2.string(t.tfqrhj)}) : intl.string(t.DRgqMo);
|
|
}
|
|
throw new global.Error('Unexpected interval');
|
|
}
|
|
if (a2) {
|
|
if (SubscriptionIntervalTypes.MONTH === a0) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
r3 = r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT;
|
|
return r2 ? Reflect.apply(formatToPlainString, intl, [r3,
|
|
{timeInterval: intl3.string(t.FPybU7)}]) : intl.string(t.Mh9bTt);
|
|
}
|
|
if (SubscriptionIntervalTypes.YEAR === a0) {
|
|
return r2 ? intl.formatToPlainString(r3 === PremiumTypes.TIER_0 ? t.NPKsLz : t.poEovT,
|
|
{timeInterval: intl2.string(t.tfqrhj)}) : intl.string(t.DRgqMo);
|
|
}
|
|
throw new global.Error('Unexpected interval');
|
|
}
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (MONTH === a0) {
|
|
return r9 !== 1 ? intl.formatToPlainString(t['0UlZnH'], {intervalCount: r9}) : intl.string(t.DKzs96);
|
|
}
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (YEAR === a0) {
|
|
return intl.string(t['/Q4HRN']);
|
|
}
|
|
const Error = global.Error;
|
|
throw new Error('Unexpected interval');
|
|
}
|
|
|
|
function getIntervalStringAsNoun(a0) { // fn#29049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:7741, offset: 0x00fb6903, size: 188 bytes, params: 2, frame: 15
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (MONTH === a0) {
|
|
return intl.string(t.FPybU7);
|
|
}
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (YEAR === a0) {
|
|
return intl.string(t.tfqrhj);
|
|
}
|
|
const Error = global.Error;
|
|
throw new Error('Unexpected interval');
|
|
}
|
|
|
|
function getPremiumType(a0) { // fn#29050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:7958, offset: 0x00fb69bf, size: 112 bytes, params: 2, frame: 16
|
|
const property = SubscriptionPlanInfo[a0];
|
|
if (property != null) {
|
|
return property.premiumType;
|
|
}
|
|
const Error = global.Error;
|
|
const error = new Error('Unsupported plan');
|
|
(BillingUtilsModule).captureBillingException(error, {tags: {planId: a0}});
|
|
throw error;
|
|
}
|
|
|
|
function getDisplayName_29051(a0) { // fn#29051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:8127, offset: 0x00fb6a2f, size: 1619 bytes, params: 2, frame: 22
|
|
var r2;
|
|
var object;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var property;
|
|
var formatToPlainString;
|
|
const value = a1;
|
|
const value2 = a2;
|
|
const r3 = value !== undefined ? value : false;
|
|
let r0 = value2 !== undefined ? value2 : false;
|
|
const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0;
|
|
if (PREMIUM_MONTH_TIER_0 === a0) {
|
|
r0 = r3 ? intl.format(t.TZXHNj, {duration: a3}) : r0 ? intl.string(t['81iAgs']) : intl.string(t['0efVPy']);
|
|
return r0;
|
|
}
|
|
const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0;
|
|
if (PREMIUM_YEAR_TIER_0 === a0) {
|
|
return r3 ? intl.format(t.eqRhC7, {duration: a3}) : r0 ? intl.string(t.UvzqY1) : intl.string(t.eoVuBn);
|
|
}
|
|
const PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1;
|
|
if (PREMIUM_MONTH_TIER_1 === a0) {
|
|
string = intl.string;
|
|
return r0 ? Reflect.apply(string, intl, [t['g/dH5g']]) : Reflect.apply(string, intl, [t['7O6qSq']]);
|
|
}
|
|
const PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1;
|
|
if (PREMIUM_YEAR_TIER_1 === a0) {
|
|
string = intl.string;
|
|
return r0 ? Reflect.apply(string, intl, [t.pdZJaq]) : Reflect.apply(string, intl, [t.Md5xbi]);
|
|
}
|
|
const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
if (PREMIUM_MONTH_TIER_2 === a0) {
|
|
return r3 ? intl.format(t.aI6QXz, {duration: a3}) : r0 ? intl.string(t.SmVbHc) : intl.string(t.FKYNC6);
|
|
}
|
|
const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH;
|
|
if (PREMIUM_GROUP_MONTH === a0) {
|
|
if (r0) {
|
|
r2 = intl.string(t.SmVbHc);
|
|
} else {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
property = (importDefault(2806) /* metro dependency 2806: PremiumGroupMessages */)['8bPDtb'];
|
|
object = {};
|
|
object.premiumGroupProductName = getPremiumGroupProductName();
|
|
r2 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
}
|
|
return r2;
|
|
}
|
|
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
if (PREMIUM_YEAR_TIER_2 === a0) {
|
|
return r3 ? intl.format(t['1wBcPi'], {duration: a3}) : r0 ? intl.string(t.JIq4O1) : intl.string(t['cfu/5d']);
|
|
}
|
|
const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2;
|
|
if (PREMIUM_3_MONTH_TIER_2 === a0) {
|
|
return intl.string(t.wCbINr);
|
|
}
|
|
const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2;
|
|
if (PREMIUM_6_MONTH_TIER_2 === a0) {
|
|
return intl.string(t['e3/ArU']);
|
|
}
|
|
const PREMIUM_MONTH_GUILD = SubscriptionPlans.PREMIUM_MONTH_GUILD;
|
|
if (PREMIUM_MONTH_GUILD === a0) {
|
|
string = intl.string;
|
|
return r0 ? Reflect.apply(string, intl, [t['6ZR3By']]) : Reflect.apply(string, intl, [t['h80cx/']]);
|
|
}
|
|
const PREMIUM_YEAR_GUILD = SubscriptionPlans.PREMIUM_YEAR_GUILD;
|
|
if (PREMIUM_YEAR_GUILD === a0) {
|
|
string = intl.string;
|
|
return r0 ? Reflect.apply(string, intl, [t.YDpAzZ]) : Reflect.apply(string, intl, [t.ZHkls0]);
|
|
}
|
|
const PREMIUM_3_MONTH_GUILD = SubscriptionPlans.PREMIUM_3_MONTH_GUILD;
|
|
if (PREMIUM_3_MONTH_GUILD === a0) {
|
|
return intl.string(t.EZHHB6);
|
|
}
|
|
const PREMIUM_6_MONTH_GUILD = SubscriptionPlans.PREMIUM_6_MONTH_GUILD;
|
|
if (PREMIUM_6_MONTH_GUILD === a0) {
|
|
return intl.string(t.X2KDO2);
|
|
}
|
|
const PREMIUM_MONTH_LEGACY = SubscriptionPlans.PREMIUM_MONTH_LEGACY;
|
|
if (PREMIUM_MONTH_LEGACY === a0) {
|
|
return intl.string(t.PD6k79);
|
|
}
|
|
const PREMIUM_YEAR_LEGACY = SubscriptionPlans.PREMIUM_YEAR_LEGACY;
|
|
if (PREMIUM_YEAR_LEGACY === a0) {
|
|
return intl.string(t.LtJgTC);
|
|
}
|
|
const Error = global.Error;
|
|
const error = new Error('Unsupported plan');
|
|
(BillingUtilsModule).captureBillingException(error, {tags: {planId: a0}});
|
|
throw error;
|
|
}
|
|
|
|
function getTierDisplayNameByPlanId(a0) { // fn#29052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:10122, offset: 0x00fb7082, size: 173 bytes, params: 2, frame: 18
|
|
const property = SubscriptionPlanInfo[a0];
|
|
const value2 = null;
|
|
const premiumType = value2 == property ? undefined : property.premiumType;
|
|
const r2 = value2 != premiumType ? PREMIUM_TYPE_DISPLAY_NAME[premiumType] : value2;
|
|
if (value2 != r2) {
|
|
return (require(1244) /* metro dependency 1244: indexNative */).intl.string(r2);
|
|
}
|
|
const Error = global.Error;
|
|
const error = new Error('Unsupported plan');
|
|
(BillingUtilsModule).captureBillingException(error, {tags: {planId: a0}});
|
|
throw error;
|
|
}
|
|
|
|
function getPlanDescription({subscription, planId, price, includePremiumGuilds, hasDiscountApplied, activeDiscountInfo, renewalInvoiceWithoutEntitlementsPreview, renewalInvoiceWithEntitlementsPreview, hasFractionalPremiumWithSub, fractionalPremiumInfo}) { // fn#29053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:10367, offset: 0x00fb712f, size: 3886 bytes, params: 2, frame: 35
|
|
var r0;
|
|
var r8;
|
|
var r13;
|
|
var r23;
|
|
var r15;
|
|
var r18;
|
|
var r17;
|
|
var currentUser;
|
|
const t = (IndexNativeModule).t;
|
|
var object;
|
|
var formatToPlainString;
|
|
var z2oQtA;
|
|
var moduleValue;
|
|
var value34;
|
|
var moduleValue2;
|
|
var value36;
|
|
var moduleValue3;
|
|
var value38;
|
|
let property = SubscriptionPlanInfo[planId];
|
|
const value4 = formatPriceString(getDefaultPrice(property.id), property.interval);
|
|
let r4 = renewalInvoiceWithEntitlementsPreview != null && renewalInvoiceWithEntitlementsPreview.subtotal === 0;
|
|
const isBaseSubscriptionCanceled2 = isBaseSubscriptionCanceled(subscription);
|
|
if (isBaseSubscriptionCanceled2) {
|
|
r8 = isBaseSubscriptionCanceled2;
|
|
} else {
|
|
r0 = subscription.paymentSourceId == null && !subscription.isPurchasedExternally;
|
|
if (r0) {
|
|
currentUser = UserStore.getCurrentUser();
|
|
r0 = !(currentUser != null && currentUser.hasFreePremium());
|
|
}
|
|
r0 = r0 && !r4;
|
|
r8 = r0;
|
|
}
|
|
r0 = price != null && subscription.paymentGateway == null;
|
|
const status = subscription.status;
|
|
const UNPAID = SubscriptionStatusTypes.UNPAID;
|
|
const r10 = r8 ? SubscriptionStatusTypes.CANCELED : status === UNPAID && subscription.latestInvoice !== null && subscription.latestInvoice?.status === InvoiceStatusTypes.OPEN ? SubscriptionStatusTypes.UNPAID : subscription.status;
|
|
r4 = renewalInvoiceWithoutEntitlementsPreview?.taxInclusive ?? subscription.latestInvoice?.taxInclusive;
|
|
const r1 = r4 == null || r4;
|
|
const value22 = NUM_FREE_GUILD_BOOSTS_WITH_PREMIUM + (includePremiumGuilds ? getNumPremiumGuildSubscriptions(subscription.additionalPlans) : 0);
|
|
const intl = (IndexNativeModule).intl;
|
|
r4 = r0 ? r1 ? intl.format(t['cd+hqB'], {price: price}) : intl.format(t.NUkcpF,
|
|
{price: price}) : intl.string(t.zYx3Y6);
|
|
let r9 = r0 ? r1 ? intl.format(t.VsKcFB, {price: price}) : intl.format(t.hJ5xEX,
|
|
{price: price}) : intl.string(t['8rSipI']);
|
|
let format = intl.format;
|
|
let r11 = r0 ? r1 ? Reflect.apply(format, intl, [t['jRy6/J'], {price: price, num: value22}]) : Reflect.apply(format,
|
|
intl, [t.tTNE8M, {price: price, num: value22}]) : Reflect.apply(format, intl, [t['U+z/HJ'], {num: value22}]);
|
|
const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0;
|
|
if (PREMIUM_MONTH_TIER_0 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
r0 = r0 ? r1 ? intl.format(t['USi/nc'], {price: price}) : intl.format(t['FS//l2'],
|
|
{price: price}) : intl.string(t.JshLzq);
|
|
return r0;
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t['5mv+2i'], {price: price}]) : Reflect.apply(format, intl,
|
|
[t.nkAEfZ,
|
|
{price: price}]) : Reflect.apply(format, intl, [t.SsLIXS, {}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t.cmkbFB, {});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value38 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r11 = value38.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r11 = null;
|
|
}
|
|
return r11 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r11}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r4 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r4;
|
|
return r4;
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue3 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue3.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29054;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
return r4;
|
|
}
|
|
const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0;
|
|
if (PREMIUM_YEAR_TIER_0 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
r0 = r0 ? r1 ? intl.format(t['USi/nc'], {price: price}) : intl.format(t['FS//l2'],
|
|
{price: price}) : intl.string(t.JshLzq);
|
|
return r0;
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t['5mv+2i'], {price: price}]) : Reflect.apply(format, intl,
|
|
[t.nkAEfZ,
|
|
{price: price}]) : Reflect.apply(format, intl, [t.SsLIXS, {}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t.cmkbFB, {});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value38 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r11 = value38.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r11 = null;
|
|
}
|
|
return r11 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r11}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r4 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r4;
|
|
return r4;
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue3 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue3.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29054;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
return r4;
|
|
}
|
|
const PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1;
|
|
if (PREMIUM_MONTH_TIER_1 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
return r0 ? r1 ? intl.format(t.cXy8Bp, {price: price}) : intl.format(t['C/XsHt'],
|
|
{price: price}) : intl.string(t.K6tYFa);
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t.HBkIBi, {price: price}]) : Reflect.apply(format, intl,
|
|
[t.ZsO1Sx,
|
|
{price: price}]) : Reflect.apply(format, intl, [t['0+/WH7'], {}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t.McIzwj, {});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value36 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r17 = value36.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r17 = null;
|
|
}
|
|
return r17 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r17}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r9 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r9;
|
|
return r9;
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue2 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue2.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29055;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
return r9;
|
|
}
|
|
const PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1;
|
|
if (PREMIUM_YEAR_TIER_1 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
return r0 ? r1 ? intl.format(t.cXy8Bp, {price: price}) : intl.format(t['C/XsHt'],
|
|
{price: price}) : intl.string(t.K6tYFa);
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t.HBkIBi, {price: price}]) : Reflect.apply(format, intl,
|
|
[t.ZsO1Sx,
|
|
{price: price}]) : Reflect.apply(format, intl, [t['0+/WH7'], {}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t.McIzwj, {});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value36 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r17 = value36.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r17 = null;
|
|
}
|
|
return r17 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r17}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r9 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r9;
|
|
return r9;
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue2 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue2.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29055;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
return r9;
|
|
}
|
|
const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
if (PREMIUM_MONTH_TIER_2 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl,
|
|
[t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn,
|
|
{num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t['0HopYf'], {num: value22});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r18 = value34.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r18 = null;
|
|
}
|
|
return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11;
|
|
return r11;
|
|
}
|
|
if (SubscriptionStatusTypes.BILLING_RETRY === r10) {
|
|
format = intl.format;
|
|
property = t['IlJ/HV'];
|
|
object = {};
|
|
object.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS,
|
|
|
|
|
|
'days').toDate();
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29056;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (hasDiscountApplied) {
|
|
if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) {
|
|
format = intl.format;
|
|
z2oQtA = t.z2oQtA;
|
|
object = {};
|
|
object.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.regularPrice = value4;
|
|
object.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo);
|
|
r15 = Reflect.apply(format, intl, [z2oQtA, object]);
|
|
} else {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
if (r1) {
|
|
property = t['3ZiutU'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
} else {
|
|
property = t['G6+XOT'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
}
|
|
}
|
|
r13 = r15;
|
|
} else {
|
|
r13 = r11;
|
|
}
|
|
return r13;
|
|
}
|
|
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
if (PREMIUM_YEAR_TIER_2 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl,
|
|
[t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn,
|
|
{num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t['0HopYf'], {num: value22});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r18 = value34.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r18 = null;
|
|
}
|
|
return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11;
|
|
return r11;
|
|
}
|
|
if (SubscriptionStatusTypes.BILLING_RETRY === r10) {
|
|
format = intl.format;
|
|
property = t['IlJ/HV'];
|
|
object = {};
|
|
object.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS,
|
|
|
|
|
|
'days').toDate();
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29056;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (hasDiscountApplied) {
|
|
if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) {
|
|
format = intl.format;
|
|
z2oQtA = t.z2oQtA;
|
|
object = {};
|
|
object.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.regularPrice = value4;
|
|
object.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo);
|
|
r15 = Reflect.apply(format, intl, [z2oQtA, object]);
|
|
} else {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
if (r1) {
|
|
property = t['3ZiutU'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
} else {
|
|
property = t['G6+XOT'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
}
|
|
}
|
|
r13 = r15;
|
|
} else {
|
|
r13 = r11;
|
|
}
|
|
return r13;
|
|
}
|
|
const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2;
|
|
if (PREMIUM_3_MONTH_TIER_2 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl,
|
|
[t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn,
|
|
{num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t['0HopYf'], {num: value22});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r18 = value34.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r18 = null;
|
|
}
|
|
return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11;
|
|
return r11;
|
|
}
|
|
if (SubscriptionStatusTypes.BILLING_RETRY === r10) {
|
|
format = intl.format;
|
|
property = t['IlJ/HV'];
|
|
object = {};
|
|
object.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS,
|
|
|
|
|
|
'days').toDate();
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29056;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (hasDiscountApplied) {
|
|
if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) {
|
|
format = intl.format;
|
|
z2oQtA = t.z2oQtA;
|
|
object = {};
|
|
object.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.regularPrice = value4;
|
|
object.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo);
|
|
r15 = Reflect.apply(format, intl, [z2oQtA, object]);
|
|
} else {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
if (r1) {
|
|
property = t['3ZiutU'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
} else {
|
|
property = t['G6+XOT'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
}
|
|
}
|
|
r13 = r15;
|
|
} else {
|
|
r13 = r11;
|
|
}
|
|
return r13;
|
|
}
|
|
const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2;
|
|
if (PREMIUM_6_MONTH_TIER_2 === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl,
|
|
[t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn,
|
|
{num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t['0HopYf'], {num: value22});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r18 = value34.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r18 = null;
|
|
}
|
|
return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11;
|
|
return r11;
|
|
}
|
|
if (SubscriptionStatusTypes.BILLING_RETRY === r10) {
|
|
format = intl.format;
|
|
property = t['IlJ/HV'];
|
|
object = {};
|
|
object.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS,
|
|
|
|
|
|
'days').toDate();
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29056;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (hasDiscountApplied) {
|
|
if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) {
|
|
format = intl.format;
|
|
z2oQtA = t.z2oQtA;
|
|
object = {};
|
|
object.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.regularPrice = value4;
|
|
object.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo);
|
|
r15 = Reflect.apply(format, intl, [z2oQtA, object]);
|
|
} else {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
if (r1) {
|
|
property = t['3ZiutU'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
} else {
|
|
property = t['G6+XOT'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
}
|
|
}
|
|
r13 = r15;
|
|
} else {
|
|
r13 = r11;
|
|
}
|
|
return r13;
|
|
}
|
|
const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH;
|
|
if (PREMIUM_GROUP_MONTH === planId) {
|
|
if (SubscriptionStatusTypes.CANCELED === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t.xoFgRh, {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl,
|
|
[t.nXdbKo, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.EcSdRH, {num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.ACCOUNT_HOLD === r10) {
|
|
format = intl.format;
|
|
return r0 ? r1 ? Reflect.apply(format, intl, [t['5C/0QG'], {price: price,
|
|
num: value22}]) : Reflect.apply(format,
|
|
intl, [t.xfYkhu, {price: price, num: value22}]) : Reflect.apply(format, intl, [t.ivjxcn,
|
|
{num: value22}]);
|
|
}
|
|
if (SubscriptionStatusTypes.UNPAID === r10) {
|
|
return intl.format(t['0HopYf'], {num: value22});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSE_PENDING === r10) {
|
|
if (subscription.pauseEndsAt != null) {
|
|
value34 = (importDefault(3738) /* metro dependency 3738 */)(subscription.pauseEndsAt);
|
|
r18 = value34.diff(subscription.currentPeriodEnd, 'days');
|
|
} else {
|
|
r18 = null;
|
|
}
|
|
return r18 != null ? intl.format(t.WUfOD5, {pauseDate: subscription.currentPeriodEnd,
|
|
pauseDuration: r18}) : intl.format(t.VlWufv, {pauseDate: subscription.currentPeriodEnd});
|
|
}
|
|
if (SubscriptionStatusTypes.PAUSED === r10) {
|
|
r11 = !hasFractionalPremiumWithSub ? intl.format(t['6RTdZA'], {resumeDate: subscription.pauseEndsAt}) : r11;
|
|
return r11;
|
|
}
|
|
if (SubscriptionStatusTypes.BILLING_RETRY === r10) {
|
|
format = intl.format;
|
|
property = t['IlJ/HV'];
|
|
object = {};
|
|
object.endDate = (importDefault(3738) /* metro dependency 3738 */)(subscription.currentPeriodStart).add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS,
|
|
|
|
|
|
'days').toDate();
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (SubscriptionStatusTypes.PAST_DUE === r10) {
|
|
format = intl.format;
|
|
property = t['d+0vwo'];
|
|
object = {};
|
|
moduleValue = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29056;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
if (hasDiscountApplied) {
|
|
if (planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2) {
|
|
format = intl.format;
|
|
z2oQtA = t.z2oQtA;
|
|
object = {};
|
|
object.percent = activeDiscountInfo?.percentage ?? ANNUAL_DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.regularPrice = value4;
|
|
object.renewalDate = getExpectedRenewalDate(subscription, fractionalPremiumInfo);
|
|
r15 = Reflect.apply(format, intl, [z2oQtA, object]);
|
|
} else {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
if (r1) {
|
|
property = t['3ZiutU'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
} else {
|
|
property = t['G6+XOT'];
|
|
object = {};
|
|
r23 = activeDiscountInfo?.percentage ?? DISCOUNT_PERCENTAGE_FALLBACK;
|
|
object.percent = r23;
|
|
object.regularPrice = value4;
|
|
r23 = activeDiscountInfo?.duration ?? DISCOUNT_DURATION_FALLBACK;
|
|
object.numMonths = r23;
|
|
r15 = Reflect.apply(formatToPlainString, intl, [property, object]);
|
|
}
|
|
}
|
|
r13 = r15;
|
|
} else {
|
|
r13 = r11;
|
|
}
|
|
return r13;
|
|
}
|
|
const Error = global.Error;
|
|
const value = 'Invalid planId ' + planId;
|
|
const value32 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value32;
|
|
function getPlanDescriptionOnClick() { // fn#29054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:12757, owner: getPlanDescription.onClick, offset: 0x00fb805d, size: 38 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(OpenURL)('https://support.discord.com/hc/articles/23082866222871');
|
|
}
|
|
|
|
function getPlanDescriptionOnClick_29055() { // fn#29055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:13887, owner: getPlanDescription.onClick, offset: 0x00fb805d, size: 38 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(OpenURL)('https://support.discord.com/hc/articles/23082866222871');
|
|
}
|
|
|
|
function getPlanDescriptionOnClick_29056() { // fn#29056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:15283, owner: getPlanDescription.onClick, offset: 0x00fb805d, size: 38 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(OpenURL)('https://support.discord.com/hc/articles/23082866222871');
|
|
}
|
|
|
|
}
|
|
|
|
function getPremiumPlanOptions({skuId, isPremium, defaultPlanId}) { // fn#29057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:15952, offset: 0x00fb8083, size: 311 bytes, params: 2, frame: 16
|
|
var r2;
|
|
var items2;
|
|
var value;
|
|
var Error;
|
|
if (skuId != null) {
|
|
if (isPremium) {
|
|
value = undefined;
|
|
r2 = value === defaultPlanId || skuId !== SubscriptionPlanInfo[defaultPlanId].skuId ? value : defaultPlanId;
|
|
if (PremiumSubscriptionSKUs.TIER_0 === skuId) {
|
|
items2 = [SubscriptionPlans.PREMIUM_YEAR_TIER_0, SubscriptionPlans.PREMIUM_MONTH_TIER_0];
|
|
if (value !== r2) {
|
|
items2.splice(items2.indexOf(r2), 1);
|
|
items2.unshift(r2);
|
|
}
|
|
return items2;
|
|
}
|
|
if (PremiumSubscriptionSKUs.TIER_1 === skuId) {
|
|
items2 = [SubscriptionPlans.PREMIUM_MONTH_TIER_1];
|
|
if (value !== r2) {
|
|
items2.splice(items2.indexOf(r2), 1);
|
|
items2.unshift(r2);
|
|
}
|
|
return items2;
|
|
}
|
|
if (PremiumSubscriptionSKUs.TIER_2 === skuId) {
|
|
items2 = [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2];
|
|
if (value !== r2) {
|
|
items2.splice(items2.indexOf(r2), 1);
|
|
items2.unshift(r2);
|
|
}
|
|
return items2;
|
|
}
|
|
Error = global.Error;
|
|
value = 'Unexpected SKU: ' + skuId;
|
|
throw new Error();
|
|
}
|
|
}
|
|
return [];
|
|
}
|
|
|
|
function getSkuIdForPlan(a0) { // fn#29058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16406, offset: 0x00fb81ba, size: 111 bytes, params: 2, frame: 15
|
|
var error;
|
|
const property = SubscriptionPlanInfo[a0];
|
|
if (property == null) {
|
|
error = new global.Error('Unsupported plan');
|
|
(require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}});
|
|
throw error;
|
|
}
|
|
return property.skuId;
|
|
}
|
|
|
|
function getNumPremiumGuildSubscriptions(a0) { // fn#29059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16571, offset: 0x00fb8229, size: 120 bytes, params: 2, frame: 16
|
|
const subscriptionPlanStoreBinding = SubscriptionPlanStore;
|
|
const getPlanIdsForSkus = subscriptionPlanStoreBinding.getPlanIdsForSkus;
|
|
const GUILD = PremiumSubscriptionSKUs.GUILD;
|
|
(Module00044)(Reflect.apply(getPlanIdsForSkus, subscriptionPlanStoreBinding,
|
|
[[GUILD]]) != null, 'Missing guildSubscriptionPlanIds');
|
|
const value = a0.find(_fun29060);
|
|
return value != null ? value.quantity : 0;
|
|
function _fun29060({planId}) { // fn#29060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16719, offset: 0x00fb82a1, size: 28 bytes, params: 2, frame: 11
|
|
return env0_0.includes(planId);
|
|
}
|
|
|
|
}
|
|
|
|
function subscriptionHasPremiumGuildPlan({additionalPlans}) { // fn#29061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:16777, offset: 0x00fb82bd, size: 31 bytes, params: 2, frame: 11
|
|
return getNumPremiumGuildSubscriptions(additionalPlans) > 0;
|
|
}
|
|
|
|
function isPremiumBaseSubscriptionPlan(a0) { // fn#29062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:17161, offset: 0x00fb82dc, size: 22 bytes, params: 2, frame: 11
|
|
return env0_56.has(a0);
|
|
}
|
|
|
|
function getBillingGracePeriodDaysAndExpiresDate(a0) { // fn#29064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:17279, offset: 0x00fb8308, size: 663 bytes, params: 2, frame: 20
|
|
var grace_period_expires_date;
|
|
var r9;
|
|
var r7;
|
|
var metadata;
|
|
var value;
|
|
var object;
|
|
var defaultImport2;
|
|
var value6;
|
|
var defaultImport3;
|
|
var defaultImport4;
|
|
var value8;
|
|
var defaultImport5;
|
|
var value9;
|
|
var value11;
|
|
if (a0.isPurchasedViaApple) {
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
if ((metadata == null ? value : metadata.apple_grace_period_expires_date) != null) {
|
|
value11 = (importDefault(3738) /* metro dependency 3738 */)(a0.metadata.apple_grace_period_expires_date);
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value.duration(value11.diff(a0.currentPeriodStart));
|
|
object.days = value.days();
|
|
object.expiresDate = value11;
|
|
return object;
|
|
}
|
|
if (a0.isPurchasedViaGoogle) {
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
if ((metadata == null ? value : metadata.google_grace_period_expires_date) == null) {
|
|
if (a0.isPurchasedExternally) {
|
|
r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS;
|
|
object = {days: r7};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r7, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
if (grace_period_expires_date != null) {
|
|
object = {};
|
|
defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
value6 = defaultImport2(grace_period_expires_date);
|
|
object.days = value6.diff(a0.currentPeriodStart, 'days');
|
|
defaultImport3 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata.grace_period_expires_date;
|
|
object.expiresDate = defaultImport3(grace_period_expires_date);
|
|
return object;
|
|
}
|
|
r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS;
|
|
object = {days: r9};
|
|
value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r9, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
if ((metadata == null ? value : metadata.google_original_expires_date) != null) {
|
|
defaultImport4 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
value8 = defaultImport4(metadata.google_grace_period_expires_date);
|
|
defaultImport5 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
value9 = defaultImport5(metadata.google_original_expires_date);
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value.duration(value8.diff(value9));
|
|
object.days = value.days();
|
|
object.expiresDate = value8;
|
|
return object;
|
|
}
|
|
if (a0.isPurchasedExternally) {
|
|
r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS;
|
|
object = {days: r7};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r7, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
if (grace_period_expires_date != null) {
|
|
object = {};
|
|
defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
value6 = defaultImport2(grace_period_expires_date);
|
|
object.days = value6.diff(a0.currentPeriodStart, 'days');
|
|
defaultImport3 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata.grace_period_expires_date;
|
|
object.expiresDate = defaultImport3(grace_period_expires_date);
|
|
return object;
|
|
}
|
|
r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS;
|
|
object = {days: r9};
|
|
value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r9, 'days');
|
|
return object;
|
|
}
|
|
if (a0.isPurchasedExternally) {
|
|
r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS;
|
|
object = {days: r7};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r7, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
if (grace_period_expires_date != null) {
|
|
object = {};
|
|
defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
value6 = defaultImport2(grace_period_expires_date);
|
|
object.days = value6.diff(a0.currentPeriodStart, 'days');
|
|
defaultImport3 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata.grace_period_expires_date;
|
|
object.expiresDate = defaultImport3(grace_period_expires_date);
|
|
return object;
|
|
}
|
|
r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS;
|
|
object = {days: r9};
|
|
value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r9, 'days');
|
|
} else {
|
|
if (a0.isPurchasedViaGoogle) {
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
if ((metadata == null ? value : metadata.google_grace_period_expires_date) == null) {
|
|
if (a0.isPurchasedExternally) {
|
|
r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS;
|
|
object = {days: r7};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r7, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
if (grace_period_expires_date != null) {
|
|
object = {};
|
|
defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
value6 = defaultImport2(grace_period_expires_date);
|
|
object.days = value6.diff(a0.currentPeriodStart, 'days');
|
|
defaultImport3 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata.grace_period_expires_date;
|
|
object.expiresDate = defaultImport3(grace_period_expires_date);
|
|
return object;
|
|
}
|
|
r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS;
|
|
object = {days: r9};
|
|
value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r9, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
if ((metadata == null ? value : metadata.google_original_expires_date) != null) {
|
|
defaultImport4 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
value8 = defaultImport4(metadata.google_grace_period_expires_date);
|
|
defaultImport5 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
value9 = defaultImport5(metadata.google_original_expires_date);
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value.duration(value8.diff(value9));
|
|
object.days = value.days();
|
|
object.expiresDate = value8;
|
|
return object;
|
|
}
|
|
if (a0.isPurchasedExternally) {
|
|
r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS;
|
|
object = {days: r7};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r7, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
if (grace_period_expires_date != null) {
|
|
object = {};
|
|
defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
value6 = defaultImport2(grace_period_expires_date);
|
|
object.days = value6.diff(a0.currentPeriodStart, 'days');
|
|
defaultImport3 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata.grace_period_expires_date;
|
|
object.expiresDate = defaultImport3(grace_period_expires_date);
|
|
return object;
|
|
}
|
|
r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS;
|
|
object = {days: r9};
|
|
value = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r9, 'days');
|
|
return object;
|
|
}
|
|
if (a0.isPurchasedExternally) {
|
|
r7 = a0.isPurchasedViaApple ? DEFAULT_APPLE_GRACE_PERIOD_DAYS : DEFAULT_GOOGLE_GRACE_PERIOD_DAYS;
|
|
object = {days: r7};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
object.expiresDate = value.add(r7, 'days');
|
|
return object;
|
|
}
|
|
metadata = a0.metadata;
|
|
value = undefined;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
if (grace_period_expires_date != null) {
|
|
object = {};
|
|
defaultImport2 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata == null ? value : metadata.grace_period_expires_date;
|
|
value6 = defaultImport2(grace_period_expires_date);
|
|
object.days = value6.diff(a0.currentPeriodStart, 'days');
|
|
defaultImport3 = importDefault(3738) /* metro dependency 3738 */;
|
|
metadata = a0.metadata;
|
|
grace_period_expires_date = metadata.grace_period_expires_date;
|
|
object.expiresDate = defaultImport3(grace_period_expires_date);
|
|
return object;
|
|
}
|
|
r9 = a0.paymentSourceId == null ? DEFAULT_MAX_GRACE_PERIOD_DAYS : PAID_SUBSCRIPTION_MAX_GRACE_PERIOD_DAYS;
|
|
object = {days: r9};
|
|
object.expiresDate = (importDefault(3738) /* metro dependency 3738 */)(a0.currentPeriodStart).add(r9, 'days');
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function getExpectedRenewalDate(a0, a1) { // fn#29065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18402, offset: 0x00fb859f, size: 93 bytes, params: 3, frame: 14
|
|
var r0;
|
|
const Date = global.Date;
|
|
let date = new Date(a0.currentPeriodEnd);
|
|
let r2 = a1 == null || a0.isBoostOnly;
|
|
r2 = !r2 ? a0.hasAnyPremiumGroup : r2;
|
|
if (r2) {
|
|
r0 = date;
|
|
} else {
|
|
date = extendDateWithUnconsumedFractionalPremium(date, a1.unactivatedUnits);
|
|
r0 = date;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getBillingInformationString(a0, a1) { // fn#29066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18597, offset: 0x00fb85fc, size: 2520 bytes, params: 3, frame: 28
|
|
var r1;
|
|
var r13;
|
|
var r14;
|
|
var object;
|
|
var status;
|
|
var isPurchasedExternally;
|
|
var Date;
|
|
var subscriptionPeriodStart;
|
|
var date;
|
|
const intl = (IndexNativeModule).intl;
|
|
var format;
|
|
const t = (IndexNativeModule).t;
|
|
var Q18lRK;
|
|
const intl2 = (IndexNativeModule).intl;
|
|
var ZlWXgR;
|
|
var paymentGateway;
|
|
var getExternalSubscriptionMethodUrlBinding;
|
|
var property;
|
|
var EMTLOT;
|
|
var expiresDate;
|
|
var qEIzyi;
|
|
var U2hb3W;
|
|
const intl3 = (IndexNativeModule).intl;
|
|
const intl4 = (IndexNativeModule).intl;
|
|
let value = a1;
|
|
const value2 = a2;
|
|
const value3 = a3;
|
|
const value4 = a4;
|
|
const value5 = undefined;
|
|
const r0 = value2 !== value5 ? value2 : null;
|
|
const r6 = value3 !== value5 ? value3 : false;
|
|
if (value4 !== value5) {
|
|
r1 = value4;
|
|
} else {
|
|
object = {'isFractionalPremiumActive': false, 'fetched': true};
|
|
object.fractionalState = FractionalPremiumStates.NONE;
|
|
object.startsAt = (importDefault(3738) /* metro dependency 3738 */)(0);
|
|
object.endsAt = (importDefault(3738) /* metro dependency 3738 */)(0);
|
|
object.currentEntitlementId = '';
|
|
object.currentEntitlementEndsAt = (importDefault(3738) /* metro dependency 3738 */)(0);
|
|
object.unactivatedUnits = [];
|
|
r1 = object;
|
|
}
|
|
let r3 = r0 === null || a0.status !== SubscriptionStatusTypes.PAST_DUE ? value : r0;
|
|
const formatPrice = PriceUtilsModule.formatPrice;
|
|
const r11 = r6 ? Reflect.apply(formatPrice, PriceUtilsModule, [r3.invoiceItems.filter(function(a0) {
|
|
return PREMIUM_TIER_2_PLANS.has(a0.subscriptionPlanId);
|
|
}).map(_fun29068).reduce(_fun29069, 0), r3.currency]) : Reflect.apply(formatPrice, PriceUtilsModule, [r3.total,
|
|
r3.currency]);
|
|
const currentUser = UserStore.getCurrentUser();
|
|
if (currentUser == null) {
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.CANCELED) {
|
|
return intl.format(t['Whp/qk'], {endDate: value.subscriptionPeriodStart});
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.PAUSE_PENDING) {
|
|
return intl.format(t.uBLUGU, {pauseDate: a0.currentPeriodEnd, resumeDate: a0.pauseEndsAt});
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.PAUSED) {
|
|
if (r1.fractionalState !== FractionalPremiumStates.NONE) {
|
|
format = intl.format;
|
|
Q18lRK = t.Q18lRK;
|
|
object = {};
|
|
object.renewalDate = r1.endsAt.toDate();
|
|
object.price = r11;
|
|
r3 = Reflect.apply(format, intl, [Q18lRK, object]);
|
|
} else {
|
|
r3 = a0.pauseEndsAt == null ? r6 ? intl.format(t.KTYQCg, {planName: intl4.string(t.Ipxkog),
|
|
price: r11}) : intl.string(t.fMz6Lg) : r6 ? intl.format(t.zcgtzf, {planName: intl3.string(t.Ipxkog),
|
|
resumeDate: a0.pauseEndsAt, price: r11}) : intl.format(t['V8+l6k'], {resumeDate: a0.pauseEndsAt});
|
|
}
|
|
return r3;
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.PAST_DUE) {
|
|
expiresDate = getBillingGracePeriodDaysAndExpiresDate(a0).expiresDate;
|
|
r3 = a0.isPurchasedViaGoogle && (a0.metadata == null ? value5 : a0.metadata.google_grace_period_expires_date) != null;
|
|
if (r3) {
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.metadata.google_grace_period_expires_date);
|
|
r14 = value;
|
|
} else {
|
|
r14 = expiresDate;
|
|
}
|
|
r3 = a0.isPurchasedViaApple && (a0.metadata == null ? value5 : a0.metadata.apple_grace_period_expires_date) != null;
|
|
if (r3) {
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.metadata.apple_grace_period_expires_date);
|
|
r14 = value;
|
|
}
|
|
isPurchasedExternally = a0.isPurchasedExternally;
|
|
format = intl.format;
|
|
if (isPurchasedExternally) {
|
|
U2hb3W = t.U2hb3W;
|
|
object = {};
|
|
object.endDate = r14.toDate();
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway];
|
|
getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway,
|
|
'PAYMENT_SOURCE_MANAGEMENT');
|
|
r3 = Reflect.apply(format, intl, [U2hb3W, object]);
|
|
} else {
|
|
qEIzyi = t.qEIzyi;
|
|
object = {};
|
|
object.endDate = r14.toDate();
|
|
object.price = r11;
|
|
r3 = Reflect.apply(format, intl, [qEIzyi, object]);
|
|
}
|
|
return r3;
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.BILLING_RETRY) {
|
|
format = intl.format;
|
|
EMTLOT = t.EMTLOT;
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
object.price = r11;
|
|
return Reflect.apply(format, intl, [EMTLOT, object]);
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.ACCOUNT_HOLD) {
|
|
if (a0.isPurchasedViaGoogle) {
|
|
value = require(3815) /* metro dependency 3815: BillingPlatformUtils */;
|
|
if (value.isGooglePlayBillingSupported()) {
|
|
format = intl.format;
|
|
EMTLOT = t.EMTLOT;
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
object.price = r11;
|
|
value = Reflect.apply(format, intl, [EMTLOT, object]);
|
|
r3 = value;
|
|
} else {
|
|
format = intl.format;
|
|
property = t['dtcxw+'];
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway];
|
|
getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway,
|
|
'PAYMENT_SOURCE_MANAGEMENT');
|
|
value = Reflect.apply(format, intl, [property, object]);
|
|
r3 = value;
|
|
}
|
|
} else {
|
|
format = intl.format;
|
|
EMTLOT = t.EMTLOT;
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
object.price = r11;
|
|
value = Reflect.apply(format, intl, [EMTLOT, object]);
|
|
r3 = value;
|
|
}
|
|
return r3;
|
|
}
|
|
if (isSubscriptionPrepaidPaymentSource(a0)) {
|
|
return intl.format(t.awpB0C, {prepaidEndDate: a0.currentPeriodEnd});
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.UNPAID) {
|
|
return intl.format(t.CzTKom, {maxProcessingTimeInDays: MAX_PAYMENT_PROCESSING_TIME_DAYS});
|
|
}
|
|
isPurchasedExternally = a0.isPurchasedExternally;
|
|
if (isPurchasedExternally) {
|
|
format = intl.format;
|
|
ZlWXgR = t.ZlWXgR;
|
|
object = {};
|
|
object.renewalDate = value.subscriptionPeriodStart;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway];
|
|
getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.subscriptionManagementLink = getExternalSubscriptionMethodUrlBinding(paymentGateway,
|
|
'SUBSCRIPTION_MANAGEMENT');
|
|
return Reflect.apply(format, intl, [ZlWXgR, object]);
|
|
}
|
|
Date = global.Date;
|
|
subscriptionPeriodStart = value.subscriptionPeriodStart;
|
|
date = new Date();
|
|
r3 = a0.isBoostOnly || a0.hasAnyPremiumGroup;
|
|
if (r3) {
|
|
r13 = date;
|
|
} else {
|
|
date = extendDateWithUnconsumedFractionalPremium(date, r1.unactivatedUnits);
|
|
r13 = date;
|
|
}
|
|
} else {
|
|
if (currentUser.isOnReverseTrial()) {
|
|
return intl.format(t['7ZS2m1'],
|
|
{trialEnd: r1.currentEntitlementEndsAt != null ? r1.currentEntitlementEndsAt.toDate() : a0.currentPeriodEnd});
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.CANCELED) {
|
|
return intl.format(t['Whp/qk'], {endDate: value.subscriptionPeriodStart});
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.PAUSE_PENDING) {
|
|
return intl.format(t.uBLUGU, {pauseDate: a0.currentPeriodEnd, resumeDate: a0.pauseEndsAt});
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.PAUSED) {
|
|
if (r1.fractionalState !== FractionalPremiumStates.NONE) {
|
|
format = intl.format;
|
|
Q18lRK = t.Q18lRK;
|
|
object = {};
|
|
object.renewalDate = r1.endsAt.toDate();
|
|
object.price = r11;
|
|
r3 = Reflect.apply(format, intl, [Q18lRK, object]);
|
|
} else {
|
|
r3 = a0.pauseEndsAt == null ? r6 ? intl.format(t.KTYQCg, {planName: intl4.string(t.Ipxkog),
|
|
price: r11}) : intl.string(t.fMz6Lg) : r6 ? intl.format(t.zcgtzf, {planName: intl3.string(t.Ipxkog),
|
|
resumeDate: a0.pauseEndsAt, price: r11}) : intl.format(t['V8+l6k'], {resumeDate: a0.pauseEndsAt});
|
|
}
|
|
return r3;
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.PAST_DUE) {
|
|
expiresDate = getBillingGracePeriodDaysAndExpiresDate(a0).expiresDate;
|
|
r3 = a0.isPurchasedViaGoogle && (a0.metadata == null ? value5 : a0.metadata.google_grace_period_expires_date) != null;
|
|
if (r3) {
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.metadata.google_grace_period_expires_date);
|
|
r14 = value;
|
|
} else {
|
|
r14 = expiresDate;
|
|
}
|
|
r3 = a0.isPurchasedViaApple && (a0.metadata == null ? value5 : a0.metadata.apple_grace_period_expires_date) != null;
|
|
if (r3) {
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.metadata.apple_grace_period_expires_date);
|
|
r14 = value;
|
|
}
|
|
isPurchasedExternally = a0.isPurchasedExternally;
|
|
format = intl.format;
|
|
if (isPurchasedExternally) {
|
|
U2hb3W = t.U2hb3W;
|
|
object = {};
|
|
object.endDate = r14.toDate();
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway];
|
|
getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway,
|
|
'PAYMENT_SOURCE_MANAGEMENT');
|
|
r3 = Reflect.apply(format, intl, [U2hb3W, object]);
|
|
} else {
|
|
qEIzyi = t.qEIzyi;
|
|
object = {};
|
|
object.endDate = r14.toDate();
|
|
object.price = r11;
|
|
r3 = Reflect.apply(format, intl, [qEIzyi, object]);
|
|
}
|
|
return r3;
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.BILLING_RETRY) {
|
|
format = intl.format;
|
|
EMTLOT = t.EMTLOT;
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(PAID_SUBSCRIPTION_MAX_BILLING_RETRY_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
object.price = r11;
|
|
return Reflect.apply(format, intl, [EMTLOT, object]);
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.ACCOUNT_HOLD) {
|
|
if (a0.isPurchasedViaGoogle) {
|
|
value = require(3815) /* metro dependency 3815: BillingPlatformUtils */;
|
|
if (value.isGooglePlayBillingSupported()) {
|
|
format = intl.format;
|
|
EMTLOT = t.EMTLOT;
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
object.price = r11;
|
|
value = Reflect.apply(format, intl, [EMTLOT, object]);
|
|
r3 = value;
|
|
} else {
|
|
format = intl.format;
|
|
property = t['dtcxw+'];
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway];
|
|
getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentSourceLink = getExternalSubscriptionMethodUrlBinding(paymentGateway,
|
|
'PAYMENT_SOURCE_MANAGEMENT');
|
|
value = Reflect.apply(format, intl, [property, object]);
|
|
r3 = value;
|
|
}
|
|
} else {
|
|
format = intl.format;
|
|
EMTLOT = t.EMTLOT;
|
|
object = {};
|
|
value = importDefault(3738) /* metro dependency 3738 */;
|
|
value = value(a0.currentPeriodStart);
|
|
value = value.add(MAX_ACCOUNT_HOLD_DAYS, 'days');
|
|
object.endDate = value.toDate();
|
|
object.price = r11;
|
|
value = Reflect.apply(format, intl, [EMTLOT, object]);
|
|
r3 = value;
|
|
}
|
|
return r3;
|
|
}
|
|
if (isSubscriptionPrepaidPaymentSource(a0)) {
|
|
return intl.format(t.awpB0C, {prepaidEndDate: a0.currentPeriodEnd});
|
|
}
|
|
status = a0.status;
|
|
if (status === SubscriptionStatusTypes.UNPAID) {
|
|
return intl.format(t.CzTKom, {maxProcessingTimeInDays: MAX_PAYMENT_PROCESSING_TIME_DAYS});
|
|
}
|
|
if (a0.isPurchasedExternally) {
|
|
format = intl.format;
|
|
ZlWXgR = t.ZlWXgR;
|
|
object = {};
|
|
object.renewalDate = value.subscriptionPeriodStart;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.paymentGatewayName = PaymentGatewayToFriendlyName[paymentGateway];
|
|
getExternalSubscriptionMethodUrlBinding = getExternalSubscriptionMethodUrl;
|
|
paymentGateway = a0.paymentGateway;
|
|
object.subscriptionManagementLink = getExternalSubscriptionMethodUrlBinding(paymentGateway,
|
|
'SUBSCRIPTION_MANAGEMENT');
|
|
return Reflect.apply(format, intl, [ZlWXgR, object]);
|
|
}
|
|
Date = global.Date;
|
|
subscriptionPeriodStart = value.subscriptionPeriodStart;
|
|
date = new Date();
|
|
if (a0.isBoostOnly || a0.hasAnyPremiumGroup) {
|
|
r13 = date;
|
|
} else {
|
|
date = extendDateWithUnconsumedFractionalPremium(date, r1.unactivatedUnits);
|
|
r13 = date;
|
|
}
|
|
}
|
|
format = intl.format;
|
|
return r6 ? Reflect.apply(format, intl, [t.Vl3cED, {planName: intl2.string(t.Ipxkog), renewalDate: r13,
|
|
price: r11}]) : Reflect.apply(format, intl, [t.Q18lRK, {renewalDate: r13, price: r11}]);
|
|
}
|
|
|
|
function extendDateWithUnconsumedFractionalPremium(a0, a1, a2, a3) { // fn#29070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22164, offset: 0x00fb9007, size: 171 bytes, params: 5, frame: 21
|
|
var r4;
|
|
var r1;
|
|
let value = a0;
|
|
const value3 = undefined;
|
|
value = (importDefault(3738) /* metro dependency 3738 */)(a3 ? value3 : value);
|
|
if (a1.length > 0) {
|
|
value = value.add(getUnactivatedFractionalPremiumHours(a1), 'hours');
|
|
r4 = value;
|
|
} else {
|
|
r4 = value;
|
|
}
|
|
if (a3) {
|
|
r1 = r4;
|
|
} else if (value3 === a2) {
|
|
r1 = r4;
|
|
} else {
|
|
value = (importDefault(3738) /* metro dependency 3738 */)();
|
|
value = a2.diff(value, 'hours', true);
|
|
if (value > 0) {
|
|
value = r4.add(value, 'hours');
|
|
r1 = value;
|
|
} else {
|
|
r1 = r4;
|
|
}
|
|
}
|
|
return r1.toDate();
|
|
}
|
|
|
|
function getUnactivatedFractionalPremiumDurationString(a0) { // fn#29071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22428, offset: 0x00fb90b2, size: 245 bytes, params: 2, frame: 22
|
|
var object;
|
|
const t = (IndexNativeModule).t;
|
|
var moduleValue;
|
|
var roundFPCountdownUnits;
|
|
var moduleValue2;
|
|
const unactivatedFractionalPremiumHours = getUnactivatedFractionalPremiumHours(a0.unactivatedUnits);
|
|
if (unactivatedFractionalPremiumHours > 0) {
|
|
if (a0.fractionalState === FractionalPremiumStates.NONE) {
|
|
object = {};
|
|
object.days = t.fYmirx;
|
|
object.hours = t['C3RO+g'];
|
|
object.minutes = t.r77oHc;
|
|
moduleValue = require(12192) /* metro dependency 12192: useFPDurationLeft */;
|
|
roundFPCountdownUnits = moduleValue.roundFPCountdownUnits;
|
|
moduleValue2 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
return (require(3826) /* metro dependency 3826: DateUtils */).unitsAsStrings(Reflect.apply(roundFPCountdownUnits,
|
|
|
|
|
|
moduleValue, [moduleValue2.diffAsUnits(0,
|
|
unactivatedFractionalPremiumHours * (importDefault(672) /* metro dependency 672: Durations */).Millis.HOUR)]),
|
|
|
|
|
|
object);
|
|
}
|
|
}
|
|
return '';
|
|
}
|
|
|
|
function isSwitchingPlansDisabled(a0) { // fn#29072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22797, offset: 0x00fb91a7, size: 55 bytes, params: 2, frame: 4
|
|
let r0 = a0.renewalMutations != null || a0.trialEndsAt != null;
|
|
r0 = !r0 ? a0.status === SubscriptionStatusTypes.PAST_DUE : r0;
|
|
return r0;
|
|
}
|
|
|
|
function getSwitchingPlansDisabledMessage(a0) { // fn#29073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:22910, offset: 0x00fb91de, size: 248 bytes, params: 2, frame: 18
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const renewalMutations = a0.renewalMutations;
|
|
const value = null;
|
|
let r0 = value != renewalMutations ? a0.renewalMutations.planId !== a0.planId ? intl.string(t['0rzJ4J']) : intl.string(t['9dLQ0/']) : value;
|
|
r0 = value != a0.trialEndsAt ? intl.string(t.a9Mdb3) : r0;
|
|
return r0;
|
|
}
|
|
|
|
function isSubscriptionPrepaidPaymentSource(a0) { // fn#29074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23199, offset: 0x00fb92d6, size: 40 bytes, params: 2, frame: 12
|
|
return a0.paymentSourceId != null && isPrepaidPaymentSource(a0.paymentSourceId);
|
|
}
|
|
|
|
function isPrepaidPaymentSource(a0) { // fn#29075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23320, offset: 0x00fb92fe, size: 61 bytes, params: 2, frame: 13
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
const paymentSource = PaymentSourceStore.getPaymentSource(a0);
|
|
return paymentSource != null && PREPAID_PAYMENT_SOURCES.has(paymentSource.type);
|
|
}
|
|
|
|
function isPremiumGuildSubscriptionCanceled(a0) { // fn#29077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23677, offset: 0x00fb9391, size: 63 bytes, params: 2, frame: 12
|
|
return a0.isPurchasedExternally ? a0.status === SubscriptionStatusTypes.CANCELED : getCoercedPremiumGuildSubscriptionStatus(a0) === SubscriptionStatusTypes.CANCELED;
|
|
}
|
|
|
|
function getFormattedPriceForPlan(a0, a1, a2) { // fn#29078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:23834, offset: 0x00fb93d0, size: 221 bytes, params: 4, frame: 20
|
|
var r4;
|
|
var r2;
|
|
var getDefaultPriceBinding;
|
|
var id;
|
|
var getPriceBinding;
|
|
var priceBinding;
|
|
var error;
|
|
let value = a3;
|
|
if (value !== undefined) {
|
|
r4 = value;
|
|
} else {
|
|
value = false;
|
|
r4 = value;
|
|
}
|
|
if (a1 != null) {
|
|
try {
|
|
value = environment;
|
|
getPriceBinding = getPrice;
|
|
id = a0.id;
|
|
priceBinding = getPriceBinding(id, false, r4, a1);
|
|
r2 = priceBinding;
|
|
} catch (error) {
|
|
getDefaultPriceBinding = getDefaultPrice;
|
|
id = a0.id;
|
|
value = getDefaultPriceBinding(id, false, r4);
|
|
r2 = value;
|
|
}
|
|
} else {
|
|
r2 = getDefaultPrice(a0.id, false, r4);
|
|
}
|
|
const formatPrice = PriceUtilsModule.formatPrice;
|
|
const amount = r2.amount;
|
|
let currency = r2.currency;
|
|
const value3 = Reflect.apply(formatPrice, PriceUtilsModule, [amount, currency]);
|
|
currency = a0.currency;
|
|
const USD = CurrencyCodes.USD;
|
|
return currency !== USD && a2 === true ? value3.concat('*') : value3;
|
|
}
|
|
|
|
function getPlanIdFromInvoice(a0, a1) { // fn#29079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24101, offset: 0x00fb94ad, size: 195 bytes, params: 3, frame: 18
|
|
const planId = a0.planId;
|
|
let status = a0.status;
|
|
const CANCELED = SubscriptionStatusTypes.CANCELED;
|
|
if (status === CANCELED) {
|
|
return planId;
|
|
}
|
|
status = a0.status;
|
|
const PAUSE_PENDING = SubscriptionStatusTypes.PAUSE_PENDING;
|
|
if (status === PAUSE_PENDING) {
|
|
return planId;
|
|
}
|
|
(Module00044)(a1 != null, 'Expected invoicePreview');
|
|
const value2 = a1.invoiceItems.find(function({subscriptionPlanId}) {
|
|
return isPremiumBaseSubscriptionPlan(subscriptionPlanId);
|
|
});
|
|
return value2 == null || isNoneSubscription(value2.subscriptionPlanId) ? a0.planId : a0.renewalMutations == null ? value2.subscriptionPlanId : a0.renewalMutations.planId !== a0.planId ? a0.planId : value2.subscriptionPlanId;
|
|
}
|
|
|
|
function getStatusFromInvoice(a0, a1) { // fn#29081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24481, offset: 0x00fb9589, size: 161 bytes, params: 3, frame: 17
|
|
const status = a0.status;
|
|
const status2 = a0.status;
|
|
const CANCELED = SubscriptionStatusTypes.CANCELED;
|
|
if (status2 === CANCELED) {
|
|
return status;
|
|
}
|
|
const status3 = a0.status;
|
|
const PAUSE_PENDING = SubscriptionStatusTypes.PAUSE_PENDING;
|
|
if (status3 === PAUSE_PENDING) {
|
|
return status;
|
|
}
|
|
(Module00044)(a1 != null, 'Expected invoicePreview');
|
|
const value2 = a1.invoiceItems.find(function({subscriptionPlanId}) {
|
|
return isPremiumBaseSubscriptionPlan(subscriptionPlanId);
|
|
});
|
|
return value2 == null || isNoneSubscription(value2.subscriptionPlanId) ? SubscriptionStatusTypes.CANCELED : status;
|
|
}
|
|
|
|
function isBaseSubscriptionCanceled(a0) { // fn#29083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24784, offset: 0x00fb962a, size: 77 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r0;
|
|
const status = a0.status;
|
|
const renewalMutations = a0.renewalMutations;
|
|
const CANCELED = SubscriptionStatusTypes.CANCELED;
|
|
const value2 = status === CANCELED;
|
|
if (value2) {
|
|
r0 = value2;
|
|
} else {
|
|
r1 = renewalMutations != null && isNoneSubscription(renewalMutations.planId);
|
|
r1 = r1 && !a0.isPurchasedExternally;
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isSubscriptionStatusFailedPayment(a0) { // fn#29084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:24929, offset: 0x00fb9677, size: 56 bytes, params: 2, frame: 4
|
|
const PAST_DUE = SubscriptionStatusTypes.PAST_DUE;
|
|
let r0 = a0 === PAST_DUE || a0 === SubscriptionStatusTypes.ACCOUNT_HOLD;
|
|
r0 = !r0 ? a0 === SubscriptionStatusTypes.BILLING_RETRY : r0;
|
|
return r0;
|
|
}
|
|
|
|
function getFormattedPlanPriceFromInvoice(a0, a1, a2) { // fn#29085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:25038, offset: 0x00fb96af, size: 175 bytes, params: 4, frame: 20
|
|
let value = a0.findInvoiceItemByPlanId(a2.id);
|
|
const amount = value == null ? getPrice(a2.id, false, false, {paymentSourceId: a1.paymentSourceId,
|
|
currency: a1.currency}).amount : value.amount;
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
const formatRate = value.formatRate;
|
|
const priceUtilsModule = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
return Reflect.apply(formatRate, value, [priceUtilsModule.formatPrice(amount, a0.currency), a2.interval,
|
|
a2.intervalCount]);
|
|
}
|
|
|
|
function getPremiumGuildIntervalPrice(a0, a1, a2, a3) { // fn#29086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:25320, offset: 0x00fb975e, size: 355 bytes, params: 5, frame: 20
|
|
var error;
|
|
const r7 = a1 != null ? {paymentSourceId: a1, currency: a2} : {country: BillingInfoStore.ipCountryCodeWithFallback,
|
|
currency: a2};
|
|
const value2 = SubscriptionPlanStore.get(a0);
|
|
if (value2 == null) {
|
|
error = new global.Error('Unsupported plan');
|
|
(require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}});
|
|
throw error;
|
|
}
|
|
subscriptionPlanStoreBinding = SubscriptionPlanStore;
|
|
const getForSkuAndInterval = subscriptionPlanStoreBinding.getForSkuAndInterval;
|
|
const GUILD = PremiumSubscriptionSKUs.GUILD;
|
|
const value3 = Reflect.apply(getForSkuAndInterval, subscriptionPlanStoreBinding, [GUILD, value2.interval,
|
|
value2.intervalCount]);
|
|
if (value3 == null) {
|
|
error = new global.Error('Unsupported plan');
|
|
(require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: a0}});
|
|
throw error;
|
|
}
|
|
const getPriceBinding = getPrice;
|
|
const id = value3.id;
|
|
let value = PremiumTypeUtilsModule;
|
|
value = value.isPremium(a3);
|
|
return getPriceBinding(id, value, false, r7);
|
|
}
|
|
|
|
function getBillingReviewSubheader(a0, a1, a2) { // fn#29087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:25809, offset: 0x00fb98c1, size: 1555 bytes, params: 4, frame: 19
|
|
var error;
|
|
var object;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var formatToPlainString;
|
|
var LwdrNi;
|
|
const id = a1.id;
|
|
if (a0 == null) {
|
|
if (SubscriptionPlans.PREMIUM_MONTH_TIER_0 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['/G3aKw']]);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_YEAR_TIER_0 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['2eQpsL']]);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_MONTH_TIER_1 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.gueLg5]);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_YEAR_TIER_1 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['MhH/vW']]);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_MONTH_TIER_2 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.LQVQIq]);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_GROUP_MONTH === id) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
LwdrNi = (importDefault(2806) /* metro dependency 2806: PremiumGroupMessages */).LwdrNi;
|
|
object = {};
|
|
object.premiumGroupProductName = getPremiumGroupProductName();
|
|
return Reflect.apply(formatToPlainString, intl, [LwdrNi, object]);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_YEAR_TIER_2 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['0nfg1x']]);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_3_MONTH_TIER_2 === id) {
|
|
return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount});
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_6_MONTH_TIER_2 === id) {
|
|
return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount});
|
|
}
|
|
if (SubscriptionPlans.NONE_MONTH === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
if (SubscriptionPlans.NONE_YEAR === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
if (SubscriptionPlans.NONE_3_MONTH === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
if (SubscriptionPlans.NONE_6_MONTH === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_MONTH_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_YEAR_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_3_MONTH_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
if (SubscriptionPlans.PREMIUM_6_MONTH_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
error = new global.Error('User is purchasing an unsupported plan');
|
|
(require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: id}});
|
|
throw error;
|
|
}
|
|
let PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0;
|
|
if (PREMIUM_MONTH_TIER_0 === id) {
|
|
return intl.string(t['0ggVqN']);
|
|
}
|
|
let PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0;
|
|
if (PREMIUM_YEAR_TIER_0 === id) {
|
|
return intl.string(t['jm+ZQw']);
|
|
}
|
|
let PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1;
|
|
if (PREMIUM_MONTH_TIER_1 === id) {
|
|
return intl.string(t.uph4Jx);
|
|
}
|
|
let PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1;
|
|
if (PREMIUM_YEAR_TIER_1 === id) {
|
|
return intl.string(t['D/l7Yt']);
|
|
}
|
|
let PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
if (PREMIUM_MONTH_TIER_2 === id) {
|
|
return intl.string(t['5l1MuV']);
|
|
}
|
|
let PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH;
|
|
if (PREMIUM_GROUP_MONTH === id) {
|
|
return intl.string(t['5l1MuV']);
|
|
}
|
|
let PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
if (PREMIUM_YEAR_TIER_2 === id) {
|
|
return intl.string(t.G0mISV);
|
|
}
|
|
PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0;
|
|
if (PREMIUM_MONTH_TIER_0 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['/G3aKw']]);
|
|
}
|
|
PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0;
|
|
if (PREMIUM_YEAR_TIER_0 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['2eQpsL']]);
|
|
}
|
|
PREMIUM_MONTH_TIER_1 = SubscriptionPlans.PREMIUM_MONTH_TIER_1;
|
|
if (PREMIUM_MONTH_TIER_1 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.gueLg5]);
|
|
}
|
|
PREMIUM_YEAR_TIER_1 = SubscriptionPlans.PREMIUM_YEAR_TIER_1;
|
|
if (PREMIUM_YEAR_TIER_1 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['MhH/vW']]);
|
|
}
|
|
PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
if (PREMIUM_MONTH_TIER_2 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t.LQVQIq]);
|
|
}
|
|
PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH;
|
|
if (PREMIUM_GROUP_MONTH === id) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
LwdrNi = (importDefault(2806) /* metro dependency 2806: PremiumGroupMessages */).LwdrNi;
|
|
object = {};
|
|
object.premiumGroupProductName = getPremiumGroupProductName();
|
|
return Reflect.apply(formatToPlainString, intl, [LwdrNi, object]);
|
|
}
|
|
PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
if (PREMIUM_YEAR_TIER_2 === id) {
|
|
string = intl.string;
|
|
return a2 ? Reflect.apply(string, intl, [t.cRCCJ3]) : Reflect.apply(string, intl, [t['0nfg1x']]);
|
|
}
|
|
const PREMIUM_3_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_3_MONTH_TIER_2;
|
|
if (PREMIUM_3_MONTH_TIER_2 === id) {
|
|
return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount});
|
|
}
|
|
const PREMIUM_6_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_6_MONTH_TIER_2;
|
|
if (PREMIUM_6_MONTH_TIER_2 === id) {
|
|
return intl.formatToPlainString(t.BCD4fT, {intervalCount: a1.intervalCount});
|
|
}
|
|
const NONE_MONTH = SubscriptionPlans.NONE_MONTH;
|
|
if (NONE_MONTH === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const NONE_YEAR = SubscriptionPlans.NONE_YEAR;
|
|
if (NONE_YEAR === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const NONE_3_MONTH = SubscriptionPlans.NONE_3_MONTH;
|
|
if (NONE_3_MONTH === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const NONE_6_MONTH = SubscriptionPlans.NONE_6_MONTH;
|
|
if (NONE_6_MONTH === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const PREMIUM_MONTH_GUILD = SubscriptionPlans.PREMIUM_MONTH_GUILD;
|
|
if (PREMIUM_MONTH_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const PREMIUM_YEAR_GUILD = SubscriptionPlans.PREMIUM_YEAR_GUILD;
|
|
if (PREMIUM_YEAR_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const PREMIUM_3_MONTH_GUILD = SubscriptionPlans.PREMIUM_3_MONTH_GUILD;
|
|
if (PREMIUM_3_MONTH_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const PREMIUM_6_MONTH_GUILD = SubscriptionPlans.PREMIUM_6_MONTH_GUILD;
|
|
if (PREMIUM_6_MONTH_GUILD === id) {
|
|
return intl.string(t.eUEeCt);
|
|
}
|
|
const Error = global.Error;
|
|
error = new Error('User is purchasing an unsupported plan');
|
|
(require(3817) /* metro dependency 3817: BillingUtils */).captureBillingException(error, {tags: {planId: id}});
|
|
throw error;
|
|
}
|
|
|
|
function getIntervalForInvoice({invoiceItems}) { // fn#29088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:27752, offset: 0x00fb9ed4, size: 104 bytes, params: 2, frame: 14
|
|
const value2 = SubscriptionPlanStore.get(invoiceItems[0].subscriptionPlanId);
|
|
(Module00044)(value2 != null, 'Missing subscriptionPlan');
|
|
return {intervalType: value2.interval, intervalCount: value2.intervalCount};
|
|
}
|
|
|
|
function getDefaultCurrency() { // fn#29089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:27948, offset: 0x00fb9f3c, size: 55 bytes, params: 1, frame: 17
|
|
var r0;
|
|
var getDefaultPriceBinding;
|
|
var PREMIUM_MONTH_TIER_2;
|
|
var currency;
|
|
var error;
|
|
let value = environment;
|
|
const USD = CurrencyCodes.USD;
|
|
try {
|
|
getDefaultPriceBinding = getDefaultPrice;
|
|
PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
value = getDefaultPriceBinding(PREMIUM_MONTH_TIER_2, false, false, undefined, false);
|
|
currency = value.currency;
|
|
r0 = currency;
|
|
} catch (error) {
|
|
r0 = USD;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function formatTrialCtaIntervalDuration({intervalType, intervalCount}) { // fn#29090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:28080, offset: 0x00fb9f73, size: 488 bytes, params: 2, frame: 20
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const r3 = intervalType !== undefined ? intervalType : SubscriptionIntervalTypes.MONTH;
|
|
intervalCount = intervalCount === undefined ? 1 : intervalCount;
|
|
const value3 = (PriceUtilsModule).formatPrice(0, getDefaultCurrency(),
|
|
{'maximumFractionDigits': 0, 'minimumFractionDigits': 0});
|
|
const DAY = SubscriptionIntervalTypes.DAY;
|
|
if (DAY === r3) {
|
|
return intervalCount >= 7 && intervalCount % 7 === 0 ? intl.formatToPlainString(t.C6i5Jt,
|
|
{weeks: intervalCount / 7, price: value3}) : intl.formatToPlainString(t.cR9ifw, {days: intervalCount, price: value3});
|
|
}
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (MONTH === r3) {
|
|
return intl.formatToPlainString(t['8FZfNo'], {months: intervalCount, price: value3});
|
|
}
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (YEAR === r3) {
|
|
return intl.formatToPlainString(t.xzAcST, {years: intervalCount, price: value3});
|
|
}
|
|
const Error = global.Error;
|
|
throw new Error('Unsupported interval duration.');
|
|
}
|
|
|
|
function getExternalSubscriptionMethodUrl(a0, a1) { // fn#29091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:28706, offset: 0x00fba15b, size: 137 bytes, params: 3, frame: 14
|
|
const APPLE_PARTNER = PaymentGateways.APPLE_PARTNER;
|
|
if (APPLE_PARTNER === a0) {
|
|
return env0_51[a1];
|
|
}
|
|
const APPLE_ADVANCED_COMMERCE = PaymentGateways.APPLE_ADVANCED_COMMERCE;
|
|
if (APPLE_ADVANCED_COMMERCE === a0) {
|
|
return env0_51[a1];
|
|
}
|
|
const APPLE = PaymentGateways.APPLE;
|
|
if (APPLE === a0) {
|
|
return env0_51[a1];
|
|
}
|
|
const GOOGLE = PaymentGateways.GOOGLE;
|
|
if (GOOGLE === a0) {
|
|
return env0_52[a1];
|
|
}
|
|
const Error = global.Error;
|
|
const value = 'Invalid external payment gateway ' + a0;
|
|
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value2;
|
|
}
|
|
|
|
function getItemsFromNewAdditionalPlans(a0, a1) { // fn#29092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:28925, offset: 0x00fba1e4, size: 127 bytes, params: 3, frame: 17
|
|
const env0_0 = a0;
|
|
const items2 = [];
|
|
const renewalMutations = a0.renewalMutations;
|
|
const value = renewalMutations == null;
|
|
let items = value ? undefined : renewalMutations.items;
|
|
items = items ?? a0.items;
|
|
const value3 = items.find(function(a0) {
|
|
return PREMIUM_PLANS.has(a0.planId);
|
|
});
|
|
if (value3 != null) {
|
|
items2.push(value3);
|
|
}
|
|
const push = items2.push;
|
|
const items3 = [];
|
|
arraySpread(items3, a1, 0, value);
|
|
apply(push, items3, items2, value);
|
|
return items2.map(_fun29094);
|
|
function _fun29093({planId}) { // fn#29093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29057, offset: 0x00fb5c1b, size: 28 bytes, params: 2, frame: 11
|
|
return PREMIUM_PLANS.has(planId);
|
|
}
|
|
|
|
function _fun29094(a0) { // fn#29094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29124, offset: 0x00fba263, size: 109 bytes, params: 2, frame: 16
|
|
var value3;
|
|
var planId;
|
|
var planId2;
|
|
var value4;
|
|
let value = environment.__proto__;
|
|
value = _createForOfIteratorHelperLoose_29031(env0_0.items);
|
|
const value2 = value();
|
|
let done = value2.done;
|
|
if (done) {
|
|
return a0;
|
|
}
|
|
let r3 = value2;
|
|
loopExit1: while (true) {
|
|
value3 = r3.value;
|
|
planId = a0.planId;
|
|
planId2 = value3.planId;
|
|
if (planId === planId2) {
|
|
break loopExit1;
|
|
}
|
|
value4 = value();
|
|
done = value4.done;
|
|
if (done) {
|
|
return a0;
|
|
}
|
|
r3 = value4;
|
|
continue;
|
|
}
|
|
const object = {};
|
|
copyDataProperties(object, value3, planId);
|
|
copyDataProperties(object, a0, planId);
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function getItemsWithoutPremiumPlanItem(a0) { // fn#29095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29264, offset: 0x00fba2d0, size: 22 bytes, params: 2, frame: 11
|
|
return a0.filter(function(a0) {
|
|
return !PREMIUM_PLANS.has(a0.planId);
|
|
});
|
|
function _fun29096({planId}) { // fn#29096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29324, offset: 0x00fba2e6, size: 31 bytes, params: 2, frame: 11
|
|
return !PREMIUM_PLANS.has(planId);
|
|
}
|
|
|
|
}
|
|
|
|
function getItemsWithUpsertedPlanIdForGroup(a0, a1, a2, a3) { // fn#29097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29346, offset: 0x00fba305, size: 263 bytes, params: 5, frame: 17
|
|
var items;
|
|
var value;
|
|
var object;
|
|
var renewalMutations;
|
|
var value2;
|
|
const env0_0 = a1;
|
|
const env0_1 = a2;
|
|
const env0_2 = a3;
|
|
if (a3.has(a1)) {
|
|
var env0_3 = false;
|
|
renewalMutations = a0.renewalMutations;
|
|
value = undefined;
|
|
items = renewalMutations == null ? value : renewalMutations.items;
|
|
items = items ?? a0.items;
|
|
value = items.map(function(a0) {
|
|
var r0;
|
|
var object;
|
|
var value = a0;
|
|
if (importAll.has(value.planId)) {
|
|
env0_3 = true;
|
|
object = {};
|
|
copyDataProperties(object, value, importAll);
|
|
object['quantity'] = importDefault;
|
|
object['planId'] = require;
|
|
r0 = object;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
});
|
|
if (!env0_3) {
|
|
object = {planId: a1, quantity: a2};
|
|
value2 = a0.items.find(_fun29099);
|
|
if (value2 != null) {
|
|
object.id = value2.id;
|
|
}
|
|
value.push(object);
|
|
}
|
|
return value.filter(_fun29100);
|
|
}
|
|
const CheckoutError = (CheckoutErrorModule).CheckoutError;
|
|
throw new CheckoutError({message: 'Expected planId in group', extraSentryInformation: {newPlanId: a1,
|
|
planGroup: a3}});
|
|
function _fun29099({planId}) { // fn#29099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29732, offset: 0x00fba45d, size: 22 bytes, params: 2, frame: 2
|
|
return planId === require;
|
|
}
|
|
|
|
}
|
|
|
|
function getGuildBoostPlanItem(a0) { // fn#29101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29818, offset: 0x00fba484, size: 38 bytes, params: 2, frame: 12
|
|
const value = null;
|
|
return value == a0 ? value : a0.items.find(function(a0) {
|
|
return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(a0.planId);
|
|
});
|
|
function _fun29102({planId}) { // fn#29102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29886, offset: 0x00fba4aa, size: 28 bytes, params: 2, frame: 11
|
|
return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(planId);
|
|
}
|
|
|
|
}
|
|
|
|
function isBoostOnlySubscription(a0) { // fn#29103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29907, offset: 0x00fba4c6, size: 53 bytes, params: 2, frame: 13
|
|
return a0 != null && getPremiumPlanItem(a0) == null && getGuildBoostPlanItem(a0) != null;
|
|
}
|
|
|
|
function getPremiumSkuIdForSubscription(a0) { // fn#29104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30019, offset: 0x00fba4fb, size: 59 bytes, params: 2, frame: 13
|
|
const value = null;
|
|
const r1 = value != a0 ? getPremiumPlanItem(a0) : value;
|
|
return value != r1 ? getSkuIdForPlan(r1.planId) : value;
|
|
}
|
|
|
|
function canUseQuestOrbMultiplier(a0) { // fn#29107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30354, offset: 0x00fba5a7, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const QUEST_ORB_MULTIPLIER = (ProductCatalogModule).QUEST_ORB_MULTIPLIER;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [QUEST_ORB_MULTIPLIER, a0]);
|
|
}
|
|
|
|
function canUseCollectibles(a0) { // fn#29108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30453, offset: 0x00fba5e0, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const COLLECTIBLES = (ProductCatalogModule).COLLECTIBLES;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [COLLECTIBLES, a0]);
|
|
}
|
|
|
|
function formatPriceString({amount, currency}, a1) { // fn#29109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30538, offset: 0x00fba619, size: 94 bytes, params: 3, frame: 16
|
|
return '' + (PriceUtilsModule).formatPrice(amount,
|
|
currency) + '/' + getIntervalStringAsNoun(a1);
|
|
}
|
|
|
|
function formatInterval(a0) { // fn#29113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:30823, offset: 0x00fba6a3, size: 207 bytes, params: 2, frame: 15
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (a0 === YEAR) {
|
|
return intl.string(t.tfqrhj);
|
|
}
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (a0 === MONTH) {
|
|
return intl.string(t.FPybU7);
|
|
}
|
|
const Error = global.Error;
|
|
const value = 'Invalid interval type: ' + a0;
|
|
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value2;
|
|
}
|
|
|
|
function getFractionalPremiumUnitsHours(a0) { // fn#29115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31095, offset: 0x00fba795, size: 36 bytes, params: 2, frame: 12
|
|
return getFractionalPremiumUnitsHoursFromSkuIds(a0.map(function(a0) {
|
|
return a0.skuId;
|
|
}));
|
|
}
|
|
|
|
function getFractionalPremiumUnitsHoursFromSkuIds(a0) { // fn#29117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31207, offset: 0x00fba7c3, size: 26 bytes, params: 2, frame: 13
|
|
return a0.reduce(_fun29118, 0);
|
|
function _fun29118(a0, a1) { // fn#29118, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31277, offset: 0x00fba7dd, size: 92 bytes, params: 3, frame: 15
|
|
const value = environment.__proto__;
|
|
const value2 = env1_3(FRACTIONAL_PREMIUM_SKU_INTERVAL_COUNTS[a1], 2);
|
|
const property = value2[0];
|
|
const value3 = 1;
|
|
const property2 = value2[value3];
|
|
const HOUR = FractionalPremiumIntervalTypes.HOUR;
|
|
return a0 + (HOUR === property || FractionalPremiumIntervalTypes.DAY !== property ? value3 : 24) * property2;
|
|
}
|
|
|
|
}
|
|
|
|
function getMonthlyPrice({subscriptionPlan, isGift, priceOptions = {}}) { // fn#29119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31385, offset: 0x00fba839, size: 83 bytes, params: 2, frame: 18
|
|
isGift = !(isGift === undefined) && isGift;
|
|
const property = PREMIUM_SKU_TO_MONTHLY_PLAN[subscriptionPlan.skuId];
|
|
return property == null ? null : getPrice(property, false, isGift, priceOptions);
|
|
}
|
|
|
|
function calculateDiscountPercentageForYearlyPlan(a0) { // fn#29120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31518, offset: 0x00fba88c, size: 207 bytes, params: 2, frame: 21
|
|
var object;
|
|
var getMonthlyPriceBinding;
|
|
var monthlyPriceBinding;
|
|
var value4;
|
|
var getPriceBinding;
|
|
var id;
|
|
var error;
|
|
let value = a1;
|
|
const value2 = a2;
|
|
const r7 = value !== undefined ? value : false;
|
|
const r6 = value2 !== undefined ? value2 : {};
|
|
const interval = a0.interval;
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (interval === YEAR) {
|
|
try {
|
|
getMonthlyPriceBinding = getMonthlyPrice;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
object.subscriptionPlan = a0;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
object.isGift = r7;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
object.priceOptions = r6;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
monthlyPriceBinding = getMonthlyPriceBinding(object);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = monthlyPriceBinding == null;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
if (value4) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
getPriceBinding = getPrice;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
id = a0.id;
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
try {
|
|
value = getPriceBinding(id, false, r7, r6);
|
|
} catch (error) {
|
|
return undefined;
|
|
}
|
|
if (monthlyPriceBinding.amount !== 0) {
|
|
value = value.amount / (12 * monthlyPriceBinding.amount);
|
|
return global.Math.floor(100 * (1 - value));
|
|
}
|
|
}
|
|
}
|
|
|
|
function getDaysSincePremium(a0) { // fn#29121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31814, offset: 0x00fba95b, size: 129 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var Math;
|
|
var max;
|
|
var moduleValue;
|
|
var differenceInCalendarDays;
|
|
var Date;
|
|
var prototype;
|
|
var value3;
|
|
var date;
|
|
var value4;
|
|
var value5;
|
|
let value = 0;
|
|
if (a0 == null) {
|
|
r0 = value;
|
|
} else {
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
moduleValue = require(3826) /* metro dependency 3826: DateUtils */;
|
|
differenceInCalendarDays = moduleValue.differenceInCalendarDays;
|
|
Date = global.Date;
|
|
prototype = Date.prototype;
|
|
value3 = Object.create(prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
value4 = date instanceof Object ? date : value3;
|
|
Date = global.Date;
|
|
prototype = Date.prototype;
|
|
value5 = Object.create(prototype, {constructor: {value: Date}});
|
|
date = new Date(a0);
|
|
value = Reflect.apply(max, Math, [Reflect.apply(differenceInCalendarDays, moduleValue, [value4,
|
|
date instanceof Object ? date : value5]), value]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function getDaysRemainingUntilSubscriptionCurrentPeriodEnds({currentPeriodEnd}) { // fn#29122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:31932, offset: 0x00fba9dc, size: 139 bytes, params: 2, frame: 19
|
|
const Math = global.Math;
|
|
const max = Math.max;
|
|
const Math2 = global.Math;
|
|
const ceil = Math2.ceil;
|
|
let value = DateUtilsModule;
|
|
const differenceInDays = value.differenceInDays;
|
|
let Date = global.Date;
|
|
let date = new Date(currentPeriodEnd);
|
|
Date = global.Date;
|
|
const value4 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
value = Reflect.apply(ceil, Math2, [Reflect.apply(differenceInDays, value, [date,
|
|
date instanceof Object ? date : value4])]);
|
|
return Reflect.apply(max, Math, [1, value]);
|
|
}
|
|
|
|
function isPremiumSku(a0) { // fn#29123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:32684, offset: 0x00fbaa67, size: 56 bytes, params: 2, frame: 4
|
|
const TIER_0 = PremiumSubscriptionSKUs.TIER_0;
|
|
let r0 = a0 === TIER_0 || a0 === PremiumSubscriptionSKUs.TIER_1;
|
|
r0 = !r0 ? a0 === PremiumSubscriptionSKUs.TIER_2 : r0;
|
|
return r0;
|
|
}
|
|
|
|
function getIntervalMonths(a0, a1) { // fn#29124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:32776, offset: 0x00fbaa9f, size: 105 bytes, params: 3, frame: 15
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (a0 === MONTH) {
|
|
return a1;
|
|
}
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (a0 === YEAR) {
|
|
return 12 * a1;
|
|
}
|
|
const Error = global.Error;
|
|
const value = '' + a0 + ' interval subscription period not implemented';
|
|
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value2;
|
|
}
|
|
|
|
function hasAccountCredit(a0) { // fn#29127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:33937, offset: 0x00fbab87, size: 64 bytes, params: 2, frame: 12
|
|
let value = a0 != null;
|
|
let r0 = value && a0.size !== 0;
|
|
if (r0) {
|
|
value = global.Array.from(a0);
|
|
value = value.some(function({subscriptionPlanId, parentId, consumed}) {
|
|
return subscriptionPlanId != null && parentId != null && !consumed;
|
|
});
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function hasUnconsumedGiftForSubscriptionPlan(a0, a1) { // fn#29129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:34123, offset: 0x00fbabf1, size: 78 bytes, params: 3, frame: 15
|
|
const env0_0 = a1;
|
|
let value = a0 != null;
|
|
let r0 = value && a0.size !== 0 && a1 != null;
|
|
if (r0) {
|
|
value = global.Array.from(a0);
|
|
value = value.some(_fun29130);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun29130({subscriptionPlanId, parentId, consumed}) { // fn#29130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:34231, offset: 0x00fbac3f, size: 56 bytes, params: 2, frame: 6
|
|
return subscriptionPlanId != null && parentId != null && !consumed && subscriptionPlanId === require;
|
|
}
|
|
|
|
}
|
|
|
|
function canUseAnimatedEmojis(a0) { // fn#29131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35035, offset: 0x00fbac77, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const ANIMATED_EMOJIS = (ProductCatalogModule).ANIMATED_EMOJIS;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [ANIMATED_EMOJIS, a0]);
|
|
}
|
|
|
|
function canUseEmojisEverywhere(a0) { // fn#29132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35149, offset: 0x00fbacb0, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const EMOJIS_EVERYWHERE = (ProductCatalogModule).EMOJIS_EVERYWHERE;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [EMOJIS_EVERYWHERE, a0]);
|
|
}
|
|
|
|
function canUseSoundboardEverywhere(a0) { // fn#29133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35271, offset: 0x00fbace9, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const SOUNDBOARD_EVERYWHERE = (ProductCatalogModule).SOUNDBOARD_EVERYWHERE;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [SOUNDBOARD_EVERYWHERE, a0]);
|
|
}
|
|
|
|
function canUseCustomCallSounds(a0) { // fn#29134, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35397, offset: 0x00fbad22, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const CUSTOM_CALL_SOUNDS = (ProductCatalogModule).CUSTOM_CALL_SOUNDS;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [CUSTOM_CALL_SOUNDS, a0]);
|
|
}
|
|
|
|
function canUploadLargeFiles(a0) { // fn#29135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35513, offset: 0x00fbad5b, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const UPLOAD_LARGE_FILES = (ProductCatalogModule).UPLOAD_LARGE_FILES;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [UPLOAD_LARGE_FILES, a0]);
|
|
}
|
|
|
|
function canUseBadges(a0) { // fn#29136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35619, offset: 0x00fbad94, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const PROFILE_BADGES = (ProductCatalogModule).PROFILE_BADGES;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [PROFILE_BADGES, a0]);
|
|
}
|
|
|
|
function canUseHighVideoUploadQuality(a0) { // fn#29137, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35730, offset: 0x00fbadcd, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const INCREASED_VIDEO_UPLOAD_QUALITY = (ProductCatalogModule).INCREASED_VIDEO_UPLOAD_QUALITY;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [INCREASED_VIDEO_UPLOAD_QUALITY, a0]);
|
|
}
|
|
|
|
function canEditDiscriminator(a0) { // fn#29138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35865, offset: 0x00fbae06, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const CUSTOM_DISCRIMINATOR = (ProductCatalogModule).CUSTOM_DISCRIMINATOR;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [CUSTOM_DISCRIMINATOR, a0]);
|
|
}
|
|
|
|
function hasBoostDiscount(a0) { // fn#29139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:35978, offset: 0x00fbae3f, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const BOOST_DISCOUNT = (ProductCatalogModule).BOOST_DISCOUNT;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [BOOST_DISCOUNT, a0]);
|
|
}
|
|
|
|
function canUseAnimatedAvatar(a0) { // fn#29140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36085, offset: 0x00fbae78, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const ANIMATED_AVATAR = (ProductCatalogModule).ANIMATED_AVATAR;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [ANIMATED_AVATAR, a0]);
|
|
}
|
|
|
|
function canInstallPremiumApplications(a0) { // fn#29141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36206, offset: 0x00fbaeb1, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const INSTALL_PREMIUM_APPLICATIONS = (ProductCatalogModule).INSTALL_PREMIUM_APPLICATIONS;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [INSTALL_PREMIUM_APPLICATIONS, a0]);
|
|
}
|
|
|
|
function canUseIncreasedMessageLength(a0) { // fn#29142, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36348, offset: 0x00fbaeea, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const INCREASED_MESSAGE_LENGTH = (ProductCatalogModule).INCREASED_MESSAGE_LENGTH;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [INCREASED_MESSAGE_LENGTH, a0]);
|
|
}
|
|
|
|
function canUseIncreasedGuildCap(a0) { // fn#29143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36480, offset: 0x00fbaf23, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const INCREASED_GUILD_LIMIT = (ProductCatalogModule).INCREASED_GUILD_LIMIT;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [INCREASED_GUILD_LIMIT, a0]);
|
|
}
|
|
|
|
function canRedeemPremiumPerks(a0) { // fn#29144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36602, offset: 0x00fbaf5c, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const REDEEM_PREMIUM_PERKS = (ProductCatalogModule).REDEEM_PREMIUM_PERKS;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [REDEEM_PREMIUM_PERKS, a0]);
|
|
}
|
|
|
|
function canUsePremiumProfileCustomization(a0) { // fn#29145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36733, offset: 0x00fbaf95, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const PROFILE_PREMIUM_FEATURES = (ProductCatalogModule).PROFILE_PREMIUM_FEATURES;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [PROFILE_PREMIUM_FEATURES, a0]);
|
|
}
|
|
|
|
function canUsePremiumAppIcons(a0) { // fn#29146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36868, offset: 0x00fbafce, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const APP_ICONS = (ProductCatalogModule).APP_ICONS;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [APP_ICONS, a0]);
|
|
}
|
|
|
|
function canUsePremiumGuildMemberProfile(a0) { // fn#29147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:36986, offset: 0x00fbb007, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const PREMIUM_GUILD_MEMBER_PROFILE = (ProductCatalogModule).PREMIUM_GUILD_MEMBER_PROFILE;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [PREMIUM_GUILD_MEMBER_PROFILE, a0]);
|
|
}
|
|
|
|
function canUseClientThemes(a0) { // fn#29148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37120, offset: 0x00fbb040, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const CLIENT_THEMES = (ProductCatalogModule).CLIENT_THEMES;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [CLIENT_THEMES, a0]);
|
|
}
|
|
|
|
function canStreamQuality(a0, a1) { // fn#29149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37224, offset: 0x00fbb079, size: 125 bytes, params: 3, frame: 17
|
|
var r0;
|
|
var value;
|
|
const HIGH = env0_55.HIGH;
|
|
if (a0 === HIGH) {
|
|
value = require(12706) /* metro dependency 12706: ProductCatalog */;
|
|
value = value.canUserUse((require(12706) /* metro dependency 12706: ProductCatalog */).STREAM_HIGH_QUALITY, a1);
|
|
r0 = value;
|
|
} else {
|
|
value = require(12706) /* metro dependency 12706: ProductCatalog */;
|
|
value = value.canUserUse((require(12706) /* metro dependency 12706: ProductCatalog */).STREAM_MID_QUALITY, a1);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function hasFreeBoosts(a0) { // fn#29150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37446, offset: 0x00fbb0f6, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const FREE_BOOSTS = (ProductCatalogModule).FREE_BOOSTS;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [FREE_BOOSTS, a0]);
|
|
}
|
|
|
|
function canUseCustomStickersEverywhere(a0) { // fn#29151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37557, offset: 0x00fbb12f, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const STICKERS_EVERYWHERE = (ProductCatalogModule).STICKERS_EVERYWHERE;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [STICKERS_EVERYWHERE, a0]);
|
|
}
|
|
|
|
function canUseCustomBackgrounds(a0) { // fn#29152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37686, offset: 0x00fbb168, size: 57 bytes, params: 2, frame: 15
|
|
const canUserUse = ProductCatalogModule.canUserUse;
|
|
const VIDEO_FILTER_ASSETS = (ProductCatalogModule).VIDEO_FILTER_ASSETS;
|
|
return Reflect.apply(canUserUse, ProductCatalogModule, [VIDEO_FILTER_ASSETS, a0]);
|
|
}
|
|
|
|
function canUseMonthlyOrbs(a0) { // fn#29153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:37840, offset: 0x00fbb1a1, size: 135 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var moduleValue2;
|
|
const value2 = undefined;
|
|
const isCrepeEnabled = (CrepeExperimentModule).getIsCrepeEnabled('canUseMonthlyOrbs');
|
|
if (isCrepeEnabled) {
|
|
moduleValue2 = require(1893) /* metro dependency 1893: PerksStateUtils */;
|
|
r0 = moduleValue2.hasPerk(a0 == null ? value2 : a0.perks,
|
|
(require(1895) /* metro dependency 1895: user */).Perk.MONTHLY_ORBS);
|
|
} else {
|
|
r0 = !!isCrepeEnabled;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function canUseShopDiscounts(a0) { // fn#29154, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:38019, offset: 0x00fbb228, size: 141 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var moduleValue2;
|
|
const value2 = undefined;
|
|
const isCrepeEnabled = (CrepeExperimentModule).getIsCrepeEnabled('canUseShopDiscounts');
|
|
if (isCrepeEnabled) {
|
|
moduleValue2 = require(1893) /* metro dependency 1893: PerksStateUtils */;
|
|
r0 = moduleValue2.hasPerk(a0 == null ? value2 : a0.perks,
|
|
(require(1895) /* metro dependency 1895: user */).Perk.SHOP_DISCOUNTS);
|
|
} else {
|
|
r0 = isCrepeEnabled;
|
|
}
|
|
r0 = !r0 ? canUseCollectibles(a0) : r0;
|
|
return r0;
|
|
}
|
|
|
|
function canUseMoreQuestOrbs(a0) { // fn#29155, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:38226, offset: 0x00fbb2b5, size: 141 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var moduleValue2;
|
|
const value2 = undefined;
|
|
const isCrepeEnabled = (CrepeExperimentModule).getIsCrepeEnabled('canUseMoreQuestOrbs');
|
|
if (isCrepeEnabled) {
|
|
moduleValue2 = require(1893) /* metro dependency 1893: PerksStateUtils */;
|
|
r0 = moduleValue2.hasPerk(a0 == null ? value2 : a0.perks,
|
|
(require(1895) /* metro dependency 1895: user */).Perk.MORE_QUEST_ORBS);
|
|
} else {
|
|
r0 = isCrepeEnabled;
|
|
}
|
|
r0 = !r0 ? canUseQuestOrbMultiplier(a0) : r0;
|
|
return r0;
|
|
}
|
|
|
|
function getPremiumBranding(a0) { // fn#29156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:38608, offset: 0x00fbb342, size: 221 bytes, params: 2, frame: 13
|
|
const planId = a0.planId;
|
|
return PREMIUM_PLANS.has(planId) && subscriptionHasPremiumGuildPlan(a0) ? env0_54.BUNDLE : planId === SubscriptionPlans.PREMIUM_MONTH_TIER_0 || planId === SubscriptionPlans.PREMIUM_YEAR_TIER_0 ? env0_54.TIER_0 : planId === SubscriptionPlans.PREMIUM_MONTH_TIER_1 || planId === SubscriptionPlans.PREMIUM_YEAR_TIER_1 ? env0_54.TIER_1 : planId === SubscriptionPlans.PREMIUM_MONTH_TIER_2 || planId === SubscriptionPlans.PREMIUM_YEAR_TIER_2 || (planId === SubscriptionPlans.PREMIUM_3_MONTH_TIER_2 || planId === SubscriptionPlans.PREMIUM_6_MONTH_TIER_2) ? env0_54.TIER_2 : env0_54.PREMIUM_GUILD;
|
|
}
|
|
|
|
function usePlanSelectPriceState(a0, a1, a2) { // fn#29157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39140, offset: 0x00fbb41f, size: 96 bytes, params: 4, frame: 17
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
return ReactModule.useMemo(_fun29159, [a0, a1, ReactModule.useMemo(function() {
|
|
var value2 = null;
|
|
return value2 == require || value2 == require.checkoutContext || value2 == require.checkoutContext.available_plans ? value2 : require.checkoutContext.available_plans;
|
|
}, [a1]), a2]);
|
|
function _fun29159() { // fn#29159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39338, offset: 0x00fbb4cf, size: 103 bytes, params: 1, frame: 15
|
|
const object = {};
|
|
const value = environment.__proto__;
|
|
const withContextPlanPricesBinding = withContextPlanPrices;
|
|
const binding = env0_0;
|
|
object.priceOptions = withContextPlanPricesBinding(binding, Module00057);
|
|
object.planPricesLoading = binding.currency != null && require != null && require.currency !== env0_0.currency && importDefault == null;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function getCountryPrices(a0) { // fn#29160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39520, offset: 0x00fbb536, size: 46 bytes, params: 2, frame: 13
|
|
const value = a1;
|
|
return getPurchaseTypePrices(a0,
|
|
value !== undefined ? value : PriceSetAssignmentPurchaseTypes.DEFAULT).countryPrices;
|
|
}
|
|
|
|
function getSubscriptionWithNewPlansTotalServerPrice(a0, a1, a2, a3) { // fn#29161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:39878, offset: 0x00fbb564, size: 110 bytes, params: 5, frame: 17
|
|
var r2;
|
|
const value = a1;
|
|
if (value !== null) {
|
|
r2 = value;
|
|
} else {
|
|
(importDefault(44) /* metro dependency 44 */)(a0 !== null, "Subscription can't be null");
|
|
r2 = [];
|
|
}
|
|
return getItemPlansTotalServerPrice(a0 !== null ? getItemsFromNewAdditionalPlans(a0,
|
|
r2) : getItemsWithoutPremiumPlanItem(r2), a2, a3);
|
|
}
|
|
|
|
function getDiscountIntervalString(a0) { // fn#29162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:40184, offset: 0x00fbb5d2, size: 215 bytes, params: 2, frame: 15
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const MONTH = DiscountUserUsageLimitIntervalTypes.MONTH;
|
|
if (MONTH === a0) {
|
|
return intl.string(t.FPybU7);
|
|
}
|
|
const YEAR = DiscountUserUsageLimitIntervalTypes.YEAR;
|
|
if (YEAR === a0) {
|
|
return intl.string(t.tfqrhj);
|
|
}
|
|
const DAY = DiscountUserUsageLimitIntervalTypes.DAY;
|
|
if (DAY !== a0) {
|
|
DiscountUserUsageLimitIntervalTypes.WEEK;
|
|
}
|
|
const Error = global.Error;
|
|
throw new Error('Unexpected interval');
|
|
}
|
|
|
|
function getDisplayNameFromSku(a0) { // fn#29163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:40613, offset: 0x00fbb6a9, size: 314 bytes, params: 2, frame: 16
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const TIER_0 = PremiumSubscriptionSKUs.TIER_0;
|
|
if (TIER_0 === a0) {
|
|
return intl.string(t['t9uG/o']);
|
|
}
|
|
const TIER_1 = PremiumSubscriptionSKUs.TIER_1;
|
|
if (TIER_1 === a0) {
|
|
return intl.string(t.FSOz78);
|
|
}
|
|
const TIER_2 = PremiumSubscriptionSKUs.TIER_2;
|
|
if (TIER_2 === a0) {
|
|
return intl.string(t.lG6a5x);
|
|
}
|
|
const Error = global.Error;
|
|
const error = new Error('Unsupported sku');
|
|
(BillingUtilsModule).captureBillingException(error, {tags: {skuId: a0}});
|
|
throw error;
|
|
}
|
|
|
|
function getPremiumTypeDisplayName(a0) { // fn#29164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:41035, offset: 0x00fbb7e3, size: 251 bytes, params: 2, frame: 17
|
|
const intl = (IndexNativeModule).intl;
|
|
const t = (IndexNativeModule).t;
|
|
const value = a1;
|
|
const r2 = value !== undefined ? value : false;
|
|
const TIER_0 = PremiumTypes.TIER_0;
|
|
if (TIER_0 === a0) {
|
|
return r2 ? 'Basic' : intl.string(t['t9uG/o']);
|
|
}
|
|
const TIER_1 = PremiumTypes.TIER_1;
|
|
if (TIER_1 === a0) {
|
|
return r2 ? 'Classic' : intl.string(t.FSOz78);
|
|
}
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
if (TIER_2 === a0) {
|
|
return intl.string(t.lG6a5x);
|
|
}
|
|
}
|
|
|
|
function getPlanDescriptionFromInvoice({renewalInvoicePreview, renewalInvoiceWithEntitlementsPreview, subscription, planId, includePremiumGuilds, hasDiscountApplied, activeDiscountInfo, hasFractionalPremiumWithSub, fractionalPremiumInfo}) { // fn#29165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:41338, offset: 0x00fbb8de, size: 211 bytes, params: 2, frame: 24
|
|
includePremiumGuilds = !(includePremiumGuilds === undefined) && includePremiumGuilds;
|
|
hasDiscountApplied = !(hasDiscountApplied === undefined) && hasDiscountApplied;
|
|
hasFractionalPremiumWithSub = !(hasFractionalPremiumWithSub === undefined) && hasFractionalPremiumWithSub;
|
|
const value2 = SubscriptionPlanStore.get(planId);
|
|
(Module00044)(value2 != null, 'Missing plan');
|
|
const getPlanDescriptionBinding = getPlanDescription;
|
|
const object = {subscription: subscription};
|
|
object.planId = value2.id;
|
|
object.price = getFormattedPlanPriceFromInvoice(renewalInvoicePreview, subscription, value2);
|
|
object.includePremiumGuilds = includePremiumGuilds;
|
|
object.hasDiscountApplied = hasDiscountApplied;
|
|
object.activeDiscountInfo = activeDiscountInfo;
|
|
object.renewalInvoiceWithoutEntitlementsPreview = renewalInvoicePreview;
|
|
object.renewalInvoiceWithEntitlementsPreview = renewalInvoiceWithEntitlementsPreview;
|
|
object.hasFractionalPremiumWithSub = hasFractionalPremiumWithSub;
|
|
object.fractionalPremiumInfo = fractionalPremiumInfo;
|
|
return getPlanDescriptionBinding(object);
|
|
}
|
|
|
|
function getExternalPlanDisplayName({planId, additionalPlans}) { // fn#29166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:41980, offset: 0x00fbb9b1, size: 364 bytes, params: 2, frame: 21
|
|
const t = (IndexNativeModule).t;
|
|
const intl = (IndexNativeModule).intl;
|
|
const r5 = isNoneSubscription(planId) ? null : getDisplayName_29051(planId);
|
|
const r10 = additionalPlans?.find(function({planId}) {
|
|
return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(planId);
|
|
});
|
|
planId = r10?.planId;
|
|
const PREMIUM_MONTH_GUILD = SubscriptionPlans.PREMIUM_MONTH_GUILD;
|
|
const Pi5yMJ = planId === PREMIUM_MONTH_GUILD ? t.Pi5yMJ : r10?.planId !== SubscriptionPlans.PREMIUM_YEAR_GUILD ? null : t.Pi5yMJ;
|
|
const r4 = Pi5yMJ != null ? intl.formatToPlainString(Pi5yMJ, {num: r10?.quantity}) : undefined;
|
|
if (r5 == null) {
|
|
if (r5 != null) {
|
|
return r5;
|
|
}
|
|
if (r4 != null) {
|
|
return r4;
|
|
}
|
|
throw new global.Error('Subscription without premium or premium guild subscription');
|
|
}
|
|
if (r4 != null) {
|
|
return intl.formatToPlainString(t.FN5T9r, {premiumDescription: r5, premiumGuildDescription: r4});
|
|
}
|
|
if (r5 != null) {
|
|
return r5;
|
|
}
|
|
if (r4 != null) {
|
|
return r4;
|
|
}
|
|
const Error = global.Error;
|
|
throw new Error('Subscription without premium or premium guild subscription');
|
|
}
|
|
|
|
function getPlanIdForPremiumType(a0, a1) { // fn#29168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:42669, offset: 0x00fbbb39, size: 344 bytes, params: 3, frame: 15
|
|
var Error;
|
|
const Set = global.Set;
|
|
var value;
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
const set = new Set([MONTH, YEAR]);
|
|
if (set.has(a1)) {
|
|
if (PremiumTypes.TIER_0 === a0) {
|
|
return a1 === SubscriptionIntervalTypes.MONTH ? SubscriptionPlans.PREMIUM_MONTH_TIER_0 : SubscriptionPlans.PREMIUM_YEAR_TIER_0;
|
|
}
|
|
if (PremiumTypes.TIER_1 === a0) {
|
|
return a1 === SubscriptionIntervalTypes.MONTH ? SubscriptionPlans.PREMIUM_MONTH_TIER_1 : SubscriptionPlans.PREMIUM_YEAR_TIER_1;
|
|
}
|
|
if (PremiumTypes.TIER_2 === a0) {
|
|
return a1 === SubscriptionIntervalTypes.MONTH ? SubscriptionPlans.PREMIUM_MONTH_TIER_2 : SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
}
|
|
Error = global.Error;
|
|
value = 'Unsupported premium type: ' + a0;
|
|
throw new Error();
|
|
}
|
|
Error = global.Error;
|
|
value = 'Unsupported plan interval for premium type: ' + a1;
|
|
const value4 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value4;
|
|
}
|
|
|
|
function isPremiumSubscriptionPlan(a0) { // fn#29169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:43412, offset: 0x00fbbc91, size: 31 bytes, params: 2, frame: 13
|
|
return isPremiumBaseSubscriptionPlan(a0) || isPremiumGuildSubscriptionPlan(a0);
|
|
}
|
|
|
|
function isPremiumGroupSubscriptionPlan(a0) { // fn#29170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:43561, offset: 0x00fbbcb0, size: 31 bytes, params: 2, frame: 3
|
|
return a0 != null && a0 === SubscriptionPlans.PREMIUM_GROUP_MONTH;
|
|
}
|
|
|
|
function getPremiumGuildHeaderDescription({subscription, user, price, renewalInvoicePreview, fractionalPremiumInfo}) { // fn#29171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:44470, offset: 0x00fbbccf, size: 1555 bytes, params: 2, frame: 38
|
|
var r12;
|
|
var r11;
|
|
var r19;
|
|
var r3;
|
|
var value10;
|
|
var moduleValue;
|
|
var isPurchasedViaGoogle;
|
|
var intl;
|
|
var format;
|
|
var t;
|
|
var ijSDcI;
|
|
var object;
|
|
var eDwrLA;
|
|
var property;
|
|
var moduleValue3;
|
|
var oiRy7v;
|
|
const planId = subscription.planId;
|
|
const additionalPlans = subscription.additionalPlans;
|
|
const renewalMutations = subscription.renewalMutations;
|
|
var value;
|
|
const value2 = SubscriptionPlanStore.get(planId);
|
|
(Module00044)(value2 != null, 'Missing plan');
|
|
const numPremiumGuildSubscriptions = getNumPremiumGuildSubscriptions(additionalPlans);
|
|
const r15 = renewalMutations?.additionalPlans == null ? numPremiumGuildSubscriptions : getNumPremiumGuildSubscriptions(renewalMutations.additionalPlans);
|
|
const Math = global.Math;
|
|
const value6 = Math.max(0, numPremiumGuildSubscriptions - r15);
|
|
let r17 = r15 > 0 && value6 > 0;
|
|
const value9 = getPremiumGuildIntervalPrice(subscription.planId, subscription.paymentSourceId,
|
|
subscription.currency, user).amount * (r17 ? r15 : numPremiumGuildSubscriptions);
|
|
if (renewalInvoicePreview == null) {
|
|
r12 = value9;
|
|
} else {
|
|
value10 = renewalInvoicePreview.invoiceItems.find(function(a0) {
|
|
return PREMIUM_GUILD_SUBSCRIPTION_PLANS.has(a0.subscriptionPlanId);
|
|
});
|
|
r12 = value10 == null ? value9 : value10.amount;
|
|
}
|
|
if (price != null) {
|
|
r11 = price;
|
|
} else {
|
|
moduleValue = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
r11 = moduleValue.formatPrice(r12, subscription.currency);
|
|
}
|
|
const r6 = renewalInvoicePreview?.taxInclusive ?? subscription.latestInvoice?.taxInclusive;
|
|
let r0 = r6 == null || r6;
|
|
if (isPremiumGuildSubscriptionCanceled(subscription)) {
|
|
isPurchasedViaGoogle = subscription.isPurchasedViaGoogle;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
format = intl.format;
|
|
t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
if (isPurchasedViaGoogle) {
|
|
r0 = Reflect.apply(format, intl, [t['3/WTrI'], {quantity: numPremiumGuildSubscriptions}]);
|
|
} else if (r0) {
|
|
property = t['0ozBSB'];
|
|
object = {quantity: numPremiumGuildSubscriptions};
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
object.rate = value.formatRate(r11, value2.interval, value2.intervalCount);
|
|
value = Reflect.apply(format, intl, [property, object]);
|
|
r0 = value;
|
|
} else {
|
|
property = t['yjsv/s'];
|
|
object = {quantity: numPremiumGuildSubscriptions};
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
object.rate = value.formatRate(r11, value2.interval, value2.intervalCount);
|
|
value = Reflect.apply(format, intl, [property, object]);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
const status = subscription.status;
|
|
const ACCOUNT_HOLD = SubscriptionStatusTypes.ACCOUNT_HOLD;
|
|
if (ACCOUNT_HOLD === status) {
|
|
isPurchasedViaGoogle = subscription.isPurchasedViaGoogle;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
format = intl.format;
|
|
t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
if (isPurchasedViaGoogle) {
|
|
r3 = Reflect.apply(format, intl, [t.Nlf3nc, {quantity: numPremiumGuildSubscriptions,
|
|
boostQuantity: numPremiumGuildSubscriptions}]);
|
|
} else if (r0) {
|
|
oiRy7v = t.oiRy7v;
|
|
object = {quantity: numPremiumGuildSubscriptions, boostQuantity: numPremiumGuildSubscriptions};
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
object.rate = value.formatRate(r11, value2.interval, value2.intervalCount);
|
|
value = Reflect.apply(format, intl, [oiRy7v, object]);
|
|
r3 = value;
|
|
} else {
|
|
property = t['0QxOAi'];
|
|
object = {quantity: numPremiumGuildSubscriptions, boostQuantity: numPremiumGuildSubscriptions};
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
object.rate = value.formatRate(r11, value2.interval, value2.intervalCount);
|
|
value = Reflect.apply(format, intl, [property, object]);
|
|
r3 = value;
|
|
}
|
|
return r3;
|
|
}
|
|
const PAUSE_PENDING = SubscriptionStatusTypes.PAUSE_PENDING;
|
|
if (PAUSE_PENDING === status) {
|
|
if (fractionalPremiumInfo == null) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'],
|
|
{quantity: numPremiumGuildSubscriptions});
|
|
} else if (fractionalPremiumInfo.isFractionalPremiumActive) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'],
|
|
{quantity: numPremiumGuildSubscriptions});
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r3 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.CduWAm);
|
|
}
|
|
return r3;
|
|
}
|
|
const PAUSED = SubscriptionStatusTypes.PAUSED;
|
|
if (PAUSED === status) {
|
|
if (fractionalPremiumInfo == null) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'],
|
|
{quantity: numPremiumGuildSubscriptions});
|
|
} else if (fractionalPremiumInfo.isFractionalPremiumActive) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r3 = intl.format((require(1244) /* metro dependency 1244: indexNative */).t['5iud9s'],
|
|
{quantity: numPremiumGuildSubscriptions});
|
|
} else {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
r3 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.CduWAm);
|
|
}
|
|
return r3;
|
|
}
|
|
const PAST_DUE = SubscriptionStatusTypes.PAST_DUE;
|
|
if (PAST_DUE === status) {
|
|
if (subscription.isBoostOnly) {
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
format = intl.format;
|
|
property = (require(1244) /* metro dependency 1244: indexNative */).t['d+0vwo'];
|
|
object = {};
|
|
moduleValue3 = require(3826) /* metro dependency 3826: DateUtils */;
|
|
object.endDate = moduleValue3.dateFormat(getBillingGracePeriodDaysAndExpiresDate(subscription).expiresDate,
|
|
'LL');
|
|
object.onClick = onClick_29173;
|
|
return Reflect.apply(format, intl, [property, object]);
|
|
}
|
|
}
|
|
isPurchasedViaGoogle = subscription.isPurchasedViaGoogle;
|
|
const moduleValue2 = require(1244) /* metro dependency 1244: indexNative */;
|
|
if (r17) {
|
|
if (isPurchasedViaGoogle) {
|
|
intl = moduleValue2.intl;
|
|
return intl.format((require(1244) /* metro dependency 1244: indexNative */).t['krRy+d'],
|
|
{activeQuantity: r15,
|
|
pendingQuantity: value6});
|
|
}
|
|
t = moduleValue2.t;
|
|
r19 = r0 ? t['4nc7+E'] : t.BmaudS;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
format = intl.format;
|
|
object = {activeQuantity: r15, pendingQuantity: value6};
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
object.rate = value.formatRate(r11, value2.interval, value2.intervalCount);
|
|
return Reflect.apply(format, intl, [r19, object]);
|
|
}
|
|
intl = moduleValue2.intl;
|
|
format = intl.format;
|
|
t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
if (isPurchasedViaGoogle) {
|
|
r17 = Reflect.apply(format, intl, [t['5iud9s'], {quantity: numPremiumGuildSubscriptions}]);
|
|
} else if (r0) {
|
|
eDwrLA = t.eDwrLA;
|
|
object = {quantity: numPremiumGuildSubscriptions};
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
object.rate = value.formatRate(r11, value2.interval, value2.intervalCount);
|
|
value = Reflect.apply(format, intl, [eDwrLA, object]);
|
|
r17 = value;
|
|
} else {
|
|
ijSDcI = t.ijSDcI;
|
|
object = {quantity: numPremiumGuildSubscriptions};
|
|
value = require(5137) /* metro dependency 5137: PriceUtils */;
|
|
object.rate = value.formatRate(r11, value2.interval, value2.intervalCount);
|
|
value = Reflect.apply(format, intl, [ijSDcI, object]);
|
|
r17 = value;
|
|
}
|
|
return r17;
|
|
function getPremiumGuildHeaderDescriptionOnClick() { // fn#29173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:46323, owner: getPremiumGuildHeaderDescription.onClick, offset: 0x00fb805d, size: 38 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
(OpenURL)('https://support.discord.com/hc/articles/23082866222871');
|
|
}
|
|
|
|
}
|
|
|
|
function getFormattedRateForPlan(a0, a1, a2) { // fn#29174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:47097, offset: 0x00fbc2fe, size: 72 bytes, params: 4, frame: 16
|
|
const formattedPriceForPlan = getFormattedPriceForPlan(a0, a1, a2);
|
|
return PriceUtilsModule.formatRate(formattedPriceForPlan, a0.interval, a0.intervalCount);
|
|
}
|
|
|
|
function formatTrialOfferIntervalDuration({intervalType, intervalCount, capitalize}) { // fn#29175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:47771, offset: 0x00fbc346, size: 540 bytes, params: 2, frame: 20
|
|
const intl = (IndexNativeModule).intl;
|
|
var formatToPlainString;
|
|
const t = (IndexNativeModule).t;
|
|
const r3 = intervalType !== undefined ? intervalType : SubscriptionIntervalTypes.MONTH;
|
|
intervalCount = intervalCount === undefined ? 1 : intervalCount;
|
|
capitalize = !(capitalize === undefined) && capitalize;
|
|
const DAY = SubscriptionIntervalTypes.DAY;
|
|
if (DAY === r3) {
|
|
return intervalCount >= 7 && intervalCount % 7 === 0 ? capitalize ? intl.formatToPlainString(t.fRNBRX,
|
|
{weeks: intervalCount / 7}) : intl.formatToPlainString(t.EIpHEj, {weeks: intervalCount / 7}) : capitalize ? intl.formatToPlainString(t['6Cdzoy'],
|
|
|
|
{days: intervalCount}) : intl.formatToPlainString(t['kbBj/h'], {days: intervalCount});
|
|
}
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (MONTH === r3) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
return capitalize ? Reflect.apply(formatToPlainString, intl, [t.x5MgxS,
|
|
{months: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t['4SEnCZ'],
|
|
{months: intervalCount}]);
|
|
}
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (YEAR === r3) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
return capitalize ? Reflect.apply(formatToPlainString, intl, [t['h+63yl'],
|
|
{years: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t['9DFiHk'], {years: intervalCount}]);
|
|
}
|
|
const Error = global.Error;
|
|
throw new Error('Unsupported interval duration.');
|
|
}
|
|
|
|
function formatTrialCtaIntervalDurationFromTrialOffer(a0, a1) { // fn#29176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:48675, offset: 0x00fbc562, size: 86 bytes, params: 3, frame: 12
|
|
if (a0 != null) {
|
|
var subscription_trial = a0.subscription_trial;
|
|
if (subscription_trial == null) {
|
|
return null;
|
|
}
|
|
subscription_trial = a0.subscription_trial;
|
|
if (subscription_trial.sku_id === a1) {
|
|
subscription_trial = a0.subscription_trial;
|
|
return formatTrialCtaIntervalDuration({intervalType: subscription_trial.interval,
|
|
intervalCount: subscription_trial.interval_count});
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
function formatIntervalDuration({intervalType, intervalCount, capitalize}) { // fn#29177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:48970, offset: 0x00fbc5b8, size: 524 bytes, params: 2, frame: 20
|
|
const intl = (IndexNativeModule).intl;
|
|
var formatToPlainString;
|
|
const t = (IndexNativeModule).t;
|
|
const r3 = intervalType !== undefined ? intervalType : SubscriptionIntervalTypes.MONTH;
|
|
intervalCount = intervalCount === undefined ? 1 : intervalCount;
|
|
capitalize = !(capitalize === undefined) && capitalize;
|
|
const DAY = SubscriptionIntervalTypes.DAY;
|
|
if (DAY === r3) {
|
|
return intervalCount >= 7 && intervalCount % 7 === 0 ? capitalize ? intl.formatToPlainString(t.iVZYyl,
|
|
{weeks: intervalCount / 7}) : intl.formatToPlainString(t.EmoBD2, {weeks: intervalCount / 7}) : capitalize ? intl.formatToPlainString(t.jzH70Z,
|
|
|
|
{days: intervalCount}) : intl.formatToPlainString(t['k2UNz+'], {days: intervalCount});
|
|
}
|
|
const MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (MONTH === r3) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
return capitalize ? Reflect.apply(formatToPlainString, intl, [t.erUSmA,
|
|
{months: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t.kridzK, {months: intervalCount}]);
|
|
}
|
|
const YEAR = SubscriptionIntervalTypes.YEAR;
|
|
if (YEAR === r3) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
return capitalize ? Reflect.apply(formatToPlainString, intl, [t.IfYQVC,
|
|
{years: intervalCount}]) : Reflect.apply(formatToPlainString, intl, [t.PClsrw, {years: intervalCount}]);
|
|
}
|
|
const Error = global.Error;
|
|
throw new Error('Unsupported interval duration.');
|
|
}
|
|
|
|
function hasPremiumSubscriptionToDisplay(a0, a1) { // fn#29178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:49843, offset: 0x00fbc7c4, size: 72 bytes, params: 3, frame: 14
|
|
return (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremium(a0) || isSubscriptionStatusFailedPayment(a1?.status);
|
|
}
|
|
|
|
function useHasPremiumSubscriptionToDisplay() { // fn#29179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:50019, offset: 0x00fbc80c, size: 145 bytes, params: 1, frame: 19
|
|
const value2 = undefined;
|
|
const premiumTypeSubscription = (require(566) /* metro dependency 566: flux */).useStateFromStores([SubscriptionStore],
|
|
function() {
|
|
return SubscriptionStore.getPremiumTypeSubscription();
|
|
});
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
return (require(1900) /* metro dependency 1900: PremiumTypeUtils */).isPremium(currentUser) || isSubscriptionStatusFailedPayment(premiumTypeSubscription == null ? value2 : premiumTypeSubscription.status);
|
|
}
|
|
|
|
function coerceExistingItemsToNewItemInterval(a0) { // fn#29184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:50825, offset: 0x00fbc8fa, size: 136 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var subscriptionPlanStoreBinding;
|
|
let value = a0;
|
|
const r2 = value.find(function(a0) {
|
|
return !('id' in a0);
|
|
}) ?? value.find(function(a0) {
|
|
return PREMIUM_PLANS.has(a0.planId);
|
|
});
|
|
if (r2 == null) {
|
|
r0 = value;
|
|
} else {
|
|
subscriptionPlanStoreBinding = SubscriptionPlanStore;
|
|
(importDefault(44) /* metro dependency 44 */)(subscriptionPlanStoreBinding.get(r2.planId) != null,
|
|
'Missing plan');
|
|
value = value.map(_fun29187);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun29187(a0) { // fn#29187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:51024, offset: 0x00fbc992, size: 227 bytes, params: 2, frame: 20
|
|
var value;
|
|
if (a0 === env0_0) {
|
|
return a0;
|
|
}
|
|
const value3 = SubscriptionPlanStore.get(a0.planId);
|
|
(Module00044)(value3 != null, 'Missing plan');
|
|
if (env0_1.interval !== value3.interval) {
|
|
subscriptionPlanStoreBinding = SubscriptionPlanStore;
|
|
value = subscriptionPlanStoreBinding.getForSkuAndInterval(value3.skuId, env0_1.interval, env0_1.intervalCount);
|
|
} else {
|
|
if (env0_1.intervalCount === value3.intervalCount) {
|
|
return a0;
|
|
}
|
|
value = SubscriptionPlanStore.getForSkuAndInterval(value3.skuId, env0_1.interval, env0_1.intervalCount);
|
|
}
|
|
(Module00044)(value != null, 'Missing planForInterval');
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
object['planId'] = value.id;
|
|
return object;
|
|
}
|
|
|
|
}
|
|
|
|
function getMaxFileSizeForPremiumType(a0) { // fn#29188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:51353, offset: 0x00fbca75, size: 105 bytes, params: 2, frame: 15
|
|
let value = a1;
|
|
const r4 = value !== undefined ? value : {useSpace: true};
|
|
const fileSize = PremiumUserLimits[a0].fileSize;
|
|
value = require(4136) /* metro dependency 4136: FileSizeUtils */;
|
|
const formatSize = value.formatSize;
|
|
const value2 = fileSize / 1024;
|
|
const useSpace = r4.useSpace;
|
|
return Reflect.apply(formatSize, value, [value2, {useKibibytes: true, useSpace: useSpace}]);
|
|
}
|
|
|
|
function getPremiumTypeFromPlanId(a0) { // fn#29189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:51896, offset: 0x00fbcade, size: 270 bytes, params: 2, frame: 13
|
|
const PREMIUM_MONTH_TIER_0 = SubscriptionPlans.PREMIUM_MONTH_TIER_0;
|
|
if (PREMIUM_MONTH_TIER_0 === a0) {
|
|
return {premiumType: PremiumTypes.TIER_0, planInterval: SubscriptionIntervalTypes.MONTH};
|
|
}
|
|
const PREMIUM_YEAR_TIER_0 = SubscriptionPlans.PREMIUM_YEAR_TIER_0;
|
|
if (PREMIUM_YEAR_TIER_0 === a0) {
|
|
return {premiumType: PremiumTypes.TIER_0, planInterval: SubscriptionIntervalTypes.YEAR};
|
|
}
|
|
const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
|
if (PREMIUM_MONTH_TIER_2 === a0) {
|
|
return {premiumType: PremiumTypes.TIER_2, planInterval: SubscriptionIntervalTypes.MONTH};
|
|
}
|
|
const PREMIUM_GROUP_MONTH = SubscriptionPlans.PREMIUM_GROUP_MONTH;
|
|
if (PREMIUM_GROUP_MONTH === a0) {
|
|
return {premiumType: PremiumTypes.TIER_2, planInterval: SubscriptionIntervalTypes.MONTH};
|
|
}
|
|
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
|
if (PREMIUM_YEAR_TIER_2 === a0) {
|
|
return {premiumType: PremiumTypes.TIER_2, planInterval: SubscriptionIntervalTypes.YEAR};
|
|
}
|
|
const Error = global.Error;
|
|
const value = 'Unsupported gifting planId: ' + a0;
|
|
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
|
|
const error = new Error();
|
|
throw error instanceof Object ? error : value2;
|
|
}
|
|
|
|
function useHasTier2Premium() { // fn#29191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:52620, offset: 0x00fbcbf9, size: 91 bytes, params: 1, frame: 17
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const isPremiumExactly = PremiumTypeUtilsModule.isPremiumExactly;
|
|
const TIER_2 = PremiumTypes.TIER_2;
|
|
return Reflect.apply(isPremiumExactly, PremiumTypeUtilsModule, [currentUser, TIER_2]);
|
|
function _fun29192() { // fn#29192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:52690, offset: 0x00fbc8b0, size: 18 bytes, params: 1, frame: 9
|
|
return UserStore.getCurrentUser();
|
|
}
|
|
|
|
}
|
|
|
|
function getSavingsPercent({planId, isGift, priceOptions, subscriptionPlan}) { // fn#29194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:53317, offset: 0x00fbcca0, size: 59 bytes, params: 2, frame: 16
|
|
return subscriptionPlan == null ? DISCOUNTS[planId] : calculateDiscountPercentageForYearlyPlan(subscriptionPlan,
|
|
isGift, priceOptions);
|
|
}
|
|
|
|
function calculateMonthlyPriceEquivalentTotal({subscriptionPlan, isGift, priceOptions}) { // fn#29195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:53522, offset: 0x00fbccdb, size: 189 bytes, params: 2, frame: 16
|
|
var monthlyPrice;
|
|
isGift = !(isGift === undefined) && isGift;
|
|
const r5 = priceOptions !== undefined ? priceOptions : {};
|
|
let interval = subscriptionPlan.interval;
|
|
const DAY = SubscriptionIntervalTypes.DAY;
|
|
if (interval === DAY) {
|
|
return null;
|
|
}
|
|
interval = subscriptionPlan.interval;
|
|
let MONTH = SubscriptionIntervalTypes.MONTH;
|
|
if (interval !== MONTH) {
|
|
monthlyPrice = getMonthlyPrice({subscriptionPlan: subscriptionPlan, isGift: isGift, priceOptions: r5});
|
|
if (monthlyPrice == null) {
|
|
return null;
|
|
}
|
|
return monthlyPrice.amount * (subscriptionPlan.interval === SubscriptionIntervalTypes.MONTH ? subscriptionPlan.intervalCount : 12 * subscriptionPlan.intervalCount);
|
|
}
|
|
if (subscriptionPlan.intervalCount === 1) {
|
|
return null;
|
|
}
|
|
monthlyPrice = getMonthlyPrice({subscriptionPlan: subscriptionPlan, isGift: isGift, priceOptions: r5});
|
|
if (monthlyPrice == null) {
|
|
return null;
|
|
}
|
|
interval = subscriptionPlan.interval;
|
|
MONTH = SubscriptionIntervalTypes.MONTH;
|
|
return monthlyPrice.amount * (interval === MONTH ? subscriptionPlan.intervalCount : 12 * subscriptionPlan.intervalCount);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun29038({id, price}) { // fn#29038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:3551, offset: 0x00fb5d16, size: 28 bytes, params: 2, frame: 3
|
|
return [id, price];
|
|
}
|
|
|
|
function _fun29068(a0) { // fn#29068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18970, offset: 0x00fb8ff0, size: 11 bytes, params: 2, frame: 1
|
|
return a0.amount;
|
|
}
|
|
|
|
function _fun29069(a0, a1) { // fn#29069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:18992, offset: 0x00fb8ffb, size: 12 bytes, params: 3, frame: 2
|
|
return a1 + a0;
|
|
}
|
|
|
|
function _fun29100({quantity}) { // fn#29100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:29798, offset: 0x00fba473, size: 17 bytes, params: 2, frame: 2
|
|
return quantity !== 0;
|
|
}
|
|
|
|
function _fun29128({subscriptionPlanId, parentId, consumed}) { // fn#29128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3929:34014, offset: 0x00fbabc7, size: 42 bytes, params: 2, frame: 5
|
|
return subscriptionPlanId != null && parentId != null && !consumed;
|
|
}
|
|
|
|
global.__d(_fun29030, 3802, [57, 31, 3803, 1878, 3804, 3805, 3807, 3808, 661, 1880, 3816, 482, 3, 3817, 3814, 1900,
|
|
44, 1244, 2806, 3738, 3826, 3847, 5137, 3815, 12192, 672, 566, 8458, 4136, 12706, 5136, 1893, 1895, 7937,
|
|
2]) /* metro module 3802, dependencies: [57, 31, 3803, 1878, 3804, 3805, 3807, 3808, 661, 1880, 3816, 482, 3, 3817, 3814, 1900, 44, 1244, 2806, 3738, 3826, 3847, 5137, 3815, 12192, 672, 566, 8458, 4136, 12706, 5136, 1893, 1895, 7937, 2] */;
|