391 lines
15 KiB
TypeScript
391 lines
15 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] */
|
|
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});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_6 = value.ActivityIndicator;
|
|
const env0_7 = value.View;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const env0_9 = (require(661) /* metro dependency 661: Constants */).RelationshipTypes;
|
|
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 object = {'width': 32, 'height': 32};
|
|
object.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: object}]);
|
|
(require(2) /* metro dependency 2 */).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 object3;
|
|
const styles = useStyles();
|
|
const value2 = env0_5.useCallback(_fun80160, [application.id, application.name, userDisplayName, userId]);
|
|
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
|
|
object3 = {};
|
|
const XSmallIcon = (require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon;
|
|
object3.trailing = <XSmallIcon size="md" color="redesign-button-tertiary-text" />;
|
|
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
|
|
const object2 = {};
|
|
object2.uri = application.getIconURL(32) ?? '';
|
|
const icon = <Icon style={styles.gameIcon} resizeMode="contain" source={object2} disableColor key={application.id} />;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
object3.label = <View style={styles.applicationNameWrapper}>{icon}<Text variant="text-md/semibold" color="mobile-text-heading-primary">{application.name}</Text></View>;
|
|
object3.onPress = value2;
|
|
return <ActionSheetRow {...object3} key={application.id} />;
|
|
}
|
|
|
|
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 object2;
|
|
var r5;
|
|
var object4;
|
|
var object5;
|
|
const value2 = (require(10341) /* metro dependency 10341: GameRelationshipStoreHooks */).useGameFriendsForUser(user.id);
|
|
let binding = env0_5;
|
|
const value3 = binding.useMemo(_fun80162, [value2]);
|
|
const value4 = (importDefault(6777) /* metro dependency 6777: useGetOrFetchApplications */)(value3);
|
|
const env0_3 = (importDefault(4617) /* metro dependency 4617: 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 = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
|
|
object2 = {};
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
object2.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl, [t['Uv/eTx']])} />;
|
|
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
|
|
let Group = ActionSheetRow.Group;
|
|
string = intl.string;
|
|
const YpCiMt = (require(1244) /* metro dependency 1244: indexNative */).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 {...object2}>
|
|
{group}
|
|
{r5}
|
|
</ActionSheet>
|
|
);
|
|
}
|
|
|
|
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 _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__;
|
|
if (RelationshipStore.isFriend(user.id)) {
|
|
return false;
|
|
}
|
|
if (RelationshipStore.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 object3;
|
|
var id;
|
|
var object4;
|
|
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 {
|
|
object3 = {};
|
|
} 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 {
|
|
object3.userId = id;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object4 = {};
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object4.location = 'User Profile Action Sheet';
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
object3.context = object4;
|
|
} catch (error) {
|
|
break exceptionLanding30;
|
|
}
|
|
} catch (error) {
|
|
break exceptionLanding35;
|
|
}
|
|
try {
|
|
try {
|
|
value5 = Reflect.apply(addRelationship, value4, [object3]);
|
|
} 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 object;
|
|
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;
|
|
}
|
|
|