264 lines
18 KiB
TypeScript
264 lines
18 KiB
TypeScript
/* Metro module 10279; source: modules/user_profile/native/UserProfileVoiceSettings.tsx; dependencies: [31, 27, 4613, 4259, 3784, 661, 482, 33, 4501, 8514, 566, 4802, 9293, 10272, 8899, 6815, 1244, 9252, 10280, 10282, 10284, 10286, 9759, 7684, 4573, 8796, 9322, 7972, 4080, 9279, 9275, 2] */
|
|
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
|
|
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import MediaEngineStore from '../../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */
|
|
import SoundboardStore from '../../soundboard/SoundboardStore.tsx'; /* Metro dependency 4613 */
|
|
import UseAudienceRequestToSpeakState from '../../stage_channels/useAudienceRequestToSpeakState.tsx'; /* Metro dependency 4802 */
|
|
import AudioActionCreators from '../../../actions/AudioActionCreators.tsx'; /* Metro dependency 8899 */
|
|
import SecureFramesPlatformUtilsNative from '../../rtc/SecureFramesPlatformUtils.native.tsx'; /* Metro dependency 9279 */
|
|
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 ConstantsModule from '../../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
|
|
import * as ConstantsModule2 from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as UserProfileCardModule from './UserProfileCard.tsx'; /* Metro dependency 6815 */
|
|
import * as UserProfileAnalyticsContextModule from '../UserProfileAnalyticsContext.tsx'; /* Metro dependency 8514 */
|
|
import * as UseIsSecureFramesUIEnabledModule from '../../rtc/hooks/useIsSecureFramesUIEnabled.tsx'; /* Metro dependency 9293 */
|
|
|
|
function _fun79755(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#79755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:6, offset: 0x01e60d73, size: 367 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
ReactModule;
|
|
const env0_11 = (CreateStylesModule).createStyles({card: {paddingBottom: 0},
|
|
cardTitle: {marginBottom: 0}, volumeSlider: {paddingVertical: 20},
|
|
disableVideoSublabel: {'flexDirection': 'row', 'alignItems': 'center', 'gap': 4}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileVoiceSettings.tsx');
|
|
exports.default = UserProfileVoiceSettings;
|
|
function UserVoiceSettings({user, channel, style}) { // fn#79756, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:404, offset: 0x01e60ee2, size: 1543 bytes, params: 2, frame: 35
|
|
var r2;
|
|
var r0;
|
|
var push;
|
|
const UserProfileFormRow = (require(6815) /* metro dependency 6815: UserProfileCard */).UserProfileFormRow;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var object;
|
|
var items2;
|
|
var UserProfileCard;
|
|
const styles = useStyles();
|
|
const useUserProfileAnalyticsContext = UserProfileAnalyticsContextModule.useUserProfileAnalyticsContext;
|
|
const env0_2 = Reflect.apply(useUserProfileAnalyticsContext, UserProfileAnalyticsContextModule,
|
|
[]).trackUserProfileAction;
|
|
const {localVolume, isLocalMute, isLocalVideoDisabled, isLocalVideoAutoDisabled,
|
|
supportsDisableLocalVideo} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([MediaEngineStore],
|
|
_fun79757);
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun79758);
|
|
const value4 = (UseAudienceRequestToSpeakState)(user.id,
|
|
channel.id);
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SoundboardStore], function() {
|
|
return SoundboardStore.isLocalSoundboardMuted(user.id);
|
|
});
|
|
const value6 = (UseIsSecureFramesUIEnabledModule).useIsSecureFramesUIEnabled({channelId: channel.id});
|
|
items3 = [
|
|
((Component) => <Component style={styles.volumeSlider} value={localVolume} onValueChange={function(a0) {
|
|
trackUserProfileAction({action: 'SET_VOLUME'});
|
|
importDefault(dependencyMap[14]).setLocalVolume(user.id, a0);
|
|
}} key="set-volume" />)(importDefault(10272) /* metro dependency 10272: VolumeSlider */),
|
|
];
|
|
if (!(value3 ? channel.isGuildStageVoice() && value4 !== (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates.ON_STAGE : !value3)) {
|
|
push = items3.push;
|
|
string = intl.string;
|
|
Reflect.apply(push, items3, [<UserProfileFormRow label={isLocalMute ? Reflect.apply(string, intl,
|
|
[t.NHJxcg]) : Reflect.apply(string, intl,
|
|
[t.sWmtI6])} icon={isLocalMute ? (require(9252) /* metro dependency 9252: MicrophoneSlashIcon */).MicrophoneSlashIcon : (require(10280) /* metro dependency 10280: MicrophoneIcon */).MicrophoneIcon} onPress={function() {
|
|
trackUserProfileAction({action: 'MUTE'});
|
|
importDefault(dependencyMap[14]).toggleLocalMute(user.id);
|
|
}} key="mute" />]);
|
|
}
|
|
push = items3.push;
|
|
string = intl.string;
|
|
Reflect.apply(push, items3, [<UserProfileFormRow label={value5 ? Reflect.apply(string, intl,
|
|
[t['639hQT']]) : Reflect.apply(string, intl,
|
|
[t.LxhEuG])} icon={value5 ? (require(10282) /* metro dependency 10282: SoundboardSlashIcon */).SoundboardSlashIcon : (require(10284) /* metro dependency 10284: SoundboardIcon */).SoundboardIcon} onPress={function() {
|
|
trackUserProfileAction({action: 'MUTE_SOUNDBOARD'});
|
|
importDefault(dependencyMap[14]).toggleLocalSoundboardMute(user.id);
|
|
}} key="mute-soundboard" />]);
|
|
if (supportsDisableLocalVideo) {
|
|
push = items3.push;
|
|
object = {};
|
|
string = intl.string;
|
|
object.label = isLocalVideoDisabled ? Reflect.apply(string, intl, [t['xc+Psz']]) : Reflect.apply(string, intl,
|
|
[t['4MMsWF']]);
|
|
object.icon = isLocalVideoDisabled ? (require(10286) /* metro dependency 10286: VideoSlashIcon */).VideoSlashIcon : (require(9759) /* metro dependency 9759: VideoIcon */).VideoIcon;
|
|
if (isLocalVideoAutoDisabled) {
|
|
var viewBindingProps = {style: styles.disableVideoSublabel};
|
|
const CircleErrorIcon = (require(7684) /* metro dependency 7684: CircleErrorIcon */).CircleErrorIcon;
|
|
items2 = [
|
|
<CircleErrorIcon size="xxs" color="text-feedback-warning" />,
|
|
];
|
|
items2[1] = ((Text) => <Text variant="text-xs/medium" color="text-feedback-warning">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.m2Hyj0)}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
|
|
r2 = (
|
|
<View {...viewBindingProps}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
} else {
|
|
r2 = isLocalVideoAutoDisabled;
|
|
}
|
|
object.sublabel = r2;
|
|
object.onPress = onPress_79763;
|
|
Reflect.apply(push, items3, [<UserProfileFormRow {...object} key="disable-video" />]);
|
|
}
|
|
if (value6) {
|
|
items3.push(<UserProfileFormRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8ErYvY'])} icon={(require(9322) /* metro dependency 9322: ShieldLockIcon */).ShieldLockIcon} hint={(require(7972) /* metro dependency 7972: native */).FormArrow} onPress={function() {
|
|
trackUserProfileAction({action: 'VIEW_SECURE_FRAMES_VERIFICATION_CODE'});
|
|
importDefault(dependencyMap[28]).hideActionSheet();
|
|
importDefault(dependencyMap[29]).openSecureFramesUserVerificationModal(user.id, channel.id, _fun79766);
|
|
}} key="view-secure-frames-verification-code" />);
|
|
}
|
|
if (items3.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
UserProfileCard = importDefault(6815) /* metro dependency 6815: UserProfileCard */;
|
|
r0 = (
|
|
<UserProfileCard
|
|
style={[styles.card, style]}
|
|
title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.NiTd0e)}
|
|
titleStyle={styles.cardTitle}
|
|
>
|
|
{((UserProfileCardRows) => <UserProfileCardRows>{items3}</UserProfileCardRows>)((require(6815) /* metro dependency 6815: UserProfileCard */).UserProfileCardRows)}
|
|
</UserProfileCard>
|
|
);
|
|
}
|
|
return r0;
|
|
function _fun79757() { // fn#79757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:576, offset: 0x01e614e9, size: 133 bytes, params: 1, frame: 14
|
|
const object = {};
|
|
let mediaEngineStoreBinding = MediaEngineStore;
|
|
const getLocalVolume = mediaEngineStoreBinding.getLocalVolume;
|
|
const userBinding = user;
|
|
object.localVolume = Reflect.apply(getLocalVolume, mediaEngineStoreBinding, [userBinding.id]);
|
|
mediaEngineStoreBinding = MediaEngineStore;
|
|
object.isLocalMute = mediaEngineStoreBinding.isLocalMute(userBinding.id);
|
|
mediaEngineStoreBinding = MediaEngineStore;
|
|
object.isLocalVideoDisabled = mediaEngineStoreBinding.isLocalVideoDisabled(userBinding.id);
|
|
mediaEngineStoreBinding = MediaEngineStore;
|
|
object.isLocalVideoAutoDisabled = mediaEngineStoreBinding.isLocalVideoAutoDisabled(userBinding.id);
|
|
object.supportsDisableLocalVideo = MediaEngineStore.supportsDisableLocalVideo();
|
|
return object;
|
|
}
|
|
|
|
function _fun79758() { // fn#79758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:968, offset: 0x01e6156e, size: 55 bytes, params: 1, frame: 14
|
|
return channel.isPrivate() || PermissionStore.can(Permissions.SPEAK, channel);
|
|
}
|
|
|
|
function UserVoiceSettingsOnPress_79763() { // fn#79763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:2370, owner: UserVoiceSettings.onPress, offset: 0x01e6169c, size: 144 bytes, params: 1, frame: 17
|
|
var defaultImport;
|
|
trackUserProfileAction({action: 'DISABLE_VIDEO'});
|
|
if (isLocalVideoAutoDisabled) {
|
|
(require(8796) /* metro dependency 8796: UserProfileAlertUtils */).confirmVideoUnstableConnection(function() {
|
|
return importDefault(dependencyMap[14]).setDisableLocalVideo(user.id, VideoToggleState.MANUAL_ENABLED);
|
|
});
|
|
} else {
|
|
defaultImport = importDefault(8899) /* metro dependency 8899: AudioActionCreators */;
|
|
defaultImport.setDisableLocalVideo(user.id,
|
|
isLocalVideoDisabled ? VideoToggleState.MANUAL_ENABLED : VideoToggleState.DISABLED);
|
|
}
|
|
}
|
|
|
|
function UserVoiceSettingsOnPress_79765() { // fn#79765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:2742, owner: UserVoiceSettings.onPress, offset: 0x01e61769, size: 113 bytes, params: 1, frame: 16
|
|
trackUserProfileAction({action: 'VIEW_SECURE_FRAMES_VERIFICATION_CODE'});
|
|
(ActionSheetActionCreators).hideActionSheet();
|
|
const defaultImport2 = SecureFramesPlatformUtilsNative;
|
|
defaultImport2.openSecureFramesUserVerificationModal(user.id, channel.id, _fun79766);
|
|
function _fun79766() { // fn#79766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:2883, offset: 0x01e617da, size: 78 bytes, params: 1, frame: 13
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(9275) /* metro dependency 9275: SecureFramesUtils */;
|
|
const validateSecureFramesKeyConsistent = value.validateSecureFramesKeyConsistent;
|
|
const channelBinding = channel;
|
|
return Reflect.apply(validateSecureFramesKeyConsistent, value, [{userId: user.id, channelId: channelBinding.id,
|
|
guildId: channelBinding.guild_id}]);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function CurrentUserVoiceSettings({user, channel, style}) { // fn#79767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:3196, offset: 0x01e61828, size: 574 bytes, params: 2, frame: 29
|
|
var r0;
|
|
var defaultImport2;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
const UserProfileCardRows = (UserProfileCardModule).UserProfileCardRows;
|
|
const UserProfileFormRow = (UserProfileCardModule).UserProfileFormRow;
|
|
const styles = useStyles();
|
|
const useUserProfileAnalyticsContext = UserProfileAnalyticsContextModule.useUserProfileAnalyticsContext;
|
|
const env0_1 = Reflect.apply(useUserProfileAnalyticsContext, UserProfileAnalyticsContextModule,
|
|
[]).trackUserProfileAction;
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([MediaEngineStore], function() {
|
|
return MediaEngineStore.isSelfMute();
|
|
});
|
|
if ((require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun79769)) {
|
|
if (channel.isGuildStageVoice()) {
|
|
if ((importDefault(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */)(user.id,
|
|
channel.id) !== (require(4802) /* metro dependency 4802: useAudienceRequestToSpeakState */).RequestToSpeakStates.ON_STAGE) {
|
|
r0 = null;
|
|
} else {
|
|
defaultImport2 = importDefault(6815) /* metro dependency 6815: UserProfileCard */;
|
|
var defaultImport2Props2 = {style: [styles.card, style], title: intl.string(t.NiTd0e),
|
|
titleStyle: styles.cardTitle};
|
|
string = intl.string;
|
|
r0 = ((Component) => <Component {...defaultImport2Props2}><UserProfileCardRows><UserProfileFormRow label={value2 ? Reflect.apply(string,
|
|
|
|
|
|
|
|
intl, [t.NHJxcg]) : Reflect.apply(string, intl,
|
|
[t.sWmtI6])} icon={value2 ? (require(9252) /* metro dependency 9252: MicrophoneSlashIcon */).MicrophoneSlashIcon : (require(10280) /* metro dependency 10280: MicrophoneIcon */).MicrophoneIcon} onPress={onPress_79770} key="mute" /></UserProfileCardRows></Component>)(defaultImport2);
|
|
}
|
|
} else {
|
|
defaultImport2 = importDefault(6815) /* metro dependency 6815: UserProfileCard */;
|
|
var defaultImport2Props2 = {style: [styles.card, style], title: intl.string(t.NiTd0e),
|
|
titleStyle: styles.cardTitle};
|
|
string = intl.string;
|
|
r0 = ((Component) => <Component {...defaultImport2Props2}><UserProfileCardRows><UserProfileFormRow label={value2 ? Reflect.apply(string,
|
|
|
|
|
|
intl, [t.NHJxcg]) : Reflect.apply(string, intl,
|
|
[t.sWmtI6])} icon={value2 ? (require(9252) /* metro dependency 9252: MicrophoneSlashIcon */).MicrophoneSlashIcon : (require(10280) /* metro dependency 10280: MicrophoneIcon */).MicrophoneIcon} onPress={onPress_79770} key="mute" /></UserProfileCardRows></Component>)(defaultImport2);
|
|
}
|
|
} else {
|
|
r0 = null;
|
|
}
|
|
return r0;
|
|
function _fun79769() { // fn#79769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:3425, offset: 0x01e61a79, size: 55 bytes, params: 1, frame: 14
|
|
return channel.isPrivate() || PermissionStore.can(Permissions.SPEAK, channel);
|
|
}
|
|
|
|
function CurrentUserVoiceSettingsOnPress() { // fn#79770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:3901, owner: CurrentUserVoiceSettings.onPress, offset: 0x01e61ab0, size: 59 bytes, params: 1, frame: 12
|
|
trackUserProfileAction({action: 'MUTE'});
|
|
const value = environment.__proto__;
|
|
(AudioActionCreators).toggleSelfMute();
|
|
}
|
|
|
|
}
|
|
|
|
function UserProfileVoiceSettings({user, currentUser, channel, style}) { // fn#79771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10465:4066, offset: 0x01e61aeb, size: 108 bytes, params: 2, frame: 16
|
|
return (
|
|
user.id === currentUser.id
|
|
? (
|
|
<CurrentUserVoiceSettings
|
|
user={currentUser}
|
|
channel={channel}
|
|
style={style}
|
|
/>
|
|
)
|
|
: (
|
|
<UserVoiceSettings
|
|
user={user}
|
|
channel={channel}
|
|
style={style}
|
|
/>
|
|
)
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun79755, 10279, [31, 27, 4613, 4259, 3784, 661, 482, 33, 4501, 8514, 566, 4802, 9293, 10272, 8899,
|
|
6815, 1244, 9252, 10280, 10282, 10284, 10286, 9759, 7684, 4573, 8796, 9322, 7972, 4080, 9279, 9275,
|
|
2]) /* metro module 10279, dependencies: [31, 27, 4613, 4259, 3784, 661, 482, 33, 4501, 8514, 566, 4802, 9293, 10272, 8899, 6815, 1244, 9252, 10280, 10282, 10284, 10286, 9759, 7684, 4573, 8796, 9322, 7972, 4080, 9279, 9275, 2] */;
|