268 lines
15 KiB
TypeScript
268 lines
15 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] */
|
|
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import UseStateFromSharedValue from '../../../reanimated/native/useStateFromSharedValue.tsx'; /* Metro dependency 8621 */
|
|
import QuestDockStore from './QuestDockStore.tsx'; /* Metro dependency 13570 */
|
|
import QuestBottomSheetHeader from '../QuestBottomSheet/QuestBottomSheetHeader.tsx'; /* Metro dependency 13592 */
|
|
import QuestBottomSheetFooter from '../QuestBottomSheet/QuestBottomSheetFooter.tsx'; /* Metro dependency 13593 */
|
|
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as YouBarExperimentModule from '../../../main_tabs_v2/YouBarExperiment.tsx'; /* Metro dependency 5176 */
|
|
import * as QuestConstantsModule from '../../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as QuestTypesModule from '../../QuestTypes.tsx'; /* Metro dependency 6531 */
|
|
import * as QuestHooksNativeModule from '../QuestHooks.native.tsx'; /* Metro dependency 13568 */
|
|
import * as QuestDockConstantsModule from './QuestDockConstants.tsx'; /* Metro dependency 13572 */
|
|
import * as QuestDockGestureContextModule from './QuestDockGestureContext.tsx'; /* Metro dependency 13573 */
|
|
import * as QuestDockExternalCoordinationContextModule from './QuestDockExternalCoordinationContext.tsx'; /* Metro dependency 13576 */
|
|
import * as QuestBottomSheetModule from '../QuestBottomSheet/QuestBottomSheet.tsx'; /* Metro dependency 13591 */
|
|
|
|
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
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP = QuestDockConstantsModule.QUEST_DOCK_EXPANDED_ENROLLED_PADDING_TOP;
|
|
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 createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
object.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;
|
|
object.headerWrapper = {marginBottom: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.contentWrapper = {'display': 'flex', 'gap': null, 'flexGrow': 0, 'flexShrink': 0, gap: PX_16};
|
|
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object.footer = {marginTop: PX_16};
|
|
object.footerWrapper = {marginLeft: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL,
|
|
marginRight: -1 * QUEST_DOCK_EXPANDED_PADDING_HORIZONTAL};
|
|
const env0_14 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
value = value.memo(QuestDockEnrolledBody);
|
|
(FileImportTrackerModule).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 = (QuestDockExternalCoordinationContextModule).QuestDockExternalCoordinationContext;
|
|
const {restingQuestDockMode, setRestingQuestDockMode} = Reflect.apply(useContext, binding,
|
|
[QuestDockExternalCoordinationContext]);
|
|
binding = env0_4;
|
|
useContext = binding.useContext;
|
|
const QuestDockGestureContext = (QuestDockGestureContextModule).QuestDockGestureContext;
|
|
const questDockWrapperSpecs = Reflect.apply(useContext, binding, [QuestDockGestureContext]).questDockWrapperSpecs;
|
|
const value3 = (UseStateFromSharedValue)(restingQuestDockMode);
|
|
const value4 = (QuestHooksNativeModule).useHasWatchVideoOnMobileTasks(quest.config);
|
|
var env0_4 = value4;
|
|
env0_4.useEffect(_fun104339, [value3, questDockWrapperSpecs, quest.id, setRestingQuestDockMode, value4]);
|
|
const jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
const QuestBottomSheetStep = (QuestBottomSheetModule).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 = (QuestBottomSheetModule).QuestBottomSheetContent;
|
|
QUESTS_BAR_MOBILE = QuestsExperimentLocations.QUESTS_BAR_MOBILE;
|
|
TASK_STATUS = QuestBottomSheetStep.TASK_STATUS;
|
|
const QuestContent = (QuestTypesModule).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>
|
|
);
|
|
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 _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 _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 object;
|
|
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]);
|
|
object = {};
|
|
object.questId = require.id;
|
|
binding = env4_0;
|
|
object.sourceQuestContent = binding(binding2[14]).QuestContent.QUEST_BAR_MOBILE;
|
|
yield value9(object);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
importDefault(env4_7.COLLAPSED);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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 useEnrolledQuestContentProps = QuestBottomSheetModule.useEnrolledQuestContentProps;
|
|
const object = {quest: quest};
|
|
let QUESTS_BAR_MOBILE = QuestsExperimentLocations.QUESTS_BAR_MOBILE;
|
|
object.location = QUESTS_BAR_MOBILE;
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
let QUEST_BAR_MOBILE = QuestContent.QUEST_BAR_MOBILE;
|
|
object.sourceQuestContent = QUEST_BAR_MOBILE;
|
|
const {step, defibrillator, stepActions, handleTaskSelect,
|
|
showMicrophone} = Reflect.apply(useEnrolledQuestContentProps, QuestBottomSheetModule, [object]);
|
|
const jsxRuntimeEnv0_12Binding = jsxRuntimeEnv0_12;
|
|
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 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 = (QuestDockGestureContextModule).QuestDockGestureContext;
|
|
const minExpandedContentHeight = Reflect.apply(useContext, binding,
|
|
[QuestDockGestureContext]).minExpandedContentHeight;
|
|
const bottom = (UseSafeAreaInsetsNative)().bottom;
|
|
const value2 = (YouBarExperimentModule).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 _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 _fun104348() { // fn#104348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13860:3287, offset: 0x0229334a, size: 49 bytes, params: 1, frame: 12
|
|
if (minExpandedContentHeight.get() !== QUEST_DOCK_EXPANDED_HEIGHT) {
|
|
minExpandedContentHeight.set(QUEST_DOCK_EXPANDED_HEIGHT);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun104337, 13663, [5, 31, 27, 13570, 6528, 13572, 33, 4501, 697, 13576, 13573, 8621, 13568, 13595, 6531,
|
|
13592, 13591, 13593, 1585, 5176, 7116,
|
|
2]) /* metro module 13663, dependencies: [5, 31, 27, 13570, 6528, 13572, 33, 4501, 697, 13576, 13573, 8621, 13568, 13595, 6531, 13592, 13591, 13593, 1585, 5176, 7116, 2] */;
|