Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,177 @@
/* Metro module 11143; source: modules/media/native/AttachmentPreview.tsx; dependencies: [31, 27, 33, 4501, 697, 11144, 11145, 11146, 11147, 11148, 11149, 11150, 11151, 11152, 11153, 11154, 11155, 11156, 11157, 4655, 4573, 477, 5475, 1305, 9783, 9543, 2] */
function _fun85201(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:6, offset: 0x01f66fee, size: 651 bytes, params: 8, frame: 24
const env0_0 = require;
const closure = AttachmentIcon_85202;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_4 = value2.Image;
const env0_5 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object3 = {'flexDirection': 'row', 'alignItems': 'center', 'overflow': 'hidden', 'borderRadius': null,
'height': 75, 'padding': 12, 'flex': 1};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.gap = PX_8;
const env0_8 = Reflect.apply(createStyles, createStylesModule, [{fileInfoAttachmentPreviewFile: object3,
attachmentFileIcon: {'height': 32, 'width': 24}, attachmentFileName: {'paddingRight': 4, 'paddingLeft': 4,
'maxWidth': 136}, videoIcon: {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0,
'alignItems': 'center', 'justifyContent': 'center'}}]);
object = {archive: importDefault(11144) /* metro dependency 11144 */,
acrobat: importDefault(11145) /* metro dependency 11145 */,
ae: importDefault(11146) /* metro dependency 11146 */, ai: importDefault(11147) /* metro dependency 11147 */,
audio: importDefault(11148) /* metro dependency 11148 */,
code: importDefault(11149) /* metro dependency 11149 */,
document: importDefault(11150) /* metro dependency 11150 */,
image: importDefault(11151) /* metro dependency 11151 */,
photoshop: importDefault(11152) /* metro dependency 11152 */,
sketch: importDefault(11153) /* metro dependency 11153 */,
spreadsheet: importDefault(11154) /* metro dependency 11154 */,
unknown: importDefault(11155) /* metro dependency 11155 */,
video: importDefault(11156) /* metro dependency 11156 */,
webcode: importDefault(11157) /* metro dependency 11157 */};
const env0_10 = value.memo(_fun85206);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media/native/AttachmentPreview.tsx');
exports.default = AttachmentPreview;
exports.AttachmentIcon = closure;
}
function AttachmentIcon_85202({fileName}) { // fn#85202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:792, offset: 0x01f67279, size: 90 bytes, params: 2, frame: 17
const styles = useStyles();
return <Image style={styles.attachmentFileIcon} source={env0_3.useMemo(_fun85203, [fileName])} />;
}
function FilenameText({fileName}) { // fn#85204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:996, offset: 0x01f67331, size: 289 bytes, params: 2, frame: 23
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const styles = useStyles();
const regexp = RegExp('(?:\\.([^.]+))?$', '');
const value2 = '';
const value3 = regexp.exec(fileName ?? value2);
return (
<View>
{fileName != null && value2 !== fileName && <Text style={styles.attachmentFileName} ellipsizeMode="middle" lineClamp={1} variant="text-xs/medium" color="mobile-text-heading-primary">{fileName}</Text>}
<Text
style={styles.attachmentFileName}
lineClamp={1}
variant="text-xs/medium"
color="text-muted"
>
{value3 != null && value3[1] != null ? value3[1].toUpperCase() : 'UNKNOWN'}
</Text>
</View>
);
}
function DefaultAttachmentPreview({fileName, maxFileWidth, borderRadius}) { // fn#85205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:1436, offset: 0x01f67452, size: 142 bytes, params: 2, frame: 19
const styles = useStyles();
return (
<View style={[styles.fileInfoAttachmentPreviewFile, {maxWidth: maxFileWidth, borderRadius: borderRadius}]}>
<AttachmentIcon_85202 fileName={fileName} />
<FilenameText fileName={fileName} />
</View>
);
}
function _fun85206({uri, width, height, borderRadius, style, fileName}) { // fn#85206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:1691, offset: 0x01f674e0, size: 423 bytes, params: 2, frame: 22
var r0;
const object3 = {uri: uri, width: width, height: height};
const object4 = {width: width, height: height, borderRadius: borderRadius};
let value = fileName != null;
let r1 = value && fileName !== '' && RegExp('\\.gif$', 'i').test(fileName);
if (r1) {
r0 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && uri.startsWith('ph://');
if (!r0) {
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isAndroid();
r0 = value && uri.startsWith('content://');
}
r1 = r0;
}
const viewProps = {style: [object4, style, {overflow: 'hidden'}]};
if (r1) {
viewProps.children = ((Component) => <Component style={[object4,
style]} source={object3} resizeMode="cover" enableAnimation />)(importDefault(5475) /* metro dependency 5475: FastImage */);
} else {
viewProps.children = ((ThumbnailImage) => <ThumbnailImage style={[object4,
style]} source={object3} localImageSource={object3} />)((require(1305) /* metro dependency 1305: native */).ThumbnailImage);
}
return <View {...viewProps} />;
}
function AttachmentPreview({uri, isImage, isVideo, width, height, maxFileWidth, fileName, borderRadius = importDefault(dependencyMap[4]).radii.sm, showPlayOnVideoPreview, defaultPreview = <DefaultAttachmentPreview fileName={fileName} maxFileWidth={maxFileWidth} borderRadius={borderRadius} />, style}) { // fn#85207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:2322, offset: 0x01f67687, size: 676 bytes, params: 2, frame: 30
var r0;
var moduleValue;
var moduleValue2;
var moduleValue3;
width = width === undefined ? 75 : width;
height = height === undefined ? 75 : height;
showPlayOnVideoPreview = !(showPlayOnVideoPreview === undefined) && showPlayOnVideoPreview;
const styles = useStyles();
if (isImage) {
r0 = ((Component) => <Component uri={uri} width={width} height={height} borderRadius={borderRadius} style={style} fileName={fileName} />)(env0_10);
} else if (isVideo) {
moduleValue = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue.isAndroid()) {
r0 = showPlayOnVideoPreview ? <View style={style}>{((Component) => <Component uri={uri} width={width} height={height} borderRadius={borderRadius} style={style} fileName={fileName} />)(env0_10)}<View style={styles.videoIcon}>{((CirclePlayIcon) => <CirclePlayIcon size="md" color="white" secondaryColor="black" />)((require(9783) /* metro dependency 9783: CirclePlayIcon */).CirclePlayIcon)}</View></View> : ((Component) => <Component uri={uri} width={width} height={height} borderRadius={borderRadius} style={style} fileName={fileName} />)(env0_10);
} else {
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue2.isIOS()) {
if (uri.startsWith('ph://')) {
r0 = showPlayOnVideoPreview ? <View style={style}>{((Component) => <Component uri={uri} width={width} height={height} borderRadius={borderRadius} style={style} fileName={fileName} />)(env0_10)}<View style={styles.videoIcon}>{((CirclePlayIcon) => <CirclePlayIcon size="md" color="white" secondaryColor="black" />)((require(9783) /* metro dependency 9783: CirclePlayIcon */).CirclePlayIcon)}</View></View> : ((Component) => <Component uri={uri} width={width} height={height} borderRadius={borderRadius} style={style} fileName={fileName} />)(env0_10);
} else if (isVideo) {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r0 = moduleValue3.isIOS() ? <View style={style}>{((VideoComponent) => <VideoComponent style={{height: height,
width: width}} source={{uri: uri}} muted paused resizeMode="cover" preventsDisplaySleepDuringVideoPlayback={false} />)((require(9543) /* metro dependency 9543: Video */).VideoComponent)}</View> : defaultPreview;
} else {
r0 = defaultPreview;
}
} else if (isVideo) {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r0 = moduleValue3.isIOS() ? <View style={style}>{((VideoComponent) => <VideoComponent style={{height: height,
width: width}} source={{uri: uri}} muted paused resizeMode="cover" preventsDisplaySleepDuringVideoPlayback={false} />)((require(9543) /* metro dependency 9543: Video */).VideoComponent)}</View> : defaultPreview;
} else {
r0 = defaultPreview;
}
}
} else {
moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue2.isIOS()) {
if (uri.startsWith('ph://')) {
r0 = showPlayOnVideoPreview ? <View style={style}>{((Component) => <Component uri={uri} width={width} height={height} borderRadius={borderRadius} style={style} fileName={fileName} />)(env0_10)}<View style={styles.videoIcon}>{((CirclePlayIcon) => <CirclePlayIcon size="md" color="white" secondaryColor="black" />)((require(9783) /* metro dependency 9783: CirclePlayIcon */).CirclePlayIcon)}</View></View> : ((Component) => <Component uri={uri} width={width} height={height} borderRadius={borderRadius} style={style} fileName={fileName} />)(env0_10);
} else if (isVideo) {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r0 = moduleValue3.isIOS() ? <View style={style}>{((VideoComponent) => <VideoComponent style={{height: height,
width: width}} source={{uri: uri}} muted paused resizeMode="cover" preventsDisplaySleepDuringVideoPlayback={false} />)((require(9543) /* metro dependency 9543: Video */).VideoComponent)}</View> : defaultPreview;
} else {
r0 = defaultPreview;
}
} else if (isVideo) {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
r0 = moduleValue3.isIOS() ? <View style={style}>{((VideoComponent) => <VideoComponent style={{height: height,
width: width}} source={{uri: uri}} muted paused resizeMode="cover" preventsDisplaySleepDuringVideoPlayback={false} />)((require(9543) /* metro dependency 9543: Video */).VideoComponent)}</View> : defaultPreview;
} else {
r0 = defaultPreview;
}
}
return r0;
}
function _fun85203() { // fn#85203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11329:853, offset: 0x01f672d3, size: 94 bytes, params: 1, frame: 16
const value = environment.__proto__;
const fileUtilsModule = require(4655) /* metro dependency 4655: FileUtils */;
return env1_9[fileUtilsModule.classifyFileName(fileName ?? '')] ?? (importDefault(11155) /* metro dependency 11155 */);
}
+45
View File
@@ -0,0 +1,45 @@
/* Metro module 8509; source: modules/media/native/Caption.tsx; dependencies: [27, 661, 33, 4501, 697, 4000, 1305, 2] */
function _fun67450(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67450, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8694:6, offset: 0x01c23282, size: 344 bytes, params: 8, frame: 25
var object4;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(27) /* metro dependency 27 */).View;
const Fonts = (require(661) /* metro dependency 661: Constants */).Fonts;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object4 = {};
const object5 = {};
const PRIMARY_BOLD = Fonts.PRIMARY_BOLD;
object5.fontFamily = PRIMARY_BOLD;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object5.color = WHITE;
object5.fontSize = 12;
object4.captionText = object5;
const object6 = {'backgroundColor': null, 'borderRadius': null, 'paddingHorizontal': 8, 'paddingVertical': 2,
'position': 'absolute', 'right': 6, 'bottom': 6};
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;
object6.backgroundColor = Reflect.apply(hexWithOpacity, colorUtilsModule, [PRIMARY_700, 0.5]);
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
object4.labelContainer = object6;
const env0_4 = Reflect.apply(createStyles, createStylesModule, [object4]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media/native/Caption.tsx');
exports.Caption = Caption;
}
function Caption({label, style, textStyle}) { // fn#67451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8694:524, offset: 0x01c233da, size: 136 bytes, params: 2, frame: 20
const styles = useStyles();
const items2 = [styles.labelContainer, style];
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
return (
<View style={items2}>
<LegacyText style={[styles.captionText, textStyle]}>
{label}
</LegacyText>
</View>
);
}
@@ -0,0 +1,227 @@
/* Metro module 4682; source: modules/media/native/IosImageTypesManager.tsx; dependencies: [57, 6, 7, 15, 17, 18, 27, 3, 4561, 2] */
function _fun40520(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:6, offset: 0x01103903, size: 312 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(57) /* metro dependency 57 */;
const env0_1 = importDefault(6) /* metro dependency 6 */;
const env0_2 = importDefault(7) /* metro dependency 7 */;
const env0_3 = importDefault(15) /* metro dependency 15 */;
const env0_4 = importDefault(17) /* metro dependency 17 */;
const env0_5 = importDefault(18) /* metro dependency 18 */;
const env0_6 = (require(27) /* metro dependency 27 */).NativeModules;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('IosImageTypesManager');
value = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
value = _fun40524(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media/native/IosImageTypesManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_40521() { // fn#40521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:182, offset: 0x01103a3b, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_40521_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun40524(a0) { // fn#40524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:448, offset: 0x01103a99, size: 316 bytes, params: 2, frame: 16
const closure = IosImageTypesManager;
env0_5(closure, a0);
return env0_2(closure, [{key: '_initialize', value: function() {
this.initializeSupportedImageTypes();
}}, {key: '_terminate', value: function() {
}}, {key: 'initializeSupportedImageTypes', value: value_40528}, {key: 'getSupportedImageTypes', value: value_40529},
{key: 'isImageTypeSupported', value: value_40530}, {key: 'getSupportedExtensions', value: value_40531},
{key: 'getSupportedMimeTypes', value: value_40532}, {key: 'getAnimatedExtensions', value: value_40533},
{key: 'isExtensionSupported', value: value_40534}, {key: 'isMimeTypeSupported', value: value_40535},
{key: 'isExtensionAnimated', value: value_40536}]);
}
function IosImageTypesManager() { // fn#40525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:460, offset: 0x01103bd5, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_1(this, IosImageTypesManager);
const value3 = env1_4(IosImageTypesManager);
return env1_3(this, _isNativeReflectConstruct_40521() ? global.Reflect.construct(value3, arguments,
env1_4(this).constructor) : value3.apply(this, arguments));
}
function value_40528() { // fn#40528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:910, offset: 0x01103c59, size: 509 bytes, params: 1, frame: 26
var r12;
var r5;
var MediaManager;
var supportedImageTypes;
var Set;
var prototype;
var value3;
var set;
var value4;
var value5;
var value6;
var value7;
var value8;
var value9;
var Object;
var value10;
var length;
var value11;
var property;
var binding;
var value12;
var extension;
var mimeType;
var value13;
var value14;
var value15;
var value16;
var value17;
var value18;
var error;
var value19;
var value20;
var value21;
var value22;
var value23;
var value24;
if (env1_8 === null) {
try {
MediaManager = NativeModules.MediaManager;
supportedImageTypes = MediaManager.getSupportedImageTypes();
env1_8 = supportedImageTypes;
Set = global.Set;
prototype = Set.prototype;
value3 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value4 = set instanceof Object ? set : value3;
Set = global.Set;
prototype = Set.prototype;
value5 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value6 = set instanceof Object ? set : value5;
Set = global.Set;
prototype = Set.prototype;
value7 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value8 = set instanceof Object ? set : value7;
value9 = 0;
Object = global.Object;
value10 = Object.entries(supportedImageTypes);
length = value10.length;
value11 = value9 < length;
if (value11) {
r12 = value9;
while (true) {
property = value10[r12];
binding = env1_0;
value12 = binding(property, 2);
value12[value9];
property = value12[1];
extension = property.extension;
mimeType = property.mimeType;
value13 = extension != null;
if (!value13) {
r5 = value13;
continue;
}
value14 = extension !== '';
r5 = value14;
if (!r5) {
continue;
}
value4.add(extension);
value15 = mimeType != null;
if (!value15) {
r5 = value15;
continue;
}
value16 = mimeType !== '';
r5 = value16;
if (!r5) {
continue;
}
value6.add(mimeType);
value17 = typeof r12 === 'bigint' ? r12 + 1n : +r12 + 1;
length = value10.length;
value18 = value17 < length;
if (value18) {
r12 = value17;
continue;
}
break;
}
}
value4.add('jpg');
value8.add('gif');
value8.add('webp');
env1_9 = value4;
env1_10 = value6;
env1_11 = value8;
} catch (error) {
binding = env1_7;
binding.warn('Failed to get iOS supported image types:', error);
env1_8 = {};
Set = global.Set;
prototype = Set.prototype;
value19 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value20 = set instanceof Object ? set : value19;
env1_9 = value20;
Set = global.Set;
prototype = Set.prototype;
value21 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value22 = set instanceof Object ? set : value21;
env1_10 = value22;
Set = global.Set;
prototype = Set.prototype;
value23 = Object.create(prototype, {constructor: {value: Set}});
set = new Set();
value24 = set instanceof Object ? set : value23;
env1_11 = value24;
}
}
}
function value_40530(a0) { // fn#40530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:1424, offset: 0x01103e56, size: 29 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_8 !== null && a0 in env1_8;
}
function value_40534(a0) { // fn#40534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:1668, offset: 0x01103e73, size: 35 bytes, params: 2, frame: 12
const value = environment.__proto__;
return env1_9 !== null && env1_9.has(a0);
}
function value_40535(a0) { // fn#40535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:1741, offset: 0x01103e96, size: 35 bytes, params: 2, frame: 12
const value = environment.__proto__;
return env1_10 !== null && env1_10.has(a0);
}
function value_40536(a0) { // fn#40536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4860:1814, offset: 0x01103eb9, size: 35 bytes, params: 2, frame: 12
const value = environment.__proto__;
return env1_11 !== null && env1_11.has(a0);
}
@@ -0,0 +1,750 @@
/* Metro module 13079; source: modules/media/native/MediaPlayerManager.tsx; dependencies: [6, 7, 15, 17, 18, 27, 1378, 7710, 1379, 4814, 3784, 7030, 661, 8044, 13080, 482, 3, 629, 690, 4008, 694, 477, 628, 7067, 10915, 4561, 2] */
function _fun99904(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99904, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6, offset: 0x021d8da4, size: 554 bytes, params: 8, frame: 20
let env0_0 = require;
const closure = function(a0) {
if (a0.duration <= 0) {
return undefined;
}
return a0.duration - a0.time <= PLAYBACK_COMPLETION_DETECTION_TOLERANCE;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
let value = require(27) /* metro dependency 27 */;
const env0_8 = value.NativeEventEmitter;
const env0_9 = value.NativeModules;
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
const voicePanelStore = importDefault(7710) /* metro dependency 7710: VoicePanelStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const appStateStore = importDefault(7030) /* metro dependency 7030: AppStateStore */;
const env0_16 = (require(661) /* metro dependency 661: Constants */).AppStates;
const env0_17 = (require(8044) /* metro dependency 8044: ActivityPanelConstants */).ActivityPanelModes;
value = require(13080) /* metro dependency 13080: MediaPlaybackPanelConstants */;
const env0_18 = value.PLAYBACK_COMPLETION_DETECTION_TOLERANCE;
const env0_19 = value.PLAYBACK_PROGRESS_UPDATE_INTERVAL;
const env0_20 = (require(482) /* metro dependency 482: Constants */).Permissions;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('MediaPlayerManager');
value = require(629) /* metro dependency 629 */;
value = value.create(function(a0) {
var env0_0 = a0;
return {'activeMediaPlayerSource': null, 'mediaSourceMessage': null, 'canAccessMedia': true, 'isPlaying': false,
'wasPipClosedByUser': false, 'progress': null, 'rate': 0, 'showPip': false,
activeMediaPlayerSource: undefined,
mediaSourceMessage: undefined, progress: undefined, closePip: _fun99910,
displayedMediaItemIdsPerChannel: {},
currentlyDisplayedChannelId: undefined};
});
const value6 = new _fun99912(importDefault(4561) /* metro dependency 4561: LifecycleManager */)();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/media/native/MediaPlayerManager.tsx');
exports.default = value6;
exports.useMediaPlayerManagerStore = value;
exports.isPlaybackComplete = closure;
}
function _isNativeReflectConstruct_99905() { // fn#99905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:430, offset: 0x021d8fce, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_99905_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun99909(a0) { // fn#99909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:684, offset: 0x021d905e, size: 69 bytes, params: 2, frame: 4
const env0_0 = a0;
return {'activeMediaPlayerSource': null, 'mediaSourceMessage': null, 'canAccessMedia': true, 'isPlaying': false,
'wasPipClosedByUser': false, 'progress': null, 'rate': 0, 'showPip': false, activeMediaPlayerSource: undefined,
mediaSourceMessage: undefined, progress: undefined, closePip: closePip, displayedMediaItemIdsPerChannel: {},
currentlyDisplayedChannelId: undefined};
}
function _fun99912(a0) { // fn#99912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:1056, offset: 0x021d90eb, size: 478 bytes, params: 2, frame: 16
const closure = MediaPlayerManager;
env0_7(closure, a0);
return env0_4(closure, [{key: '_initialize', value: value_99914}, {key: 'updateMediaPermissions',
value: value_99916}, {key: '_terminate', value: value_99918}, {key: 'pauseCurrentPlayer', value: function() {
var MediaPlayerManager = NativeModules.MediaPlayerManager;
MediaPlayerManager.pauseCurrentPlayer();
}}, {key: 'playCurrentPlayer', value: function() {
var MediaPlayerManager = NativeModules.MediaPlayerManager;
MediaPlayerManager.playCurrentPlayer();
}}, {key: 'userDidClosePip', value: value_99922}, {key: 'pauseAndClosePip', value: value_99924},
{key: 'handleVoicePanelStateUpdated', value: value_99926}, {key: 'handleEmbeddedActivitiesUpdated',
value: function() {
if (EmbeddedActivitiesStore.getActivityPanelMode() === ActivityPanelModes.PIP) {
this.pauseAndClosePip();
}
}}, {key: 'handleMediaPlayerPlaybackRateChanged', value: value_99928},
{key: 'handleMediaPlayerPlaybackProgressUpdated', value: value_99930},
{key: 'handleMediaPlayerPlaybackSourceChanged', value: value_99932}, {key: 'getOrFetchMediaSourceMessage',
value: value_99934}, {key: 'handleMediaSourceMessageUpdated', value: value_99938},
{key: 'handleMediaPlayerViewWillAppear', value: value_99940}, {key: 'handleMediaPlayerViewDidDisappear',
value: value_99942}, {key: 'updateDisplayState', value: value_99945}]);
}
function closePip() { // fn#99910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:842, offset: 0x021d90a3, size: 47 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99911);
}
function MediaPlayerManager() { // fn#99913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:1068, offset: 0x021d92c9, size: 328 bytes, params: 1, frame: 19
let value = environment.__proto__;
env1_3(this, MediaPlayerManager);
const value3 = env1_6(MediaPlayerManager);
value = env1_5(this, _isNativeReflectConstruct_99905() ? global.Reflect.construct(value3, [],
env1_6(this).constructor) : value3.apply(this, undefined));
value.subscriptions = [];
value.voicePanelStoreUnsubscribe = undefined;
value.showPipUnsubscribe = undefined;
value.pauseAndClosePip = value.pauseAndClosePip.bind(value);
value.handleVoicePanelStateUpdated = value.handleVoicePanelStateUpdated.bind(value);
value.handleEmbeddedActivitiesUpdated = value.handleEmbeddedActivitiesUpdated.bind(value);
value.handleMediaPlayerPlaybackRateChanged = value.handleMediaPlayerPlaybackRateChanged.bind(value);
value.handleMediaPlayerPlaybackSourceChanged = value.handleMediaPlayerPlaybackSourceChanged.bind(value);
value.handleMediaPlayerViewWillAppear = value.handleMediaPlayerViewWillAppear.bind(value);
value.handleMediaPlayerViewDidDisappear = value.handleMediaPlayerViewDidDisappear.bind(value);
value.updateDisplayState = value.updateDisplayState.bind(value);
value.updateMediaPermissions = value.updateMediaPermissions.bind(value);
return value;
}
function value_99914() { // fn#99914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:2092, offset: 0x021d9411, size: 484 bytes, params: 1, frame: 17
var binding;
let MediaPlayerManager = NativeModules.MediaPlayerManager;
const nativeEventEmitter = new NativeEventEmitter(MediaPlayerManager);
this.subscriptions = [nativeEventEmitter.addListener('MediaPlayerPlaybackSourceChanged',
this.handleMediaPlayerPlaybackSourceChanged),
nativeEventEmitter.addListener('MediaPlayerPlaybackProgressUpdated',
this.handleMediaPlayerPlaybackProgressUpdated), nativeEventEmitter.addListener('MediaPlayerPlaybackRateChanged',
this.handleMediaPlayerPlaybackRateChanged), nativeEventEmitter.addListener('MediaPlayerViewWillAppear',
this.handleMediaPlayerViewWillAppear), nativeEventEmitter.addListener('MediaPlayerViewDidDisappear',
this.handleMediaPlayerViewDidDisappear)];
MediaPlayerManager = NativeModules.MediaPlayerManager;
MediaPlayerManager.subscribeToPlaybackEvents();
const rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.addListener('state', this.updateDisplayState);
}
let subscribe = VoicePanelStore.subscribe;
this.voicePanelStoreUnsubscribe = Reflect.apply(subscribe, VoicePanelStore, [this.handleVoicePanelStateUpdated]);
EmbeddedActivitiesStore.addChangeListener(this.handleEmbeddedActivitiesUpdated);
ChannelStore.addChangeListener(this.updateMediaPermissions);
PermissionStore.addChangeListener(this.updateMediaPermissions);
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
subscribe = defaultImport.subscribe;
const userDidClosePip = this.userDidClosePip;
Reflect.apply(subscribe, defaultImport, ['LOGOUT', userDidClosePip]);
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isIOS()) {
binding = env1_22;
this.showPipUnsubscribe = binding.subscribe(_fun99915);
}
env1_21.verbose('Initialized and subscribed to playback events');
}
function value_99916() { // fn#99916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:3364, offset: 0x021d968b, size: 54 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99917);
}
function value_99918() { // fn#99918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:3677, offset: 0x021d9777, size: 248 bytes, params: 1, frame: 17
var environment;
this.subscriptions.forEach(function(a0) {
return a0.remove();
});
this.subscriptions = [];
let value = environment.__proto__;
const rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.removeListener('state', this.updateDisplayState);
}
const voicePanelStoreUnsubscribe = this.voicePanelStoreUnsubscribe;
if (voicePanelStoreUnsubscribe != null) {
voicePanelStoreUnsubscribe.call(this);
}
const showPipUnsubscribe = this.showPipUnsubscribe;
if (showPipUnsubscribe != null) {
showPipUnsubscribe.call(this);
}
EmbeddedActivitiesStore.removeChangeListener(this.handleEmbeddedActivitiesUpdated);
ChannelStore.removeChangeListener(this.updateMediaPermissions);
PermissionStore.removeChangeListener(this.updateMediaPermissions);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
const unsubscribe = value.unsubscribe;
const userDidClosePip = this.userDidClosePip;
Reflect.apply(unsubscribe, value, ['LOGOUT', userDidClosePip]);
}
function value_99922() { // fn#99922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:4381, offset: 0x021d98a5, size: 47 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99923);
}
function value_99924() { // fn#99924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:4500, offset: 0x021d98f6, size: 54 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99925);
}
function value_99926() { // fn#99926, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:4659, offset: 0x021d9961, size: 67 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = VoicePanelStore.getState();
if (value.isVoicePanelFullscreen() || value.voicePanelsPIP.size > 0) {
this.pauseAndClosePip();
}
}
function value_99928({source, rate}) { // fn#99928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:4936, offset: 0x021d99d4, size: 76 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99929);
}
function value_99930({source, time, duration}) { // fn#99930, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:5507, offset: 0x021d9b74, size: 78 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99931);
}
function value_99932({source}) { // fn#99932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6010, offset: 0x021d9cf8, size: 66 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99933);
}
function value_99934({channelId, messageId, assetUrl}) { // fn#99934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6503, offset: 0x021d9e4e, size: 190 bytes, params: 2, frame: 18
var environment;
if (messageId != null) {
if (channelId == null) {
return undefined;
}
var value = environment.__proto__;
var message = MessageStore.getMessage(channelId, messageId);
if (message != null) {
return message;
}
if (assetUrl == null) {
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
value = value.fetchMessage({channelId: channelId, messageId: messageId});
value.then(_fun99937);
return undefined;
}
var value5 = MessageStore.getMessages(channelId).toArray().find(function(a0) {
var value = a0.getContentMessage();
return value == null || value.attachments == null ? undefined : value.attachments.some(_fun99936);
});
if (value5 != null) {
return value5;
}
value = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
value = value.fetchMessage({channelId: channelId, messageId: messageId});
value.then(_fun99937);
}
}
function value_99938(a0) { // fn#99938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6962, offset: 0x021d9f7f, size: 54 bytes, params: 2, frame: 12
var environment;
const env0_0 = a0;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99939);
}
function value_99940({mediaItemIds, channelId}) { // fn#99940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:7167, offset: 0x021da00a, size: 76 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99941);
}
function value_99942({mediaItemIds, channelId}) { // fn#99942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:7465, offset: 0x021da0ec, size: 76 bytes, params: 2, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99943);
}
function value_99945() { // fn#99945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:7795, offset: 0x021da1fe, size: 47 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun99946);
}
function _fun99911() { // fn#99911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:870, offset: 0x021d90d2, size: 25 bytes, params: 1, frame: 11
return env1_0({showPip: false});
}
function _fun99915(a0, a1) { // fn#99915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:3086, offset: 0x021d95f5, size: 150 bytes, params: 3, frame: 11
var r0;
var value;
if (a1.showPip) {
if (a0.showPip) {
value = a1.rate !== 0;
r0 = value && a0.rate === 0;
r0 = r0 && !a0.showPip;
if (r0) {
value = environment.__proto__.__proto__;
value = AppStateStore.getState() === AppStates.ACTIVE;
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
NativeModules.MediaPlayerManager.clearNowPlayingInfo();
}
} else {
value = environment.__proto__.__proto__;
NativeModules.MediaPlayerManager.clearNowPlayingInfo();
}
} else {
value = a1.rate !== 0;
r0 = value && a0.rate === 0;
r0 = r0 && !a0.showPip;
if (r0) {
value = environment.__proto__.__proto__;
value = AppStateStore.getState() === AppStates.ACTIVE;
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
NativeModules.MediaPlayerManager.clearNowPlayingInfo();
}
}
}
function _fun99917() { // fn#99917, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:3398, offset: 0x021d96c1, size: 182 bytes, params: 1, frame: 17
let binding = env2_22;
const getState = binding.getState;
const activeMediaPlayerSource = Reflect.apply(getState, binding, []).activeMediaPlayerSource;
const getChannel = ChannelStore.getChannel;
const value2 = null;
const value3 = undefined;
const channelId = value2 == activeMediaPlayerSource ? value3 : activeMediaPlayerSource.channelId;
const value4 = Reflect.apply(getChannel, ChannelStore, [value2 != channelId ? channelId : value2]);
if (value2 == value4) {
env2_22.setState({canAccessMedia: true});
} else if (value4.isPrivate()) {
env2_22.setState({canAccessMedia: true});
} else if (PermissionStore.can(Permissions.VIEW_CHANNEL, value4)) {
env2_22.setState({canAccessMedia: true});
} else {
binding = env2_22;
binding.setState({canAccessMedia: false});
binding = env0_0;
binding.pauseCurrentPlayer();
}
return value3;
}
function _fun99923() { // fn#99923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:4415, offset: 0x021d98d4, size: 34 bytes, params: 1, frame: 11
return env2_22.setState({'wasPipClosedByUser': true, 'showPip': false});
}
function _fun99925() { // fn#99925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:4534, offset: 0x021d992c, size: 53 bytes, params: 1, frame: 11
env0_0.pauseCurrentPlayer();
env2_22.setState({'wasPipClosedByUser': true, 'showPip': false});
}
function _fun99929() { // fn#99929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:4987, offset: 0x021d9a20, size: 340 bytes, params: 1, frame: 21
var value2;
var setState;
if (source == null) {
value2 = environment.__proto__.__proto__;
env2_22.setState({'rate': 0, 'isPlaying': false});
}
let binding = env2_21;
const verbose = binding.verbose;
let rateBinding = rate;
sourceBinding = source;
const value4 = undefined;
Reflect.apply(verbose, binding,
['Playback rate changed to ' + rateBinding + ': ' + (sourceBinding == null ? value4 : source.id)]);
const state = env2_22.getState();
if ((importDefault(628) /* metro dependency 628: shallowEqual */)(state.activeMediaPlayerSource,
source ?? value4)) {
binding = env2_22;
setState = binding.setState;
rateBinding = rate;
Reflect.apply(setState, binding, [{rate: rateBinding, isPlaying: rateBinding !== 0,
wasPipClosedByUser: !(state.isPlaying === false && rate > 0) && state.wasPipClosedByUser}]);
binding = env0_0;
binding.updateDisplayState();
} else {
binding = env0_0;
var handleMediaPlayerPlaybackSourceChanged = binding.handleMediaPlayerPlaybackSourceChanged;
sourceBinding = source;
Reflect.apply(handleMediaPlayerPlaybackSourceChanged, binding, [{source: sourceBinding}]);
binding.handleMediaPlayerPlaybackRateChanged({source: sourceBinding, rate: rate});
}
return value4;
}
function _fun99931() { // fn#99931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:5569, offset: 0x021d9bc2, size: 310 bytes, params: 1, frame: 19
var r4;
var r2;
var currentlyDisplayedChannelId;
var durationBinding;
var object2;
var timeBinding;
var isPlaybackComplete2;
var progress;
let binding = env2_22;
const state = binding.getState();
const value3 = undefined;
if ((importDefault(628) /* metro dependency 628: shallowEqual */)(state.activeMediaPlayerSource,
source ?? value3)) {
currentlyDisplayedChannelId = state.currentlyDisplayedChannelId;
if (state.showPip) {
durationBinding = duration;
if (durationBinding > 0) {
object2 = {};
timeBinding = time;
object2.time = timeBinding;
durationBinding = duration;
object2.duration = durationBinding;
isPlaybackComplete2 = isPlaybackComplete({time: timeBinding, duration: durationBinding});
object2.isCompleted = isPlaybackComplete2 != null && isPlaybackComplete2;
r4 = object2;
} else {
r4 = value3;
}
progress = state.progress;
r2 = progress != null && r4 != null;
r2 = r2 && global.Math.abs(r4.time - progress.time) < PLAYBACK_PROGRESS_UPDATE_INTERVAL;
r2 = r2 && r4.time !== r4.duration;
if (!r2) {
binding = env2_22;
binding.setState({progress: r4});
}
} else if (currentlyDisplayedChannelId != null) {
if (currentlyDisplayedChannelId === (source == null ? value3 : source.channelId)) {
durationBinding = duration;
if (durationBinding > 0) {
object2 = {};
timeBinding = time;
object2.time = timeBinding;
durationBinding = duration;
object2.duration = durationBinding;
isPlaybackComplete2 = isPlaybackComplete({time: timeBinding, duration: durationBinding});
object2.isCompleted = isPlaybackComplete2 != null && isPlaybackComplete2;
r4 = object2;
} else {
r4 = value3;
}
progress = state.progress;
r2 = progress != null && r4 != null;
r2 = r2 && global.Math.abs(r4.time - progress.time) < PLAYBACK_PROGRESS_UPDATE_INTERVAL;
r2 = r2 && r4.time !== r4.duration;
if (!r2) {
binding = env2_22;
binding.setState({progress: r4});
}
}
}
}
return value3;
}
function _fun99933() { // fn#99933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6054, offset: 0x021d9d3a, size: 276 bytes, params: 1, frame: 19
const value = environment.__proto__.__proto__;
let binding = env2_22;
const state = binding.getState();
binding = env2_21;
const verbose = binding.verbose;
const sourceBinding = source;
const value4 = undefined;
Reflect.apply(verbose, binding, ['Playback source changed: ' + (sourceBinding == null ? value4 : source.id)]);
if (!(importDefault(628) /* metro dependency 628: shallowEqual */)(state.activeMediaPlayerSource ?? value4,
source ?? value4)) {
binding = env2_22;
binding.setState({'activeMediaPlayerSource': null, 'mediaSourceMessage': null, 'progress': null, 'rate': 0,
'isPlaying': false, 'wasPipClosedByUser': false, activeMediaPlayerSource: source ?? value4,
mediaSourceMessage: source != null ? env0_0.getOrFetchMediaSourceMessage(source) : value4,
progress: value4});
binding = env0_0;
binding.updateMediaPermissions();
binding.updateDisplayState();
}
return value4;
}
function _fun99935(a0) { // fn#99935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6676, offset: 0x021d9f0c, size: 61 bytes, params: 2, frame: 13
const contentMessage = a0.getContentMessage();
return contentMessage == null || contentMessage.attachments == null ? undefined : contentMessage.attachments.some(function({url}) {
return url === assetUrl;
});
}
function _fun99937(a0) { // fn#99937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6858, offset: 0x021d9f5e, size: 33 bytes, params: 2, frame: 11
if (a0 != null) {
env0_0.handleMediaSourceMessageUpdated(a0);
}
}
function _fun99939() { // fn#99939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:6997, offset: 0x021d9fb5, size: 85 bytes, params: 1, frame: 13
let binding = env2_22;
const getState = binding.getState;
const activeMediaPlayerSource = Reflect.apply(getState, binding, []).activeMediaPlayerSource;
const value2 = undefined;
if ((activeMediaPlayerSource == null ? value2 : activeMediaPlayerSource.messageId) === env0_0.id) {
binding = env2_22;
binding.setState({mediaSourceMessage: env0_0});
}
return value2;
}
function _fun99941() { // fn#99941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:7229, offset: 0x021da056, size: 150 bytes, params: 1, frame: 17
let binding = env2_22;
const getState = binding.getState;
const displayedMediaItemIdsPerChannel = Reflect.apply(getState, binding, []).displayedMediaItemIdsPerChannel;
const r6 = displayedMediaItemIdsPerChannel[channelId] ?? [];
const Set = global.Set;
const items = [];
arraySpread(items, mediaItemIds, arraySpread(items, r6, 0, r6), r6);
const value4 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set(items);
displayedMediaItemIdsPerChannel[channelId] = set instanceof Object ? set : value4;
binding = env2_22;
binding.setState({displayedMediaItemIdsPerChannel: displayedMediaItemIdsPerChannel});
env0_0.updateDisplayState();
}
function _fun99943() { // fn#99943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:7527, offset: 0x021da138, size: 198 bytes, params: 1, frame: 18
var r2;
var set;
let binding = env2_22;
const getState = binding.getState;
const displayedMediaItemIdsPerChannel = Reflect.apply(getState, binding, []).displayedMediaItemIdsPerChannel;
const Set = global.Set;
const property = displayedMediaItemIdsPerChannel[channelId];
if (property != null) {
r2 = property;
} else {
set = new global.Set();
}
const items = [];
arraySpread(items, r2, 0, items);
set = new Set(items.filter(function(a0) {
return !mediaItemIds.includes(a0);
}));
if (set.size === 0) {
delete displayedMediaItemIdsPerChannel[channelId];
} else {
displayedMediaItemIdsPerChannel[channelId] = set;
}
binding = env2_22;
binding.setState({displayedMediaItemIdsPerChannel: displayedMediaItemIdsPerChannel});
env0_0.updateDisplayState();
}
function _fun99946() { // fn#99946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13269:7829, offset: 0x021da22d, size: 384 bytes, params: 1, frame: 22
var r4;
var r2;
var r7;
var r8;
var value3;
var value4;
var moduleValue;
var getFocusedChannelId;
var value5;
var properties;
var properties2;
var properties3;
var propertyName;
var propertyName2;
var setState;
var property;
var has;
let value = environment.__proto__.__proto__;
let binding = env2_22;
const state = binding.getState();
const displayedMediaItemIdsPerChannel = state.displayedMediaItemIdsPerChannel;
const currentlyDisplayedChannelId = state.currentlyDisplayedChannelId;
const activeMediaPlayerSource = state.activeMediaPlayerSource;
reducibleJoin2: while (true) {
if (activeMediaPlayerSource !== undefined) {
r4 = activeMediaPlayerSource;
break reducibleJoin2;
}
r4 = {};
break reducibleJoin2;
}
const id = r4.id;
const wasPipClosedByUser = state.wasPipClosedByUser;
const progress = state.progress;
const isPlaying = state.isPlaying;
if (wasPipClosedByUser) {
env2_22.setState({showPip: false});
} else {
reducibleJoin25: while (true) {
reducibleJoin15: while (true) {
if (isPlaying) {
reducibleJoin9: while (true) {
if (isPlaying) {
r7 = isPlaying;
break reducibleJoin9;
}
value3 = progress != null;
reducibleJoin8: while (true) {
if (value3) {
value4 = !isPlaybackComplete(progress);
r2 = value4;
break reducibleJoin8;
}
r2 = value3;
break reducibleJoin8;
}
r7 = r2;
break reducibleJoin9;
}
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
getFocusedChannelId = moduleValue.getFocusedChannelId;
value5 = Reflect.apply(getFocusedChannelId, moduleValue, []);
if (value5 == null) {
break reducibleJoin15;
}
if (currentlyDisplayedChannelId === value5) {
break reducibleJoin15;
}
properties = Object.keys(displayedMediaItemIdsPerChannel);
properties2 = 0;
properties3 = properties.length;
if (properties === undefined) {
break reducibleJoin15;
}
r8 = properties2;
reducibleLoop12: while (true) {
propertyName = properties[r8];
propertyName2 = r8 + 1;
if (propertyName === undefined) {
break reducibleJoin15;
}
if (propertyName === value5) {
r8 = propertyName2;
continue reducibleLoop12;
}
delete displayedMediaItemIdsPerChannel[propertyName];
r8 = propertyName2;
continue reducibleLoop12;
}
} else {
if (!state.showPip) {
break reducibleJoin25;
}
reducibleJoin9: while (true) {
if (isPlaying) {
r7 = isPlaying;
break reducibleJoin9;
}
value3 = progress != null;
reducibleJoin8: while (true) {
if (value3) {
value4 = !isPlaybackComplete(progress);
r2 = value4;
break reducibleJoin8;
}
r2 = value3;
break reducibleJoin8;
}
r7 = r2;
break reducibleJoin9;
}
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
getFocusedChannelId = moduleValue.getFocusedChannelId;
value5 = Reflect.apply(getFocusedChannelId, moduleValue, []);
if (value5 == null) {
break reducibleJoin15;
}
if (currentlyDisplayedChannelId === value5) {
break reducibleJoin15;
}
properties = Object.keys(displayedMediaItemIdsPerChannel);
properties2 = 0;
properties3 = properties.length;
if (properties === undefined) {
break reducibleJoin15;
}
r8 = properties2;
reducibleLoop12: while (true) {
propertyName = properties[r8];
propertyName2 = r8 + 1;
if (propertyName === undefined) {
break reducibleJoin15;
}
if (propertyName === value5) {
r8 = propertyName2;
continue reducibleLoop12;
}
delete displayedMediaItemIdsPerChannel[propertyName];
r8 = propertyName2;
continue reducibleLoop12;
}
}
}
if (id != null) {
if (value5 != null) {
property = displayedMediaItemIdsPerChannel[value5];
if (property != null) {
binding = env2_22;
setState = binding.setState;
reducibleJoin23: while (true) {
if (r7) {
has = property.has;
value = !Reflect.apply(has, property, [id]);
r7 = value;
break reducibleJoin23;
}
break reducibleJoin23;
}
Reflect.apply(setState, binding, [{showPip: r7, currentlyDisplayedChannelId: value5,
displayedMediaItemIdsPerChannel: displayedMediaItemIdsPerChannel}]);
break reducibleJoin25;
}
binding = env2_22;
setState = binding.setState;
Reflect.apply(setState, binding, [{showPip: r7, currentlyDisplayedChannelId: value5,
displayedMediaItemIdsPerChannel: displayedMediaItemIdsPerChannel}]);
break reducibleJoin25;
}
binding = env2_22;
setState = binding.setState;
Reflect.apply(setState, binding, [{showPip: r7, currentlyDisplayedChannelId: value5,
displayedMediaItemIdsPerChannel: displayedMediaItemIdsPerChannel}]);
break reducibleJoin25;
}
binding = env2_22;
setState = binding.setState;
Reflect.apply(setState, binding, [{showPip: r7, currentlyDisplayedChannelId: value5,
displayedMediaItemIdsPerChannel: displayedMediaItemIdsPerChannel}]);
break reducibleJoin25;
}
}
}