decord/source/modules/quests/native/VideoQuestModal/VideoQuestModalContentInProgress.tsx
2026-09-02 09:53:35 +00:00

661 lines
34 KiB
TypeScript

// Module ID: 14957
// Function ID: 14958
// Name: importDefaultResult1
// Dependencies: [32, 19, 17, 5395, 502, 21, 686, 709, 14958, 4478, 1234, 11142, 4217, 4479, 1627, 5561, 4204, 14960, 14975, 7805, 14976, 14954, 14977, 4926, 5076, 4474, 14978, 5501, 4928, 11152, 8015, 1233, 9767, 10894, 11303, 11332, 14923, 8584, 4940, 14980, 10893, 14857, 14855, 13000, 8813, 14953, 4445, 14981, 2008, 11306, 7477, 9012, 9013, 9017, 7456, 7483, 5398, 7473, 8647, 14982, 11557, 14983, 5402, 2]
// Module 14957 (importDefaultResult1)
import ThemesDefault from "Themes" /* 709 */;
import PressableBase from "PressableBase" /* 5076 */;
import closure_3 from "_slicedToArray" /* 32 */;
import importAllResult from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import { QuestsExperimentLocations } from "QuestsExperimentLocations" /* 5395 */;
import { ThemeTypes } from "sum" /* 502 */;
import jsxProd from "jsxProd" /* 21 */;
import importDefaultResult from "n" /* 686 */;
import alphaResult1 from "module_0" /* 0 */;
import alphaResult2 from "module_0" /* 0 */;
import createCacheKey from "createCacheKey" /* 4478 */;
require = arg1;
let c4 = importAllResult;
({ View: c5, StyleSheet: closure_6, ScrollView: error } = get_ActivityIndicator);
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
let closure_12 = { x: 0, y: 0 };
let closure_13 = { x: 0, y: 1 };
const importDefaultResultResult = importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23);
let items = [importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23).alpha(0.4).hex(), ];
const alphaResult = importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23).alpha(0.4);
const importDefaultResult1 = importDefaultResult;
const importDefaultResult1Result = importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23);
items[1] = require("module_0").hex();
const importDefaultResult2 = importDefaultResult;
const importDefaultResult2Result = importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23);
let items1 = [require("module_0").hex(), ];
const importDefaultResult3 = importDefaultResult;
const importDefaultResult3Result = importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23);
items1[1] = importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23).alpha(0.4).hex();
let closure_16 = { bottom: 158, top: 64, left: 16, right: 16 };
let closure_17 = { bottom: 16, left: 16, right: 16 };
let closure_18 = createCacheKey.createStyles((arg0) => {
let obj = { wrapper: null, wrapperPortrait: null, videoLandscape: null, videoLandscape9by16: null, landscapeContentScroll: null, landscapeContentScrollContent: null, videoLandscapeFullscreen: null, videoWrapper: null, videoWrapperLandscape: null, videoWrapperFullscreen: null, videoContentWrapper: null, videoContentWrapperLandscape: null, videoContentWrapperPortrait: null, rewardContainer: null, rewardContentCentered: null, modalBackground: null, questDetailsLandscape: null, questDetailsPrimary: null, questDetailsSecondary: null, footer: null, icon: null, iconDisabled: null, closeButtonLandscape: null, gradientTop: null, gradientBottom: null, textShadow: null, viewRewardBtn: null, playerThumbnail: null, cloudsBackground: null, questDetailsSubheader: null };
obj = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOWEST, flex: 1 };
obj[0] = obj;
obj = { borderTopLeftRadius: ThemesDefault.radii.lg, borderTopRightRadius: ThemesDefault.radii.lg, justifyContent: null };
let str = "center";
if (arg0) {
str = "flex-start";
}
obj[2] = str;
obj[1] = obj;
obj[2] = { width: "100%", position: "relative" };
obj[3] = { aspectRatio: 1.7777777777777777, flexShrink: 0 };
obj[4] = { flex: 1 };
obj[5] = { flexGrow: 1 };
obj[6] = { flexGrow: 1, flexShrink: 1 };
obj[7] = { borderRadius: ThemesDefault.radii.lg, flexGrow: 0, flexShrink: 0, overflow: "hidden" };
obj1 = { borderRadius: ThemesDefault.radii.lg, flexGrow: 0, flexShrink: 0, overflow: "hidden" };
obj[8] = { flexGrow: 1, borderTopLeftRadius: ThemesDefault.radii.none, borderTopRightRadius: ThemesDefault.radii.none };
const obj2 = { flexGrow: 1, borderTopLeftRadius: ThemesDefault.radii.none, borderTopRightRadius: ThemesDefault.radii.none };
obj[9] = { borderRadius: ThemesDefault.radii.none };
const obj3 = { borderRadius: ThemesDefault.radii.none };
obj[10] = { flexDirection: "column", pointerEvents: "box-none", flexGrow: 1, flexShrink: 0, justifyContent: "space-between", padding: ThemesDefault.space.PX_16 };
obj[11] = { padding: 0 };
const merged = Object.assign(closure_6.absoluteFillObject);
obj[12] = {};
obj[13] = { justifyContent: "center", flexGrow: 1, flexShrink: 0 };
const obj4 = { flexDirection: "column", pointerEvents: "box-none", flexGrow: 1, flexShrink: 0, justifyContent: "space-between", padding: ThemesDefault.space.PX_16 };
const obj5 = {};
obj[14] = { position: "absolute", top: ThemesDefault.space.PX_16, left: ThemesDefault.space.PX_16, right: ThemesDefault.space.PX_16, bottom: ThemesDefault.space.PX_16, alignItems: "center", justifyContent: "center" };
const obj6 = { position: "absolute", top: ThemesDefault.space.PX_16, left: ThemesDefault.space.PX_16, right: ThemesDefault.space.PX_16, bottom: ThemesDefault.space.PX_16, alignItems: "center", justifyContent: "center" };
obj[15] = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOWEST };
const obj7 = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOWEST };
obj[16] = { borderTopWidth: 1, borderColor: ThemesDefault.colors.BACKGROUND_MOD_STRONG, paddingHorizontal: ThemesDefault.space.PX_16, paddingTop: ThemesDefault.space.PX_24 };
obj[17] = { flexGrow: 0, flexShrink: 1 };
obj[18] = { flexGrow: 0, flexShrink: 0 };
const obj8 = { borderTopWidth: 1, borderColor: ThemesDefault.colors.BACKGROUND_MOD_STRONG, paddingHorizontal: ThemesDefault.space.PX_16, paddingTop: ThemesDefault.space.PX_24 };
obj[19] = { paddingHorizontal: ThemesDefault.space.PX_16, paddingVertical: ThemesDefault.space.PX_8 };
const obj9 = { paddingHorizontal: ThemesDefault.space.PX_16, paddingVertical: ThemesDefault.space.PX_8 };
obj[20] = { color: ThemesDefault.colors.INTERACTIVE_TEXT_ACTIVE };
const obj10 = { color: ThemesDefault.colors.INTERACTIVE_TEXT_ACTIVE };
obj[21] = { color: ThemesDefault.colors.INTERACTIVE_TEXT_DEFAULT };
const obj11 = { color: ThemesDefault.colors.INTERACTIVE_TEXT_DEFAULT };
obj[22] = { position: "absolute", top: ThemesDefault.space.PX_16, left: ThemesDefault.space.PX_16 };
const obj13 = {};
const merged1 = Object.assign(closure_6.absoluteFillObject);
obj13.bottom = undefined;
obj13.height = 70;
obj[23] = obj13;
const obj14 = {};
const merged2 = Object.assign(closure_6.absoluteFillObject);
obj14.top = undefined;
obj14.height = 150;
obj[24] = obj14;
const obj12 = { position: "absolute", top: ThemesDefault.space.PX_16, left: ThemesDefault.space.PX_16 };
obj[25] = { margin: -15, padding: 15, textShadowColor: ThemesDefault.colors.BLACK, textShadowOffset: { width: 0, height: 0 }, textShadowRadius: 15 };
obj[26] = { marginRight: "auto" };
const obj15 = { margin: -15, padding: 15, textShadowColor: ThemesDefault.colors.BLACK, textShadowOffset: { width: 0, height: 0 }, textShadowRadius: 15 };
obj[27] = { borderRadius: ThemesDefault.radii.lg, height: 96, width: "100%" };
obj[28] = { zIndex: -1 };
obj[29] = { opacity: 0.6 };
return obj;
});
let closure_19 = { code: "function VideoQuestModalContentInProgressTsx1(){const{withDelay,LOGO_REWARD_TRANSITION_DELAY_MS,withTiming,isComponentMounted,LOGO_REWARD_TRANSITION_DURATION_MS}=this.__closure;return withDelay(LOGO_REWARD_TRANSITION_DELAY_MS,withTiming(isComponentMounted.get(),{duration:LOGO_REWARD_TRANSITION_DURATION_MS}));}" };
let closure_20 = { code: "function VideoQuestModalContentInProgressTsx2(){const{animation}=this.__closure;return{opacity:animation.get()};}" };
let closure_21 = { code: "function VideoQuestModalContentInProgressTsx3(){const{animation}=this.__closure;return{opacity:1-animation.get()};}" };
let closure_22 = { code: "function VideoQuestModalContentInProgressTsx4(){const{animation}=this.__closure;return{pointerEvents:animation.get()>0.3?'auto':'none'};}" };
let closure_23 = importAllResult.memo((quest) => {
quest = quest.quest;
({ handleAdvertiserDetailsPress, isFullscreen } = quest);
const setIsFullscreen = quest.setIsFullscreen;
({ sourceQuestContent, isShareable } = quest);
let callback;
let sharedValue;
let derivedValue;
let tmp2 = setIsFullscreen;
({ captionsEnabled, contentWidth, handleClose, handlePrimaryCtaPress, handleShareQuest, handleOpenTranscript, handleToggleCaptions, onNavigateToPostWatchVideo, onEnd, externallyPaused, hasCaptionAsset, hasTranscriptAsset } = quest);
let obj = quest(setIsFullscreen[10]);
const tmp3 = callback3(obj.isAndroid());
obj1 = importAllResult;
items = [quest];
const memo = importAllResult.useMemo(() => quest(setIsFullscreen[11]).getQuestAsset(quest, quest(setIsFullscreen[11]).QuestAssetType.HERO), items);
const userStatus = quest.userStatus;
let completedAt;
if (userStatus != null) {
completedAt = userStatus.completedAt;
}
let tmp25Result = null != completedAt;
[tmp8, c3] = callback(obj1.useState(null), 2);
callback = obj1.useCallback((nativeEvent) => {
_undefined(nativeEvent.nativeEvent.layout.height);
}, []);
const tmp7 = callback(obj1.useState(null), 2);
[num, c4] = callback(obj1.useState(null), 2);
let diff = null;
const callback1 = obj1.useCallback((nativeEvent) => {
_undefined2(isFullscreen(setIsFullscreen[7]).space.PX_24 + nativeEvent.nativeEvent.layout.height);
}, []);
if (null != tmp8) {
diff = tmp8 - 2 * isFullscreen(tmp2[7]).space.PX_16;
}
let str = "md";
let str2 = "md";
if (null != diff) {
str2 = str;
if (null != num) {
let str3 = "lg";
if (diff < tmp(tmp2[8]).QUEST_PROGRESS_DIAMETER_BY_SIZE.lg + num) {
if (diff >= tmp(tmp2[8]).QUEST_PROGRESS_DIAMETER_BY_SIZE["md-lg"] + num) {
str = "md-lg";
}
str3 = str;
}
str2 = str3;
}
}
const sum = tmp(tmp2[8]).QUEST_PROGRESS_DIAMETER_BY_SIZE.md + num;
const sum1 = sum + 2 * isFullscreen(tmp2[7]).space.PX_16;
let tmpResult = tmp(tmp2[12]);
sharedValue = tmpResult.useSharedValue(0);
items1 = [sharedValue];
const effect = obj1.useEffect(() => {
const result = sharedValue.set(1);
}, items1);
tmpResult = tmp(tmp2[12]);
function te() {
const obj = quest(setIsFullscreen[12]);
return obj.withDelay(3000, quest(setIsFullscreen[13]).withTiming(sharedValue.get(), { duration: 1000 }));
}
obj = { withDelay: tmp(tmp2[12]).withDelay, LOGO_REWARD_TRANSITION_DELAY_MS: 3000, withTiming: tmp(tmp2[13]).withTiming, isComponentMounted: sharedValue, LOGO_REWARD_TRANSITION_DURATION_MS: 1000 };
te.__closure = obj;
te.__workletHash = 12561024953493;
te.__initData = closure_19;
derivedValue = tmpResult.useDerivedValue(te);
const tmp10 = callback(obj1.useState(null), 2);
function ne() {
return { opacity: derivedValue.get() };
}
ne.__closure = { animation: derivedValue };
ne.__workletHash = 17463485679217;
ne.__initData = closure_20;
const animatedStyle = quest(tmp2[12]).useAnimatedStyle(ne);
const tmpResult1 = quest(tmp2[12]);
function se() {
return { opacity: 1 - derivedValue.get() };
}
se.__closure = { animation: derivedValue };
se.__workletHash = 9103187579788;
se.__initData = closure_21;
const animatedStyle1 = quest(tmp2[12]).useAnimatedStyle(se);
const tmpResult2 = quest(tmp2[12]);
function oe() {
let pointerEvents = "none";
if (derivedValue.get() > 0.3) {
pointerEvents = "auto";
}
return { pointerEvents };
}
oe.__closure = { animation: derivedValue };
oe.__workletHash = 11833431315705;
oe.__initData = closure_22;
const animatedProps = quest(tmp2[12]).useAnimatedProps(oe);
const tmp23 = isFullscreen(tmp2[14])();
const items2 = [isFullscreen, setIsFullscreen];
const callback2 = obj1.useCallback((arg0) => {
let tmp2 = isFullscreen;
if (!isFullscreen) {
tmp2 = "landscape" !== tmp;
}
let str2 = "PORTRAIT";
if (!tmp2) {
str2 = "LANDSCAPE";
}
setIsFullscreen("LANDSCAPE" === str2);
}, items2);
obj = { bottom: true, style: tmp3.wrapper, children: null };
const items3 = [, , ];
({ videoWrapper: arr4[0], videoWrapperLandscape: arr4[1] } = tmp3);
let videoWrapperFullscreen = isFullscreen;
if (isFullscreen) {
videoWrapperFullscreen = tmp3.videoWrapperFullscreen;
}
obj1 = { style: items3, children: null };
items3[2] = videoWrapperFullscreen;
const obj2 = { theme: ThemeTypes.DARKER, children: null };
const obj3 = { captionsEnabled, orientation: "landscape", style: null, contentInsets: null, handleOpenTranscript: null, handleToggleCaptions: null, isFullscreen: null, externallyPaused: null, onEnd: null, onToggleFullscreen: null, sourceQuestContent: null, hasCaptionAsset: null, hasTranscriptAsset: null };
const items4 = [tmp3.videoLandscape, , ];
let videoLandscape9by16 = !isFullscreen;
if (!isFullscreen) {
videoLandscape9by16 = tmp3.videoLandscape9by16;
}
items4[1] = videoLandscape9by16;
let videoLandscapeFullscreen = isFullscreen;
if (isFullscreen) {
videoLandscapeFullscreen = tmp3.videoLandscapeFullscreen;
}
items4[2] = videoLandscapeFullscreen;
obj3[2] = items4;
obj3[3] = closure_17;
obj3[4] = handleOpenTranscript;
obj3[5] = handleToggleCaptions;
obj3[6] = isFullscreen;
obj3[7] = externallyPaused;
obj3[8] = onEnd;
obj3[9] = callback2;
obj3[10] = sourceQuestContent;
obj3[11] = hasCaptionAsset;
obj3[12] = hasTranscriptAsset;
const items5 = [closure_10(quest(tmp2[17]).VideoQuestPlayer, obj3), ];
const obj4 = { onClose: handleClose, style: null };
const items6 = [tmp3.closeButtonLandscape, ];
let tmp29 = isFullscreen;
let tmp15Result = tmp15(tmp2[18]);
if (isFullscreen) {
tmp29 = null != tmp23;
}
if (tmp29) {
const obj5 = { left: null };
obj5[0] = tmp23.left;
tmp29 = obj5;
}
items6[1] = tmp29;
obj4[1] = items6;
items5[1] = closure_10(tmp15Result, obj4);
obj2[1] = items5;
const items7 = [closure_11(quest(tmp2[16]).ThemeContextProvider, obj2), ];
let tmp25Result1 = !isFullscreen;
if (!isFullscreen) {
const obj6 = { style: null, contentContainerStyle: null, showsVerticalScrollIndicator: false, alwaysBounceVertical: false, children: null };
({ landscapeContentScroll: obj15[0], landscapeContentScrollContent: obj15[1] } = tmp3);
const obj7 = { style: null, children: null };
const items8 = [, ];
({ videoContentWrapper: arr9[0], videoContentWrapperLandscape: arr9[1] } = tmp3);
obj7[0] = items8;
const obj8 = { style: null, onLayout: null, children: null };
const items9 = [tmp3.rewardContainer, ];
const obj9 = { minHeight: null };
obj9[0] = sum1;
items9[1] = obj9;
obj8[0] = items9;
obj8[1] = callback;
const obj10 = { style: null, animatedProps: null, children: null };
const items10 = [tmp3.rewardContentCentered, animatedStyle];
obj10[0] = items10;
obj10[1] = animatedProps;
tmp15Result = tmp15(tmp2[19]);
const obj11 = { size: null, onTextBlockLayout: null };
obj11[0] = str2;
obj11[1] = callback1;
obj10[2] = tmp25(tmp15(tmp2[20]), obj11);
const items11 = [tmp25(tmp15Result, obj10), ];
const items12 = [tmp3.rewardContentCentered, , ];
const tmp15Result1 = tmp15(tmp2[19]);
const tmp31 = closure_7;
const tmpResult4 = tmp(tmp2[10]);
const obj12 = { style: null, pointerEvents: "none", children: null };
items12[1] = tmp(tmp2[10]).isAndroid() && tmp3.modalBackground;
items12[2] = animatedStyle1;
obj12[0] = items12;
const tmp34 = tmp(tmp2[10]).isAndroid() && tmp3.modalBackground;
let isAndroidResult = tmp(tmp2[10]).isAndroid();
if (isAndroidResult) {
const obj13 = { align: "top", style: null };
obj13[1] = tmp3.cloudsBackground;
isAndroidResult = tmp25(tmp15(tmp2[21]), obj13);
}
const items13 = [isAndroidResult, ];
const obj14 = { assetUrl: null, maxHeight: 90, maxWidth: null };
const tmpResult5 = tmp(tmp2[10]);
const tmp15Result2 = tmp15(tmp2[22]);
obj14[0] = tmp(tmp2[11]).getQuestAsset(quest, tmp(tmp2[11]).QuestAssetType.LOGO_TYPE, "dark").url;
obj14[2] = contentWidth - 120;
items13[1] = tmp25(tmp15Result2, obj14);
obj12[2] = items13;
items11[1] = tmp26(tmp15Result1, obj12);
obj8[2] = items11;
const items14 = [tmp26(tmp27, obj8), , ];
const obj15 = { align: "top", style: null };
obj15[1] = tmp3.cloudsBackground;
items14[1] = tmp25(tmp15(tmp2[21]), obj15);
const obj16 = { direction: "vertical", spacing: null, style: null, children: null };
obj16[1] = tmp15(tmp2[7]).space.PX_24;
obj16[2] = tmp3.questDetailsLandscape;
const obj17 = { direction: "horizontal", justify: "space-between", spacing: null, children: null };
obj17[2] = tmp15(tmp2[7]).space.PX_8;
const obj18 = { style: null, onPress: null, children: null };
obj18[0] = tmp3.questDetailsPrimary;
obj18[1] = handleAdvertiserDetailsPress;
const obj19 = { variant: "heading-lg/semibold", color: "mobile-text-heading-primary", accessibilityRole: "header", children: null };
obj19[3] = quest.config.messages.gameTitle;
const items15 = [tmp25(tmp(tmp2[25]).Text, obj19), ];
const obj20 = { variant: "heading-sm/semibold", color: "text-subtle", children: null };
obj20[2] = quest.config.messages.gamePublisher;
items15[1] = tmp25(tmp(tmp2[25]).Text, obj20);
obj18[2] = items15;
const items16 = [tmp26(tmp(tmp2[24]).PressableOpacity, obj18), ];
const obj21 = { style: null, children: null };
obj21[0] = tmp3.questDetailsSecondary;
const obj22 = { quest: null, location: null, sourceQuestContent: null };
obj22[0] = quest;
obj22[1] = QuestsExperimentLocations.VIDEO_MODAL_MOBILE;
obj22[2] = sourceQuestContent;
obj21[1] = tmp25(tmp15(tmp2[26]), obj22);
items16[1] = tmp25(tmp27, obj21);
obj17[3] = items16;
const items17 = [tmp26(tmp(tmp2[23]).Stack, obj17), , ];
tmp25Result = null != memo;
if (tmp25Result) {
const obj23 = { onPress: null, children: null };
obj23[0] = handleAdvertiserDetailsPress;
const obj24 = { source: null, style: null };
const obj25 = { uri: null };
obj25[0] = memo.url;
obj24[0] = obj25;
obj24[1] = tmp3.playerThumbnail;
obj23[1] = tmp25(tmp15(tmp2[27]), obj24);
tmp25Result = tmp25(tmp(tmp2[24]).PressableOpacity, obj23);
}
items17[1] = tmp25Result;
const obj26 = { direction: "horizontal", spacing: null, children: null };
obj26[1] = tmp15(tmp2[7]).space.PX_16;
const obj27 = { grow: true, variant: "expressive", onPress: null, text: null };
obj27[2] = handlePrimaryCtaPress;
const tmpResult6 = tmp(tmp2[11]);
obj27[3] = tmp(tmp2[29]).getExternalCtaLabel(quest);
const items18 = [tmp25(tmp(tmp2[28]).Button, obj27), , ];
if (isShareable) {
const obj28 = { accessibilityLabel: null, icon: null, onPress: null, variant: "secondary" };
const intl = tmp(tmp2[31]).intl;
obj28[0] = intl.string(tmp(tmp2[31]).t.Ej3B3Y);
obj28[1] = tmp15(tmp2[32]);
obj28[2] = handleShareQuest;
isShareable = tmp25(tmp(tmp2[30]).IconButton, obj28);
}
items18[1] = isShareable;
if (tmp25Result) {
const obj29 = { accessibilityLabel: null, icon: null, onPress: null, variant: "secondary" };
const intl2 = tmp(tmp2[31]).intl;
obj29[0] = intl2.string(tmp(tmp2[31]).t.cfY4PE);
obj29[1] = tmp15(tmp2[33]);
obj29[2] = onNavigateToPostWatchVideo;
tmp25Result = tmp25(tmp(tmp2[30]).IconButton, obj29);
}
items18[2] = tmp25Result;
obj26[2] = items18;
items17[2] = tmp26(tmp(tmp2[23]).Stack, obj26);
obj16[3] = items17;
items14[2] = tmp26(tmp(tmp2[23]).Stack, obj16);
obj7[1] = items14;
obj6[4] = tmp26(tmp27, obj7);
tmp25Result1 = tmp25(tmp31, obj6);
const tmpResult7 = tmp(tmp2[29]);
}
items7[1] = tmp25Result1;
obj1[1] = items7;
obj[2] = closure_11(sharedValue, obj1);
return closure_10(quest(tmp2[15]).SafeAreaPaddingView, obj);
});
let closure_24 = importAllResult.memo((arg0) => {
({ quest, captionsEnabled, contentWidth } = arg0);
({ handleOpenTranscript, handleToggleCaptions, sourceQuestContent, hasCaptionAsset, hasTranscriptAsset, isShareable } = arg0);
let height;
let memo;
let callback;
let first;
closure_5 = undefined;
({ handleClose, handleAdvertiserDetailsPress, handlePrimaryCtaPress, handleRewardDetailsPress, handleShareQuest, isFullscreen, onNavigateToPostWatchVideo, onEnd, externallyPaused } = arg0);
let obj = contentWidth(memo[34]);
const questTaskDetails = obj.useQuestTaskDetails(quest);
const userStatus = quest.userStatus;
let completedAt;
if (userStatus != null) {
completedAt = userStatus.completedAt;
}
let tmpResult = tmp(tmp2[35]);
const videoQuestProgressRemainingAccessibilityLabel = tmpResult.getVideoQuestProgressRemainingAccessibilityLabel(questTaskDetails, tmp5);
height = height(tmp2[37])(first.useContext(tmp(tmp2[36]).QuestDockGestureContext).windowDimensions).height;
items = [contentWidth];
memo = first.useMemo(() => Math.floor(contentWidth / 0.5625), items);
callback = first.useCallback(() => {
}, []);
const tmp10 = height(memo[14])();
callback = tmp10;
const tmp11 = callback(first.useState(64), 2);
first = tmp11[0];
closure_5 = tmp11[1];
items1 = [memo, first, height, tmp10];
const callback1 = first.useCallback((nativeEvent) => {
callback(nativeEvent.nativeEvent.layout.height);
}, []);
const memo1 = first.useMemo(() => Math.min(height - closure_3.top - closure_3.bottom - first, memo), items1);
let tmp18Result = callback3(height - memo1 - first < 200);
obj = { bottom: true, style: items2, children: null };
items2 = [, ];
({ wrapper: arr3[0], wrapperPortrait: arr3[1] } = tmp18Result);
const items3 = [tmp18Result.videoWrapper, ];
if (null == memo1) {
obj = { flexGrow: 1 };
} else {
obj = { height: null };
obj[0] = memo1;
}
obj1 = { style: items3, children: null };
items3[1] = obj;
const items4 = [callback2(contentWidth(memo[16]).ThemeContextProvider, { theme: ThemeTypes.DARKER, children: callback2(contentWidth(memo[17]).VideoQuestPlayer, obj3) }), callback2(height(memo[38]), { start: closure_12, end: closure_13, style: tmp18Result.gradientTop, colors: items }), callback2(height(memo[38]), { start: closure_12, end: closure_13, style: tmp18Result.gradientBottom, colors: items1 }), ];
const obj6 = { style: items5, children: null };
items5 = [, ];
({ videoContentWrapper: arr6[0], videoContentWrapperPortrait: arr6[1] } = tmp18Result);
const obj7 = { closeButtonIconColor: null, onClose: null, showCurrentVideoTime: true, withTextShadow: true };
const obj2 = { theme: ThemeTypes.DARKER, children: callback2(contentWidth(memo[17]).VideoQuestPlayer, obj3) };
const obj4 = { start: closure_12, end: closure_13, style: tmp18Result.gradientTop, colors: items };
const obj5 = { start: closure_12, end: closure_13, style: tmp18Result.gradientBottom, colors: items1 };
obj7[0] = height(memo[7]).colors.WHITE;
obj7[1] = handleClose;
const items6 = [callback2(height(memo[39]), obj7), ];
const obj8 = { direction: "vertical", spacing: height(memo[7]).space.PX_24, children: null };
const obj9 = { direction: "horizontal", justify: "space-between", spacing: height(memo[7]).space.PX_8, children: null };
const obj10 = { style: tmp18Result.questDetailsPrimary, onPress: handleAdvertiserDetailsPress, children: null };
const items7 = [callback2(contentWidth(memo[25]).Text, { variant: "heading-lg/semibold", color: "text-overlay-light", style: tmp18Result.textShadow, accessibilityRole: "header", children: quest.config.messages.gameTitle }), ];
const items8 = [, ];
({ textShadow: arr9[0], questDetailsSubheader: arr9[1] } = tmp18Result);
items7[1] = callback2(contentWidth(memo[25]).Text, { variant: "heading-sm/semibold", color: "text-overlay-light", style: items8, children: quest.config.messages.gamePublisher });
obj10[2] = items7;
const items9 = [closure_11(contentWidth(memo[24]).PressableOpacity, obj10), ];
const obj11 = { variant: "heading-lg/semibold", color: "text-overlay-light", style: tmp18Result.textShadow, accessibilityRole: "header", children: quest.config.messages.gameTitle };
const obj12 = { variant: "heading-sm/semibold", color: "text-overlay-light", style: items8, children: quest.config.messages.gamePublisher };
const tmp7Result = height(memo[39]);
items9[1] = callback2(closure_5, { style: tmp18Result.questDetailsSecondary, children: callback2(height(memo[8]), obj14) });
obj9[3] = items9;
const items10 = [closure_11(contentWidth(memo[23]).Stack, obj9), ];
const obj15 = { grow: true, variant: "expressive", onPress: handlePrimaryCtaPress, text: null };
tmpResult = tmp(tmp2[29]);
obj15[3] = tmpResult.getExternalCtaLabel(quest);
items10[1] = callback2(contentWidth(memo[28]).Button, obj15);
obj8[2] = items10;
items6[1] = closure_11(contentWidth(memo[23]).Stack, obj8);
obj6[1] = items6;
items4[3] = closure_11(closure_5, obj6);
obj1[1] = items4;
const items11 = [closure_11(closure_5, obj1), ];
const obj16 = { direction: "horizontal", justify: "flex-end", align: "center", style: tmp18Result.footer, spacing: height(memo[7]).space.PX_4, onLayout: callback1, children: null };
tmp18Result = tmp5;
if (null != completedAt) {
const obj17 = { style: null, children: null };
obj17[0] = tmp18Result.viewRewardBtn;
const obj18 = { icon: null, iconPosition: "end", onPress: null, variant: "secondary", size: "sm", text: null };
obj18[0] = tmp18(tmp(tmp2[40]).ArrowSmallRightIcon, { size: "sm" });
obj18[2] = onNavigateToPostWatchVideo;
let intl = tmp(tmp2[31]).intl;
obj18[5] = intl.string(tmp(tmp2[31]).t["jyYgZ+"]);
obj17[1] = tmp18(tmp(tmp2[28]).Button, obj18);
tmp18Result = tmp18(tmp17, obj17);
}
const items12 = [tmp18Result, , , , ];
if (hasTranscriptAsset) {
const obj19 = { accessibilityLabel: null, onPress: null, children: null };
const intl2 = tmp(tmp2[31]).intl;
obj19[0] = intl2.string(tmp(tmp2[31]).t.KCzjTi);
obj19[1] = handleOpenTranscript;
const obj20 = { color: null };
obj20[0] = tmp18Result.iconDisabled.color;
obj19[2] = tmp18(tmp(tmp2[41]).TranscriptOutlineIcon, obj20);
hasTranscriptAsset = tmp18(closure_26, obj19);
}
items12[1] = hasTranscriptAsset;
if (!hasCaptionAsset) {
items12[2] = hasCaptionAsset;
if (isShareable) {
const obj21 = { accessibilityLabel: null, onPress: null, children: null };
const intl4 = tmp(tmp2[31]).intl;
obj21[0] = intl4.string(tmp(tmp2[31]).t.Ej3B3Y);
obj21[1] = handleShareQuest;
const obj22 = { color: null };
obj22[0] = tmp7(tmp2[7]).colors.TEXT_DEFAULT;
obj21[2] = tmp18(tmp(tmp2[43]).ShareIcon, obj22);
isShareable = tmp18(closure_26, obj21);
}
items12[3] = isShareable;
const obj23 = { quest: null, location: null, sourceQuestContent: null, children: null };
obj23[0] = quest;
obj23[1] = QuestsExperimentLocations.VIDEO_MODAL_MOBILE;
obj23[2] = sourceQuestContent;
obj23[3] = function children(ref) {
let obj = { accessibilityLabel: null, ref: null };
const merged = Object.assign(ref, Object.create(null));
const intl = contentWidth(memo[31]).intl;
obj[0] = intl.string(contentWidth(memo[31]).t.PdRCRg);
obj[1] = ref.ref;
const merged1 = Object.assign(merged);
obj = { color: height(memo[7]).colors.TEXT_DEFAULT };
obj.children = callback2(contentWidth(memo[44]).MoreHorizontalIcon, obj);
return callback2(closure_26, obj);
};
items12[4] = tmp18(tmp7(tmp2[26]), obj23);
obj16[6] = items12;
items11[1] = tmp16(tmp(tmp2[23]).Stack, obj16);
obj[2] = items11;
return tmp16(tmp(tmp2[15]).SafeAreaPaddingView, obj);
} else {
const obj24 = { accessibilityLabel: null, onPress: null, children: null };
const intl3 = tmp(tmp2[31]).intl;
obj24[0] = intl3.string(tmp(tmp2[31]).t.bDSZO1);
obj24[1] = handleToggleCaptions;
if (captionsEnabled) {
let color = tmp18Result.icon.color;
} else {
color = tmp18Result.iconDisabled.color;
}
const obj25 = { color: null };
obj25[0] = color;
tmp18Result = tmp18(tmp(tmp2[42]).ClosedCaptionsOutlineIcon, obj25);
obj24[2] = tmp18Result;
tmp18(closure_26, obj24);
const tmp22 = closure_26;
}
});
let obj = { footerButton: null };
obj = { padding: ThemesDefault.space.PX_8 };
obj[0] = obj;
let closure_25 = createCacheKey.createStyles(obj);
let closure_26 = importAllResult.forwardRef(function FooterButton(arg0, ref) {
const obj = { accessibilityRole: "button", style: callback4().footerButton };
const merged = Object.assign(arg0);
obj.ref = ref;
return callback2(PressableBase.PressableOpacity, obj);
});
const alphaResult3 = importDefaultResult(ThemesDefault.unsafe_rawColors.PLUM_23).alpha(0.4);
const memoResult = importAllResult.memo(function VideoQuestModalContentInProgress(arg0) {
({ onClose, sourceQuestContent } = arg0);
({ contentWidth, isFullscreen, onNavigateToPostWatchVideo, onEnd, setIsFullscreen } = arg0);
let obj = sourceQuestContent(14953);
const quest = obj.useVideoQuestModalContext().quest;
items = [quest];
items1 = [quest];
const memo = importAllResult.useMemo(() => sourceQuestContent(closure_1_2[11]).getQuestAsset(quest, sourceQuestContent(closure_1_2[11]).QuestAssetType.VIDEO_PLAYER_CAPTION, undefined, true), items);
const memo1 = importAllResult.useMemo(() => sourceQuestContent(closure_1_2[11]).getQuestAsset(quest, sourceQuestContent(closure_1_2[11]).QuestAssetType.VIDEO_PLAYER_TRANSCRIPT, undefined, true), items1);
[tmp6, dependencyMap] = getQuestImpressionId(importAllResult.useState(false), 2);
const items2 = [quest];
const callback = importAllResult.useCallback(() => callback((arg0) => !arg0), []);
const callback1 = importAllResult.useCallback(() => {
let obj = quest(closure_1_2[46]);
obj = { quest };
obj.openLazy(sourceQuestContent(closure_1_2[48])(closure_1_2[47], closure_1_2.paths), "transcript-" + quest.id, obj);
}, items2);
let tmp = sourceQuestContent;
const tmp5 = getQuestImpressionId(importAllResult.useState(false), 2);
getQuestImpressionId = sourceQuestContent(11306).useGetQuestImpressionId();
const obj2 = sourceQuestContent(11306);
[tmp11, closure_4] = getQuestImpressionId(importAllResult.useState(false), 2);
const tmp10 = getQuestImpressionId(importAllResult.useState(false), 2);
const isShareableQuestResult = sourceQuestContent(7477).isShareableQuest(quest.config);
closure_5 = isShareableQuestResult;
const items3 = [isShareableQuestResult, quest.id, getQuestImpressionId, sourceQuestContent];
const callback2 = importAllResult.useCallback(() => {
if (closure_5) {
let getQuestUrl = sourceQuestContent;
let id = closure_1_2;
let obj = sourceQuestContent(closure_1_2[51]);
if (obj.shouldMigrateToAdAnalyticsInterface(sourceQuestContent(closure_1_2[51]).AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL, "video_quest_modal_in_progress")) {
const questUrl = getQuestUrl(id[52]);
obj = { type: null, adCreativeType: null, adCreativeId: null, questContentCTA: null, surfaceId: null, sourceQuestContent: null, impressionId: null };
obj[0] = getQuestUrl(id[53]).AdUserActionType.CLICK_INTERNAL;
obj[1] = getQuestUrl(id[54]).AdCreativeType.QUEST;
obj[2] = quest.id;
obj[3] = getQuestUrl(id[55]).QuestContentCTA.MOBILE_SHARESHEET;
obj[4] = getQuestUrl(id[56]).QuestContent.VIDEO_MODAL_MOBILE;
obj[5] = sourceQuestContent;
obj[6] = getQuestImpressionId();
questUrl.captureAdUserAction(obj);
let tmp = quest;
} else {
const questUrl1 = getQuestUrl(id[57]);
obj = { questId: null, questContent: null, questContentCTA: null, impressionId: null, sourceQuestContent: null };
tmp = quest;
obj[0] = quest.id;
obj[1] = getQuestUrl(id[56]).QuestContent.VIDEO_MODAL_MOBILE;
obj[2] = getQuestUrl(id[55]).QuestContentCTA.MOBILE_SHARESHEET;
obj[3] = getQuestImpressionId();
obj[4] = sourceQuestContent;
const result = questUrl1.trackQuestContentClicked(obj);
}
callback2(true);
const questUrl2 = getQuestUrl(id[58]);
obj1 = { message: null, iOSOnlyShareCallback: null };
const questUrl3 = getQuestUrl(id[29]);
getQuestUrl = questUrl3.getQuestUrl;
obj1[0] = getQuestUrl(tmp.id);
obj1[1] = function iOSOnlyShareCallback() {
return callback(false);
};
id = tmp.id;
const _HermesInternal = HermesInternal;
questUrl2.showShareActionSheet(obj1, "Video Quest Modal - " + id);
}
}, items3);
const obj3 = sourceQuestContent(7477);
const videoQuestClickCtaAndMaybeCloseModal = sourceQuestContent(14982).useVideoQuestClickCtaAndMaybeCloseModal({ quest, onClose, sourceQuestContent });
const items4 = [videoQuestClickCtaAndMaybeCloseModal];
const items5 = [videoQuestClickCtaAndMaybeCloseModal];
const callback3 = importAllResult.useCallback(() => videoQuestClickCtaAndMaybeCloseModal(sourceQuestContent(closure_1_2[56]).QuestContent.VIDEO_MODAL_MOBILE_FOOTER), items4);
const items6 = [quest.id];
const callback4 = importAllResult.useCallback(() => videoQuestClickCtaAndMaybeCloseModal(sourceQuestContent(closure_1_2[56]).QuestContent.VIDEO_MODAL_MOBILE), items5);
const callback5 = importAllResult.useCallback(() => {
let obj = sourceQuestContent(closure_1_2[60]);
obj = { questId: quest.id };
const result = obj.openRewardDetailsBottomSheet(obj);
}, items6);
const obj4 = sourceQuestContent(14982);
const videoExternallyPaused = sourceQuestContent(14983).useVideoExternallyPaused(quest.id, tmp11);
const tmp19 = quest.config.taskConfigV2.tasks[sourceQuestContent(undefined, 5402).FirstPartyQuestTaskTypes.WATCH_VIDEO_ON_MOBILE];
let tmp20 = null == tmp19;
if (!tmp20) {
tmp20 = "portrait" === tmp(11332).getVideoOrientation(tmp19);
const tmpResult = tmp(11332);
}
obj = { quest, captionsEnabled: tmp6, contentWidth, handleClose: onClose, handleAdvertiserDetailsPress: callback3, handlePrimaryCtaPress: callback4, handleRewardDetailsPress: callback5, handleShareQuest: callback2, handleOpenTranscript: callback1, handleToggleCaptions: callback, isFullscreen, onNavigateToPostWatchVideo, onEnd, setIsFullscreen, externallyPaused: videoExternallyPaused, sourceQuestContent, hasCaptionAsset: null != memo, hasTranscriptAsset: null != memo1, isShareable: isShareableQuestResult };
return callback2(tmp20 ? closure_24 : closure_23, obj);
});
let result = require("set").fileFinishedImporting("modules/quests/native/VideoQuestModal/VideoQuestModalContentInProgress.tsx");
export default memoResult;