191 lines
10 KiB
TypeScript
191 lines
10 KiB
TypeScript
/* Metro module 10885; source: components_native/TouchableStreamPreview.tsx; dependencies: [31, 27, 4295, 4492, 1226, 1379, 1867, 3784, 4297, 661, 33, 4501, 4000, 697, 4800, 566, 1244, 4796, 8913, 8915, 7712, 4285, 4594, 10886, 4573, 2] */
|
|
function _fun83378(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:6, offset: 0x01f1809d, size: 525 bytes, params: 8, frame: 25
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const StyleSheet = value.StyleSheet;
|
|
const env0_4 = value.View;
|
|
const gameConsoleStore = importDefault(4295) /* metro dependency 4295: GameConsoleStore */;
|
|
const applicationStreamingStore = importDefault(4492) /* metro dependency 4492: ApplicationStreamingStore */;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
|
|
const env0_12 = (require(661) /* metro dependency 661: Constants */).Permissions;
|
|
const env0_13 = (require(33) /* metro dependency 33 */).jsx;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object3 = {touchable: {'borderRadius': 5, 'overflow': 'hidden'}};
|
|
const object4 = {};
|
|
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
|
|
object4['alignItems'] = 'center';
|
|
object4['justifyContent'] = 'center';
|
|
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
|
|
const hexWithOpacity = colorUtilsModule.hexWithOpacity;
|
|
const PRIMARY_700 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_700;
|
|
object4['backgroundColor'] = Reflect.apply(hexWithOpacity, colorUtilsModule, [PRIMARY_700, 0.7]);
|
|
object3.ctaWrapper = object4;
|
|
const PRIMARY_500 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_500;
|
|
object3.ctaBackground = {'height': 40, 'paddingHorizontal': 16, 'borderRadius': 20, 'backgroundColor': null,
|
|
'justifyContent': 'center', 'alignItems': 'center', backgroundColor: PRIMARY_500};
|
|
object3.ctaText = {lineHeight: 20};
|
|
const env0_14 = Reflect.apply(createStyles, value, [object3]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/TouchableStreamPreview.tsx');
|
|
exports.default = VoiceChannelSettingsStreamPreview;
|
|
}
|
|
|
|
function StreamPreviewContainer({style, disableTransition, onPress, stream, channel}) { // fn#83379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:667, offset: 0x01f182aa, size: 809 bytes, params: 2, frame: 29
|
|
var r15;
|
|
var r2;
|
|
var r5;
|
|
var r4;
|
|
var r13;
|
|
var value7;
|
|
var value8;
|
|
var value10;
|
|
var value12;
|
|
const env0_3 = channel;
|
|
const styles = useStyles();
|
|
const channelUtilsModule = require(4800) /* metro dependency 4800: ChannelUtils */;
|
|
const isChannelFull2 = channelUtilsModule.isChannelFull(channel, VoiceStateStore, GuildStore);
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GameConsoleStore], _fun83380);
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], function() {
|
|
var CONNECT = Permissions.CONNECT;
|
|
return !PermissionStore.can(CONNECT, channel);
|
|
});
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([VoiceStateStore], function() {
|
|
return VoiceStateStore.isInChannel(channel.id);
|
|
});
|
|
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ApplicationStreamingStore,
|
|
AuthenticationStore], _fun83383, [channel.id, stream.ownerId]);
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const value6 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7Xq/nV']);
|
|
if (value2) {
|
|
value12 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.gcnYT2);
|
|
r4 = true;
|
|
r13 = value12;
|
|
} else {
|
|
r15 = value4 || value5;
|
|
value7 = false;
|
|
if (r15) {
|
|
r4 = value7;
|
|
r13 = value6;
|
|
} else {
|
|
if (isChannelFull2) {
|
|
value10 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rZfiNq);
|
|
r2 = true;
|
|
r5 = value10;
|
|
} else if (value3) {
|
|
value8 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.TVBCKZ);
|
|
r2 = true;
|
|
r5 = value8;
|
|
} else {
|
|
r2 = value7;
|
|
r5 = value6;
|
|
}
|
|
r4 = r2;
|
|
r13 = r5;
|
|
}
|
|
}
|
|
const value14 = env0_3.useCallback(_fun83384, [stream, disableTransition, onPress]);
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(_fun83385);
|
|
const StreamPreview = importDefault(10886) /* metro dependency 10886: StreamPreview */;
|
|
const items2 = [styles.touchable, style];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<StreamPreview
|
|
stream={stream}
|
|
ctaText={r13}
|
|
style={items2}
|
|
onPress={value14}
|
|
disabled={r4}
|
|
>
|
|
<View style={styles.ctaWrapper}>
|
|
<View style={styles.ctaBackground}>
|
|
<Text
|
|
style={styles.ctaText}
|
|
variant="text-md/semibold"
|
|
color="always-white"
|
|
>
|
|
{r13}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
</StreamPreview>
|
|
);
|
|
}
|
|
|
|
function VoiceChannelSettingsStreamPreview(a0) { // fn#83386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:1891, offset: 0x01f1879d, size: 173 bytes, params: 2, frame: 20
|
|
const env0_0 = a0;
|
|
const streamForUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([ApplicationStreamingStore],
|
|
_fun83387);
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun83388);
|
|
const value3 = null;
|
|
return value3 == streamForUser || value3 == value2 ? value3 : <StreamPreviewContainer {...a0} {...{['stream']: streamForUser}} {...{['channel']: value2}} />;
|
|
}
|
|
|
|
function _fun83380() { // fn#83380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:836, offset: 0x01f185d3, size: 25 bytes, params: 1, frame: 9
|
|
const value = environment.__proto__;
|
|
return GameConsoleStore.getRemoteSessionId() != null;
|
|
}
|
|
|
|
function _fun83383() { // fn#83383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:1030, offset: 0x01f18635, size: 63 bytes, params: 1, frame: 13
|
|
const ownerId = stream.ownerId;
|
|
const getId = AuthenticationStore.getId;
|
|
return ownerId === Reflect.apply(getId, AuthenticationStore,
|
|
[]) && ApplicationStreamingStore.isSelfStreamHidden(channel.id);
|
|
}
|
|
|
|
function _fun83384() { // fn#83384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:1336, offset: 0x01f18674, size: 223 bytes, params: 1, frame: 18
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(4796) /* metro dependency 4796: SelectedChannelActionCreators */;
|
|
const selectVoiceChannel = defaultImport.selectVoiceChannel;
|
|
let streamBinding = stream;
|
|
let channelId = streamBinding.channelId;
|
|
Reflect.apply(selectVoiceChannel, defaultImport, [channelId]);
|
|
(require(8913) /* metro dependency 8913: StreamActionCreators */).watchStream(streamBinding);
|
|
if (disableTransition) {
|
|
(importDefault(7712) /* metro dependency 7712: ChannelRTCActionCreators */).rebuildRTCActiveChannels();
|
|
} else {
|
|
(importDefault(8915) /* metro dependency 8915: transitionToStreamNative */)(stream);
|
|
}
|
|
const defaultImport4 = importDefault(7712) /* metro dependency 7712: ChannelRTCActionCreators */;
|
|
const selectParticipant = defaultImport4.selectParticipant;
|
|
streamBinding = stream;
|
|
channelId = streamBinding.channelId;
|
|
value = require(4285) /* metro dependency 4285: StreamKeyUtils */;
|
|
Reflect.apply(selectParticipant, defaultImport4, [channelId, value.encodeStreamKey(streamBinding)]);
|
|
if (onPress != null) {
|
|
onPress();
|
|
}
|
|
}
|
|
|
|
function _fun83385() { // fn#83385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:1565, offset: 0x01f18753, size: 74 bytes, params: 1, frame: 14
|
|
var value2;
|
|
var moduleValue;
|
|
const channelBinding = channel;
|
|
if (channelBinding.isGuildStageVoice()) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(8913) /* metro dependency 8913: StreamActionCreators */;
|
|
moduleValue.watchStream(stream, {noFocus: true});
|
|
}
|
|
}
|
|
|
|
function _fun83387() { // fn#83387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:1976, offset: 0x01f1884a, size: 38 bytes, params: 1, frame: 13
|
|
const getStreamForUser = ApplicationStreamingStore.getStreamForUser;
|
|
const binding = env0_0;
|
|
const userId = binding.userId;
|
|
return Reflect.apply(getStreamForUser, ApplicationStreamingStore, [userId, binding.guildId]);
|
|
}
|
|
|
|
function _fun83388() { // fn#83388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11071:2056, offset: 0x01f18870, size: 44 bytes, params: 1, frame: 12
|
|
const streamForUserBinding = streamForUser;
|
|
const value2 = null;
|
|
return value2 != streamForUserBinding ? ChannelStore.getChannel(streamForUser.channelId) : value2;
|
|
}
|
|
|