decord/source/modules/quests/native/QuestProgressBottomSheet.tsx

333 lines
13 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 16382
// Function ID: 16383
2026-07-20 16:05:17 +00:00
// Name: contextMenuButton
2026-08-25 06:04:03 +00:00
// Dependencies: [5, 19, 17, 10677, 7305, 5268, 9915, 21, 4380, 712, 589, 11336, 5271, 7896, 8752, 1236, 4952, 5840, 7328, 10837, 10531, 11333, 14572, 10681, 4347, 11326, 9070, 10552, 5503, 5374, 4826, 691, 11329, 9241, 14602, 4813, 4376, 4815, 14568, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 16382 (contextMenuButton)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import IconButton from "IconButton" /* 7896 */;
import registerAssetDefault from "registerAsset" /* 8752 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-08-25 06:04:03 +00:00
import closure_7 from "map" /* 10677 */;
import closure_8 from "initializeState" /* 7305 */;
import { QuestsExperimentLocations } from "QuestsExperimentLocations" /* 5268 */;
import { ActivityPanelModes } from "ActivityPanelModes" /* 9915 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function contextMenuButton(arg0) {
const obj = {};
const merged = Object.assign(arg0);
2026-08-24 06:08:38 +00:00
obj.icon = registerAssetDefault;
2026-07-29 08:29:29 +00:00
obj.variant = "secondary-overlay";
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj.accessibilityLabel = intl.string(getSystemLocale.t["UKOtz+"]);
2026-07-29 08:29:29 +00:00
obj.size = "sm";
2026-08-24 06:08:38 +00:00
return callback2(IconButton.IconButton, obj);
2026-07-20 16:05:17 +00:00
}
function QuestProgressBottomSheet(quest) {
quest = quest.quest;
2026-07-23 10:11:24 +00:00
claim = undefined;
2026-08-25 06:04:03 +00:00
let obj = quest(4952);
2026-07-20 16:05:17 +00:00
const isScreenLandscape = obj.useIsScreenLandscape();
2026-07-29 08:29:29 +00:00
const tmp4 = callback3(isScreenLandscape);
2026-08-25 06:04:03 +00:00
obj1 = quest(5840);
let obj2 = quest(7328);
2026-07-20 16:05:17 +00:00
const getOrFetchApplication = obj1.useGetOrFetchApplication(obj2.getActivityApplicationId(quest));
let id;
2026-07-29 08:29:29 +00:00
if (getOrFetchApplication != null) {
2026-07-20 16:05:17 +00:00
id = getOrFetchApplication.id;
}
2026-08-25 06:04:03 +00:00
const url = claim(10837)({ applicationId: id, size: 600, names: ["embedded_cover"] }).url;
let tmpResult = tmp(10531);
2026-07-29 08:29:29 +00:00
const questTaskDetails = tmpResult.useQuestTaskDetails(quest);
const intl = tmp(1236).intl;
2026-07-20 16:05:17 +00:00
obj = { questName: quest.config.messages.questName };
2026-08-25 06:04:03 +00:00
const tmp7 = claim(10837);
tmpResult = tmp(11333);
obj = { quest, taskDetails: questTaskDetails, location: QuestsExperimentLocations.QUEST_ACTIVITY_BOTTOM_SHEET, sourceQuestContent: tmp(5271).QuestContent.RUNNING_ACTIVITY };
2026-07-20 16:05:17 +00:00
const userStatus = quest.userStatus;
let completedAt;
2026-07-29 08:29:29 +00:00
const questsInstructionsToWinReward = tmpResult.useQuestsInstructionsToWinReward(obj);
if (userStatus != null) {
2026-07-20 16:05:17 +00:00
completedAt = userStatus.completedAt;
}
2026-07-29 08:29:29 +00:00
let tmp14 = null != completedAt;
if (tmp14) {
2026-07-20 16:05:17 +00:00
const userStatus2 = quest.userStatus;
let claimedAt;
2026-07-29 08:29:29 +00:00
if (userStatus2 != null) {
2026-07-20 16:05:17 +00:00
claimedAt = userStatus2.claimedAt;
}
2026-07-29 08:29:29 +00:00
tmp14 = null == claimedAt;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const formatToPlainStringResult = intl.formatToPlainString(quest(1236).t.EAYZAr, obj);
const tmp11 = QuestsExperimentLocations;
2026-08-25 06:04:03 +00:00
const isQuestAccessSuspended = quest(10531).useIsQuestAccessSuspended();
const tmpResult1 = quest(10531);
obj1 = { quest, questContent: tmp(5271).QuestContent.RUNNING_ACTIVITY, sourceQuestContent: tmp(5271).QuestContent.RUNNING_ACTIVITY };
const questRewardClaimHandler = quest(14572).useQuestRewardClaimHandler(obj1);
2026-07-20 16:05:17 +00:00
({ isClaiming, claim } = questRewardClaimHandler);
const items = [claim];
const items1 = [quest.id];
2026-07-29 08:29:29 +00:00
callback = React.useCallback(callback(function*() {
2026-08-07 06:50:47 +00:00
if (c3 === 2) {
c3 = 3;
2026-07-29 08:29:29 +00:00
HermesBuiltin.throwTypeError();
2026-08-07 06:50:47 +00:00
} else if (tmp4 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-25 06:04:03 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
}
} else {
try {
2026-08-07 06:50:47 +00:00
c3 = 2;
if (0 === table) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
2026-08-07 06:50:47 +00:00
c3 = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-08-07 06:50:47 +00:00
c3 = 3;
2026-07-29 08:29:29 +00:00
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp5;
2026-08-07 06:50:47 +00:00
let mainFrame = tmp2;
mainFrame = undefined;
2026-07-29 08:29:29 +00:00
table = 1;
2026-08-07 06:50:47 +00:00
c3 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = closure_1_1();
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (arg0 === 1) {
2026-08-07 06:50:47 +00:00
c3 = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-08-07 06:50:47 +00:00
c3 = 3;
2026-07-29 08:29:29 +00:00
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
if (arg1) {
2026-08-24 06:08:38 +00:00
mainFrame = closure_1_7.getMainFrame();
2026-08-07 06:50:47 +00:00
if (null != mainFrame) {
2026-08-24 06:08:38 +00:00
obj = closure_1_1(table[23]);
obj.updateFramePanelMode(closure_1_0.id, closure_1_10.PIP);
2026-08-07 06:50:47 +00:00
}
2026-07-29 08:29:29 +00:00
}
2026-08-07 06:50:47 +00:00
c3 = 3;
2026-08-25 06:04:03 +00:00
return { value: "HermesInternal", done: "HermesInternal" };
2026-07-29 08:29:29 +00:00
}
2026-08-07 06:50:47 +00:00
} catch (tmp19) {
c3 = tmp;
throw tmp19;
2026-07-29 08:29:29 +00:00
}
}
}), items);
2026-07-20 16:05:17 +00:00
let callback1 = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
let obj = claim(closure_1_2[24]);
2026-07-20 16:05:17 +00:00
obj.hideActionSheet();
2026-08-24 06:08:38 +00:00
const mainFrame = closure_1_7.getMainFrame();
2026-08-07 06:50:47 +00:00
if (null != mainFrame) {
2026-08-24 06:08:38 +00:00
claim(tmp2[23]).updateFramePanelMode(mainFrame.id, closure_1_10.PIP);
2026-08-07 06:50:47 +00:00
const tmpResult = claim(tmp2[23]);
}
obj = { scrollToQuestId: quest.id, fromContent: quest(tmp2[12]).QuestContent.QUEST_BOTTOM_SHEET };
2026-08-24 06:08:38 +00:00
quest(closure_1_2[25]).openQuestHome(obj);
2026-07-20 16:05:17 +00:00
}, items1);
const items2 = [quest.id];
const callback2 = React.useCallback(() => {
2026-08-24 06:08:38 +00:00
let obj = claim(closure_1_2[24]);
2026-07-20 16:05:17 +00:00
obj.hideActionSheet();
2026-07-29 08:29:29 +00:00
obj = { message: null };
2026-08-24 06:08:38 +00:00
const obj2 = quest(closure_1_2[26]);
obj[0] = quest(closure_1_2[27]).getQuestUrl(quest.id);
2026-07-20 16:05:17 +00:00
obj2.showShareActionSheet(obj);
}, items2);
2026-07-29 08:29:29 +00:00
callback3 = React.useCallback(() => {
2026-08-07 06:50:47 +00:00
claim(table[24]).hideActionSheet();
2026-07-20 16:05:17 +00:00
}, []);
2026-07-29 08:29:29 +00:00
obj2 = { style: tmp4.heroContainer, children: null };
2026-08-07 06:50:47 +00:00
let tmp24 = null != url;
if (tmp24) {
2026-07-29 08:29:29 +00:00
const obj3 = { source: null, style: null };
const obj4 = { uri: null };
obj4[0] = url;
obj3[0] = obj4;
obj3[1] = tmp4.heroImg;
2026-08-25 06:04:03 +00:00
tmp24 = callback2(tmp6(5374), obj3);
2026-07-20 16:05:17 +00:00
}
2026-08-07 06:50:47 +00:00
const items3 = [tmp24, , , ];
2026-07-29 08:29:29 +00:00
const obj5 = { style: tmp4.heroGradient, start: null, end: null, colors: null };
2026-08-25 06:04:03 +00:00
let tmp6Result = tmp6(4826);
2026-07-29 08:29:29 +00:00
obj5[1] = quest(691).VerticalGradient.START;
obj5[2] = quest(691).VerticalGradient.END;
const items4 = ["rgba(0, 0, 0, 0)", callback4().gradientEnd];
obj5[3] = items4;
items3[1] = callback2(tmp6Result, obj5);
const obj6 = { style: tmp4.gameTileContainer, children: null };
const obj7 = { quest, height: null, width: null };
let num = 80;
2026-07-20 16:05:17 +00:00
let num2 = 80;
2026-08-25 06:04:03 +00:00
tmp6Result = tmp6(11329);
2026-07-20 16:05:17 +00:00
if (isScreenLandscape) {
2026-07-29 08:29:29 +00:00
num2 = 56;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj7[1] = num2;
2026-07-20 16:05:17 +00:00
if (isScreenLandscape) {
2026-07-29 08:29:29 +00:00
num = 56;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj7[2] = num;
obj6[1] = callback2(tmp6Result, obj7);
items3[2] = callback2(closure_5, obj6);
const obj8 = { style: tmp4.contextMenuContainer, children: null };
2026-08-25 06:04:03 +00:00
const obj9 = { icon: claim(9241), onPress: callback2, variant: "secondary-overlay", size: "sm", accessibilityLabel: null };
2026-07-29 08:29:29 +00:00
const intl2 = tmp(1236).intl;
obj9[4] = intl2.string(quest(1236).t.RDE0Sc);
2026-08-25 06:04:03 +00:00
const items5 = [callback2(quest(7896).IconButton, obj9), ];
2026-07-29 08:29:29 +00:00
const obj10 = { quest, showShareLink: true, location: tmp11.QUEST_ACTIVITY_BOTTOM_SHEET, sourceQuestContent: null, children: null };
2026-08-25 06:04:03 +00:00
const tmpResult2 = quest(14572);
obj10[3] = quest(5271).QuestContent.RUNNING_ACTIVITY;
2026-07-29 08:29:29 +00:00
obj10[4] = contextMenuButton;
2026-08-25 06:04:03 +00:00
items5[1] = callback2(claim(14602), obj10);
2026-07-29 08:29:29 +00:00
obj8[1] = items5;
2026-08-07 06:50:47 +00:00
items3[3] = closure_12(closure_5, obj8);
2026-07-29 08:29:29 +00:00
obj2[1] = items3;
2026-08-07 06:50:47 +00:00
const items6 = [closure_12(closure_5, obj2), ];
2026-07-29 08:29:29 +00:00
const obj11 = { style: tmp4.contentContainer, children: null };
2026-08-24 06:08:38 +00:00
const obj12 = { direction: "vertical", spacing: claim(712).space.PX_8, style: tmp4.textContainer, children: null };
2026-07-20 16:05:17 +00:00
let str = "heading-lg/bold";
if (isScreenLandscape) {
str = "heading-md/bold";
}
2026-08-25 06:04:03 +00:00
const items7 = [callback2(quest(4376).Text, { variant: str, color: "mobile-text-heading-primary", children: formatToPlainStringResult }), ];
2026-07-29 08:29:29 +00:00
const obj13 = { style: tmp4.questDescription, variant: null, color: "text-muted", children: null };
2026-07-20 16:05:17 +00:00
let str2 = "text-md/normal";
if (isScreenLandscape) {
str2 = "text-sm/normal";
}
2026-07-29 08:29:29 +00:00
obj13[1] = str2;
obj13[3] = questsInstructionsToWinReward;
2026-08-25 06:04:03 +00:00
items7[1] = callback2(quest(4376).Text, obj13);
2026-07-29 08:29:29 +00:00
obj12[3] = items7;
2026-08-25 06:04:03 +00:00
const items8 = [closure_12(quest(4813).Stack, obj12), ];
2026-08-24 06:08:38 +00:00
const obj14 = { direction: "vertical", spacing: claim(712).space.PX_12, style: tmp4.buttonsContainer, children: null };
2026-07-29 08:29:29 +00:00
const intl3 = tmp(1236).intl;
const t = tmp(1236).t;
2026-08-07 06:50:47 +00:00
const obj15 = { size: "lg", text: intl3.string(tmp14 ? t.cfY4PE : t.LLLLPD), onPress: null, loading: null, grow: true, disabled: null, onPressDisabled: null };
2026-07-29 08:29:29 +00:00
if (tmp14) {
2026-07-20 16:05:17 +00:00
callback1 = callback;
}
2026-07-29 08:29:29 +00:00
obj15[2] = callback1;
2026-07-20 16:05:17 +00:00
if (!isClaiming) {
isClaiming = questRewardClaimHandler.isLoading;
}
2026-07-29 08:29:29 +00:00
obj15[3] = isClaiming;
2026-08-07 06:50:47 +00:00
let tmp30 = isQuestAccessSuspended;
if (isQuestAccessSuspended) {
tmp30 = tmp14;
}
obj15[5] = tmp30;
let tmp6Result2;
if (isQuestAccessSuspended) {
if (tmp14) {
2026-08-25 06:04:03 +00:00
tmp6Result2 = tmp6(14568);
2026-08-07 06:50:47 +00:00
}
}
const obj16 = { handleDisabled: true, startExpanded: true, children: null };
obj15[6] = tmp6Result2;
2026-08-25 06:04:03 +00:00
const items9 = [callback2(quest(4815).Button, obj15), ];
2026-07-29 08:29:29 +00:00
const obj17 = { size: "lg", text: null, onPress: null, variant: "secondary", grow: true };
const intl4 = tmp(1236).intl;
obj17[1] = intl4.string(quest(1236).t.cpT0Cq);
obj17[2] = callback3;
2026-08-25 06:04:03 +00:00
items9[1] = callback2(quest(4815).Button, obj17);
2026-07-29 08:29:29 +00:00
obj14[3] = items9;
2026-08-25 06:04:03 +00:00
items8[1] = closure_12(quest(4813).Stack, obj14);
2026-07-29 08:29:29 +00:00
obj11[1] = items8;
2026-08-07 06:50:47 +00:00
items6[1] = closure_12(closure_5, obj11);
2026-07-29 08:29:29 +00:00
obj16[2] = items6;
2026-08-25 06:04:03 +00:00
return closure_12(quest(5503).BottomSheet, obj16);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ View: c5, StyleSheet: closure_6 } = get_ActivityIndicator);
2026-08-07 06:50:47 +00:00
({ jsx: unpackModuleId, jsxs: closure_12 } = jsxProd);
let closure_13 = createCacheKey.createStyles((arg0) => {
2026-07-29 08:29:29 +00:00
let obj = { contentContainer: null, heroContainer: null, heroImg: null, heroGradient: null, gameTileContainer: null, contextMenuContainer: null, textContainer: null, questDescription: null, buttonsContainer: null };
2026-08-24 06:08:38 +00:00
obj = { display: "flex", paddingHorizontal: ThemesDefault.space.PX_16, paddingBottom: ThemesDefault.space.PX_16 };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
2026-07-20 16:05:17 +00:00
let num = 140;
if (arg0) {
num = 125;
}
2026-07-29 08:29:29 +00:00
obj = { height: num, position: "relative", marginBottom: null };
2026-07-20 16:05:17 +00:00
let num2 = 0;
if (!arg0) {
2026-07-29 08:29:29 +00:00
num2 = 52 + tmp(712).space.PX_8;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = num2;
obj[1] = obj;
2026-08-24 06:08:38 +00:00
obj1 = { resizeMode: "cover" };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(closure_6.absoluteFillObject);
2026-08-24 06:08:38 +00:00
obj1.borderTopLeftRadius = ThemesDefault.radii.lg;
obj1.borderTopRightRadius = ThemesDefault.radii.lg;
2026-07-29 08:29:29 +00:00
obj[2] = obj1;
2026-07-20 16:05:17 +00:00
const obj2 = {};
const merged1 = Object.assign(closure_6.absoluteFillObject);
2026-08-24 06:08:38 +00:00
obj2.borderTopLeftRadius = ThemesDefault.radii.lg;
obj2.borderTopRightRadius = ThemesDefault.radii.lg;
2026-07-29 08:29:29 +00:00
obj[3] = obj2;
2026-07-20 16:05:17 +00:00
let num4 = -52;
if (arg0) {
2026-07-29 08:29:29 +00:00
num4 = tmp(712).space.PX_12;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[4] = { position: "absolute", bottom: num4, left: 0, right: 0, alignItems: "center" };
2026-08-24 06:08:38 +00:00
obj[5] = { position: "absolute", top: ThemesDefault.space.PX_16, right: ThemesDefault.space.PX_16, display: "flex", flexDirection: "row", gap: ThemesDefault.space.PX_16, alignItems: "center" };
2026-07-20 16:05:17 +00:00
let PX_16;
if (!arg0) {
2026-07-29 08:29:29 +00:00
PX_16 = tmp(712).space.PX_16;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const obj3 = { position: "absolute", top: ThemesDefault.space.PX_16, right: ThemesDefault.space.PX_16, display: "flex", flexDirection: "row", gap: ThemesDefault.space.PX_16, alignItems: "center" };
obj[6] = { alignItems: "center", paddingTop: PX_16, gap: ThemesDefault.space.PX_8, marginBottom: ThemesDefault.space.PX_16, textAlign: "center" };
2026-07-29 08:29:29 +00:00
obj[7] = { textAlign: "center" };
2026-07-20 16:05:17 +00:00
let PX_161;
if (!arg0) {
2026-07-29 08:29:29 +00:00
PX_161 = tmp(712).space.PX_16;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[8] = { paddingTop: PX_161 };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-08-24 06:08:38 +00:00
let closure_14 = createCacheKey.createStyleProperties(() => ({ gradientEnd: ThemesDefault.colors.MOBILE_ACTIONSHEET_GRADIENT_BACKGROUND_DEFAULT }));
const result = require("set").fileFinishedImporting("modules/quests/native/QuestProgressBottomSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function QuestProgressBottomSheetConnected(questId) {
2026-07-23 10:11:24 +00:00
questId = questId.questId;
2026-07-29 08:29:29 +00:00
let stateFromStores;
let obj = questId(589);
2026-08-24 06:08:38 +00:00
const items = [closure_8];
stateFromStores = obj.useStateFromStores(items, () => closure_1_8.getQuest(questId));
2026-07-29 08:29:29 +00:00
let tmp4 = null;
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { overrideVisibility: true, questOrQuests: null, questContent: null, sourceQuestContent: null, children: null };
obj[1] = stateFromStores;
2026-08-25 06:04:03 +00:00
obj[2] = tmp(5271).QuestContent.RUNNING_ACTIVITY;
obj[3] = tmp(5271).QuestContent.RUNNING_ACTIVITY;
2026-07-29 08:29:29 +00:00
obj[4] = function children() {
2026-08-24 06:08:38 +00:00
return closure_1_11(closure_1_16, { quest: stateFromStores });
2026-07-20 16:05:17 +00:00
};
2026-08-25 06:04:03 +00:00
tmp4 = callback2(tmp(11336).QuestContentImpressionTrackerNative, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp4;
2026-07-20 16:05:17 +00:00
};