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,505 @@
// 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 };
@@ -0,0 +1,11 @@
// Metro module 14184 (f14185).
import * as Module19 from "react";
import { useMemo } from "react";
import { StyleSheet } from "react-native";
import VisualEffectViewAnimated from "../../../visual_effect_view/native/VisualEffectViewAnimated";
const r23 = Module19.memo(function QuestDockBlurredContentBackground(props) {
const { animatedStyle, animatedLayout, blurTheme = "dark" } = props;
const memo = useMemo(() => blurTheme === "dark" ? "rgba(38, 39, 50, 0.65)" : "rgba(255, 255, 255, 0.1)", [blurTheme]);
return <VisualEffectViewAnimated nativeID="quest-dock-blurred-background" blurTintRgba={useMemo(() => blurTheme === "dark" ? "rgba(38, 39, 50, 0.1)" : "rgba(255, 255, 255, 0.1)", [blurTheme])} blurAmount={0.5} blurTheme="dark" android_fallbackColor={memo} style={[StyleSheet.absoluteFillObject, animatedStyle]} layout={animatedLayout} />;
});
export default r23;
@@ -0,0 +1,51 @@
// Metro module 14210 (f14211).
import * as Module19 from "react";
import { useContext, useMemo } from "react";
import { View, StyleSheet } from "react-native";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED, QUEST_DOCK_EXPANDED_HEIGHT } from "./QuestDockConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import { thumbHashToDataURL } from "../../../../_bundle/thumbHashToRGBA";
import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
const useStyles = createStyles({
image: {
...StyleSheet.absoluteFillObject,
height: QUEST_DOCK_EXPANDED_HEIGHT,
top: -QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED
},
overlay: {
...StyleSheet.absoluteFillObject,
backgroundColor: "rgba(38, 39, 50, 0.3)",
height: QUEST_DOCK_EXPANDED_HEIGHT
}
});
const __initData = {
code: "function QuestDockBlurredHeaderPlaceholderTsx1(){const{activeQuestDockMode,QuestDockMode,QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,questDockWrapperSpecs}=this.__closure;return{left:activeQuestDockMode.get()===QuestDockMode.EXPANDED?-QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED:0,width:questDockWrapperSpecs.get().width+QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED};}"
};
const r50 = Module19.memo(function QuestDockBlurredContentBackground(props) {
const { animatedLayout, animatedStyle, placeholder } = props;
const context = useContext(QuestDockGestureContext);
const { questDockWrapperSpecs, activeQuestDockMode } = context;
const memo = useMemo(() => ({
uri: thumbHashToDataURL(Uint8Array.from(atob(placeholder), (a0) => a0.charCodeAt(0)))
}), [placeholder]);
const styles = useStyles();
const D = () => ({
left: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? -QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : 0,
width: questDockWrapperSpecs.get().width + QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED
});
D.__closure = {
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,
questDockWrapperSpecs
};
D.__workletHash = 11176778421725;
D.__initData = __initData;
return <>
<ReanimatedRexport.Image source={memo} style={[styles.image, animatedStyle, useAnimatedStyle(D)]} layout={animatedLayout} />
<View style={styles.overlay} />
</>;
});
export default r50;
@@ -0,0 +1,46 @@
// Metro module 14122 (f14123).
import Module712 from "../../../../_bundle/Module712";
const PX_16 = Module712.space.PX_16;
const PX_12 = Module712.space.PX_12;
const PX_8 = Module712.space.PX_8;
const r31 = {
mass: 0.5,
damping: 80,
stiffness: 320
};
const r32 = {
...r31,
overshootClamping: true
};
const lg = Module712.radii.lg;
export const QUEST_DOCK_COLLAPSED_HEIGHT = 56;
export const QUEST_DOCK_CLOSED_HEIGHT = 22;
export const QUEST_DOCK_EXPANDED_HEIGHT = 400;
export { PX_16 as QUEST_DOCK_EXPANDED_PADDING_BOTTOM };
export { PX_12 as QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL };
export { PX_8 as QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP };
export const QUEST_DOCK_COLLAPSED_MAX_WIDTH = 600;
export const QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED = 8;
export const QUEST_DOCK_VERTICAL_EDGE_GUTTER_COLLAPSED = 8;
export const QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED = 0;
export const QUEST_DOCK_VERTICAL_EDGE_GUTTER_CLOSED = 0;
export const QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED = 12;
export const QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM = 15;
export const QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM = 15;
export const QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT = 200;
export const QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT = 30;
export const QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY = 200;
export const QUEST_DOCK_GESTURE_TOUCH_MOVE_COUNT_THRESHOLD = 5;
export const QUEST_DOCK_GESTURE_CLOSED_Y_OFFSET_FACTOR = 0.8;
export const QUEST_DOCK_GESTURE_COLLAPSED_Y_OFFSET_FACTOR = 1.5;
export const QUEST_DOCK_GESTURE_EXPANDED_EXCESS_HEIGHT_FACTOR = 0.07;
export const QUEST_DOCK_EXTERNAL_SCROLL_DELTA_THRESHOLD = 4;
export const QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED = 64;
export const QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED_WITH_YOU_BAR = 56;
export const QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED = 64;
export const QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED_WITH_YOU_BAR = 56;
export const QUEST_DOCK_EXTERNAL_OFFSET_CLOSED = 22;
export const QUEST_DOCK_EXPANDED_CONTENT_PADDING_VERTICAL = 16;
export { r31 as QUEST_DOCK_MODE_CHANGE_PHYSICS };
export { r32 as QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED };
export { lg as QUEST_DOCK_CONTENT_BORDER_RADII };
@@ -0,0 +1,65 @@
// Metro module 14208 (f14209).
import { memo, useContext } from "react";
import { StyleSheet } from "react-native";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_MODE_CHANGE_PHYSICS } from "./QuestDockConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import QuestDockContext from "./QuestDockContext";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import { useAnimatedStyle, useAnimatedProps } from "../../../reanimated/ReanimatedRexport";
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
import ReanimatedNativeView from "../../../core/native/ReanimatedNativeView";
import QuestDockUnenrolledHeader from "./QuestDockUnenrolledHeader";
import QuestDockEnrolledHeader from "./QuestDockEnrolledHeader";
const useStyles = createStyles({
questDockContentCollapsed: {
...StyleSheet.absoluteFillObject,
bottom: void 0,
zIndex: 2
}
});
const __initData = {
code: "function QuestDockContentCollapsedTsx1(){const{withSpring,activeQuestDockMode,QuestDockMode,hideOnExpand,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.COLLAPSED||!hideOnExpand?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS)};}"
};
const __initData2 = {
code: "function QuestDockContentCollapsedTsx2(){const{activeQuestDockMode,QuestDockMode,hideOnExpand}=this.__closure;return{pointerEvents:activeQuestDockMode.get()===QuestDockMode.COLLAPSED||!hideOnExpand?'auto':'none'};}"
};
const r43 = memo(function QuestDockContentCollapsed(props) {
const hideOnExpand2 = props.hideOnExpand;
const hideOnExpand = hideOnExpand2 === void 0 || hideOnExpand2;
const quest = useContext(QuestDockContext).quest;
const styles = useStyles();
let r8 = quest.userStatus?.enrolledAt != null;
const activeQuestDockMode = useContext(QuestDockGestureContext).activeQuestDockMode;
const u = () => ({
opacity: _spring.withSpring(activeQuestDockMode.get() !== QuestDockMode.COLLAPSED ? hideOnExpand ? 0 : 1 : 1, QUEST_DOCK_MODE_CHANGE_PHYSICS)
});
u.__closure = {
withSpring: _spring.withSpring,
activeQuestDockMode,
QuestDockMode,
hideOnExpand,
QUEST_DOCK_MODE_CHANGE_PHYSICS
};
u.__workletHash = 13361221764426;
u.__initData = __initData;
const animatedStyle = useAnimatedStyle(u);
const r44 = () => ({
pointerEvents: activeQuestDockMode.get() !== QuestDockMode.COLLAPSED ? hideOnExpand ? "none" : "auto" : "auto"
});
r44.__closure = {
activeQuestDockMode,
QuestDockMode,
hideOnExpand
};
r44.__workletHash = 14339269503421;
r44.__initData = __initData2;
const animatedProps = useAnimatedProps(r44);
const r60 = [r8 ? !r8 : <QuestDockUnenrolledHeader />, ,];
if (r8) {
r8 = <QuestDockEnrolledHeader />;
}
r60[1] = r8;
return <ReanimatedNativeView style={[styles.questDockContentCollapsed, animatedStyle]} animatedProps={animatedProps}>{r60}</ReanimatedNativeView>;
});
export default r43;
@@ -0,0 +1,60 @@
// Metro module 14215 (f14216).
import { memo, useContext } from "react";
import { StyleSheet } from "react-native";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_EXPANDED_HEIGHT, QUEST_DOCK_MODE_CHANGE_PHYSICS } from "./QuestDockConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import QuestDockContext from "./QuestDockContext";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
import ReanimatedNativeView from "../../../core/native/ReanimatedNativeView";
import QuestDockUnenrolledBody from "./QuestDockUnenrolledBody";
import QuestDockEnrolledBody from "./QuestDockEnrolledBody";
const useStyles = createStyles({
wrapper: {
...StyleSheet.absoluteFillObject,
bottom: void 0,
display: "flex",
zIndex: 1
}
});
const __initData = {
code: "function QuestDockContentExpandedTsx1(){const{isEnrolled,QUEST_DOCK_EXPANDED_HEIGHT,windowDimensions,withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS,questDockWrapperSpecs}=this.__closure;return{height:isEnrolled?undefined:QUEST_DOCK_EXPANDED_HEIGHT,width:windowDimensions.get().width,opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS),transform:[{translateX:withSpring((questDockWrapperSpecs.get().width-windowDimensions.get().width)/2,QUEST_DOCK_MODE_CHANGE_PHYSICS)}]};}"
};
const r44 = memo(function QuestDockContentExpanded() {
const quest = useContext(QuestDockContext).quest;
const styles = useStyles();
const context = useContext(QuestDockGestureContext);
const { activeQuestDockMode, questDockWrapperSpecs, windowDimensions } = context;
let isEnrolled = quest.userStatus?.enrolledAt != null;
let c21042_3 = isEnrolled;
const r33 = () => ({
height: c21042_3 ? void 0 : QUEST_DOCK_EXPANDED_HEIGHT,
width: windowDimensions.get().width,
opacity: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? 1 : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS),
transform: [{
translateX: _spring.withSpring((questDockWrapperSpecs.get().width - windowDimensions.get().width) / 2, QUEST_DOCK_MODE_CHANGE_PHYSICS)
}]
});
r33.__closure = {
isEnrolled,
QUEST_DOCK_EXPANDED_HEIGHT,
windowDimensions,
withSpring: _spring.withSpring,
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_MODE_CHANGE_PHYSICS,
questDockWrapperSpecs
};
r33.__workletHash = 17161265612101;
r33.__initData = __initData;
const animatedStyle = useAnimatedStyle(r33);
const r52 = [isEnrolled ? !isEnrolled : <QuestDockUnenrolledBody />, ,];
if (isEnrolled) {
isEnrolled = <QuestDockEnrolledBody quest={quest} />;
}
r52[1] = isEnrolled;
return <ReanimatedNativeView style={[styles.wrapper, animatedStyle]}>{r52}</ReanimatedNativeView>;
});
export default r44;
@@ -0,0 +1,8 @@
// Metro module 14204 (f14205).
import { createContext } from "react";
const context = createContext({
quest: void 0,
isRendered: false,
isVisibleToUser: false
});
export default context;
@@ -0,0 +1,158 @@
// Metro module 14129 (f14130).
import { UserSettingsSections } from "../../../../Constants";
import * as _QuestUtils from "../../utils/QuestUtils";
import { useQuestPreviewActions } from "../../hooks/QuestHooks";
import { getExternalCtaLabel, copyShareLink } from "../../utils/QuestCopyUtils";
import { ActionSheet } from "../../../../design/components/Sheet/native/ActionSheet.native";
import { ActionSheetRow } from "../../../../design/components/Sheet/native/ActionSheetRow.native";
import { LinkExternalMediumIcon } from "../../../../design/components/Icon/native/redesign/generated/LinkExternalMediumIcon";
import { FormLabel } from "../../../../design/void/Form/native/index";
import { openGameLinkDirectly } from "../../utils/QuestPlatformUtils";
import { QuestContent } from "../../QuestTypes";
import { QuestContentCTA } from "../../lib/analytics/AnalyticsTypes";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { CopyIcon } from "../../../../design/components/Icon/native/redesign/generated/CopyIcon";
import { intl, t } from "../../../../intl/index.native";
import WreathIcon from "./WreathIcon";
import { shouldMigrateToAdAnalyticsInterface, AdAnalyticsInterfaceExperimentStep } from "../../experiments/AdAnalyticsInterfaceExperiment";
import { captureAdUserAction } from "../../../ads/analytics/captureAdUserAction";
import { AdUserActionType } from "../../../ads/analytics/captureAdUserActionTypes";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { trackQuestContentClicked } from "../../lib/analytics/AnalyticsActions";
import { openQuestHome } from "../QuestUtils.native";
import { CircleQuestionIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleQuestionIcon";
import QuestDisclosureModalActionCreators from "../QuestDisclosureModal/QuestDisclosureModalActionCreators";
import { XSmallIcon } from "../../../../design/components/Icon/native/redesign/generated/XSmallIcon";
import { dismissQuestContent, markAdContentUnseen } from "../../QuestActionCreators";
import { displayQuestDismissalToast } from "../QuestDockDismissalToast";
import { TrophyIcon } from "../../../../design/components/Icon/native/redesign/generated/TrophyIcon";
import { RedoIcon } from "../../../../design/components/Icon/native/redesign/generated/RedoIcon";
import { UndoIcon } from "../../../../design/components/Icon/native/redesign/generated/UndoIcon";
import { UnsendIcon } from "../../../../design/components/Icon/native/redesign/generated/UnsendIcon";
import { EyeIcon } from "../../../../design/components/Icon/native/redesign/generated/EyeIcon";
import { openUserSettings } from "../../../user_settings/core/native/openUserSettings";
import { copy } from "../../../../utils/ClipboardUtils.native";
export default function QuestDockContextMenuActionSheet(props) {
const quest = props.quest;
const isShareableQuest = _QuestUtils.isShareableQuest(quest.config);
const questPreviewActions = useQuestPreviewActions(quest.id);
const { handleComplete, handleProgress, handleResetDismissibilityClick, handleResetStatusClick } = questPreviewActions;
return <ActionSheet>
<ActionSheetRow.Group hasIcons>
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={LinkExternalMediumIcon} />} label={<FormLabel text={getExternalCtaLabel(quest)} />} onPress={() => {
openGameLinkDirectly(quest, {
content: QuestContent.QUEST_BAR_MOBILE,
ctaContent: QuestContentCTA.CONTEXT_MENU_OPEN_GAME_LINK,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
ActionSheetActionCreators.hideActionSheet();
}} />
{isShareableQuest && <ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={CopyIcon} />} label={<FormLabel text={intl.string(t.WqhZss)} />} onPress={() => {
copyShareLink(quest.id, {
content: QuestContent.QUEST_BAR_MOBILE,
ctaContent: QuestContentCTA.CONTEXT_MENU_COPY_LINK,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
ActionSheetActionCreators.hideActionSheet();
}} />}
</ActionSheetRow.Group>
<ActionSheetRow.Group hasIcons>
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={WreathIcon} />} label={<FormLabel text={intl.string(t.LLLLPD)} />} onPress={() => {
if (shouldMigrateToAdAnalyticsInterface(AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL, "quest_dock_context_menu")) {
captureAdUserAction({
type: AdUserActionType.CLICK_INTERNAL,
adCreativeType: AdCreativeType.QUEST,
adCreativeId: quest.id,
questContentCTA: QuestContentCTA.CONTEXT_MENU_LEARN_MORE,
surfaceId: QuestContent.QUEST_BAR_MOBILE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
} else {
trackQuestContentClicked({
questId: quest.id,
questContent: QuestContent.QUEST_BAR_MOBILE,
questContentCTA: QuestContentCTA.CONTEXT_MENU_LEARN_MORE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
}
openQuestHome({
scrollToQuestId: quest.id,
fromContent: QuestContent.QUEST_BAR_MOBILE
});
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={CircleQuestionIcon} />} label={<FormLabel text={intl.string(t.GcsZKJ)} />} onPress={() => {
QuestDisclosureModalActionCreators.showModal({
quest,
isTargetedDisclosure: true,
trackingCtx: {
content: QuestContent.QUEST_BAR_MOBILE,
ctaContent: QuestContentCTA.CONTEXT_MENU_OPEN_DISCLOSURE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
}
});
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={XSmallIcon} />} label={<FormLabel text={intl.string(t.NN79E9)} />} subLabel={intl.string(t.V6htN5)} onPress={async () => {
let c27643_0;
c27643_0 = void 0;
const r38 = dismissQuestContent(quest.id, QuestContent.QUEST_BAR_MOBILE);
ActionSheetActionCreators.hideActionSheet();
if (shouldMigrateToAdAnalyticsInterface(AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL, "quest_dock_context_menu")) {
captureAdUserAction({
type: AdUserActionType.CLICK_INTERNAL,
adCreativeType: AdCreativeType.QUEST,
adCreativeId: quest.id,
questContentCTA: QuestContentCTA.CONTEXT_MENU_HIDE_CONTENT,
surfaceId: QuestContent.QUEST_BAR_MOBILE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
} else {
trackQuestContentClicked({
questId: quest.id,
questContent: QuestContent.QUEST_BAR_MOBILE,
questContentCTA: QuestContentCTA.CONTEXT_MENU_HIDE_CONTENT,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
}
await r38;
displayQuestDismissalToast();
}} />
</ActionSheetRow.Group>
{quest.preview && <ActionSheetRow.Group title={intl.string(t["Ape+mm"])} hasIcons>
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={TrophyIcon} />} label={<FormLabel text={intl.string(t.jQEfRT)} />} onPress={() => {
handleComplete();
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={RedoIcon} />} label={<FormLabel text={intl.string(t.cKSLr4)} />} onPress={() => {
handleProgress(0.9 * Math.random() + 0.03);
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={UndoIcon} />} label={<FormLabel text={intl.string(t.taqkwK)} />} onPress={() => {
handleResetStatusClick();
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={UnsendIcon} />} label={<FormLabel text={intl.string(t.JF6W66)} />} onPress={() => {
handleResetDismissibilityClick();
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={EyeIcon} />} label={<FormLabel text={intl.string(t["lL6/zF"])} />} onPress={() => {
markAdContentUnseen(AdCreativeType.QUEST, [quest.id]);
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={EyeIcon} />} label={<FormLabel text={intl.string(t.tx5Ax5)} />} onPress={() => {
openUserSettings({
screen: UserSettingsSections.QUEST_PREVIEW_TOOL_2,
params: {
questId: quest.id
}
});
ActionSheetActionCreators.hideActionSheet();
}} />
<ActionSheetRow icon={<ActionSheetRow.Icon IconComponent={CopyIcon} />} label={<FormLabel text={intl.string(t.oisrFi)} />} onPress={() => {
copy(quest.id);
ActionSheetActionCreators.hideActionSheet();
}} />
</ActionSheetRow.Group>}
</ActionSheet>;
};
@@ -0,0 +1,128 @@
// Metro module 14219 (f14220).
import { memo, useContext } from "react";
import { StyleSheet } from "react-native";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_COLLAPSED_MAX_WIDTH, QUEST_DOCK_MODE_CHANGE_PHYSICS } from "./QuestDockConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import QuestDockContext from "./QuestDockContext";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import { useYouBarHorizontalMargin } from "../../../main_tabs_v2/native/you_bar/hooks/useYouBarMargins";
import { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import { useMobileVisualRefreshConfig } from "../../../themes/experiments/MobileVisualRefreshExperiment";
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
import ReanimatedNativeView from "../../../core/native/ReanimatedNativeView";
import { dimensionsLayoutTransition } from "./QuestDockUtils";
import { ActionSheetHeaderBar } from "../../../../design/components/Sheet/native/ActionSheetHeaderBar.native";
import { intl, t } from "../../../../intl/index.native";
let getDragHandleOffsetLeft, __initData, __initData2, __initData3, __initData4;
const useStyles = createStyles({
dragHandleWrapper: {
...StyleSheet.absoluteFillObject,
bottom: void 0,
right: void 0,
zIndex: 4
},
dragHandleOverlay: {
...StyleSheet.absoluteFillObject,
bottom: void 0
}
});
const getDragHandleOffsetLeft2 = function getDragHandleOffsetLeft(a0, a1) {
return a0 !== QuestDockMode.EXPANDED ? -1 * a1 : 0;
};
getDragHandleOffsetLeft2.__closure = {
QuestDockMode
};
getDragHandleOffsetLeft2.__workletHash = 4145264969027;
getDragHandleOffsetLeft2.__initData = {
code: "function getDragHandleOffsetLeft_QuestDockDragHandleTsx1(activeQuestDockMode,horizontalEdgeGutter){const{QuestDockMode}=this.__closure;switch(activeQuestDockMode){case QuestDockMode.EXPANDED:return 0;default:return horizontalEdgeGutter*-1;}}"
};
getDragHandleOffsetLeft = getDragHandleOffsetLeft2;
__initData = {
code: "function QuestDockDragHandleTsx2(){const{windowDimensions,QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;return{width:Math.min(windowDimensions.get().width,QUEST_DOCK_COLLAPSED_MAX_WIDTH)};}"
};
__initData2 = {
code: "function QuestDockDragHandleTsx3(){const{getDragHandleOffsetLeft,activeQuestDockMode,questDockHorizontalGutterCollapsed,isVisualRefreshEnabled,QuestDockMode}=this.__closure;return{left:getDragHandleOffsetLeft(activeQuestDockMode.get(),questDockHorizontalGutterCollapsed),transform:[{translateY:isVisualRefreshEnabled&&activeQuestDockMode.get()!==QuestDockMode.CLOSED&&activeQuestDockMode.get()!==QuestDockMode.SOFT_DISMISSED?-4:0}]};}"
};
__initData3 = {
code: "function QuestDockDragHandleTsx4(){const{withSpring,isEnrolled,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{opacity:withSpring(isEnrolled||activeQuestDockMode.get()===QuestDockMode.CLOSED||activeQuestDockMode.get()===QuestDockMode.SOFT_DISMISSED?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS)};}"
};
__initData4 = {
code: "function QuestDockDragHandleTsx5(){const{withSpring,isEnrolled,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{opacity:withSpring(!isEnrolled&&activeQuestDockMode.get()!==QuestDockMode.CLOSED&&activeQuestDockMode.get()!==QuestDockMode.SOFT_DISMISSED?0.5:0,QUEST_DOCK_MODE_CHANGE_PHYSICS)};}"
};
const r54 = memo(function QuestDockDragHandle(props) {
let enabled;
const isExpanded = props.isExpanded;
const quest = useContext(QuestDockContext).quest;
const styles = useStyles();
const context = useContext(QuestDockGestureContext);
const { activeQuestDockMode, windowDimensions } = context;
const isEnrolled = quest.userStatus?.enrolledAt != null;
let c21047_2 = isEnrolled;
const youBarHorizontalMargin = useYouBarHorizontalMargin();
const n = () => ({
width: Math.min(windowDimensions.get().width, QUEST_DOCK_COLLAPSED_MAX_WIDTH)
});
n.__closure = {
windowDimensions,
QUEST_DOCK_COLLAPSED_MAX_WIDTH
};
n.__workletHash = 13640576219747;
n.__initData = __initData;
const animatedStyle = useAnimatedStyle(n);
enabled = useMobileVisualRefreshConfig({
location: "QuestDockDragHandle"
}).enabled;
const D = () => ({
left: activeQuestDockMode.get() !== QuestDockMode.EXPANDED ? -1 * youBarHorizontalMargin : 0,
transform: [{
translateY: enabled ? activeQuestDockMode.get() !== QuestDockMode.CLOSED ? activeQuestDockMode.get() !== QuestDockMode.SOFT_DISMISSED ? -4 : 0 : 0 : 0
}]
});
D.__closure = {
getDragHandleOffsetLeft,
activeQuestDockMode,
questDockHorizontalGutterCollapsed: youBarHorizontalMargin,
isVisualRefreshEnabled: enabled,
QuestDockMode
};
D.__workletHash = 2091098328770;
D.__initData = __initData2;
const animatedStyle2 = useAnimatedStyle(D);
const E = () => ({
opacity: _spring.withSpring(!c21047_2 && activeQuestDockMode.get() !== QuestDockMode.CLOSED ? activeQuestDockMode.get() === QuestDockMode.SOFT_DISMISSED ? 1 : 0 : 1, QUEST_DOCK_MODE_CHANGE_PHYSICS)
});
E.__closure = {
withSpring: _spring.withSpring,
isEnrolled,
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_MODE_CHANGE_PHYSICS
};
E.__workletHash = 12299455640931;
E.__initData = __initData3;
const animatedStyle3 = useAnimatedStyle(E);
const h = () => ({
opacity: _spring.withSpring(!c21047_2 && activeQuestDockMode.get() !== QuestDockMode.CLOSED ? activeQuestDockMode.get() === QuestDockMode.SOFT_DISMISSED ? 0 : 0.5 : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS)
});
h.__closure = {
withSpring: _spring.withSpring,
isEnrolled,
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_MODE_CHANGE_PHYSICS
};
h.__workletHash = 9632835517209;
h.__initData = __initData4;
return <ReanimatedNativeView style={[styles.dragHandleWrapper, animatedStyle]}>
<ReanimatedNativeView style={animatedStyle2} layout={dimensionsLayoutTransition}>
<ReanimatedNativeView style={[styles.dragHandleOverlay, useAnimatedStyle(h)]}>
<ActionSheetHeaderBar variant="overlay" accessibilityLabel={isExpanded ? intl.string(t["GQ+4bk"]) : intl.string(t.Yplnt6)} />
</ReanimatedNativeView>
<ReanimatedNativeView style={[styles.dragHandleOverlay, animatedStyle3]} pointerEvents="none" accessibilityElementsHidden importantForAccessibility="no-hide-descendants">
<ActionSheetHeaderBar variant="default" />
</ReanimatedNativeView>
</ReanimatedNativeView>
</ReanimatedNativeView>;
});
export default r54;
@@ -0,0 +1,138 @@
// Metro module 14217 (f14218).
import { useContext, useEffect, memo, useCallback } from "react";
import { View } from "react-native";
import QuestDockStore from "./QuestDockStore";
import { QuestDockMode, QuestsExperimentLocations } from "../../QuestConstants";
import * as _QuestDockConstants from "./QuestDockConstants";
import { QUEST_DOCK_EXPANDED_HEIGHT, QUEST_DOCK_EXPANDED_PADDING_BOTTOM } from "./QuestDockConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { QuestDockExternalCoordinationContext } from "./QuestDockExternalCoordinationContext";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import useStateFromSharedValue from "../../../reanimated/native/useStateFromSharedValue";
import { useHasWatchVideoOnMobileTasks } from "../QuestHooks.native";
import openVideoQuestModal from "../VideoQuestModal/openVideoQuestModal";
import { QuestContent } from "../../QuestTypes";
import QuestBottomSheetHeader from "../QuestBottomSheet/QuestBottomSheetHeader";
import { QuestBottomSheetStep, QuestBottomSheetContent, useEnrolledQuestContentProps } from "../QuestBottomSheet/QuestBottomSheet";
import QuestBottomSheetFooter from "../QuestBottomSheet/QuestBottomSheetFooter";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { hasWatchVideoTasks } from "../../utils/QuestTaskUtils";
let useStyles, EnrolledBodyPlayStreamTask;
const EnrolledBodyWatchTask = function EnrolledBodyWatchTask(props) {
const quest = props.quest;
const styles = useStyles();
const context = useContext(QuestDockExternalCoordinationContext);
const { restingQuestDockMode, setRestingQuestDockMode } = context;
const questDockWrapperSpecs = useContext(QuestDockGestureContext).questDockWrapperSpecs;
const stateFromSharedValue = useStateFromSharedValue(restingQuestDockMode);
let c21044_3 = stateFromSharedValue;
const hasWatchVideoOnMobileTasks = useHasWatchVideoOnMobileTasks(quest.config);
useEffect(() => {
let _maybeOpenVideoQuestModal2 = function _maybeOpenVideoQuestModal() {
const r9 = async () => {
let c31720_0;
L17: {
c31720_0 = void 0;
if (questDockWrapperSpecs.get().prevDeltaY < 0 && c21044_3 === QuestDockMode.RESET_TO_PREVIOUS && QuestDockStore.prevRestingQuestDockMode === QuestDockMode.EXPANDED) {
await openVideoQuestModal({
questId: quest.id,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
(0, setRestingQuestDockMode)(QuestDockMode.COLLAPSED);
break L17;
}
return void 0;
}
};
_maybeOpenVideoQuestModal2 = r9;
return r9.apply(this, arguments);
};
if (hasWatchVideoOnMobileTasks) {
(function maybeOpenVideoQuestModal() {
return _maybeOpenVideoQuestModal2.apply(this, arguments);
})();
}
}, [stateFromSharedValue, questDockWrapperSpecs, quest.id, setRestingQuestDockMode, hasWatchVideoOnMobileTasks]);
return <>
<View style={styles.headerWrapper}>
<QuestBottomSheetHeader quest={quest} step={QuestBottomSheetStep.TASK_STATUS} withActionSheet location={QuestsExperimentLocations.QUESTS_BAR_MOBILE} />
</View>
<View style={styles.contentWrapper}>
<QuestBottomSheetContent quest={quest} location={QuestsExperimentLocations.QUESTS_BAR_MOBILE} step={QuestBottomSheetStep.TASK_STATUS} sourceQuestContent={QuestContent.QUEST_BAR_MOBILE} />
</View>
<View style={styles.footerWrapper}>
<QuestBottomSheetFooter quest={quest} step={QuestBottomSheetStep.TASK_STATUS} style={styles.footer} withSafeArea={false} sourceQuestContent={QuestContent.QUEST_BAR_MOBILE} />
</View>
</>;
};
EnrolledBodyPlayStreamTask = function EnrolledBodyPlayStreamTask(props) {
const quest2 = props.quest;
const styles = useStyles();
const enrolledQuestContentProps = useEnrolledQuestContentProps({
quest: quest2,
location: QuestsExperimentLocations.QUESTS_BAR_MOBILE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
const { step, defibrillator, stepActions } = enrolledQuestContentProps;
return <>
<View style={styles.headerWrapper}>
<QuestBottomSheetHeader quest={quest2} step={step} withActionSheet location={QuestsExperimentLocations.QUESTS_BAR_MOBILE} />
</View>
<View style={styles.contentWrapper}>
<QuestBottomSheetContent defibrillator={defibrillator} quest={quest2} handleTaskSelect={enrolledQuestContentProps.handleTaskSelect} location={QuestsExperimentLocations.QUESTS_BAR_MOBILE} showMicrophone={enrolledQuestContentProps.showMicrophone} step={step} sourceQuestContent={QuestContent.QUEST_BAR_MOBILE} />
</View>
<View style={styles.footerWrapper}>
<QuestBottomSheetFooter quest={quest2} step={step} isDefibrilating={defibrillator.isActive} onBack={stepActions.onBack} onDefib={defibrillator.start} onConnectConsoleNext={stepActions.onNext} style={styles.footer} withSafeArea={false} sourceQuestContent={QuestContent.QUEST_BAR_MOBILE} />
</View>
</>;
};
const { QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP, QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL } = _QuestDockConstants;
useStyles = createStyles({
wrapper: {
flexGrow: 0,
flexShrink: 0,
paddingBottom: QUEST_DOCK_EXPANDED_PADDING_BOTTOM,
paddingTop: QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP,
paddingHorizontal: QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL
},
headerWrapper: {
marginBottom: Module712.space.PX_16
},
contentWrapper: {
display: "flex",
gap: Module712.space.PX_16,
flexGrow: 0,
flexShrink: 0
},
footer: {
marginTop: Module712.space.PX_16
},
footerWrapper: {
marginLeft: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL,
marginRight: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL
}
});
const r66 = memo(function QuestDockEnrolledBody(props) {
const quest2 = props.quest;
const styles = useStyles();
const minExpandedContentHeight = useContext(QuestDockGestureContext).minExpandedContentHeight;
const bottom = useSafeAreaInsets_native().bottom;
const callback = useCallback((a0) => {
const height = a0.nativeEvent.layout.height;
if (minExpandedContentHeight.get() !== height) {
minExpandedContentHeight.set(height);
}
}, [minExpandedContentHeight]);
useEffect(() => () => {
if (minExpandedContentHeight.get() !== QUEST_DOCK_EXPANDED_HEIGHT) {
minExpandedContentHeight.set(QUEST_DOCK_EXPANDED_HEIGHT);
}
}, [minExpandedContentHeight]);
return <View style={[styles.wrapper, {
paddingBottom: Math.max(bottom, QUEST_DOCK_EXPANDED_PADDING_BOTTOM)
}]} onLayout={callback}>
{hasWatchVideoTasks(quest2) ? <EnrolledBodyWatchTask quest={quest2} /> : <EnrolledBodyPlayStreamTask quest={quest2} />}
</View>;
});
export default r66;
@@ -0,0 +1,55 @@
// Metro module 14214 (f14215).
import { memo, useContext } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import QuestDockContext from "./QuestDockContext";
import { useQuestTaskDetails, useTaskPlatformScreen } from "../../hooks/QuestHooks";
import { useQuestBarTitle, useQuestBarSubtitle } from "../../hooks/QuestCopyHooks";
import { QuestContent } from "../../QuestTypes";
import QuestProgressIndicator from "../QuestProgressIndicator";
import { Text } from "../../../../design/components/Text/native/Text";
const useStyles = createStyles({
wrapper: {
alignItems: "center",
display: "flex",
flexDirection: "row",
flexGrow: 1,
flexShrink: 1,
gap: 8,
justifyContent: "center",
padding: 8
},
progressIndicatorWrapper: {
flexGrow: 0,
flexShrink: 0
},
copy: {
flexGrow: 1,
flexShrink: 1
}
});
const r34 = memo(function QuestDockEnrolledHeader() {
const quest = useContext(QuestDockContext).quest;
const styles = useStyles();
const questTaskDetails = useQuestTaskDetails(quest);
const [activeScreen] = useTaskPlatformScreen(quest, questTaskDetails);
return <View style={styles.wrapper}>
<View style={styles.progressIndicatorWrapper}>
<QuestProgressIndicator quest={quest} size="x-sm" progress={questTaskDetails.percentComplete} loading={false} hasConfetti />
</View>
<View style={styles.copy}>
<Text variant="heading-md/semibold" color="mobile-text-heading-primary">
{useQuestBarTitle(quest)}
</Text>
<Text variant="text-sm/medium" color="text-muted">
{useQuestBarSubtitle({
quest,
isExpanded: false,
activeScreen,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
})}
</Text>
</View>
</View>;
});
export default r34;
@@ -0,0 +1,168 @@
// Metro module 14126 (f14127).
import { createContext, memo, useCallback, useMemo, useContext, useRef, useEffect } from "react";
import QuestDockStore from "./QuestDockStore";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_EXTERNAL_SCROLL_DELTA_THRESHOLD } from "./QuestDockConstants";
import Durations from "../../../../utils/Durations";
import { createFakeSharedValue } from "../../../reanimated/ReanimatedHelperTypes";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useSharedValue, useAnimatedReaction } from "../../../reanimated/ReanimatedRexport";
import { isSoftDismissed } from "./QuestDockUtils";
import { updatePrevRestingQuestDockMode } from "../../QuestActionCreators";
import * as _PlatformUtils from "../../../../utils/PlatformUtils";
let isAndroid, __initData, __initData2, __initData3;
let c9885_7 = 1 * Durations.Millis.SECOND;
const context = createContext({
restingQuestDockMode: createFakeSharedValue(QuestDockMode.COLLAPSED),
setRestingQuestDockMode: () => {},
lastScrollEventSourceId: createFakeSharedValue(null),
questDockOffset: createFakeSharedValue(0)
});
const r53 = memo(function QuestDockExternalCoordinationContextProviderInner(props) {
const sharedValue = useSharedValue(null);
const sharedValue2 = useSharedValue(0);
const sharedValue3 = useSharedValue(isSoftDismissed(QuestDockStore.questDockSoftDismissedAt) ? QuestDockMode.SOFT_DISMISSED : QuestDockMode.COLLAPSED);
const callback = useCallback((a0) => {
sharedValue2.set(0);
if (sharedValue3.get() !== a0) {
sharedValue3.set(a0);
}
if (a0 !== QuestDockMode.RESET_TO_PREVIOUS) {
updatePrevRestingQuestDockMode(a0);
}
}, [sharedValue3, sharedValue2]);
return <context.Provider value={useMemo(() => ({
lastScrollEventSourceId: sharedValue,
restingQuestDockMode: sharedValue3,
setRestingQuestDockMode: callback,
questDockOffset: sharedValue2
}), [sharedValue, sharedValue3, callback, sharedValue2])}>{props.children}</context.Provider>;
});
isAndroid = _PlatformUtils.isAndroid();
__initData = {
code: "function QuestDockExternalCoordinationContextTsx1(){const{restingQuestDockMode}=this.__closure;return restingQuestDockMode.get();}"
};
__initData2 = {
code: "function QuestDockExternalCoordinationContextTsx2(nextMode,prevMode){const{runOnJS,cancelReopenQuestDock}=this.__closure;if(nextMode!==prevMode){runOnJS(cancelReopenQuestDock)();}}"
};
__initData3 = {
code: "function QuestDockExternalCoordinationContextTsx3(contentOffsetY,contentHeight,layoutHeight){const{isScrollHandlerEnabled,restingQuestDockMode,QuestDockMode,lastContentOffsetY,lastScrollEventSourceId,id,runOnJS,cancelReopenQuestDock,IS_ANDROID,scheduleReopenQuestDock,setRestingQuestDockMode,QUEST_DOCK_EXTERNAL_SCROLL_DELTA_THRESHOLD}=this.__closure;if(!isScrollHandlerEnabled.get())return;if(restingQuestDockMode.get()===QuestDockMode.SOFT_DISMISSED||restingQuestDockMode.get()===QuestDockMode.EXPANDED){return;}const lastContentOffsetYValue=lastContentOffsetY.get();lastContentOffsetY.set(contentOffsetY);if(lastContentOffsetYValue===contentOffsetY)return;const lastSourceId=lastScrollEventSourceId.get();if(id!=='guilds'){lastScrollEventSourceId.set(id);}const isFirstScrollEvent=id!=='guilds'&&id!==lastSourceId;if(isFirstScrollEvent)return;const isOverscrollingAtTop=contentOffsetY<0&&lastContentOffsetYValue<0;if(isOverscrollingAtTop){runOnJS(cancelReopenQuestDock)();return;}const hasLayoutData=layoutHeight!=null&&contentHeight!=null;const isOverscrollingAtBottom=hasLayoutData&&contentOffsetY+layoutHeight>=contentHeight;if(isOverscrollingAtBottom)return;const isScrolledToTop=contentOffsetY<=0&&(IS_ANDROID||lastContentOffsetYValue<=0);if(isScrolledToTop&&restingQuestDockMode.get()===QuestDockMode.CLOSED){if(IS_ANDROID){runOnJS(scheduleReopenQuestDock)();}else{runOnJS(setRestingQuestDockMode)(QuestDockMode.COLLAPSED);}return;}const isScrollingDown=contentOffsetY>lastContentOffsetYValue&&contentOffsetY>0&&lastContentOffsetYValue>0;const isScrollingUp=contentOffsetY<lastContentOffsetYValue;const scrollDistance=Math.abs(lastContentOffsetYValue-contentOffsetY);if(isScrollingDown&&restingQuestDockMode.get()===QuestDockMode.COLLAPSED){runOnJS(setRestingQuestDockMode)(QuestDockMode.CLOSED);}else if(isScrollingUp&&restingQuestDockMode.get()===QuestDockMode.CLOSED&&scrollDistance>=QUEST_DOCK_EXTERNAL_SCROLL_DELTA_THRESHOLD){runOnJS(scheduleReopenQuestDock)();}}"
};
export { context as QuestDockExternalCoordinationContext };
export { r53 as QuestDockExternalCoordinationContextProvider };
export function useExternalScrollEventHandler({ id }) {
let callback3, sharedValue4, sharedValue5;
callback3 = void 0;
sharedValue4 = void 0;
sharedValue5 = void 0;
const context2 = useContext(context);
const { setRestingQuestDockMode: setRestingQuestDockMode2, restingQuestDockMode, lastScrollEventSourceId } = context2;
const ref = useRef(-1);
const callback2 = useCallback(() => {
if (ref.current !== -1) {
window.clearTimeout(ref.current);
}
ref.current = window.setTimeout(() => {
if (restingQuestDockMode.get() !== QuestDockMode.EXPANDED) {
setRestingQuestDockMode2(QuestDockMode.COLLAPSED);
}
}, 500);
}, [setRestingQuestDockMode2, restingQuestDockMode]);
callback3 = useCallback(() => {
if (ref.current !== -1) {
window.clearTimeout(ref.current);
}
}, []);
const D = () => restingQuestDockMode.get();
D.__closure = {
restingQuestDockMode
};
D.__workletHash = 14040596710288;
D.__initData = __initData;
const c = function c(a0, a1) {
if (a0 !== a1) {
_ReanimatedRexport.runOnJS(callback3)();
}
};
c.__closure = {
runOnJS: _ReanimatedRexport.runOnJS,
cancelReopenQuestDock: callback3
};
c.__workletHash = 1848909508809;
c.__initData = __initData2;
useAnimatedReaction(D, c);
sharedValue4 = useSharedValue(0);
sharedValue5 = useSharedValue(false);
useEffect(() => {
let c27642_0 = setTimeout(() => {
sharedValue5.set(true);
}, c9885_7);
return () => {
clearTimeout(c27642_0);
};
}, [sharedValue5]);
const T = function T(a0, a1, a2) {
L32: {
if (sharedValue5.get() && restingQuestDockMode.get() !== QuestDockMode.SOFT_DISMISSED && restingQuestDockMode.get() !== QuestDockMode.EXPANDED) {
const r22 = sharedValue4.get();
sharedValue4.set(a0);
if (r22 !== a0) {
const r26 = lastScrollEventSourceId.get();
if (id !== "guilds") {
lastScrollEventSourceId.set(id);
}
if (id !== "guilds" && id !== r26) {
break L32;
}
if (a0 < 0 && r22 < 0) {
_ReanimatedRexport.runOnJS(callback3)();
break L32;
}
if (a2 != null && a1 != null && a0 + a2 >= a1) {
break L32;
}
L17: {
if (a0 <= 0) {
if (!isAndroid && !(r22 <= 0)) {
break L17;
}
if (restingQuestDockMode.get() === QuestDockMode.CLOSED) {
if (isAndroid) {
_ReanimatedRexport.runOnJS(callback2)();
break L32;
}
_ReanimatedRexport.runOnJS(setRestingQuestDockMode2)(QuestDockMode.COLLAPSED);
break L32;
}
}
}
const r40 = Math.abs(r22 - a0);
if (a0 > r22 && a0 > 0 && r22 > 0 && restingQuestDockMode.get() === QuestDockMode.COLLAPSED) {
_ReanimatedRexport.runOnJS(setRestingQuestDockMode2)(QuestDockMode.CLOSED);
break L32;
}
if (a0 < r22 && restingQuestDockMode.get() === QuestDockMode.CLOSED && r40 >= QUEST_DOCK_EXTERNAL_SCROLL_DELTA_THRESHOLD) {
_ReanimatedRexport.runOnJS(callback2)();
}
}
}
}
};
T.__closure = {
isScrollHandlerEnabled: sharedValue5,
restingQuestDockMode,
QuestDockMode,
lastContentOffsetY: sharedValue4,
lastScrollEventSourceId,
id,
runOnJS: _ReanimatedRexport.runOnJS,
cancelReopenQuestDock: callback3,
IS_ANDROID: isAndroid,
scheduleReopenQuestDock: callback2,
setRestingQuestDockMode: setRestingQuestDockMode2,
QUEST_DOCK_EXTERNAL_SCROLL_DELTA_THRESHOLD
};
T.__workletHash = 9824540806898;
T.__initData = __initData3;
return useCallback(T, [id, sharedValue4, lastScrollEventSourceId, restingQuestDockMode, callback2, setRestingQuestDockMode2, callback3, sharedValue5]);
}
@@ -0,0 +1,64 @@
// Metro module 14123 (f14124).
import * as Module19 from "react";
import { createContext, useMemo, useEffect } from "react";
import QuestDockStore from "./QuestDockStore";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_COLLAPSED_HEIGHT, QUEST_DOCK_EXPANDED_HEIGHT } from "./QuestDockConstants";
import { createFakeSharedValue } from "../../../reanimated/ReanimatedHelperTypes";
import { getWindowDimensions } from "../../../screen/useWindowDimensions.native";
import { useSharedValue } from "../../../reanimated/ReanimatedRexport";
import { useYouBarHorizontalMargin } from "../../../main_tabs_v2/native/you_bar/hooks/useYouBarMargins";
import { getQuestDockCollapsedWidth, isSoftDismissed } from "./QuestDockUtils";
import subscribeToWindowDimensions_native from "../../../screen/subscribeToWindowDimensions.native";
const context = createContext({
questDockWrapperSpecs: createFakeSharedValue({
width: 0,
height: 0,
x: 0,
y: 0,
prevDeltaY: 0
}),
windowDimensions: createFakeSharedValue({
width: 0,
height: 0,
maxContentHeight: 0,
landscape: false
}),
activeQuestDockMode: createFakeSharedValue(QuestDockMode.COLLAPSED),
minExpandedContentHeight: createFakeSharedValue(0)
});
const r52 = Module19.memo(function QuestDockGestureContextProviderInner(props) {
const memo = useMemo(getWindowDimensions, []);
const sharedValue = useSharedValue({
width: memo.width,
height: memo.height,
landscape: memo.width > memo.height,
maxContentHeight: memo.height
});
const youBarHorizontalMargin = useYouBarHorizontalMargin();
const sharedValue2 = useSharedValue({
width: getQuestDockCollapsedWidth(memo.width, youBarHorizontalMargin, youBarHorizontalMargin),
height: QUEST_DOCK_COLLAPSED_HEIGHT,
x: 0,
y: -8,
prevDeltaY: 0
});
const sharedValue3 = useSharedValue(isSoftDismissed(QuestDockStore.questDockSoftDismissedAt) ? QuestDockMode.SOFT_DISMISSED : QuestDockMode.COLLAPSED);
const sharedValue4 = useSharedValue(QUEST_DOCK_EXPANDED_HEIGHT);
useEffect(() => subscribeToWindowDimensions_native(({ width, height }) => {
sharedValue.set({
width,
height,
landscape: width > height,
maxContentHeight: height
});
}), [sharedValue]);
return <context.Provider value={useMemo(() => ({
windowDimensions: sharedValue,
questDockWrapperSpecs: sharedValue2,
activeQuestDockMode: sharedValue3,
minExpandedContentHeight: sharedValue4
}), [sharedValue, sharedValue2, sharedValue3, sharedValue4])}>{props.children}</context.Provider>;
});
export { context as QuestDockGestureContext };
export { r52 as QuestDockGestureContextProvider };
@@ -0,0 +1,283 @@
// Metro module 14207 (f14208).
import * as Module19 from "react";
import { useContext, useEffect, useMemo } from "react";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_CLOSED_HEIGHT, QUEST_DOCK_COLLAPSED_HEIGHT, QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM, QUEST_DOCK_GESTURE_CLOSED_Y_OFFSET_FACTOR, QUEST_DOCK_GESTURE_COLLAPSED_Y_OFFSET_FACTOR, QUEST_DOCK_GESTURE_EXPANDED_EXCESS_HEIGHT_FACTOR, QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT, QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT, QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY, QUEST_DOCK_GESTURE_TOUCH_MOVE_COUNT_THRESHOLD, QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM, QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED } from "./QuestDockConstants";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import useSafeAreaInsetsSharedValue_native from "../../../safe_area/useSafeAreaInsetsSharedValue.native";
import { QuestDockExternalCoordinationContext } from "./QuestDockExternalCoordinationContext";
import QuestDockContext from "./QuestDockContext";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useSharedValue, useAnimatedReaction } from "../../../reanimated/ReanimatedRexport";
import { useYouBarTotalHeight } from "../../../main_tabs_v2/native/you_bar/hooks/useYouBarTotalHeight";
import { useYouBarHorizontalMargin } from "../../../main_tabs_v2/native/you_bar/hooks/useYouBarMargins";
import * as _Module5273 from "../../../../_bundle/Module5273";
import { Gesture, GestureDetector } from "../../../../_bundle/Module5273";
import * as _QuestDockUtils from "./QuestDockUtils";
import * as _HapticUtils_native from "../../../haptics/HapticUtils.native";
let __initData, __initData2, __initData3, __initData4, __initData5, __initData6;
const useQuestDockSwipeGesture = function useQuestDockSwipeGesture() {
const context = useContext(QuestDockGestureContext);
const { questDockWrapperSpecs, activeQuestDockMode, windowDimensions, minExpandedContentHeight } = context;
const safeArea = useSafeAreaInsetsSharedValue_native();
const context2 = useContext(QuestDockExternalCoordinationContext);
const { restingQuestDockMode, setRestingQuestDockMode, questDockOffset } = context2;
const isVisibleToUser = useContext(QuestDockContext).isVisibleToUser;
const sharedValue = useSharedValue({
absoluteX: 0,
absoluteY: 0,
x: 0,
y: 0,
height: 0,
isDrawer: restingQuestDockMode.get() === QuestDockMode.EXPANDED,
active: false
});
const sharedValue2 = useSharedValue(0);
const sharedValue3 = useSharedValue(isVisibleToUser);
const youBarTotalHeight = useYouBarTotalHeight();
const youBarHorizontalMargin = useYouBarHorizontalMargin();
useEffect(() => {
sharedValue3.set(isVisibleToUser);
}, [isVisibleToUser, sharedValue3]);
const memo = useMemo(() => {
const shouldCancelWhenOutside = Gesture.Pan().manualActivation(false).maxPointers(1).shouldCancelWhenOutside(false);
const I = function I(a0) {
sharedValue2.set(0);
sharedValue.set({
absoluteX: a0.changedTouches[0].absoluteX,
absoluteY: a0.changedTouches[0].absoluteY,
x: questDockWrapperSpecs.get().x,
y: questDockWrapperSpecs.get().y,
height: questDockWrapperSpecs.get().height,
isDrawer: restingQuestDockMode.get() === QuestDockMode.EXPANDED,
active: false
});
};
I.__closure = {
touchMoveCount: sharedValue2,
initialGestureOffset: sharedValue,
questDockWrapperSpecs,
restingQuestDockMode,
QuestDockMode
};
I.__workletHash = 15649211210155;
I.__initData = __initData4;
const r29 = shouldCancelWhenOutside.onTouchesDown(I);
const A = function A(a0) {
if (a0.state === _Module5273.State.BEGAN && !sharedValue.get().active) {
sharedValue2.set(sharedValue2.get() + 1);
const r2 = sharedValue2.get() <= QUEST_DOCK_GESTURE_TOUCH_MOVE_COUNT_THRESHOLD;
const r34 = a0.changedTouches[0];
const { absoluteY, absoluteX } = r34;
const r14 = sharedValue.get().absoluteY - absoluteY;
const r42 = Math.abs(r14);
if (!(restingQuestDockMode.get() === QuestDockMode.EXPANDED && r2 && r14 >= 0) && (restingQuestDockMode.get() === QuestDockMode.COLLAPSED && r14 > QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM || restingQuestDockMode.get() === QuestDockMode.EXPANDED && (r14 < -QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM || r14 > QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM) || restingQuestDockMode.get() === QuestDockMode.COLLAPSED && r14 < 0 && r42 > QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM || restingQuestDockMode.get() === QuestDockMode.CLOSED && r14 > 0 && r14 > QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM || restingQuestDockMode.get() === QuestDockMode.CLOSED && r14 < 0 && r42 > QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM)) {
sharedValue.set({
absoluteX,
absoluteY,
x: questDockWrapperSpecs.get().x,
y: questDockWrapperSpecs.get().y,
height: questDockWrapperSpecs.get().height,
isDrawer: restingQuestDockMode.get() === QuestDockMode.EXPANDED,
active: true
});
}
}
};
A.__closure = {
State: _Module5273.State,
initialGestureOffset: sharedValue,
touchMoveCount: sharedValue2,
QUEST_DOCK_GESTURE_TOUCH_MOVE_COUNT_THRESHOLD,
restingQuestDockMode,
QuestDockMode,
QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM,
QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM,
questDockWrapperSpecs
};
A.__workletHash = 16451041821957;
A.__initData = __initData3;
const r40 = r29.onTouchesMove(A);
const r42 = function(a0) {
const prevDeltaY = a0.absoluteY - sharedValue.get().absoluteY;
const r29 = minExpandedContentHeight.get();
const r33 = sharedValue.get().height - prevDeltaY;
const r15 = r33 > r29 && activeQuestDockMode.get() === QuestDockMode.EXPANDED ? r29 + (r33 - r29) * QUEST_DOCK_GESTURE_EXPANDED_EXCESS_HEIGHT_FACTOR : r33;
if (r15 >= (minExpandedContentHeight.get() > 0 ? Math.min(minExpandedContentHeight.get(), QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT) : QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT)) {
if (!sharedValue.get().isDrawer) {
sharedValue.set({
...sharedValue.get(),
isDrawer: true
});
}
questDockWrapperSpecs.set({
...questDockWrapperSpecs.get(),
x: 0,
y: youBarTotalHeight > 0 ? youBarTotalHeight : 0,
width: _QuestDockUtils.getQuestDockExpandedWidth(windowDimensions.get().width, safeArea.get().left, safeArea.get().right),
height: Math.min(r15, windowDimensions.get().height),
prevDeltaY
});
activeQuestDockMode.set(QuestDockMode.EXPANDED);
} else if (r15 < QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT) {
if (activeQuestDockMode.get() === QuestDockMode.CLOSED) {
const r157 = (1 - Math.min(r15, 0) / QUEST_DOCK_CLOSED_HEIGHT) * (QUEST_DOCK_CLOSED_HEIGHT - r15);
questDockWrapperSpecs.set({
...questDockWrapperSpecs.get(),
x: 0,
y: 0 < r157 ? r157 * QUEST_DOCK_GESTURE_CLOSED_Y_OFFSET_FACTOR : 0,
width: _QuestDockUtils.getQuestDockClosedWidth(windowDimensions.get().width, safeArea.get().left, safeArea.get().right),
height: 0 < r157 ? QUEST_DOCK_CLOSED_HEIGHT : r15,
prevDeltaY
});
activeQuestDockMode.set(QuestDockMode.CLOSED);
}
} else {
const r62 = -1 * (r15 - QUEST_DOCK_COLLAPSED_HEIGHT) * (1 - r15 / QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT / QUEST_DOCK_GESTURE_COLLAPSED_Y_OFFSET_FACTOR);
questDockOffset.set(youBarTotalHeight > 0 ? -Math.min(r62, 0) : 0);
if (sharedValue.get().isDrawer) {
sharedValue.set({
...sharedValue.get(),
isDrawer: false
});
}
if (QUEST_DOCK_COLLAPSED_HEIGHT !== questDockWrapperSpecs.get().height && activeQuestDockMode.get() !== QuestDockMode.EXPANDED) {
_ReanimatedRexport.runOnJS(_HapticUtils_native.triggerHapticFeedback)(_HapticUtils_native.HapticFeedbackTypes.IMPACT_MEDIUM);
}
questDockWrapperSpecs.set({
...questDockWrapperSpecs.get(),
x: 0,
y: -1 * QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED + (youBarTotalHeight > 0 ? Math.min(r62, 0) : r62),
width: _QuestDockUtils.getQuestDockCollapsedWidth(windowDimensions.get().width, youBarTotalHeight > 0 ? youBarHorizontalMargin : safeArea.get().left, youBarTotalHeight > 0 ? youBarHorizontalMargin : safeArea.get().right),
height: QUEST_DOCK_COLLAPSED_HEIGHT,
prevDeltaY
});
activeQuestDockMode.set(QuestDockMode.COLLAPSED);
}
};
r42.__closure = {
initialGestureOffset: sharedValue,
minExpandedContentHeight,
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_GESTURE_EXPANDED_EXCESS_HEIGHT_FACTOR,
QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT,
questDockWrapperSpecs,
youBarHeight: youBarTotalHeight,
getQuestDockExpandedWidth: _QuestDockUtils.getQuestDockExpandedWidth,
windowDimensions,
safeArea,
QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT,
QUEST_DOCK_CLOSED_HEIGHT,
QUEST_DOCK_GESTURE_CLOSED_Y_OFFSET_FACTOR,
getQuestDockClosedWidth: _QuestDockUtils.getQuestDockClosedWidth,
QUEST_DOCK_COLLAPSED_HEIGHT,
QUEST_DOCK_GESTURE_COLLAPSED_Y_OFFSET_FACTOR,
questDockOffset,
runOnJS: _ReanimatedRexport.runOnJS,
triggerHapticFeedback: _HapticUtils_native.triggerHapticFeedback,
HapticFeedbackTypes: _HapticUtils_native.HapticFeedbackTypes,
QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED,
getQuestDockCollapsedWidth: _QuestDockUtils.getQuestDockCollapsedWidth,
youBarHorizontalMargin
};
r42.__workletHash = 3375221025411;
r42.__initData = __initData2;
const r79 = r40.onChange(r42);
const t = function t(a0) {
let r7, r8, SOFT_DISMISSED;
L25: {
const velocityY = a0.velocityY;
r7 = a0.y;
const r10 = Math.abs(velocityY);
r8 = Math.abs(r7);
if (!(r10 > QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY && velocityY < 0) && !(r10 < QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY && sharedValue.get().isDrawer)) {
L7: {
if (restingQuestDockMode.get() === QuestDockMode.COLLAPSED) {
if (!(velocityY > QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY) && !(r7 > QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT)) {
break L7;
}
SOFT_DISMISSED = QuestDockMode.SOFT_DISMISSED;
break L25;
}
}
if (!(velocityY > QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY && restingQuestDockMode.get() !== QuestDockMode.COLLAPSED) && !(velocityY < 0 && (r10 > QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY && restingQuestDockMode.get() === QuestDockMode.CLOSED))) {
if (restingQuestDockMode.get() !== QuestDockMode.COLLAPSED && restingQuestDockMode.get() !== QuestDockMode.CLOSED) {
SOFT_DISMISSED = QuestDockMode.COLLAPSED;
break L25;
}
SOFT_DISMISSED = QuestDockMode.RESET_TO_PREVIOUS;
break L25;
}
SOFT_DISMISSED = QuestDockMode.COLLAPSED;
} else {
SOFT_DISMISSED = restingQuestDockMode.get() === QuestDockMode.EXPANDED ? QuestDockMode.RESET_TO_PREVIOUS : QuestDockMode.EXPANDED;
}
}
if (restingQuestDockMode.get() === QuestDockMode.CLOSED && SOFT_DISMISSED !== QuestDockMode.EXPANDED && r7 < 0 && r8 > QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT) {
SOFT_DISMISSED = QuestDockMode.COLLAPSED;
}
_ReanimatedRexport.runOnJS(setRestingQuestDockMode)(SOFT_DISMISSED);
};
t.__closure = {
QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY,
restingQuestDockMode,
QuestDockMode,
initialGestureOffset: sharedValue,
QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT,
runOnJS: _ReanimatedRexport.runOnJS,
setRestingQuestDockMode
};
t.__workletHash = 10107537449160;
t.__initData = __initData;
return r79.onEnd(t);
}, [restingQuestDockMode, sharedValue, safeArea, sharedValue2, windowDimensions, questDockWrapperSpecs, setRestingQuestDockMode, activeQuestDockMode, minExpandedContentHeight, youBarTotalHeight, youBarHorizontalMargin, questDockOffset]);
const V = () => ({
mode: activeQuestDockMode.get(),
isVisible: sharedValue3.get()
});
V.__closure = {
activeQuestDockMode,
isVisibleSharedValue: sharedValue3
};
V.__workletHash = 13629688537260;
V.__initData = __initData5;
const F = function F(a0, a1) {
if (a0.mode !== a1?.mode && a0.mode !== QuestDockMode.CLOSED && a1?.mode !== QuestDockMode.CLOSED && a0.isVisible) {
_ReanimatedRexport.runOnJS(_HapticUtils_native.triggerHapticFeedback)(_HapticUtils_native.HapticFeedbackTypes.IMPACT_MEDIUM);
}
};
F.__closure = {
QuestDockMode,
runOnJS: _ReanimatedRexport.runOnJS,
triggerHapticFeedback: _HapticUtils_native.triggerHapticFeedback,
HapticFeedbackTypes: _HapticUtils_native.HapticFeedbackTypes
};
F.__workletHash = 17417080823410;
F.__initData = __initData6;
useAnimatedReaction(V, F);
return memo;
};
__initData = {
code: "function QuestDockGestureDetectorTsx1(event){const{QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY,restingQuestDockMode,QuestDockMode,initialGestureOffset,QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT,runOnJS,setRestingQuestDockMode}=this.__closure;const{velocityY:velocityY,y:y}=event;const absoluteVelocityY=Math.abs(velocityY);const absoluteY=Math.abs(y);let resultingDockMode;if(absoluteVelocityY>QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY&&velocityY<0){if(restingQuestDockMode.get()===QuestDockMode.EXPANDED){resultingDockMode=QuestDockMode.RESET_TO_PREVIOUS;}else{resultingDockMode=QuestDockMode.EXPANDED;}}else if(absoluteVelocityY<QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY&&initialGestureOffset.get().isDrawer){if(restingQuestDockMode.get()===QuestDockMode.EXPANDED){resultingDockMode=QuestDockMode.RESET_TO_PREVIOUS;}else{resultingDockMode=QuestDockMode.EXPANDED;}}else if(restingQuestDockMode.get()===QuestDockMode.COLLAPSED&&(velocityY>QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY||y>QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT)){resultingDockMode=QuestDockMode.SOFT_DISMISSED;}else if(velocityY>QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY&&restingQuestDockMode.get()!==QuestDockMode.COLLAPSED){resultingDockMode=QuestDockMode.COLLAPSED;}else if(velocityY<0&&absoluteVelocityY>QUEST_DOCK_GESTURE_MODE_TRANSITION_VELOCITY&&restingQuestDockMode.get()===QuestDockMode.CLOSED){resultingDockMode=QuestDockMode.COLLAPSED;}else{if(restingQuestDockMode.get()===QuestDockMode.COLLAPSED||restingQuestDockMode.get()===QuestDockMode.CLOSED){resultingDockMode=QuestDockMode.RESET_TO_PREVIOUS;}else{resultingDockMode=QuestDockMode.COLLAPSED;}}if(restingQuestDockMode.get()===QuestDockMode.CLOSED&&resultingDockMode!==QuestDockMode.EXPANDED&&y<0&&absoluteY>QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT){resultingDockMode=QuestDockMode.COLLAPSED;}runOnJS(setRestingQuestDockMode)(resultingDockMode);}"
};
__initData2 = {
code: "function QuestDockGestureDetectorTsx2(event){const{initialGestureOffset,minExpandedContentHeight,activeQuestDockMode,QuestDockMode,QUEST_DOCK_GESTURE_EXPANDED_EXCESS_HEIGHT_FACTOR,QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT,questDockWrapperSpecs,youBarHeight,getQuestDockExpandedWidth,windowDimensions,safeArea,QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT,QUEST_DOCK_CLOSED_HEIGHT,QUEST_DOCK_GESTURE_CLOSED_Y_OFFSET_FACTOR,getQuestDockClosedWidth,QUEST_DOCK_COLLAPSED_HEIGHT,QUEST_DOCK_GESTURE_COLLAPSED_Y_OFFSET_FACTOR,questDockOffset,runOnJS,triggerHapticFeedback,HapticFeedbackTypes,QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED,getQuestDockCollapsedWidth,youBarHorizontalMargin}=this.__closure;const deltaY=event.absoluteY-initialGestureOffset.get().absoluteY;const expandedContentHeight=minExpandedContentHeight.get();let nextHeight=initialGestureOffset.get().height-deltaY;if(nextHeight>expandedContentHeight&&activeQuestDockMode.get()===QuestDockMode.EXPANDED){const overage=nextHeight-expandedContentHeight;const additionalHeight=overage*QUEST_DOCK_GESTURE_EXPANDED_EXCESS_HEIGHT_FACTOR;nextHeight=expandedContentHeight+additionalHeight;}const expandedModeTransitionHeight=minExpandedContentHeight.get()>0?Math.min(minExpandedContentHeight.get(),QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT):QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT;if(nextHeight>=expandedModeTransitionHeight){if(!initialGestureOffset.get().isDrawer){initialGestureOffset.set({...initialGestureOffset.get(),isDrawer:true});}questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:youBarHeight>0?youBarHeight:0,width:getQuestDockExpandedWidth(windowDimensions.get().width,safeArea.get().left,safeArea.get().right),height:Math.min(nextHeight,windowDimensions.get().height),prevDeltaY:deltaY});activeQuestDockMode.set(QuestDockMode.EXPANDED);}else if(nextHeight<QUEST_DOCK_GESTURE_MODE_CLOSED_TRANSITION_HEIGHT){if(activeQuestDockMode.get()===QuestDockMode.CLOSED){const progress=1-Math.min(nextHeight,0)/QUEST_DOCK_CLOSED_HEIGHT;const newChange=progress*(QUEST_DOCK_CLOSED_HEIGHT-nextHeight);const nextY=newChange*QUEST_DOCK_GESTURE_CLOSED_Y_OFFSET_FACTOR;const isDraggingDown=newChange>0;questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:isDraggingDown?nextY:0,width:getQuestDockClosedWidth(windowDimensions.get().width,safeArea.get().left,safeArea.get().right),height:isDraggingDown?QUEST_DOCK_CLOSED_HEIGHT:nextHeight,prevDeltaY:deltaY});activeQuestDockMode.set(QuestDockMode.CLOSED);}}else{const progress=nextHeight/QUEST_DOCK_GESTURE_MODE_TRANSITION_HEIGHT;const yOffset=(nextHeight-QUEST_DOCK_COLLAPSED_HEIGHT)*-1;const newChange=yOffset*(1-progress/QUEST_DOCK_GESTURE_COLLAPSED_Y_OFFSET_FACTOR);questDockOffset.set(youBarHeight>0?-Math.min(newChange,0):0);if(initialGestureOffset.get().isDrawer){initialGestureOffset.set({...initialGestureOffset.get(),isDrawer:false});}if(QUEST_DOCK_COLLAPSED_HEIGHT!==questDockWrapperSpecs.get().height&&activeQuestDockMode.get()!==QuestDockMode.EXPANDED){runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);}questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED*-1+(youBarHeight>0?Math.min(newChange,0):newChange),width:getQuestDockCollapsedWidth(windowDimensions.get().width,youBarHeight>0?youBarHorizontalMargin:safeArea.get().left,youBarHeight>0?youBarHorizontalMargin:safeArea.get().right),height:QUEST_DOCK_COLLAPSED_HEIGHT,prevDeltaY:deltaY});activeQuestDockMode.set(QuestDockMode.COLLAPSED);}}"
};
__initData3 = {
code: "function QuestDockGestureDetectorTsx3(event){const{State,initialGestureOffset,touchMoveCount,QUEST_DOCK_GESTURE_TOUCH_MOVE_COUNT_THRESHOLD,restingQuestDockMode,QuestDockMode,QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM,QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM,questDockWrapperSpecs}=this.__closure;if(event.state!==State.BEGAN||initialGestureOffset.get().active){return;}touchMoveCount.set(touchMoveCount.get()+1);const isDragging=touchMoveCount.get()<=QUEST_DOCK_GESTURE_TOUCH_MOVE_COUNT_THRESHOLD;const{absoluteY:absoluteY,absoluteX:absoluteX}=event.changedTouches[0];const computed=initialGestureOffset.get().absoluteY-absoluteY;const computedAbsolute=Math.abs(computed);if(restingQuestDockMode.get()===QuestDockMode.EXPANDED&&isDragging&&computed>=0){return;}if(restingQuestDockMode.get()===QuestDockMode.COLLAPSED&&computed>QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM||restingQuestDockMode.get()===QuestDockMode.EXPANDED&&(computed<-QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM||computed>QUEST_DOCK_GESTURE_VERTICAL_DELTA_MINIMUM)||restingQuestDockMode.get()===QuestDockMode.COLLAPSED&&computed<0&&computedAbsolute>QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM||restingQuestDockMode.get()===QuestDockMode.CLOSED&&computed>0&&computed>QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM||restingQuestDockMode.get()===QuestDockMode.CLOSED&&computed<0&&computedAbsolute>QUEST_DOCK_GESTURE_CLOSED_VERTICAL_DELTA_MINIMUM){initialGestureOffset.set({absoluteX:absoluteX,absoluteY:absoluteY,x:questDockWrapperSpecs.get().x,y:questDockWrapperSpecs.get().y,height:questDockWrapperSpecs.get().height,isDrawer:restingQuestDockMode.get()===QuestDockMode.EXPANDED,active:true});}}"
};
__initData4 = {
code: "function QuestDockGestureDetectorTsx4(event){const{touchMoveCount,initialGestureOffset,questDockWrapperSpecs,restingQuestDockMode,QuestDockMode}=this.__closure;touchMoveCount.set(0);initialGestureOffset.set({absoluteX:event.changedTouches[0].absoluteX,absoluteY:event.changedTouches[0].absoluteY,x:questDockWrapperSpecs.get().x,y:questDockWrapperSpecs.get().y,height:questDockWrapperSpecs.get().height,isDrawer:restingQuestDockMode.get()===QuestDockMode.EXPANDED,active:false});}"
};
__initData5 = {
code: "function QuestDockGestureDetectorTsx5(){const{activeQuestDockMode,isVisibleSharedValue}=this.__closure;return{mode:activeQuestDockMode.get(),isVisible:isVisibleSharedValue.get()};}"
};
__initData6 = {
code: "function QuestDockGestureDetectorTsx6(current,previous){const{QuestDockMode,runOnJS,triggerHapticFeedback,HapticFeedbackTypes}=this.__closure;if(current.mode===(previous===null||previous===void 0?void 0:previous.mode)||current.mode===QuestDockMode.CLOSED||(previous===null||previous===void 0?void 0:previous.mode)===QuestDockMode.CLOSED||!current.isVisible){return;}runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);}"
};
const r44 = Module19.memo(function QuestDockGestureDetector(props) {
return <GestureDetector gesture={useQuestDockSwipeGesture()}>{props.children}</GestureDetector>;
});
export default r44;
export { useQuestDockSwipeGesture };
@@ -0,0 +1,204 @@
// Metro module 14119 (f14120).
import { useContext, useMemo, useEffect, useCallback } from "react";
import QuestDockStore from "./QuestDockStore";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_CLOSED_HEIGHT, QUEST_DOCK_COLLAPSED_HEIGHT, QUEST_DOCK_EXTERNAL_OFFSET_CLOSED, QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED_WITH_YOU_BAR, QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED_WITH_YOU_BAR, QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED } from "./QuestDockConstants";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import { QuestDockExternalCoordinationContext } from "./QuestDockExternalCoordinationContext";
import useSafeAreaInsetsSharedValue_native from "../../../safe_area/useSafeAreaInsetsSharedValue.native";
import { useYouBarHorizontalMargin } from "../../../main_tabs_v2/native/you_bar/hooks/useYouBarMargins";
import { useYouBarTotalHeight } from "../../../main_tabs_v2/native/you_bar/hooks/useYouBarTotalHeight";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useAnimatedReaction } from "../../../reanimated/ReanimatedRexport";
import * as _cheapWorkletShallowEqual from "../../../reanimated/native/cheapWorkletShallowEqual";
import * as _QuestDockUtils from "./QuestDockUtils";
import { isSoftDismissed } from "./QuestDockUtils";
import { useStateFromStoresArray } from "../../../../_bundle/Module589";
import Durations from "../../../../utils/Durations";
import { useTrackQuestContentClickedWithImpression } from "../../lib/analytics/AnalyticsHooks";
import { useQuestImpressionId } from "../../lib/analytics/ContentImpressionTrackerHooks";
import { shouldMigrateToAdAnalyticsInterface, AdAnalyticsInterfaceExperimentStep } from "../../experiments/AdAnalyticsInterfaceExperiment";
import { captureAdUserAction } from "../../../ads/analytics/captureAdUserAction";
import { AdUserActionType } from "../../../ads/analytics/captureAdUserActionTypes";
import { AdCreativeType } from "../../../../_bundle/Module6013";
import { QuestContentCTA } from "../../lib/analytics/AnalyticsTypes";
import { QuestContent } from "../../QuestTypes";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
const __initData = {
code: "function QuestDockHooksTsx1(){const{restingQuestDockMode,minExpandedContentHeight,windowDimensions,safeArea}=this.__closure;return{restingQuestDockMode:restingQuestDockMode.get(),minExpandedContentHeight:minExpandedContentHeight.get(),windowWidth:windowDimensions.get().width,windowHeight:windowDimensions.get().height,safeArea:safeArea.get()};}"
};
const __initData2 = {
code: "function QuestDockHooksTsx2(props,previous){const{cheapWorkletShallowEqual,QuestDockMode,runOnJS,setRestingQuestDockMode,questDockWrapperSpecs,getQuestDockCollapsedWidth,youBarHorizontalMargin,QUEST_DOCK_COLLAPSED_HEIGHT,activeQuestDockMode,getQuestDockClosedWidth,QUEST_DOCK_CLOSED_HEIGHT,getQuestDockExpandedHeightLimits,youBarHeight,QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED,getQuestDockExpandedWidth}=this.__closure;var _previous$restingQues;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const{restingQuestDockMode:restingQuestDockMode,minExpandedContentHeight:minExpandedContentHeight,windowWidth:windowWidth,windowHeight:windowHeight,safeArea:safeArea}=props;switch(restingQuestDockMode){case QuestDockMode.RESET_TO_PREVIOUS:runOnJS(setRestingQuestDockMode)((_previous$restingQues=previous===null||previous===void 0?void 0:previous.restingQuestDockMode)!==null&&_previous$restingQues!==void 0?_previous$restingQues:QuestDockMode.COLLAPSED);return;case QuestDockMode.COLLAPSED:questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:0,width:getQuestDockCollapsedWidth(windowWidth,youBarHorizontalMargin,youBarHorizontalMargin),height:QUEST_DOCK_COLLAPSED_HEIGHT});activeQuestDockMode.set(QuestDockMode.COLLAPSED);break;case QuestDockMode.CLOSED:case QuestDockMode.SOFT_DISMISSED:questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:0,width:getQuestDockClosedWidth(windowWidth,youBarHorizontalMargin,youBarHorizontalMargin),height:QUEST_DOCK_CLOSED_HEIGHT});activeQuestDockMode.set(restingQuestDockMode);break;case QuestDockMode.EXPANDED:const minContentHeight=minExpandedContentHeight;const{minHeight:minHeight,maxHeight:maxHeight}=getQuestDockExpandedHeightLimits(windowHeight,safeArea.top,minContentHeight);const heightMidpoint=(maxHeight+minHeight)/2;let height;if(questDockWrapperSpecs.get().height<=QUEST_DOCK_COLLAPSED_HEIGHT){height=maxHeight;}else if(previous!=null&&questDockWrapperSpecs.get().height===getQuestDockExpandedHeightLimits(previous.windowHeight,previous.safeArea.top,minContentHeight).maxHeight){height=maxHeight;}else if(questDockWrapperSpecs.get().height>=heightMidpoint){height=maxHeight;}else{height=maxHeight;}questDockWrapperSpecs.set({...questDockWrapperSpecs.get(),x:0,y:youBarHeight>0?youBarHeight:QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED,width:getQuestDockExpandedWidth(windowWidth,safeArea.left,safeArea.right),height:height});activeQuestDockMode.set(QuestDockMode.EXPANDED);break;}}"
};
export function useQuestDockModeAnimatedReaction() {
const context = useContext(QuestDockGestureContext);
const { questDockWrapperSpecs, windowDimensions, activeQuestDockMode, minExpandedContentHeight } = context;
const context2 = useContext(QuestDockExternalCoordinationContext);
const { restingQuestDockMode, setRestingQuestDockMode } = context2;
const safeAreaInsetsSharedValue_native = useSafeAreaInsetsSharedValue_native();
let c20926_6 = safeAreaInsetsSharedValue_native;
const youBarHorizontalMargin = useYouBarHorizontalMargin();
const youBarTotalHeight = useYouBarTotalHeight();
const r39 = () => ({
restingQuestDockMode: restingQuestDockMode.get(),
minExpandedContentHeight: minExpandedContentHeight.get(),
windowWidth: windowDimensions.get().width,
windowHeight: windowDimensions.get().height,
safeArea: c20926_6.get()
});
r39.__closure = {
restingQuestDockMode,
minExpandedContentHeight,
windowDimensions,
safeArea: safeAreaInsetsSharedValue_native
};
r39.__workletHash = 9502251090521;
r39.__initData = __initData;
const t = function t(a0, a1) {
const r26 = a1 == null ? void 0 : a1;
L24: {
if (!_cheapWorkletShallowEqual.cheapWorkletShallowEqual(a0, r26)) {
const { restingQuestDockMode: restingQuestDockMode2, minExpandedContentHeight: minExpandedContentHeight2, windowWidth, windowHeight, safeArea } = a0;
if (QuestDockMode.RESET_TO_PREVIOUS === restingQuestDockMode2) {
const r114 = _ReanimatedRexport.runOnJS(setRestingQuestDockMode);
let r116 = a1?.restingQuestDockMode;
if (r116 == null) {
r116 = QuestDockMode.COLLAPSED;
}
r114(r116);
return void 0;
}
if (QuestDockMode.COLLAPSED === restingQuestDockMode2) {
questDockWrapperSpecs.set({
...questDockWrapperSpecs.get(),
x: 0,
y: 0,
width: _QuestDockUtils.getQuestDockCollapsedWidth(windowWidth, youBarHorizontalMargin, youBarHorizontalMargin),
height: QUEST_DOCK_COLLAPSED_HEIGHT
});
activeQuestDockMode.set(QuestDockMode.COLLAPSED);
} else {
if (QuestDockMode.CLOSED !== restingQuestDockMode2 && QuestDockMode.SOFT_DISMISSED !== restingQuestDockMode2) {
if (QuestDockMode.EXPANDED !== restingQuestDockMode2) {
break L24;
}
const questDockExpandedHeightLimits = _QuestDockUtils.getQuestDockExpandedHeightLimits(windowHeight, safeArea.top, minExpandedContentHeight2);
questDockExpandedHeightLimits.minHeight;
const maxHeight = questDockExpandedHeightLimits.maxHeight;
if (!(questDockWrapperSpecs.get().height <= QUEST_DOCK_COLLAPSED_HEIGHT || a1 != null && questDockWrapperSpecs.get().height === _QuestDockUtils.getQuestDockExpandedHeightLimits(a1.windowHeight, a1.safeArea.top, minExpandedContentHeight2).maxHeight)) {
questDockWrapperSpecs.get().height;
}
const r58 = {
...questDockWrapperSpecs.get(),
x: 0
};
let r61 = youBarTotalHeight;
if (!(youBarTotalHeight > 0)) {
r61 = QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED;
}
r58.y = r61;
r58.width = _QuestDockUtils.getQuestDockExpandedWidth(windowWidth, safeArea.left, safeArea.right);
r58.height = maxHeight;
questDockWrapperSpecs.set(r58);
activeQuestDockMode.set(QuestDockMode.EXPANDED);
break L24;
}
questDockWrapperSpecs.set({
...questDockWrapperSpecs.get(),
x: 0,
y: 0,
width: _QuestDockUtils.getQuestDockClosedWidth(windowWidth, youBarHorizontalMargin, youBarHorizontalMargin),
height: QUEST_DOCK_CLOSED_HEIGHT
});
activeQuestDockMode.set(restingQuestDockMode2);
}
}
}
};
t.__closure = {
cheapWorkletShallowEqual: _cheapWorkletShallowEqual.cheapWorkletShallowEqual,
QuestDockMode,
runOnJS: _ReanimatedRexport.runOnJS,
setRestingQuestDockMode,
questDockWrapperSpecs,
getQuestDockCollapsedWidth: _QuestDockUtils.getQuestDockCollapsedWidth,
youBarHorizontalMargin,
QUEST_DOCK_COLLAPSED_HEIGHT,
activeQuestDockMode,
getQuestDockClosedWidth: _QuestDockUtils.getQuestDockClosedWidth,
QUEST_DOCK_CLOSED_HEIGHT,
getQuestDockExpandedHeightLimits: _QuestDockUtils.getQuestDockExpandedHeightLimits,
youBarHeight: youBarTotalHeight,
QUEST_DOCK_VERTICAL_EDGE_GUTTER_EXPANDED,
getQuestDockExpandedWidth: _QuestDockUtils.getQuestDockExpandedWidth
};
t.__workletHash = 2510234714195;
t.__initData = __initData2;
useAnimatedReaction(r39, t);
}
export function useQuestDockExternalOffset() {
let c20927_0, c20927_1;
const [r15, r16] = useStateFromStoresArray([QuestDockStore], () => [QuestDockStore.prevRestingQuestDockMode, QuestDockStore.isEligibleToBeVisible]);
c20927_0 = r15;
c20927_1 = r16;
return useMemo(() => {
if (c20927_1) {
if (QuestDockMode.COLLAPSED === c20927_0) {
return QUEST_DOCK_EXTERNAL_OFFSET_COLLAPSED_WITH_YOU_BAR;
}
if (QuestDockMode.EXPANDED === c20927_0) {
return QUEST_DOCK_EXTERNAL_OFFSET_EXPANDED_WITH_YOU_BAR;
}
if (QuestDockMode.CLOSED !== c20927_0 && QuestDockMode.SOFT_DISMISSED !== c20927_0) {
return 0;
}
return QUEST_DOCK_EXTERNAL_OFFSET_CLOSED;
}
return 0;
}, [r16, r15]);
}
export function useQuestDockDismissalReset() {
const setRestingQuestDockMode2 = useContext(QuestDockExternalCoordinationContext).setRestingQuestDockMode;
const activeQuestDockMode2 = useContext(QuestDockGestureContext).activeQuestDockMode;
useEffect(() => {
if (!(activeQuestDockMode2.get() !== QuestDockMode.SOFT_DISMISSED || isSoftDismissed(QuestDockStore.questDockSoftDismissedAt))) {
setRestingQuestDockMode2(QuestDockMode.COLLAPSED);
}
let c27641_0 = setInterval(function maybeResetSoftDismissal() {
if (!(activeQuestDockMode2.get() !== QuestDockMode.SOFT_DISMISSED || isSoftDismissed(QuestDockStore.questDockSoftDismissedAt))) {
setRestingQuestDockMode2(QuestDockMode.COLLAPSED);
}
}, 5 * Durations.Millis.MINUTE);
return () => {
clearInterval(c27641_0);
};
}, [setRestingQuestDockMode2, activeQuestDockMode2]);
}
export function useActionSheetPressHandler(a0) {
const quest = a0;
const trackQuestContentClickedWithImpression = useTrackQuestContentClickedWithImpression();
const questImpressionId = useQuestImpressionId();
return useCallback(() => {
if (shouldMigrateToAdAnalyticsInterface(AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL, "quest_dock_action_sheet")) {
captureAdUserAction({
type: AdUserActionType.CLICK_INTERNAL,
adCreativeType: AdCreativeType.QUEST,
adCreativeId: quest.id,
questContentCTA: QuestContentCTA.OPEN_CONTEXT_MENU,
surfaceId: QuestContent.QUEST_BAR_MOBILE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE,
impressionId: questImpressionId
});
} else {
trackQuestContentClickedWithImpression({
questId: quest.id,
questContent: QuestContent.QUEST_BAR_MOBILE,
questContentCTA: QuestContentCTA.OPEN_CONTEXT_MENU,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
}
ActionSheetActionCreators.openLazy(import("./QuestDockContextMenuActionSheet"), "QuestDockContextMenuActionSheet", {
quest
});
}, [a0, trackQuestContentClickedWithImpression, questImpressionId]);
}
@@ -0,0 +1,52 @@
// Metro module 14120 (f14121).
import { QuestDockMode } from "../../QuestConstants";
import Module589 from "../../../../_bundle/Module589";
import { isSoftDismissed } from "./QuestDockUtils";
import Dispatcher from "../../../../Dispatcher";
let isEligibleToBeVisible2 = false;
let COLLAPSED = QuestDockMode.COLLAPSED;
let questDockSoftDismissedAt2 = null;
isEligibleToBeVisible2 = false;
class QuestDockStore extends Module589.PersistedStore {
static displayName = "QuestDockStore";
static persistKey = "QuestDockStore";
initialize(a0) {
if (a0 != null) {
questDockSoftDismissedAt2 = a0.questDockSoftDismissedAt;
COLLAPSED = isSoftDismissed(questDockSoftDismissedAt2) ? QuestDockMode.SOFT_DISMISSED : QuestDockMode.COLLAPSED;
}
}
getState() {
return {
prevRestingQuestDockMode: COLLAPSED,
questDockSoftDismissedAt: questDockSoftDismissedAt2
};
}
get prevRestingQuestDockMode() {
return COLLAPSED;
}
get questDockSoftDismissedAt() {
return questDockSoftDismissedAt2;
}
get isEligibleToBeVisible() {
return isEligibleToBeVisible2;
}
}
const questDockStore = new QuestDockStore(Dispatcher, {
QUESTS_PREV_RESTING_QUEST_DOCK_MODE_UPDATE: function handlePrevRestingQuestDockModeUpdate(a0) {
const r0 = a0.mode !== COLLAPSED;
COLLAPSED = a0.mode;
if (r0) {
questDockSoftDismissedAt2 = a0.mode === QuestDockMode.SOFT_DISMISSED ? Date.now() : null;
}
return r0;
},
QUESTS_DOCK_RESET_SOFT_DISMISSAL: function handleResetSoftDismissal() {
COLLAPSED = QuestDockMode.COLLAPSED;
questDockSoftDismissedAt2 = null;
},
QUESTS_DOCK_VISIBILITY_ELIGIBILITY_UPDATE: function handleQuestDockEligibilityUpdate(a0) {
isEligibleToBeVisible2 = a0.isEligibleToBeVisible;
}
});
export default questDockStore;
@@ -0,0 +1,138 @@
// Metro module 14218 (f14219).
import * as Module19 from "react";
import { useContext, useMemo, useState, useEffect, useCallback } from "react";
import { AppState, StyleSheet } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED, QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED, QUEST_DOCK_EXPANDED_HEIGHT } from "./QuestDockConstants";
import { VerticalGradient } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import QuestDockContext from "./QuestDockContext";
import { useQuestDockHeroAsset } from "../QuestHooks.native";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import { QuestDockExternalCoordinationContext } from "./QuestDockExternalCoordinationContext";
import useStateFromSharedValue from "../../../reanimated/native/useStateFromSharedValue";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useToken } from "../../../../design/tokens/native/useToken";
import Module712 from "../../../../_bundle/Module712";
import Module689 from "../../../../_bundle/Module689";
import { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
import { isIOS, isAndroid } from "../../../../utils/PlatformUtils";
import { isHeroVideoSupported } from "../QuestUtils.native";
import ReanimatedNativeView from "../../../core/native/ReanimatedNativeView";
import { VideoComponent } from "../../../../components_native/common/Video";
import FastImage from "../../../../components_native/common/FastImage";
import Module4611 from "../../../../_bundle/Module4611";
const useStyles = createStyles({
backgroundWrapper: {
...StyleSheet.absoluteFillObject,
right: void 0,
bottom: void 0,
height: QUEST_DOCK_EXPANDED_HEIGHT,
zIndex: 1
},
backgroundHeroAsset: {
...StyleSheet.absoluteFillObject,
height: QUEST_DOCK_EXPANDED_HEIGHT,
resizeMode: "cover"
},
backgroundHeroAssetVideo: {
...StyleSheet.absoluteFillObject
},
backgroundGradient: {
...StyleSheet.absoluteFillObject,
height: QUEST_DOCK_EXPANDED_HEIGHT
}
});
const __initData = {
code: "function QuestDockUnenrolledBackgroundTsx1(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,windowDimensions}=this.__closure;return{transform:[{translateX:withSpring(activeQuestDockMode.get()===QuestDockMode.COLLAPSED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED*-1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)},{translateY:withSpring(activeQuestDockMode.get()===QuestDockMode.COLLAPSED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED*-1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)}],width:windowDimensions.get().width};}"
};
const __initData2 = {
code: "function QuestDockUnenrolledBackgroundTsx2(){const{withSpring,activeQuestDockMode,QuestDockMode,videoLoaded,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()!==QuestDockMode.EXPANDED||!videoLoaded?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)};}"
};
const r66 = Module19.memo(function QuestDockUnenrolledBackground() {
let token;
const quest = useContext(QuestDockContext).quest;
const styles = useStyles();
const questDockHeroAsset = useQuestDockHeroAsset(quest);
const { staticUrl, videoAsset } = questDockHeroAsset;
const context = useContext(QuestDockGestureContext);
const { activeQuestDockMode, windowDimensions } = context;
const setRestingQuestDockMode = useContext(QuestDockExternalCoordinationContext).setRestingQuestDockMode;
const stateFromSharedValue = useStateFromSharedValue(activeQuestDockMode);
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
token = useToken(Module712.colors.CARD_BACKGROUND_DEFAULT);
const memo = useMemo(() => {
const r4 = Module689(token);
return [r4.alpha(0).hex(), r4.alpha(0.1).hex(), r4.alpha(0.8).hex(), r4.alpha(1).hex()];
}, [token]);
const memo2 = useMemo(() => [0, 0.33, 0.76, 1], []);
const r68 = () => ({
transform: [{
translateX: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.COLLAPSED ? -1 * QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
}, {
translateY: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.COLLAPSED ? -1 * QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
}],
width: windowDimensions.get().width
});
r68.__closure = {
withSpring: _spring.withSpring,
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,
windowDimensions
};
r68.__workletHash = 3565242281634;
r68.__initData = __initData;
const animatedStyle = useAnimatedStyle(r68);
const [state2, setState] = useState(AppState.currentState !== "active");
useEffect(() => {
let c27703_0 = AppState.addEventListener("change", (a0) => {
const r1 = a0 !== "active";
setState(r1);
if (isIOS() && r1 && activeQuestDockMode.get() === QuestDockMode.EXPANDED) {
setRestingQuestDockMode(QuestDockMode.COLLAPSED);
}
});
return () => {
c27703_0.remove();
};
}, [activeQuestDockMode, setRestingQuestDockMode]);
const isRendered = useContext(QuestDockContext).isRendered;
const r94 = (state2 ? !state2 : isRendered) && !stateFromStores && videoAsset != null && !isAndroid() && isHeroVideoSupported(videoAsset);
const [state, setState2] = useState(false);
const callback = useCallback(() => {
setState2(true);
}, []);
const G = () => ({
opacity: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? state ? 0 : 1 : 1, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
});
G.__closure = {
withSpring: _spring.withSpring,
activeQuestDockMode,
QuestDockMode,
videoLoaded: state,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED
};
G.__workletHash = 13084905891385;
G.__initData = __initData2;
const animatedStyle2 = useAnimatedStyle(G);
return <ReanimatedNativeView style={[styles.backgroundWrapper, animatedStyle]}>
{r94 ? <>
<VideoComponent style={styles.backgroundHeroAssetVideo} onLoad={callback} source={{
uri: videoAsset.url
}} paused={stateFromSharedValue !== QuestDockMode.EXPANDED} resizeMode="cover" muted disableFocus preventsDisplaySleepDuringVideoPlayback={false} />
<ReanimatedNativeView style={animatedStyle2}>
<FastImage style={styles.backgroundHeroAsset} source={{
uri: staticUrl
}} />
</ReanimatedNativeView>
</> : <FastImage style={styles.backgroundHeroAsset} source={{
uri: staticUrl
}} />}
<Module4611 locations={memo2} style={styles.backgroundGradient} start={VerticalGradient.START} end={VerticalGradient.END} colors={memo} />
</ReanimatedNativeView>;
});
export default r66;
@@ -0,0 +1,167 @@
// Metro module 14216 (f14217).
import { memo, useContext, useCallback } from "react";
import { View } from "react-native";
import QuestStore from "../../QuestStore";
import QuestDockStore from "./QuestDockStore";
import { QuestDockMode, QuestsExperimentLocations } from "../../QuestConstants";
import { QUEST_DOCK_EXPANDED_PADDING_BOTTOM, QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL } from "./QuestDockConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import QuestDockContext from "./QuestDockContext";
import { useStateFromStores } from "../../../../_bundle/defaultAreStatesEqual";
import { useHasWatchVideoOnMobileTasks, useMobileActivityQuest } from "../QuestHooks.native";
import { useQuestTaskDetails, useShouldShowBonusOrbsUX } from "../../hooks/QuestHooks";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { useQuestOrbMultiplierEligibility } from "../../hooks/QuestOrbMultiplierHooks";
import { QuestOrbMultiplierEligibilityType } from "../../utils/QuestOrbMultiplierUtils";
import { QuestDockExternalCoordinationContext } from "./QuestDockExternalCoordinationContext";
import { enrollInQuest } from "../../QuestActionCreators";
import { QuestContentCTA } from "../../lib/analytics/AnalyticsTypes";
import { QuestContent } from "../../QuestTypes";
import openVideoQuestModal from "../VideoQuestModal/openVideoQuestModal";
import { usePrimaryCtaCopy, useQuestsInstructionsToWinReward } from "../../hooks/QuestCopyHooks";
import PremiumRewardGradient from "../PremiumRewardGradient";
import QuestDockBlurredContentBackground from "./QuestDockBlurredContentBackground";
import QuestRewardTile from "../QuestRewardTile";
import { QuestOrbMultiplierPerkPill } from "../QuestOrbMultiplierPerkPill";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { ShinyButton } from "../../../../design/void/native";
import { getPrimaryCtaIcon } from "../QuestUtils.native";
const useStyles = createStyles({
wrapper: {
flexGrow: 1,
flexShrink: 0,
justifyContent: "flex-end",
paddingHorizontal: QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL,
paddingBottom: QUEST_DOCK_EXPANDED_PADDING_BOTTOM
},
rewardContentWrapper: {
borderRadius: Module712.modules.mobile.QUEST_DOCK_BORDER_RADIUS,
overflow: "hidden",
padding: 8,
paddingRight: 16
},
rewardContent: {
alignItems: "center",
flexDirection: "row",
gap: 16
},
rewardContentCopy: {
flexGrow: 1,
flexShrink: 1,
gap: 4
},
premiumRewardPerkPill: {
alignSelf: "flex-start"
},
titleRow: {
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_8,
flexWrap: "wrap"
},
questDockRewardTile: {
borderRadius: Module712.radii.lg
},
questDockCtaWrapper: {
marginTop: 12,
paddingHorizontal: 4,
paddingTop: 16,
position: "relative"
},
questDockCta: {
borderRadius: Module712.radii.round
},
questDockCtaRow: {
alignSelf: "stretch"
},
questDockCtaSaparator: {
position: "absolute",
left: -12,
right: -12,
top: 0,
backgroundColor: Module712.colors.BORDER_SUBTLE,
height: 1,
opacity: 1
}
});
const r75 = memo(function QuestDockUnenrolledBody() {
let hasWatchVideoOnMobileTasks, isMobileActivityQuest, launchMobileActivity, setRestingQuestDockMode;
const context = useContext(QuestDockContext);
const { isRendered, quest } = context;
const styles = useStyles();
const stateFromStores = useStateFromStores([QuestDockStore], () => QuestDockStore.prevRestingQuestDockMode === QuestDockMode.EXPANDED);
const stateFromStores2 = useStateFromStores([QuestStore], () => QuestStore.isEnrolling(quest.id));
hasWatchVideoOnMobileTasks = useHasWatchVideoOnMobileTasks(quest.config);
const questTaskDetails = useQuestTaskDetails(quest);
const mobileActivityQuest = useMobileActivityQuest(quest);
isMobileActivityQuest = mobileActivityQuest.isMobileActivityQuest;
const questApplication = mobileActivityQuest.questApplication;
launchMobileActivity = mobileActivityQuest.launchMobileActivity;
const bottom = useSafeAreaInsets_native().bottom;
const questOrbMultiplierEligibility = useQuestOrbMultiplierEligibility();
const shouldShowBonusOrbsUX = useShouldShowBonusOrbsUX(quest, questOrbMultiplierEligibility);
const visible = shouldShowBonusOrbsUX ? questOrbMultiplierEligibility === QuestOrbMultiplierEligibilityType.NITRO : shouldShowBonusOrbsUX;
setRestingQuestDockMode = useContext(QuestDockExternalCoordinationContext).setRestingQuestDockMode;
const callback = useCallback(async () => {
let c27701_0;
c27701_0 = void 0;
await enrollInQuest(quest.id, {
questContentCTA: QuestContentCTA.ACCEPT_QUEST,
questContent: QuestContent.QUEST_BAR_MOBILE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
if (isMobileActivityQuest) {
await (0, launchMobileActivity)();
(0, setRestingQuestDockMode)(QuestDockMode.COLLAPSED);
} else if (hasWatchVideoOnMobileTasks) {
openVideoQuestModal({
questId: quest.id,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
(0, setRestingQuestDockMode)(QuestDockMode.COLLAPSED);
}
}, [quest.id, hasWatchVideoOnMobileTasks, setRestingQuestDockMode, isMobileActivityQuest, launchMobileActivity]);
const primaryCtaCopy = usePrimaryCtaCopy({
quest,
application: questApplication,
shortText: true
});
const questsInstructionsToWinReward = useQuestsInstructionsToWinReward({
quest,
location: QuestsExperimentLocations.QUESTS_BAR_MOBILE,
taskDetails: questTaskDetails,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
});
return <PremiumRewardGradient visible={visible} glow style={[styles.wrapper, {
paddingBottom: Math.max(bottom, QUEST_DOCK_EXPANDED_PADDING_BOTTOM)
}]}>
<View style={styles.rewardContentWrapper}>
<QuestDockBlurredContentBackground />
<View style={styles.rewardContent}>
<QuestRewardTile paused={stateFromStores ? !isRendered : !stateFromStores} height={80} width={80} quest={quest} style={styles.questDockRewardTile} withAnimation={stateFromStores && isRendered} />
<View style={styles.rewardContentCopy}>
{shouldShowBonusOrbsUX && <View style={styles.premiumRewardPerkPill}>
<QuestOrbMultiplierPerkPill questId={quest.config.id} orbMultiplierEligibility={questOrbMultiplierEligibility} />
</View>}
<View style={styles.titleRow}>
<Text variant="heading-md/medium" color="mobile-text-heading-primary">
{intl.format(t.EQa7os, {
questName: quest.config.messages.questName
})}
</Text>
</View>
<Text color="text-default" variant="text-sm/normal">{questsInstructionsToWinReward}</Text>
</View>
</View>
</View>
<View style={styles.questDockCtaWrapper}>
<View style={styles.questDockCtaSaparator} />
<View style={styles.questDockCtaRow}>
<ShinyButton style={styles.questDockCta} onPress={callback} loading={stateFromStores2} renderIcon={() => getPrimaryCtaIcon(quest, true)} text={primaryCtaCopy} shineDisabled={!stateFromStores} />
</View>
</View>
</PremiumRewardGradient>;
});
export default r75;
@@ -0,0 +1,313 @@
// Metro module 14209 (f14210).
import { memo, useContext, useState, useEffect, useCallback } from "react";
import { AccessibilityInfo, View } from "react-native";
import { QuestDockMode } from "../../QuestConstants";
import { QUEST_DOCK_CONTENT_BORDER_RADII, QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED, QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED, QUEST_DOCK_COLLAPSED_HEIGHT } from "./QuestDockConstants";
import { ThemeTypes } from "../../../../_bundle/Module505";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
import QuestDockContext from "./QuestDockContext";
import { QuestDockGestureContext } from "./QuestDockGestureContext";
import { isIOS, isAndroid } from "../../../../_bundle/Module501";
import { useActionSheetPressHandler } from "./QuestDockHooks";
import QuestDisclosureModalActionCreators from "../QuestDisclosureModal/QuestDisclosureModalActionCreators";
import { QuestContent } from "../../QuestTypes";
import { QuestContentCTA } from "../../lib/analytics/AnalyticsTypes";
import useTheme from "../../../../hooks/useTheme";
import { isThemeDark } from "../../../../design/shared";
import { useToken } from "../../../../design/tokens/native/useToken";
import useQuestDockAnimatedBorderRadius from "./useQuestDockAnimatedBorderRadius";
import { useAnimatedStyle, useAnimatedProps } from "../../../reanimated/ReanimatedRexport";
import { useQuestGameLogotypeAssetUrl } from "../QuestHooks.native";
import ReanimatedNativeView from "../../../core/native/ReanimatedNativeView";
import QuestDockBlurredHeaderPlaceholder from "./QuestDockBlurredHeaderPlaceholder";
import QuestDockBlurredContentBackground from "./QuestDockBlurredContentBackground";
import FastImage from "../../../../components_native/common/FastImage";
import Module14212 from "../../../../_bundle/Module14212";
import Module14213 from "../../../../_bundle/Module14213";
import QuestGameLogotype from "../QuestGameLogotype";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { CircleQuestionIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleQuestionIcon";
import { MoreHorizontalIcon } from "../../../../design/components/Icon/native/redesign/generated/MoreHorizontalIcon";
let questDockHeaderLayoutAnimation, __initData, __initData2, __initData3, __initData4, __initData5, __initData6, __initData7;
const useStyles = createStyles({
questDockHeader: {
alignItems: "center",
justifyContent: "space-between",
flexDirection: "row",
height: QUEST_DOCK_COLLAPSED_HEIGHT,
overflow: "hidden",
paddingRight: 16,
paddingLeft: 8,
position: "absolute",
zIndex: 2
},
wreathImage: {
height: 35,
marginRight: 4,
width: 35
},
questDockHeaderPrimary: {
alignItems: "center",
flexDirection: "row"
},
logo: {
marginTop: 2
},
questDockHeaderSecondary: {
flexGrow: 0,
flexShrink: 0
},
questDockHeaderContentCollapsed: {
justifyContent: "center",
position: "absolute",
bottom: 0,
top: 0,
right: 0
},
questDockHeaderContentExpanded: {
alignItems: "center",
flexDirection: "row",
gap: 8
},
questDockHeaderActionDisclosures: {
alignItems: "center",
display: "flex",
flexDirection: "row",
gap: 4
},
questDockHeaderActionDisclosuresIcon: {
height: 14,
width: 14
},
questDockHeaderActionSeparator: {
backgroundColor: Module712.colors.TEXT_DEFAULT,
opacity: 0.2,
height: 18,
width: 1.5
},
questDockHeaderTertiaryContent: {
opacity: 0.7
}
});
const questDockHeaderLayoutAnimation2 = function questDockHeaderLayoutAnimation(a0) {
return {
initialValues: {
originX: a0.currentOriginX,
originY: a0.currentOriginY,
width: a0.currentWidth,
height: a0.currentHeight
},
animations: {
originX: _spring.withSpring(a0.targetOriginX, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
originY: _spring.withSpring(a0.targetOriginY, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
height: _spring.withSpring(a0.targetHeight, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
width: _spring.withSpring(a0.targetWidth, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
}
};
};
questDockHeaderLayoutAnimation2.__closure = {
withSpring: _spring.withSpring,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED
};
questDockHeaderLayoutAnimation2.__workletHash = 6787168806966;
questDockHeaderLayoutAnimation2.__initData = {
code: "function questDockHeaderLayoutAnimation_QuestDockUnenrolledHeaderTsx1(values){const{withSpring,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED}=this.__closure;return{initialValues:{originX:values.currentOriginX,originY:values.currentOriginY,width:values.currentWidth,height:values.currentHeight},animations:{originX:withSpring(values.targetOriginX,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),originY:withSpring(values.targetOriginY,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),height:withSpring(values.targetHeight,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),width:withSpring(values.targetWidth,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)}};}"
};
questDockHeaderLayoutAnimation = questDockHeaderLayoutAnimation2;
__initData = {
code: "function QuestDockUnenrolledHeaderTsx2(){const{activeQuestDockMode,QuestDockMode,QUEST_DOCK_CONTENT_BORDER_RADII,questDockBorderRadius,withSpring,questDockAnimatedBorderRadius,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,questDockWrapperSpecs,QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED}=this.__closure;return{borderTopLeftRadius:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:questDockBorderRadius,borderTopRightRadius:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:questDockBorderRadius,borderBottomLeftRadius:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:withSpring(questDockAnimatedBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),borderBottomRightRadius:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:withSpring(questDockAnimatedBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),width:activeQuestDockMode.get()===QuestDockMode.EXPANDED?questDockWrapperSpecs.get().width-QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED*2:questDockWrapperSpecs.get().width,transform:[{translateX:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)},{translateY:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)}]};}"
};
__initData2 = {
code: "function QuestDockUnenrolledHeaderTsx3(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?0:1,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)};}"
};
__initData3 = {
code: "function QuestDockUnenrolledHeaderTsx4(){const{activeQuestDockMode,QuestDockMode,QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED}=this.__closure;return{right:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED*-1:0};}"
};
__initData4 = {
code: "function QuestDockUnenrolledHeaderTsx5(){const{withSpring,activeQuestDockMode,QuestDockMode,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED}=this.__closure;return{opacity:withSpring(activeQuestDockMode.get()===QuestDockMode.EXPANDED?1:0,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)};}"
};
__initData5 = {
code: "function QuestDockUnenrolledHeaderTsx6(){const{activeQuestDockMode,QuestDockMode,QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED}=this.__closure;return{right:activeQuestDockMode.get()===QuestDockMode.EXPANDED?0:QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED};}"
};
__initData6 = {
code: "function QuestDockUnenrolledHeaderTsx7(){const{activeQuestDockMode,QuestDockMode}=this.__closure;return{pointerEvents:activeQuestDockMode.get()===QuestDockMode.EXPANDED?'auto':'none'};}"
};
__initData7 = {
code: "function QuestDockUnenrolledHeaderTsx8(){const{activeQuestDockMode,QuestDockMode,QUEST_DOCK_CONTENT_BORDER_RADII,questDockBorderRadius,withSpring,questDockAnimatedBorderRadius,QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,questDockWrapperSpecs}=this.__closure;return{borderRadius:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:questDockBorderRadius,borderBottomLeftRadius:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:withSpring(questDockAnimatedBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),borderBottomRightRadius:activeQuestDockMode.get()===QuestDockMode.EXPANDED?QUEST_DOCK_CONTENT_BORDER_RADII:withSpring(questDockAnimatedBorderRadius.get(),QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),width:questDockWrapperSpecs.get().width};}"
};
const r75 = memo(function QuestDockUnenrolledHeader() {
let token, c21039_5;
const quest = useContext(QuestDockContext).quest;
const context = useContext(QuestDockGestureContext);
const { activeQuestDockMode, questDockWrapperSpecs } = context;
const [state, setState] = useState(false);
useEffect(() => {
if (isIOS()) {
AccessibilityInfo.isReduceTransparencyEnabled().then(setState);
let c27700_0 = AccessibilityInfo.addEventListener("reduceTransparencyChanged", setState);
return () => c27700_0.remove();
}
}, []);
const actionSheetPressHandler = useActionSheetPressHandler(quest);
const callback = useCallback(() => {
QuestDisclosureModalActionCreators.showModal({
quest,
isTargetedDisclosure: true,
trackingCtx: {
content: QuestContent.QUEST_BAR_MOBILE,
ctaContent: QuestContentCTA.CONTEXT_MENU_OPEN_DISCLOSURE,
sourceQuestContent: QuestContent.QUEST_BAR_MOBILE
}
});
}, [quest]);
const r11 = isThemeDark(useTheme()) ? ThemeTypes.DARK : ThemeTypes.LIGHT;
token = useToken(Module712.modules.mobile.QUEST_DOCK_BORDER_RADIUS);
const questDockAnimatedBorderRadius = useQuestDockAnimatedBorderRadius(token);
c21039_5 = questDockAnimatedBorderRadius;
const K = () => {
const borderTopLeftRadius = activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : token;
const borderTopRightRadius = activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : token;
const borderBottomLeftRadius = activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : _spring.withSpring(c21039_5.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED);
return {
borderTopLeftRadius,
borderTopRightRadius,
borderBottomLeftRadius,
borderBottomRightRadius: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : _spring.withSpring(c21039_5.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
width: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? questDockWrapperSpecs.get().width - 2 * QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : questDockWrapperSpecs.get().width,
transform: [{
translateX: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
}, {
translateY: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
}]
};
};
K.__closure = {
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_CONTENT_BORDER_RADII,
questDockBorderRadius: token,
withSpring: _spring.withSpring,
questDockAnimatedBorderRadius,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,
questDockWrapperSpecs,
QUEST_DOCK_UNENROLLED_HEADER_INSET_EXPANDED
};
K.__workletHash = 15527986377887;
K.__initData = __initData;
const animatedStyle3 = useAnimatedStyle(K);
const X = () => ({
opacity: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? 0 : 1, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
});
X.__closure = {
withSpring: _spring.withSpring,
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED
};
X.__workletHash = 15527972438968;
X.__initData = __initData2;
const animatedStyle2 = useAnimatedStyle(X);
const q = () => ({
right: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? -1 * QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED : 0
});
q.__closure = {
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED
};
q.__workletHash = 7866036039040;
q.__initData = __initData3;
const animatedStyle = useAnimatedStyle(q);
const f = () => ({
opacity: _spring.withSpring(activeQuestDockMode.get() === QuestDockMode.EXPANDED ? 1 : 0, QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED)
});
f.__closure = {
withSpring: _spring.withSpring,
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED
};
f.__workletHash = 11647269239934;
f.__initData = __initData4;
const animatedStyle4 = useAnimatedStyle(f);
const B = () => ({
right: activeQuestDockMode.get() !== QuestDockMode.EXPANDED ? QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED : 0
});
B.__closure = {
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED
};
B.__workletHash = 14794727045076;
B.__initData = __initData5;
const animatedStyle5 = useAnimatedStyle(B);
const G = () => ({
pointerEvents: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? "auto" : "none"
});
G.__closure = {
activeQuestDockMode,
QuestDockMode
};
G.__workletHash = 6738114933032;
G.__initData = __initData6;
const animatedProps = useAnimatedProps(G);
const x = () => ({
borderRadius: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : token,
borderBottomLeftRadius: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : _spring.withSpring(c21039_5.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
borderBottomRightRadius: activeQuestDockMode.get() === QuestDockMode.EXPANDED ? QUEST_DOCK_CONTENT_BORDER_RADII : _spring.withSpring(c21039_5.get(), QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED),
width: questDockWrapperSpecs.get().width
});
x.__closure = {
activeQuestDockMode,
QuestDockMode,
QUEST_DOCK_CONTENT_BORDER_RADII,
questDockBorderRadius: token,
withSpring: _spring.withSpring,
questDockAnimatedBorderRadius,
QUEST_DOCK_MODE_CHANGE_PHYSICS_CLAMPED,
questDockWrapperSpecs
};
x.__workletHash = 16321960714067;
x.__initData = __initData7;
const animatedStyle6 = useAnimatedStyle(x);
const styles = useStyles();
const questGameLogotypeAssetUrl = useQuestGameLogotypeAssetUrl(quest);
const questBarHeroBlurhash = quest.config.assets.questBarHeroBlurhash;
return <ReanimatedNativeView style={[styles.questDockHeader, animatedStyle3]} layout={questDockHeaderLayoutAnimation}>
{!(!isAndroid() && !state) && questBarHeroBlurhash != null ? <QuestDockBlurredHeaderPlaceholder placeholder={questBarHeroBlurhash} animatedStyle={animatedStyle6} animatedLayout={questDockHeaderLayoutAnimation} /> : <QuestDockBlurredContentBackground animatedStyle={animatedStyle6} animatedLayout={questDockHeaderLayoutAnimation} />}
<View style={styles.questDockHeaderPrimary}>
<FastImage source={r11 === ThemeTypes.DARK ? Module14212 : Module14213} resizeMode="contain" style={styles.wreathImage} />
<QuestGameLogotype assetUrl={questGameLogotypeAssetUrl} height={36} maxWidth={120} style={styles.logo} />
</View>
<View style={styles.questDockHeaderSecondary}>
<ReanimatedNativeView style={[styles.questDockHeaderContentCollapsed, animatedStyle]} layout={questDockHeaderLayoutAnimation}>
<ReanimatedNativeView style={animatedStyle2}>
<Text style={styles.questDockHeaderTertiaryContent} variant="text-sm/medium" color="interactive-text-active">
{intl.string(t["3mgEQf"])}
</Text>
</ReanimatedNativeView>
</ReanimatedNativeView>
<ReanimatedNativeView animatedProps={animatedProps} style={animatedStyle5} layout={questDockHeaderLayoutAnimation}>
<ReanimatedNativeView style={[styles.questDockHeaderContentExpanded, animatedStyle4]}>
<PressableOpacity onPress={callback} accessibilityRole="button" style={[styles.questDockHeaderActionDisclosures, styles.questDockHeaderTertiaryContent]}>
<>
<Text color="interactive-text-active" variant="text-sm/medium">
{intl.string(t.o6FLcF)}
</Text>
<CircleQuestionIcon color={Module712.colors.INTERACTIVE_TEXT_ACTIVE} style={styles.questDockHeaderActionDisclosuresIcon} />
</>
</PressableOpacity>
<View style={styles.questDockHeaderActionSeparator} />
<PressableOpacity accessibilityRole="button" onPress={actionSheetPressHandler} style={styles.questDockHeaderTertiaryContent}>
<MoreHorizontalIcon color={Module712.colors.INTERACTIVE_TEXT_ACTIVE} />
</PressableOpacity>
</ReanimatedNativeView>
</ReanimatedNativeView>
</View>
</ReanimatedNativeView>;
});
export default r75;
@@ -0,0 +1,89 @@
// Metro module 14121 (f14122).
import { PixelRatio } from "react-native";
import { QUEST_DOCK_COLLAPSED_HEIGHT, QUEST_DOCK_COLLAPSED_MAX_WIDTH, QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED, QUEST_DOCK_MODE_CHANGE_PHYSICS } from "./QuestDockConstants";
import Durations from "../../../../utils/Durations";
import * as _spring from "../../../../design/animation/reanimated/spring/spring";
let c9882_7;
let c9882_6 = PixelRatio.get();
export function roundToNearestPixel(a0) {
return Math.round(a0 * c9882_6) / c9882_6;
}
roundToNearestPixel.__closure = {
PIXEL_DENSITY: c9882_6
};
roundToNearestPixel.__workletHash = 9602449563120;
roundToNearestPixel.__initData = {
code: "function roundToNearestPixel_QuestDockUtilsTsx1(position){const{PIXEL_DENSITY}=this.__closure;return Math.round(position*PIXEL_DENSITY)/PIXEL_DENSITY;}"
};
export function getQuestDockExpandedHeightLimits(a0, a1, a2) {
return {
minHeight: QUEST_DOCK_COLLAPSED_HEIGHT,
maxHeight: Math.min(a2, a0 - a1)
};
}
getQuestDockExpandedHeightLimits.__closure = {
QUEST_DOCK_COLLAPSED_HEIGHT
};
getQuestDockExpandedHeightLimits.__workletHash = 880847803554;
getQuestDockExpandedHeightLimits.__initData = {
code: "function getQuestDockExpandedHeightLimits_QuestDockUtilsTsx2(windowHeight,safeAreaTop,minContentHeight){const{QUEST_DOCK_COLLAPSED_HEIGHT}=this.__closure;return{minHeight:QUEST_DOCK_COLLAPSED_HEIGHT,maxHeight:Math.min(minContentHeight,windowHeight-safeAreaTop)};}"
};
export function getQuestDockCollapsedWidth(a0, a1, a2) {
return Math.min(a0 - Math.max(a1, QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED) - Math.max(a2, QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED), QUEST_DOCK_COLLAPSED_MAX_WIDTH);
}
getQuestDockCollapsedWidth.__closure = {
QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED,
QUEST_DOCK_COLLAPSED_MAX_WIDTH
};
getQuestDockCollapsedWidth.__workletHash = 1119343760780;
getQuestDockCollapsedWidth.__initData = {
code: "function getQuestDockCollapsedWidth_QuestDockUtilsTsx3(windowWidth,safeAreaLeft,safeAreaRight){const{QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED,QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;safeAreaLeft=Math.max(safeAreaLeft,QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED);safeAreaRight=Math.max(safeAreaRight,QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED);return Math.min(windowWidth-safeAreaLeft-safeAreaRight,QUEST_DOCK_COLLAPSED_MAX_WIDTH);}"
};
export function getQuestDockExpandedWidth(a0, a1, a2) {
return Math.min(a0 - a1 - a2, QUEST_DOCK_COLLAPSED_MAX_WIDTH);
}
getQuestDockExpandedWidth.__closure = {
QUEST_DOCK_COLLAPSED_MAX_WIDTH
};
getQuestDockExpandedWidth.__workletHash = 6480418564130;
getQuestDockExpandedWidth.__initData = {
code: "function getQuestDockExpandedWidth_QuestDockUtilsTsx4(windowWidth,safeAreaLeft,safeAreaRight){const{QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;return Math.min(windowWidth-safeAreaLeft-safeAreaRight,QUEST_DOCK_COLLAPSED_MAX_WIDTH);}"
};
export function getQuestDockClosedWidth(a0, a1, a2) {
return Math.min(a0 - a1 - a2, QUEST_DOCK_COLLAPSED_MAX_WIDTH);
}
getQuestDockClosedWidth.__closure = {
QUEST_DOCK_COLLAPSED_MAX_WIDTH
};
getQuestDockClosedWidth.__workletHash = 14159592925974;
getQuestDockClosedWidth.__initData = {
code: "function getQuestDockClosedWidth_QuestDockUtilsTsx5(windowWidth,safeAreaLeft,safeAreaRight){const{QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;return Math.min(windowWidth-safeAreaLeft-safeAreaRight,QUEST_DOCK_COLLAPSED_MAX_WIDTH);}"
};
c9882_7 = 3 * Durations.Millis.HOUR;
export function dimensionsLayoutTransition(a0) {
return {
initialValues: {
originX: a0.currentOriginX,
originY: a0.currentOriginY,
width: a0.currentWidth,
height: a0.currentHeight
},
animations: {
originX: _spring.withSpring(a0.targetOriginX, QUEST_DOCK_MODE_CHANGE_PHYSICS),
originY: _spring.withSpring(a0.targetOriginY, QUEST_DOCK_MODE_CHANGE_PHYSICS),
height: _spring.withSpring(a0.targetHeight, QUEST_DOCK_MODE_CHANGE_PHYSICS),
width: _spring.withSpring(a0.targetWidth, QUEST_DOCK_MODE_CHANGE_PHYSICS)
}
};
}
dimensionsLayoutTransition.__closure = {
withSpring: _spring.withSpring,
QUEST_DOCK_MODE_CHANGE_PHYSICS
};
dimensionsLayoutTransition.__workletHash = 4497154070776;
dimensionsLayoutTransition.__initData = {
code: "function dimensionsLayoutTransition_QuestDockUtilsTsx6(values){const{withSpring,QUEST_DOCK_MODE_CHANGE_PHYSICS}=this.__closure;return{initialValues:{originX:values.currentOriginX,originY:values.currentOriginY,width:values.currentWidth,height:values.currentHeight},animations:{originX:withSpring(values.targetOriginX,QUEST_DOCK_MODE_CHANGE_PHYSICS),originY:withSpring(values.targetOriginY,QUEST_DOCK_MODE_CHANGE_PHYSICS),height:withSpring(values.targetHeight,QUEST_DOCK_MODE_CHANGE_PHYSICS),width:withSpring(values.targetWidth,QUEST_DOCK_MODE_CHANGE_PHYSICS)}};}"
};
export function isSoftDismissed(a0) {
return a0 != null && Date.now() - a0 < c9882_7;
}
@@ -0,0 +1,8 @@
// Metro module 14130 (f14131).
import Module712 from "../../../../_bundle/Module712";
import { BaseIconImage } from "../../../../design/components/Icon/native/BaseIconImage";
import * as _Module14131 from "../../../../_bundle/Module14131";
export default function WreathIcon(props) {
const { style, color = Module712.colors.INTERACTIVE_TEXT_DEFAULT, ...rest } = props;
return <BaseIconImage source={_Module14131} color={color} style={style} {...rest} />;
};
@@ -0,0 +1,29 @@
// Metro module 14206 (f14207).
import { useContext } from "react";
import { QuestDockExternalCoordinationContext } from "./QuestDockExternalCoordinationContext";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useDerivedValue } from "../../../reanimated/ReanimatedRexport";
const __initData = {
code: "function useQuestDockAnimatedBorderRadiusTsx1(){const{interpolate,questDockOffset,minBorder,maxBorder,Extrapolation}=this.__closure;return interpolate(questDockOffset.get(),[0,50],[minBorder,maxBorder],Extrapolation.CLAMP);}"
};
export default function useQuestDockAnimatedBorderRadius(a0) {
let minBorder = arguments[1];
if (minBorder === void 0) {
minBorder = 0;
}
let c21036_1 = minBorder;
const questDockOffset = useContext(QuestDockExternalCoordinationContext).questDockOffset;
const u = function u() {
return _ReanimatedRexport.interpolate(questDockOffset.get(), [0, 50], [c21036_1, a0], _ReanimatedRexport.Extrapolation.CLAMP);
};
u.__closure = {
interpolate: _ReanimatedRexport.interpolate,
questDockOffset,
minBorder,
maxBorder: a0,
Extrapolation: _ReanimatedRexport.Extrapolation
};
u.__workletHash = 17005846780112;
u.__initData = __initData;
return useDerivedValue(u);
};