144 lines
5 KiB
TypeScript
144 lines
5 KiB
TypeScript
// Module ID: 12865
|
|
// Function ID: 12866
|
|
// Name: canFetchNitroProgramReward
|
|
// Dependencies: [1874, 1876, 3678, 12866, 12869, 6909, 12870, 3901, 2]
|
|
// Exports: canFetchAnyProgramReward, canFetchNitroProgramReward, canFetchXboxProgramReward, hasNecessaryPremiumSubscriptionStatus, isEligibleForProgramReward, isProgramRewardStale, useIsEligibleForProgramReward
|
|
|
|
// Module 12865 (canFetchNitroProgramReward)
|
|
import mergeGuildAvatar from "mergeGuildAvatar";
|
|
import { PremiumTypes } from "GuildFeatures";
|
|
|
|
const require = arg1;
|
|
function canFetchNitroProgramReward(canUseMonthlyOrbs) {
|
|
let str = canUseMonthlyOrbs;
|
|
if (canUseMonthlyOrbs === undefined) {
|
|
str = "ProgramRewardsUtils";
|
|
}
|
|
const NITRO = require(12866) /* RewardProgram */.RewardProgram.NITRO;
|
|
if (str === undefined) {
|
|
str = "ProgramRewardsUtils";
|
|
}
|
|
if (require(12866) /* RewardProgram */.RewardProgram.NITRO === NITRO) {
|
|
let tmpResult = tmp(12869);
|
|
let flag = tmpResult.getPremiumRewardsOrbsExperiment(str).isInTreatment;
|
|
} else {
|
|
flag = false;
|
|
if (tmp(12866).RewardProgram.XBOX === NITRO) {
|
|
tmpResult = tmp(6909);
|
|
flag = tmpResult.getIsCrepeEnabled(str);
|
|
}
|
|
}
|
|
if (flag) {
|
|
const currentUser = authStore.getCurrentUser();
|
|
flag = tmp(3901).isPremiumExactly(currentUser, PremiumTypes.TIER_2);
|
|
const tmpResult1 = tmp(3901);
|
|
}
|
|
return flag;
|
|
}
|
|
function canFetchXboxProgramReward(canUseMonthlyOrbs) {
|
|
let str = canUseMonthlyOrbs;
|
|
if (canUseMonthlyOrbs === undefined) {
|
|
str = "ProgramRewardsUtils";
|
|
}
|
|
const XBOX = require(12866) /* RewardProgram */.RewardProgram.XBOX;
|
|
if (str === undefined) {
|
|
str = "ProgramRewardsUtils";
|
|
}
|
|
if (require(12866) /* RewardProgram */.RewardProgram.NITRO === XBOX) {
|
|
let tmpResult = tmp(12869);
|
|
let flag = tmpResult.getPremiumRewardsOrbsExperiment(str).isInTreatment;
|
|
} else {
|
|
flag = false;
|
|
if (tmp(12866).RewardProgram.XBOX === XBOX) {
|
|
tmpResult = tmp(6909);
|
|
flag = tmpResult.getIsCrepeEnabled(str);
|
|
}
|
|
}
|
|
if (flag) {
|
|
flag = tmp(12870).hasCrepeMonthlyOrbsPerk(authStore.getCurrentUser());
|
|
const tmpResult1 = tmp(12870);
|
|
}
|
|
return flag;
|
|
}
|
|
let closure_5 = { [arg1(12866).RewardProgram.NITRO]: canFetchNitroProgramReward, [arg1(12866).RewardProgram.XBOX]: canFetchXboxProgramReward };
|
|
const result = require("isPast").fileFinishedImporting("modules/rewards/ProgramRewardsUtils.tsx");
|
|
|
|
export const isProgramRewardStale = function isProgramRewardStale(next_reward_date) {
|
|
if (null == next_reward_date) {
|
|
return true;
|
|
} else {
|
|
next_reward_date = next_reward_date.next_reward_date;
|
|
let tmp = null != next_reward_date;
|
|
if (tmp) {
|
|
tmp = "" !== next_reward_date;
|
|
}
|
|
if (tmp) {
|
|
const _Date = Date;
|
|
const date = new Date(next_reward_date);
|
|
tmp = importDefault(3678)(date);
|
|
const tmp4 = importDefault(3678);
|
|
}
|
|
return tmp;
|
|
}
|
|
};
|
|
export const isEligibleForProgramReward = function isEligibleForProgramReward(arg0, canUseMonthlyOrbs) {
|
|
let str = canUseMonthlyOrbs;
|
|
if (canUseMonthlyOrbs === undefined) {
|
|
str = "ProgramRewardsUtils";
|
|
}
|
|
if (require(12866) /* RewardProgram */.RewardProgram.NITRO === arg0) {
|
|
let tmpResult = tmp(12869);
|
|
return tmpResult.getPremiumRewardsOrbsExperiment(str).isInTreatment;
|
|
} else if (tmp(12866).RewardProgram.XBOX === arg0) {
|
|
tmpResult = tmp(6909);
|
|
return tmpResult.getIsCrepeEnabled(str);
|
|
} else {
|
|
return false;
|
|
}
|
|
};
|
|
export const useIsEligibleForProgramReward = function useIsEligibleForProgramReward(arg0, location) {
|
|
let str = location;
|
|
if (location === undefined) {
|
|
str = "ProgramRewardsUtils";
|
|
}
|
|
const obj = require(12869) /* PremiumRewardsOrbsTreatment */;
|
|
const tmp = require;
|
|
const isCrepeEnabled = require(6909) /* apexExperiment */.useIsCrepeEnabled(str);
|
|
if (require(12866) /* RewardProgram */.RewardProgram.NITRO === arg0) {
|
|
return obj.usePremiumRewardsOrbsExperiment(str).isInTreatment;
|
|
} else if (tmp(12866).RewardProgram.XBOX === arg0) {
|
|
return isCrepeEnabled;
|
|
} else {
|
|
return false;
|
|
}
|
|
const obj2 = require(6909) /* apexExperiment */;
|
|
};
|
|
export { canFetchNitroProgramReward };
|
|
export { canFetchXboxProgramReward };
|
|
export const canFetchAnyProgramReward = function canFetchAnyProgramReward(ProgramRewardsStore) {
|
|
let str = ProgramRewardsStore;
|
|
if (ProgramRewardsStore === undefined) {
|
|
str = "ProgramRewardsUtils";
|
|
}
|
|
const values = Object.values(require(12866) /* RewardProgram */.RewardProgram);
|
|
for (const item10015 of values) {
|
|
if (typeof item10015 === "number") {
|
|
let tmp4 = dependencyMap;
|
|
let tmp5 = item10015;
|
|
if (dependencyMap[tmp2](str)) {
|
|
let tmp3 = obj;
|
|
obj.return();
|
|
let flag = true;
|
|
return true;
|
|
}
|
|
}
|
|
continue;
|
|
}
|
|
return false;
|
|
};
|
|
export const hasNecessaryPremiumSubscriptionStatus = function hasNecessaryPremiumSubscriptionStatus(currentUser) {
|
|
if (currentUser == null) {
|
|
currentUser = authStore.getCurrentUser();
|
|
}
|
|
return require(3901) /* getPremiumPlanItem */.isPremiumExactly(currentUser, PremiumTypes.TIER_2);
|
|
};
|