274 lines
7.3 KiB
TypeScript
274 lines
7.3 KiB
TypeScript
// Metro module 8517 (f8518).
|
|
import { GameGenres, Routes, SKUProductLines, SKUTypes } from "../Constants";
|
|
import { matchPath } from "../modules/routing/matchPathCompat";
|
|
import { intl, t } from "../intl/index.native";
|
|
import { nativePlatformTypeToSKUOperatingSystem } from "./StoreUtils";
|
|
import { getPlatform } from "./PlatformUtils";
|
|
import Module3771 from "../_bundle/Module3771";
|
|
let c5455_11;
|
|
let c5455_8 = {};
|
|
let c5455_9 = {};
|
|
let c5455_10 = Object.freeze({
|
|
ALL: -1,
|
|
...GameGenres
|
|
});
|
|
Object.keys(c5455_10).forEach((item) => {
|
|
const r8 = item.toLowerCase().replace(/_/g, "-");
|
|
const r10 = c5455_10[item];
|
|
c5455_8[r8] = r10;
|
|
c5455_9[r10] = r8;
|
|
});
|
|
c5455_11 = [["YYYY-MM-DD", "MMMM DD, Y"], ["YYYY-MM", "MMMM Y"], ["MM-DD", "MMMM DD"], ["MM", "MMMM"], ["YYYY", "Y"]];
|
|
export function getSKUIdFromURL(a0) {
|
|
const r14 = matchPath(a0, {
|
|
path: Routes.APPLICATION_STORE_LISTING_SKU(":skuId", ":slug")
|
|
});
|
|
return r14 != null ? r14.params.skuId : null;
|
|
}
|
|
export function getGenreURLSlugFromId(a0) {
|
|
return c5455_9[a0];
|
|
}
|
|
export function getGenreIdFromURLSlug(a0) {
|
|
return c5455_8[a0];
|
|
}
|
|
export function getGenreText(a0) {
|
|
if (GameGenres.ACTION === a0) {
|
|
return intl.string(t["1o2/IM"]);
|
|
}
|
|
if (GameGenres.ACTION_RPG === a0) {
|
|
return intl.string(t.e9Yo4H);
|
|
}
|
|
if (GameGenres.BRAWLER === a0) {
|
|
return intl.string(t.WCkEjT);
|
|
}
|
|
if (GameGenres.HACK_AND_SLASH === a0) {
|
|
return intl.string(t.xQ4VmK);
|
|
}
|
|
if (GameGenres.PLATFORMER === a0) {
|
|
return intl.string(t.WA3189);
|
|
}
|
|
if (GameGenres.STEALTH === a0) {
|
|
return intl.string(t["6UPFdw"]);
|
|
}
|
|
if (GameGenres.SURVIVAL === a0) {
|
|
return intl.string(t.SVPCt9);
|
|
}
|
|
if (GameGenres.ADVENTURE === a0) {
|
|
return intl.string(t["15p8on"]);
|
|
}
|
|
if (GameGenres.ACTION_ADVENTURE === a0) {
|
|
return intl.string(t.AxkUBp);
|
|
}
|
|
if (GameGenres.METROIDVANIA === a0) {
|
|
return intl.string(t.Iwr38m);
|
|
}
|
|
if (GameGenres.OPEN_WORLD === a0) {
|
|
return intl.string(t["2HRHJO"]);
|
|
}
|
|
if (GameGenres.PSYCHOLOGICAL_HORROR === a0) {
|
|
return intl.string(t["/IwK3s"]);
|
|
}
|
|
if (GameGenres.SANDBOX === a0) {
|
|
return intl.string(t["2+Vu4Q"]);
|
|
}
|
|
if (GameGenres.SURVIVAL_HORROR === a0) {
|
|
return intl.string(t.CCzRiK);
|
|
}
|
|
if (GameGenres.VISUAL_NOVEL === a0) {
|
|
return intl.string(t.FE7rnk);
|
|
}
|
|
if (GameGenres.DRIVING_RACING === a0) {
|
|
return intl.string(t.Erzgca);
|
|
}
|
|
if (GameGenres.VEHICULAR_COMBAT === a0) {
|
|
return intl.string(t.YQHhog);
|
|
}
|
|
if (GameGenres.MASSIVELY_MULTIPLAYER === a0) {
|
|
return intl.string(t["5CNg1o"]);
|
|
}
|
|
if (GameGenres.MMORPG === a0) {
|
|
return intl.string(t["c4NuO/"]);
|
|
}
|
|
if (GameGenres.ROLE_PLAYING === a0) {
|
|
return intl.string(t.yayVgs);
|
|
}
|
|
if (GameGenres.DUNGEON_CRAWLER === a0) {
|
|
return intl.string(t.qicemc);
|
|
}
|
|
if (GameGenres.ROGUELIKE === a0) {
|
|
return intl.string(t.zWzaCv);
|
|
}
|
|
if (GameGenres.SHOOTER === a0) {
|
|
return intl.string(t["+pk6sd"]);
|
|
}
|
|
if (GameGenres.LIGHT_GUN === a0) {
|
|
return intl.string(t.TDS96y);
|
|
}
|
|
if (GameGenres.SHOOT_EM_UP === a0) {
|
|
return intl.string(t.wltDUE);
|
|
}
|
|
if (GameGenres.FPS === a0) {
|
|
return intl.string(t.olTaq4);
|
|
}
|
|
if (GameGenres.DUAL_JOYSTICK_SHOOTER === a0) {
|
|
return intl.string(t["SN+NS3"]);
|
|
}
|
|
if (GameGenres.SIMULATION === a0) {
|
|
return intl.string(t.sxMPdm);
|
|
}
|
|
if (GameGenres.FLIGHT_SIMULATOR === a0) {
|
|
return intl.string(t["Q7msr+"]);
|
|
}
|
|
if (GameGenres.TRAIN_SIMULATOR === a0) {
|
|
return intl.string(t.ZtECf3);
|
|
}
|
|
if (GameGenres.LIFE_SIMULATOR === a0) {
|
|
return intl.string(t.byt5Fo);
|
|
}
|
|
if (GameGenres.FISHING === a0) {
|
|
return intl.string(t.BKwiwY);
|
|
}
|
|
if (GameGenres.SPORTS === a0) {
|
|
return intl.string(t.O0B7XM);
|
|
}
|
|
if (GameGenres.BASEBALL === a0) {
|
|
return intl.string(t["jPYb/z"]);
|
|
}
|
|
if (GameGenres.BASKETBALL === a0) {
|
|
return intl.string(t["o+D1Bm"]);
|
|
}
|
|
if (GameGenres.BILLIARDS === a0) {
|
|
return intl.string(t.PJ5o4E);
|
|
}
|
|
if (GameGenres.BOWLING === a0) {
|
|
return intl.string(t["82afJw"]);
|
|
}
|
|
if (GameGenres.BOXING === a0) {
|
|
return intl.string(t.DQvfei);
|
|
}
|
|
if (GameGenres.FOOTBALL === a0) {
|
|
return intl.string(t.slOYkj);
|
|
}
|
|
if (GameGenres.GOLF === a0) {
|
|
return intl.string(t.aeQPlG);
|
|
}
|
|
if (GameGenres.HOCKEY === a0) {
|
|
return intl.string(t.g7oe5X);
|
|
}
|
|
if (GameGenres.SKATEBOARDING_SKATING === a0) {
|
|
return intl.string(t.yBDEP0);
|
|
}
|
|
if (GameGenres.SNOWBOARDING_SKIING === a0) {
|
|
return intl.string(t.GVaAci);
|
|
}
|
|
if (GameGenres.SOCCER === a0) {
|
|
return intl.string(t.KPznxl);
|
|
}
|
|
if (GameGenres.TRACK_FIELD === a0) {
|
|
return intl.string(t["hJ62Q/"]);
|
|
}
|
|
if (GameGenres.SURFING_WAKEBOARDING === a0) {
|
|
return intl.string(t.PSh0CV);
|
|
}
|
|
if (GameGenres.WRESTLING === a0) {
|
|
return intl.string(t["3y9hAT"]);
|
|
}
|
|
if (GameGenres.STRATEGY === a0) {
|
|
return intl.string(t.KovTD8);
|
|
}
|
|
if (GameGenres.FOUR_X === a0) {
|
|
return intl.string(t["19h4dX"]);
|
|
}
|
|
if (GameGenres.ARTILLERY === a0) {
|
|
return intl.string(t.sBqLsP);
|
|
}
|
|
if (GameGenres.RTS === a0) {
|
|
return intl.string(t.yS4ddj);
|
|
}
|
|
if (GameGenres.TOWER_DEFENSE === a0) {
|
|
return intl.string(t.SULyIO);
|
|
}
|
|
if (GameGenres.TURN_BASED_STRATEGY === a0) {
|
|
return intl.string(t.VDsbru);
|
|
}
|
|
if (GameGenres.WARGAME === a0) {
|
|
return intl.string(t.YDCIrO);
|
|
}
|
|
if (GameGenres.MOBA === a0) {
|
|
return intl.string(t.i1m1t8);
|
|
}
|
|
if (GameGenres.FIGHTING === a0) {
|
|
return intl.string(t.KepcSI);
|
|
}
|
|
if (GameGenres.PUZZLE === a0) {
|
|
return intl.string(t.rm7Ggs);
|
|
}
|
|
if (GameGenres.CARD_GAME === a0) {
|
|
return intl.string(t.kX85vy);
|
|
}
|
|
if (GameGenres.EDUCATION === a0) {
|
|
return intl.string(t.klIi67);
|
|
}
|
|
if (GameGenres.FITNESS === a0) {
|
|
return intl.string(t.GOaaFb);
|
|
}
|
|
if (GameGenres.GAMBLING === a0) {
|
|
return intl.string(t["X8/Ee9"]);
|
|
}
|
|
if (GameGenres.MUSIC_RHYTHM === a0) {
|
|
return intl.string(t.qPgrgw);
|
|
}
|
|
if (GameGenres.PARTY_MINI_GAME === a0) {
|
|
return intl.string(t.diBclF);
|
|
}
|
|
if (GameGenres.PINBALL === a0) {
|
|
return intl.string(t["1+ottx"]);
|
|
}
|
|
if (GameGenres.TRIVIA_BOARD_GAME === a0) {
|
|
return intl.string(t.aLlxjC);
|
|
}
|
|
if (GameGenres.TACTICAL === a0) {
|
|
return intl.string(t.LRPgbt);
|
|
}
|
|
if (GameGenres.INDIE === a0) {
|
|
return intl.string(t.hz9Xvj);
|
|
}
|
|
if (GameGenres.ARCADE === a0) {
|
|
return intl.string(t.Sbxowr);
|
|
}
|
|
if (GameGenres.POINT_AND_CLICK === a0) {
|
|
return intl.string(t.vcerEn);
|
|
}
|
|
return intl.string(t["9b4eUr"]);
|
|
}
|
|
export function canUserInstall(a0) {
|
|
const r12 = nativePlatformTypeToSKUOperatingSystem(getPlatform());
|
|
return a0.type === SKUTypes.DURABLE_PRIMARY && r12 != null && a0.supportedOperatingSystems.includes(r12);
|
|
}
|
|
export function getReadablePreorderReleaseDate({ preorderReleaseAt, preorderApproximateReleaseDate }) {
|
|
if (preorderReleaseAt != null) {
|
|
return preorderReleaseAt.format("MMMM DD");
|
|
}
|
|
if (preorderApproximateReleaseDate == null) {
|
|
return null;
|
|
}
|
|
const length = c5455_11.length;
|
|
let r0 = 0;
|
|
if (0 < length) {
|
|
do {
|
|
const [r14, r20] = c5455_11[r0];
|
|
const r24 = Module3771(preorderApproximateReleaseDate, r14, true);
|
|
const isValid = r24.isValid();
|
|
const r1 = r0;
|
|
if (isValid) {
|
|
return r24.format(r20);
|
|
}
|
|
r0 = r1 + 1;
|
|
} while (r0 < c5455_11.length);
|
|
}
|
|
return preorderApproximateReleaseDate;
|
|
}
|
|
export function isThirdPartySKU(a0) {
|
|
return a0 === SKUProductLines.SOCIAL_LAYER_GAME_ITEM;
|
|
}
|