203 lines
12 KiB
TypeScript
203 lines
12 KiB
TypeScript
/* Metro module 13663; source: modules/quests/native/QuestDock/QuestDockEnrolledBody.tsx; dependencies: [5, 31, 27, 13570, 6528, 13572, 33, 4501, 697, 13576, 13573, 8621, 13568, 13595, 6531, 13592, 13591, 13593, 1585, 5176, 7116, 2] */
|
|
function _fun104337(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#104337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:6, offset: 0x022929cd, size: 517 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
const questDockStore = importDefault(13570) /* metro dependency 13570: QuestDockStore */;
|
|
const questConstantsModule = require(6528) /* metro dependency 6528: QuestConstants */;
|
|
const env0_7 = questConstantsModule.QuestDockMode;
|
|
const env0_8 = questConstantsModule.QuestsExperimentLocations;
|
|
const questDockConstantsModule = require(13572) /* metro dependency 13572: QuestDockConstants */;
|
|
const QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP = questDockConstantsModule.QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP;
|
|
const env0_9 = questDockConstantsModule.QUEST_DOCK_EXPANDED_HEIGHT;
|
|
const QUEST_DOCK_EXPANDED_PADDING_BOTTOM = questDockConstantsModule.QUEST_DOCK_EXPANDED_PADDING_BOTTOM;
|
|
const QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL = questDockConstantsModule.QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL;
|
|
const value4 = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value4.jsx;
|
|
const env0_12 = value4.Fragment;
|
|
const env0_13 = value4.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
object2 = {};
|
|
object2.wrapper = {'flexGrow': 0, 'flexShrink': 0, paddingBottom: QUEST_DOCK_EXPANDED_PADDING_BOTTOM,
|
|
paddingTop: QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP, paddingHorizontal: QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL};
|
|
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.headerWrapper = {marginBottom: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.contentWrapper = {'display': 'flex', 'gap': null, 'flexGrow': 0, 'flexShrink': 0, gap: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.footer = {marginTop: PX_16};
|
|
object2.footerWrapper = {marginLeft: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL,
|
|
marginRight: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL};
|
|
const env0_14 = Reflect.apply(createStyles, createStylesModule, [object2]);
|
|
value = value.memo(QuestDockEnrolledBody);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quests/native/QuestDock/QuestDockEnrolledBody.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function EnrolledBodyWatchTask({quest}) { // fn#104338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:733, offset: 0x02292bd2, size: 643 bytes, params: 2, frame: 29
|
|
const styles = useStyles();
|
|
let binding = env0_4;
|
|
let useContext = binding.useContext;
|
|
const QuestDockExternalCoordinationContext = (require(13576) /* metro dependency 13576: QuestDockExternalCoordinationContext */).QuestDockExternalCoordinationContext;
|
|
const {restingQuestDockMode, setRestingQuestDockMode} = Reflect.apply(useContext, binding,
|
|
[QuestDockExternalCoordinationContext]);
|
|
binding = env0_4;
|
|
useContext = binding.useContext;
|
|
const QuestDockGestureContext = (require(13573) /* metro dependency 13573: QuestDockGestureContext */).QuestDockGestureContext;
|
|
const questDockWrapperSpecs = Reflect.apply(useContext, binding, [QuestDockGestureContext]).questDockWrapperSpecs;
|
|
const value3 = (importDefault(8621) /* metro dependency 8621: useStateFromSharedValue */)(restingQuestDockMode);
|
|
const value4 = (require(13568) /* metro dependency 13568: QuestHooksNative */).useHasWatchVideoOnMobileTasks(quest.config);
|
|
var env0_4 = value4;
|
|
env0_4.useEffect(_fun104339, [value3, questDockWrapperSpecs, quest.id, setRestingQuestDockMode, value4]);
|
|
const jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
const QuestBottomSheetHeader = importDefault(13592) /* metro dependency 13592: QuestBottomSheetHeader */;
|
|
const QuestBottomSheetStep = (require(13591) /* metro dependency 13591: QuestBottomSheet */).QuestBottomSheetStep;
|
|
let TASK_STATUS = QuestBottomSheetStep.TASK_STATUS;
|
|
let QUESTS_BAR_MOBILE = QuestsExperimentLocations.QUESTS_BAR_MOBILE;
|
|
const items2 = [<View style={styles.headerWrapper}><QuestBottomSheetHeader quest={quest} step={TASK_STATUS} withActionSheet location={QUESTS_BAR_MOBILE} /></View>];
|
|
const QuestBottomSheetContent = (require(13591) /* metro dependency 13591: QuestBottomSheet */).QuestBottomSheetContent;
|
|
QUESTS_BAR_MOBILE = QuestsExperimentLocations.QUESTS_BAR_MOBILE;
|
|
TASK_STATUS = QuestBottomSheetStep.TASK_STATUS;
|
|
const QuestContent = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent;
|
|
let QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
items2[1] = <View style={styles.contentWrapper}><QuestBottomSheetContent quest={quest} location={QUESTS_BAR_MOBILE} step={TASK_STATUS} sourceQuestContent={QUEST_BAR_MOBILE} /></View>;
|
|
const questBottomSheetFooter = importDefault(13593) /* metro dependency 13593: QuestBottomSheetFooter */;
|
|
TASK_STATUS = QuestBottomSheetStep.TASK_STATUS;
|
|
QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
items2[2] = <View style={styles.footerWrapper}>{((Component) => <Component quest={quest} step={TASK_STATUS} style={styles.footer} withSafeArea={false} sourceQuestContent={QUEST_BAR_MOBILE} />)(questBottomSheetFooter)}</View>;
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function EnrolledBodyPlayStreamTask({quest}) { // fn#104344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:2070, offset: 0x02292f93, size: 532 bytes, params: 2, frame: 33
|
|
const styles = useStyles();
|
|
const questBottomSheetModule = require(13591) /* metro dependency 13591: QuestBottomSheet */;
|
|
const useEnrolledQuestContentProps = questBottomSheetModule.useEnrolledQuestContentProps;
|
|
const object2 = {quest: quest};
|
|
let QUESTS_BAR_MOBILE = QuestsExperimentLocations.QUESTS_BAR_MOBILE;
|
|
object2.location = QUESTS_BAR_MOBILE;
|
|
const QuestContent = (require(6531) /* metro dependency 6531: QuestTypes */).QuestContent;
|
|
let QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
object2.sourceQuestContent = QUEST_BAR_MOBILE;
|
|
const {step, defibrillator, stepActions, handleTaskSelect,
|
|
showMicrophone} = Reflect.apply(useEnrolledQuestContentProps, questBottomSheetModule, [object2]);
|
|
const jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
const QuestBottomSheetHeader = importDefault(13592) /* metro dependency 13592: QuestBottomSheetHeader */;
|
|
QUESTS_BAR_MOBILE = QuestsExperimentLocations.QUESTS_BAR_MOBILE;
|
|
const items2 = [<View style={styles.headerWrapper}><QuestBottomSheetHeader quest={quest} step={step} withActionSheet location={QUESTS_BAR_MOBILE} /></View>];
|
|
const QuestBottomSheetContent = questBottomSheetModule.QuestBottomSheetContent;
|
|
QUESTS_BAR_MOBILE = QuestsExperimentLocations.QUESTS_BAR_MOBILE;
|
|
QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
items2[1] = <View style={styles.contentWrapper}><QuestBottomSheetContent defibrillator={defibrillator} quest={quest} handleTaskSelect={handleTaskSelect} location={QUESTS_BAR_MOBILE} showMicrophone={showMicrophone} step={step} sourceQuestContent={QUEST_BAR_MOBILE} /></View>;
|
|
const questBottomSheetFooter = importDefault(13593) /* metro dependency 13593: QuestBottomSheetFooter */;
|
|
const isActive = defibrillator.isActive;
|
|
const onBack = stepActions.onBack;
|
|
const start = defibrillator.start;
|
|
const onNext = stepActions.onNext;
|
|
QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
items2[2] = <View style={styles.footerWrapper}>{((Component) => <Component quest={quest} step={step} isDefibrilating={isActive} onBack={onBack} onDefib={start} onConnectConsoleNext={onNext} style={styles.footer} withSafeArea={false} sourceQuestContent={QUEST_BAR_MOBILE} />)(questBottomSheetFooter)}</View>;
|
|
return (
|
|
<>
|
|
{items2}
|
|
</>
|
|
);
|
|
}
|
|
|
|
function QuestDockEnrolledBody({quest}) { // fn#104345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:2980, offset: 0x022931a7, size: 350 bytes, params: 2, frame: 23
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const useContext = binding.useContext;
|
|
const QuestDockGestureContext = (require(13573) /* metro dependency 13573: QuestDockGestureContext */).QuestDockGestureContext;
|
|
const minExpandedContentHeight = Reflect.apply(useContext, binding,
|
|
[QuestDockGestureContext]).minExpandedContentHeight;
|
|
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
|
|
const value2 = (require(5176) /* metro dependency 5176: YouBarExperiment */).useYouBarEnabled('QuestDockEnrolledBody');
|
|
const value3 = env0_4.useCallback(function(a0) {
|
|
var height = a0.nativeEvent.layout.height;
|
|
if (minExpandedContentHeight.get() !== height) {
|
|
minExpandedContentHeight.set(height);
|
|
}
|
|
}, [minExpandedContentHeight]);
|
|
env0_4.useEffect(function() {
|
|
return _fun104348;
|
|
}, [minExpandedContentHeight]);
|
|
return (
|
|
<View
|
|
style={[styles.wrapper, value2 ? {paddingBottom: global.Math.max(bottom,
|
|
QUEST_DOCK_EXPANDED_PADDING_BOTTOM)} : null]}
|
|
onLayout={value3}
|
|
>
|
|
{(require(7116) /* metro dependency 7116: QuestTaskUtils */).hasWatchVideoTasks(quest) ? <EnrolledBodyWatchTask quest={quest} /> : <EnrolledBodyPlayStreamTask quest={quest} />}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun104339() { // fn#104339, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:1057, offset: 0x02292e55, size: 40 bytes, params: 1, frame: 9
|
|
if (env0_4) {
|
|
(function() {
|
|
return _maybeOpenVideoQuestModal.apply(this, arguments);
|
|
})();
|
|
}
|
|
}
|
|
|
|
function _fun104347() { // fn#104347, offset: 0x0229333f, size: 11 bytes, params: 1, frame: 1
|
|
return function() {
|
|
if (minExpandedContentHeight.get() !== QUEST_DOCK_EXPANDED_HEIGHT) {
|
|
minExpandedContentHeight.set(QUEST_DOCK_EXPANDED_HEIGHT);
|
|
}
|
|
};
|
|
}
|
|
|
|
function _maybeOpenVideoQuestModal() { // fn#104340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:1062, offset: 0x02292e7d, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__.__proto__;
|
|
return env2_3(_fun104342).apply(this, arguments);
|
|
}
|
|
|
|
function* _fun104342() { // fn#104342, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:1135, offset: 0x02292ebd, size: 214 bytes, params: 1, frame: 17
|
|
var r1;
|
|
var binding;
|
|
var value4;
|
|
var value8;
|
|
var binding2;
|
|
var value9;
|
|
var object2;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
var get = dependencyMap.get;
|
|
var value3 = Reflect.apply(get, dependencyMap, []).prevDeltaY < 0;
|
|
if (value3) {
|
|
binding = env3_3;
|
|
value4 = environment.__proto__.__proto__.__proto__.__proto__;
|
|
r1 = binding === env4_7.RESET_TO_PREVIOUS;
|
|
} else {
|
|
r1 = value3;
|
|
}
|
|
r1 = r1 && env4_6.prevRestingQuestDockMode === env4_7.EXPANDED;
|
|
if (r1) {
|
|
value8 = environment.__proto__.__proto__.__proto__.__proto__;
|
|
binding = env4_1;
|
|
binding2 = env4_2;
|
|
value9 = binding(binding2[13]);
|
|
object2 = {};
|
|
object2.questId = require.id;
|
|
binding = env4_0;
|
|
object2.sourceQuestContent = binding(binding2[14]).QuestContent.QUEST_BAR_MOBILE;
|
|
yield value9(object2);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
importDefault(env4_7.COLLAPSED);
|
|
}
|
|
}
|
|
}
|
|
|