506 lines
26 KiB
TypeScript
506 lines
26 KiB
TypeScript
// Metro module 14205 (f14206).
|
|
import { useContext, useId, useCallback, useEffect, useState, useRef, memo } from "react";
|
|
import { Image as Image2, Pressable, View, StyleSheet } from "react-native";
|
|
import QuestDockStore from "./QuestDockStore";
|
|
import { QuestDockMode, QuestsExperimentLocations } from "../../QuestConstants";
|
|
import { QUEST_DOCK_COLLAPSED_HEIGHT, QUEST_DOCK_CONTENT_BORDER_RADII, QUEST_DOCK_MODE_CHANGE_PHYSICS, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED, QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED } from "./QuestDockConstants";
|
|
import { AnalyticEvents } from "../../../../Constants";
|
|
import { ThemeTypes } from "../../../../_bundle/Module505";
|
|
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
|
|
import Module712 from "../../../../_bundle/Module712";
|
|
import QuestDockContext from "./QuestDockContext";
|
|
import { QuestDockGestureContext, QuestDockGestureContextProvider } from "./QuestDockGestureContext";
|
|
import { QuestDockExternalCoordinationContext } from "./QuestDockExternalCoordinationContext";
|
|
import { useQuestDockModeAnimatedReaction, useQuestDockDismissalReset } from "./QuestDockHooks";
|
|
import { useIsScreenReaderEnabled } from "../../../a11y/native/useIsScreenReaderEnabled.native";
|
|
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
|
|
import ReanimatedRexport, { useDerivedValue, useAnimatedStyle, useSharedValue, useAnimatedProps } from "../../../reanimated/ReanimatedRexport";
|
|
import useStateFromSharedValue from "../../../reanimated/native/useStateFromSharedValue";
|
|
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
|
|
import { useYouBarTotalHeight } from "../../../main_tabs_v2/native/you_bar/hooks/useYouBarTotalHeight";
|
|
import { useToken } from "../../../../design/tokens/native/useToken";
|
|
import useQuestDockAnimatedBorderRadius from "./useQuestDockAnimatedBorderRadius";
|
|
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
|
|
import * as _QuestDockUtils from "./QuestDockUtils";
|
|
import { dimensionsLayoutTransition } from "./QuestDockUtils";
|
|
import * as _springPresets from "../../../../design/animation/reanimated/spring/springPresets";
|
|
import { SUBTLE_SPRING } from "../../../../design/animation/reanimated/spring/springPresets";
|
|
import { AccessibilityViewAnimated } from "../../../../design/components/AccessibilityView/AccessibilityView.native";
|
|
import QuestDockGestureDetector from "./QuestDockGestureDetector";
|
|
import ReanimatedNativeView from "../../../core/native/ReanimatedNativeView";
|
|
import { intl, t } from "../../../../intl/index.native";
|
|
import QuestDockContentCollapsed from "./QuestDockContentCollapsed";
|
|
import QuestDockContentExpanded from "./QuestDockContentExpanded";
|
|
import QuestDockUnenrolledBackground from "./QuestDockUnenrolledBackground";
|
|
import QuestDockDragHandle from "./QuestDockDragHandle";
|
|
import { Backdrop } from "../../../../design/components/Backdrop/native/Backdrop.native";
|
|
import { useQuestBarOrDockModeChangeTracking, useQuestBarImpressionSurvey } from "../../hooks/QuestHooks";
|
|
import { QuestContent } from "../../QuestTypes";
|
|
import { QuestBarRenderedTriggerPoint } from "../../../experiments/trigger_points/QuestBarRenderedTriggerPoint";
|
|
import { useStateFromStores } from "../../../../_bundle/Module589";
|
|
import { getIsEligibleForQuests } from "../../lib/QuestsEligibility";
|
|
import { useQuestDockHeroAsset, useQuestGameLogotypeAssetUrl, useMobileQuestDock, useIsMobileQuestDockRenderedBase, useIsMobileQuestDockVisibleToUser } from "../QuestHooks.native";
|
|
import { useGradientBottom } from "../../../client_themes/native/ClientThemesOverrides";
|
|
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
|
|
import MonitoringAgent from "../../../monitoring/MonitoringAgent";
|
|
import { MetricEvents } from "../../../../_bundle/Module5872";
|
|
import { getQuestContentName } from "../../lib/analytics/AnalyticsTypes";
|
|
import { updateQuestDockVisibilityEligibility } from "../../QuestActionCreators";
|
|
import { BillableAdPlacementImpressionTrackerNative } from "../QuestContentImpressionTracker.native";
|
|
import { ThemeContextProvider } from "../../../../_bundle/Module3901";
|
|
let useStyles, __initData, __initData2, __initData3, __initData4, __initData5, __initData6, __initData7, __initData8, QuestDockModeChangeTracker, QuestBarRenderedTriggerPointWrapper, useStyles2, ENTRANCE_ANIMATION_SPING_CONFIG, __initData9, QuestDockWithEntranceAnimation;
|
|
const QuestDockWithGestureAnimation = function QuestDockWithGestureAnimation(props) {
|
|
let top, c21034_7, token, c21034_9, sharedValue;
|
|
const appThemedBackgroundColor = props.appThemedBackgroundColor;
|
|
const quest2 = useContext(QuestDockContext).quest;
|
|
const styles = useStyles();
|
|
const context = useContext(QuestDockGestureContext);
|
|
const { questDockWrapperSpecs, activeQuestDockMode, windowDimensions } = context;
|
|
const context2 = useContext(QuestDockExternalCoordinationContext);
|
|
const { restingQuestDockMode, setRestingQuestDockMode } = context2;
|
|
const id = useId();
|
|
const callback3 = useCallback(() => {
|
|
setRestingQuestDockMode(QuestDockMode.COLLAPSED);
|
|
}, [setRestingQuestDockMode]);
|
|
useQuestDockModeAnimatedReaction();
|
|
useQuestDockDismissalReset();
|
|
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
const x = () => restingQuestDockMode.get() === QuestDockMode.EXPANDED;
|
|
x.__closure = {
|
|
restingQuestDockMode,
|
|
QuestDockMode
|
|
};
|
|
x.__workletHash = 2415817673061;
|
|
x.__initData = __initData;
|
|
const stateFromSharedValue = useStateFromSharedValue(useDerivedValue(x));
|
|
top = useSafeAreaInsets_native().top;
|
|
const youBarTotalHeight = useYouBarTotalHeight();
|
|
const isEnrolled = quest2.userStatus?.enrolledAt != null;
|
|
c21034_7 = isEnrolled;
|
|
token = useToken(Module712.modules.mobile.QUEST_DOCK_BORDER_RADIUS);
|
|
const questDockAnimatedBorderRadius = useQuestDockAnimatedBorderRadius(token);
|
|
c21034_9 = questDockAnimatedBorderRadius;
|
|
const K = () => ({
|
|
backgroundColor: appThemedBackgroundColor,
|
|
borderBottomRightRadius: _spring.withSpring(c21034_9.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
|
|
borderBottomLeftRadius: _spring.withSpring(c21034_9.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
|
|
height: questDockWrapperSpecs.get().height,
|
|
width: questDockWrapperSpecs.get().width,
|
|
opacity: _spring.withSpring(1, QUEST_DOCK_MODE_CHANGE_PHYSICS),
|
|
transform: [{
|
|
translateX: _spring.withSpring(questDockWrapperSpecs.get().x + -1 * _QuestDockUtils.roundToNearestPixel(questDockWrapperSpecs.get().width / 2), QUEST_DOCK_MODE_CHANGE_PHYSICS)
|
|
}, {
|
|
translateY: _spring.withSpring(questDockWrapperSpecs.get().y, QUEST_DOCK_MODE_CHANGE_PHYSICS)
|
|
}]
|
|
});
|
|
K.__closure = {
|
|
appThemedBackgroundColor,
|
|
withSpring: _spring.withSpring,
|
|
bottomBorderRadius: questDockAnimatedBorderRadius,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,
|
|
questDockWrapperSpecs,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS,
|
|
roundToNearestPixel: _QuestDockUtils.roundToNearestPixel
|
|
};
|
|
K.__workletHash = 4228984550973;
|
|
K.__initData = __initData2;
|
|
const animatedStyle = useAnimatedStyle(K);
|
|
sharedValue = useSharedValue(0);
|
|
const q = () => ({
|
|
transform: [{
|
|
scale: _spring.withSpring(_ReanimatedRexport.interpolate(sharedValue.get(), [1, 0], [1, 1]), _springPresets.springStandard)
|
|
}]
|
|
});
|
|
q.__closure = {
|
|
withSpring: _spring.withSpring,
|
|
interpolate: _ReanimatedRexport.interpolate,
|
|
isPressed: sharedValue,
|
|
springStandard: _springPresets.springStandard
|
|
};
|
|
q.__workletHash = 3373473585356;
|
|
q.__initData = __initData3;
|
|
const animatedStyle2 = useAnimatedStyle(q);
|
|
const callback4 = useCallback(() => {
|
|
setRestingQuestDockMode(QuestDockMode.EXPANDED);
|
|
}, [setRestingQuestDockMode]);
|
|
const callback2 = useCallback(() => {
|
|
sharedValue.set(1);
|
|
}, [sharedValue]);
|
|
const callback = useCallback(() => {
|
|
sharedValue.set(0);
|
|
}, [sharedValue]);
|
|
const W = () => ({
|
|
opacity: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? 1 : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS),
|
|
height: windowDimensions.get().height
|
|
});
|
|
W.__closure = {
|
|
withSpring: _spring.withSpring,
|
|
activeQuestDockMode,
|
|
QuestDockMode,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS,
|
|
windowDimensions
|
|
};
|
|
W.__workletHash = 6178969276321;
|
|
W.__initData = __initData4;
|
|
const animatedStyle3 = useAnimatedStyle(W);
|
|
const X = () => ({
|
|
pointerEvents: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? "auto" : "none"
|
|
});
|
|
X.__closure = {
|
|
activeQuestDockMode,
|
|
QuestDockMode
|
|
};
|
|
X.__workletHash = 5416180055289;
|
|
X.__initData = __initData5;
|
|
const animatedProps = useAnimatedProps(X);
|
|
const Y = function Y() {
|
|
const r4 = questDockWrapperSpecs.get();
|
|
return windowDimensions.get().height - top - r4.height;
|
|
};
|
|
Y.__closure = {
|
|
questDockWrapperSpecs,
|
|
windowDimensions,
|
|
safeAreaTop: top
|
|
};
|
|
Y.__workletHash = 8073454569923;
|
|
Y.__initData = __initData6;
|
|
const stateFromSharedValue2 = useStateFromSharedValue(useDerivedValue(Y));
|
|
const F = () => ({
|
|
opacity: _spring.withSpring(activeQuestDockMode.get() !== QuestDockMode.CLOSED ? activeQuestDockMode.get() === QuestDockMode.SOFT_DISMISSED ? 0 : 1 : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS)
|
|
});
|
|
F.__closure = {
|
|
withSpring: _spring.withSpring,
|
|
activeQuestDockMode,
|
|
QuestDockMode,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS
|
|
};
|
|
F.__workletHash = 6468803634518;
|
|
F.__initData = __initData7;
|
|
const animatedStyle4 = useAnimatedStyle(F);
|
|
const V = () => {
|
|
const r22 = {
|
|
borderTopLeftRadius: !c21034_7 && activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : token,
|
|
borderTopRightRadius: !c21034_7 && activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : token,
|
|
borderBottomLeftRadius: !c21034_7 && activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : c21034_9.get(),
|
|
borderBottomRightRadius: !c21034_7 && activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : c21034_9.get(),
|
|
opacity: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? 0 : 1, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
|
|
height: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? c21034_7 ? questDockWrapperSpecs.get().height : QUEST_DOCK_COLLAPSED_HEIGHT : questDockWrapperSpecs.get().height,
|
|
width: activeQuestDockMode.get() === QuestDockMode.EXPANDED && !c21034_7 ? questDockWrapperSpecs.get().width - 2 * QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : questDockWrapperSpecs.get().width,
|
|
transform: [{
|
|
translateX: c21034_7 ? 0 : _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
|
|
}, {
|
|
translateY: c21034_7 ? 0 : _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
|
|
}],
|
|
borderBottomWidth: c21034_9.get() > 0 ? 1 : 0
|
|
};
|
|
return r22;
|
|
};
|
|
V.__closure = {
|
|
isEnrolled,
|
|
activeQuestDockMode,
|
|
QuestDockMode,
|
|
QUEST_DOCK_CONTENT_BORDER_RADII,
|
|
questDockBorderRadius: token,
|
|
bottomBorderRadius: questDockAnimatedBorderRadius,
|
|
withSpring: _spring.withSpring,
|
|
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,
|
|
questDockWrapperSpecs,
|
|
QUEST_DOCK_COLLAPSED_HEIGHT,
|
|
QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED
|
|
};
|
|
V.__workletHash = 12859739915134;
|
|
V.__initData = __initData8;
|
|
const animatedStyle5 = useAnimatedStyle(V);
|
|
return <>
|
|
<View style={styles.wrapper} pointerEvents="auto">
|
|
<AccessibilityViewAnimated nativeID={id} style={styles.accessibilityWrapper} accessibilityViewIsModal={!!isScreenReaderEnabled && stateFromSharedValue} onAccessibilityEscape={callback3} pointerEvents="box-none">
|
|
<QuestDockGestureDetector>
|
|
<ReanimatedNativeView style={animatedStyle2}>
|
|
<ReanimatedNativeView style={[styles.questDockWrapper, {
|
|
bottom: youBarTotalHeight - 1
|
|
}, animatedStyle]} layout={dimensionsLayoutTransition}>
|
|
<Pressable style={styles.nestedPressable} onPressIn={callback2} onPressOut={callback} onPress={callback4} pointerEvents={stateFromSharedValue ? "none" : "auto"} accessibilityRole="button" accessibilityLabel={intl.string(t.rjVPdM)} accessibilityHint={stateFromSharedValue ? "" : intl.string(t.n0MlOB)} />
|
|
<ReanimatedNativeView style={[styles.questDockHeaderBorder, animatedStyle5]} layout={dimensionsLayoutTransition} pointerEvents="none" />
|
|
<ReanimatedNativeView style={[styles.questDockContentWrapper, animatedStyle4]}>
|
|
<View style={styles.questDockContentWrapper}>
|
|
<QuestDockContentCollapsed hideOnExpand={isEnrolled} />
|
|
<QuestDockContentExpanded />
|
|
</View>
|
|
{isEnrolled ? !isEnrolled : <QuestDockUnenrolledBackground />}
|
|
</ReanimatedNativeView>
|
|
<QuestDockDragHandle isExpanded={stateFromSharedValue} />
|
|
</ReanimatedNativeView>
|
|
</ReanimatedNativeView>
|
|
</QuestDockGestureDetector>
|
|
</AccessibilityViewAnimated>
|
|
</View>
|
|
<ReanimatedNativeView style={animatedStyle3} animatedProps={animatedProps}>
|
|
<Backdrop onDismiss={callback3} accessibleDismissStyle={{
|
|
height: stateFromSharedValue2
|
|
}} />
|
|
</ReanimatedNativeView>
|
|
</>;
|
|
};
|
|
QuestDockModeChangeTracker = function QuestDockModeChangeTracker(a0) {
|
|
useQuestBarOrDockModeChangeTracking({
|
|
mode: a0.mode,
|
|
questContent: QuestContent.QUEST_BAR_MOBILE,
|
|
questId: a0.questId,
|
|
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
|
|
});
|
|
return null;
|
|
};
|
|
QuestBarRenderedTriggerPointWrapper = function QuestBarRenderedTriggerPointWrapper() {
|
|
useEffect(() => {
|
|
QuestBarRenderedTriggerPoint.trigger();
|
|
}, []);
|
|
return null;
|
|
};
|
|
QuestDockWithEntranceAnimation = function QuestDockWithEntranceAnimation() {
|
|
let ref, stateFromStores, staticUrl, questGameLogotypeAssetUrl, c21035_11, token2, c21035_13;
|
|
const context = useContext(QuestDockContext);
|
|
const { isRendered, isVisibleToUser, quest } = context;
|
|
const [state] = useState(() => performance.now());
|
|
ref = useRef(false);
|
|
const styles2 = useStyles2();
|
|
const [state2, setState] = useState({
|
|
width: 0,
|
|
height: 0
|
|
});
|
|
stateFromStores = useStateFromStores([QuestDockStore], () => QuestDockStore.prevRestingQuestDockMode);
|
|
const isEligibleForQuests = getIsEligibleForQuests();
|
|
const questBarImpressionSurvey = useQuestBarImpressionSurvey(quest);
|
|
const n = () => ({
|
|
opacity: _spring.withSpring(isRendered ? 1 : 0, ENTRANCE_ANIMATION_SPING_CONFIG, "animate-always"),
|
|
transform: [{
|
|
translateY: _spring.withSpring(isRendered ? 0 : state2.height, ENTRANCE_ANIMATION_SPING_CONFIG)
|
|
}]
|
|
});
|
|
n.__closure = {
|
|
withSpring: _spring.withSpring,
|
|
isRendered,
|
|
ENTRANCE_ANIMATION_SPING_CONFIG,
|
|
componentDimensions: state2
|
|
};
|
|
n.__workletHash = 15545726338295;
|
|
n.__initData = __initData9;
|
|
const animatedStyle = useAnimatedStyle(n);
|
|
const [state3, setState2] = useState(null);
|
|
staticUrl = useQuestDockHeroAsset(quest).staticUrl;
|
|
questGameLogotypeAssetUrl = useQuestGameLogotypeAssetUrl(quest);
|
|
c21035_11 = quest.userStatus?.enrolledAt != null;
|
|
const gradientBottom = useGradientBottom();
|
|
const token3 = useToken(Module712.colors.BACKGROUND_SURFACE_HIGH);
|
|
let r93 = gradientBottom?.backgroundColor;
|
|
if (r93 == null) {
|
|
r93 = token3;
|
|
}
|
|
token2 = r93;
|
|
useEffect(() => {
|
|
let _prefetchWithErrorReporting2, _preloadQuestDockAssets2;
|
|
const prefetchWithErrorReporting2 = function prefetchWithErrorReporting(a0) {
|
|
return _prefetchWithErrorReporting2.apply(this, arguments);
|
|
};
|
|
_prefetchWithErrorReporting2 = function _prefetchWithErrorReporting() {
|
|
const r9 = async (c31718_0) => {
|
|
let c31718_4 = 0;
|
|
let c32056_0;
|
|
try {
|
|
c32056_0 = c31718_0;
|
|
c31718_4 = 1;
|
|
await Image2.prefetch(c31718_0);
|
|
c31718_4 = 0;
|
|
} catch ($e) {
|
|
let r7 = $e;
|
|
if (c31718_4 !== 0) {
|
|
while (true) {
|
|
try {
|
|
c31718_4 = 0;
|
|
AnalyticsUtils.track(AnalyticEvents.QUEST_ASSET_LOADING_FAILURE, {
|
|
source: QuestsExperimentLocations.QUESTS_BAR_MOBILE,
|
|
quest_id: quest.id,
|
|
asset_id: c32056_0
|
|
});
|
|
} catch ($e) {
|
|
r7 = $e;
|
|
if (c31718_4 === 0) {
|
|
break;
|
|
}
|
|
continue;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
throw r7;
|
|
}
|
|
return true;
|
|
};
|
|
_prefetchWithErrorReporting2 = r9;
|
|
return r9.apply(this, arguments);
|
|
};
|
|
_preloadQuestDockAssets2 = function _preloadQuestDockAssets() {
|
|
const r9 = async () => {
|
|
let c31719_1;
|
|
let env32057;
|
|
c31719_1 = void 0;
|
|
const r9 = env32057 = {};
|
|
let c31719_0 = r9;
|
|
env32057[0] = void 0;
|
|
const r10 = [];
|
|
if (staticUrl != null) {
|
|
r10.push(prefetchWithErrorReporting2(staticUrl));
|
|
}
|
|
if (questGameLogotypeAssetUrl != null) {
|
|
r10.push(prefetchWithErrorReporting2(questGameLogotypeAssetUrl));
|
|
}
|
|
env32057[0] = await Promise.all(r10);
|
|
(0, setState2)(env32057[0].every((item) => item === true));
|
|
};
|
|
_preloadQuestDockAssets2 = r9;
|
|
return r9.apply(this, arguments);
|
|
};
|
|
(function preloadQuestDockAssets() {
|
|
return _preloadQuestDockAssets2.apply(this, arguments);
|
|
})();
|
|
}, [staticUrl, questGameLogotypeAssetUrl, quest.id]);
|
|
useEffect(() => {
|
|
if (state3 === false) {
|
|
MonitoringAgent.increment({
|
|
name: MetricEvents.QUEST_CONTENT_RENDERING_FAILURE,
|
|
tags: [`quest_id:${quest.id}`, `quest_content:${getQuestContentName(QuestContent.QUEST_BAR_MOBILE)}`, "reason:asset_loading_error"]
|
|
});
|
|
}
|
|
}, [state3, quest.id]);
|
|
const r104 = quest == null || !isEligibleForQuests || !state3;
|
|
c21035_13 = r104;
|
|
useEffect(() => {
|
|
updateQuestDockVisibilityEligibility({
|
|
isEligibleToBeVisible: !c21035_13
|
|
});
|
|
return () => {
|
|
updateQuestDockVisibilityEligibility({
|
|
isEligibleToBeVisible: false
|
|
});
|
|
};
|
|
}, [r104]);
|
|
return r104 ? null : <ReanimatedRexport.View pointerEvents="box-none" style={[styles2.wrapperAnimated, animatedStyle]} onLayout={(event) => {
|
|
setState({
|
|
height: event.nativeEvent.layout.height,
|
|
width: event.nativeEvent.layout.width
|
|
});
|
|
if (!ref.current) {
|
|
ref.current = true;
|
|
if (Math.random() < 0.1) {
|
|
MonitoringAgent.distribution({
|
|
name: MetricEvents.QUEST_BAR_MOBILE_TIME_TO_FIRST_PAINT,
|
|
tags: [`quest_id:${quest.id}`]
|
|
}, Math.round(performance.now() - state));
|
|
}
|
|
}
|
|
}}>
|
|
<BillableAdPlacementImpressionTrackerNative overrideVisibility={isVisibleToUser} questContent={QuestContent.QUEST_BAR_MOBILE} questOrQuests={quest} onImpression={questBarImpressionSurvey} sourceQuestContent={QuestContent.QUEST_BAR_MOBILE}>
|
|
{() => <>
|
|
{[<QuestDockModeChangeTracker questId={quest.id} mode={stateFromStores} />, <QuestBarRenderedTriggerPointWrapper />, <QuestDockGestureContextProvider>
|
|
<ThemeContextProvider theme={c21035_11 ? void 0 : ThemeTypes.DARK}>
|
|
<QuestDockWithGestureAnimation appThemedBackgroundColor={token2} />
|
|
</ThemeContextProvider>
|
|
</QuestDockGestureContextProvider>]}
|
|
</>}
|
|
</BillableAdPlacementImpressionTrackerNative>
|
|
</ReanimatedRexport.View>;
|
|
};
|
|
useStyles = createStyles({
|
|
wrapper: {
|
|
position: "absolute",
|
|
left: "50%",
|
|
bottom: 0,
|
|
zIndex: 1
|
|
},
|
|
accessibilityWrapper: {
|
|
...StyleSheet.absoluteFillObject,
|
|
zIndex: 1
|
|
},
|
|
questDockWrapper: {
|
|
position: "absolute",
|
|
bottom: 0,
|
|
left: "50%",
|
|
overflow: "hidden",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
borderRadius: Module712.modules.mobile.QUEST_DOCK_BORDER_RADIUS,
|
|
zIndex: 1
|
|
},
|
|
questDockContentWrapper: {
|
|
...StyleSheet.absoluteFillObject,
|
|
justifyContent: "flex-end",
|
|
zIndex: 4
|
|
},
|
|
questDockHeaderBorder: {
|
|
...StyleSheet.absoluteFillObject,
|
|
bottom: void 0,
|
|
right: void 0,
|
|
borderWidth: 1,
|
|
borderColor: Module712.colors.BORDER_MUTED,
|
|
zIndex: 5
|
|
},
|
|
nestedPressable: {
|
|
...StyleSheet.absoluteFillObject,
|
|
zIndex: 6
|
|
}
|
|
});
|
|
__initData = {
|
|
code: "function QuestDockTsx1(){const{restingQuestDockMode,QuestDockMode}=this.__closure;return restingQuestDockMode.get()===QuestDockMode.EXPANDED;}"
|
|
};
|
|
__initData2 = {
|
|
code: "function QuestDockTsx2(){const{appThemedBackgroundColor,withSpring,bottomBorderRadius,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,questDockWrapperSpecs,QUEST_DOCK_MODE_CHANGE_PHYSICS,roundToNearestPixel}=this.__closure;return{backgroundColor:appThemedBackgroundColor,borderBottomRightRadius:withSpring(bottomBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),borderBottomLeftRadius:withSpring(bottomBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),height:questDockWrapperSpecs.get().height,width:questDockWrapperSpecs.get().width,opacity:withSpring(1,QUEST_DOCK_MODE_CHANGE_PHYSICS),transform:[{translateX:withSpring(questDockWrapperSpecs.get().x+roundToNearestPixel(questDockWrapperSpecs.get().width/2)*-1,QUEST_DOCK_MODE_CHANGE_PHYSICS)},{translateY:withSpring(questDockWrapperSpecs.get().y,QUEST_DOCK_MODE_CHANGE_PHYSICS)}]};}"
|
|
};
|
|
__initData3 = {
|
|
code: "function QuestDockTsx3(){const{withSpring,interpolate,isPressed,springStandard}=this.__closure;return{transform:[{scale:withSpring(interpolate(isPressed.get(),[1,0],[1,1]),springStandard)}]};}"
|
|
};
|
|
__initData4 = {
|
|
code: "function QuestDockTsx4(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS,windowDimensions}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS),height:windowDimensions.get().height};}"
|
|
};
|
|
__initData5 = {
|
|
code: "function QuestDockTsx5(){const{activeQuestDockMode,QuestDockMode}=this.__closure;return{pointerEvents:activeQuestDockMode.get()===QuestDockMode.EXPANDED?'auto':'none'};}"
|
|
};
|
|
__initData6 = {
|
|
code: "function QuestDockTsx6(){const{questDockWrapperSpecs,windowDimensions,safeAreaTop}=this.__closure;const specs=questDockWrapperSpecs.get();const windowHeight=windowDimensions.get().height;return windowHeight-safeAreaTop-specs.height;}"
|
|
};
|
|
__initData7 = {
|
|
code: "function QuestDockTsx7(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.CLOSED||activeQuestDockMode.get()===QuestDockMode.SOFT_DISMISSED?0:1,QUEST_DOCK_MODE_CHANGE_PHYSICS)};}"
|
|
};
|
|
__initData8 = {
|
|
code: "function QuestDockTsx8(){const{isEnrolled,activeQuestDockMode,QuestDockMode,QUEST_DOCK_CONTENT_BORDER_RADII,questDockBorderRadius,bottomBorderRadius,withSpring,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,questDockWrapperSpecs,QUEST_DOCK_COLLAPSED_HEIGHT,QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED}=this.__closure;return{borderTopLeftRadius:!isEnrolled&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:questDockBorderRadius,borderTopRightRadius:!isEnrolled&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:questDockBorderRadius,borderBottomLeftRadius:!isEnrolled&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:bottomBorderRadius.get(),borderBottomRightRadius:!isEnrolled&&activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:bottomBorderRadius.get(),opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?0:1,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),height:activeQuestDockMode.get()===QuestDockMode.EXPANDED?isEnrolled?questDockWrapperSpecs.get().height:QUEST_DOCK_COLLAPSED_HEIGHT:questDockWrapperSpecs.get().height,width:activeQuestDockMode.get()===QuestDockMode.EXPANDED&&!isEnrolled?questDockWrapperSpecs.get().width-QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED*2:questDockWrapperSpecs.get().width,transform:[{translateX:isEnrolled?0:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)},{translateY:isEnrolled?0:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)}],borderBottomWidth:bottomBorderRadius.get()>0?1:0};}"
|
|
};
|
|
useStyles2 = createStyles(() => ({
|
|
wrapperAnimated: {
|
|
position: "absolute",
|
|
bottom: 0,
|
|
padding: 0,
|
|
width: "100%"
|
|
}
|
|
}));
|
|
ENTRANCE_ANIMATION_SPING_CONFIG = {
|
|
...SUBTLE_SPRING,
|
|
overshootClamping: true,
|
|
damping: 54
|
|
};
|
|
__initData9 = {
|
|
code: "function QuestDockTsx9(){const{withSpring,isRendered,ENTRANCE_ANIMATION_SPING_CONFIG,componentDimensions}=this.__closure;return{opacity:withSpring(isRendered?1:0,ENTRANCE_ANIMATION_SPING_CONFIG,'animate-always'),transform:[{translateY:withSpring(isRendered?0:componentDimensions.height,ENTRANCE_ANIMATION_SPING_CONFIG)}]};}"
|
|
};
|
|
const r115 = memo(function QuestDockWithQuestContext() {
|
|
const mobileQuestDock = useMobileQuestDock();
|
|
const isMobileQuestDockRenderedBase = useIsMobileQuestDockRenderedBase(mobileQuestDock);
|
|
const isMobileQuestDockVisibleToUser = useIsMobileQuestDockVisibleToUser(mobileQuestDock, isMobileQuestDockRenderedBase);
|
|
return mobileQuestDock != null ? <QuestDockContext.Provider value={{
|
|
isRendered: isMobileQuestDockRenderedBase,
|
|
isVisibleToUser: isMobileQuestDockVisibleToUser,
|
|
quest: mobileQuestDock
|
|
}}>
|
|
<QuestDockWithEntranceAnimation />
|
|
</QuestDockContext.Provider> : null;
|
|
});
|
|
export default r115;
|
|
export { QuestDockWithEntranceAnimation };
|