349 lines
22 KiB
TypeScript
349 lines
22 KiB
TypeScript
/* Metro module 15386; source: modules/quests/native/QuestActivityUnenrolledModal.tsx; dependencies: [5, 57, 31, 27, 7093, 15385, 6528, 33, 4501, 697, 478, 4048, 3866, 566, 6777, 7116, 9483, 9950, 6531, 1423, 9484, 7120, 5080, 3874, 4572, 5475, 9542, 4573, 1244, 4578, 7974, 5277, 8160, 10183, 10121, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
|
|
import QuestStore from '../QuestStore.tsx'; /* Metro dependency 7093 */
|
|
import Module08160 from '../../../by-id/module-08160.js'; /* Metro dependency 8160 */
|
|
import UnenrolledActivityQuestStore from '../UnenrolledActivityQuestStore.tsx'; /* Metro dependency 15385 */
|
|
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 PlatformUtilsModule from '../../../external/discord_common/js/shared/utils/PlatformUtils.tsx'; /* Metro dependency 478 */
|
|
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as ThemesModule from '../../../design/utils/shared/themes.tsx'; /* Metro dependency 3866 */
|
|
import * as UseA11yRolesNativeModule from '../../../external/discord_common/js/packages/design/hooks/useA11yRolesNative.tsx'; /* Metro dependency 3874 */
|
|
import * as UseThemeModule from '../../../hooks/useTheme.tsx'; /* Metro dependency 4048 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as StackNativeModule from '../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as HeaderActionButtonNativeModule from '../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
|
|
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
|
|
import * as QuestTypesModule from '../QuestTypes.tsx'; /* Metro dependency 6531 */
|
|
import * as UseGetOrFetchApplicationsModule from '../../applications/useGetOrFetchApplications.tsx'; /* Metro dependency 6777 */
|
|
import * as QuestTaskUtilsModule from '../utils/QuestTaskUtils.tsx'; /* Metro dependency 7116 */
|
|
import * as FormCheckboxNativeModule from '../../../design/components/Forms/native/FormCheckbox.native.tsx'; /* Metro dependency 7974 */
|
|
import * as QuestHooksModule from '../hooks/QuestHooks.tsx'; /* Metro dependency 9483 */
|
|
import * as QuestActionCreatorsModule from '../QuestActionCreators.tsx'; /* Metro dependency 9484 */
|
|
import * as QuestCopyHooksModule from '../hooks/QuestCopyHooks.tsx'; /* Metro dependency 9950 */
|
|
import * as ModalNativeModule from '../../../design/components/Modal/native/Modal.native.tsx'; /* Metro dependency 10121 */
|
|
import * as QuestContentImpressionTrackerNativeModule from './QuestContentImpressionTracker.native.tsx'; /* Metro dependency 10183 */
|
|
|
|
function _fun117629(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:6, offset: 0x024bb1c2, size: 339 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_6 = value.Pressable;
|
|
const env0_7 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value.jsx;
|
|
const env0_12 = value.jsxs;
|
|
object = {MAIN: 'main'};
|
|
const env0_14 = (CreateStylesModule).createStyles(_fun117639);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/native/QuestActivityUnenrolledModal.tsx');
|
|
exports.default = QuestActivityUnenrolledModal;
|
|
function QuestActivityUnenrolledModalInner({quest}) { // fn#117630, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:1751, offset: 0x024bb315, size: 1610 bytes, params: 2, frame: 41
|
|
const value2 = (UseThemeModule).useTheme();
|
|
const styles = useStyles(ThemesModule.isThemeDark(value2));
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
const [property, env0_2] = Module00057(ReactModule.useState(Reflect.apply(useStateFromStores, FluxModule,
|
|
[[UnenrolledActivityQuestStore], function() {
|
|
return UnenrolledActivityQuestStore.getState().autoEnroll;
|
|
}])), 2);
|
|
const useGetOrFetchApplication = UseGetOrFetchApplicationsModule.useGetOrFetchApplication;
|
|
const getActivityApplicationId = QuestTaskUtilsModule.getActivityApplicationId;
|
|
const value5 = Reflect.apply(useGetOrFetchApplication, UseGetOrFetchApplicationsModule,
|
|
[Reflect.apply(getActivityApplicationId, QuestTaskUtilsModule, [quest])]);
|
|
const env0_3 = value5;
|
|
const value6 = (QuestHooksModule).useQuestTaskDetails(quest);
|
|
const useQuestsInstructionsToWinReward = QuestCopyHooksModule.useQuestsInstructionsToWinReward;
|
|
object = {quest: quest, taskDetails: value6};
|
|
let QUEST_ACTIVITY_UNENROLLED_MODAL = QuestsExperimentLocations.QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
object.location = QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
QUEST_ACTIVITY_UNENROLLED_MODAL = QuestContent.QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
object.sourceQuestContent = QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
const value7 = Reflect.apply(useQuestsInstructionsToWinReward, QuestCopyHooksModule, [object]);
|
|
const value8 = ReactModule.useMemo(_fun117632, [value5]);
|
|
const value10 = ReactModule.useCallback(env0_3(_fun117634), [quest.id]);
|
|
const {accessibilityRole,
|
|
accessibilityState} = (UseA11yRolesNativeModule).useCheckboxA11yNative({checked: property});
|
|
const Stack = (StackNativeModule).Stack;
|
|
const view = (
|
|
<View style={styles.baseShadow}>
|
|
<View style={styles.imagesContainer}>
|
|
{value8 != null && <View style={styles.appIconContainer}>{((Component) => <Component source={{uri: value8}} style={styles.appIcon} />)(importDefault(5475) /* metro dependency 5475: FastImage */)}</View>}
|
|
<View style={styles.rewardTileContainer}>
|
|
{((Component) => <Component quest={quest} height={87} width={87} style={styles.questRewardTile} />)(importDefault(9542) /* metro dependency 9542: QuestRewardTile */)}
|
|
</View>
|
|
</View>
|
|
</View>
|
|
);
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const IrNgN4 = (IndexNativeModule).t.IrNgN4;
|
|
const text = (
|
|
<Text
|
|
variant="heading-xl/bold"
|
|
color="mobile-text-heading-primary"
|
|
style={{textAlign: 'center'}}
|
|
>
|
|
{Reflect.apply(string, intl, [IrNgN4])}
|
|
</Text>
|
|
);
|
|
const format = intl.format;
|
|
const V3NSJx = (IndexNativeModule).t.V3NSJx;
|
|
const view2 = (
|
|
<View style={styles.content}>
|
|
{view}
|
|
<View style={styles.textContainer}>
|
|
{text}
|
|
<Text
|
|
variant="text-sm/normal"
|
|
color="text-subtle"
|
|
style={{textAlign: 'center'}}
|
|
>
|
|
{Reflect.apply(format, intl, [V3NSJx, {questName: quest.config.messages.questName}])}
|
|
{'\xa0'}
|
|
{value7}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
);
|
|
const Button = (ButtonNativeModule).Button;
|
|
const view3 = (
|
|
<View style={styles.buttonsContainer}>
|
|
<Button
|
|
size="lg"
|
|
text={intl.string((IndexNativeModule).t.l7E81v)}
|
|
onPress={value10}
|
|
/>
|
|
<Button
|
|
size="lg"
|
|
text={intl.string((IndexNativeModule).t.fyT2ol)}
|
|
onPress={onPress_117635}
|
|
variant="secondary"
|
|
/>
|
|
</View>
|
|
);
|
|
const pressableProps = {accessibilityRole: accessibilityRole,
|
|
accessibilityLabel: intl.string((IndexNativeModule).t['931n1T']),
|
|
accessibilityState: accessibilityState, onPress: onPress_117636, style: {'alignSelf': 'center',
|
|
'flexDirection': 'row', 'alignItems': 'center', 'gap': 8}};
|
|
const FormCheckbox = (FormCheckboxNativeModule).FormCheckbox;
|
|
return (
|
|
<Stack
|
|
direction="vertical"
|
|
align="center"
|
|
justify="center"
|
|
style={styles.container}
|
|
>
|
|
{view2}
|
|
<View style={styles.footer}>
|
|
{view3}
|
|
<Pressable {...pressableProps}>
|
|
<FormCheckbox checked={property} />
|
|
<Text variant="text-sm/normal" color="text-subtle">
|
|
{intl.string((IndexNativeModule).t['931n1T'])}
|
|
</Text>
|
|
</Pressable>
|
|
</View>
|
|
</Stack>
|
|
);
|
|
function _fun117632() { // fn#117632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:2270, offset: 0x024bb978, size: 85 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var value3;
|
|
var defaultImport;
|
|
var getApplicationIconURL;
|
|
var binding;
|
|
const value2 = null;
|
|
if (value2 == env0_3) {
|
|
r0 = value2;
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
|
|
getApplicationIconURL = defaultImport.getApplicationIconURL;
|
|
binding = env0_3;
|
|
r0 = Reflect.apply(getApplicationIconURL, defaultImport, [{id: binding.id, icon: binding.icon, size: 87}]);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function* _fun117634() { // fn#117634, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:2374, offset: 0x024bb9d8, size: 194 bytes, params: 1, frame: 20
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_0;
|
|
var binding2 = env2_2;
|
|
var value3 = binding(binding2[20]);
|
|
var enrollInQuest = value3.enrollInQuest;
|
|
var id = require.id;
|
|
var object = {};
|
|
var QuestContent = binding(binding2[18]).QuestContent;
|
|
var QUEST_ACTIVITY_UNENROLLED_MODAL = QuestContent.QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
object.questContent = QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
var QuestContentCTA = binding(binding2[21]).QuestContentCTA;
|
|
var START_QUEST = QuestContentCTA.START_QUEST;
|
|
object.questContentCTA = START_QUEST;
|
|
QuestContent = binding(binding2[18]).QuestContent;
|
|
QUEST_ACTIVITY_UNENROLLED_MODAL = QuestContent.QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
object.sourceQuestContent = QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
yield Reflect.apply(enrollInQuest, value3, [id, object]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env2_1(env2_2[22]).pop();
|
|
}
|
|
}
|
|
|
|
function QuestActivityUnenrolledModalInnerOnPress() { // fn#117635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:3778, owner: QuestActivityUnenrolledModalInner.onPress, offset: 0x024bba9a, size: 76 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
QuestActionCreatorsModule.dismissQuestActivityModal(quest.id);
|
|
(ModalActionCreators).pop();
|
|
}
|
|
|
|
function QuestActivityUnenrolledModalInnerOnPress_117636() { // fn#117636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:3981, owner: QuestActivityUnenrolledModalInner.onPress, offset: 0x024bbae6, size: 59 bytes, params: 1, frame: 13
|
|
const binding = env0_2;
|
|
const value = !env0_1;
|
|
binding(value);
|
|
(QuestActionCreatorsModule).setAutoEnroll(value);
|
|
}
|
|
|
|
}
|
|
|
|
function CloseButton_117637() { // fn#117637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:4284, offset: 0x024bbb21, size: 129 bytes, params: 1, frame: 18
|
|
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
|
|
const headerActionButtonProps = {source: Module08160, onPress: onPress_117638};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
headerActionButtonProps.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq);
|
|
return <HeaderActionButton {...headerActionButtonProps} />;
|
|
function CloseButton_117637OnPress() { // fn#117638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:4369, owner: CloseButton_117637.onPress, offset: 0x024bbba2, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (ModalActionCreators).pop();
|
|
}
|
|
|
|
}
|
|
|
|
function _fun117639(a0) { // fn#117639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:311, offset: 0x024bbbc7, size: 783 bytes, params: 2, frame: 22
|
|
var r12;
|
|
var items2;
|
|
var r3;
|
|
var object;
|
|
const object2 = {};
|
|
const object4 = {flex: 1};
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object4.paddingHorizontal = PX_24;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.paddingVertical = PX_16;
|
|
const PX_48 = (importDefault(697) /* metro dependency 697: native */).space.PX_48;
|
|
object4.paddingBottom = PX_48;
|
|
object2.container = object4;
|
|
object2.content = {marginTop: 'auto'};
|
|
const object8 = {'flexDirection': 'row', 'justifyContent': 'center', 'alignItems': 'center'};
|
|
const PX_32 = (importDefault(697) /* metro dependency 697: native */).space.PX_32;
|
|
object8.marginBottom = PX_32;
|
|
if (PlatformUtilsModule.isIOS()) {
|
|
r3 = a0 ? {'shadowColor': 'rgb(144, 144, 251)', 'shadowOffset': null, 'shadowOpacity': 0.6, 'shadowRadius': 85,
|
|
shadowOffset: {'width': 0, 'height': 0}} : {};
|
|
} else {
|
|
if (a0) {
|
|
object = {'standardDeviation': '85px', 'color': 'rgba(144, 144, 250, 0.41)', 'offsetX': 0, 'offsetY': 0};
|
|
items2 = [{dropShadow: {'standardDeviation': '85px', 'color': 'rgba(144, 144, 251, 0.65)', 'offsetX': 0,
|
|
'offsetY': 0}}, {dropShadow: object}];
|
|
r12 = object;
|
|
} else {
|
|
items2 = [];
|
|
}
|
|
r3 = {filter: items2};
|
|
}
|
|
copyDataProperties(object8, r3, r12);
|
|
object2.imagesContainer = object8;
|
|
const isIOS2 = PlatformUtilsModule.isIOS();
|
|
const object11 = {};
|
|
if (isIOS2) {
|
|
copyDataProperties(object11, a0 ? {'shadowColor': 'rgb(144, 144, 250)', 'shadowOffset': null,
|
|
'shadowOpacity': 0.4,
|
|
'shadowRadius': 85, shadowOffset: {'width': 0, 'height': 16}} : {}, r12);
|
|
}
|
|
object2.baseShadow = object11;
|
|
const object14 = {'borderRadius': null, 'borderWidth': 2.18, 'borderColor': 'rgba(151, 151, 159, 0.24)',
|
|
'borderStyle': 'solid', 'transform': null, 'overflow': 'hidden'};
|
|
object14.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
|
|
object14.transform = [{rotate: '-12.41deg'}];
|
|
object2.appIconContainer = object14;
|
|
const object16 = {'width': 87, 'height': 87};
|
|
object16.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl - 2.18;
|
|
object2.appIcon = object16;
|
|
const object17 = {'borderWidth': 2.18, 'borderColor': 'rgba(151, 151, 159, 0.24)', 'borderRadius': null,
|
|
'borderStyle': 'solid', 'transform': null, 'overflow': 'hidden'};
|
|
object17.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
|
|
object17.transform = [{translateX: -10}, {rotate: '7.81deg'}];
|
|
object2.rewardTileContainer = object17;
|
|
const object18 = {};
|
|
object18.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl - 2.18;
|
|
object2.questRewardTile = object18;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.textContainer = {alignItems: 'center', gap: PX_8};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.buttonsContainer = {'flexDirection': 'column', 'gap': null, 'marginBottom': 20, gap: PX_8};
|
|
object2.footer = {'flexDirection': 'column', 'width': '100%', 'marginTop': 'auto'};
|
|
return object2;
|
|
}
|
|
|
|
function QuestActivityUnenrolledModal({questId}) { // fn#117640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:4548, offset: 0x024bbed6, size: 202 bytes, params: 2, frame: 18
|
|
const useStateFromStores = FluxModule.useStateFromStores;
|
|
let object = [QuestStore];
|
|
if (Reflect.apply(useStateFromStores, FluxModule, [object, function() {
|
|
return QuestStore.getQuest(questId);
|
|
}]) == null) {
|
|
return null;
|
|
}
|
|
object = {};
|
|
const binding = env0_13;
|
|
let MAIN = binding.MAIN;
|
|
object[MAIN] = {headerLeft: CloseButton_117637, headerRight: function() {
|
|
return null;
|
|
}, headerTitle: headerTitle_117643, render: render_117644};
|
|
const Modal = (ModalNativeModule).Modal;
|
|
MAIN = binding.MAIN;
|
|
return <Modal screens={object} initialRouteName={MAIN} />;
|
|
function QuestActivityUnenrolledModalHeaderTitle() { // fn#117643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:4754, owner: QuestActivityUnenrolledModal.headerTitle, offset: 0x024bbfbb, size: 107 bytes, params: 1, frame: 18
|
|
const Text = (TextModule).Text;
|
|
const intl = (IndexNativeModule).intl;
|
|
return (
|
|
<Text variant="redesign/heading-18/bold" color="mobile-text-heading-primary">
|
|
{intl.string((IndexNativeModule).t.l7E81v)}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function QuestActivityUnenrolledModalRender() { // fn#117644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:4904, owner: QuestActivityUnenrolledModal.render, offset: 0x024bc026, size: 125 bytes, params: 1, frame: 17
|
|
const QuestContentImpressionTrackerNative = (QuestContentImpressionTrackerNativeModule).QuestContentImpressionTrackerNative;
|
|
const questContentImpressionTrackerNativeProps = {questOrQuests: quest};
|
|
const QuestContent = (QuestTypesModule).QuestContent;
|
|
let QUEST_ACTIVITY_UNENROLLED_MODAL = QuestContent.QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
questContentImpressionTrackerNativeProps.questContent = QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
QUEST_ACTIVITY_UNENROLLED_MODAL = QuestContent.QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
questContentImpressionTrackerNativeProps.sourceQuestContent = QUEST_ACTIVITY_UNENROLLED_MODAL;
|
|
return (
|
|
<QuestContentImpressionTrackerNative {...questContentImpressionTrackerNativeProps}>
|
|
{children_117645}
|
|
</QuestContentImpressionTrackerNative>
|
|
);
|
|
function renderChildren() { // fn#117645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15583:5121, owner: QuestActivityUnenrolledModal.render.children, offset: 0x024bc0a3, size: 35 bytes, params: 1, frame: 13
|
|
return <QuestActivityUnenrolledModalInner quest={quest} />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117629, 15386, [5, 57, 31, 27, 7093, 15385, 6528, 33, 4501, 697, 478, 4048, 3866, 566, 6777, 7116,
|
|
9483, 9950, 6531, 1423, 9484, 7120, 5080, 3874, 4572, 5475, 9542, 4573, 1244, 4578, 7974, 5277, 8160, 10183,
|
|
10121,
|
|
2]) /* metro module 15386, dependencies: [5, 57, 31, 27, 7093, 15385, 6528, 33, 4501, 697, 478, 4048, 3866, 566, 6777, 7116, 9483, 9950, 6531, 1423, 9484, 7120, 5080, 3874, 4572, 5475, 9542, 4573, 1244, 4578, 7974, 5277, 8160, 10183, 10121, 2] */;
|