Files
2026-07-28 01:06:53 +03:00

155 lines
8.5 KiB
TypeScript

/* Metro module 12951; source: stores/PermissionVADStore.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 1379, 4259, 3784, 4294, 4297, 661, 694, 566, 2] */
import ClassCallCheck from '../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import AuthenticationStore from './AuthenticationStore.tsx'; /* Metro dependency 1226 */
import ChannelStore from './ChannelStore.tsx'; /* Metro dependency 1379 */
import PermissionStore from './PermissionStore.tsx'; /* Metro dependency 3784 */
import MediaEngineStore from './MediaEngineStore.tsx'; /* Metro dependency 4259 */
import RTCConnectionStore from './RTCConnectionStore.tsx'; /* Metro dependency 4294 */
import VoiceStateStore from './VoiceStateStore.tsx'; /* Metro dependency 4297 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
function _fun98658(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#98658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:6, offset: 0x021b1b28, size: 491 bytes, params: 8, frame: 21
const RTC_CONNECTION_STATE_986622 = RTC_CONNECTION_STATE_98662;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ConstantsModule;
const env0_13 = value.InputModes;
const env0_14 = value.Permissions;
const Store = (Flux).Store;
_fun98663(Store).displayName = 'PermissionVADStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{RTC_CONNECTION_STATE: RTC_CONNECTION_STATE_986622, MEDIA_ENGINE_SET_AUDIO_ENABLED: RTC_CONNECTION_STATE_986622,
AUDIO_SET_MODE: RTC_CONNECTION_STATE_986622, CHANNEL_UPDATES: RTC_CONNECTION_STATE_986622,
THREAD_UPDATE: RTC_CONNECTION_STATE_986622, GUILD_ROLE_UPDATE: RTC_CONNECTION_STATE_986622,
GUILD_MEMBER_UPDATE: RTC_CONNECTION_STATE_986622, IMPERSONATE_UPDATE: RTC_CONNECTION_STATE_986622,
IMPERSONATE_STOP: RTC_CONNECTION_STATE_986622, VOICE_STATE_UPDATES: function({voiceStates}) {
return voiceStates.some(_fun98669);
}, AUDIO_TOGGLE_SELF_MUTE: AUDIO_TOGGLE_SELF_MUTE_98670, PERMISSION_CLEAR_VAD_WARNING: function() {
env0_16 = true;
}});
(FileImportTrackerModule).fileFinishedImporting('stores/PermissionVADStore.tsx');
exports.default = value;
function _isNativeReflectConstruct_98659() { // fn#98659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:251, offset: 0x021b1d13, 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_98659_isNativeReflectConstruct = function() {
return !!result;
})();
}
function AUDIO_SET_MODE_98662() { // fn#98662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:458, offset: 0x021b1d75, size: 301 bytes, params: 1, frame: 19
var r3;
var r0;
var r2;
var channel;
var voiceStateStoreBinding;
var getVoiceState;
var authenticationStoreBinding;
var value7;
var defaultImport;
const channelId = RTCConnectionStore.getChannelId();
const value3 = true;
if (channelId == null) {
r2 = value3;
} else {
channel = ChannelStore.getChannel(channelId);
voiceStateStoreBinding = VoiceStateStore;
getVoiceState = voiceStateStoreBinding.getVoiceState;
r3 = channel?.getGuildId();
authenticationStoreBinding = AuthenticationStore;
value7 = Reflect.apply(getVoiceState, voiceStateStoreBinding, [r3, authenticationStoreBinding.getId()]);
r0 = MediaEngineStore.getMode() !== InputModes.VOICE_ACTIVITY || channel == null;
r0 = !r0 ? channel.isPrivate() : r0;
r0 = !r0 ? channel.isGuildStageVoice() : r0;
r0 = !r0 ? PermissionStore.can(Permissions.USE_VAD, channel) : r0;
if (!r0) {
r3 = value7 == null || !!value7.suppress;
r3 = !r3 ? value7.requestToSpeakTimestamp != null : r3;
r0 = r3;
}
r2 = r0;
}
const value15 = env0_15 !== r2;
if (value15) {
env0_15 = r2;
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
defaultImport.dispatch({type: 'SET_VAD_PERMISSION', hasPermission: env0_15});
r0 = value3;
} else {
r0 = value15;
}
return r0;
}
function _fun98663(a0) { // fn#98663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:917, offset: 0x021b1ea2, size: 124 bytes, params: 2, frame: 16
const PermissionVADStore2 = PermissionVADStore;
Inherits(PermissionVADStore2, a0);
return CreateClass(PermissionVADStore2, [{key: 'initialize', value: function() {
this.waitFor(AuthenticationStore, ChannelStore, MediaEngineStore, PermissionStore, RTCConnectionStore,
VoiceStateStore);
}}, {key: 'shouldShowWarning', value: value_98666}, {key: 'canUseVoiceActivity', value: value_98667}]);
function PermissionVADStore() { // fn#98664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:929, offset: 0x010992b7, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_2(this, PermissionVADStore);
const value3 = env1_5(PermissionVADStore);
return env1_4(this, _isNativeReflectConstruct_98659() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
function value_98666() { // fn#98666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:1307, offset: 0x021b1f4d, size: 12 bytes, params: 1, frame: 1
return !env1_16;
}
function value_98667() { // fn#98667, offset: 0x00df0e8b, size: 9 bytes, params: 1, frame: 1
return env1_15;
}
}
function VOICE_STATE_UPDATES_98668({voiceStates}) { // fn#98668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:1885, offset: 0x021b1f59, size: 31 bytes, params: 2, frame: 11
return voiceStates.some(_fun98669);
function _fun98669({userId}) { // fn#98669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13141:1950, offset: 0x021b1f78, size: 44 bytes, params: 2, frame: 11
const value = environment.__proto__;
const authenticationStoreBinding = AuthenticationStore;
const getId = authenticationStoreBinding.getId;
return userId === Reflect.apply(getId, authenticationStoreBinding, []) && RTC_CONNECTION_STATE_98662();
}
}
function AUDIO_TOGGLE_SELF_MUTE_98670() { // fn#98670, offset: 0x01d2aab1, size: 15 bytes, params: 1, frame: 2
}
}
global.__d(_fun98658, 12951, [6, 7, 15, 17, 18, 1226, 1379, 4259, 3784, 4294, 4297, 661, 694, 566,
2]) /* metro module 12951, dependencies: [6, 7, 15, 17, 18, 1226, 1379, 4259, 3784, 4294, 4297, 661, 694, 566, 2] */;