This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,70 @@
// Metro module 14081 (f14082).
import { useEffect } from "react";
import { View } from "react-native";
import ReanimatedRexport, { useSharedValue, withRepeat, withSequence, Easing, cancelAnimation, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import { withTiming } from "../../../../design/animation/reanimated/timing/timing";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useToken } from "../../../../design/tokens/native/useToken";
import { ArrowSmallUpIcon } from "../../../../design/components/Icon/native/redesign/generated/ArrowSmallUpIcon";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { AnimatedCircularProgress } from "../../../../_bundle/Module14084";
let __initData, useStyles;
const BouncingArrow = function BouncingArrow(props) {
const children2 = props.children;
const sharedValue = useSharedValue(0);
useEffect(() => {
sharedValue.set(withRepeat(withSequence(withTiming(-6, {
duration: 500,
easing: Easing.inOut(Easing.quad)
}), withTiming(0, {
duration: 500,
easing: Easing.inOut(Easing.quad)
})), -1));
return () => cancelAnimation(sharedValue);
}, [sharedValue]);
const l = () => ({
transform: [{
translateY: sharedValue.get()
}]
});
l.__closure = {
translateY: sharedValue
};
l.__workletHash = 10126349088819;
l.__initData = __initData;
return <ReanimatedRexport.View style={useAnimatedStyle(l)}>{children2}</ReanimatedRexport.View>;
};
__initData = {
code: "function BountiesAutoScrollIndicatorTsx1(){const{translateY}=this.__closure;return{transform:[{translateY:translateY.get()}]};}"
};
useStyles = createStyles({
root: {
alignItems: "center",
gap: Module712.space.PX_8
},
ringContainer: {
alignItems: "center",
justifyContent: "center",
width: 40,
height: 40
}
});
export default function BountiesAutoScrollIndicator(props) {
const { progress, showProgressRing = true } = props;
const styles = useStyles();
const token = useToken(Module712.colors.WHITE);
const r16 = <ArrowSmallUpIcon size="md" color={Module712.colors.WHITE} />;
let c20889_0 = r16;
return <View style={styles.root}>
<Text variant="text-md/semibold" color="text-default">
{intl.string(t.eafsh4)}
</Text>
<View style={styles.ringContainer}>
{showProgressRing ? <AnimatedCircularProgress size={40} width={3} fill={100 * progress} duration={0} rotation={0} lineCap="round" tintColor={token} backgroundColor="rgba(255, 255, 255, 0.35)">
{() => c20889_0}
</AnimatedCircularProgress> : <BouncingArrow>{r16}</BouncingArrow>}
</View>
</View>;
};
@@ -0,0 +1,43 @@
// Metro module 14075 (f14076).
import { useEffect } from "react";
import { StyleSheet } from "react-native";
import Module712 from "../../../../_bundle/Module712";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import { withTiming } from "../../../../design/animation/reanimated/timing/timing";
import { timingSlow } from "../../../../design/animation/reanimated/timing/timingPresets";
import Module4611 from "../../../../_bundle/Module4611";
const BRAND_500 = Module712.unsafe_rawColors.BRAND_500;
const __initData = {
code: "function BountiesAutoScrollOverlayNuxGradientTsx1(){const{opacity}=this.__closure;return{opacity:opacity.get()};}"
};
export default function BountiesAutoScrollOverlayNuxGradient(props) {
const active = props.active;
const sharedValue = useSharedValue(0);
useEffect(() => {
sharedValue.set(withTiming(active ? 1 : 0, timingSlow));
}, [active, sharedValue]);
const _ = () => ({
opacity: sharedValue.get()
});
_.__closure = {
opacity: sharedValue
};
_.__workletHash = 17406907036861;
_.__initData = __initData;
return <ReanimatedRexport.View style={[StyleSheet.absoluteFillObject, useAnimatedStyle(_)]} pointerEvents="none">
<Module4611 style={StyleSheet.absoluteFillObject} colors={[`${BRAND_500}80`, `${BRAND_500}00`]} locations={[0, 1]} start={{
x: 0.5,
y: 1
}} end={{
x: 0.5,
y: 0
}} />
<Module4611 style={StyleSheet.absoluteFillObject} colors={["rgba(0,0,0,0.4)", "rgba(0,0,0,0)"]} locations={[0, 0.5]} start={{
x: 0.5,
y: 1
}} end={{
x: 0.5,
y: 0
}} />
</ReanimatedRexport.View>;
};
@@ -0,0 +1,65 @@
// Metro module 14070 (f14071).
import { useCallback } from "react";
import { Pressable, View } from "react-native";
import { END_CARD_IMAGE_SIZE } from "./BountyConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useGetQuestImpressionId } from "../../lib/analytics/ContentImpressionTrackerHooks";
import { getBountyCtaInfo } from "./BountyCtaHelpers";
import { getScaledImageUrl } from "../../lib/AssetUtils";
import { openAdGameLinkDirectly } from "../../utils/QuestPlatformUtils";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { QuestContent } from "../../../../_bundle/Module5038";
import { QuestContentCTA } from "../../lib/analytics/AnalyticsTypes";
import FastImage from "../../../../components_native/common/FastImage";
import { Text } from "../../../../design/components/Text/native/Text";
const useStyles = createStyles(() => ({
image: {
width: END_CARD_IMAGE_SIZE,
height: END_CARD_IMAGE_SIZE,
borderRadius: Module712.radii.xl,
borderWidth: 1,
borderColor: Module712.colors.BORDER_MUTED
},
info: {
gap: Module712.space.PX_4,
alignItems: "center",
marginTop: Module712.space.PX_12
},
ctaContainer: {
position: "relative",
alignItems: "center"
}
}));
export default function BountiesEndCardPressableCta(props) {
const { bounty, sourceQuestContent, disabled = false } = props;
const styles = useStyles();
const getQuestImpressionId = useGetQuestImpressionId();
const bountyCtaInfo = getBountyCtaInfo(bounty);
const uri = bountyCtaInfo.iconImageUri != null ? getScaledImageUrl({
assetUrl: bountyCtaInfo.iconImageUri,
width: END_CARD_IMAGE_SIZE,
height: END_CARD_IMAGE_SIZE
}) : void 0;
const callback = useCallback(() => {
openAdGameLinkDirectly({
adContentId: bounty.id,
adCreativeType: AdCreativeType.BOUNTY,
cta: bounty.cta
}, {
content: QuestContent.VIDEO_MODAL_ICON_END_CARD,
ctaContent: QuestContentCTA.OPEN_GAME_LINK,
impressionId: getQuestImpressionId(),
sourceQuestContent
});
}, [bounty.id, bounty.cta, getQuestImpressionId, sourceQuestContent]);
return <Pressable onPress={disabled ? void 0 : callback} disabled={disabled} hitSlop={16} accessibilityRole="button" accessibilityLabel={bountyCtaInfo.label} style={styles.ctaContainer}>
<FastImage source={{
uri
}} style={styles.image} />
<View style={styles.info}>
<Text variant="text-md/semibold" color="text-strong">{bountyCtaInfo.label}</Text>
<Text variant="text-sm/medium" color="text-default">{bountyCtaInfo.subtext}</Text>
</View>
</Pressable>;
};
@@ -0,0 +1,31 @@
// Metro module 14034 (f14035).
import * as Module19 from "react";
import { useMemo, useLayoutEffect } from "react";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
import BountiesModalContentScroll from "./BountiesModalContentScroll";
import BountiesModalContent from "./BountiesModalContent";
import { lockOrientation, restoreDefaultOrientation } from "../../../device/native/DeviceOrientation";
import { Modal } from "../../../../design/components/Modal/native/Modal.native";
const initialRouteName = "bounty_main";
const r24 = Module19.memo(function BountiesModal(props) {
const { bountyId, sourceQuestContent } = props;
const verticalScrollEnabled = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE).verticalScrollEnabled;
const memo = useMemo(() => {
const r1 = {};
r1[initialRouteName] = {
fullscreen: true,
headerLeft: () => null,
render: () => verticalScrollEnabled ? <BountiesModalContentScroll bountyId={bountyId} sourceQuestContent={sourceQuestContent} /> : <BountiesModalContent bountyId={bountyId} sourceQuestContent={sourceQuestContent} />
};
return r1;
}, [bountyId, sourceQuestContent, verticalScrollEnabled]);
useLayoutEffect(() => {
lockOrientation("PORTRAIT", true);
return restoreDefaultOrientation;
}, []);
return <Modal hideTitle initialRouteName={initialRouteName} screens={memo} viewStyle={{
backgroundColor: "#000000"
}} />;
});
export default r24;
@@ -0,0 +1,16 @@
// Metro module 14033 (f14034).
import ModalActionCreators from "../../../../actions/ModalActionCreators";
let c9809_3 = "BOUNTIES_MODAL";
const r15 = {
showModal: ({ bountyId, sourceQuestContent }) => {
ModalActionCreators.pushLazy(import("./BountiesModal"), {
bountyId,
sourceQuestContent
}, c9809_3);
},
hideModal: () => {
ModalActionCreators.popWithKey(c9809_3);
}
};
export default r15;
export const BOUNTIES_MODAL_KEY = "BOUNTIES_MODAL";
@@ -0,0 +1,191 @@
// Metro module 14066 (f14067).
import { useCallback } from "react";
import { StyleSheet, View, Pressable } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { QuestsExperimentLocations } from "../../QuestConstants";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { getBountyCtaInfo } from "./BountyCtaHelpers";
import { getScaledImageUrl } from "../../lib/AssetUtils";
import { useButtonPressAnimationProps } from "../../../../design/components/Button/native/ButtonHooks.native";
import { useGetQuestImpressionId } from "../../lib/analytics/ContentImpressionTrackerHooks";
import { openAdGameLinkDirectly } from "../../utils/QuestPlatformUtils";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { QuestContentCTA } from "../../lib/analytics/AnalyticsTypes";
import { QuestContent } from "../../../../_bundle/Module5038";
import { BackgroundBlurView } from "../../../../design/components/experimental/BackgroundBlurView/native/BackgroundBlurView.native";
import FastImage from "../../../../components_native/common/FastImage";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { useIsBountiesModalTransitionsRefactorEnabled } from "../../experiments/BountiesModalTransitionsRefactorExperiment";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useVisibilityTransition } from "./useVisibilityTransition";
import AnimatedEnterExitItem from "../../../../design/components/AnimatedEnterExitItem/native/AnimatedEnterExitItem";
let _excluded, AnimatedComponent, useStyles, n, s2, __initData;
const BountiesModalAdvertiserCtaContent = function BountiesModalAdvertiserCtaContent(props) {
const { bounty, sourceQuestContent, opacityStyle, transformStyle } = props;
const styles = useStyles();
const bountyCtaInfo = getBountyCtaInfo(bounty);
const uri = bountyCtaInfo.iconImageUri != null ? getScaledImageUrl({
assetUrl: bountyCtaInfo.iconImageUri,
width: 40,
height: 40
}) : void 0;
const sharedValue = useSharedValue(0);
const buttonPressAnimationProps = useButtonPressAnimationProps(sharedValue);
const { style, ...rest } = buttonPressAnimationProps;
const getQuestImpressionId = useGetQuestImpressionId();
const callback = useCallback((a0) => {
openAdGameLinkDirectly({
adContentId: bounty.id,
adCreativeType: AdCreativeType.BOUNTY,
cta: bounty.cta
}, {
content: a0,
ctaContent: QuestContentCTA.OPEN_GAME_LINK,
impressionId: getQuestImpressionId(),
sourceQuestContent
});
}, [bounty.id, bounty.cta, sourceQuestContent, getQuestImpressionId]);
return <ReanimatedRexport.View style={[styles.outerContainer, opacityStyle, transformStyle]}>
<AnimatedComponent {...rest} onPress={useCallback(() => {
callback(QuestContent.VIDEO_MODAL_MOBILE);
}, [callback])} accessibilityRole="button" accessibilityLabel={bountyCtaInfo.label} style={[styles.ctaPressable, style]}>
<BackgroundBlurView blurTheme="dark" style={styles.cta} pressed={sharedValue}>
<View style={styles.ctaLogoContainer}>
<FastImage source={{
uri
}} style={styles.ctaLogo} resizeMode="cover" />
</View>
<View style={styles.ctaInfo}>
<Text lineClamp={2} variant="text-sm/semibold" color="text-default">{bountyCtaInfo.label}</Text>
<Text variant="text-xs/medium" color="text-default">{bountyCtaInfo.subtext}</Text>
</View>
<View accessible={false} importantForAccessibility="no-hide-descendants">
<Button variant="primary-overlay" text={bountyCtaInfo.buttonLabel} size="sm" onPress={useCallback(() => {
callback(QuestContent.VIDEO_MODAL_MOBILE_FOOTER);
}, [callback])} />
</View>
</BackgroundBlurView>
</AnimatedComponent>
</ReanimatedRexport.View>;
};
_excluded = ["style"];
AnimatedComponent = ReanimatedRexport.createAnimatedComponent(Pressable);
useStyles = createStyles(() => ({
outerContainer: {
position: "absolute",
bottom: 0,
left: 0,
right: 0,
paddingHorizontal: Module712.space.PX_16,
paddingBottom: Module712.space.PX_16,
alignItems: "center"
},
ctaPressable: {
...Module712.shadows.SHADOW_TOP_HIGH,
alignSelf: "stretch",
borderWidth: 1,
borderColor: "transparent",
borderRadius: Module712.radii.lg,
overflow: "hidden"
},
cta: {
flexDirection: "row",
alignItems: "center",
paddingLeft: Module712.space.PX_12,
paddingRight: Module712.space.PX_16,
paddingVertical: Module712.space.PX_12,
gap: Module712.space.PX_12
},
ctaLogoContainer: {
width: 40,
height: 40,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.md,
overflow: "hidden"
},
ctaLogo: {
...StyleSheet.absoluteFillObject
},
ctaInfo: {
flex: 1,
justifyContent: "center",
gap: 2
}
}));
const r43 = function n(a0) {
return {
opacity: _timing.withTiming(a0, _timingPresets.timingStandard, "respect-motion-settings")
};
};
r43.__closure = {
withTiming: _timing.withTiming,
timingStandard: _timingPresets.timingStandard
};
r43.__workletHash = 2981824910249;
r43.__initData = {
code: "function BountiesModalAdvertiserCtaTsx1(visible){const{withTiming,timingStandard}=this.__closure;return{opacity:withTiming(visible,timingStandard,'respect-motion-settings')};}"
};
n = r43;
const r52 = function(a0, a1) {
return {
opacity: _timing.withTiming(a0, _timingPresets.timingFast, "respect-motion-settings", a1)
};
};
r52.__closure = {
withTiming: _timing.withTiming,
timingFast: _timingPresets.timingFast
};
r52.__workletHash = 15850601331978;
r52.__initData = {
code: "function BountiesModalAdvertiserCtaTsx2(visible,cleanUp){const{withTiming,timingFast}=this.__closure;return{opacity:withTiming(visible,timingFast,'respect-motion-settings',cleanUp)};}"
};
s2 = r52;
__initData = {
code: "function BountiesModalAdvertiserCtaTsx3(){const{withTiming,interpolate,visibility,visible,timingStandard,timingFast}=this.__closure;return{transform:[{translateY:withTiming(interpolate(visibility,[0,1],[8,0]),visible?timingStandard:timingFast)}]};}"
};
export default function BountiesModalAdvertiserCta(props) {
let c20882_1, animatedStyle;
const { visible, ...props2 } = props;
c20882_1 = void 0;
animatedStyle = void 0;
const isBountiesModalTransitionsRefactorEnabled = useIsBountiesModalTransitionsRefactorEnabled(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const visibility = visible ? 1 : 0;
c20882_1 = visibility;
const r32 = () => ({
transform: [{
translateY: _timing.withTiming(_ReanimatedRexport.interpolate(c20882_1, [0, 1], [8, 0]), visible ? _timingPresets.timingStandard : _timingPresets.timingFast)
}]
});
r32.__closure = {
withTiming: _timing.withTiming,
interpolate: _ReanimatedRexport.interpolate,
visibility,
visible,
timingStandard: _timingPresets.timingStandard,
timingFast: _timingPresets.timingFast
};
r32.__workletHash = 252868467367;
r32.__initData = __initData;
animatedStyle = useAnimatedStyle(r32);
const callback2 = useCallback((a0, a1) => <BountiesModalAdvertiserCtaContent {...a0} opacityStyle={a1} transformStyle={animatedStyle} />, [animatedStyle]);
const visibilityTransition = useVisibilityTransition({
visible,
entranceTiming: _timingPresets.timingStandard,
exitTiming: _timingPresets.timingFast
});
const opacityStyle = visibilityTransition.opacityStyle;
let shouldRender = visibilityTransition.shouldRender;
if (isBountiesModalTransitionsRefactorEnabled) {
shouldRender = <AnimatedEnterExitItem useReducedMotion={stateFromStores} item={visible ? props2 : void 0} entering={n} exiting={s2} renderItem={callback2} />;
} else if (shouldRender) {
shouldRender = <BountiesModalAdvertiserCtaContent {...props2} opacityStyle={opacityStyle} transformStyle={animatedStyle} />;
}
return shouldRender;
};
@@ -0,0 +1,23 @@
// Metro module 14080 (f14081).
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { intl, t } from "../../../../intl/index.native";
import { XSmallIcon } from "../../../../design/components/Icon/native/redesign/generated/XSmallIcon";
const useStyles = createStyles(() => ({
closeButton: {
alignItems: "center",
justifyContent: "center",
backgroundColor: Module712.colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT,
borderRadius: Module712.radii.round,
width: Module712.space.PX_32,
height: Module712.space.PX_32
}
}));
export default function BountiesModalCloseButton(props) {
const onPress = props.onPress;
const styles = useStyles();
return <PressableOpacity accessibilityLabel={intl.string(t.cpT0Cq)} accessibilityRole="button" hitSlop={12} onPress={onPress} style={styles.closeButton}>
<XSmallIcon size="sm" color={Module712.colors.CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT} />
</PressableOpacity>;
};
@@ -0,0 +1,2 @@
// Metro module 14057 (f14058).
export const BOUNTY_REWARD_CLAIM_FAILED_TOAST_DURATION_MS = 10000;
@@ -0,0 +1,262 @@
// Metro module 14087 (f14088).
import { useMemo, useCallback } from "react";
import { View } from "react-native";
import BountyStore from "../../BountyStore";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { AnalyticEvents } from "../../../../Constants";
import { ThemeTypes } from "../../../../_bundle/Module505";
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useFetchVirtualCurrencyBalance } from "../../../virtual_currency/hooks/index";
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
import { BountyVideoEndMode, useBountiesModalTiming } from "./useBountiesModalTiming";
import { useBountyVideoProgressPersistence } from "./useBountyVideoProgressPersistence";
import { claimBountyReward } from "../../BountyActionCreators";
import { openBountyRewardClaimErrorToast } from "./bountyError";
import { useBountiesModalVideoAnalytics } from "./useBountiesModalVideoAnalytics";
import { trackAdContentEvent } from "../../lib/analytics/AnalyticsActions";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { getQuestContentName } from "../../lib/analytics/AnalyticsTypes";
import { QuestContent } from "../../../../_bundle/Module5038";
import { formatVideoProgressRatio } from "../../utils/VideoQuestUtils";
import BountiesModalActionCreators from "./BountiesModalActionCreators";
import { BountyVideo } from "./BountyVideo";
import { QuestContentImpressionTrackerNative, BillableAdPlacementImpressionTrackerNative } from "../QuestContentImpressionTracker.native";
import BountiesModalEndCard from "./BountiesModalEndCard";
import BountiesModalCloseButton from "./BountiesModalCloseButton";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import BountiesModalEndedCtaButtons from "./BountiesModalEndedCtaButtons";
import { useQuestHomeBounties } from "../../hooks/QuestHooks";
import { ThemeContextProvider } from "../../../../_bundle/Module3901";
let c9854_13, useStyles;
const BountiesModalContentInner = function BountiesModalContentInner(props) {
let c20892_4, handleProgress, flushProgress, handleVideoProgressAnalytics, isEndCardVisible, maxVideoProgressSeconds, videoDuration;
const { bounty, sourceQuestContent } = props;
c20892_4 = void 0;
handleProgress = void 0;
flushProgress = void 0;
handleVideoProgressAnalytics = void 0;
isEndCardVisible = void 0;
maxVideoProgressSeconds = void 0;
videoDuration = void 0;
const styles = useStyles();
const windowDimensions_native = useWindowDimensions_native();
const { width, height } = windowDimensions_native;
const safeAreaInsets_native = useSafeAreaInsets_native();
let c20893_2 = safeAreaInsets_native;
const memo = useMemo(() => {
const r11 = width - c20893_2.left - c20893_2.right;
const r13 = height - c20893_2.top - c20893_2.bottom;
let r21 = r11 / c9854_13;
let isFullWidth = true;
let r9 = r11;
if (r21 > r13) {
r9 = r13 * c9854_13;
isFullWidth = false;
r21 = r13;
}
return {
top: Math.floor(c20893_2.top + (r13 - r21) / 2),
left: Math.floor(c20893_2.left + (r11 - r9) / 2),
width: Math.floor(r9),
height: Math.floor(r21),
isFullWidth
};
}, [width, height, safeAreaInsets_native.top, safeAreaInsets_native.bottom, safeAreaInsets_native.left, safeAreaInsets_native.right]);
const memo4 = useMemo(() => [styles.videoWrapper, {
top: memo.top,
left: memo.left,
width: memo.width,
height: memo.height
}], [styles.videoWrapper, memo]);
const memo3 = useMemo(() => [styles.closeButton, {
top: memo.top + Module712.space.PX_8,
left: memo.left + memo.width - Module712.space.PX_32 - Module712.space.PX_8
}], [styles.closeButton, memo.top, memo.left, memo.width]);
const memo2 = useMemo(() => {
const isFullWidth = memo.isFullWidth;
const bottomContainer = styles.bottomContainer;
return isFullWidth ? [bottomContainer, styles.bottomContainerFullWidth] : [bottomContainer, styles.bottomContainerNotFullWidth, {
left: memo.left,
width: memo.width
}];
}, [styles.bottomContainer, styles.bottomContainerFullWidth, styles.bottomContainerNotFullWidth, memo.isFullWidth, memo.left, memo.width]);
const stateFromStores = useStateFromStores([BountyStore], () => BountyStore.isBountyCompleted(bounty.id));
const balance = useFetchVirtualCurrencyBalance().balance;
const bountiesExperience = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
const { loopingEnabled, ownedByVerticalScrollExperiment, stage1Enabled, rewardTimerSeconds } = bountiesExperience;
const endMode = loopingEnabled ? BountyVideoEndMode.LOOP : BountyVideoEndMode.END_CARD;
const rewardDurationMs = !stage1Enabled && !ownedByVerticalScrollExperiment ? 1000 * bounty.rewardTimerSeconds : 1000 * rewardTimerSeconds;
c20892_4 = rewardDurationMs;
const bountyVideoProgressPersistence = useBountyVideoProgressPersistence({
bountyId: bounty.id,
endMode
});
const initialProgress = bountyVideoProgressPersistence.initialProgress;
handleProgress = bountyVideoProgressPersistence.handleProgress;
flushProgress = bountyVideoProgressPersistence.flushProgress;
const callback = useCallback(async () => {
let c27624_2;
let c27624_3 = 0;
let c30697_0;
L10: {
try {
c27624_3 = 1;
await claimBountyReward(bounty.id, sourceQuestContent);
c27624_3 = 0;
} catch ($e) {
const r24 = $e;
let r7 = r24;
c27624_2 = r24;
if (c27624_3 !== 0) {
while (true) {
try {
const r57 = c27624_2;
c27624_3 = 0;
c30697_0 = r57;
openBountyRewardClaimErrorToast(c30697_0);
break L10;
} catch (r53) {
r7 = r53;
c27624_2 = r53;
if (c27624_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
}, [bounty.id, sourceQuestContent]);
const bountiesModalVideoAnalytics = useBountiesModalVideoAnalytics({
bountyId: bounty.id,
sourceQuestContent,
rewardDurationMs,
initialPlaybackTimeSec: initialProgress.timestampSec,
initialMaxVideoProgressSec: initialProgress.maxTimestampSec,
initialVideoDurationSec: initialProgress.duration,
wasPreloaded: false,
startupPath: "carousel",
verticalScrollingPosition: null
});
handleVideoProgressAnalytics = bountiesModalVideoAnalytics.handleVideoProgressAnalytics;
const { handleVideoEndAnalytics, handleVideoLoopedAnalytics, handleVideoPausedAnalytics, handleVideoResumedAnalytics, handleVideoErrorAnalytics, handleLoadStartAnalytics, handleVideoTracksAnalytics, handleReadyForDisplayAnalytics, handleBufferAnalytics } = bountiesModalVideoAnalytics;
const bountiesModalTiming = useBountiesModalTiming({
endMode,
rewardDurationMs,
isCompleted: stateFromStores,
onRewardEarned: callback,
onVideoProgress: useCallback((a0, a1, a2) => {
handleVideoProgressAnalytics(a0, a1, a2);
handleProgress(a0, a1, a2);
}, [handleVideoProgressAnalytics, handleProgress]),
onVideoEnd: handleVideoEndAnalytics,
onVideoLooped: handleVideoLoopedAnalytics,
onVideoPaused: handleVideoPausedAnalytics,
onVideoResumed: handleVideoResumedAnalytics,
initialProgressSec: initialProgress.timestampSec,
initialMaxVideoProgressSec: initialProgress.maxTimestampSec,
initialVideoDurationSec: initialProgress.duration > 0 ? initialProgress.duration : null
});
const isCtaVisible = bountiesModalTiming.isCtaVisible;
isEndCardVisible = bountiesModalTiming.isEndCardVisible;
const { handleVideoEnd, handleVideoProgress, handleVideoPaused, handleVideoResumed, rewardRemainingSeconds, rewardTotalSeconds, normalizedProgress } = bountiesModalTiming;
maxVideoProgressSeconds = bountiesModalTiming.maxVideoProgressSeconds;
videoDuration = bountiesModalTiming.videoDuration;
return <>
<View style={memo4}>
<BountyVideo isActive bounty={bounty} sourceQuestContent={sourceQuestContent} isCompleted={stateFromStores} isCtaVisible={isCtaVisible} isEndCardVisible={isEndCardVisible} isProgressBarVisible={!isEndCardVisible} orbsBalance={balance} handleVideoEnd={handleVideoEnd} handleVideoProgress={handleVideoProgress} handleVideoPaused={handleVideoPaused} handleVideoResumed={handleVideoResumed} handleVideoError={handleVideoErrorAnalytics} onLoadStart={handleLoadStartAnalytics} onBuffer={handleBufferAnalytics} onFirstFrame={handleReadyForDisplayAnalytics} onVideoTracks={handleVideoTracksAnalytics} rewardRemainingSeconds={rewardRemainingSeconds} rewardTotalSeconds={rewardTotalSeconds} normalizedProgress={normalizedProgress} repeat={loopingEnabled} initialProgress={initialProgress} renderEndCard={() => <QuestContentImpressionTrackerNative adContentId={bounty.id} adCreativeType={AdCreativeType.BOUNTY} questContent={QuestContent.VIDEO_MODAL_END_CARD} sourceQuestContent={sourceQuestContent} overrideVisibility={isEndCardVisible}>
{() => <BountiesModalEndCard bounty={bounty} visible={isEndCardVisible} sourceQuestContent={sourceQuestContent} />}
</QuestContentImpressionTrackerNative>} isScrollIndicatorEnabled={false} width={memo.width} height={memo.height} />
</View>
<View style={memo3}>
<BountiesModalCloseButton onPress={useCallback(() => {
const properties = {
content_name: getQuestContentName(QuestContent.VIDEO_MODAL_MOBILE),
content_id: QuestContent.VIDEO_MODAL_MOBILE,
video_progress: null,
threshold_met: null,
reward_timer_seconds: null
};
let r38 = videoDuration;
if (videoDuration == null) {
r38 = 0;
}
properties.video_progress = formatVideoProgressRatio(maxVideoProgressSeconds, r38);
const r1 = 1000 * maxVideoProgressSeconds;
properties.threshold_met = r1 >= c20892_4;
properties.reward_timer_seconds = c20892_4 / 1000;
trackAdContentEvent({
adContentId: bounty.id,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_MODAL_CLOSED,
properties,
sourceQuestContent
});
flushProgress();
BountiesModalActionCreators.hideModal();
}, [bounty.id, maxVideoProgressSeconds, rewardDurationMs, sourceQuestContent, videoDuration, flushProgress])} />
</View>
<SafeAreaPaddingView left={memo.isFullWidth} right={memo.isFullWidth} bottom style={memo2} pointerEvents="box-none">
<BountiesModalEndedCtaButtons bounty={bounty} visible={isEndCardVisible} sourceQuestContent={sourceQuestContent} onClose={useCallback(() => {
const properties = {
content_name: getQuestContentName(QuestContent.VIDEO_MODAL_END_CARD),
content_id: QuestContent.VIDEO_MODAL_END_CARD,
video_progress: null,
threshold_met: true,
reward_timer_seconds: null
};
let r36 = videoDuration;
if (videoDuration == null) {
r36 = 0;
}
properties.video_progress = formatVideoProgressRatio(maxVideoProgressSeconds, r36);
properties.reward_timer_seconds = c20892_4 / 1000;
trackAdContentEvent({
adContentId: bounty.id,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_MODAL_CLOSED,
properties,
sourceQuestContent
});
flushProgress();
BountiesModalActionCreators.hideModal();
}, [bounty.id, maxVideoProgressSeconds, rewardDurationMs, sourceQuestContent, videoDuration, flushProgress])} />
</SafeAreaPaddingView>
</>;
};
c9854_13 = 0.5625;
useStyles = createStyles(() => ({
videoWrapper: {
position: "absolute"
},
closeButton: {
position: "absolute"
},
bottomContainer: {
position: "absolute",
bottom: Module712.space.PX_24,
justifyContent: "flex-end"
},
bottomContainerFullWidth: {
left: Module712.space.PX_16,
right: Module712.space.PX_16
},
bottomContainerNotFullWidth: {
paddingLeft: Module712.space.PX_16,
paddingRight: Module712.space.PX_16
}
}));
export default function BountiesModalContent(props) {
const { bountyId, sourceQuestContent: sourceQuestContent2 } = props;
const bounty2 = useQuestHomeBounties().questHomeBounties.find((questHomeBounty) => questHomeBounty.id === bountyId);
return bounty2 != null ? <ThemeContextProvider theme={ThemeTypes.DARKER}>
<BillableAdPlacementImpressionTrackerNative adContentId={bounty2.id} adCreativeType={AdCreativeType.BOUNTY} questContent={QuestContent.VIDEO_MODAL_MOBILE} sourceQuestContent={sourceQuestContent2} overrideVisibility>
{() => <BountiesModalContentInner bounty={bounty2} sourceQuestContent={sourceQuestContent2} />}
</BillableAdPlacementImpressionTrackerNative>
</ThemeContextProvider> : null;
};
@@ -0,0 +1,799 @@
// Metro module 14035 (f14036).
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { useRef, useState, useCallback, useMemo, useEffect } from "react";
import { StyleSheet, View } from "react-native";
import BountyStore from "../../BountyStore";
import { DEFAULT_PLACEHOLDER_ENTRYPOINT_BOUNTY_ID, QuestsExperimentLocations } from "../../QuestConstants";
import { AnalyticEvents } from "../../../../Constants";
import { ContentDismissActionType } from "../../../dismissible_content/DismissibleContentConstants";
import * as _Module501 from "../../../../_bundle/Module501";
import Module712 from "../../../../_bundle/Module712";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useAnimatedStyle, useSharedValue, useAnimatedScrollHandler, useAnimatedReaction, useDerivedValue } from "../../../reanimated/ReanimatedRexport";
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import BountiesScrollPromptFooter, { BOUNTIES_MODAL_BASE_FOOTER_HEIGHT } from "./BountiesScrollPromptFooter";
import { useQuestHomeBounties } from "../../hooks/QuestHooks";
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
import * as _BountiesVerticalScrollExperiment from "../../experiments/BountiesVerticalScrollExperiment";
import { useStateFromStores } from "../../../../_bundle/Module589";
import * as _useBountiesRecapScroll from "./useBountiesRecapScroll";
import { useBountiesRecapScroll } from "./useBountiesRecapScroll";
import { useBountySwipeUpNux } from "./useBountySwipeUpNux";
import { v4 } from "../../../../_bundle/Module514";
import * as _AnalyticsTypes from "../../lib/analytics/AnalyticsTypes";
import { BountyScrollingType, getQuestContentName } from "../../lib/analytics/AnalyticsTypes";
import { trackBountyAutoScrollDismissed, trackBountyVerticalScroll, trackAdContentEvent } from "../../lib/analytics/AnalyticsActions";
import { useBountiesAutoScroll, AUTO_SCROLL_PEEK_TOP_OFFSET, AUTO_SCROLL_PEEK_SCALE } from "./useBountiesAutoScroll";
import { useBountiesRecapOrbCount } from "./useBountiesRecapOrbCount";
import { markAdContentSeen } from "../../QuestActionCreators";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { QuestContent } from "../../../../_bundle/Module5038";
import { formatVideoProgressRatio } from "../../utils/VideoQuestUtils";
import BountiesModalActionCreators from "./BountiesModalActionCreators";
import { BountiesScrollVideoItem } from "./BountiesScrollVideoItem";
import BountiesScrollPromptNuxFooter from "./BountiesScrollPromptNuxFooter";
import { BountiesScrollRecapFooter } from "./BountiesScrollRecapFooter";
import BountiesAutoScrollOverlayNuxGradient from "./BountiesAutoScrollOverlayNuxGradient";
import { QuestContentImpressionTrackerNative } from "../QuestContentImpressionTracker.native";
import { BountiesScrollRecapPage } from "./BountiesScrollRecapPage";
import { AnimatedFlashList } from "../../../../_bundle/noop_6676";
import Module4611 from "../../../../_bundle/Module4611";
import BountiesModalCloseButton from "./BountiesModalCloseButton";
import BountiesAutoScrollIndicator from "./BountiesAutoScrollIndicator";
import { ThemeContextProvider } from "../../../../_bundle/Module3913";
import { ThemeTypes } from "../../../../_bundle/Module6678";
let isAndroid, zIndex, zIndex2, zIndex3, zIndex4, c9811_19, PX_8, _excluded, FOOTER_FADE_START_PROGRESS, FOOTER_FADE_END_PROGRESS, isScrollEventInBounds, BountiesRecapPullZone, useStyles, __initData, BountiesScrollVideoItemContainer, __initData2, __initData3, __initData4, __initData5, __initData6, __initData7, __initData8, __initData9, __initData10, __initData11, __initData12, __initData13, __initData14, __initData15, __initData16, __initData17, __initData18, __initData19, __initData20, BountiesModalContentScrollInner;
const ItemSeparator = function ItemSeparator(props) {
return props.trailingItem != null ? <View style={{
height: PX_8
}} /> : null;
};
BountiesRecapPullZone = function BountiesRecapPullZone(props) {
return <View style={{
height: props.height
}} />;
};
BountiesScrollVideoItemContainer = function BountiesScrollVideoItemContainer(props) {
const { index, slotHeight, scrollY, style, isPeekEnabled, children: children2 } = props;
const c = function c() {
const r19 = (scrollY.get() - index * slotHeight) / slotHeight;
return {
opacity: _ReanimatedRexport.interpolate(Math.abs(r19), [0, 0.3, 1], [1, 1, isPeekEnabled ? r19 < 0 ? index === 1 ? 0.8 : 0 : 0 : 0], _ReanimatedRexport.Extrapolation.CLAMP)
};
};
c.__closure = {
scrollY,
index,
slotHeight,
isPeekEnabled,
PEEK_OPACITY: 0.8,
interpolate: _ReanimatedRexport.interpolate,
FADE_DEADBAND: 0.3,
Extrapolation: _ReanimatedRexport.Extrapolation
};
c.__workletHash = 6532652233494;
c.__initData = __initData;
return <ReanimatedRexport.View style={[style, useAnimatedStyle(c)]}>{children2}</ReanimatedRexport.View>;
};
BountiesModalContentScrollInner = function BountiesModalContentScrollInner(props) {
let memo, questHomeBounties, state, orbAmount, ownedByVerticalScrollExperiment, rewardTimerSeconds, ownedByVerticalScrollExperiment2, isAutoScrollEnabled, c20862_13, height2, slotHeight2, c20862_16, c20862_17, height3, lastBounty, fullRecap, handleRecapMomentumEnd, state2, setState2, state3, setState3, setState4, setState5, state4, setState6, sharedValue, sharedValue2, sharedValue3, hasSingleUseSwipeUpNux, dismissSingleUseSwipeUpNux, hasRecurringSwipeUpNux, dismissRecurringSwipeUpNux, hasRecurringSwipeUpNux2, hasRecurringSwipeUpNux3, memo2, ref, ref2, peekScale, cancel, dismissOnClose, takeDidAutoScroll, onPlaybackTimeChange, onEndCardVisible, pauseCountdown, resumeCountdown, memo3, callback, callback2, bountiesRecapOrbCount, callback3, memo4, derivedValue;
let state5, width, height4, c20863_3;
const { initialBountyId, sourceQuestContent } = props;
memo = void 0;
questHomeBounties = void 0;
state = void 0;
orbAmount = void 0;
ownedByVerticalScrollExperiment = void 0;
rewardTimerSeconds = void 0;
ownedByVerticalScrollExperiment2 = void 0;
isAutoScrollEnabled = void 0;
c20862_13 = void 0;
height2 = void 0;
slotHeight2 = void 0;
c20862_16 = void 0;
c20862_17 = void 0;
height3 = void 0;
lastBounty = void 0;
fullRecap = void 0;
handleRecapMomentumEnd = void 0;
state2 = void 0;
setState2 = void 0;
state3 = void 0;
setState3 = void 0;
setState4 = void 0;
setState5 = void 0;
state4 = void 0;
setState6 = void 0;
sharedValue = void 0;
sharedValue2 = void 0;
sharedValue3 = void 0;
hasSingleUseSwipeUpNux = void 0;
dismissSingleUseSwipeUpNux = void 0;
hasRecurringSwipeUpNux = void 0;
dismissRecurringSwipeUpNux = void 0;
hasRecurringSwipeUpNux2 = void 0;
hasRecurringSwipeUpNux3 = void 0;
memo2 = void 0;
ref = void 0;
ref2 = void 0;
peekScale = void 0;
cancel = void 0;
dismissOnClose = void 0;
takeDidAutoScroll = void 0;
onPlaybackTimeChange = void 0;
onEndCardVisible = void 0;
pauseCountdown = void 0;
resumeCountdown = void 0;
memo3 = void 0;
callback = void 0;
callback2 = void 0;
bountiesRecapOrbCount = void 0;
callback3 = void 0;
memo4 = void 0;
derivedValue = void 0;
const styles = useStyles();
const height = useWindowDimensions_native().height;
const ref3 = useRef(null);
const [state6, setState] = useState(BOUNTIES_MODAL_BASE_FOOTER_HEIGHT);
const callback4 = useCallback((a0) => {
setState(Math.ceil(a0.nativeEvent.layout.height));
}, []);
state5 = state6;
width = void 0;
height4 = void 0;
c20863_3 = void 0;
const windowDimensions_native = useWindowDimensions_native();
width = windowDimensions_native.width;
height4 = windowDimensions_native.height;
const safeAreaInsets_native = useSafeAreaInsets_native();
c20863_3 = safeAreaInsets_native;
memo = useMemo(() => {
const r9 = width - c20863_3.left - c20863_3.right;
const r16 = height4 - c20863_3.top - state5;
let r18 = r9 / c9811_19;
let r7 = r9;
if (r18 > r16) {
r7 = r16 * c9811_19;
r18 = r16;
}
return {
top: c20863_3.top,
left: Math.floor(c20863_3.left + (r9 - r7) / 2),
width: Math.floor(r7),
height: Math.floor(r18)
};
}, [width, height4, safeAreaInsets_native.top, safeAreaInsets_native.left, safeAreaInsets_native.right, state5]);
questHomeBounties = useQuestHomeBounties().questHomeBounties;
state = _slicedToArray(useState(() => {
const r5 = questHomeBounties.findIndex((questHomeBounty) => questHomeBounty.id === initialBountyId);
return r5 <= 0 ? questHomeBounties : [...questHomeBounties.slice(r5), ...questHomeBounties.slice(0, r5)];
}), 1)[0];
const bountiesExperience = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
orbAmount = bountiesExperience.orbAmount;
ownedByVerticalScrollExperiment = bountiesExperience.ownedByVerticalScrollExperiment;
rewardTimerSeconds = bountiesExperience.rewardTimerSeconds;
const scrollAffordanceVariant = bountiesExperience.scrollAffordanceVariant;
ownedByVerticalScrollExperiment2 = ownedByVerticalScrollExperiment;
isAutoScrollEnabled = scrollAffordanceVariant === "auto";
const shouldUseScrollIndicatorOverlay = _BountiesVerticalScrollExperiment.shouldUseScrollIndicatorOverlay(scrollAffordanceVariant);
const stateFromStores = useStateFromStores([BountyStore], () => BountyStore.getCompletedBountyCount(state) * orbAmount, [state, orbAmount]);
const r121 = state[0];
c20862_13 = r121;
const stateFromStores2 = useStateFromStores([BountyStore], () => {
if (c20862_13 == null) {
return false;
}
const bountyVideoProgress = BountyStore.getBountyVideoProgress(c20862_13.id);
return bountyVideoProgress != null && bountyVideoProgress.maxTimestampSec >= rewardTimerSeconds;
}, [r121, rewardTimerSeconds]);
height2 = memo.height;
slotHeight2 = height2 + PX_8;
const lastBountyIndex = state.length - 1;
c20862_16 = lastBountyIndex;
const enabled = stateFromStores > 0;
c20862_17 = enabled;
height3 = height2;
lastBounty = lastBountyIndex * slotHeight2;
fullRecap = lastBounty + height2;
handleRecapMomentumEnd = useBountiesRecapScroll({
listRef: ref3,
enabled,
offsets: useMemo(() => ({
lastBounty,
fullRecap,
revealHeight: height3
}), [fullRecap, lastBounty, height2])
}).handleRecapMomentumEnd;
const memo5 = useMemo(() => {
const r5 = state.map((item, index) => index * slotHeight2);
if (c20862_17) {
r5.push(fullRecap);
}
return r5;
}, [state, fullRecap, enabled, slotHeight2]);
[state2, setState2] = useState(false);
[state3, setState3] = useState(false);
let state7;
[state7, setState4] = useState(true);
let state8;
[state8, setState5] = useState(false);
[state4, setState6] = useState(0);
sharedValue = useSharedValue(false);
sharedValue2 = useSharedValue(false);
sharedValue3 = useSharedValue(0);
const bountySwipeUpNux = useBountySwipeUpNux({
isEligible: state.length > 1,
location: QuestsExperimentLocations.VIDEO_MODAL_MOBILE
});
hasSingleUseSwipeUpNux = bountySwipeUpNux.hasSingleUseSwipeUpNux;
dismissSingleUseSwipeUpNux = bountySwipeUpNux.dismissSingleUseSwipeUpNux;
hasRecurringSwipeUpNux = bountySwipeUpNux.hasRecurringSwipeUpNux;
dismissRecurringSwipeUpNux = bountySwipeUpNux.dismissRecurringSwipeUpNux;
const r179 = state4 === 0;
let visible2 = r179 && hasSingleUseSwipeUpNux && stateFromStores2;
hasRecurringSwipeUpNux2 = scrollAffordanceVariant === "peek" && hasRecurringSwipeUpNux;
hasRecurringSwipeUpNux3 = shouldUseScrollIndicatorOverlay && hasRecurringSwipeUpNux;
memo2 = useMemo(() => v4(), []);
ref = useRef(0);
ref2 = useRef(0);
useEffect(() => {
ref.current = Date.now();
}, []);
const callback5 = useCallback((a0) => {
if (a0 === _AnalyticsTypes.VerticalScrollingDirection.DOWN) {
trackBountyAutoScrollDismissed({
verticalScrollingPosition: state4,
scrollSessionId: memo2
});
}
}, [state4, memo2]);
const enabled2 = isAutoScrollEnabled ? state4 < lastBountyIndex : isAutoScrollEnabled;
const mode = r179 ? hasRecurringSwipeUpNux ? "countdown" : "hint" : "hint";
let activeBountyId = state[state4]?.id;
if (activeBountyId == null) {
activeBountyId = null;
}
const bountiesAutoScroll = useBountiesAutoScroll({
listRef: ref3,
enabled: enabled2,
mode,
activeIndex: state4,
activeBountyId,
slotHeight: slotHeight2,
onCountdownCancelled: callback5
});
const { visible, peekActive, progress, showProgressRing } = bountiesAutoScroll;
peekScale = bountiesAutoScroll.peekScale;
cancel = bountiesAutoScroll.cancel;
dismissOnClose = bountiesAutoScroll.dismissOnClose;
takeDidAutoScroll = bountiesAutoScroll.takeDidAutoScroll;
onPlaybackTimeChange = bountiesAutoScroll.onPlaybackTimeChange;
onEndCardVisible = bountiesAutoScroll.onEndCardVisible;
pauseCountdown = bountiesAutoScroll.pauseCountdown;
resumeCountdown = bountiesAutoScroll.resumeCountdown;
memo3 = useMemo(() => ({
onPlaybackTimeChange,
onPaused: pauseCountdown,
onResumed: resumeCountdown,
onEndCardVisible
}), [onEndCardVisible, onPlaybackTimeChange, pauseCountdown, resumeCountdown]);
callback = useCallback(function(a0, scrollingType = BountyScrollingType.MANUAL) {
const current = ref2.current;
if (a0 !== current) {
ref2.current = a0;
const current2 = Date.now();
const timeWatchedPreScrollMs = current2 - ref.current;
ref.current = current2;
trackBountyVerticalScroll({
scrollingType,
scrollingDirection: a0 > current ? _AnalyticsTypes.VerticalScrollingDirection.DOWN : _AnalyticsTypes.VerticalScrollingDirection.UP,
verticalScrollingPosition: a0,
scrollSessionId: memo2,
timeWatchedPreScrollMs
});
}
}, [memo2]);
callback2 = useCallback((a0) => {
const r7 = takeDidAutoScroll();
setState6(a0);
callback(a0, r7 ? BountyScrollingType.AUTO : BountyScrollingType.MANUAL);
if (state4 === 0 && a0 > 0) {
if (hasSingleUseSwipeUpNux) {
dismissSingleUseSwipeUpNux(ContentDismissActionType.USER_DISMISS);
} else if (hasRecurringSwipeUpNux) {
dismissRecurringSwipeUpNux(ContentDismissActionType.USER_DISMISS);
}
}
}, [takeDidAutoScroll, callback, state4, hasSingleUseSwipeUpNux, hasRecurringSwipeUpNux, dismissSingleUseSwipeUpNux, dismissRecurringSwipeUpNux]);
bountiesRecapOrbCount = useBountiesRecapOrbCount({
scrollY: sharedValue3,
lastBountyScrollOffset: lastBounty,
recapRevealHeight: height2,
targetOrbAmount: stateFromStores,
enabled
});
useEffect(() => {
const r7 = state[state4];
if (r7 != null) {
markAdContentSeen(AdCreativeType.BOUNTY, [r7.id]);
}
}, [state, state4]);
const callback6 = useCallback(() => {
dismissOnClose();
const r10 = state[state4];
if (r10 != null) {
const bountyVideoProgress = BountyStore.getBountyVideoProgress(r10.id);
let r11 = bountyVideoProgress?.maxTimestampSec;
if (r11 == null) {
r11 = 0;
}
let r14 = bountyVideoProgress?.duration;
if (r14 == null) {
r14 = 0;
}
const r1 = 1000 * rewardTimerSeconds;
trackAdContentEvent({
adContentId: r10.id,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_MODAL_CLOSED,
properties: {
content_name: getQuestContentName(QuestContent.VIDEO_MODAL_MOBILE),
content_id: QuestContent.VIDEO_MODAL_MOBILE,
video_progress: formatVideoProgressRatio(r11, r14),
threshold_met: 1000 * r11 >= r1,
reward_timer_seconds: r1 / 1000
},
sourceQuestContent
});
}
BountiesModalActionCreators.hideModal();
}, [state, state4, dismissOnClose, rewardTimerSeconds, sourceQuestContent]);
callback3 = useCallback(() => {
trackAdContentEvent({
adContentId: DEFAULT_PLACEHOLDER_ENTRYPOINT_BOUNTY_ID,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_MODAL_CLOSED,
properties: {
content_name: getQuestContentName(QuestContent.BOUNTIES_END_INTERSTITIAL),
content_id: QuestContent.BOUNTIES_END_INTERSTITIAL
},
sourceQuestContent
});
BountiesModalActionCreators.hideModal();
}, [sourceQuestContent]);
const Tt = function Tt(a0) {
sharedValue3.set(a0.contentOffset.y);
if (sharedValue2.get()) {
const r28 = Math.max(0, a0.contentSize.height - a0.layoutMeasurement.height);
sharedValue.set(a0.contentOffset.y >= 0 && a0.contentOffset.y <= r28);
}
};
Tt.__closure = {
scrollY: sharedValue3,
isDraggingSharedValue: sharedValue2,
isScrollingInBoundsSharedValue: sharedValue,
isScrollEventInBounds
};
Tt.__workletHash = 7942598540397;
Tt.__initData = __initData2;
const Bt = function Bt(a0) {
sharedValue2.set(true);
const r23 = Math.max(0, a0.contentSize.height - a0.layoutMeasurement.height);
sharedValue.set(a0.contentOffset.y >= 0 && a0.contentOffset.y <= r23);
};
Bt.__closure = {
isDraggingSharedValue: sharedValue2,
isScrollingInBoundsSharedValue: sharedValue,
isScrollEventInBounds
};
Bt.__workletHash = 14039038912528;
Bt.__initData = __initData3;
const Ct = function Ct(a0) {
const r6 = a0.contentOffset.y < 0 ? _AnalyticsTypes.VerticalScrollingDirection.DOWN : _AnalyticsTypes.VerticalScrollingDirection.UP;
_ReanimatedRexport.runOnJS(cancel)(r6);
sharedValue2.set(false);
if (!isAndroid) {
sharedValue.set(false);
}
};
Ct.__closure = {
VerticalScrollingDirection: _AnalyticsTypes.VerticalScrollingDirection,
runOnJS: _ReanimatedRexport.runOnJS,
cancelScrollAffordance: cancel,
isDraggingSharedValue: sharedValue2,
IS_ANDROID: isAndroid,
isScrollingInBoundsSharedValue: sharedValue
};
Ct.__workletHash = 10752087179842;
Ct.__initData = __initData4;
const It = function It(a0) {
if (c20862_17) {
_ReanimatedRexport.runOnJS(handleRecapMomentumEnd)(a0);
}
sharedValue.set(false);
};
It.__closure = {
showRecapPullZone: enabled,
runOnJS: _ReanimatedRexport.runOnJS,
handleRecapMomentumEnd,
isScrollingInBoundsSharedValue: sharedValue
};
It.__workletHash = 13684210320337;
It.__initData = __initData5;
const animatedScrollHandler = useAnimatedScrollHandler({
onScroll: Tt,
onBeginDrag: Bt,
onEndDrag: Ct,
onMomentumEnd: It
});
const xt = () => Math.min(Math.max(Math.round(sharedValue3.get() / slotHeight2), 0), c20862_16);
xt.__closure = {
scrollY: sharedValue3,
slotHeight: slotHeight2,
lastBountyIndex
};
xt.__workletHash = 14048843158960;
xt.__initData = __initData6;
const mt = function mt(a0, a1) {
if (a0 !== a1) {
_ReanimatedRexport.runOnJS(callback2)(a0);
}
};
mt.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
commitSwipe: callback2
};
mt.__workletHash = 14015091539518;
mt.__initData = __initData7;
useAnimatedReaction(xt, mt);
const wt = () => c20862_17 && sharedValue3.get() >= lastBounty - _useBountiesRecapScroll.RECAP_SNAP_EPSILON;
wt.__closure = {
showRecapPullZone: enabled,
scrollY: sharedValue3,
lastBountyScrollOffset: lastBounty,
RECAP_SNAP_EPSILON: _useBountiesRecapScroll.RECAP_SNAP_EPSILON
};
wt.__workletHash = 6584708256992;
wt.__initData = __initData8;
const yt = function yt(a0, a1) {
if (a0 !== a1) {
_ReanimatedRexport.runOnJS(setState5)(a0);
}
};
yt.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
setShowRecapFooter: setState5
};
yt.__workletHash = 10788669301891;
yt.__initData = __initData9;
useAnimatedReaction(wt, yt);
const Nt = () => c20862_17 && sharedValue3.get() > lastBounty;
Nt.__closure = {
showRecapPullZone: enabled,
scrollY: sharedValue3,
lastBountyScrollOffset: lastBounty
};
Nt.__workletHash = 6186370630693;
Nt.__initData = __initData10;
const Mt = function Mt(a0, a1) {
if (a0 !== a1) {
_ReanimatedRexport.runOnJS(setState2)(a0);
}
};
Mt.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
setIsRecapPageRevealed: setState2
};
Mt.__workletHash = 12713474352874;
Mt.__initData = __initData11;
useAnimatedReaction(Nt, Mt);
const Vt = () => c20862_17 && sharedValue3.get() >= fullRecap - _useBountiesRecapScroll.RECAP_SNAP_EPSILON;
Vt.__closure = {
showRecapPullZone: enabled,
scrollY: sharedValue3,
fullRecapScrollOffset: fullRecap,
RECAP_SNAP_EPSILON: _useBountiesRecapScroll.RECAP_SNAP_EPSILON
};
Vt.__workletHash = 5669564400667;
Vt.__initData = __initData12;
const bt = function bt(a0, a1) {
if (a0 !== a1) {
_ReanimatedRexport.runOnJS(setState3)(a0);
}
};
bt.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
setIsRecapPageOnTop: setState3
};
bt.__workletHash = 8102193741774;
bt.__initData = __initData13;
useAnimatedReaction(Vt, bt);
const memo6 = useMemo(() => c20862_17 ? <BountiesRecapPullZone height={height3} /> : null, [height2, enabled]);
const memo7 = useMemo(() => [styles.listWrapper, {
top: 0,
left: memo.left,
width: memo.width,
height: memo.top + memo.height + 97
}], [styles.listWrapper, memo]);
const memo8 = useMemo(() => ({
paddingTop: memo.top,
paddingBottom: 97
}), [memo.top]);
memo4 = useMemo(() => ({
width: memo.width,
height: memo.height
}), [memo.width, memo.height]);
const memo9 = useMemo(() => [styles.closeButton, {
top: memo.top + Module712.space.PX_8,
left: memo.left + memo.width - Module712.space.PX_32 - Module712.space.PX_8
}], [styles.closeButton, memo.top, memo.left, memo.width]);
const memo10 = useMemo(() => [styles.autoScrollIndicator, {
top: memo.top + AUTO_SCROLL_PEEK_TOP_OFFSET + memo.height * AUTO_SCROLL_PEEK_SCALE + Module712.space.PX_32,
left: memo.left,
width: memo.width
}], [styles.autoScrollIndicator, memo.top, memo.height, memo.left, memo.width]);
const memo11 = useMemo(() => [styles.recapPage, {
top: memo.top,
left: memo.left,
width: memo.width,
height: height - memo.top,
...state3 ? {
zIndex: zIndex4
} : null
}], [state3, styles.recapPage, memo.top, memo.left, memo.width, height]);
const Ft = () => _useBountiesRecapScroll.getRevealProgress(sharedValue3.get(), lastBounty, height3);
Ft.__closure = {
getRevealProgress: _useBountiesRecapScroll.getRevealProgress,
scrollY: sharedValue3,
lastBountyScrollOffset: lastBounty,
recapRevealHeight: height2
};
Ft.__workletHash = 8427964721554;
Ft.__initData = __initData14;
derivedValue = useDerivedValue(Ft);
const Yt = () => ({
opacity: _ReanimatedRexport.interpolate(derivedValue.get(), [0, 1], [0, 1], _ReanimatedRexport.Extrapolation.CLAMP)
});
Yt.__closure = {
interpolate: _ReanimatedRexport.interpolate,
recapPullProgress: derivedValue,
Extrapolation: _ReanimatedRexport.Extrapolation
};
Yt.__workletHash = 1497321349449;
Yt.__initData = __initData15;
const animatedStyle = useAnimatedStyle(Yt);
const Jt = () => ({
opacity: _ReanimatedRexport.interpolate(derivedValue.get(), [FOOTER_FADE_START_PROGRESS, FOOTER_FADE_END_PROGRESS], [1, 0], _ReanimatedRexport.Extrapolation.CLAMP)
});
Jt.__closure = {
interpolate: _ReanimatedRexport.interpolate,
recapPullProgress: derivedValue,
FOOTER_FADE_START_PROGRESS,
FOOTER_FADE_END_PROGRESS,
Extrapolation: _ReanimatedRexport.Extrapolation
};
Jt.__workletHash = 3685190194249;
Jt.__initData = __initData16;
const animatedStyle2 = useAnimatedStyle(Jt);
const Ut = function Ut() {
return {
opacity: _ReanimatedRexport.interpolate(sharedValue3.get() >= lastBounty - slotHeight2 / 2 ? derivedValue.get() : _useBountiesRecapScroll.getRevealProgress(sharedValue3.get(), 0, height3), [FOOTER_FADE_START_PROGRESS, FOOTER_FADE_END_PROGRESS], [1, 0], _ReanimatedRexport.Extrapolation.CLAMP)
};
};
Ut.__closure = {
scrollY: sharedValue3,
lastBountyScrollOffset: lastBounty,
slotHeight: slotHeight2,
recapPullProgress: derivedValue,
getRevealProgress: _useBountiesRecapScroll.getRevealProgress,
recapRevealHeight: height2,
interpolate: _ReanimatedRexport.interpolate,
FOOTER_FADE_START_PROGRESS,
FOOTER_FADE_END_PROGRESS,
Extrapolation: _ReanimatedRexport.Extrapolation
};
Ut.__workletHash = 15092194442650;
Ut.__initData = __initData17;
const animatedStyle3 = useAnimatedStyle(Ut);
const memo12 = useMemo(() => [styles.peekGradient, {
left: memo.left,
width: memo.width,
top: memo.top + memo.height,
bottom: 0
}], [styles.peekGradient, memo.left, memo.width, memo.top, memo.height]);
const Gt = () => ({
opacity: _ReanimatedRexport.interpolate(sharedValue3.get(), [0, slotHeight2], [1, 0], _ReanimatedRexport.Extrapolation.CLAMP)
});
Gt.__closure = {
interpolate: _ReanimatedRexport.interpolate,
scrollY: sharedValue3,
slotHeight: slotHeight2,
Extrapolation: _ReanimatedRexport.Extrapolation
};
Gt.__workletHash = 5908400559291;
Gt.__initData = __initData18;
const animatedStyle4 = useAnimatedStyle(Gt);
const Zt = () => derivedValue.get() < FOOTER_FADE_END_PROGRESS;
Zt.__closure = {
recapPullProgress: derivedValue,
FOOTER_FADE_END_PROGRESS
};
Zt.__workletHash = 547045699209;
Zt.__initData = __initData19;
const Qt = function Qt(a0, a1) {
if (a0 !== a1) {
_ReanimatedRexport.runOnJS(setState4)(a0);
}
};
Qt.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
setIsCloseButtonPressable: setState4
};
Qt.__workletHash = 6290671204687;
Qt.__initData = __initData20;
useAnimatedReaction(Zt, Qt);
const callback7 = useCallback(({ item, index: index2 }) => {
const shouldLoadHls = ownedByVerticalScrollExperiment ? index2 === state4 || index2 === state4 + 1 : true;
const isActive = index2 === state4;
let isScrollIndicatorOverlayEnabled = hasRecurringSwipeUpNux3;
if (hasRecurringSwipeUpNux3) {
isScrollIndicatorOverlayEnabled = index2 === 0;
}
return <BountiesScrollVideoItemContainer index={index2} slotHeight={slotHeight2} scrollY={sharedValue3} style={memo4} isPeekEnabled={hasRecurringSwipeUpNux2}>
<BountiesScrollVideoItem key={item.id} bounty={item} sourceQuestContent={sourceQuestContent} width={memo.width} height={memo.height} index={index2} isActive={isActive} isRecapPageRevealed={state2} isRecapPageOnTop={state3} isScrollingInBoundsSharedValue={sharedValue} isScrollIndicatorOverlayEnabled={isScrollIndicatorOverlayEnabled} shouldLoadHls={shouldLoadHls} scrollAffordance={isAutoScrollEnabled ? memo3 : void 0} peekScale={isActive ? isAutoScrollEnabled ? peekScale : void 0 : void 0} softDownloadCapsEnabled={ownedByVerticalScrollExperiment2} />
</BountiesScrollVideoItemContainer>;
}, [slotHeight2, sharedValue3, memo4, hasRecurringSwipeUpNux2, isAutoScrollEnabled, peekScale, sourceQuestContent, memo.width, memo.height, state4, state2, state3, sharedValue, hasRecurringSwipeUpNux3, memo3, ownedByVerticalScrollExperiment, ownedByVerticalScrollExperiment]);
const memo13 = useMemo(() => ({
activeIndex: state4,
isRecapPageRevealed: state2,
isRecapPageOnTop: state3,
width: memo.width,
height: memo.height,
isPeekEnabled: hasRecurringSwipeUpNux2,
isAutoScrollEnabled,
canShowScrollIndicatorOverlay: hasRecurringSwipeUpNux3,
ownedByVerticalScrollExperiment,
isSoftCapPreload: ownedByVerticalScrollExperiment2
}), [state4, state2, state3, memo.width, memo.height, hasRecurringSwipeUpNux2, isAutoScrollEnabled, hasRecurringSwipeUpNux3, ownedByVerticalScrollExperiment, ownedByVerticalScrollExperiment]);
const callback8 = useCallback((a0) => {
a0.size = height2;
}, [height2]);
if (state.length === 0) {
return null;
}
const r496 = visible2 ? <BountiesScrollPromptNuxFooter /> : state8 ? <BountiesScrollRecapFooter orbAmount={stateFromStores} /> : null;
const r515 = [<BountiesAutoScrollOverlayNuxGradient active={peekActive} />, enabled ? <ReanimatedRexport.View style={[memo11, animatedStyle]} pointerEvents={state3 ? "box-none" : "none"}>
<QuestContentImpressionTrackerNative adContentId={DEFAULT_PLACEHOLDER_ENTRYPOINT_BOUNTY_ID} adCreativeType={AdCreativeType.BOUNTY} questContent={QuestContent.BOUNTIES_END_INTERSTITIAL} overrideVisibility={state3} sourceQuestContent={sourceQuestContent}>
{() => <BountiesScrollRecapPage orbAmount={bountiesRecapOrbCount} onClose={callback3} style={{
flex: 1
}} />}
</QuestContentImpressionTrackerNative>
</ReanimatedRexport.View> : null, <View style={memo7}>
<AnimatedFlashList ref={ref3} data={state} keyExtractor={(item) => item.id} renderItem={callback7} extraData={memo13} overrideItemLayout={callback8} ItemSeparatorComponent={ItemSeparator} ListFooterComponent={memo6} snapToOffsets={memo5} snapToEnd={false} decelerationRate={0.85} showsVerticalScrollIndicator={false} drawDistance={slotHeight2} onScroll={animatedScrollHandler} scrollEventThrottle={16} contentContainerStyle={memo8} />
</View>, hasRecurringSwipeUpNux2 ? state.length > 1 ? <ReanimatedRexport.View pointerEvents="none" style={[memo12, animatedStyle4]}>
<Module4611 colors={_excluded} style={StyleSheet.absoluteFill} />
</ReanimatedRexport.View> : null : null, <ReanimatedRexport.View style={[memo9, animatedStyle2]} pointerEvents={state7 ? "box-none" : "none"}>
{state7 ? <BountiesModalCloseButton onPress={callback6} /> : null}
</ReanimatedRexport.View>, visible ? <View style={memo10} pointerEvents="none">
<BountiesAutoScrollIndicator progress={progress} showProgressRing={showProgressRing} />
</View> : null, ,];
if (!visible2) {
visible2 = state8;
}
r515[6] = <BountiesScrollPromptFooter visible={visible2} onContentLayout={callback4} zIndex={zIndex4} opacityStyle={animatedStyle3}>{r496}</BountiesScrollPromptFooter>;
return <View style={styles.root}>{r515}</View>;
};
isAndroid = _Module501.isAndroid();
zIndex = 0;
zIndex2 = 1;
zIndex3 = 2;
zIndex4 = 3;
c9811_19 = 0.5625;
PX_8 = Module712.space.PX_8;
_excluded = ["rgba(0,0,0,0)", "rgba(0,0,0,0.75)"];
FOOTER_FADE_START_PROGRESS = 0.05;
FOOTER_FADE_END_PROGRESS = 0.1;
const isScrollEventInBounds2 = function isScrollEventInBounds(a0) {
const r12 = Math.max(0, a0.contentSize.height - a0.layoutMeasurement.height);
return a0.contentOffset.y >= 0 && a0.contentOffset.y <= r12;
};
isScrollEventInBounds2.__closure = {};
isScrollEventInBounds2.__workletHash = 14148486927190;
isScrollEventInBounds2.__initData = {
code: "function isScrollEventInBounds_BountiesModalContentScrollTsx1(event){const maxOffset=Math.max(0,event.contentSize.height-event.layoutMeasurement.height);return event.contentOffset.y>=0&&event.contentOffset.y<=maxOffset;}"
};
isScrollEventInBounds = isScrollEventInBounds2;
useStyles = createStyles(() => ({
root: {
flex: 1
},
recapPage: {
position: "absolute",
zIndex
},
listWrapper: {
position: "absolute",
zIndex: zIndex2,
overflow: "hidden"
},
closeButton: {
position: "absolute",
zIndex: zIndex4
},
peekGradient: {
position: "absolute",
zIndex: zIndex3
},
autoScrollIndicator: {
position: "absolute",
zIndex: zIndex4,
alignItems: "center"
}
}));
__initData = {
code: "function BountiesModalContentScrollTsx2(){const{scrollY,index,slotHeight,isPeekEnabled,PEEK_OPACITY,interpolate,FADE_DEADBAND,Extrapolation}=this.__closure;const signedDistance=(scrollY.get()-index*slotHeight)/slotHeight;const distance=Math.abs(signedDistance);const peekOpacity=isPeekEnabled&&signedDistance<0&&index===1?PEEK_OPACITY:0;const opacity=interpolate(distance,[0,FADE_DEADBAND,1],[1,1,peekOpacity],Extrapolation.CLAMP);return{opacity:opacity};}"
};
__initData2 = {
code: "function BountiesModalContentScrollTsx3(event){const{scrollY,isDraggingSharedValue,isScrollingInBoundsSharedValue,isScrollEventInBounds}=this.__closure;scrollY.set(event.contentOffset.y);if(isDraggingSharedValue.get()){isScrollingInBoundsSharedValue.set(isScrollEventInBounds(event));}}"
};
__initData3 = {
code: "function BountiesModalContentScrollTsx4(event){const{isDraggingSharedValue,isScrollingInBoundsSharedValue,isScrollEventInBounds}=this.__closure;isDraggingSharedValue.set(true);isScrollingInBoundsSharedValue.set(isScrollEventInBounds(event));}"
};
__initData4 = {
code: "function BountiesModalContentScrollTsx5(event){const{VerticalScrollingDirection,runOnJS,cancelScrollAffordance,isDraggingSharedValue,IS_ANDROID,isScrollingInBoundsSharedValue}=this.__closure;const scrollingDirection=event.contentOffset.y<0?VerticalScrollingDirection.DOWN:VerticalScrollingDirection.UP;runOnJS(cancelScrollAffordance)(scrollingDirection);isDraggingSharedValue.set(false);if(!IS_ANDROID){isScrollingInBoundsSharedValue.set(false);}}"
};
__initData5 = {
code: "function BountiesModalContentScrollTsx6(event){const{showRecapPullZone,runOnJS,handleRecapMomentumEnd,isScrollingInBoundsSharedValue}=this.__closure;if(showRecapPullZone){runOnJS(handleRecapMomentumEnd)(event);}isScrollingInBoundsSharedValue.set(false);}"
};
__initData6 = {
code: "function BountiesModalContentScrollTsx7(){const{scrollY,slotHeight,lastBountyIndex}=this.__closure;return Math.min(Math.max(Math.round(scrollY.get()/slotHeight),0),lastBountyIndex);}"
};
__initData7 = {
code: "function BountiesModalContentScrollTsx8(next,prev){const{runOnJS,commitSwipe}=this.__closure;if(next!==prev){runOnJS(commitSwipe)(next);}}"
};
__initData8 = {
code: "function BountiesModalContentScrollTsx9(){const{showRecapPullZone,scrollY,lastBountyScrollOffset,RECAP_SNAP_EPSILON}=this.__closure;return showRecapPullZone&&scrollY.get()>=lastBountyScrollOffset-RECAP_SNAP_EPSILON;}"
};
__initData9 = {
code: "function BountiesModalContentScrollTsx10(show,previousShow){const{runOnJS,setShowRecapFooter}=this.__closure;if(show!==previousShow){runOnJS(setShowRecapFooter)(show);}}"
};
__initData10 = {
code: "function BountiesModalContentScrollTsx11(){const{showRecapPullZone,scrollY,lastBountyScrollOffset}=this.__closure;return showRecapPullZone&&scrollY.get()>lastBountyScrollOffset;}"
};
__initData11 = {
code: "function BountiesModalContentScrollTsx12(revealed,previousRevealed){const{runOnJS,setIsRecapPageRevealed}=this.__closure;if(revealed!==previousRevealed){runOnJS(setIsRecapPageRevealed)(revealed);}}"
};
__initData12 = {
code: "function BountiesModalContentScrollTsx13(){const{showRecapPullZone,scrollY,fullRecapScrollOffset,RECAP_SNAP_EPSILON}=this.__closure;return showRecapPullZone&&scrollY.get()>=fullRecapScrollOffset-RECAP_SNAP_EPSILON;}"
};
__initData13 = {
code: "function BountiesModalContentScrollTsx14(onTop,previousOnTop){const{runOnJS,setIsRecapPageOnTop}=this.__closure;if(onTop!==previousOnTop){runOnJS(setIsRecapPageOnTop)(onTop);}}"
};
__initData14 = {
code: "function BountiesModalContentScrollTsx15(){const{getRevealProgress,scrollY,lastBountyScrollOffset,recapRevealHeight}=this.__closure;return getRevealProgress(scrollY.get(),lastBountyScrollOffset,recapRevealHeight);}"
};
__initData15 = {
code: "function BountiesModalContentScrollTsx16(){const{interpolate,recapPullProgress,Extrapolation}=this.__closure;return{opacity:interpolate(recapPullProgress.get(),[0,1],[0,1],Extrapolation.CLAMP)};}"
};
__initData16 = {
code: "function BountiesModalContentScrollTsx17(){const{interpolate,recapPullProgress,FOOTER_FADE_START_PROGRESS,FOOTER_FADE_END_PROGRESS,Extrapolation}=this.__closure;return{opacity:interpolate(recapPullProgress.get(),[FOOTER_FADE_START_PROGRESS,FOOTER_FADE_END_PROGRESS],[1,0],Extrapolation.CLAMP)};}"
};
__initData17 = {
code: "function BountiesModalContentScrollTsx18(){const{scrollY,lastBountyScrollOffset,slotHeight,recapPullProgress,getRevealProgress,recapRevealHeight,interpolate,FOOTER_FADE_START_PROGRESS,FOOTER_FADE_END_PROGRESS,Extrapolation}=this.__closure;const progress=scrollY.get()>=lastBountyScrollOffset-slotHeight/2?recapPullProgress.get():getRevealProgress(scrollY.get(),0,recapRevealHeight);return{opacity:interpolate(progress,[FOOTER_FADE_START_PROGRESS,FOOTER_FADE_END_PROGRESS],[1,0],Extrapolation.CLAMP)};}"
};
__initData18 = {
code: "function BountiesModalContentScrollTsx19(){const{interpolate,scrollY,slotHeight,Extrapolation}=this.__closure;return{opacity:interpolate(scrollY.get(),[0,slotHeight],[1,0],Extrapolation.CLAMP)};}"
};
__initData19 = {
code: "function BountiesModalContentScrollTsx20(){const{recapPullProgress,FOOTER_FADE_END_PROGRESS}=this.__closure;return recapPullProgress.get()<FOOTER_FADE_END_PROGRESS;}"
};
__initData20 = {
code: "function BountiesModalContentScrollTsx21(pressable,previousPressable){const{runOnJS,setIsCloseButtonPressable}=this.__closure;if(pressable!==previousPressable){runOnJS(setIsCloseButtonPressable)(pressable);}}"
};
export default function BountiesModalContentScroll(props) {
return <ThemeContextProvider theme={ThemeTypes.DARKER}>
<BountiesModalContentScrollInner initialBountyId={props.bountyId} sourceQuestContent={props.sourceQuestContent} />
</ThemeContextProvider>;
};
@@ -0,0 +1,56 @@
// Metro module 14088 (f14089).
import { StyleSheet, View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import Module4611 from "../../../../_bundle/Module4611";
import BountiesEndCardPressableCta from "./BountiesEndCardPressableCta";
let __initData;
const useStyles = createStyles(() => ({
container: {
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
justifyContent: "center",
alignItems: "center"
},
backdropTint: {
...StyleSheet.absoluteFillObject,
backgroundColor: "rgba(241, 251, 169, 0.15)"
},
backdropGradient: {
...StyleSheet.absoluteFillObject
}
}));
__initData = {
code: "function BountiesModalEndCardTsx1(){const{withTiming,visible,timingStandard}=this.__closure;return{opacity:withTiming(visible?1:0,timingStandard)};}"
};
export default function BountiesModalEndCard(props) {
const bounty = props.bounty;
let visible2 = props.visible;
const visible = visible2;
const sourceQuestContent = props.sourceQuestContent;
const styles = useStyles();
const y = () => ({
opacity: _timing.withTiming(visible ? 1 : 0, _timingPresets.timingStandard)
});
y.__closure = {
withTiming: _timing.withTiming,
visible,
timingStandard: _timingPresets.timingStandard
};
y.__workletHash = 15062259404736;
y.__initData = __initData;
const animatedStyle = useAnimatedStyle(y);
if (visible) {
visible2 = <ReanimatedRexport.View style={[styles.container, animatedStyle]} pointerEvents="box-none">
<View style={styles.backdropTint} />
<Module4611 colors={["rgba(0, 0, 0, 0.60)", "rgba(0, 0, 0, 1)"]} locations={[0, 0.841]} style={styles.backdropGradient} />
<BountiesEndCardPressableCta bounty={bounty} sourceQuestContent={sourceQuestContent} />
</ReanimatedRexport.View>;
}
return visible2;
};
@@ -0,0 +1,61 @@
// Metro module 14072 (f14073).
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useGetQuestImpressionId } from "../../lib/analytics/ContentImpressionTrackerHooks";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { getBountyCtaInfo } from "./BountyCtaHelpers";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { openAdGameLinkDirectly } from "../../utils/QuestPlatformUtils";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { QuestContent } from "../../../../_bundle/Module5038";
import { QuestContentCTA } from "../../lib/analytics/AnalyticsTypes";
import { intl, t } from "../../../../intl/index.native";
let __initData;
const useStyles = createStyles(() => ({
container: {
gap: Module712.space.PX_8
}
}));
__initData = {
code: "function BountiesModalEndedCtaButtonsTsx1(){const{withTiming,visible,timingStandard}=this.__closure;return{opacity:withTiming(visible?1:0,timingStandard)};}"
};
export default function BountiesModalEndedCtaButtons(props) {
const bounty = props.bounty;
let visible2 = props.visible;
const visible = visible2;
const { sourceQuestContent, onClose, showCloseButton = true, disabled = false } = props;
const styles = useStyles();
const getQuestImpressionId = useGetQuestImpressionId();
const y = () => ({
opacity: _timing.withTiming(visible ? 1 : 0, _timingPresets.timingStandard)
});
y.__closure = {
withTiming: _timing.withTiming,
visible,
timingStandard: _timingPresets.timingStandard
};
y.__workletHash = 11417131685254;
y.__initData = __initData;
const animatedStyle = useAnimatedStyle(y);
const bountyCtaInfo = getBountyCtaInfo(bounty);
if (visible) {
visible2 = <ReanimatedRexport.View style={[styles.container, animatedStyle]}>
<Button variant="primary-overlay" text={bountyCtaInfo.buttonLabel} size="lg" disabled={disabled} onPress={() => {
openAdGameLinkDirectly({
adContentId: bounty.id,
adCreativeType: AdCreativeType.BOUNTY,
cta: bounty.cta
}, {
content: QuestContent.VIDEO_MODAL_END_CARD,
ctaContent: QuestContentCTA.OPEN_GAME_LINK,
impressionId: getQuestImpressionId(),
sourceQuestContent
});
}} />
{showCloseButton ? <Button variant="secondary-overlay" text={intl.string(t.cpT0Cq)} size="lg" disabled={disabled} onPress={onClose} /> : null}
</ReanimatedRexport.View>;
}
return visible2;
};
@@ -0,0 +1,98 @@
// Metro module 14062 (f14063).
import { useState } from "react";
import { StyleSheet, View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
let __initData, __initData2;
const useStyles = createStyles(() => ({
progressContainer: {
height: 4
},
progressTrack: {
...StyleSheet.absoluteFillObject,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT,
opacity: 0.54
},
progressBar: {
position: "absolute",
height: "100%",
left: 0,
bottom: 0,
borderRadius: Module712.radii.round,
backgroundColor: Module712.unsafe_rawColors.GREEN_300,
shadowOffset: {
width: 0,
height: 0
},
shadowRadius: 8,
shadowOpacity: 1,
elevation: 4,
shadowColor: "#30C773"
},
progressBarGlowLayer: {
position: "absolute",
height: "100%",
left: 0,
bottom: 0,
borderRadius: Module712.radii.round,
backgroundColor: Module712.unsafe_rawColors.GREEN_300,
shadowOffset: {
width: 0,
height: 0
},
shadowRadius: 12,
shadowOpacity: 1,
elevation: 8,
shadowColor: Module712.unsafe_rawColors.GREEN_300
}
}));
__initData = {
code: "function BountiesModalProgressTsx1(){const{withTiming,visible,timingFast}=this.__closure;return{opacity:withTiming(visible?1:0,timingFast)};}"
};
__initData2 = {
code: "function BountiesModalProgressTsx2(){const{withTiming,progress,shouldSkipAnimation,timingNone,timingFast}=this.__closure;return{width:withTiming(progress*100+\"%\",shouldSkipAnimation?timingNone:timingFast,'animate-always')};}"
};
export default function BountiesModalProgress(props) {
const { progress, visible, style } = props;
const styles = useStyles();
const [state, setState] = useState(false);
const [state2, setState2] = useState(progress);
if (progress !== state2) {
setState2(progress);
setState(progress < state2);
}
const O = () => ({
opacity: _timing.withTiming(visible ? 1 : 0, _timingPresets.timingFast)
});
O.__closure = {
withTiming: _timing.withTiming,
visible,
timingFast: _timingPresets.timingFast
};
O.__workletHash = 5158131592262;
O.__initData = __initData;
const animatedStyle = useAnimatedStyle(O);
const B = () => ({
width: _timing.withTiming(100 * progress + "%", state ? _timingPresets.timingNone : _timingPresets.timingFast, "animate-always")
});
B.__closure = {
withTiming: _timing.withTiming,
progress,
shouldSkipAnimation: state,
timingNone: _timingPresets.timingNone,
timingFast: _timingPresets.timingFast
};
B.__workletHash = 15586067343237;
B.__initData = __initData2;
const animatedStyle2 = useAnimatedStyle(B);
return <ReanimatedRexport.View style={[styles.progressContainer, style, animatedStyle]}>
<View style={styles.progressTrack} />
<ReanimatedRexport.View style={[styles.progressBarGlowLayer, animatedStyle2]} />
<ReanimatedRexport.View style={[styles.progressBar, animatedStyle2]} />
</ReanimatedRexport.View>;
};
export const PROGRESS_BAR_HEIGHT = 4;
@@ -0,0 +1,171 @@
// Metro module 14068 (f14069).
import { useEffect, useRef } from "react";
import { View } from "react-native";
import { SMALL_BUTTON_HEIGHT } from "../../../../design/components/Button/native/ButtonConstants.native";
import ReanimatedRexport, { Easing, useSharedValue, withSequence, withDelay, useAnimatedProps, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import Module8531, { Circle } from "../../../../_bundle/Module8531";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { isAndroid } from "../../../../utils/PlatformUtils";
import { withTiming } from "../../../../design/animation/reanimated/timing/timing";
import { Text } from "../../../../design/components/Text/native/Text";
import { CheckmarkSmallBoldIcon } from "../../../../design/components/Icon/native/redesign/generated/CheckmarkSmallBoldIcon";
const stroke = "#2ECC71";
let c9839_8 = (SMALL_BUTTON_HEIGHT - 4) / 2;
const PROGRESS_CIRCUMFERENCE = 2 * Math.PI * c9839_8;
const easing = Easing.bezier(0.15, 0.21, 0.58, 1);
const easing2 = Easing.bezier(0.61, 0, 0.58, 1);
const easing3 = Easing.bezier(0.42, 0, 0.58, 1);
const AnimatedComponent = ReanimatedRexport.createAnimatedComponent(Circle);
const useStyles = createStyles({
progress: {
alignItems: "center",
justifyContent: "center",
backgroundColor: Module712.colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT,
borderRadius: Module712.radii.round,
width: SMALL_BUTTON_HEIGHT,
height: SMALL_BUTTON_HEIGHT
},
ring: {
position: "absolute",
transform: [{
rotate: "-90deg"
}]
},
trackPath: {
color: Module712.colors.BACKGROUND_SURFACE_HIGHEST
},
countdownText: {
color: Module712.colors.CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT,
lineHeight: isAndroid() ? 14 : void 0
},
checkmarkLayer: {
position: "absolute",
inset: 6,
alignItems: "center",
justifyContent: "center"
},
checkmarkBackground: {
width: 20,
height: 20,
backgroundColor: "#2ECC71",
borderRadius: Module712.radii.round
},
checkmarkIcon: {
width: 20,
height: 20
}
});
const __initData = {
code: "function BountiesModalTimerTsx1(){const{PROGRESS_CIRCUMFERENCE,animatedProgress}=this.__closure;return{strokeDashoffset:PROGRESS_CIRCUMFERENCE-PROGRESS_CIRCUMFERENCE*animatedProgress.get()};}"
};
const __initData2 = {
code: "function BountiesModalTimerTsx2(){const{checkmarkBackgroundScale}=this.__closure;return{transform:[{scale:checkmarkBackgroundScale.get()}]};}"
};
const __initData3 = {
code: "function BountiesModalTimerTsx3(){const{checkmarkScale}=this.__closure;return{transform:[{scale:checkmarkScale.get()}]};}"
};
export default function BountiesModalTimer(props) {
let r31;
let ref;
const { isCompleted, totalSeconds, remainingSeconds } = props;
ref = void 0;
const styles = useStyles();
const r12 = isCompleted || remainingSeconds <= 0;
let c20883_0 = r12;
const r21 = Math.max(1, Math.ceil(remainingSeconds));
let c20883_1 = 0;
if (isCompleted) {
c20883_1 = 1;
r31 = 1;
} else {
const r5 = totalSeconds > 0;
r31 = 0;
if (r5) {
const r3 = 1 - remainingSeconds / totalSeconds;
c20883_1 = r3;
r31 = r3;
}
}
const sharedValue = useSharedValue(r31);
const sharedValue2 = useSharedValue(0);
const sharedValue3 = useSharedValue(0);
useEffect(() => {
sharedValue.set(withTiming(c20883_1, {
duration: 500
}, "animate-always"));
}, [sharedValue, r31]);
ref = useRef(false);
useEffect(() => {
const current = ref.current;
ref.current = true;
if (c20883_0) {
if (current) {
sharedValue2.set(withSequence(withTiming(1.65, {
duration: 267,
easing
}), withTiming(1, {
duration: 233,
easing: easing2
})));
sharedValue3.set(withDelay(167, withSequence(withTiming(1.25, {
duration: 167,
easing: easing3
}), withTiming(1, {
duration: 333,
easing: easing3
}))));
} else {
sharedValue2.set(1);
sharedValue3.set(1);
}
} else {
sharedValue2.set(0);
sharedValue3.set(0);
}
}, [r12, sharedValue2, sharedValue3]);
const U = () => ({
strokeDashoffset: PROGRESS_CIRCUMFERENCE - PROGRESS_CIRCUMFERENCE * sharedValue.get()
});
U.__closure = {
PROGRESS_CIRCUMFERENCE,
animatedProgress: sharedValue
};
U.__workletHash = 12964700773124;
U.__initData = __initData;
const animatedProps = useAnimatedProps(U);
const x = () => ({
transform: [{
scale: sharedValue2.get()
}]
});
x.__closure = {
checkmarkBackgroundScale: sharedValue2
};
x.__workletHash = 10834015407160;
x.__initData = __initData2;
const animatedStyle = useAnimatedStyle(x);
const G = () => ({
transform: [{
scale: sharedValue3.get()
}]
});
G.__closure = {
checkmarkScale: sharedValue3
};
G.__workletHash = 7510845920441;
G.__initData = __initData3;
return <View style={styles.progress}>
<Module8531 height={SMALL_BUTTON_HEIGHT} width={SMALL_BUTTON_HEIGHT} style={styles.ring}>
<Circle cx={SMALL_BUTTON_HEIGHT / 2} cy={SMALL_BUTTON_HEIGHT / 2} r={c9839_8} fill="none" stroke={styles.trackPath.color} strokeWidth={4} />
<AnimatedComponent cx={SMALL_BUTTON_HEIGHT / 2} cy={SMALL_BUTTON_HEIGHT / 2} r={c9839_8} fill="none" stroke={stroke} strokeWidth={4} strokeDasharray={PROGRESS_CIRCUMFERENCE} strokeLinecap="round" animatedProps={animatedProps} />
</Module8531>
{r12 ? !r12 : <Text variant="text-sm/semibold" style={styles.countdownText} maxFontSizeMultiplier={1}>{r21}</Text>}
<ReanimatedRexport.View style={[styles.checkmarkLayer, animatedStyle]}>
<View style={styles.checkmarkBackground} />
</ReanimatedRexport.View>
<ReanimatedRexport.View style={[styles.checkmarkLayer, useAnimatedStyle(G)]}>
<CheckmarkSmallBoldIcon size="custom" color={Module712.colors.CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT} style={styles.checkmarkIcon} />
</ReanimatedRexport.View>
</View>;
};
@@ -0,0 +1,149 @@
// Metro module 14069 (f14070).
import { useCallback } from "react";
import { Pressable, StyleSheet, View } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { useIsBountiesVerticalScrollExperimentEnabled } from "../../experiments/BountiesVerticalScrollExperiment";
import { getBountyCtaInfo } from "./BountyCtaHelpers";
import * as _index_native from "../../../../intl/index.native";
import { intl } from "../../../../intl/index.native";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import Module4611 from "../../../../_bundle/Module4611";
import BountiesEndCardPressableCta from "./BountiesEndCardPressableCta";
import BountiesModalEndedCtaButtons from "./BountiesModalEndedCtaButtons";
import { Text } from "../../../../design/components/Text/native/Text";
import { RetryIcon } from "../../../../design/components/Icon/native/redesign/generated/RetryIcon";
import { useIsBountiesModalTransitionsRefactorEnabled } from "../../experiments/BountiesModalTransitionsRefactorExperiment";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useVisibilityTransition } from "./useVisibilityTransition";
import AnimatedEnterExitItem from "../../../../design/components/AnimatedEnterExitItem/native/AnimatedEnterExitItem";
let useStyles, t, n, __initData;
const BountiesScrollEndCardContent = function BountiesScrollEndCardContent(props) {
const { bounty, visible, onReplay, isActive, isScrollingInBoundsSharedValue, sourceQuestContent, opacityStyle } = props;
const styles = useStyles();
const isBountiesVerticalScrollExperimentEnabled = useIsBountiesVerticalScrollExperimentEnabled("BountiesScrollEndCard");
const bountyCtaInfo = getBountyCtaInfo(bounty);
const accessibilityLabel = intl.string(_index_native.t["9UtZAY"]);
const y = function y() {
const r4 = isScrollingInBoundsSharedValue == null ? void 0 : isScrollingInBoundsSharedValue.get();
return {
opacity: _timing.withTiming(isActive ? r4 !== true ? 1 : 0 : 0, _timingPresets.timingStandard)
};
};
y.__closure = {
isScrollingInBoundsSharedValue,
withTiming: _timing.withTiming,
isActive,
timingStandard: _timingPresets.timingStandard
};
y.__workletHash = 4903386092677;
y.__initData = __initData;
const animatedStyle = useAnimatedStyle(y);
return <ReanimatedRexport.View style={[styles.container, opacityStyle]} pointerEvents="box-none">
<View style={styles.backdropTint} pointerEvents="none" />
<Module4611 colors={["rgba(0, 0, 0, 0.48)", "rgba(0, 0, 0, 0.8)"]} style={styles.backdropGradient} pointerEvents="none" />
{isBountiesVerticalScrollExperimentEnabled ? <ReanimatedRexport.View style={[styles.overlayContent, animatedStyle]} pointerEvents="box-none">
<BountiesEndCardPressableCta bounty={bounty} sourceQuestContent={sourceQuestContent} disabled={!isActive} />
<View style={styles.endedCtaButtonsContainer} pointerEvents="box-none">
<BountiesModalEndedCtaButtons bounty={bounty} visible={visible} sourceQuestContent={sourceQuestContent} onClose={() => {}} showCloseButton={false} disabled={!isActive} />
</View>
</ReanimatedRexport.View> : <Pressable onPress={isActive ? onReplay : void 0} disabled={!isActive} accessibilityRole="button" accessibilityLabel={accessibilityLabel} style={styles.pressable}>
<ReanimatedRexport.View style={[styles.overlayContent, animatedStyle]}>
<View style={styles.textBlock}>
<Text variant="heading-md/semibold" color="text-strong">{bountyCtaInfo.label}</Text>
<Text variant="heading-sm/medium" color="text-default">{accessibilityLabel}</Text>
</View>
<RetryIcon accessible={false} color={Module712.colors.CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT} style={styles.replayIcon} />
</ReanimatedRexport.View>
</Pressable>}
</ReanimatedRexport.View>;
};
useStyles = createStyles(() => ({
container: {
...StyleSheet.absoluteFillObject
},
backdropTint: {
...StyleSheet.absoluteFillObject,
backgroundColor: "rgba(0, 0, 0, 0.6)"
},
backdropGradient: {
...StyleSheet.absoluteFillObject
},
overlayContent: {
...StyleSheet.absoluteFillObject,
justifyContent: "center",
alignItems: "center"
},
pressable: {
...StyleSheet.absoluteFillObject,
justifyContent: "center",
alignItems: "center"
},
textBlock: {
alignItems: "center",
gap: Module712.space.PX_4
},
replayIcon: {
margin: Module712.space.PX_12
},
endedCtaButtonsContainer: {
position: "absolute",
left: Module712.space.PX_16,
right: Module712.space.PX_16,
bottom: Module712.space.PX_16
}
}));
const r36 = function t(a0) {
return {
opacity: _timing.withTiming(a0, _timingPresets.timingStandard, "respect-motion-settings")
};
};
r36.__closure = {
withTiming: _timing.withTiming,
timingStandard: _timingPresets.timingStandard
};
r36.__workletHash = 12127714049951;
r36.__initData = {
code: "function BountiesScrollEndCardTsx1(visible){const{withTiming,timingStandard}=this.__closure;return{opacity:withTiming(visible,timingStandard,'respect-motion-settings')};}"
};
t = r36;
const r45 = function n(a0, a1) {
return {
opacity: _timing.withTiming(a0, _timingPresets.timingStandard, "respect-motion-settings", a1)
};
};
r45.__closure = {
withTiming: _timing.withTiming,
timingStandard: _timingPresets.timingStandard
};
r45.__workletHash = 7470211880124;
r45.__initData = {
code: "function BountiesScrollEndCardTsx2(visible,cleanUp){const{withTiming,timingStandard}=this.__closure;return{opacity:withTiming(visible,timingStandard,'respect-motion-settings',cleanUp)};}"
};
n = r45;
__initData = {
code: "function BountiesScrollEndCardTsx3(){const{isScrollingInBoundsSharedValue,withTiming,isActive,timingStandard}=this.__closure;var _isScrollingInBoundsS;const isScrollingInBounds=((_isScrollingInBoundsS=isScrollingInBoundsSharedValue)===null||_isScrollingInBoundsS===void 0?void 0:_isScrollingInBoundsS.get())===true;return{opacity:withTiming(isActive&&!isScrollingInBounds?1:0,timingStandard)};}"
};
export default function BountiesScrollEndCard(props) {
const visible = props.visible;
const isBountiesModalTransitionsRefactorEnabled = useIsBountiesModalTransitionsRefactorEnabled(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const callback = useCallback((a0, a1) => <BountiesScrollEndCardContent {...a0} opacityStyle={a1} />, []);
const visibilityTransition = useVisibilityTransition({
visible,
entranceTiming: _timingPresets.timingStandard,
exitTiming: _timingPresets.timingStandard
});
const opacityStyle = visibilityTransition.opacityStyle;
let shouldRender = visibilityTransition.shouldRender;
if (isBountiesModalTransitionsRefactorEnabled) {
shouldRender = <AnimatedEnterExitItem useReducedMotion={stateFromStores} item={visible ? props : void 0} entering={t} exiting={n} renderItem={callback} />;
} else if (shouldRender) {
shouldRender = <BountiesScrollEndCardContent {...props} opacityStyle={opacityStyle} />;
}
return shouldRender;
};
@@ -0,0 +1,32 @@
// Metro module 14065 (f14066).
import { useState } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { useToken } from "../../../../design/tokens/native/useToken";
import Module712 from "../../../../_bundle/Module712";
import { BountiesScrollIndicatorRive } from "../../../../_bundle/Module3901";
const useStyles = createStyles(() => ({
container: {
width: 80,
height: 80
}
}));
export default function BountiesScrollIndicatorAnimation(props) {
const { visible, isFadingInContent } = props;
const styles = useStyles();
const token = useToken(Module712.colors.TEXT_DEFAULT);
const [key, setState] = useState(0);
const [state, setState2] = useState(visible);
if (visible !== state) {
setState2(visible);
if (visible) {
setState((prevState) => prevState + 1);
}
}
return <View style={styles.container}>
<BountiesScrollIndicatorRive key={key} stateMachine="State Machine 1" fit="contain" dataBinding={{
color: token,
startAnimation: !isFadingInContent
}} />
</View>;
};
@@ -0,0 +1,186 @@
// Metro module 14064 (f14065).
import { useState, useEffect, useCallback } from "react";
import { StyleSheet } from "react-native";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { timingSlowDuration } from "../../../../design/animation/reanimated/timing/timingPresets";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import Module4611 from "../../../../_bundle/Module4611";
import BountiesScrollIndicatorAnimation from "./BountiesScrollIndicatorAnimation";
import { Text } from "../../../../design/components/Text/native/Text";
import * as _index_native from "../../../../intl/index.native";
import { intl } from "../../../../intl/index.native";
function $mk118410($env) {
return () => {
let env32054;
const r8 = $env.$parent.$parent[1];
const r0 = $env[0];
r8(r0);
const r10 = $env.$parent;
const r11 = env32054 = {
$parent: r10
};
env32054[0] = !r0;
const r6 = setTimeout;
const r12 = r0 ? r10.$parent.$parent[9] : 5000;
r10[0] = r6($mk118410(r11), r12);
};
}
let c9835_11, c9835_12, c9835_13, c9835_14;
let env9835 = {};
const _excluded = ["rgba(0,0,0,0)", "rgba(0,0,0,0.7)", "rgba(0,0,0,1)"];
const c9835_9 = 5000 + timingSlowDuration;
const useStyles = createStyles(() => ({
scrollIndicator: {
position: "absolute",
left: 0,
right: 0,
bottom: 0,
height: "45%",
alignItems: "center",
justifyContent: "center",
paddingHorizontal: Module712.space.PX_16
},
scrollIndicatorContent: {
position: "absolute",
bottom: 124,
left: 0,
right: 0,
alignItems: "center",
justifyContent: "flex-start",
gap: Module712.space.PX_8
},
scrollIndicatorText: {
textAlign: "center"
}
}));
c9835_11 = {
code: "function BountiesScrollIndicatorOverlayTsx1(){const{withTiming,visible,enabled,timingSlow,timingStandard,runOnJS,animationCallbackJSThread}=this.__closure;return{opacity:withTiming(visible?1:0,enabled?timingSlow:timingStandard,'respect-motion-settings',function(){'worklet';runOnJS(animationCallbackJSThread)();})};}"
};
c9835_12 = {
code: "function BountiesScrollIndicatorOverlayTsx2(){const{runOnJS,animationCallbackJSThread}=this.__closure;runOnJS(animationCallbackJSThread)();}"
};
c9835_13 = {
code: "function BountiesScrollIndicatorOverlayTsx3(){const{withTiming,visible,isEndCardVisible,enabled,timingStandard,timingSlow}=this.__closure;return{opacity:withTiming(visible&&!isEndCardVisible?1:0,isEndCardVisible||!enabled?timingStandard:timingSlow)};}"
};
c9835_14 = {
code: "function BountiesScrollIndicatorOverlayTsx4(){const{withTiming,visible,timingStandard}=this.__closure;return{transform:[{scale:withTiming(visible?1:0.9,timingStandard)}]};}"
};
export default function BountiesScrollIndicatorOverlay(props) {
let state, setState, callback;
const { enabled, isEndCardVisible, opacityStyle } = props;
state = void 0;
setState = void 0;
callback = void 0;
const styles = useStyles();
let env20880 = {
$parent: env9835
};
env20880[0] = enabled;
env20880[1] = void 0;
const [state2, setState2] = useState(true);
env20880[1] = setState2;
const [state3, setState3] = useState(enabled);
if (enabled !== state3) {
setState3(enabled);
if (enabled) {
setState2(true);
}
}
useEffect(() => {
if (env20880[0]) {
let env30695;
let env30696;
const r6 = env30695 = {
$parent: env20880
};
const r2 = env30696 = {
$parent: r6
};
env30696[0] = false;
env30695[0] = setTimeout($mk118410(r2), c9835_9);
return () => clearTimeout(env30695[0]);
}
}, [enabled]);
state = enabled ? state2 : enabled;
let isFadingInContent;
[isFadingInContent, setState] = useState(state);
const [state4, setState4] = useState(state);
if (state !== state4) {
setState4(state);
if (state) {
setState(true);
}
}
callback = useCallback(() => {
setState(false);
}, []);
const E = () => {
const r0 = state ? 1 : 0;
const r6 = enabled ? _timingPresets.timingSlow : _timingPresets.timingStandard;
const t = function t() {
_ReanimatedRexport.runOnJS(callback)();
};
t.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
animationCallbackJSThread: callback
};
t.__workletHash = 7847207274031;
t.__initData = c9835_12;
return {
opacity: _timing.withTiming(r0, r6, "respect-motion-settings", t)
};
};
E.__closure = {
withTiming: _timing.withTiming,
visible: state,
enabled,
timingSlow: _timingPresets.timingSlow,
timingStandard: _timingPresets.timingStandard,
runOnJS: _ReanimatedRexport.runOnJS,
animationCallbackJSThread: callback
};
E.__workletHash = 2813930896935;
E.__initData = c9835_11;
const animatedStyle = useAnimatedStyle(E);
const j = () => ({
opacity: _timing.withTiming(state ? isEndCardVisible ? 0 : 1 : 0, !isEndCardVisible && enabled ? _timingPresets.timingSlow : _timingPresets.timingStandard)
});
j.__closure = {
withTiming: _timing.withTiming,
visible: state,
isEndCardVisible,
enabled,
timingStandard: _timingPresets.timingStandard,
timingSlow: _timingPresets.timingSlow
};
j.__workletHash = 12172713560290;
j.__initData = c9835_13;
const animatedStyle2 = useAnimatedStyle(j);
const A = () => ({
transform: [{
scale: _timing.withTiming(state ? 1 : 0.9, _timingPresets.timingStandard)
}]
});
A.__closure = {
withTiming: _timing.withTiming,
visible: state,
timingStandard: _timingPresets.timingStandard
};
A.__workletHash = 4041303236067;
A.__initData = c9835_14;
return <ReanimatedRexport.View style={[styles.scrollIndicator, opacityStyle]} pointerEvents="none">
<ReanimatedRexport.View style={[StyleSheet.absoluteFill, animatedStyle2]}>
<Module4611 colors={_excluded} style={StyleSheet.absoluteFill} />
</ReanimatedRexport.View>
<ReanimatedRexport.View style={[styles.scrollIndicatorContent, [animatedStyle, useAnimatedStyle(A)]]}>
<BountiesScrollIndicatorAnimation visible={state} isFadingInContent={isFadingInContent} />
<Text variant="text-sm/semibold" color="text-default" style={styles.scrollIndicatorText}>
{intl.string(_index_native.t.eafsh4)}
</Text>
</ReanimatedRexport.View>
</ReanimatedRexport.View>;
};
@@ -0,0 +1,103 @@
// Metro module 14036 (f14037).
import { useMemo, useCallback } from "react";
import { StyleSheet } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { useStateFromStores } from "../../../../_bundle/Module589";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { BountiesScrollGradientRive } from "../../../../_bundle/Module3901";
import { useIsBountiesModalTransitionsRefactorEnabled } from "../../experiments/BountiesModalTransitionsRefactorExperiment";
import { useVisibilityTransition } from "./useVisibilityTransition";
import AnimatedEnterExitItem from "../../../../design/components/AnimatedEnterExitItem/native/AnimatedEnterExitItem";
let useStyles, t, n;
const BountiesScrollPromptFooterContent = function BountiesScrollPromptFooterContent(props) {
let c20864_1;
const { children, onContentLayout, zIndex, opacityStyle, visibilityOpacityStyle } = props;
c20864_1 = void 0;
const styles = useStyles();
const memo = useMemo(() => zIndex != null ? {
zIndex
} : void 0, [zIndex]);
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const safeAreaInsets_native = useSafeAreaInsets_native();
c20864_1 = safeAreaInsets_native;
return <ReanimatedRexport.View style={[styles.root, visibilityOpacityStyle, memo]} pointerEvents="none">
<ReanimatedRexport.View style={[styles.gradient, opacityStyle]}>
<BountiesScrollGradientRive stateMachine="State Machine 1" fit="fill" alignment="bottom-center" withReducedMotion={stateFromStores ? "halt" : "play"} />
</ReanimatedRexport.View>
<ReanimatedRexport.View style={[styles.content, useMemo(() => ({
paddingBottom: Math.max(c20864_1.bottom, Module712.space.PX_8)
}), [safeAreaInsets_native.bottom]), opacityStyle]} onLayout={onContentLayout}>{children}</ReanimatedRexport.View>
</ReanimatedRexport.View>;
};
useStyles = createStyles(() => ({
root: {
position: "absolute",
bottom: 0,
left: 0,
right: 0
},
content: {
flex: 1,
minHeight: 97,
alignItems: "center",
justifyContent: "center",
paddingHorizontal: Module712.space.PX_16
},
gradient: {
...StyleSheet.absoluteFillObject
}
}));
const r34 = function t(a0) {
return {
opacity: _timing.withTiming(a0, _timingPresets.timingStandard, "respect-motion-settings")
};
};
r34.__closure = {
withTiming: _timing.withTiming,
timingStandard: _timingPresets.timingStandard
};
r34.__workletHash = 11416950434629;
r34.__initData = {
code: "function BountiesScrollPromptFooterTsx1(visible){const{withTiming,timingStandard}=this.__closure;return{opacity:withTiming(visible,timingStandard,'respect-motion-settings')};}"
};
t = r34;
const r43 = function n(a0, a1) {
return {
opacity: _timing.withTiming(a0, _timingPresets.timingStandard, "respect-motion-settings", a1)
};
};
r43.__closure = {
withTiming: _timing.withTiming,
timingStandard: _timingPresets.timingStandard
};
r43.__workletHash = 9928471408966;
r43.__initData = {
code: "function BountiesScrollPromptFooterTsx2(visible,cleanUp){const{withTiming,timingStandard}=this.__closure;return{opacity:withTiming(visible,timingStandard,'respect-motion-settings',cleanUp)};}"
};
n = r43;
export default function BountiesScrollPromptFooter(props) {
const { visible, ...props2 } = props;
const isBountiesModalTransitionsRefactorEnabled = useIsBountiesModalTransitionsRefactorEnabled(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const callback = useCallback((a0, a1) => <BountiesScrollPromptFooterContent {...a0} visibilityOpacityStyle={a1} />, []);
const visibilityTransition = useVisibilityTransition({
visible,
entranceTiming: _timingPresets.timingStandard,
exitTiming: _timingPresets.timingStandard
});
const opacityStyle = visibilityTransition.opacityStyle;
let shouldRender = visibilityTransition.shouldRender;
if (isBountiesModalTransitionsRefactorEnabled) {
shouldRender = <AnimatedEnterExitItem useReducedMotion={stateFromStores} item={visible ? props2 : void 0} entering={t} exiting={n} renderItem={callback} />;
} else if (shouldRender) {
shouldRender = <BountiesScrollPromptFooterContent {...props2} visibilityOpacityStyle={opacityStyle} />;
}
return shouldRender;
};
export const BOUNTIES_MODAL_BASE_FOOTER_HEIGHT = 97;
@@ -0,0 +1,29 @@
// Metro module 14073 (f14074).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
const useStyles = createStyles(() => ({
root: {
alignItems: "center",
gap: 2
},
titleText: {
textAlign: "center"
},
swipeText: {
textAlign: "center",
textTransform: "uppercase"
}
}));
export default function BountiesScrollPromptFooter() {
const styles = useStyles();
return <View style={styles.root}>
<Text variant="text-md/semibold" color="text-default" style={styles.titleText}>
{intl.string(t.H57f41)}
</Text>
<Text variant="text-xxs/semibold" color="text-muted" style={styles.swipeText}>
{intl.string(t.tG0zsk)}
</Text>
</View>;
};
@@ -0,0 +1,53 @@
// Metro module 14074 (f14075).
import { View } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { isIOS } from "../../../../utils/PlatformUtils";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { OrbsIcon } from "../../../../design/components/Icon/native/redesign/generated/OrbsIcon";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { BountiesScrollGradientRive } from "../../../../_bundle/Module3901";
const useStyles = createStyles(() => ({
container: {
flex: 1,
alignItems: "center",
justifyContent: "center",
gap: Module712.space.PX_4
},
headerLabel: {
textTransform: "uppercase"
},
orbRow: {
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_4
},
rive: {
flex: 1,
width: "100%"
},
orbAmount: {
marginTop: isIOS() ? 6 : 0
}
}));
export function BountiesScrollRecapFooter(props) {
const orbAmount = props.orbAmount;
const styles = useStyles();
const r6 = intl.string(t.d6Rrn6);
return <View style={styles.container} pointerEvents="none" accessible accessibilityRole="text" accessibilityLabel={`${r6}, +${orbAmount}`}>
<Text variant="text-xs/bold" color="text-brand" style={styles.headerLabel} accessible={false}>{r6}</Text>
<View style={styles.orbRow} accessible={false} importantForAccessibility="no-hide-descendants">
<OrbsIcon size="sm" color="icon-strong" accessible={false} />
<Text variant="display-sm" color="text-strong" accessible={false} style={styles.orbAmount}>
{`+${orbAmount}`}
</Text>
</View>
</View>;
}
export function BountiesScrollRecapFooterGradient() {
return <View style={useStyles().rive}>
<BountiesScrollGradientRive stateMachine="State Machine 1" fit="fill" alignment="bottom-center" withReducedMotion={useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion) ? "halt" : "play"} />
</View>;
}
@@ -0,0 +1,112 @@
// Metro module 14076 (f14077).
import { StyleSheet, View } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import Module712 from "../../../../_bundle/Module712";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { isAndroid, isIOS } from "../../../../utils/PlatformUtils";
import { APNGPlayer } from "../../../image/native/APNGPlayer.android";
import Module14077 from "../../../../_bundle/Module14077";
import { VideoComponent } from "../../../../components_native/common/Video";
import Module14078 from "../../../../_bundle/Module14078";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import Module14079 from "../../../../_bundle/Module14079";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { OrbsIcon } from "../../../../design/components/Icon/native/redesign/generated/OrbsIcon";
import { Button } from "../../../../design/components/Button/native/Button.native";
let lg, useStyles;
const BountiesRecapOrbsBackground = function BountiesRecapOrbsBackground(props) {
const { style, reducedMotion } = props;
return isAndroid() ? <View style={style} needsOffscreenAlphaCompositing renderToHardwareTextureAndroid pointerEvents="none">
<APNGPlayer url={Module14077} style={StyleSheet.absoluteFillObject} autoplay={!reducedMotion} />
</View> : <VideoComponent source={{
uri: Module14078
}} style={style} resizeMode="contain" paused={reducedMotion} disableFocus preventsDisplaySleepDuringVideoPlayback={false} importantForAccessibility="no-hide-descendants" />;
};
lg = Module712.radii.lg;
useStyles = createStyles(() => ({
root: {
overflow: "hidden",
borderRadius: lg,
backgroundColor: Module712.colors.MOBILE_ACTIONSHEET_BACKGROUND
},
content: {
flex: 1,
paddingHorizontal: Module712.space.PX_24,
justifyContent: "center",
alignItems: "center"
},
centeredCopy: {
alignItems: "center",
width: "100%"
},
orbsBackground: {
position: "absolute",
top: 0,
left: 0,
right: 0,
height: "40%",
zIndex: 1
},
headerLabel: {
paddingBottom: Module712.space.PX_4,
textTransform: "uppercase"
},
titleRow: {
flexDirection: "row",
alignItems: "center",
justifyContent: "center",
paddingBottom: Module712.space.PX_24,
gap: Module712.space.PX_8
},
actions: {
position: "absolute",
left: Module712.space.PX_24,
right: Module712.space.PX_24,
gap: Module712.space.PX_12
},
orbAmount: {
marginTop: isIOS() ? 6 : 0,
lineHeight: 46
}
}));
export function BountiesScrollRecapPage(props) {
const { orbAmount, onClose, style } = props;
const styles = useStyles();
const safeAreaInsets_native = useSafeAreaInsets_native();
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
return <View style={[styles.root, style]} pointerEvents="box-none">
<View style={StyleSheet.absoluteFillObject} pointerEvents="none">
<VideoComponent source={{
uri: Module14079
}} style={StyleSheet.absoluteFillObject} resizeMode="cover" paused={stateFromStores} disableFocus preventsDisplaySleepDuringVideoPlayback={false} importantForAccessibility="no-hide-descendants" />
<BountiesRecapOrbsBackground style={styles.orbsBackground} reducedMotion={stateFromStores} />
</View>
<View style={styles.content} pointerEvents="box-none">
<View style={styles.centeredCopy} pointerEvents="none">
<Text variant="text-xs/bold" color="text-brand" style={styles.headerLabel}>
{intl.string(t.d6Rrn6)}
</Text>
<View accessible accessibilityRole="text" accessibilityLabel={`+${orbAmount}`}>
<View style={styles.titleRow}>
<OrbsIcon size="lg" color="icon-strong" accessible={false} />
<Text variant="display-lg" color="text-strong" accessible={false} style={styles.orbAmount}>
{`+${orbAmount}`}
</Text>
</View>
</View>
<Text variant="text-md/medium" color="text-muted" style={{
textAlign: "center"
}}>
{intl.string(t.x0Ffz3)}
</Text>
</View>
<View style={[styles.actions, {
bottom: safeAreaInsets_native.bottom + Module712.space.PX_8
}]}>
<Button grow variant="primary" text={intl.string(t.i4jeWR)} size="lg" onPress={onClose} />
</View>
</View>
</View>;
}
@@ -0,0 +1,305 @@
// Metro module 14044 (f14045).
import { useMemo, useState, useRef, useCallback, useEffect } from "react";
import { View } from "react-native";
import VirtualCurrencyStore from "../../../virtual_currency/stores/VirtualCurrencyStore";
import BountyStore from "../../BountyStore";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { jsx } from "react/jsx-runtime";
import { PlayerState } from "../AdVideoPlayer";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
import { BountyVideoEndMode, useBountiesModalTiming } from "./useBountiesModalTiming";
import { claimBountyReward } from "../../BountyActionCreators";
import { openBountyRewardClaimErrorToast } from "./bountyError";
import { useBountyVideoProgressPersistence } from "./useBountyVideoProgressPersistence";
import { useBountiesModalVideoAnalytics } from "./useBountiesModalVideoAnalytics";
import { BountyVideo } from "./BountyVideo";
import { QuestContentImpressionTrackerNative, BillableAdPlacementImpressionTrackerNative } from "../QuestContentImpressionTracker.native";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { QuestContent } from "../../../../_bundle/Module5038";
import BountiesScrollEndCard from "./BountiesScrollEndCard";
function $mk116636($env) {
return (a0) => a0 != null ? a0 + $env[7] : null;
}
let env9820 = {};
const BountiesScrollVideoItemInner = function BountiesScrollVideoItemInner(props) {
let env20869 = {
$parent: env9820
};
const bounty2 = props.bounty;
env20869[0] = bounty2;
const sourceQuestContent2 = props.sourceQuestContent;
env20869[1] = sourceQuestContent2;
const width2 = props.width;
env20869[2] = width2;
const height2 = props.height;
env20869[3] = height2;
const { index: index2, isActive: isActive3 } = props;
env20869[4] = isActive3;
const { isRecapPageRevealed: isRecapPageRevealed2, isRecapPageOnTop: isRecapPageOnTop2, isScrollingInBoundsSharedValue: isScrollingInBoundsSharedValue2 } = props;
env20869[5] = isScrollingInBoundsSharedValue2;
const { isScrollIndicatorOverlayEnabled: isScrollIndicatorOverlayEnabled2 = false, shouldLoadHls: shouldLoadHls2 = true, scrollAffordance: scrollAffordance2, peekScale: peekScale2, softDownloadCapsEnabled: softDownloadCapsEnabled2 = false } = props;
env20869[6] = void 0;
env20869[7] = void 0;
env20869[8] = void 0;
env20869[9] = void 0;
env20869[10] = void 0;
env20869[11] = void 0;
env20869[12] = void 0;
env20869[13] = void 0;
env20869[14] = void 0;
env20869[15] = void 0;
env20869[16] = void 0;
env20869[17] = void 0;
env20869[18] = void 0;
env20869[19] = void 0;
env20869[20] = void 0;
const memo = useMemo(() => ({
width: env20869[2],
height: env20869[3]
}), [width2, height2]);
const stateFromStores = useStateFromStores([BountyStore], () => BountyStore.isBountyCompleted(env20869[0].id));
env20869[6] = stateFromStores;
const [shouldLoadHls3, setState] = useState(shouldLoadHls2);
const [state, setState2] = useState(shouldLoadHls2);
if (state !== shouldLoadHls2) {
setState2(shouldLoadHls2);
if (shouldLoadHls2) {
setState(true);
}
}
const bountiesExperience = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
const { loopingEnabled, ownedByVerticalScrollExperiment, stage1Enabled, orbAmount } = bountiesExperience;
env20869[7] = orbAmount;
const rewardTimerSeconds = bountiesExperience.rewardTimerSeconds;
const endMode = loopingEnabled ? BountyVideoEndMode.LOOP : ownedByVerticalScrollExperiment ? BountyVideoEndMode.END_CARD : BountyVideoEndMode.END_CARD_WITH_CTA;
const rewardDurationMs = !stage1Enabled && !ownedByVerticalScrollExperiment ? 1000 * bounty2.rewardTimerSeconds : 1000 * rewardTimerSeconds;
env20869[8] = rewardDurationMs;
const ref4 = useRef(null);
const isActive = isActive3;
const ref = ref4;
const ref2 = useRef(true);
const ref3 = useRef(null);
const callback2 = useCallback((a0) => {
ref3.current = a0;
}, []);
useEffect(() => {
if (ref2.current) {
ref2.current = false;
} else {
let r7 = isActive;
if (isActive) {
r7 = ref3.current === PlayerState.PAUSED;
}
if (r7) {
const current = ref.current;
if (current != null) {
current.play();
}
}
}
}, [isActive, ref]);
const [state2, setState3] = useState(isActive);
const [orbsBalance, setState4] = useState(() => env20869[4] ? VirtualCurrencyStore.getCurrentBalance() : null);
env20869[9] = setState4;
const [balanceWidgetPillResetKey, setState5] = useState(0);
if (state2 !== isActive) {
setState3(isActive);
if (isActive) {
const currentBalance = VirtualCurrencyStore.getCurrentBalance();
setState4(currentBalance);
if (currentBalance !== orbsBalance) {
setState5((prevState5) => prevState5 + 1);
}
}
}
const callback = useCallback(async () => {
let c27617_0, c27617_1, c27617_2;
let c27617_3 = 0;
const r13 = env20869;
L14: {
try {
let env30694;
c27617_1 = r13;
const r28 = env30694 = {
$parent: r13
};
c27617_0 = r28;
env30694[0] = false;
c27617_3 = 1;
await claimBountyReward(env20869[0].id, env20869[1]);
env30694[0] = true;
c27617_3 = 0;
if (env30694[0] && env20869[4]) {
env20869[9]($mk116636(env20869));
}
} catch ($e) {
const r26 = $e;
let r7 = r26;
c27617_2 = r26;
if (c27617_3 !== 0) {
while (true) {
try {
const r70 = c27617_2;
c27617_3 = 0;
env30694[1] = r70;
openBountyRewardClaimErrorToast(env30694[1]);
if (!(env30694[0] && env20869[4])) {
break L14;
}
env20869[9]($mk116636(env20869));
break L14;
} catch (r66) {
r7 = r66;
c27617_2 = r66;
if (c27617_3 === 0) {
break;
}
}
}
}
throw r7;
}
}
}, [bounty2.id, isActive, orbAmount, sourceQuestContent2]);
const bountyVideoProgressPersistence = useBountyVideoProgressPersistence({
bountyId: bounty2.id,
endMode
});
const { initialProgress, handleProgress } = bountyVideoProgressPersistence;
env20869[10] = handleProgress;
const flushProgress = bountyVideoProgressPersistence.flushProgress;
env20869[11] = flushProgress;
useEffect(() => () => (0, env20869[11])(), [flushProgress]);
const bountiesModalVideoAnalytics = useBountiesModalVideoAnalytics({
bountyId: bounty2.id,
sourceQuestContent: sourceQuestContent2,
rewardDurationMs,
initialPlaybackTimeSec: initialProgress.timestampSec,
initialMaxVideoProgressSec: initialProgress.maxTimestampSec,
initialVideoDurationSec: initialProgress.duration,
wasPreloaded: false,
startupPath: ownedByVerticalScrollExperiment ? "active_only" : "carousel",
verticalScrollingPosition: index2,
isActive
});
const handleVideoProgressAnalytics = bountiesModalVideoAnalytics.handleVideoProgressAnalytics;
env20869[12] = handleVideoProgressAnalytics;
const { handleVideoEndAnalytics, handleVideoLoopedAnalytics, handleVideoPausedAnalytics, handleVideoResumedAnalytics, handleVideoErrorAnalytics, handleLoadStartAnalytics, handleVideoTracksAnalytics, handleReadyForDisplayAnalytics, handleBufferAnalytics } = bountiesModalVideoAnalytics;
const onPlaybackTimeChange = scrollAffordance2?.onPlaybackTimeChange;
env20869[13] = onPlaybackTimeChange;
const onPaused = scrollAffordance2?.onPaused;
env20869[14] = onPaused;
const onResumed = scrollAffordance2?.onResumed;
env20869[15] = onResumed;
const onEndCardVisible = scrollAffordance2?.onEndCardVisible;
env20869[16] = onEndCardVisible;
const bountiesModalTiming = useBountiesModalTiming({
endMode,
rewardDurationMs,
isCompleted: stateFromStores,
onRewardEarned: callback,
onVideoProgress: useCallback((a0, a1, a2) => {
(0, env20869[12])(a0, a1, a2);
(0, env20869[10])(a0, a1, a2);
const r5 = env20869[13];
if (r5 != null) {
const r4 = env20869[6];
r5(a2, a1, r4 || 1000 * a0 >= env20869[8], a0, r4);
}
}, [handleVideoProgressAnalytics, handleProgress, stateFromStores, onPlaybackTimeChange, rewardDurationMs]),
onVideoEnd: handleVideoEndAnalytics,
onVideoLooped: handleVideoLoopedAnalytics,
onVideoPaused: handleVideoPausedAnalytics,
onVideoResumed: handleVideoResumedAnalytics,
playerRef: ref,
initialProgressSec: initialProgress.timestampSec,
initialMaxVideoProgressSec: initialProgress.maxTimestampSec,
initialVideoDurationSec: initialProgress.duration > 0 ? initialProgress.duration : null
});
const { isCtaVisible, isEndCardVisible } = bountiesModalTiming;
env20869[17] = isEndCardVisible;
const { handleVideoEnd, handleVideoProgress, handleVideoPaused } = bountiesModalTiming;
env20869[18] = handleVideoPaused;
const handleVideoResumed = bountiesModalTiming.handleVideoResumed;
env20869[19] = handleVideoResumed;
env20869[20] = bountiesModalTiming.handleReplay;
const { rewardRemainingSeconds, rewardTotalSeconds, normalizedProgress } = bountiesModalTiming;
const callback3 = useCallback((a0) => {
(0, env20869[18])(a0);
if (!env20869[17]) {
const r7 = env20869[14];
if (r7 != null) {
r7();
}
}
}, [handleVideoPaused, isEndCardVisible, onPaused]);
const callback4 = useCallback((a0) => {
(0, env20869[19])(a0);
const r6 = env20869[15];
if (r6 != null) {
r6();
}
}, [handleVideoResumed, onResumed]);
useEffect(() => {
if (env20869[17] && env20869[4]) {
const r3 = env20869[16];
if (r3 != null) {
r3();
}
}
}, [isActive, isEndCardVisible, onEndCardVisible]);
return <View style={memo}>
<BountyVideo bounty={bounty2} sourceQuestContent={sourceQuestContent2} isCompleted={stateFromStores} isCtaVisible={isCtaVisible} isEndCardVisible={isEndCardVisible} isScrollIndicatorEnabled={isScrollIndicatorOverlayEnabled2} isProgressBarVisible={isEndCardVisible ? !isEndCardVisible : !isRecapPageOnTop2} orbsBalance={orbsBalance} handleVideoEnd={handleVideoEnd} handleVideoProgress={handleVideoProgress} handleVideoPaused={callback3} handleVideoResumed={callback4} handleVideoError={handleVideoErrorAnalytics} onLoadStart={handleLoadStartAnalytics} onBuffer={handleBufferAnalytics} onFirstFrame={handleReadyForDisplayAnalytics} onVideoTracks={handleVideoTracksAnalytics} rewardRemainingSeconds={rewardRemainingSeconds} rewardTotalSeconds={rewardTotalSeconds} normalizedProgress={normalizedProgress} repeat={loopingEnabled} initialProgress={initialProgress} isActive={isActive} isRecapPageRevealed={isRecapPageRevealed2} isScrollingInBoundsSharedValue={isScrollingInBoundsSharedValue2} playerRef={ref} onPlayerStateChange={callback2} balanceWidgetPillResetKey={balanceWidgetPillResetKey} shouldLoadHls={shouldLoadHls3} width={width2} height={height2} peekScale={peekScale2} softDownloadCapsEnabled={softDownloadCapsEnabled2} renderEndCard={() => <QuestContentImpressionTrackerNative adContentId={env20869[0].id} adCreativeType={AdCreativeType.BOUNTY} questContent={QuestContent.VIDEO_MODAL_END_CARD} sourceQuestContent={env20869[1]} overrideVisibility={env20869[17]}>
{() => (0, jsx)(BountiesScrollEndCard, {
bounty: env20869[0],
visible: env20869[17],
onReplay: env20869[20],
isActive: env20869[4],
isScrollingInBoundsSharedValue: env20869[5],
sourceQuestContent: env20869[1]
})}
</QuestContentImpressionTrackerNative>} />
</View>;
};
export function BountiesScrollVideoItem(props) {
const { bounty, sourceQuestContent, width, height, index, isActive: isActive3 = false } = props;
const isActive2 = isActive3;
let isRecapPageRevealed2 = props.isRecapPageRevealed;
if (isRecapPageRevealed2 === void 0) {
isRecapPageRevealed2 = false;
}
const isRecapPageRevealed = isRecapPageRevealed2;
let isRecapPageOnTop2 = props.isRecapPageOnTop;
if (isRecapPageOnTop2 === void 0) {
isRecapPageOnTop2 = false;
}
const isRecapPageOnTop = isRecapPageOnTop2;
const { isScrollingInBoundsSharedValue, isScrollIndicatorOverlayEnabled: isScrollIndicatorOverlayEnabled2 = false } = props;
const isScrollIndicatorOverlayEnabled = isScrollIndicatorOverlayEnabled2;
let shouldLoadHls2 = props.shouldLoadHls;
if (shouldLoadHls2 === void 0) {
shouldLoadHls2 = true;
}
const shouldLoadHls = shouldLoadHls2;
const { scrollAffordance, peekScale, softDownloadCapsEnabled: softDownloadCapsEnabled2 = false } = props;
const softDownloadCapsEnabled = softDownloadCapsEnabled2;
return <BillableAdPlacementImpressionTrackerNative adContentId={bounty.id} adCreativeType={AdCreativeType.BOUNTY} questContent={QuestContent.VIDEO_MODAL_MOBILE} sourceQuestContent={sourceQuestContent} overrideVisibility={isActive2}>
{() => (0, jsx)(BountiesScrollVideoItemInner, {
bounty,
sourceQuestContent,
width,
height,
index,
isActive: isActive2,
isRecapPageRevealed,
isRecapPageOnTop,
isScrollingInBoundsSharedValue,
isScrollIndicatorOverlayEnabled,
shouldLoadHls,
scrollAffordance,
peekScale,
softDownloadCapsEnabled
})}
</BillableAdPlacementImpressionTrackerNative>;
}
@@ -0,0 +1,2 @@
// Metro module 14071 (f14072).
export const END_CARD_IMAGE_SIZE = 92;
@@ -0,0 +1,10 @@
// Metro module 14067 (f14068).
import { intl, t } from "../../../../intl/index.native";
export function getBountyCtaInfo(a0) {
return {
label: a0.productName,
subtext: a0.cta.buttonLabel,
buttonLabel: intl.string(t.LLLLPD),
iconImageUri: a0.productIcon
};
}
@@ -0,0 +1,232 @@
// Metro module 14061 (f14062).
import { useState, useRef, useMemo, useEffect, useCallback } from "react";
import { ActivityIndicator, StyleSheet, View } from "react-native";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { isAndroid } from "../../../../_bundle/Module501";
import { getScaledFirstFrameImageUrl } from "../../lib/AssetUtils";
import Module712 from "../../../../_bundle/Module712";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import BountiesModalProgress, { PROGRESS_BAR_HEIGHT } from "./BountiesModalProgress";
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
import { useIsBountiesVerticalScrollExperimentEnabled } from "../../experiments/BountiesVerticalScrollExperiment";
import ReanimatedRexport, { useSharedValue, useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import { useToken } from "../../../../design/tokens/native/useToken";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _timingPresets from "../../../../design/animation/reanimated/timing/timingPresets";
import { timingFast } from "../../../../design/animation/reanimated/timing/timingPresets";
import * as _useBountiesAutoScroll from "./useBountiesAutoScroll";
import { AdVideoPlayer } from "../AdVideoPlayer";
import { SOFT_CAP_PRELOAD_MAX_BITRATE, SOFT_CAP_PRELOAD_BUFFER_CONFIG, SOFT_CAP_PRELOAD_FORWARD_BUFFER_SEC } from "./bountiesSoftCapPreload";
import FastImage from "../../../../components_native/common/FastImage";
import BountiesScrollIndicatorOverlay from "./BountiesScrollIndicatorOverlay";
import BountiesModalAdvertiserCta from "./BountiesModalAdvertiserCta";
import BountiesModalTimer from "./BountiesModalTimer";
import { BalanceWidgetPill } from "../../../virtual_currency/native/BalanceWidgetPill";
let __initData, __initData2, __initData3;
let c9833_12 = isAndroid() ? 150 : 0;
const contentInsets = {
top: 48,
bottom: 16,
left: 16,
right: 16
};
const lg = Module712.radii.lg;
const useStyles = createStyles(() => ({
videoContainer: {
...StyleSheet.absoluteFillObject,
overflow: "hidden",
borderRadius: lg
},
leftRow: {
position: "absolute",
top: Module712.space.PX_8,
left: Module712.space.PX_8,
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_8
},
progress: {
position: "absolute",
bottom: 0,
height: PROGRESS_BAR_HEIGHT,
left: lg,
right: lg
},
poster: {
...StyleSheet.absoluteFillObject,
backgroundColor: "#000000",
justifyContent: "center",
alignItems: "center"
},
peekOrigin: {
transformOrigin: "top"
}
}));
__initData = {
code: "function BountyVideoTsx1(){const{posterOpacity}=this.__closure;return{opacity:posterOpacity.get()};}"
};
__initData2 = {
code: "function BountyVideoTsx2(){const{isScrollingInBoundsSharedValue,withTiming,isActive,timingStandard}=this.__closure;var _isScrollingInBoundsS;const isScrollingInBounds=((_isScrollingInBoundsS=isScrollingInBoundsSharedValue)===null||_isScrollingInBoundsS===void 0?void 0:_isScrollingInBoundsS.get())===true;return{opacity:withTiming(isActive&&!isScrollingInBounds?1:0,timingStandard)};}"
};
__initData3 = {
code: "function BountyVideoTsx3(){const{peekScale,AUTO_SCROLL_PEEK_SCALE,AUTO_SCROLL_PEEK_TOP_OFFSET}=this.__closure;if(peekScale==null){return{};}const scale=peekScale.get();const scaleProgress=(1-scale)/(1-AUTO_SCROLL_PEEK_SCALE);return{transform:[{translateY:scaleProgress*AUTO_SCROLL_PEEK_TOP_OFFSET},{scale:scale}]};}"
};
export function BountyVideo(props) {
let callback;
const { bounty, sourceQuestContent, isCompleted, isCtaVisible, isEndCardVisible } = props;
let isScrollIndicatorEnabled = props.isScrollIndicatorEnabled;
const { isProgressBarVisible, orbsBalance, handleVideoEnd, handleVideoProgress, handleVideoPaused, handleVideoResumed, handleVideoError, onLoadStart, onBuffer, onFirstFrame, onVideoTracks, rewardRemainingSeconds, rewardTotalSeconds, normalizedProgress, initialProgress, repeat } = props;
let isActive = props.isActive;
if (isActive === void 0) {
isActive = false;
}
let c20877_4 = isActive;
const { isRecapPageRevealed = false, isScrollingInBoundsSharedValue, renderEndCard, playerRef, onPlayerStateChange, balanceWidgetPillResetKey, shouldLoadHls = true, width, height, peekScale } = props;
let softDownloadCapsEnabled = props.softDownloadCapsEnabled;
if (softDownloadCapsEnabled === void 0) {
softDownloadCapsEnabled = false;
}
callback = void 0;
const styles = useStyles();
const bountiesExperience = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
const { ownedByVerticalScrollExperiment, stage1Enabled } = bountiesExperience;
const isBountiesVerticalScrollExperimentEnabled = useIsBountiesVerticalScrollExperimentEnabled("BountyVideo");
if (softDownloadCapsEnabled) {
softDownloadCapsEnabled = !isActive;
}
const [state2, setState] = useState(false);
const [state, setState2] = useState(false);
const ref = useRef(null);
const sharedValue = useSharedValue(1);
const memo = useMemo(() => getScaledFirstFrameImageUrl({
assetUrl: bounty.videoHls,
width,
height
}), [bounty, width, height]);
const token = useToken(Module712.colors.TEXT_DEFAULT);
const r98 = `${bounty.id}:${shouldLoadHls}`;
const [state3, setState3] = useState(r98);
if (state3 !== r98) {
setState3(r98);
setState2(false);
sharedValue.set(1);
}
useEffect(() => () => {
if (ref.current != null) {
clearTimeout(ref.current);
ref.current = null;
}
}, [r98]);
useEffect(() => {
if (state) {
sharedValue.set(_timing.withTiming(0, timingFast));
}
}, [state, sharedValue]);
callback = useCallback(() => {
if (ref.current != null) {
clearTimeout(ref.current);
ref.current = null;
}
setState2(true);
}, []);
const callback2 = useCallback(() => {
if (onFirstFrame != null) {
onFirstFrame();
}
if (ref.current != null) {
clearTimeout(ref.current);
}
ref.current = setTimeout(() => {
setState2(true);
ref.current = null;
}, c9833_12);
}, [onFirstFrame]);
const callback3 = useCallback((a0) => {
callback();
if (handleVideoError != null) {
handleVideoError(a0);
}
}, [callback, handleVideoError]);
const callback4 = useCallback((a0) => {
if (a0.currentTime > 0) {
setState(true);
}
handleVideoProgress(a0);
}, [handleVideoProgress]);
const Ce = () => ({
opacity: sharedValue.get()
});
Ce.__closure = {
posterOpacity: sharedValue
};
Ce.__workletHash = 4975136521719;
Ce.__initData = __initData;
const animatedStyle = useAnimatedStyle(Ce);
const Ae = function Ae() {
const r4 = isScrollingInBoundsSharedValue == null ? void 0 : isScrollingInBoundsSharedValue.get();
return {
opacity: _timing.withTiming(c20877_4 ? r4 !== true ? 1 : 0 : 0, _timingPresets.timingStandard)
};
};
Ae.__closure = {
isScrollingInBoundsSharedValue,
withTiming: _timing.withTiming,
isActive,
timingStandard: _timingPresets.timingStandard
};
Ae.__workletHash = 12676706441349;
Ae.__initData = __initData2;
const animatedStyle2 = useAnimatedStyle(Ae);
const Fe = function Fe() {
if (peekScale == null) {
return {};
}
const scale = peekScale.get();
return {
transform: [{
translateY: (1 - scale) / (1 - _useBountiesAutoScroll.AUTO_SCROLL_PEEK_SCALE) * _useBountiesAutoScroll.AUTO_SCROLL_PEEK_TOP_OFFSET
}, {
scale
}]
};
};
Fe.__closure = {
peekScale,
AUTO_SCROLL_PEEK_SCALE: _useBountiesAutoScroll.AUTO_SCROLL_PEEK_SCALE,
AUTO_SCROLL_PEEK_TOP_OFFSET: _useBountiesAutoScroll.AUTO_SCROLL_PEEK_TOP_OFFSET
};
Fe.__workletHash = 7501077341815;
Fe.__initData = __initData3;
const animatedStyle3 = useAnimatedStyle(Fe);
const visible = isBountiesVerticalScrollExperimentEnabled ? isCtaVisible ? !isEndCardVisible : isCtaVisible : isCtaVisible;
const r203 = [shouldLoadHls ? <AdVideoPlayer ref={playerRef} source={{
uri: bounty.videoHls
}} automaticallyWaitsToMinimizeStalling={(stage1Enabled ? !stage1Enabled : !ownedByVerticalScrollExperiment) && void 0} maxBitRate={softDownloadCapsEnabled ? SOFT_CAP_PRELOAD_MAX_BITRATE : void 0} bufferConfig={softDownloadCapsEnabled ? SOFT_CAP_PRELOAD_BUFFER_CONFIG : void 0} preferredForwardBufferDuration={softDownloadCapsEnabled ? SOFT_CAP_PRELOAD_FORWARD_BUFFER_SEC : void 0} initialProgress={initialProgress} isFullscreen={false} externallyPaused={(isActive ? isEndCardVisible : !isActive) || isRecapPageRevealed} style={StyleSheet.absoluteFillObject} contentInsets={contentInsets} onProgress={callback4} onEnd={handleVideoEnd} onPausePlayback={handleVideoPaused} onResumePlayback={handleVideoResumed} onError={callback3} onLoadStart={onLoadStart} onBuffer={onBuffer} onReadyForDisplay={callback2} onVideoTracks={onVideoTracks} hideControls={isEndCardVisible} showSkipButtons={false} repeat={repeat} bufferingSpinnerPlacement="center" onPlayerStateChange={onPlayerStateChange} /> : null, memo != null ? <ReanimatedRexport.View style={[styles.poster, animatedStyle]} pointerEvents="none">
<FastImage style={StyleSheet.absoluteFillObject} source={{
uri: memo
}} resizeMode="cover" />
{state ? !state : <ActivityIndicator animating size="small" color={token} />}
</ReanimatedRexport.View> : <ReanimatedRexport.View style={[styles.poster, animatedStyle]} pointerEvents="none" />, renderEndCard == null ? void 0 : renderEndCard(), , ,];
if (isScrollIndicatorEnabled) {
if (isActive) {
isActive = state2;
}
isScrollIndicatorEnabled = <BountiesScrollIndicatorOverlay opacityStyle={animatedStyle2} enabled={isActive} isEndCardVisible={isEndCardVisible} />;
}
r203[3] = isScrollIndicatorEnabled;
r203[4] = <ReanimatedRexport.View style={[StyleSheet.absoluteFillObject, animatedStyle2]} pointerEvents="box-none">
<BountiesModalAdvertiserCta bounty={bounty} visible={visible} sourceQuestContent={sourceQuestContent} />
</ReanimatedRexport.View>;
return <>
<ReanimatedRexport.View style={[StyleSheet.absoluteFillObject, styles.peekOrigin, animatedStyle3]}>
<View style={styles.videoContainer}>{r203}</View>
<ReanimatedRexport.View style={[styles.progress, animatedStyle2]}>
<BountiesModalProgress progress={normalizedProgress} visible={isProgressBarVisible} />
</ReanimatedRexport.View>
</ReanimatedRexport.View>
<ReanimatedRexport.View style={[styles.leftRow, animatedStyle2]}>
<BountiesModalTimer isCompleted={isCompleted} totalSeconds={rewardTotalSeconds} remainingSeconds={rewardRemainingSeconds} />
<BalanceWidgetPill key={balanceWidgetPillResetKey} balance={orbsBalance} />
</ReanimatedRexport.View>
</>;
}
@@ -0,0 +1,9 @@
// Metro module 14063 (f14064).
export const SOFT_CAP_PRELOAD_MAX_BITRATE = 500000;
export const SOFT_CAP_PRELOAD_BUFFER_CONFIG = {
minBufferMs: 1000,
maxBufferMs: 3000,
bufferForPlaybackMs: 500,
bufferForPlaybackAfterRebufferMs: 1000
};
export const SOFT_CAP_PRELOAD_FORWARD_BUFFER_SEC = 2;
@@ -0,0 +1,7 @@
// Metro module 14041 (f14042).
import { useLocalStorageState } from "../../../../hooks/useLocalStorageState";
let c9817_2 = "devtools-force-bounties-swipe-up-nux";
export const FORCE_BOUNTIES_SWIPE_UP_NUX_STORAGE_KEY = "devtools-force-bounties-swipe-up-nux";
export function useForceBountiesSwipeUpNux() {
return useLocalStorageState(c9817_2, false);
}
@@ -0,0 +1,14 @@
// Metro module 14056 (f14057).
import { BOUNTY_REWARD_CLAIM_FAILED_TOAST_DURATION_MS } from "./BountiesModalConstants";
import { intl, t } from "../../../../intl/index.native";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import Module9172 from "../../../../_bundle/Module9172";
let c9829_4 = new Set([260021]);
export function openBountyRewardClaimErrorToast(a0) {
ToastActionCreators.open({
key: "QUESTS_BOUNTIES_REWARD_CLAIM_FAILED",
content: a0?.code != null && c9829_4.has(a0.code) ? a0?.message != null ? a0.message : intl.string(t.uLjCfn) : intl.string(t.uLjCfn),
icon: Module9172,
toastDurationMs: BOUNTY_REWARD_CLAIM_FAILED_TOAST_DURATION_MS
});
}
@@ -0,0 +1,295 @@
// Metro module 14042 (f14043).
import { useState, useRef, useCallback, useEffect } from "react";
import { AppState } from "react-native";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { BountiesVerticalScrollExperiment } from "../../experiments/BountiesVerticalScrollExperiment";
import { useForceBountiesSwipeUpNux } from "./bountiesSwipeUpNuxDevTools";
import { useSharedValue } from "../../../reanimated/ReanimatedRexport";
import { withTiming } from "../../../../design/animation/reanimated/timing/timing";
import { timingSlow, timingStandard } from "../../../../design/animation/reanimated/timing/timingPresets";
import { getIsInAppBrowserOpen, subscribeToIsInAppBrowserOpen } from "../../../links/native/BrowserManager";
let c9818_6 = new Set();
export const AUTO_SCROLL_PEEK_SCALE = 0.83;
export const AUTO_SCROLL_PEEK_TOP_OFFSET = 54;
export function clearDismissedScrollAffordanceBountyIds() {
c9818_6.clear();
}
export function useBountiesAutoScroll({ listRef, enabled, mode, activeIndex, activeBountyId, slotHeight, onCountdownCancelled }) {
let callback2, callback3, callback4, callback5, callback6, callback7, callback8, callback9, callback10, callback11, callback12, callback13;
callback2 = void 0;
callback3 = void 0;
callback4 = void 0;
callback5 = void 0;
callback6 = void 0;
callback7 = void 0;
callback8 = void 0;
callback9 = void 0;
callback10 = void 0;
callback11 = void 0;
callback12 = void 0;
callback13 = void 0;
const config = BountiesVerticalScrollExperiment.useConfig({
location: QuestsExperimentLocations.VIDEO_MODAL_MOBILE
});
const { autoScrollLeadMs, autoScrollEndCardMs, ctaTimerMilliSeconds } = config;
const r4 = autoScrollLeadMs / 1000;
let c20867_8 = r4;
const current = r4 + autoScrollEndCardMs / 1000;
const [r48] = useForceBountiesSwipeUpNux();
let c20867_10 = r48;
const [visible, setState] = useState(false);
const [peekActive, setState2] = useState(false);
const [progress, setState3] = useState(0);
const [showProgressRing, setState4] = useState(false);
const ref = useRef(false);
const ref2 = useRef(false);
const ref3 = useRef(false);
const ref4 = useRef(false);
const ref5 = useRef(null);
const ref6 = useRef(null);
const ref7 = useRef(0);
const ref8 = useRef(null);
const ref9 = useRef(false);
const ref10 = useRef(false);
const sharedValue = useSharedValue(1);
const ref11 = useRef(current);
const callback = useCallback(() => {
if (ref5.current != null) {
clearInterval(ref5.current);
ref5.current = null;
}
ref8.current = null;
}, []);
callback2 = useCallback(() => {
if (ref6.current != null) {
clearTimeout(ref6.current);
ref6.current = null;
}
}, []);
callback3 = useCallback((a0) => {
if (!(c20867_10 || a0 == null)) {
c9818_6.add(a0);
}
}, [r48]);
callback4 = useCallback((a0) => (c20867_10 ? !c20867_10 : a0 != null) && c9818_6.has(a0), [r48]);
callback5 = useCallback(() => {
setState(false);
setState2(false);
setState3(0);
setState4(false);
}, []);
const [state, setState5] = useState(activeIndex);
const [state2, setState6] = useState(activeBountyId);
if (!(state === activeIndex && state2 === activeBountyId)) {
setState5(activeIndex);
setState6(activeBountyId);
callback5();
}
useEffect(() => {
callback();
callback2();
ref.current = callback4(activeBountyId);
ref2.current = callback4(activeBountyId);
ref3.current = false;
ref4.current = false;
ref7.current = 0;
ref9.current = false;
ref10.current = false;
sharedValue.set(1);
}, [activeIndex, activeBountyId, callback, callback2, sharedValue, callback4]);
useEffect(() => () => {
callback();
callback2();
}, [callback, callback2]);
useEffect(() => {
ref11.current = current;
}, [current]);
callback6 = useCallback(function(r7 = 0) {
const r6 = ref2.current || ref.current || callback4(activeBountyId);
let r1 = !r6;
if (!r6) {
ref2.current = true;
callback3(activeBountyId);
callback2();
ref6.current = setTimeout(() => {
ref6.current = null;
if (!(ref.current || ref4.current)) {
sharedValue.set(withTiming(0.83, timingSlow));
setState2(true);
ref6.current = setTimeout(() => {
ref6.current = null;
if (!(ref.current || ref4.current)) {
setState(true);
}
}, 500);
}
}, r7);
r1 = true;
}
return r1;
}, [activeBountyId, callback2, callback3, sharedValue, callback4]);
callback7 = useCallback(() => {
if (!(ref4.current || ref.current)) {
ref4.current = true;
callback3(activeBountyId);
callback();
callback2();
callback5();
sharedValue.set(1);
const current2 = listRef.current;
if (current2 != null) {
current2.scrollToOffset({
offset: (activeIndex + 1) * slotHeight,
animated: true
});
}
}
}, [activeBountyId, activeIndex, callback, callback2, listRef, callback3, sharedValue, callback5, slotHeight]);
callback8 = useCallback(() => {
if (!ref.current && !ref9.current) {
const current3 = Date.now();
if (ref8.current != null) {
ref7.current = ref7.current + (current3 - ref8.current);
}
ref8.current = current3;
const current2 = ref11.current;
const r22 = ref7.current / 1000;
if (r22 >= current2) {
callback7();
} else {
setState3(r22 / current2);
}
}
}, [callback7]);
callback9 = useCallback(() => {
if (!(ref3.current || ref5.current != null || ref9.current)) {
ref3.current = true;
ref7.current = 0;
ref8.current = Date.now();
setState3(0);
setState4(true);
ref5.current = setInterval(callback8, 50);
}
}, [callback8]);
callback10 = useCallback(() => {
if (ref3.current && !ref9.current && ref5.current != null) {
const r6 = Date.now();
if (ref8.current != null) {
ref7.current = ref7.current + (r6 - ref8.current);
}
ref9.current = true;
callback();
}
}, [callback]);
callback11 = useCallback(() => {
if (ref3.current && ref9.current && !ref.current && !ref4.current) {
ref9.current = false;
ref8.current = Date.now();
ref5.current = setInterval(callback8, 50);
}
}, [callback8]);
callback12 = useCallback(() => {
if (!ref9.current) {
callback10();
ref10.current = true;
}
}, [callback10]);
callback13 = useCallback(() => {
if (ref10.current && !getIsInAppBrowserOpen()) {
ref10.current = false;
callback11();
}
}, [callback11]);
useEffect(() => {
let c27615_1;
let c27615_0 = AppState.addEventListener("change", (a0) => {
if (a0 === "active") {
callback13();
} else {
callback12();
}
});
c27615_1 = subscribeToIsInAppBrowserOpen((a0) => {
if (a0) {
callback12();
} else {
callback13();
}
});
return () => {
c27615_0.remove();
c27615_1();
};
}, [callback12, callback13]);
return {
visible,
peekActive,
progress,
showProgressRing,
peekScale: sharedValue,
cancel: useCallback((a0) => {
const current2 = ref2.current;
if (!((current2 ? ref.current : !current2) || ref4.current)) {
ref.current = true;
callback3(activeBountyId);
callback();
setState(false);
setState3(0);
sharedValue.set(withTiming(1, timingStandard));
if (mode === "countdown" && onCountdownCancelled != null) {
onCountdownCancelled(a0);
}
callback2();
callback5();
}
}, [activeBountyId, callback, callback2, callback3, mode, onCountdownCancelled, sharedValue, callback5]),
dismissOnClose: useCallback(() => {
if (ref2.current) {
ref.current = true;
callback3(activeBountyId);
callback();
callback2();
callback5();
sharedValue.set(1);
}
}, [activeBountyId, callback, callback2, callback3, sharedValue, callback5]),
takeDidAutoScroll: useCallback(() => {
const current2 = ref4.current;
ref4.current = false;
callback2();
callback5();
return current2;
}, [callback2, callback5]),
onPlaybackTimeChange: useCallback((a0, a1, a2, a3, a4) => {
if (!((enabled ? mode !== "countdown" : !enabled) || ref.current || ref4.current || a1 <= 0)) {
const current2 = ref2.current;
if (current2 ? !current2 : a4 ? a4 : 1000 * a3 > ctaTimerMilliSeconds) {
callback6(5000);
}
if ((a2 ? !ref3.current : a2) && !(a1 - a0 > c20867_8)) {
callback9();
}
}
}, [r4, ctaTimerMilliSeconds, enabled, mode, callback6, callback9]),
onEndCardVisible: useCallback(() => {
if (!((enabled ? ref.current : !enabled) || callback4(activeBountyId))) {
if (mode !== "hint") {
if (!ref2.current) {
callback6();
}
if (ref3.current) {
if (ref9.current) {
callback11();
}
} else {
callback9();
}
} else {
callback6();
}
}
}, [activeBountyId, enabled, mode, callback11, callback6, callback9, callback4]),
pauseCountdown: callback10,
resumeCountdown: callback11
};
}
@@ -0,0 +1,127 @@
// Metro module 14055 (f14056).
import { useState, useRef, useCallback } from "react";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
let c9828_5 = {
END_CARD: "END_CARD",
END_CARD_WITH_CTA: "END_CARD_WITH_CTA",
LOOP: "LOOP"
};
export { c9828_5 as BountyVideoEndMode };
export function useBountiesModalTiming(a0) {
let setState2, setState3, setState4, setState5, ref, ref2, ref3, ref4, ref5;
const { endMode, rewardDurationMs } = a0;
let isCompleted = a0.isCompleted;
const { onRewardEarned, onVideoProgress, onVideoEnd, onVideoLooped, onVideoPaused, onVideoResumed, playerRef, initialProgressSec = 0 } = a0;
let c20874_9 = initialProgressSec;
let initialMaxVideoProgressSec = a0.initialMaxVideoProgressSec;
if (initialMaxVideoProgressSec === void 0) {
initialMaxVideoProgressSec = 0;
}
let initialVideoDurationSec = a0.initialVideoDurationSec;
if (initialVideoDurationSec === void 0) {
initialVideoDurationSec = null;
}
let c20874_10 = initialVideoDurationSec;
setState2 = void 0;
setState3 = void 0;
setState4 = void 0;
setState5 = void 0;
ref = void 0;
ref2 = void 0;
ref3 = void 0;
ref4 = void 0;
ref5 = void 0;
const [isEndCardVisible, setState] = useState(initialVideoDurationSec != null && initialProgressSec >= initialVideoDurationSec - 1 && endMode !== c9828_5.LOOP);
let state;
[state, setState2] = useState(() => c20874_10 != null ? c20874_9 / c20874_10 : 0);
let normalizedProgress;
[normalizedProgress, setState3] = useState(null);
let maxVideoProgressSeconds;
[maxVideoProgressSeconds, setState4] = useState(initialMaxVideoProgressSec);
let videoDuration;
[videoDuration, setState5] = useState(initialVideoDurationSec);
ref = useRef(isCompleted);
ref2 = useRef(initialMaxVideoProgressSec);
if (initialVideoDurationSec == null) {
initialVideoDurationSec = 0;
}
ref3 = useRef(initialVideoDurationSec);
ref4 = useRef(0);
ref5 = useRef(initialProgressSec);
const callback = useCallback(({ progress, currentTime, seekableDuration }) => {
setState3(null);
const current2 = Math.max(currentTime, ref2.current);
ref2.current = current2;
ref3.current = seekableDuration;
ref5.current = currentTime;
setState2(progress);
setState4(current2);
setState5(seekableDuration);
onVideoProgress(current2, seekableDuration, currentTime);
const current = ref.current;
if (current ? !current : 1000 * current2 >= rewardDurationMs) {
ref.current = true;
onRewardEarned();
}
}, [onVideoProgress, onRewardEarned, rewardDurationMs]);
const callback2 = useCallback(() => {
onVideoEnd(ref2.current, ref3.current, ref5.current);
if (endMode === c9828_5.LOOP) {
ref4.current = ref4.current + 1;
onVideoLooped(ref4.current);
ref5.current = 0;
} else {
setState(true);
}
if (!ref.current) {
ref.current = true;
onRewardEarned();
}
}, [endMode, onVideoEnd, onVideoLooped, onRewardEarned]);
const callback3 = useCallback(() => {
if (playerRef != null) {
const current = playerRef.current;
if (current != null) {
current.seekToStart();
}
}
setState3(0);
setState(false);
}, [playerRef]);
const callback4 = useCallback((a0) => {
onVideoPaused(ref5.current, a0);
}, [onVideoPaused]);
const callback5 = useCallback((a0) => {
onVideoResumed(ref5.current, a0);
}, [onVideoResumed]);
const r2 = 1000 * maxVideoProgressSeconds;
const rewardTotalSeconds = rewardDurationMs / 1000;
const r91 = Math.max(0, rewardTotalSeconds - maxVideoProgressSeconds);
const rewardRemainingSeconds = r2 >= rewardDurationMs ? 0 : isEndCardVisible ? 0 : isCompleted ? 0 : videoDuration != null ? videoDuration > 0 ? Math.max(0, Math.min(rewardTotalSeconds, videoDuration) - maxVideoProgressSeconds) : r91 : r91;
const ctaTimerMilliSeconds = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE).ctaTimerMilliSeconds;
const r109 = isEndCardVisible && endMode !== c9828_5.END_CARD_WITH_CTA;
if (!isCompleted) {
isCompleted = r2 > ctaTimerMilliSeconds;
}
if (isCompleted) {
isCompleted = !r109;
}
if (normalizedProgress == null) {
normalizedProgress = state;
}
return {
isCtaVisible: isCompleted,
isEndCardVisible,
handleVideoEnd: callback2,
handleVideoProgress: callback,
handleVideoPaused: callback4,
handleVideoResumed: callback5,
handleReplay: callback3,
rewardRemainingSeconds,
rewardTotalSeconds,
normalizedProgress,
maxVideoProgressSeconds,
videoDuration
};
}
@@ -0,0 +1,454 @@
// Metro module 14059 (f14060).
import { useMemo, useRef, useCallback, useEffect } from "react";
import NetworkStore from "../../../../stores/NetworkStore";
import { AnalyticEvents } from "../../../../Constants";
import { useQuestImpressionId } from "../../lib/analytics/ContentImpressionTrackerHooks";
import { v4 } from "../../../../_bundle/Module514";
import { formatVideoProgressRatio } from "../../utils/VideoQuestUtils";
import { trackAdContentEvent } from "../../lib/analytics/AnalyticsActions";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { PlaybackTriggerSource } from "../AdVideoPlayer";
import { isSourceError } from "../AdsVideoUtils";
import MonitoringAgent from "../../../monitoring/MonitoringAgent";
import { MetricEvents } from "../../../../_bundle/Module5872";
let c9831_6 = [25, 50, 75];
export function useBountiesModalVideoAnalytics(a0) {
let ref, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9, ref10, ref11, ref12, callback, memo2, callback2, callback3, callback4, callback5, callback6, callback7, callback8, callback9, callback10, callback11;
const { bountyId, sourceQuestContent, rewardDurationMs, initialPlaybackTimeSec = 0, initialMaxVideoProgressSec = 0 } = a0;
let c20876_3 = initialMaxVideoProgressSec;
let initialVideoDurationSec = a0.initialVideoDurationSec;
if (initialVideoDurationSec === void 0) {
initialVideoDurationSec = 0;
}
let c20876_4 = initialVideoDurationSec;
let wasPreloaded = a0.wasPreloaded;
if (wasPreloaded === void 0) {
wasPreloaded = false;
}
const was_preloaded = wasPreloaded;
let startupPath = a0.startupPath;
if (startupPath === void 0) {
startupPath = "carousel";
}
const startup_path = startupPath;
let verticalScrollingPosition = a0.verticalScrollingPosition;
if (verticalScrollingPosition === void 0) {
verticalScrollingPosition = null;
}
const vertical_scrolling_position = verticalScrollingPosition;
let isActive = a0.isActive;
if (isActive === void 0) {
isActive = true;
}
let c20876_8 = isActive;
ref = void 0;
ref2 = void 0;
ref3 = void 0;
ref4 = void 0;
ref5 = void 0;
ref6 = void 0;
ref7 = void 0;
ref8 = void 0;
ref9 = void 0;
ref10 = void 0;
ref11 = void 0;
ref12 = void 0;
callback = void 0;
memo2 = void 0;
callback2 = void 0;
callback3 = void 0;
callback4 = void 0;
callback5 = void 0;
callback6 = void 0;
callback7 = void 0;
callback8 = void 0;
callback9 = void 0;
callback10 = void 0;
callback11 = void 0;
const questImpressionId = useQuestImpressionId();
const memo = useMemo(() => v4(), []);
const set = new Set();
const r40 = initialPlaybackTimeSec > 0 || initialMaxVideoProgressSec > 0;
if (r40) {
set.add("start");
}
if (1000 * initialMaxVideoProgressSec >= rewardDurationMs) {
set.add("threshold");
}
ref = useRef(set);
ref2 = useRef(false);
ref3 = useRef(initialPlaybackTimeSec);
ref4 = useRef(initialVideoDurationSec);
ref5 = useRef(null);
ref6 = useRef(null);
ref7 = useRef(false);
ref8 = useRef(false);
ref9 = useRef(null);
ref10 = useRef(null);
ref11 = useRef(-1);
ref12 = useRef({
bitrateBps: null,
width: null,
height: null,
levelIndex: null
});
callback = useCallback(() => {
if (ref9.current != null) {
clearTimeout(ref9.current);
ref9.current = null;
}
}, []);
memo2 = useMemo(() => ({
was_preloaded,
startup_path,
vertical_scrolling_position,
reward_timer_seconds: rewardDurationMs / 1000
}), [was_preloaded, startup_path, vertical_scrolling_position, rewardDurationMs]);
callback2 = useCallback(() => {
const current = ref12.current;
return {
hls_level_index: current.levelIndex,
hls_segment_res_width: current.width,
hls_segment_res_height: current.height
};
}, []);
callback3 = useCallback((a0) => {
if (!ref2.current) {
let r5 = a0;
ref2.current = true;
if (!(a0 > 0)) {
r5 = c20876_4;
}
if (!(r5 <= 0)) {
const r6 = formatVideoProgressRatio(c20876_3, r5);
for (const item of c9831_6) {
if (r6 >= item / 100) {
ref.current.add(`p${item}`);
}
}
}
}
}, [initialMaxVideoProgressSec, initialVideoDurationSec]);
callback4 = useCallback((a0) => {
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_PROGRESSED,
properties: {
progress: a0.progress,
video_timestamp_seconds: a0.videoTimestampSeconds,
video_session_id: memo,
impression_id: questImpressionId,
threshold_met: a0.thresholdMet,
reward_timer_seconds: rewardDurationMs / 1000
},
sourceQuestContent
});
}, [bountyId, memo, questImpressionId, sourceQuestContent, rewardDurationMs]);
callback5 = useCallback(() => {
if (!ref.current.has("start")) {
ref.current.add("start");
callback4({
videoTimestampSeconds: 0,
progress: 0,
thresholdMet: false
});
}
}, [callback4]);
callback6 = useCallback((a0, a1) => {
if (!ref.current.has("threshold")) {
ref.current.add("threshold");
const videoTimestampSeconds = Math.max(rewardDurationMs / 1000, a0);
callback4({
videoTimestampSeconds,
progress: formatVideoProgressRatio(videoTimestampSeconds, a1),
thresholdMet: true
});
}
}, [callback4, rewardDurationMs]);
callback7 = useCallback((a0, a1) => {
if (!ref.current.has("end")) {
ref.current.add("end");
callback4({
videoTimestampSeconds: Math.max(a0, a1),
progress: 1,
thresholdMet: true
});
}
}, [callback4]);
callback8 = useCallback((a0, a1) => {
if (!(a1 <= 0)) {
const progress = formatVideoProgressRatio(a0, a1);
for (const item of c9831_6) {
const r15 = `p${item}`;
if (!ref.current.has(r15) && !(progress < item / 100)) {
ref.current.add(r15);
callback4({
videoTimestampSeconds: a0,
progress,
thresholdMet: 1000 * a0 >= rewardDurationMs
});
}
}
}
}, [callback4, rewardDurationMs]);
const callback12 = useCallback((a0, a1, a2) => {
ref3.current = a2;
ref4.current = a1;
callback3(a1);
if (a0 === 0) {
callback5();
}
if (1000 * a0 >= rewardDurationMs) {
callback6(a0, a1);
}
callback8(a0, a1);
}, [callback3, callback5, callback6, callback8, rewardDurationMs]);
const callback13 = useCallback((a0, a1, a2) => {
ref3.current = a2;
ref4.current = a1;
callback3(a1);
if (a0 === 0) {
callback5();
}
callback6(a0, a1);
callback8(a0, a1);
callback7(a0, a1);
}, [callback3, callback5, callback6, callback8, callback7]);
const callback14 = useCallback((a0) => {
ref3.current = 0;
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_LOOPED,
properties: {
video_session_id: memo,
impression_id: questImpressionId,
loop_count: a0,
reward_timer_seconds: rewardDurationMs / 1000
},
sourceQuestContent
});
}, [bountyId, memo, questImpressionId, sourceQuestContent, rewardDurationMs]);
const callback15 = useCallback((a0, a1) => {
if (a1 === PlaybackTriggerSource.USER_INTERACTION) {
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_PAUSED,
properties: {
video_timestamp_seconds: a0,
video_session_id: memo,
impression_id: questImpressionId,
reward_timer_seconds: rewardDurationMs / 1000
},
sourceQuestContent
});
}
}, [bountyId, memo, questImpressionId, sourceQuestContent, rewardDurationMs]);
const callback16 = useCallback((a0, a1) => {
if (a1 === PlaybackTriggerSource.USER_INTERACTION) {
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_RESUMED,
properties: {
video_timestamp_seconds: a0,
video_session_id: memo,
impression_id: questImpressionId,
reward_timer_seconds: rewardDurationMs / 1000
},
sourceQuestContent
});
}
}, [bountyId, memo, questImpressionId, sourceQuestContent, rewardDurationMs]);
const callback17 = useCallback((a0) => {
const properties = {
video_progress: formatVideoProgressRatio(ref3.current, ref4.current),
video_error_type: null,
network_connection_speed: null,
video_session_id: memo,
video_error_code: a0 == null ? void 0 : a0.error.code,
video_error_message: null,
video_network_state: null,
impression_id: null,
reward_timer_seconds: null
};
let video_error_message = a0 == null ? void 0 : a0.error.localizedDescription;
if (video_error_message == null) {
video_error_message = a0 == null ? void 0 : a0.error.errorString;
}
properties.video_error_message = video_error_message;
properties.impression_id = questImpressionId;
properties.reward_timer_seconds = rewardDurationMs / 1000;
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_ERROR,
properties,
sourceQuestContent
});
if (isSourceError(a0)) {
MonitoringAgent.increment({
name: MetricEvents.QUEST_VIDEO_ERROR,
tags: ["error_type:SOURCE_ERROR"]
});
}
}, [bountyId, memo, questImpressionId, sourceQuestContent, rewardDurationMs]);
callback9 = useCallback(() => {
if (ref10.current != null) {
const duration = Date.now() - ref10.current;
ref10.current = null;
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_BUFFERING_ENDED,
properties: {
video_session_id: memo,
impression_id: questImpressionId,
duration,
network_connection_speed: NetworkStore.getEffectiveConnectionSpeed(),
buffer_index: ref11.current,
video_bitrate_bps: ref12.current.bitrateBps,
...callback2(),
...memo2
},
sourceQuestContent
});
}
}, [bountyId, memo, questImpressionId, callback2, memo2, sourceQuestContent]);
callback10 = useCallback(() => {
if (!(ref7.current || ref5.current == null || ref6.current == null)) {
ref7.current = true;
callback();
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_TIME_TO_FIRST_FRAME,
properties: {
video_session_id: memo,
impression_id: questImpressionId,
duration_ms: ref6.current - ref5.current,
network_connection_speed: NetworkStore.getEffectiveConnectionSpeed(),
startup_bitrate_bps: ref12.current.bitrateBps,
...callback2(),
...memo2
},
sourceQuestContent
});
}
}, [bountyId, memo, questImpressionId, callback, callback2, memo2, sourceQuestContent]);
callback11 = useCallback(() => {
if (!(ref7.current || ref5.current == null || ref6.current == null)) {
if (ref12.current.bitrateBps == null) {
if (ref9.current == null) {
ref9.current = setTimeout(() => {
ref9.current = null;
callback10();
}, 500);
}
} else {
callback10();
}
}
}, [callback10]);
useEffect(() => () => {
if (ref9.current != null) {
callback10();
}
callback();
callback9();
}, [callback, callback9, callback10]);
useEffect(() => {
if (c20876_8) {
callback11();
} else {
if (ref9.current != null) {
callback10();
}
callback();
callback9();
}
}, [isActive, callback11, callback, callback9, callback10]);
return {
handleVideoProgressAnalytics: callback12,
handleVideoEndAnalytics: callback13,
handleVideoLoopedAnalytics: callback14,
handleVideoPausedAnalytics: callback15,
handleVideoResumedAnalytics: callback16,
handleVideoErrorAnalytics: callback17,
handleLoadStartAnalytics: useCallback(() => {
callback9();
callback();
ref5.current = Date.now();
ref6.current = null;
ref7.current = false;
ref8.current = false;
ref12.current = {
bitrateBps: null,
width: null,
height: null,
levelIndex: null
};
}, [callback, callback9]),
handleVideoTracksAnalytics: useCallback(({ videoTracks, selectedVideoTrackId }) => {
let current;
if (videoTracks.length === 0) {
current = {
bitrateBps: null,
width: null,
height: null,
levelIndex: null
};
} else {
const r7 = selectedVideoTrackId != null ? selectedVideoTrackId.length > 0 ? videoTracks.findIndex((videoTrack) => videoTrack.trackId === selectedVideoTrackId) : -1 : -1;
const r16 = r7 >= 0 ? videoTracks[r7] : videoTracks[0];
current = {
bitrateBps: r16.bitrate > 0 ? r16.bitrate : null,
width: r16.width > 0 ? r16.width : null,
height: r16.height > 0 ? r16.height : null,
levelIndex: r7 >= 0 ? r7 : null
};
}
ref12.current = current;
if (c20876_8 && ref6.current != null && ref12.current.bitrateBps != null) {
callback10();
}
}, [callback10, isActive]),
handleReadyForDisplayAnalytics: useCallback(() => {
ref8.current = true;
if (ref6.current == null) {
ref6.current = Date.now();
}
if (c20876_8) {
callback11();
}
}, [isActive, callback11]),
handleBufferAnalytics: useCallback((a0) => {
if (ref8.current && c20876_8) {
if (a0) {
ref10.current = Date.now();
ref11.current = ref11.current + 1;
trackAdContentEvent({
adContentId: bountyId,
adCreativeType: AdCreativeType.BOUNTY,
event: AnalyticEvents.AD_VIDEO_BUFFERING_STARTED,
properties: {
video_session_id: memo,
impression_id: questImpressionId,
network_connection_speed: NetworkStore.getEffectiveConnectionSpeed(),
buffer_index: ref11.current,
video_bitrate_bps: ref12.current.bitrateBps,
...callback2(),
...memo2
},
sourceQuestContent
});
} else {
callback9();
}
return void 0;
}
}, [bountyId, memo, questImpressionId, callback9, callback2, isActive, memo2, sourceQuestContent])
};
}
@@ -0,0 +1,87 @@
// Metro module 14043 (f14044).
import { useState, useCallback } from "react";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useAnimatedReaction } from "../../../reanimated/ReanimatedRexport";
import * as _useBountiesRecapScroll from "./useBountiesRecapScroll";
let getRecapOrbCountFromPullProgress, __initData, __initData2;
const getRecapOrbCountFromPullProgress2 = function getRecapOrbCountFromPullProgress(a0, a1) {
if (!(a1 <= 0) && Number.isFinite(a1)) {
return Math.round(Math.min(1, Math.max(0, a0)) * a1);
}
return 0;
};
getRecapOrbCountFromPullProgress2.__closure = {};
getRecapOrbCountFromPullProgress2.__workletHash = 14295638108053;
getRecapOrbCountFromPullProgress2.__initData = {
code: "function getRecapOrbCountFromPullProgress_useBountiesRecapOrbCountTsx1(progress,targetOrbAmount){if(targetOrbAmount<=0||!Number.isFinite(targetOrbAmount)){return 0;}const clampedProgress=Math.min(1,Math.max(0,progress));return Math.round(clampedProgress*targetOrbAmount);}"
};
getRecapOrbCountFromPullProgress = getRecapOrbCountFromPullProgress2;
__initData = {
code: "function useBountiesRecapOrbCountTsx2(){const{enabled,recapRevealHeight,getRevealProgress,scrollY,lastBountyScrollOffset,RECAP_ORB_COUNT_REACHES_TARGET_AT_PROGRESS,getRecapOrbCountFromPullProgress,targetOrbAmount}=this.__closure;if(!enabled||recapRevealHeight<=0){return{count:0,revealed:false};}const pullProgress=getRevealProgress(scrollY.get(),lastBountyScrollOffset,recapRevealHeight)/RECAP_ORB_COUNT_REACHES_TARGET_AT_PROGRESS;if(pullProgress<=0.1){return{count:0,revealed:false};}return{count:getRecapOrbCountFromPullProgress(pullProgress,targetOrbAmount),revealed:true};}"
};
__initData2 = {
code: "function useBountiesRecapOrbCountTsx3({count:count,revealed:revealed}){const{runOnJS,resetDisplayCount,setDisplayCountMonotonic}=this.__closure;if(!revealed){runOnJS(resetDisplayCount)();return;}runOnJS(setDisplayCountMonotonic)(count);}"
};
export { getRecapOrbCountFromPullProgress };
export function useBountiesRecapOrbCount({ scrollY, lastBountyScrollOffset, recapRevealHeight, targetOrbAmount, enabled }) {
let callback2;
callback2 = void 0;
const [state, setState] = useState(0);
const callback = useCallback((c27616_0) => {
setState((prevState) => {
let r0 = prevState;
if (c27616_0 > prevState) {
r0 = c27616_0;
}
return r0;
});
}, []);
callback2 = useCallback(() => {
setState(0);
}, []);
const b = function b() {
if (enabled && !(recapRevealHeight <= 0)) {
const r21 = _useBountiesRecapScroll.getRevealProgress(scrollY.get(), lastBountyScrollOffset, recapRevealHeight) / 0.95;
return r21 <= 0.1 ? {
count: 0,
revealed: false
} : {
count: targetOrbAmount <= 0 ? 0 : Number.isFinite(targetOrbAmount) ? Math.round(Math.min(1, Math.max(0, r21)) * targetOrbAmount) : 0,
revealed: true
};
}
return {
count: 0,
revealed: false
};
};
b.__closure = {
enabled,
recapRevealHeight,
getRevealProgress: _useBountiesRecapScroll.getRevealProgress,
scrollY,
lastBountyScrollOffset,
RECAP_ORB_COUNT_REACHES_TARGET_AT_PROGRESS: 0.95,
getRecapOrbCountFromPullProgress,
targetOrbAmount
};
b.__workletHash = 2855285055570;
b.__initData = __initData;
const r39 = function(a0) {
const count = a0.count;
if (a0.revealed) {
_ReanimatedRexport.runOnJS(callback)(count);
} else {
_ReanimatedRexport.runOnJS(callback2)();
}
};
r39.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
resetDisplayCount: callback2,
setDisplayCountMonotonic: callback
};
r39.__workletHash = 12006414940221;
r39.__initData = __initData2;
useAnimatedReaction(b, r39);
return state;
}
@@ -0,0 +1,46 @@
// Metro module 14039 (f14040).
import { useCallback } from "react";
let getRevealProgress;
const getRevealProgress2 = function getRevealProgress(a0, a1, a2) {
return a2 <= 0 ? 0 : (a0 - a1) / a2;
};
getRevealProgress2.__closure = {};
getRevealProgress2.__workletHash = 9769647749947;
getRevealProgress2.__initData = {
code: "function getRevealProgress_useBountiesRecapScrollTsx1(scrollOffset,startOffset,revealHeight){if(revealHeight<=0){return 0;}return(scrollOffset-startOffset)/revealHeight;}"
};
getRevealProgress = getRevealProgress2;
export const RECAP_SNAP_EPSILON = 2;
export { getRevealProgress };
export function useBountiesRecapScroll({ listRef, enabled, offsets }) {
let callback2;
callback2 = void 0;
const callback = useCallback((a0) => {
if (listRef.current != null) {
listRef.current.scrollToOffset({
offset: a0,
animated: true
});
}
}, [listRef]);
const callback3 = useCallback(() => {
callback(offsets.lastBounty);
}, [offsets.lastBounty, callback]);
callback2 = useCallback((a0) => {
if (enabled && !(a0 <= offsets.lastBounty)) {
const { lastBounty, revealHeight } = offsets;
const r15 = (revealHeight <= 0 ? 0 : (a0 - lastBounty) / revealHeight) >= 0.25 ? offsets.fullRecap : offsets.lastBounty;
if (!(Math.abs(a0 - r15) < 2)) {
callback(r15);
}
}
}, [enabled, offsets.fullRecap, offsets.lastBounty, offsets.revealHeight, callback]);
return {
scrollToLastBounty: callback3,
handleRecapMomentumEnd: useCallback((a0) => {
if (enabled) {
callback2(a0.contentOffset.y);
}
}, [enabled, callback2])
};
}
@@ -0,0 +1,34 @@
// Metro module 14040 (f14041).
import { BountiesVerticalScrollExperiment } from "../../experiments/BountiesVerticalScrollExperiment";
import { useForceBountiesSwipeUpNux } from "./bountiesSwipeUpNuxDevTools";
import { DismissibleContent } from "../../../../_bundle/Module1358";
import { useSelectedDismissibleContent, useSelectedTimeRecurringDismissibleContent } from "../../../dismissible_content/hooks/useSelectedDismissibleContent";
export function useBountySwipeUpNux(a0) {
let hasRecurringSwipeUpNux;
let isEligible = a0.isEligible;
const r3 = BountiesVerticalScrollExperiment.useConfig({
location: a0.location
}).scrollAffordanceVariant === "none";
const [r27] = useForceBountiesSwipeUpNux();
const r28 = isEligible && r3 ? [DismissibleContent.BOUNTIES_SWIPE_UP_NUX] : [];
const r14 = isEligible ? r3 ? null : DismissibleContent.BOUNTIES_RECURRING_SWIPE_UP_NUX : null;
const [r43, dismissSingleUseSwipeUpNux] = useSelectedDismissibleContent(r28);
const hasSingleUseSwipeUpNux = r27 ? isEligible ? r3 : isEligible : r43 === DismissibleContent.BOUNTIES_SWIPE_UP_NUX;
const [r55, dismissRecurringSwipeUpNux] = useSelectedTimeRecurringDismissibleContent(r14, {
cooldownDurationMs: 86400000
});
if (r27) {
if (isEligible) {
isEligible = !r3;
}
hasRecurringSwipeUpNux = isEligible;
} else {
hasRecurringSwipeUpNux = r55 === DismissibleContent.BOUNTIES_RECURRING_SWIPE_UP_NUX;
}
return {
hasSingleUseSwipeUpNux,
dismissSingleUseSwipeUpNux,
hasRecurringSwipeUpNux,
dismissRecurringSwipeUpNux
};
}
@@ -0,0 +1,83 @@
// Metro module 14058 (f14059).
import { useState, useRef, useCallback } from "react";
import BountyStore from "../../BountyStore";
import { QuestsExperimentLocations } from "../../QuestConstants";
import { useBountiesExperience } from "../../experiments/useBountiesExperience";
import { BountyVideoEndMode } from "./useBountiesModalTiming";
import { setBountyVideoProgress } from "../../BountyActionCreators";
let c9830_6 = {
timestampSec: 0,
maxTimestampSec: 0,
duration: 0
};
export function useBountyVideoProgressPersistence({ bountyId, endMode }) {
let ref, ref2, ref3, ref4;
ref = void 0;
ref2 = void 0;
ref3 = void 0;
ref4 = void 0;
const bountiesExperience = useBountiesExperience(QuestsExperimentLocations.VIDEO_MODAL_MOBILE);
let ownedByVerticalScrollExperiment = bountiesExperience.ownedByVerticalScrollExperiment;
const stage1Enabled2 = bountiesExperience.stage1Enabled;
if (!ownedByVerticalScrollExperiment) {
ownedByVerticalScrollExperiment = stage1Enabled2;
}
const stage1Enabled = ownedByVerticalScrollExperiment;
const [initialProgress] = useState(() => {
let r10;
if (stage1Enabled) {
L9: {
L8: {
r10 = BountyStore.getBountyVideoProgress(bountyId);
if (r10 != null) {
if (endMode === BountyVideoEndMode.LOOP) {
const { maxTimestampSec, duration } = r10;
if (duration > 0 && maxTimestampSec >= duration - 1) {
break L8;
}
}
if (!(r10.timestampSec <= 5)) {
break L9;
}
}
}
r10 = c9830_6;
}
return r10;
}
return c9830_6;
});
ref = useRef(0);
ref2 = useRef(initialProgress.timestampSec);
ref3 = useRef(initialProgress.maxTimestampSec);
ref4 = useRef(initialProgress.duration);
return {
initialProgress,
handleProgress: useCallback((a0, a1, a2) => {
ref2.current = a2;
ref3.current = a0;
ref4.current = a1;
let r11 = stage1Enabled;
if (stage1Enabled) {
r11 = a2 >= ref.current;
}
if (r11) {
ref.current = a2 + 1;
setBountyVideoProgress(bountyId, {
timestampSec: a2,
maxTimestampSec: a0,
duration: a1
});
}
}, [stage1Enabled, bountyId]),
flushProgress: useCallback(() => {
if (stage1Enabled) {
setBountyVideoProgress(bountyId, {
timestampSec: ref2.current,
maxTimestampSec: ref3.current,
duration: ref4.current
});
}
}, [stage1Enabled, bountyId])
};
}
@@ -0,0 +1,66 @@
// Metro module 14038 (f14039).
import { useState, useCallback } from "react";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
const __initData = {
code: "function useVisibilityTransitionTsx1(){const{withTiming,visibility,visible,entranceTiming,exitTiming,runOnJS,animationCallbackJSThread}=this.__closure;return{opacity:withTiming(visibility,visible?entranceTiming:exitTiming,'respect-motion-settings',function(){'worklet';runOnJS(animationCallbackJSThread)();})};}"
};
const __initData2 = {
code: "function useVisibilityTransitionTsx2(){const{runOnJS,animationCallbackJSThread}=this.__closure;runOnJS(animationCallbackJSThread)();}"
};
export function useVisibilityTransition(a0) {
let c20865_5;
let visible2 = a0.visible;
const visible = visible2;
const { entranceTiming, exitTiming } = a0;
c20865_5 = void 0;
const [state, setState] = useState(false);
const [state2, setState2] = useState(visible);
if (state2 !== visible) {
setState2(visible);
if (!visible) {
setState(true);
}
}
const callback = useCallback(() => {
setState(false);
}, []);
const visibility = visible ? 1 : 0;
c20865_5 = visibility;
const k = () => {
const r6 = visible ? entranceTiming : exitTiming;
const n = function n() {
_ReanimatedRexport.runOnJS(callback)();
};
n.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
animationCallbackJSThread: callback
};
n.__workletHash = 11904317879470;
n.__initData = __initData2;
return {
opacity: _timing.withTiming(c20865_5, r6, "respect-motion-settings", n)
};
};
k.__closure = {
withTiming: _timing.withTiming,
visibility,
visible,
entranceTiming,
exitTiming,
runOnJS: _ReanimatedRexport.runOnJS,
animationCallbackJSThread: callback
};
k.__workletHash = 12648900540770;
k.__initData = __initData;
const r46 = {
opacityStyle: useAnimatedStyle(k),
shouldRender: null
};
if (!visible) {
visible2 = state;
}
r46.shouldRender = visible2;
return r46;
}