441 lines
19 KiB
TypeScript
441 lines
19 KiB
TypeScript
/* Metro module 10340; source: modules/user_profile/native/UserProfileGameFriendActionSheet.tsx; dependencies: [5, 57, 31, 27, 3793, 661, 33, 4501, 697, 8796, 6807, 5312, 1305, 4573, 10341, 6777, 4617, 8783, 3856, 4080, 6805, 6758, 1244, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import RelationshipStore from '../../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
|
|
import NicknameUtils from '../../../utils/NicknameUtils.tsx'; /* Metro dependency 4617 */
|
|
import UseGetOrFetchApplications from '../../applications/useGetOrFetchApplications.tsx'; /* Metro dependency 6777 */
|
|
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as XSmallIconModule from '../../../design/components/Icon/native/redesign/generated/XSmallIcon.tsx'; /* Metro dependency 5312 */
|
|
import * as BottomSheetTitleHeaderNativeModule from '../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
|
|
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
|
|
import * as ActionSheetRowNativeModule from '../../../design/components/Sheet/native/ActionSheetRow.native.tsx'; /* Metro dependency 6807 */
|
|
import * as GameRelationshipStoreHooksModule from '../../game_relationships/GameRelationshipStoreHooks.tsx'; /* Metro dependency 10341 */
|
|
|
|
function _fun80158(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:6, offset: 0x01e6f83b, size: 356 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const env0_6 = value.ActivityIndicator;
|
|
const env0_7 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object2 = {'width': 32, 'height': 32};
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const env0_12 = Reflect.apply(createStyles, value, [{applicationNameWrapper: {'flexDirection': 'row',
|
|
'justifyContent': 'flex-start', 'alignItems': 'center', 'gap': 12}, gameIcon: object2}]);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileGameFriendActionSheet.tsx');
|
|
exports.default = UserProfileGameFriendActionSheet;
|
|
function GameFriendApplicationRow({application, userId, userDisplayName}) { // fn#80159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:418, offset: 0x01e6f99f, size: 395 bytes, params: 2, frame: 27
|
|
var object4;
|
|
const styles = useStyles();
|
|
const value2 = ReactModule.useCallback(_fun80160, [application.id, application.name, userDisplayName, userId]);
|
|
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
|
|
object4 = {};
|
|
const XSmallIcon = (XSmallIconModule).XSmallIcon;
|
|
object4.trailing = <XSmallIcon size="md" color="redesign-button-tertiary-text" />;
|
|
const Icon = (NativeModule).Icon;
|
|
const object = {};
|
|
object.uri = application.getIconURL(32) ?? '';
|
|
const icon = (
|
|
<Icon
|
|
style={styles.gameIcon}
|
|
resizeMode="contain"
|
|
source={object}
|
|
disableColor
|
|
key={application.id}
|
|
/>
|
|
);
|
|
const Text = (TextModule).Text;
|
|
object4.label = (
|
|
<View style={styles.applicationNameWrapper}>
|
|
{icon}
|
|
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
|
|
{application.name}
|
|
</Text>
|
|
</View>
|
|
);
|
|
object4.onPress = value2;
|
|
return <ActionSheetRow {...object4} key={application.id} />;
|
|
function _fun80160() { // fn#80160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:525, offset: 0x01e6fb2a, size: 83 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
value = require(8796) /* metro dependency 8796: UserProfileAlertUtils */;
|
|
const confirmRemoveGameFriend = value.confirmRemoveGameFriend;
|
|
const applicationBinding = application;
|
|
Reflect.apply(confirmRemoveGameFriend, value, [{userDisplayName: userDisplayName, userId: userId,
|
|
applicationId: applicationBinding.id, gameName: applicationBinding.name}]);
|
|
}
|
|
|
|
}
|
|
|
|
function UserProfileGameFriendActionSheet({user, guildId, channelId}) { // fn#80161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:1166, offset: 0x01e6fb7d, size: 847 bytes, params: 2, frame: 32
|
|
var r5;
|
|
var object2;
|
|
var object3;
|
|
const value2 = (GameRelationshipStoreHooksModule).useGameFriendsForUser(user.id);
|
|
let binding = env0_5;
|
|
const value3 = binding.useMemo(_fun80162, [value2]);
|
|
const value4 = (UseGetOrFetchApplications)(value3);
|
|
const env0_3 = (NicknameUtils).useName(guildId, channelId, user);
|
|
binding = env0_5;
|
|
let useState = binding.useState;
|
|
const value5 = Reflect.apply(useState, binding, [_fun80164]);
|
|
binding = env0_4;
|
|
const property = binding(value5, 1)[0];
|
|
var [property2, env0_4] = binding(env0_5.useState(false), 2);
|
|
const binding3 = env0_5;
|
|
useState = binding3.useState;
|
|
const value9 = binding(Reflect.apply(useState, binding3, [false]), 2);
|
|
const property3 = value9[0];
|
|
var env0_5 = value9[1];
|
|
const value11 = env0_5.useCallback(env0_3(_fun80166), [user.id]);
|
|
env0_5.useEffect(_fun80167, [value3]);
|
|
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
|
|
object = {};
|
|
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
|
|
const intl = (IndexNativeModule).intl;
|
|
let string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
object.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl, [t['Uv/eTx']])} />;
|
|
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
|
|
let Group = ActionSheetRow.Group;
|
|
string = intl.string;
|
|
const YpCiMt = (IndexNativeModule).t.YpCiMt;
|
|
const group = (
|
|
<Group title={Reflect.apply(string, intl, [YpCiMt])} hasIcons={false}>
|
|
{value4.map(_fun80168)}
|
|
</Group>
|
|
);
|
|
if (property) {
|
|
Group = ActionSheetRow.Group;
|
|
r5 = (
|
|
<Group title={intl.string(t.GbsGCp)} hasIcons={false}>
|
|
<ActionSheetRow
|
|
label={intl.string(t.LAcY7m)}
|
|
subLabel={intl.string(t.YTvOUx)}
|
|
onPress={value11}
|
|
disabled={property2}
|
|
trailing={property3
|
|
? (
|
|
<ActivityIndicator />
|
|
)
|
|
: null}
|
|
/>
|
|
</Group>
|
|
);
|
|
} else {
|
|
r5 = property;
|
|
}
|
|
return (
|
|
<ActionSheet {...object}>
|
|
{group}
|
|
{r5}
|
|
</ActionSheet>
|
|
);
|
|
function _fun80162() { // fn#80162, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:1296, offset: 0x01e6fecc, size: 28 bytes, params: 1, frame: 11
|
|
return env0_1.map(function(a0) {
|
|
return a0.applicationId;
|
|
});
|
|
}
|
|
|
|
function _fun80164() { // fn#80164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:1392, offset: 0x01e6fee8, size: 121 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
let relationshipStoreBinding = RelationshipStore;
|
|
if (relationshipStoreBinding.isFriend(user.id)) {
|
|
return false;
|
|
}
|
|
relationshipStoreBinding = RelationshipStore;
|
|
if (relationshipStoreBinding.isBlockedOrIgnored(user.id)) {
|
|
return false;
|
|
}
|
|
const relationshipType = RelationshipStore.getRelationshipType(user.id);
|
|
const PENDING_OUTGOING = RelationshipTypes.PENDING_OUTGOING;
|
|
return relationshipType !== PENDING_OUTGOING && relationshipType !== RelationshipTypes.PENDING_INCOMING;
|
|
}
|
|
|
|
function* _fun80166() { // fn#80166, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:1656, offset: 0x01e6ff6c, size: 201 bytes, params: 1, frame: 17
|
|
var value;
|
|
var value2;
|
|
var value3;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var addRelationship;
|
|
var object;
|
|
var id;
|
|
var object2;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var binding3;
|
|
var value8;
|
|
var presentAddedFriendToast;
|
|
var error;
|
|
exceptionLanding35: while (true) {
|
|
value = undefined;
|
|
value2 = false;
|
|
if (value2) {
|
|
return value;
|
|
}
|
|
value = environment.__proto__;
|
|
env1_4(true);
|
|
env1_5(true);
|
|
value3 = environment.__proto__.__proto__;
|
|
reducibleJoin4: while (true) {
|
|
reduciblePort34: while (true) {
|
|
exceptionLanding30: while (true) {
|
|
try {
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
break reducibleJoin4;
|
|
}
|
|
try {
|
|
binding = env1_4;
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
binding(false);
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
break reduciblePort34;
|
|
}
|
|
env1_5(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
property = binding2[17];
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
addRelationship = value4.addRelationship;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
id = require.id;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object.userId = id;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object2.location = 'User Profile Action Sheet';
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object.context = object2;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
value5 = Reflect.apply(addRelationship, value4, [object]);
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
yield value5;
|
|
try {
|
|
try {
|
|
value6 = undefined;
|
|
value7 = false;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
if (value7) {
|
|
env1_5(false);
|
|
return value6;
|
|
}
|
|
try {
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
binding3 = env2_2;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
property = binding3[18];
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
value8 = binding(property);
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
presentAddedFriendToast = value8.presentAddedFriendToast;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
Reflect.apply(presentAddedFriendToast, value8, []);
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
env1_5(false);
|
|
return undefined;
|
|
}
|
|
env1_5(false);
|
|
throw error;
|
|
}
|
|
|
|
function _fun80167() { // fn#80167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:1873, offset: 0x01e70035, size: 57 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (env0_2.length === 0) {
|
|
value = environment.__proto__;
|
|
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
value.hideActionSheet();
|
|
}
|
|
}
|
|
|
|
function _fun80168(a0) { // fn#80168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10526:2160, offset: 0x01e7006e, size: 70 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var object2;
|
|
var id;
|
|
let value = a0 != null;
|
|
if (value) {
|
|
value = environment.__proto__;
|
|
var gameFriendApplicationRowProps = {application: a0, userDisplayName: env0_3};
|
|
id = user.id;
|
|
gameFriendApplicationRowProps.userId = id;
|
|
id = a0.id;
|
|
value = <GameFriendApplicationRow {...gameFriendApplicationRowProps} key={id} />;
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun80158, 10340, [5, 57, 31, 27, 3793, 661, 33, 4501, 697, 8796, 6807, 5312, 1305, 4573, 10341, 6777,
|
|
4617, 8783, 3856, 4080, 6805, 6758, 1244,
|
|
2]) /* metro module 10340, dependencies: [5, 57, 31, 27, 3793, 661, 33, 4501, 697, 8796, 6807, 5312, 1305, 4573, 10341, 6777, 4617, 8783, 3856, 4080, 6805, 6758, 1244, 2] */;
|