Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,193 @@
|
||||
/* Metro module 7674; source: modules/premium/gifting/utils/promotions/GiftingPromotionUtils.tsx; dependencies: [57, 31, 7261, 1880, 566, 7675, 7676, 7583, 3968, 1365, 2] */
|
||||
function _fun61309(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:6, offset: 0x01b3aef3, size: 277 bytes, params: 8, frame: 20
|
||||
let env0_0 = require;
|
||||
const closure = useIsPlanEligibleForGiftingPromotion;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_2 = importDefault(57) /* metro dependency 57 */;
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
|
||||
const env0_5 = (require(1880) /* metro dependency 1880: PremiumConstants */).SubscriptionPlans;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/gifting/utils/promotions/GiftingPromotionUtils.tsx');
|
||||
exports.useFetchClaimableGiftingPromotionRewardSkuIds = useFetchClaimableGiftingPromotionRewardSkuIds;
|
||||
exports.getRewardAssetIdMap = function(a0) {
|
||||
var Map = global.Map;
|
||||
var value2 = new Map();
|
||||
var env0_0 = value2;
|
||||
a0.forEach(_fun61316);
|
||||
return value2;
|
||||
};
|
||||
exports.useShouldShowSelectFreeSkuStep = function(a0, a1, a2) {
|
||||
return a1 && useIsPlanEligibleForGiftingPromotion(a0) && (a2 != null && a2.length >= 1);
|
||||
};
|
||||
exports.useShouldAutoSelectGiftingPromotionReward = function(a0, a1, a2) {
|
||||
return a2 != null && a2.length === 1 && useIsPlanEligibleForGiftingPromotion(a0) && a1;
|
||||
};
|
||||
exports.useIsPlanEligibleForGiftingPromotion = closure;
|
||||
exports.createGradientStyle = createGradientStyle;
|
||||
exports.createBackgroundStyle = function(a0) {
|
||||
if (a0 != null) {
|
||||
return {'backgroundImage': null, 'backgroundSize': 'cover', 'backgroundPosition': 'center',
|
||||
'backgroundRepeat': 'no-repeat', backgroundImage: 'url(' + a0 + ')'};
|
||||
}
|
||||
};
|
||||
exports.combinePromotionStyles = combinePromotionStyles;
|
||||
exports.shouldShowGiftPromotionReminderNotice = shouldShowGiftPromotionReminderNotice;
|
||||
}
|
||||
|
||||
function useIsPlanEligibleForGiftingPromotion(a0) { // fn#61310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:154, offset: 0x01b3b008, size: 66 bytes, params: 2, frame: 13
|
||||
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
|
||||
const items2 = [PREMIUM_YEAR_TIER_2];
|
||||
const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
|
||||
items2[1] = PREMIUM_MONTH_TIER_2;
|
||||
return items2.includes(a0?.id);
|
||||
}
|
||||
|
||||
function useFetchClaimableGiftingPromotionRewardSkuIds() { // fn#61311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:435, offset: 0x01b3b04a, size: 209 bytes, params: 1, frame: 19
|
||||
const binding = env0_3;
|
||||
const [property, env0_0] = env0_2(binding.useState(), 2);
|
||||
const value = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore],
|
||||
function() {
|
||||
return PromotionsStore.getGiftPromotionRewardSkuIds();
|
||||
});
|
||||
const {purchases, hasPreviouslyFetched,
|
||||
fetchPurchasesError} = (require(7675) /* metro dependency 7675: useFetchCollectiblesCategoriesAndPurchases */).useFetchPurchases();
|
||||
const env0_5 = binding.useRef(false);
|
||||
binding.useEffect(_fun61313, [value, purchases, hasPreviouslyFetched, fetchPurchasesError]);
|
||||
return property;
|
||||
}
|
||||
|
||||
function getRewardAssetIdMap(a0) { // fn#61315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:879, offset: 0x01b3b1af, size: 54 bytes, params: 2, frame: 12
|
||||
const Map = global.Map;
|
||||
const map = new Map();
|
||||
a0.forEach(_fun61316);
|
||||
return map;
|
||||
}
|
||||
|
||||
function createGradientStyle(a0, a1) { // fn#61319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:1423, offset: 0x01b3b27b, size: 272 bytes, params: 3, frame: 21
|
||||
var r1;
|
||||
var r0;
|
||||
var r9;
|
||||
var r4;
|
||||
var r7;
|
||||
var r6;
|
||||
var r5;
|
||||
var reverse;
|
||||
var colorStops;
|
||||
var defaultAngle;
|
||||
var Array;
|
||||
var isArray;
|
||||
let value = a0;
|
||||
if (value != null) {
|
||||
r1 = a1 ?? ({});
|
||||
reverse = r1.reverse;
|
||||
r0 = reverse !== undefined && reverse;
|
||||
colorStops = r1.colorStops;
|
||||
defaultAngle = r1.defaultAngle;
|
||||
r9 = defaultAngle === undefined ? 78.98 : defaultAngle;
|
||||
Array = global.Array;
|
||||
isArray = Array.isArray;
|
||||
r4 = Reflect.apply(isArray, Array, [value]) ? value : value.gradient;
|
||||
Array = global.Array;
|
||||
isArray = Array.isArray;
|
||||
r7 = Reflect.apply(isArray, Array, [value]) || value.angle == null ? r9 : value.angle;
|
||||
r6 = r0 ? (r7 + 180) % 360 : r7;
|
||||
if (colorStops != null) {
|
||||
value = r4.map(function(a0, a1) {
|
||||
return '' + a0 + ' ' + colorStops[a1] + '%';
|
||||
});
|
||||
value = value.join(', ');
|
||||
r5 = value;
|
||||
} else {
|
||||
r5 = r4.join(', ');
|
||||
}
|
||||
return {background: 'linear-gradient(' + r6 + 'deg, ' + r5 + ')'};
|
||||
}
|
||||
}
|
||||
|
||||
function combinePromotionStyles(a0, a1) { // fn#61322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:1992, offset: 0x01b3b3ff, size: 153 bytes, params: 3, frame: 17
|
||||
const value = a0;
|
||||
const value2 = a1;
|
||||
if (value != null) {
|
||||
if (value2 != null) {
|
||||
value.backgroundImage = '' + value.backgroundImage + ', ' + value2.background;
|
||||
value.backgroundColor = 'lightgray';
|
||||
value.backgroundRepeat = 'no-repeat, no-repeat';
|
||||
if (value.backgroundSize == null) {
|
||||
value.backgroundSize = 'auto 110%, auto';
|
||||
}
|
||||
if (value.backgroundPosition == null) {
|
||||
value.backgroundPosition = 'right 90% center, 0% 0%';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return value ?? (value2 ?? ({}));
|
||||
}
|
||||
|
||||
function shouldShowGiftPromotionReminderNotice() { // fn#61323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:2410, offset: 0x01b3b498, size: 299 bytes, params: 1, frame: 19
|
||||
var id;
|
||||
var r1;
|
||||
var r0;
|
||||
var giftPromotion;
|
||||
var value5;
|
||||
var moduleValue;
|
||||
const DismissibleContent = (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent;
|
||||
var isDismissed;
|
||||
var value;
|
||||
const value2 = undefined;
|
||||
const GiftPromotionReminderExperiment = (require(7676) /* metro dependency 7676: GiftPromotionReminderExperiment */).GiftPromotionReminderExperiment;
|
||||
const getConfig = GiftPromotionReminderExperiment.getConfig;
|
||||
if (Reflect.apply(getConfig, GiftPromotionReminderExperiment,
|
||||
[{location: 'shouldShowGiftPromotionReminderNotice'}]).enabled) {
|
||||
if (PromotionsStore.getMarketingComponentByType((require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType.GIFT_REMINDER_NAGBAR) == null) {
|
||||
return false;
|
||||
}
|
||||
giftPromotion = PromotionsStore.getGiftPromotion();
|
||||
id = giftPromotion == null ? value2 : giftPromotion.id;
|
||||
value5 = id != null;
|
||||
if (value5) {
|
||||
moduleValue = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
|
||||
isDismissed = moduleValue.UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_DESKTOP_FIRST_TIME_COACHMARK,
|
||||
|
||||
|
||||
id).isDismissed;
|
||||
if (isDismissed) {
|
||||
value = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
|
||||
value = !value.UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_REMINDER,
|
||||
|
||||
|
||||
id).isDismissed;
|
||||
r1 = value;
|
||||
} else {
|
||||
r1 = !!isDismissed;
|
||||
}
|
||||
r0 = r1;
|
||||
} else {
|
||||
r0 = value5;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function _fun61313() { // fn#61313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:740, offset: 0x01b3b12e, size: 101 bytes, params: 1, frame: 13
|
||||
if (hasPreviouslyFetched) {
|
||||
if (!env0_5.current) {
|
||||
if (env0_1.length > 0) {
|
||||
env0_0(fetchPurchasesError == null ? env0_1.filter(_fun61314) : []);
|
||||
env0_5.current = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _fun61316({skuId, assetId}) { // fn#61316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:943, offset: 0x01b3b1e5, size: 34 bytes, params: 2, frame: 13
|
||||
return env0_0.set(skuId, assetId);
|
||||
}
|
||||
|
||||
function _fun61314(a0) { // fn#61314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:799, offset: 0x01b3b193, size: 28 bytes, params: 2, frame: 11
|
||||
const value = environment.__proto__;
|
||||
return purchases.get(a0) == null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user