Files
discord-decomp/sources/modules/quests/native/QuestDock/QuestDockDragHandle.tsx
T
2026-07-27 16:20:00 +03:00

147 lines
10 KiB
TypeScript

/* Metro module 13665; source: modules/quests/native/QuestDock/QuestDockDragHandle.tsx; dependencies: [31, 27, 6528, 13572, 7553, 33, 4501, 13650, 13573, 5176, 4017, 4577, 8141, 13571, 6515, 1244, 2] */
function _fun104360(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:6, offset: 0x02293cfa, size: 460 bytes, params: 8, frame: 24
var object4;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const StyleSheet = (require(27) /* metro dependency 27 */).StyleSheet;
const env0_4 = (require(6528) /* metro dependency 6528: QuestConstants */).QuestDockMode;
const questDockConstantsModule = require(13572) /* metro dependency 13572: QuestDockConstants */;
const env0_5 = questDockConstantsModule.QUEST_DOCK_MODE_CHANGE_PHYSICS;
const env0_6 = questDockConstantsModule.QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED;
const env0_7 = questDockConstantsModule.QUEST_DOCK_COLLAPSED_MAX_WIDTH;
const env0_8 = (require(7553) /* metro dependency 7553: YouBarConstants */).useYouBarHorizontalMargin;
const value3 = require(33) /* metro dependency 33 */;
const env0_9 = value3.jsx;
const env0_10 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object4 = {};
const object5 = {};
copyDataProperties(object5, StyleSheet.absoluteFillObject, undefined);
object5['bottom'] = undefined;
object5['right'] = undefined;
object5['zIndex'] = 4;
object4.dragHandleWrapper = object5;
const object6 = {};
copyDataProperties(object6, StyleSheet.absoluteFillObject, undefined);
object6['bottom'] = undefined;
object4.dragHandleOverlay = object6;
const env0_11 = Reflect.apply(createStyles, createStylesModule, [object4]);
object4 = {code: 'function getDragHandleOffsetLeft_QuestDockDragHandleTsx1(activeQuestDockMode,horizontalEdgeGutter,withYouBar){const{QuestDockMode}=this.__closure;if(withYouBar){switch(activeQuestDockMode){case QuestDockMode.EXPANDED:return 0;default:return horizontalEdgeGutter*-1;}}else{switch(activeQuestDockMode){case QuestDockMode.COLLAPSED:return horizontalEdgeGutter*-1;default:return 0;}}}'};
const env0_13 = _fun104361();
object4 = {code: 'function QuestDockDragHandleTsx2(){const{windowDimensions,QUEST_DOCK_COLLAPSED_MAX_WIDTH}=this.__closure;return{width:Math.min(windowDimensions.get().width,QUEST_DOCK_COLLAPSED_MAX_WIDTH)};}'};
object4 = {code: 'function QuestDockDragHandleTsx3(){const{getDragHandleOffsetLeft,activeQuestDockMode,questDockHorizontalGutterCollapsed,youBarEnabled}=this.__closure;return{left:getDragHandleOffsetLeft(activeQuestDockMode.get(),questDockHorizontalGutterCollapsed,youBarEnabled)};}'};
object4 = {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)};}'};
object4 = {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)};}'};
value = value.memo(QuestDockDragHandle);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/QuestDock/QuestDockDragHandle.tsx');
exports.default = value;
}
function _fun104361() { // fn#104361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:900, offset: 0x02293ec6, size: 57 bytes, params: 1, frame: 4
const closure = getDragHandleOffsetLeft;
closure.__closure = {QuestDockMode: QuestDockMode};
closure.__workletHash = 3634410156103;
closure.__initData = env0_12;
return closure;
}
function QuestDockDragHandle({isExpanded}) { // fn#104363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:2358, offset: 0x02293f45, size: 973 bytes, params: 2, frame: 31
var object2;
const binding = env0_3;
let useContext = binding.useContext;
const quest = Reflect.apply(useContext, binding,
[importDefault(13650) /* metro dependency 13650: QuestDockContext */]).quest;
const styles = useStyles();
useContext = binding.useContext;
const QuestDockGestureContext = (require(13573) /* metro dependency 13573: QuestDockGestureContext */).QuestDockGestureContext;
const {activeQuestDockMode, windowDimensions} = Reflect.apply(useContext, binding, [QuestDockGestureContext]);
const userStatus = quest.userStatus;
const value4 = userStatus?.enrolledAt != null;
const value5 = (require(5176) /* metro dependency 5176: YouBarExperiment */).useYouBarEnabled('QuestDockDragHandle');
const r15 = value5 ? useYouBarHorizontalMargin() : QUEST_DOCK_HORIZONTAL_EDGE_GUTTER_COLLAPSED;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = function() {
var object = {};
var Math = global.Math;
object.width = Math.min(windowDimensions.get().width, QUEST_DOCK_COLLAPSED_MAX_WIDTH);
return object;
};
closure.__closure = {windowDimensions: windowDimensions,
QUEST_DOCK_COLLAPSED_MAX_WIDTH: QUEST_DOCK_COLLAPSED_MAX_WIDTH};
closure.__workletHash = 13640576219747;
closure.__initData = env0_14;
const value7 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const moduleValue3 = reanimatedRexportModule;
useAnimatedStyle = moduleValue3.useAnimatedStyle;
closure = QuestDockDragHandleH;
closure.__closure = {getDragHandleOffsetLeft: env0_13, activeQuestDockMode: activeQuestDockMode,
questDockHorizontalGutterCollapsed: r15, youBarEnabled: value5};
closure.__workletHash = 14041713732815;
closure.__initData = env0_15;
const value8 = Reflect.apply(useAnimatedStyle, moduleValue3, [closure]);
const moduleValue4 = reanimatedRexportModule;
useAnimatedStyle = moduleValue4.useAnimatedStyle;
closure = function() {
var moduleValue = require(dependencyMap[11]);
return {opacity: moduleValue.withSpring(result || activeQuestDockMode.get() === QuestDockMode.CLOSED ? 1 : activeQuestDockMode.get() !== QuestDockMode.SOFT_DISMISSED ? 0 : 1,
QUEST_DOCK_MODE_CHANGE_PHYSICS)};
};
object2 = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, isEnrolled: value4,
activeQuestDockMode: activeQuestDockMode};
object2.QuestDockMode = QuestDockMode;
object2.QUEST_DOCK_MODE_CHANGE_PHYSICS = QUEST_DOCK_MODE_CHANGE_PHYSICS;
closure.__closure = object2;
closure.__workletHash = 12299455640931;
closure.__initData = env0_16;
const value9 = Reflect.apply(useAnimatedStyle, moduleValue4, [closure]);
const moduleValue5 = reanimatedRexportModule;
useAnimatedStyle = moduleValue5.useAnimatedStyle;
closure = function() {
var moduleValue = require(dependencyMap[11]);
return {opacity: moduleValue.withSpring(result || activeQuestDockMode.get() === QuestDockMode.CLOSED ? 0 : activeQuestDockMode.get() !== QuestDockMode.SOFT_DISMISSED ? 0.5 : 0,
QUEST_DOCK_MODE_CHANGE_PHYSICS)};
};
closure.__closure = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring, isEnrolled: value4,
activeQuestDockMode: activeQuestDockMode, QuestDockMode: QuestDockMode,
QUEST_DOCK_MODE_CHANGE_PHYSICS: QUEST_DOCK_MODE_CHANGE_PHYSICS};
closure.__workletHash = 9632835517209;
closure.__initData = env0_17;
const value10 = Reflect.apply(useAnimatedStyle, moduleValue5, [closure]);
const ReanimatedNativeView = importDefault(8141) /* metro dependency 8141: ReanimatedNativeView */;
const items3 = [styles.dragHandleWrapper, value7];
const defaultImport2 = ReanimatedNativeView;
const dimensionsLayoutTransition = (require(13571) /* metro dependency 13571: QuestDockUtils */).dimensionsLayoutTransition;
const defaultImport3 = ReanimatedNativeView;
const items2 = [styles.dragHandleOverlay, value10];
const ActionSheetHeaderBar = (require(6515) /* metro dependency 6515: ActionSheetHeaderBarNative */).ActionSheetHeaderBar;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
return (
<ReanimatedNativeView style={items3}>
{((Component) => <Component style={value8} layout={dimensionsLayoutTransition}>{((Component) => <Component style={items2}><ActionSheetHeaderBar variant="overlay" accessibilityLabel={isExpanded ? Reflect.apply(string,
intl, [t['GQ+4bk']]) : Reflect.apply(string, intl,
[t.Yplnt6])} /></Component>)(defaultImport3)}<ReanimatedNativeView style={[styles.dragHandleOverlay,
value9]} pointerEvents="none" accessibilityElementsHidden importantForAccessibility="no-hide-descendants"><ActionSheetHeaderBar variant="default" /></ReanimatedNativeView></Component>)(defaultImport2)}
</ReanimatedNativeView>
);
}
function getDragHandleOffsetLeft(a0, a1, a2) { // fn#104362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:939, offset: 0x02293eff, size: 70 bytes, params: 4, frame: 5
const value = environment.__proto__;
return a2 ? a0 === QuestDockMode.EXPANDED ? 0 : -1 * a1 : a0 !== QuestDockMode.COLLAPSED ? 0 : -1 * a1;
}
function QuestDockDragHandleH() { // fn#104365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13862:2883, owner: QuestDockDragHandle.H, offset: 0x02294349, size: 48 bytes, params: 1, frame: 16
const object2 = {};
object2.left = env1_13(activeQuestDockMode.get(), env0_4, env0_3);
return object2;
}