This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,133 +1,141 @@
/* Metro module 13084; source: modules/soundboard/BaseSoundboardManager.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 4259, 694, 4561, 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 AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import MediaEngineStore from '../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */
import LifecycleManager from '../../lib/LifecycleManager.tsx'; /* Metro dependency 4561 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun99966(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:6, offset: 0x021dabe4, size: 238 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
let value = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
let value = LifecycleManager;
value = _fun99970(value);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/BaseSoundboardManager.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/BaseSoundboardManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_99967() { // fn#99967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:168, offset: 0x021dacd2, 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_99967_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun99970(a0) { // fn#99970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:367, offset: 0x021dad34, size: 97 bytes, params: 2, frame: 16
const closure = BaseSoundboardManager;
env0_6(closure, a0);
return env0_3(closure, [{key: '_initialize', value: value_99978}, {key: '_terminate', value: value_99979}]);
}
function BaseSoundboardManager(a0) { // fn#99971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:379, offset: 0x021dad95, size: 210 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_2;
binding(this, BaseSoundboardManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_5(BaseSoundboardManager);
binding = env1_4;
if (_isNativeReflectConstruct_99967()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_5(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value._playSound = function() {
};
value._stopAndClearSounds = function() {
};
value._handleToggleSelfDeafened = _handleToggleSelfDeafened;
value._handleSoundboardSoundReceived = _handleSoundboardSoundReceived;
value._handleSoundboardSoundPlayLocally = _handleSoundboardSoundPlayLocally;
value._handleVoiceChannelSelect = _handleVoiceChannelSelect;
return value;
}
function value_99978() { // fn#99978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:1157, offset: 0x021daf40, size: 147 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('VOICE_CHANNEL_EFFECT_SEND', this._handleSoundboardSoundReceived);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('GUILD_SOUNDBOARD_SOUND_PLAY_LOCALLY', this._handleSoundboardSoundPlayLocally);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('VOICE_CHANNEL_SELECT', this._handleVoiceChannelSelect);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('AUDIO_TOGGLE_SELF_DEAF', this._handleToggleSelfDeafened);
}
function value_99979() { // fn#99979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:1521, offset: 0x021dafd3, size: 147 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('VOICE_CHANNEL_EFFECT_SEND', this._handleSoundboardSoundReceived);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('GUILD_SOUNDBOARD_SOUND_PLAY_LOCALLY', this._handleSoundboardSoundPlayLocally);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('VOICE_CHANNEL_SELECT', this._handleVoiceChannelSelect);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('AUDIO_TOGGLE_SELF_DEAF', this._handleToggleSelfDeafened);
}
function _handleToggleSelfDeafened() { // fn#99974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:708, owner: BaseSoundboardManager._handleToggleSelfDeafened, offset: 0x021dae67, size: 41 bytes, params: 1, frame: 9
if (MediaEngineStore.isDeaf()) {
env0_0._stopAndClearSounds();
}
}
function _handleSoundboardSoundReceived({soundId, soundVolume, userId, channelId}) { // fn#99975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:783, owner: BaseSoundboardManager._handleSoundboardSoundReceived, offset: 0x021dae90, size: 90 bytes, params: 2, frame: 17
if (soundId != null) {
var getId = AuthenticationStore.getId;
if (userId !== Reflect.apply(getId, AuthenticationStore, [])) {
return env0_0._playSound(soundId, soundVolume, userId, channelId);
function _isNativeReflectConstruct_99967() { // fn#99967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:168, offset: 0x021dacd2, 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_99967_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun99970(a0) { // fn#99970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:367, offset: 0x021dad34, size: 97 bytes, params: 2, frame: 16
const BaseSoundboardManager2 = BaseSoundboardManager;
Inherits(BaseSoundboardManager2, a0);
return CreateClass(BaseSoundboardManager2, [{key: '_initialize', value: value_99978}, {key: '_terminate',
value: value_99979}]);
function BaseSoundboardManager(a0) { // fn#99971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:379, offset: 0x021dad95, size: 210 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_2;
binding(this, BaseSoundboardManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_5(BaseSoundboardManager);
binding = env1_4;
if (_isNativeReflectConstruct_99967()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_5(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value._playSound = function() {
};
value._stopAndClearSounds = function() {
};
value._handleToggleSelfDeafened = _handleToggleSelfDeafened;
value._handleSoundboardSoundReceived = _handleSoundboardSoundReceived;
value._handleSoundboardSoundPlayLocally = _handleSoundboardSoundPlayLocally;
value._handleVoiceChannelSelect = _handleVoiceChannelSelect;
return value;
function _handleToggleSelfDeafened() { // fn#99974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:708, owner: BaseSoundboardManager._handleToggleSelfDeafened, offset: 0x021dae67, size: 41 bytes, params: 1, frame: 9
const mediaEngineStoreBinding = MediaEngineStore;
if (mediaEngineStoreBinding.isDeaf()) {
env0_0._stopAndClearSounds();
}
}
function _handleSoundboardSoundReceived({soundId, soundVolume, userId, channelId}) { // fn#99975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:783, owner: BaseSoundboardManager._handleSoundboardSoundReceived, offset: 0x021dae90, size: 90 bytes, params: 2, frame: 17
if (soundId != null) {
var authenticationStoreBinding = AuthenticationStore;
var getId = authenticationStoreBinding.getId;
if (userId !== Reflect.apply(getId, authenticationStoreBinding, [])) {
return env0_0._playSound(soundId, soundVolume, userId, channelId);
}
}
}
function _handleSoundboardSoundPlayLocally({sound, channelId}) { // fn#99976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:926, owner: BaseSoundboardManager._handleSoundboardSoundPlayLocally, offset: 0x021daeea, size: 65 bytes, params: 2, frame: 17
let value = environment.__proto__.__proto__;
value = AuthenticationStore.getId();
const binding = env0_0;
return binding._playSound(sound.soundId, sound.volume, value, channelId);
}
function _handleVoiceChannelSelect() { // fn#99977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:1041, owner: BaseSoundboardManager._handleVoiceChannelSelect, offset: 0x021daf2b, size: 21 bytes, params: 1, frame: 9
env0_0._stopAndClearSounds();
}
}
function value_99978() { // fn#99978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:1157, offset: 0x021daf40, size: 147 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('VOICE_CHANNEL_EFFECT_SEND', this._handleSoundboardSoundReceived);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('GUILD_SOUNDBOARD_SOUND_PLAY_LOCALLY', this._handleSoundboardSoundPlayLocally);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('VOICE_CHANNEL_SELECT', this._handleVoiceChannelSelect);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.subscribe('AUDIO_TOGGLE_SELF_DEAF', this._handleToggleSelfDeafened);
}
function value_99979() { // fn#99979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:1521, offset: 0x021dafd3, size: 147 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('VOICE_CHANNEL_EFFECT_SEND', this._handleSoundboardSoundReceived);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('GUILD_SOUNDBOARD_SOUND_PLAY_LOCALLY', this._handleSoundboardSoundPlayLocally);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('VOICE_CHANNEL_SELECT', this._handleVoiceChannelSelect);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('AUDIO_TOGGLE_SELF_DEAF', this._handleToggleSelfDeafened);
}
}
}
function _handleSoundboardSoundPlayLocally({sound, channelId}) { // fn#99976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:926, owner: BaseSoundboardManager._handleSoundboardSoundPlayLocally, offset: 0x021daeea, size: 65 bytes, params: 2, frame: 17
let value = environment.__proto__.__proto__;
value = AuthenticationStore.getId();
const binding = env0_0;
return binding._playSound(sound.soundId, sound.volume, value, channelId);
}
function _handleVoiceChannelSelect() { // fn#99977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13274:1041, owner: BaseSoundboardManager._handleVoiceChannelSelect, offset: 0x021daf2b, size: 21 bytes, params: 1, frame: 9
env0_0._stopAndClearSounds();
}
global.__d(_fun99966, 13084, [6, 7, 15, 17, 18, 1226, 4259, 694, 4561,
2]) /* metro module 13084, dependencies: [6, 7, 15, 17, 18, 1226, 4259, 694, 4561, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,23 +1,24 @@
/* Metro module 4614; source: modules/soundboard/SoundboardConstants.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun39635(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4792:6, offset: 0x010e7089, size: 288 bytes, params: 8, frame: 17
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {SUCCESS: 0};
object2[0] = 'SUCCESS';
object2.INTERRUPTED = 1;
object2[1] = 'INTERRUPTED';
object = {SUCCESS: 0};
object[0] = 'SUCCESS';
object.INTERRUPTED = 1;
object[1] = 'INTERRUPTED';
const Set = global.Set;
const SUCCESS = object2.SUCCESS;
const INTERRUPTED = object2.INTERRUPTED;
const SUCCESS = object.SUCCESS;
const INTERRUPTED = object.INTERRUPTED;
const set = new Set([SUCCESS, INTERRUPTED]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/SoundboardConstants.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/SoundboardConstants.tsx');
exports.MAX_LENGTH_SOUND_NAME = 32;
exports.MAX_SOUND_FILE_SIZE_KILO_BYTES = 512;
exports.MAX_SOUND_FILE_SIZE_BYTES = 524288;
exports.MAX_SOUND_LENGTH_SECONDS = 5;
exports.DEFAULT_SOUND_GUILD_ID = '0';
exports.SoundboardPlaybackStatus = object2;
exports.SoundboardPlaybackStatus = object;
exports.SUCCESSFUL_SOUNDBOARD_PLAYBACKS = set;
exports.SoundboardWheelSize = {'width': 424, 'height': 424, 'padding': 100};
exports.DEFAULT_KEYBIND = 'ctrl+`';
@@ -25,3 +26,4 @@ function _fun39635(global, require, importDefault, importAll, module, exports, d
exports.CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID = '0';
}
global.__d(_fun39635, 4614, [2]) /* metro module 4614, dependencies: [2] */;
File diff suppressed because it is too large. Load diff
+48 -46
View File
@@ -1,38 +1,39 @@
/* Metro module 6639; source: modules/soundboard/SoundboardTypes.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun52540(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6817:6, offset: 0x0132fc0e, size: 439 bytes, params: 8, frame: 25
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {NONE: 0};
object2[0] = 'NONE';
object2.PLAY = 1;
object2[1] = 'PLAY';
object2.ADD = 2;
object2[2] = 'ADD';
object2.SOUNDMOJI = 3;
object2[3] = 'SOUNDMOJI';
const object3 = {FAVORITES: 0};
object3[0] = 'FAVORITES';
object3.GUILD = 1;
object3[1] = 'GUILD';
object3.DEFAULTS = 2;
object3[2] = 'DEFAULTS';
object3.SEARCH = 3;
object3[3] = 'SEARCH';
const object4 = {SOUND: 0};
object4[0] = 'SOUND';
object4.ADD_SOUND = 1;
object4[1] = 'ADD_SOUND';
const object8 = {GIFT_CODE: 0};
object8[0] = 'GIFT_CODE';
object8.SOUNDBOARD = 1;
object8[1] = 'SOUNDBOARD';
object8.JOINED_VOICE_CHANNEL = 2;
object8[2] = 'JOINED_VOICE_CHANNEL';
object8.SOUNDMOJI = 3;
object8[3] = 'SOUNDMOJI';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/SoundboardTypes.tsx');
exports.SoundButtonOverlay = object2;
object = {NONE: 0};
object[0] = 'NONE';
object.PLAY = 1;
object[1] = 'PLAY';
object.ADD = 2;
object[2] = 'ADD';
object.SOUNDMOJI = 3;
object[3] = 'SOUNDMOJI';
const object5 = {FAVORITES: 0};
object5[0] = 'FAVORITES';
object5.GUILD = 1;
object5[1] = 'GUILD';
object5.DEFAULTS = 2;
object5[2] = 'DEFAULTS';
object5.SEARCH = 3;
object5[3] = 'SEARCH';
const object6 = {SOUND: 0};
object6[0] = 'SOUND';
object6.ADD_SOUND = 1;
object6[1] = 'ADD_SOUND';
const object7 = {GIFT_CODE: 0};
object7[0] = 'GIFT_CODE';
object7.SOUNDBOARD = 1;
object7[1] = 'SOUNDBOARD';
object7.JOINED_VOICE_CHANNEL = 2;
object7[2] = 'JOINED_VOICE_CHANNEL';
object7.SOUNDMOJI = 3;
object7[3] = 'SOUNDMOJI';
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/SoundboardTypes.tsx');
exports.SoundButtonOverlay = object;
exports.AnalyticsSoundType = {ENTRY: 'entry_sound', EXIT: 'exit_sound', DEFAULT: 'default'};
exports.AnalyticsChangeType = {ADDED: 'added', UPDATED: 'updated', REMOVED: 'removed'};
exports.AnalyticsSoundSource = {DEFAULT: 'default', CUSTOM: 'custom'};
@@ -56,9 +57,9 @@ function _fun52540(global, require, importDefault, importAll, module, exports, d
object2['user_id'] = userId;
return object2;
};
exports.SoundboardSoundGridSectionType = object3;
exports.SoundboardSoundItemType = object4;
exports.LocalSoundTrigger = object8;
exports.SoundboardSoundGridSectionType = object5;
exports.SoundboardSoundItemType = object6;
exports.LocalSoundTrigger = object7;
}
function soundboardSoundFromAPI(a0, a1) { // fn#52541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6817:1018, offset: 0x0132fdc5, size: 148 bytes, params: 3, frame: 19
@@ -67,17 +68,18 @@ function soundboardSoundFromAPI(a0, a1) { // fn#52541, source: /ci/build/discord
const emoji_name = a0.emoji_name;
const user_id = a0.user_id;
const available = a0.available;
const object3 = {'sound_id': 0, 'emoji_id': 0, 'emoji_name': 0, 'user_id': 0, 'available': 0};
silentSetPrototypeOf(object3, null, undefined);
const value = copyDataProperties({}, a0, object3, a0);
const object4 = {};
copyDataProperties(object4, value, object3);
object4['soundId'] = sound_id;
object4['guildId'] = a1;
object4['emojiId'] = emoji_id;
object4['emojiName'] = emoji_name;
object4['userId'] = user_id;
object4['available'] = available == null || available;
return object4;
const object = {'sound_id': 0, 'emoji_id': 0, 'emoji_name': 0, 'user_id': 0, 'available': 0};
silentSetPrototypeOf(object, null, undefined);
const value = copyDataProperties({}, a0, object, a0);
const object2 = {};
copyDataProperties(object2, value, object);
object2['soundId'] = sound_id;
object2['guildId'] = a1;
object2['emojiId'] = emoji_id;
object2['emojiName'] = emoji_name;
object2['userId'] = user_id;
object2['available'] = available == null || available;
return object2;
}
global.__d(_fun52540, 6639, [2]) /* metro module 6639, dependencies: [2] */;
+212 -203
View File
@@ -1,4 +1,21 @@
/* Metro module 6951; source: modules/soundboard/SoundboardUtils.tsx; dependencies: [5, 1348, 1383, 3784, 1878, 4613, 4614, 661, 1346, 3829, 3802, 6952, 6944, 6639, 6953, 6980, 6981, 6982, 632, 3995, 1365, 1362, 683, 4863, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import UserSettingsProtoStore from '../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import SoundboardStore from './SoundboardStore.tsx'; /* Metro dependency 4613 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ExpressionPickerConstantsModule from '../expression_picker/ExpressionPickerConstants.tsx'; /* Metro dependency 1346 */
import * as UserSettingsProtoActionCreatorsModule from '../user_settings/UserSettingsProtoActionCreators.tsx'; /* Metro dependency 1362 */
import * as ChannelRecordModule from '../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
import * as UserSettingsModule from '../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
import * as SoundboardConstantsModule from './SoundboardConstants.tsx'; /* Metro dependency 4614 */
import * as SoundboardTypesModule from './SoundboardTypes.tsx'; /* Metro dependency 6639 */
import * as SoundboardActionCreatorsModule from './SoundboardActionCreators.tsx'; /* Metro dependency 6944 */
import * as UseMuteStatesModule from '../video_calls/useMuteStates.tsx'; /* Metro dependency 6952 */
import * as VoiceChannelEffectsActionCreatorsModule from '../voice_channel_effects/VoiceChannelEffectsActionCreators.tsx'; /* Metro dependency 6953 */
function _fun55284(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:6, offset: 0x0137a8b2, size: 459 bytes, params: 8, frame: 23
const env0_0 = require;
const closure = function(a0, a1) {
@@ -9,31 +26,24 @@ function _fun55284(global, require, importDefault, importAll, module, exports, d
r0 = !r0 ? a0.guildId === (a1 == null ? value : a1.guild_id) : r0;
return r0;
};
const closure2 = canUseSoundboardSound;
const closure3 = canMakeSound;
const closure4 = hasSetAnyCustomJoinSound;
const canUseSoundboardSound2 = canUseSoundboardSound;
const canMakeSound2 = canMakeSound;
const hasSetAnyCustomJoinSound2 = hasSetAnyCustomJoinSound;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
const env0_5 = (require(1383) /* metro dependency 1383: ChannelRecord */).SILENT_JOIN_LEAVE_CHANNEL_TYPES;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
let value = require(4614) /* metro dependency 4614: SoundboardConstants */;
let value = SoundboardConstantsModule;
const env0_9 = value.CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID;
const env0_10 = value.DEFAULT_SOUND_GUILD_ID;
value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.Permissions;
const env0_12 = value.AnalyticEvents;
const env0_13 = (require(1346) /* metro dependency 1346: ExpressionPickerConstants */).ExpressionPickerViewType;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/SoundboardUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/SoundboardUtils.tsx');
exports.getAmplitudinalSoundboardVolume = getAmplitudinalSoundboardVolume;
exports.hasPermissionToPlaySound = closure;
exports.canUseSoundboardSound = closure2;
exports.canMakeSound = closure3;
exports.canUseSoundboardSound = canUseSoundboardSound2;
exports.canMakeSound = canMakeSound2;
exports.playSound = playSound;
exports.hasSetAnyCustomJoinSound = closure4;
exports.hasSetAnyCustomJoinSound = hasSetAnyCustomJoinSound2;
exports.maybePlayCustomJoinSound = function() {
return _maybePlayCustomJoinSound.apply(this, arguments);
};
@@ -53,208 +63,207 @@ function _fun55284(global, require, importDefault, importAll, module, exports, d
expression_name: sound.name,
expression_guild_id: sound.guildId});
};
}
function canUseSoundboardSound(a0, a1, a2) { // fn#55286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:511, offset: 0x0137aae6, size: 131 bytes, params: 4, frame: 18
const value = a3;
const value2 = undefined;
const r1 = !(value !== value2) || value;
let r0 = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseSoundboardEverywhere(a0) || a1.guildId === (a2 == null ? value2 : a2.guild_id);
r0 = (!r0 ? a1.guildId === DEFAULT_SOUND_GUILD_ID : r0) && hasPermissionToPlaySound(a1,
a2) && (r1 ? a1.available : !r1);
return r0;
}
function canUseSoundboardSound(a0, a1, a2) { // fn#55286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:511, offset: 0x0137aae6, size: 131 bytes, params: 4, frame: 18
const value = a3;
const value2 = undefined;
const r1 = !(value !== value2) || value;
let r0 = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseSoundboardEverywhere(a0) || a1.guildId === (a2 == null ? value2 : a2.guild_id);
r0 = (!r0 ? a1.guildId === DEFAULT_SOUND_GUILD_ID : r0) && hasPermissionToPlaySound(a1,
a2) && (r1 ? a1.available : !r1);
return r0;
}
function canMakeSound(a0) { // fn#55287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:707, offset: 0x0137ab69, size: 68 bytes, params: 2, frame: 12
let value = UseMuteStatesModule;
value = value.getMuteStates({channel: a0});
return !value.mute && !value.suppress;
}
function canMakeSound(a0) { // fn#55287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:707, offset: 0x0137ab69, size: 68 bytes, params: 2, frame: 12
let value = require(6952) /* metro dependency 6952: useMuteStates */;
value = value.getMuteStates({channel: a0});
return !value.mute && !value.suppress;
}
function hasSetAnyCustomJoinSound() { // fn#55288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:809, offset: 0x0137abad, size: 80 bytes, params: 1, frame: 12
let guilds = UserSettingsProtoStore.settings.guilds;
guilds = guilds?.guilds;
const r2 = guilds ?? ({});
const Object = global.Object;
return Object.values(r2).some(function(a0) {
return a0.joinSound != null;
});
}
function hasSetAnyCustomJoinSound() { // fn#55288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:809, offset: 0x0137abad, size: 80 bytes, params: 1, frame: 12
let guilds = UserSettingsProtoStore.settings.guilds;
guilds = guilds?.guilds;
const r2 = guilds ?? ({});
const Object = global.Object;
return Object.values(r2).some(function(a0) {
return a0.joinSound != null;
});
}
function _maybePlayCustomJoinSound() { // fn#55290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:967, offset: 0x0137ac0e, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun55292).apply(this, arguments);
}
function trackCustomCallSettingsChanged({guildId, changeType, soundType, soundSource, location}) { // fn#55293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:1660, offset: 0x0137ae09, size: 130 bytes, params: 2, frame: 20
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const USER_CUSTOM_CALL_SOUND_SETTING_UPDATED = AnalyticEvents.USER_CUSTOM_CALL_SOUND_SETTING_UPDATED;
const object2 = {location_stack: location};
object2.guild_id = guildId === '' ? 0 : global.Number(guildId);
object2.change_type = changeType;
object2.sound_type = soundType;
object2.sound_source = soundSource;
Reflect.apply(track, defaultImport, [USER_CUSTOM_CALL_SOUND_SETTING_UPDATED, object2]);
}
function getAmplitudinalSoundboardVolume() { // fn#55294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:2016, offset: 0x0137ae8b, size: 71 bytes, params: 1, frame: 12
const value = undefined;
const SoundboardSettings = (require(3829) /* metro dependency 3829: UserSettings */).SoundboardSettings;
const setting = SoundboardSettings.getSetting();
return (setting == null ? value : setting.volume) ?? 100;
}
function playSound(a0, a1, a2, a3) { // fn#55295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:2293, offset: 0x0137aed2, size: 109 bytes, params: 5, frame: 20
const value = require(6944) /* metro dependency 6944: SoundboardActionCreators */;
const playSoundLocally = value.playSoundLocally;
const LocalSoundTrigger = (require(6639) /* metro dependency 6639: SoundboardTypes */).LocalSoundTrigger;
const SOUNDBOARD = LocalSoundTrigger.SOUNDBOARD;
Reflect.apply(playSoundLocally, value, [a1, a0, SOUNDBOARD]);
(require(6953) /* metro dependency 6953: VoiceChannelEffectsActionCreators */).sendVoiceChannelSoundboardEffect(a1,
a0, false, a2, a3);
}
function useSoundBoardDismissContentTypes({isSoundboardButtonDisabled}) { // fn#55297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:2651, offset: 0x0137af3f, size: 201 bytes, params: 2, frame: 17
isSoundboardButtonDisabled = !(isSoundboardButtonDisabled === undefined) && isSoundboardButtonDisabled;
const currentUser = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
function() {
return UserStore.getCurrentUser();
});
items2 = [];
if (!isSoundboardButtonDisabled) {
if (!hasSetAnyCustomJoinSound()) {
if ((importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseCustomCallSounds(currentUser) || (require(3995) /* metro dependency 3995: UserUtils */).ageEligibleForPremiumUpsell(currentUser)) {
items2.push((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.CUSTOM_CALL_SOUNDS_PICKER_UPSELL);
function _maybePlayCustomJoinSound() { // fn#55290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:967, offset: 0x0137ac0e, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun55292).apply(this, arguments);
function* _fun55292(a0) { // fn#55292, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:1040, offset: 0x0137ac47, size: 450 bytes, params: 2, frame: 23
var r10;
var r3;
var value10;
var value11;
var value14;
var id;
var binding3;
if (false) {
return undefined;
}
}
}
return items2;
}
function removeCustomJoinSound(a0, a1) { // fn#55299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3023, offset: 0x0137b01a, size: 82 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const value = require(1362) /* metro dependency 1362: UserSettingsProtoActionCreators */;
const updateUserGuildSettings = value.updateUserGuildSettings;
const UserSettingsDelay = (require(1362) /* metro dependency 1362: UserSettingsProtoActionCreators */).UserSettingsDelay;
const INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
Reflect.apply(updateUserGuildSettings, value, [a0, _fun55300, INFREQUENT_USER_ACTION]);
}
function updateCustomJoinSound(a0, a1, a2) { // fn#55301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3343, offset: 0x0137b0d9, size: 89 bytes, params: 4, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const value = require(1362) /* metro dependency 1362: UserSettingsProtoActionCreators */;
const updateUserGuildSettings = value.updateUserGuildSettings;
const UserSettingsDelay = (require(1362) /* metro dependency 1362: UserSettingsProtoActionCreators */).UserSettingsDelay;
const INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
Reflect.apply(updateUserGuildSettings, value, [a0, _fun55302, INFREQUENT_USER_ACTION]);
}
function* _fun55292(a0) { // fn#55292, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:1040, offset: 0x0137ac47, size: 450 bytes, params: 2, frame: 23
var r10;
var r3;
var value10;
var value11;
var value14;
var id;
var binding3;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_7;
const currentUser = binding.getCurrentUser();
binding = env2_1;
const binding2 = env2_2;
const value4 = undefined;
const value5 = binding(binding2[15])();
const customJoinSound = env2_0(binding2[16]).getCustomJoinSound(a0);
const value8 = null;
if (value8 != value5) {
binding = env2_5;
if (binding.has(value5.type)) {
return value4;
}
if (value8 == customJoinSound) {
return value4;
}
var value9 = env2_1(env2_2[10]);
if (value9.canUseCustomCallSounds(currentUser)) {
binding = env2_0;
value10 = binding(env2_2[17]);
if (value10.canSelectedVoiceChannelUseSoundboard()) {
binding = env2_0;
value11 = binding(env2_2[12]);
yield value11.maybeFetchSoundboardSounds();
if (false) {
return undefined;
}
r10 = customJoinSound.guildId === env2_9 ? env2_10 : customJoinSound.guildId;
binding = env2_8;
value14 = binding.getSound(r10, customJoinSound.soundId);
if (value8 == value14) {
value = environment.__proto__.__proto__;
let binding = env2_7;
const currentUser = binding.getCurrentUser();
binding = env2_1;
const binding2 = env2_2;
const value4 = undefined;
const value5 = binding(binding2[15])();
const customJoinSound = env2_0(binding2[16]).getCustomJoinSound(a0);
const value8 = null;
if (value8 != value5) {
binding = env2_5;
if (binding.has(value5.type)) {
return value4;
}
if (env2_14(value14, value5)) {
if (env2_15(currentUser, value14, value5, true)) {
if (env2_16(value5)) {
id = value5.id;
binding = env2_0;
binding3 = env2_2;
value = binding(binding3[12]);
value.playSoundLocally(id, value14,
binding(binding3[13]).LocalSoundTrigger.JOINED_VOICE_CHANNEL);
value = binding(binding3[14]);
value.sendVoiceChannelCustomCallSoundEffect(id, value14, false);
r3 = value4;
if (value8 == customJoinSound) {
return value4;
}
var value9 = env2_1(env2_2[10]);
if (value9.canUseCustomCallSounds(currentUser)) {
binding = env2_0;
value10 = binding(env2_2[17]);
if (value10.canSelectedVoiceChannelUseSoundboard()) {
binding = env2_0;
value11 = binding(env2_2[12]);
yield value11.maybeFetchSoundboardSounds();
if (false) {
return undefined;
}
r10 = customJoinSound.guildId === env2_9 ? env2_10 : customJoinSound.guildId;
binding = env2_8;
value14 = binding.getSound(r10, customJoinSound.soundId);
if (value8 == value14) {
return value4;
}
if (env2_14(value14, value5)) {
if (env2_15(currentUser, value14, value5, true)) {
if (env2_16(value5)) {
id = value5.id;
binding = env2_0;
binding3 = env2_2;
value = binding(binding3[12]);
value.playSoundLocally(id, value14,
binding(binding3[13]).LocalSoundTrigger.JOINED_VOICE_CHANNEL);
value = binding(binding3[14]);
value.sendVoiceChannelCustomCallSoundEffect(id, value14, false);
r3 = value4;
} else {
r3 = value8;
}
} else {
r3 = value8;
}
} else {
r3 = value8;
}
} else {
r3 = value8;
return r3;
}
} else {
r3 = value8;
return value4;
}
return r3;
}
return value4;
}
}
return value4;
}
function _fun55300(a0) { // fn#55300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3095, offset: 0x0137b06c, size: 109 bytes, params: 2, frame: 16
a0.joinSound = undefined;
const trackCustomCallSettingsChangedBinding = trackCustomCallSettingsChanged;
const object2 = {};
object2.guildId = env0_0;
const AnalyticsChangeType = (require(6639) /* metro dependency 6639: SoundboardTypes */).AnalyticsChangeType;
const REMOVED = AnalyticsChangeType.REMOVED;
object2.changeType = REMOVED;
const AnalyticsSoundType = (require(6639) /* metro dependency 6639: SoundboardTypes */).AnalyticsSoundType;
const ENTRY = AnalyticsSoundType.ENTRY;
object2.soundType = ENTRY;
object2.location = require;
trackCustomCallSettingsChangedBinding(object2);
}
function _fun55302(a0) { // fn#55302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3417, offset: 0x0137b132, size: 261 bytes, params: 2, frame: 18
var object2;
const AnalyticsChangeType = (require(6639) /* metro dependency 6639: SoundboardTypes */).AnalyticsChangeType;
const value3 = require.guildId === DEFAULT_SOUND_GUILD_ID;
const AnalyticsSoundSource = (require(6639) /* metro dependency 6639: SoundboardTypes */).AnalyticsSoundSource;
const r5 = value3 ? AnalyticsSoundSource.DEFAULT : AnalyticsSoundSource.CUSTOM;
const r7 = a0.joinSound != null ? AnalyticsChangeType.UPDATED : AnalyticsChangeType.ADDED;
a0.joinSound = {soundId: require.soundId, guildId: value3 ? CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID : require.guildId};
const trackCustomCallSettingsChangedBinding = trackCustomCallSettingsChanged;
object2 = {guildId: env0_0, changeType: r7, soundSource: r5};
const AnalyticsSoundType = (require(6639) /* metro dependency 6639: SoundboardTypes */).AnalyticsSoundType;
const ENTRY = AnalyticsSoundType.ENTRY;
object2.soundType = ENTRY;
object2.location = importDefault;
trackCustomCallSettingsChangedBinding(object2);
function trackCustomCallSettingsChanged({guildId, changeType, soundType, soundSource, location}) { // fn#55293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:1660, offset: 0x0137ae09, size: 130 bytes, params: 2, frame: 20
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const USER_CUSTOM_CALL_SOUND_SETTING_UPDATED = AnalyticEvents.USER_CUSTOM_CALL_SOUND_SETTING_UPDATED;
const object = {location_stack: location};
object.guild_id = guildId === '' ? 0 : global.Number(guildId);
object.change_type = changeType;
object.sound_type = soundType;
object.sound_source = soundSource;
Reflect.apply(track, defaultImport, [USER_CUSTOM_CALL_SOUND_SETTING_UPDATED, object]);
}
function getAmplitudinalSoundboardVolume() { // fn#55294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:2016, offset: 0x0137ae8b, size: 71 bytes, params: 1, frame: 12
const value = undefined;
const SoundboardSettings = (UserSettingsModule).SoundboardSettings;
const setting = SoundboardSettings.getSetting();
return (setting == null ? value : setting.volume) ?? 100;
}
function playSound(a0, a1, a2, a3) { // fn#55295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:2293, offset: 0x0137aed2, size: 109 bytes, params: 5, frame: 20
const playSoundLocally = SoundboardActionCreatorsModule.playSoundLocally;
const LocalSoundTrigger = (SoundboardTypesModule).LocalSoundTrigger;
const SOUNDBOARD = LocalSoundTrigger.SOUNDBOARD;
Reflect.apply(playSoundLocally, SoundboardActionCreatorsModule, [a1, a0, SOUNDBOARD]);
(VoiceChannelEffectsActionCreatorsModule).sendVoiceChannelSoundboardEffect(a1,
a0, false, a2, a3);
}
function useSoundBoardDismissContentTypes({isSoundboardButtonDisabled}) { // fn#55297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:2651, offset: 0x0137af3f, size: 201 bytes, params: 2, frame: 17
isSoundboardButtonDisabled = !(isSoundboardButtonDisabled === undefined) && isSoundboardButtonDisabled;
const currentUser = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
function() {
return UserStore.getCurrentUser();
});
items2 = [];
if (!isSoundboardButtonDisabled) {
if (!hasSetAnyCustomJoinSound()) {
if ((importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseCustomCallSounds(currentUser) || (require(3995) /* metro dependency 3995: UserUtils */).ageEligibleForPremiumUpsell(currentUser)) {
items2.push((require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent.CUSTOM_CALL_SOUNDS_PICKER_UPSELL);
}
}
}
return items2;
}
function removeCustomJoinSound(a0, a1) { // fn#55299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3023, offset: 0x0137b01a, size: 82 bytes, params: 3, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const updateUserGuildSettings = UserSettingsProtoActionCreatorsModule.updateUserGuildSettings;
const UserSettingsDelay = (UserSettingsProtoActionCreatorsModule).UserSettingsDelay;
const INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
Reflect.apply(updateUserGuildSettings, UserSettingsProtoActionCreatorsModule, [a0, _fun55300, INFREQUENT_USER_ACTION]);
function _fun55300(a0) { // fn#55300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3095, offset: 0x0137b06c, size: 109 bytes, params: 2, frame: 16
a0.joinSound = undefined;
const trackCustomCallSettingsChangedBinding = trackCustomCallSettingsChanged;
const object = {};
object.guildId = env0_0;
const AnalyticsChangeType = (SoundboardTypesModule).AnalyticsChangeType;
const REMOVED = AnalyticsChangeType.REMOVED;
object.changeType = REMOVED;
const AnalyticsSoundType = (SoundboardTypesModule).AnalyticsSoundType;
const ENTRY = AnalyticsSoundType.ENTRY;
object.soundType = ENTRY;
object.location = require;
trackCustomCallSettingsChangedBinding(object);
}
}
function updateCustomJoinSound(a0, a1, a2) { // fn#55301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3343, offset: 0x0137b0d9, size: 89 bytes, params: 4, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const updateUserGuildSettings = UserSettingsProtoActionCreatorsModule.updateUserGuildSettings;
const UserSettingsDelay = (UserSettingsProtoActionCreatorsModule).UserSettingsDelay;
const INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
Reflect.apply(updateUserGuildSettings, UserSettingsProtoActionCreatorsModule, [a0, _fun55302, INFREQUENT_USER_ACTION]);
function _fun55302(a0) { // fn#55302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7129:3417, offset: 0x0137b132, size: 261 bytes, params: 2, frame: 18
const AnalyticsChangeType = (SoundboardTypesModule).AnalyticsChangeType;
const value3 = require.guildId === DEFAULT_SOUND_GUILD_ID;
const AnalyticsSoundSource = (SoundboardTypesModule).AnalyticsSoundSource;
const r5 = value3 ? AnalyticsSoundSource.DEFAULT : AnalyticsSoundSource.CUSTOM;
const r7 = a0.joinSound != null ? AnalyticsChangeType.UPDATED : AnalyticsChangeType.ADDED;
a0.joinSound = {soundId: require.soundId, guildId: value3 ? CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID : require.guildId};
const trackCustomCallSettingsChangedBinding = trackCustomCallSettingsChanged;
object = {guildId: env0_0, changeType: r7, soundSource: r5};
const AnalyticsSoundType = (SoundboardTypesModule).AnalyticsSoundType;
const ENTRY = AnalyticsSoundType.ENTRY;
object.soundType = ENTRY;
object.location = importDefault;
trackCustomCallSettingsChangedBinding(object);
}
}
}
global.__d(_fun55284, 6951, [5, 1348, 1383, 3784, 1878, 4613, 4614, 661, 1346, 3829, 3802, 6952, 6944, 6639, 6953,
6980, 6981, 6982, 632, 3995, 1365, 1362, 683, 4863,
2]) /* metro module 6951, dependencies: [5, 1348, 1383, 3784, 1878, 4613, 4614, 661, 1346, 3829, 3802, 6952, 6944, 6639, 6953, 6980, 6981, 6982, 632, 3995, 1365, 1362, 683, 4863, 2] */;
@@ -1,46 +1,55 @@
/* Metro module 6982; source: modules/soundboard/canChannelUseSoundboard.tsx; dependencies: [1379, 3784, 1934, 661, 566, 2] */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun55367(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:6, offset: 0x013a49a3, size: 204 bytes, params: 8, frame: 20
let env0_0 = require;
const closure = canChannelUseSoundboard;
const canChannelUseSoundboard2 = canChannelUseSoundboard;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_5 = constantsModule.ChannelTypesSets;
const env0_6 = constantsModule.Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/canChannelUseSoundboard.tsx');
exports.default = closure;
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/canChannelUseSoundboard.tsx');
exports.default = canChannelUseSoundboard2;
exports.canSelectedVoiceChannelUseSoundboard = canSelectedVoiceChannelUseSoundboard;
exports.useCanChannelUseSoundboard = function(a0) {
var env0_0 = a0;
return require(dependencyMap[4]).useStateFromStores([PermissionStore], _fun55371, [a0]);
};
}
function canChannelUseSoundboard(a0) { // fn#55368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:173, offset: 0x013a4a6f, size: 124 bytes, params: 2, frame: 14
if (a0 == null) {
return false;
function canChannelUseSoundboard(a0) { // fn#55368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:173, offset: 0x013a4a6f, size: 124 bytes, params: 2, frame: 14
if (a0 == null) {
return false;
}
const CALLABLE = ChannelTypesSets.CALLABLE;
if (CALLABLE.has(a0.type)) {
return true;
}
let permissionStoreBinding = PermissionStore;
let can = permissionStoreBinding.can;
const USE_SOUNDBOARD = Permissions.USE_SOUNDBOARD;
const value2 = Reflect.apply(can, permissionStoreBinding, [USE_SOUNDBOARD, a0]);
permissionStoreBinding = PermissionStore;
can = permissionStoreBinding.can;
const SPEAK = Permissions.SPEAK;
return a0.isGuildVoiceOrThread() && value2 && Reflect.apply(can, permissionStoreBinding, [SPEAK, a0]);
}
const CALLABLE = ChannelTypesSets.CALLABLE;
if (CALLABLE.has(a0.type)) {
return true;
function canSelectedVoiceChannelUseSoundboard() { // fn#55369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:506, offset: 0x013a4aeb, size: 44 bytes, params: 1, frame: 12
return canChannelUseSoundboard(ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId()));
}
let can = PermissionStore.can;
const USE_SOUNDBOARD = Permissions.USE_SOUNDBOARD;
const value2 = Reflect.apply(can, PermissionStore, [USE_SOUNDBOARD, a0]);
can = PermissionStore.can;
const SPEAK = Permissions.SPEAK;
return a0.isGuildVoiceOrThread() && value2 && Reflect.apply(can, PermissionStore, [SPEAK, a0]);
}
function canSelectedVoiceChannelUseSoundboard() { // fn#55369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:506, offset: 0x013a4aeb, size: 44 bytes, params: 1, frame: 12
return canChannelUseSoundboard(ChannelStore.getChannel(SelectedChannelStore.getVoiceChannelId()));
}
function useCanChannelUseSoundboard(a0) { // fn#55370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:660, offset: 0x013a4b17, size: 73 bytes, params: 2, frame: 16
const env0_0 = a0;
return (FluxModule).useStateFromStores([PermissionStore], _fun55371, [a0]);
function _fun55371() { // fn#55371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:738, offset: 0x013a4b60, size: 23 bytes, params: 1, frame: 11
return canChannelUseSoundboard(env0_0);
}
}
function useCanChannelUseSoundboard(a0) { // fn#55370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7160:660, offset: 0x013a4b17, size: 73 bytes, params: 2, frame: 16
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun55371, [a0]);
}
global.__d(_fun55367, 6982, [1379, 3784, 1934, 661, 566,
2]) /* metro module 6982, dependencies: [1379, 3784, 1934, 661, 566, 2] */;
@@ -1,29 +1,32 @@
/* Metro module 13083; source: modules/soundboard/getSoundboardSoundURL.tsx; dependencies: [661, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun99964(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13273:6, offset: 0x021daadd, size: 109 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(661) /* metro dependency 661: Constants */).Endpoints;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/getSoundboardSoundURL.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/getSoundboardSoundURL.tsx');
exports.default = getSoundboardSoundURL;
}
function getSoundboardSoundURL(a0) { // fn#99965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13273:204, offset: 0x021dab4a, size: 154 bytes, params: 2, frame: 18
var r0;
var protocol;
var API_ENDPOINT;
var value;
const {CDN_HOST, PROJECT_ENV} = global.window.GLOBAL_ENV;
if (PROJECT_ENV !== 'development') {
value = Endpoints.SOUNDBOARD_SOUND(a0);
value = 'https://' + CDN_HOST + value;
r0 = value;
} else {
protocol = global.location.protocol;
API_ENDPOINT = global.window.GLOBAL_ENV.API_ENDPOINT;
value = Endpoints.SOUNDBOARD_SOUND(a0);
value = '' + protocol + API_ENDPOINT + value;
r0 = value;
function getSoundboardSoundURL(a0) { // fn#99965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13273:204, offset: 0x021dab4a, size: 154 bytes, params: 2, frame: 18
var r0;
var protocol;
var API_ENDPOINT;
var value;
const {CDN_HOST, PROJECT_ENV} = global.window.GLOBAL_ENV;
if (PROJECT_ENV !== 'development') {
value = Endpoints.SOUNDBOARD_SOUND(a0);
value = 'https://' + CDN_HOST + value;
r0 = value;
} else {
protocol = global.location.protocol;
API_ENDPOINT = global.window.GLOBAL_ENV.API_ENDPOINT;
value = Endpoints.SOUNDBOARD_SOUND(a0);
value = '' + protocol + API_ENDPOINT + value;
r0 = value;
}
return r0;
}
return r0;
}
global.__d(_fun99964, 13083, [661, 2]) /* metro module 13083, dependencies: [661, 2] */;
@@ -1,10 +1,13 @@
/* Metro module 13082; source: modules/soundboard/getVolumeForSound.tsx; dependencies: [4259, 4615, 3829, 2] */
import MediaEngineStore from '../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as PerceptualVolumeUtilsModule from '../../utils/PerceptualVolumeUtils.tsx'; /* Metro dependency 4615 */
function _fun99961(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13272:6, offset: 0x021da960, size: 129 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/getVolumeForSound.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/getVolumeForSound.tsx');
exports.default = getVolumeForSound;
exports.getPerceptualSoundboardVolume = function(a0) {
var value = a0;
@@ -13,27 +16,29 @@ function _fun99961(global, require, importDefault, importAll, module, exports, d
var value3 = 100;
return Reflect.apply(amplitudeToPerceptual, moduleValue, [value ?? value3]) / value3;
};
}
function getVolumeForSound(a0) { // fn#99962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13272:190, offset: 0x021da9e1, size: 189 bytes, params: 2, frame: 17
var volume;
var r4;
let value = a1;
const value2 = undefined;
if (value !== value2) {
r4 = value;
} else {
value = (require(3829) /* metro dependency 3829: UserSettings */).SoundboardSettings.getSetting();
volume = value == null ? value2 : value.volume;
value = 100;
r4 = volume ?? value;
function getVolumeForSound(a0) { // fn#99962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13272:190, offset: 0x021da9e1, size: 189 bytes, params: 2, frame: 17
var volume;
var r4;
let value = a1;
const value2 = undefined;
if (value !== value2) {
r4 = value;
} else {
value = (require(3829) /* metro dependency 3829: UserSettings */).SoundboardSettings.getSetting();
volume = value == null ? value2 : value.volume;
value = 100;
r4 = volume ?? value;
}
const value4 = (PerceptualVolumeUtilsModule).amplitudeToPerceptual(r4) / 100;
let Math = global.Math;
const min = Math.min;
const mediaEngineStoreBinding = MediaEngineStore;
const getOutputVolume = mediaEngineStoreBinding.getOutputVolume;
value = Reflect.apply(min, Math, [Reflect.apply(getOutputVolume, mediaEngineStoreBinding, []) / 100, 1]);
Math = global.Math;
return Math.min(a0 * value4 * value, 1);
}
const value4 = (require(4615) /* metro dependency 4615: PerceptualVolumeUtils */).amplitudeToPerceptual(r4) / 100;
let Math = global.Math;
const min = Math.min;
const getOutputVolume = MediaEngineStore.getOutputVolume;
value = Reflect.apply(min, Math, [Reflect.apply(getOutputVolume, MediaEngineStore, []) / 100, 1]);
Math = global.Math;
return Math.min(a0 * value4 * value, 1);
}
global.__d(_fun99961, 13082, [4259, 4615, 3829, 2]) /* metro module 13082, dependencies: [4259, 4615, 3829, 2] */;
+228 -214
View File
@@ -1,241 +1,255 @@
/* Metro module 15423; source: modules/soundboard/native/SoundButton.tsx; dependencies: [31, 27, 1878, 15418, 33, 4017, 4501, 697, 477, 5278, 4577, 6739, 11508, 15424, 566, 15425, 6771, 6789, 6951, 3802, 7890, 7892, 3857, 10896, 1244, 15427, 4573, 6705, 2] */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
import UseSoundboardSoundPlayerNative from '../useSoundboardSoundPlayer.native.tsx'; /* Metro dependency 15425 */
import OpenSoundboardSoundPreviewActionSheet from './utils/openSoundboardSoundPreviewActionSheet.tsx'; /* Metro dependency 15427 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as SpringModule from '../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as SoundboardUtilsModule from '../SoundboardUtils.tsx'; /* Metro dependency 6951 */
import * as SoundboardStyleConstantsModule from './SoundboardStyleConstants.tsx'; /* Metro dependency 15418 */
import * as SoundboardHooksModule from './SoundboardHooks.tsx'; /* Metro dependency 15424 */
function _fun118000(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:6, offset: 0x024c7f82, size: 869 bytes, params: 8, frame: 28
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = undefined;
const value2 = importAll(31) /* metro dependency 31 */;
const View = (require(27) /* metro dependency 27 */).View;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const SOUND_BUTTON_HEIGHT = (require(15418) /* metro dependency 15418: SoundboardStyleConstants */).SOUND_BUTTON_HEIGHT;
const value3 = require(33) /* metro dependency 33 */;
const env0_6 = value3.jsx;
const env0_7 = value3.jsxs;
const reanimatedRexport = importDefault(4017) /* metro dependency 4017: ReanimatedRexport */;
let createAnimatedComponent = reanimatedRexport.createAnimatedComponent;
const env0_8 = Reflect.apply(createAnimatedComponent, reanimatedRexport, [View]);
const View = (ReactNativeModule).View;
const SOUND_BUTTON_HEIGHT = (SoundboardStyleConstantsModule).SOUND_BUTTON_HEIGHT;
let createAnimatedComponent = ReanimatedRexport.createAnimatedComponent;
const env0_8 = Reflect.apply(createAnimatedComponent, ReanimatedRexport, [View]);
const env0_9 = {'damping': 10, 'stiffness': 300, 'mass': 1};
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {'marginTop': 4, 'height': null, 'backgroundColor': null, 'display': 'flex',
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {'marginTop': 4, 'height': null, 'backgroundColor': null, 'display': 'flex',
'flexDirection': 'column', 'justifyContent': 'center', 'alignItems': 'center', 'borderRadius': null,
'borderWidth': 1};
object4.height = SOUND_BUTTON_HEIGHT;
object2.height = SOUND_BUTTON_HEIGHT;
const CARD_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
object4.backgroundColor = CARD_BACKGROUND_DEFAULT;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.backgroundColor = CARD_BACKGROUND_DEFAULT;
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const BORDER_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_MUTED;
object4.borderColor = BORDER_MUTED;
object2.borderColor = BORDER_MUTED;
const SHADOW_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW;
copyDataProperties(object4, SHADOW_LOW, undefined);
object3.button = object4;
copyDataProperties(object2, SHADOW_LOW, undefined);
object.button = object2;
const CARD_PRIMARY_PRESSED_BG = (importDefault(697) /* metro dependency 697: native */).colors.CARD_PRIMARY_PRESSED_BG;
object3.buttonPressed = {backgroundColor: CARD_PRIMARY_PRESSED_BG};
object3.buttonDisabled = {opacity: 0.5};
const object6 = {'borderStyle': 'solid', 'borderWidth': 2};
object.buttonPressed = {backgroundColor: CARD_PRIMARY_PRESSED_BG};
object.buttonDisabled = {opacity: 0.5};
const object5 = {'borderStyle': 'solid', 'borderWidth': 2};
const STATUS_SPEAKING = (importDefault(697) /* metro dependency 697: native */).colors.STATUS_SPEAKING;
object6.borderColor = STATUS_SPEAKING;
object5.borderColor = STATUS_SPEAKING;
const CARD_SECONDARY_BG = (importDefault(697) /* metro dependency 697: native */).colors.CARD_SECONDARY_BG;
object6.backgroundColor = CARD_SECONDARY_BG;
object3.buttonPlaying = object6;
object5.backgroundColor = CARD_SECONDARY_BG;
object.buttonPlaying = object5;
const value6 = 24;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
object3.emoji = {'height': 24, 'width': 24, 'fontSize': null, 'lineHeight': 28,
fontSize: platformUtilsModule.isIOS() ? value6 : value};
const object8 = {'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center', 'height': 40, 'width': 40,
object.emoji = {'height': 24, 'width': 24, 'fontSize': null, 'lineHeight': 28,
fontSize: PlatformUtilsModule.isIOS() ? value6 : value};
const object7 = {'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center', 'height': 40, 'width': 40,
'backgroundColor': null, 'backgroundSize': 32, 'borderRadius': null, 'marginBottom': 8};
const BACKGROUND_MOD_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_MUTED;
object8.backgroundColor = BACKGROUND_MOD_MUTED;
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object3.emojiWrapper = object8;
object3.text = {marginHorizontal: 8};
object3.textPlaying = {marginHorizontal: 6};
const object9 = {'position': 'absolute', 'top': null, 'end': null, 'width': 12, 'height': 12};
object7.backgroundColor = BACKGROUND_MOD_MUTED;
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.emojiWrapper = object7;
object.text = {marginHorizontal: 8};
object.textPlaying = {marginHorizontal: 6};
const object10 = {'position': 'absolute', 'top': null, 'end': null, 'width': 12, 'height': 12};
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object9.top = PX_12;
object10.top = PX_12;
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object9.end = PX_12;
object10.end = PX_12;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object9.tintColor = WHITE;
object3.lock = object9;
const env0_10 = Reflect.apply(createStyles, createStylesModule, [object3]);
const value8 = reanimatedRexport;
createAnimatedComponent = value8.createAnimatedComponent;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const env0_11 = Reflect.apply(createAnimatedComponent, value8, [PressableOpacity]);
object3 = {code: 'function SoundButtonTsx1(){const{animationConfig,withDelay,withSpring,interpolate,SPRING_CONFIG}=this.__closure;var _animationConfig$play,_animationConfig$pres,_animationConfig;const isNotPressed=animationConfig.sharedValues.pressed.get()===0;const isPlaying=animationConfig.sharedValues.playing.get()>0;const shouldDoPlayingAnimation=isNotPressed&&isPlaying;const playingAnimationScaleValue=withDelay((_animationConfig$play=animationConfig.playingAnimationDelay)!==null&&_animationConfig$play!==void 0?_animationConfig$play:0,withSpring(interpolate(animationConfig.sharedValues.playing.get(),[0,1],[1,animationConfig.scaleFactors.playing]),SPRING_CONFIG));const pressedAnimationScaleValue=withSpring(interpolate(animationConfig.sharedValues.pressed.get(),[0,1],[1,animationConfig.scaleFactors.pressed]),SPRING_CONFIG);const rotationScaleValue=interpolate(animationConfig.sharedValues.pressed.get(),[0,1],[0,(_animationConfig$pres=(_animationConfig=animationConfig)===null||_animationConfig===void 0?void 0:_animationConfig.pressedRotationDegrees)!==null&&_animationConfig$pres!==void 0?_animationConfig$pres:0]);return{transform:[{scale:shouldDoPlayingAnimation?playingAnimationScaleValue:pressedAnimationScaleValue},{rotate:rotationScaleValue+"deg"}]};}'};
const value9 = value2.memo(_fun118004);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundButton.tsx');
object10.tintColor = WHITE;
object.lock = object10;
const env0_10 = Reflect.apply(createStyles, CreateStylesModule, [object]);
createAnimatedComponent = ReanimatedRexport.createAnimatedComponent;
const PressableOpacity = (PressablesModule).PressableOpacity;
const env0_11 = Reflect.apply(createAnimatedComponent, ReanimatedRexport, [PressableOpacity]);
object = {code: 'function SoundButtonTsx1(){const{animationConfig,withDelay,withSpring,interpolate,SPRING_CONFIG}=this.__closure;var _animationConfig$play,_animationConfig$pres,_animationConfig;const isNotPressed=animationConfig.sharedValues.pressed.get()===0;const isPlaying=animationConfig.sharedValues.playing.get()>0;const shouldDoPlayingAnimation=isNotPressed&&isPlaying;const playingAnimationScaleValue=withDelay((_animationConfig$play=animationConfig.playingAnimationDelay)!==null&&_animationConfig$play!==void 0?_animationConfig$play:0,withSpring(interpolate(animationConfig.sharedValues.playing.get(),[0,1],[1,animationConfig.scaleFactors.playing]),SPRING_CONFIG));const pressedAnimationScaleValue=withSpring(interpolate(animationConfig.sharedValues.pressed.get(),[0,1],[1,animationConfig.scaleFactors.pressed]),SPRING_CONFIG);const rotationScaleValue=interpolate(animationConfig.sharedValues.pressed.get(),[0,1],[0,(_animationConfig$pres=(_animationConfig=animationConfig)===null||_animationConfig===void 0?void 0:_animationConfig.pressedRotationDegrees)!==null&&_animationConfig$pres!==void 0?_animationConfig$pres:0]);return{transform:[{scale:shouldDoPlayingAnimation?playingAnimationScaleValue:pressedAnimationScaleValue},{rotate:rotationScaleValue+"deg"}]};}'};
const value9 = ReactModule.memo(_fun118004);
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundButton.tsx');
exports.SoundButton = value9;
return value;
}
function useAnimation(a0) { // fn#118001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:2620, offset: 0x024c82e7, size: 163 bytes, params: 2, frame: 18
const env0_0 = a0;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useAnimationT;
const object2 = {animationConfig: a0};
object2.withDelay = reanimatedRexportModule.withDelay;
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.interpolate = reanimatedRexportModule.interpolate;
object2.SPRING_CONFIG = env0_9;
closure.__closure = object2;
closure.__workletHash = 13932429225740;
closure.__initData = env0_12;
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
}
function SoundButtonEmoji({sound, sharedValues}) { // fn#118003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:3400, offset: 0x024c8590, size: 279 bytes, params: 2, frame: 21
const styles = useStyles();
const value2 = useAnimation({sharedValues: sharedValues, scaleFactors: {'pressed': 0.8, 'playing': 1.2}});
const value3 = useAnimation({sharedValues: sharedValues, scaleFactors: {'pressed': 0.7200000000000001,
'playing': 1.08}, playingAnimationDelay: 100, pressedRotationDegrees: -15});
const binding = env0_8;
return ((Component) => <Component style={[styles.emojiWrapper,
value2]}>{((Component) => <Component style={value3}>{((Component) => <Component fastImageStyle={styles.emoji} textEmojiStyle={styles.emoji} src={(importDefault(11508) /* metro dependency 11508: getSoundboardEmojiUrl */)(sound,
24)} name={sound.emojiName ?? ''} />)(importDefault(6739) /* metro dependency 6739: Emoji */)}</Component>)(binding)}</Component>)(binding);
}
function _fun118004({sound, channel, style, isSectionLocked}) { // fn#118004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:3846, offset: 0x024c86a7, size: 867 bytes, params: 2, frame: 33
isSectionLocked = !(isSectionLocked === undefined) && isSectionLocked;
const soundboardHooksModule = require(15424) /* metro dependency 15424: SoundboardHooks */;
const useSoundButtonStyleConfig = soundboardHooksModule.useSoundButtonStyleConfig;
const buttonWidth = Reflect.apply(useSoundButtonStyleConfig, soundboardHooksModule, []).buttonWidth;
let r11 = sound.emojiId != null || sound.emojiName != null;
const styles = useStyles();
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value5 = (importDefault(15425) /* metro dependency 15425: useSoundboardSoundPlayerNative */)(sound,
channel.id);
const playSoundboardSound = value5.playSoundboardSound;
const env0_3 = playSoundboardSound;
const isPlayingSound = value5.isPlayingSound;
const defaultImport2 = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const SOUNDBOARD_BUTTON = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).SOUNDBOARD_BUTTON;
const analyticsLocations = defaultImport2(SOUNDBOARD_BUTTON).analyticsLocations;
const canUseSoundboardSound2 = (require(6951) /* metro dependency 6951: SoundboardUtils */).canUseSoundboardSound(currentUser,
sound, channel);
const value6 = !canUseSoundboardSound2;
let binding = env0_3;
const value7 = binding.useCallback(_fun118006, [analyticsLocations, channel.guild_id, currentUser,
playSoundboardSound, sound, value6]);
const value8 = _fun118007(isPlayingSound);
const value9 = useAnimation({sharedValues: value8.sharedValues, scaleFactors: {'pressed': 0.95, 'playing': 1.05}});
const value11 = value8.sharedValues.pressed.get() > 0;
const value12 = binding.useCallback(_fun118011, [channel.id, sound]);
binding = env0_11;
const bindingProps = {style: [styles.button, {width: buttonWidth}, value11 ? styles.buttonPressed : null, value9,
isPlayingSound ? styles.buttonPlaying : null,
canUseSoundboardSound2 || isSectionLocked ? null : styles.buttonDisabled, style], accessibilityRole: 'button',
accessibilityLabel: sound.name, onPressIn: value8.handlers.pressIn, onPressOut: value8.handlers.pressOut,
onPress: value7, onLongPress: value12};
r11 = r11 && <SoundButtonEmoji sharedValues={value8.sharedValues} sound={sound} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View>
{((Component) => <Component {...bindingProps}>{r11}<Text lineClamp={1} style={[styles.text,
isPlayingSound ? styles.textPlaying : null]} variant="text-sm/semibold">{sound.name}</Text></Component>)(binding)}
{(canUseSoundboardSound2 ? value6 : !isSectionLocked) && ((LockIcon) => <LockIcon style={styles.lock} />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon)}
</View>
);
}
function useAnimationT() { // fn#118002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:2660, owner: useAnimation.t, offset: 0x024c838a, size: 518 bytes, params: 1, frame: 32
let binding = env0_0;
const value2 = binding.sharedValues.pressed.get();
const value3 = binding.sharedValues.playing.get();
const value4 = 0;
const value5 = value3 > value4;
const value7 = undefined;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const withDelay = reanimatedRexportModule.withDelay;
const r6 = binding.playingAnimationDelay ?? value4;
const springModule = require(4577) /* metro dependency 4577: spring */;
let withSpring = springModule.withSpring;
const moduleValue3 = reanimatedRexportModule;
let interpolate = moduleValue3.interpolate;
binding = env0_0;
const value9 = Reflect.apply(interpolate, moduleValue3, [binding.sharedValues.playing.get(), [0, 1], [1,
binding.scaleFactors.playing]]);
const binding2 = env1_9;
const value10 = Reflect.apply(withDelay, reanimatedRexportModule, [r6, Reflect.apply(withSpring, springModule,
[value9, binding2])]);
const moduleValue4 = springModule;
withSpring = moduleValue4.withSpring;
const moduleValue5 = reanimatedRexportModule;
const value12 = Reflect.apply(withSpring, moduleValue4,
[moduleValue5.interpolate(binding.sharedValues.pressed.get(), [0, 1], [1, binding.scaleFactors.pressed]),
binding2]);
const items2 = [{scale: value4 !== value2 ? value12 : value5 ? value10 : value12}];
const moduleValue6 = reanimatedRexportModule;
interpolate = moduleValue6.interpolate;
binding = env0_0;
items2[1] = {rotate: '' + Reflect.apply(interpolate, moduleValue6, [binding.sharedValues.pressed.get(), [0, 1], [0,
(binding == null ? value7 : env0_0.pressedRotationDegrees) ?? value4]]) + 'deg'};
return {transform: items2};
}
function _fun118006() { // fn#118006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4235, offset: 0x024c8a0a, size: 300 bytes, params: 1, frame: 17
var value2;
var defaultImport;
var open;
var object2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value;
if (env0_5) {
value2 = environment.__proto__;
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
if (defaultImport.canUseSoundboardEverywhere(currentUser)) {
if (!sound.available) {
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = value.open;
object2 = {key: 'DISABLED_SOUND_PRESSED', icon: importDefault(10896) /* metro dependency 10896 */};
object2.content = intl.string(t.MDOXJR);
object2.toastDurationMs = 3000;
Reflect.apply(open, value, [object2]);
}
} else if (sound.guildId === channel.guild_id) {
if (!sound.available) {
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = value.open;
object2 = {key: 'DISABLED_SOUND_PRESSED', icon: importDefault(10896) /* metro dependency 10896 */};
object2.content = intl.string(t.MDOXJR);
object2.toastDurationMs = 3000;
Reflect.apply(open, value, [object2]);
}
} else {
(importDefault(7890) /* metro dependency 7890: openPremiumUpsellActionSheet */)((require(7892) /* metro dependency 7892: EntitlementFeatureNames */).EntitlementFeatureNames.SOUNDBOARD_EVERYWHERE);
function useAnimation(a0) { // fn#118001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:2620, offset: 0x024c82e7, size: 163 bytes, params: 2, frame: 18
const env0_0 = a0;
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const useAnimationT2 = useAnimationT;
const object = {animationConfig: a0};
object.withDelay = ReanimatedRexportModule.withDelay;
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object.interpolate = ReanimatedRexportModule.interpolate;
object.SPRING_CONFIG = env0_9;
useAnimationT2.__closure = object;
useAnimationT2.__workletHash = 13932429225740;
useAnimationT2.__initData = env0_12;
return Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [useAnimationT2]);
function useAnimationT() { // fn#118002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:2660, owner: useAnimation.t, offset: 0x024c838a, size: 518 bytes, params: 1, frame: 32
let binding = env0_0;
const value2 = binding.sharedValues.pressed.get();
const value3 = binding.sharedValues.playing.get();
const value4 = 0;
const value5 = value3 > value4;
const value7 = undefined;
const withDelay = ReanimatedRexportModule.withDelay;
const r6 = binding.playingAnimationDelay ?? value4;
let withSpring = SpringModule.withSpring;
let interpolate = ReanimatedRexportModule.interpolate;
binding = env0_0;
const value9 = Reflect.apply(interpolate, ReanimatedRexportModule, [binding.sharedValues.playing.get(), [0, 1], [1,
binding.scaleFactors.playing]]);
const binding2 = env1_9;
const value10 = Reflect.apply(withDelay, ReanimatedRexportModule, [r6, Reflect.apply(withSpring, SpringModule,
[value9, binding2])]);
withSpring = SpringModule.withSpring;
const value12 = Reflect.apply(withSpring, SpringModule,
[ReanimatedRexportModule.interpolate(binding.sharedValues.pressed.get(), [0, 1], [1, binding.scaleFactors.pressed]),
binding2]);
const items2 = [{scale: value4 !== value2 ? value12 : value5 ? value10 : value12}];
interpolate = ReanimatedRexportModule.interpolate;
binding = env0_0;
items2[1] = {rotate: '' + Reflect.apply(interpolate, ReanimatedRexportModule, [binding.sharedValues.pressed.get(), [0, 1], [0,
(binding == null ? value7 : env0_0.pressedRotationDegrees) ?? value4]]) + 'deg'};
return {transform: items2};
}
} else {
playSoundboardSound(analyticsLocations);
}
function SoundButtonEmoji({sound, sharedValues}) { // fn#118003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:3400, offset: 0x024c8590, size: 279 bytes, params: 2, frame: 21
const styles = useStyles();
const value2 = useAnimation({sharedValues: sharedValues, scaleFactors: {'pressed': 0.8, 'playing': 1.2}});
const value3 = useAnimation({sharedValues: sharedValues, scaleFactors: {'pressed': 0.7200000000000001,
'playing': 1.08}, playingAnimationDelay: 100, pressedRotationDegrees: -15});
const binding = env0_8;
return ((Component) => <Component style={[styles.emojiWrapper,
value2]}>{((Component) => <Component style={value3}>{((Component) => <Component fastImageStyle={styles.emoji} textEmojiStyle={styles.emoji} src={(importDefault(11508) /* metro dependency 11508: getSoundboardEmojiUrl */)(sound,
24)} name={sound.emojiName ?? ''} />)(importDefault(6739) /* metro dependency 6739: Emoji */)}</Component>)(binding)}</Component>)(binding);
}
function _fun118004({sound, channel, style, isSectionLocked}) { // fn#118004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:3846, offset: 0x024c86a7, size: 867 bytes, params: 2, frame: 33
isSectionLocked = !(isSectionLocked === undefined) && isSectionLocked;
const useSoundButtonStyleConfig = SoundboardHooksModule.useSoundButtonStyleConfig;
const buttonWidth = Reflect.apply(useSoundButtonStyleConfig, SoundboardHooksModule, []).buttonWidth;
let r11 = sound.emojiId != null || sound.emojiName != null;
const styles = useStyles();
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value5 = (UseSoundboardSoundPlayerNative)(sound,
channel.id);
const playSoundboardSound = value5.playSoundboardSound;
const playSoundboardSound2 = playSoundboardSound;
const isPlayingSound = value5.isPlayingSound;
const defaultImport2 = UseAnalyticsLocations;
const SOUNDBOARD_BUTTON = (AnalyticsLocation).SOUNDBOARD_BUTTON;
const analyticsLocations = defaultImport2(SOUNDBOARD_BUTTON).analyticsLocations;
const canUseSoundboardSound2 = (SoundboardUtilsModule).canUseSoundboardSound(currentUser,
sound, channel);
const value6 = !canUseSoundboardSound2;
let binding = playSoundboardSound2;
const value7 = binding.useCallback(_fun118006, [analyticsLocations, channel.guild_id, currentUser,
playSoundboardSound, sound, value6]);
const value8 = _fun118007(isPlayingSound);
const value9 = useAnimation({sharedValues: value8.sharedValues, scaleFactors: {'pressed': 0.95, 'playing': 1.05}});
const value11 = value8.sharedValues.pressed.get() > 0;
const value12 = binding.useCallback(_fun118011, [channel.id, sound]);
binding = env0_11;
const bindingProps = {style: [styles.button, {width: buttonWidth}, value11 ? styles.buttonPressed : null, value9,
isPlayingSound ? styles.buttonPlaying : null,
canUseSoundboardSound2 || isSectionLocked ? null : styles.buttonDisabled, style], accessibilityRole: 'button',
accessibilityLabel: sound.name, onPressIn: value8.handlers.pressIn, onPressOut: value8.handlers.pressOut,
onPress: value7, onLongPress: value12};
r11 = r11 && <SoundButtonEmoji sharedValues={value8.sharedValues} sound={sound} />;
const Text = (TextModule).Text;
return (
<View>
{((Component) => <Component {...bindingProps}>{r11}<Text lineClamp={1} style={[styles.text,
isPlayingSound ? styles.textPlaying : null]} variant="text-sm/semibold">{sound.name}</Text></Component>)(binding)}
{(canUseSoundboardSound2 ? value6 : !isSectionLocked) && ((LockIcon) => <LockIcon style={styles.lock} />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon)}
</View>
);
function _fun118006() { // fn#118006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4235, offset: 0x024c8a0a, size: 300 bytes, params: 1, frame: 17
var value2;
var defaultImport;
var open;
var object;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var value;
if (env0_5) {
value2 = environment.__proto__;
defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
if (defaultImport.canUseSoundboardEverywhere(currentUser)) {
if (!sound.available) {
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = value.open;
object = {key: 'DISABLED_SOUND_PRESSED', icon: importDefault(10896) /* metro dependency 10896 */};
object.content = intl.string(t.MDOXJR);
object.toastDurationMs = 3000;
Reflect.apply(open, value, [object]);
}
} else if (sound.guildId === channel.guild_id) {
if (!sound.available) {
value = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = value.open;
object = {key: 'DISABLED_SOUND_PRESSED', icon: importDefault(10896) /* metro dependency 10896 */};
object.content = intl.string(t.MDOXJR);
object.toastDurationMs = 3000;
Reflect.apply(open, value, [object]);
}
} else {
(importDefault(7890) /* metro dependency 7890: openPremiumUpsellActionSheet */)((require(7892) /* metro dependency 7892: EntitlementFeatureNames */).EntitlementFeatureNames.SOUNDBOARD_EVERYWHERE);
}
} else {
playSoundboardSound(analyticsLocations);
}
}
function _fun118007(a0) { // fn#118007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4545, offset: 0x024c8b36, size: 203 bytes, params: 2, frame: 19
var environment;
const env0_0 = a0;
let value = environment.__proto__;
const value2 = (ReanimatedRexportModule).useSharedValue(0);
const value3 = (ReanimatedRexportModule).useSharedValue(0);
const binding = env1_3;
value = binding.useCallback(_fun118008, [value2]);
const value4 = binding.useCallback(_fun118009, [value2]);
binding.useEffect(_fun118010, [a0, value3, value2]);
return {handlers: {pressIn: value, pressOut: value4}, sharedValues: {pressed: value2, playing: value3}};
function _fun118008() { // fn#118008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4626, offset: 0x01b81401, size: 24 bytes, params: 1, frame: 11
env0_1.set(1);
}
function _fun118009() { // fn#118009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4664, offset: 0x01b81419, size: 23 bytes, params: 1, frame: 11
env0_1.set(0);
}
function _fun118010() { // fn#118010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4705, offset: 0x024c8c01, size: 33 bytes, params: 1, frame: 12
const binding = env0_2;
binding.set(env0_0 ? 1 : 0);
}
}
function _fun118011() { // fn#118011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4944, offset: 0x024c8c22, size: 49 bytes, params: 1, frame: 13
const value = environment.__proto__;
(OpenSoundboardSoundPreviewActionSheet)(channel.id, sound);
}
}
}
function _fun118007(a0) { // fn#118007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4545, offset: 0x024c8b36, size: 203 bytes, params: 2, frame: 19
var environment;
const env0_0 = a0;
let value = environment.__proto__;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const binding = env1_3;
value = binding.useCallback(_fun118008, [value2]);
const value4 = binding.useCallback(_fun118009, [value2]);
binding.useEffect(_fun118010, [a0, value3, value2]);
return {handlers: {pressIn: value, pressOut: value4}, sharedValues: {pressed: value2, playing: value3}};
}
function _fun118011() { // fn#118011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4944, offset: 0x024c8c22, size: 49 bytes, params: 1, frame: 13
const value = environment.__proto__;
(importDefault(15427) /* metro dependency 15427: openSoundboardSoundPreviewActionSheet */)(channel.id, sound);
}
function _fun118010() { // fn#118010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15620:4705, offset: 0x024c8c01, size: 33 bytes, params: 1, frame: 12
const binding = env0_2;
binding.set(env0_0 ? 1 : 0);
}
global.__d(_fun118000, 15423, [31, 27, 1878, 15418, 33, 4017, 4501, 697, 477, 5278, 4577, 6739, 11508, 15424, 566,
15425, 6771, 6789, 6951, 3802, 7890, 7892, 3857, 10896, 1244, 15427, 4573, 6705,
2]) /* metro module 15423, dependencies: [31, 27, 1878, 15418, 33, 4017, 4501, 697, 477, 5278, 4577, 6739, 11508, 15424, 566, 15425, 6771, 6789, 6951, 3802, 7890, 7892, 3857, 10896, 1244, 15427, 4573, 6705, 2] */;
@@ -1,25 +1,29 @@
/* Metro module 15415; source: modules/soundboard/native/SoundboardActionCreators.tsx; dependencies: [661, 1239, 3968, 1365, 4080, 15416, 1962, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
function _fun117918(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15612:6, offset: 0x024c510c, size: 124 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(661) /* metro dependency 661: Constants */).ComponentActions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardActionCreators.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardActionCreators.tsx');
exports.showSoundboardSoundPickerActionSheet = showSoundboardSoundPickerActionSheet;
function showSoundboardSoundPickerActionSheet({channel, analyticsSource}) { // fn#117919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15612:250, offset: 0x024c5188, size: 190 bytes, params: 2, frame: 19
const ComponentDispatch = require(dependencyMap[1]).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const TOGGLE_CALL_CONTROL_DRAWER = ComponentActions.TOGGLE_CALL_CONTROL_DRAWER;
Reflect.apply(dispatch, ComponentDispatch, [TOGGLE_CALL_CONTROL_DRAWER]);
const moduleValue = require(dependencyMap[2]);
const UNSAFE_markDismissibleContentAsDismissed = moduleValue.UNSAFE_markDismissibleContentAsDismissed;
const DismissibleContent = require(dependencyMap[3]).DismissibleContent;
const SOUNDBOARD_MOBILE_NEW_BADGE = DismissibleContent.SOUNDBOARD_MOBILE_NEW_BADGE;
Reflect.apply(UNSAFE_markDismissibleContentAsDismissed, moduleValue, [SOUNDBOARD_MOBILE_NEW_BADGE]);
const defaultImport = importDefault(dependencyMap[4]);
defaultImport.openLazy(require(dependencyMap[6])(dependencyMap[5], dependencyMap.paths),
'SoundboardSoundPickerActionSheet', {channel: channel, analyticsSource: analyticsSource});
}
}
function showSoundboardSoundPickerActionSheet({channel, analyticsSource}) { // fn#117919, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15612:250, offset: 0x024c5188, size: 190 bytes, params: 2, frame: 19
const ComponentDispatch = require(dependencyMap[1]).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const TOGGLE_CALL_CONTROL_DRAWER = ComponentActions.TOGGLE_CALL_CONTROL_DRAWER;
Reflect.apply(dispatch, ComponentDispatch, [TOGGLE_CALL_CONTROL_DRAWER]);
const moduleValue = require(dependencyMap[2]);
const UNSAFE_markDismissibleContentAsDismissed = moduleValue.UNSAFE_markDismissibleContentAsDismissed;
const DismissibleContent = require(dependencyMap[3]).DismissibleContent;
const SOUNDBOARD_MOBILE_NEW_BADGE = DismissibleContent.SOUNDBOARD_MOBILE_NEW_BADGE;
Reflect.apply(UNSAFE_markDismissibleContentAsDismissed, moduleValue, [SOUNDBOARD_MOBILE_NEW_BADGE]);
const defaultImport = importDefault(dependencyMap[4]);
defaultImport.openLazy(require(dependencyMap[6])(dependencyMap[5], dependencyMap.paths),
'SoundboardSoundPickerActionSheet', {channel: channel, analyticsSource: analyticsSource});
}
global.__d(_fun117918, 15415, [661, 1239, 3968, 1365, 4080, 15416, 1962,
2]) /* metro module 15415, dependencies: [661, 1239, 3968, 1365, 4080, 15416, 1962, 2] */;
@@ -1,17 +1,17 @@
/* Metro module 15424; source: modules/soundboard/native/SoundboardHooks.tsx; dependencies: [5, 31, 4502, 1310, 15418, 6276, 1478, 566, 4002, 1362, 6944, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
import ThemeStore from '../../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ActionSheetConstantsModule from '../../action_sheet/native/ActionSheetConstants.tsx'; /* Metro dependency 6276 */
import * as SoundboardStyleConstantsModule from './SoundboardStyleConstants.tsx'; /* Metro dependency 15418 */
function _fun118012(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:6, offset: 0x024c8c53, size: 236 bytes, params: 8, frame: 19
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 = importAll(31) /* metro dependency 31 */;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
const soundboardStyleConstantsModule = require(15418) /* metro dependency 15418: SoundboardStyleConstants */;
const env0_7 = soundboardStyleConstantsModule.SOUNDS_PER_ROW;
const env0_8 = soundboardStyleConstantsModule.SOUND_ROW_PADDING;
const env0_9 = (require(6276) /* metro dependency 6276: ActionSheetConstants */).ACTION_SHEET_MAX_WIDTH;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardHooks.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardHooks.tsx');
exports.useSoundButtonStyleConfig = function() {
var width = importDefault(dependencyMap[6])().width;
var object = {};
@@ -20,44 +20,50 @@ function _fun118012(global, require, importDefault, importAll, module, exports,
return object;
};
exports.useMaybeFetchSoundboardSounds = useMaybeFetchSoundboardSounds;
}
function useMaybeFetchSoundboardSounds({shouldFetch}) { // fn#118014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:428, offset: 0x024c8d91, size: 149 bytes, params: 2, frame: 20
ReactModule.useEffect(function() {
_fun118018()();
}, [(require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore], function() {
return AccessibilityStore.saturation;
}), (require(566) /* metro dependency 566: flux */).useStateFromStores([ThemeStore], function() {
return require(dependencyMap[8]).isThemeDark(ThemeStore.theme);
}), shouldFetch]);
function _fun118017() { // fn#118017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:587, offset: 0x024c8e56, size: 21 bytes, params: 1, frame: 9
_fun118018()();
function _fun118018() { // fn#118018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:598, offset: 0x024c8e6b, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun118020);
return _fun118021;
function* _fun118020() { // fn#118020, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:618, offset: 0x024c8e9a, size: 101 bytes, params: 1, frame: 14
var binding;
var binding2;
if (true) {
value = environment.__proto__.__proto__.__proto__;
if (require) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding2 = env4_2;
binding(binding2[9]).FrecencyUserSettingsActionCreators.loadIfNecessary();
value = binding(binding2[10]);
yield value.maybeFetchSoundboardSounds();
value = undefined;
if (false) {
return value;
}
}
}
}
function useMaybeFetchSoundboardSounds({shouldFetch}) { // fn#118014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:428, offset: 0x024c8d91, size: 149 bytes, params: 2, frame: 20
env0_4.useEffect(function() {
_fun118018()();
}, [(require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore], function() {
return AccessibilityStore.saturation;
}), (require(566) /* metro dependency 566: flux */).useStateFromStores([ThemeStore], function() {
return require(dependencyMap[8]).isThemeDark(ThemeStore.theme);
}), shouldFetch]);
}
function _fun118021() { // fn#118021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:750, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
function _fun118017() { // fn#118017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:587, offset: 0x024c8e56, size: 21 bytes, params: 1, frame: 9
_fun118018()();
}
function _fun118018() { // fn#118018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:598, offset: 0x024c8e6b, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun118020);
return _fun118021;
}
function* _fun118020() { // fn#118020, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15621:618, offset: 0x024c8e9a, size: 101 bytes, params: 1, frame: 14
var binding;
var binding2;
if (true) {
value = environment.__proto__.__proto__.__proto__;
if (require) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding2 = env4_2;
binding(binding2[9]).FrecencyUserSettingsActionCreators.loadIfNecessary();
value = binding(binding2[10]);
yield value.maybeFetchSoundboardSounds();
value = undefined;
if (false) {
return value;
}
}
}
}
global.__d(_fun118012, 15424, [5, 31, 4502, 1310, 15418, 6276, 1478, 566, 4002, 1362, 6944,
2]) /* metro module 15424, dependencies: [5, 31, 4502, 1310, 15418, 6276, 1478, 566, 4002, 1362, 6944, 2] */;
@@ -1,17 +1,19 @@
/* Metro module 13081; source: modules/soundboard/native/SoundboardManager.tsx; dependencies: [5, 7, 6, 15, 17, 18, 4259, 1934, 4613, 3, 13082, 13083, 10756, 6944, 13084, 2] */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
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 SelectedChannelStore from '../../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import MediaEngineStore from '../../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */
import SoundboardStore from '../SoundboardStore.tsx'; /* Metro dependency 4613 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun99948(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:6, offset: 0x021da43a, size: 366 bytes, params: 8, frame: 20
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(7) /* metro dependency 7 */;
const env0_5 = importDefault(6) /* metro dependency 6 */;
const env0_6 = importDefault(15) /* metro dependency 15 */;
const env0_7 = importDefault(17) /* metro dependency 17 */;
const env0_8 = importDefault(18) /* metro dependency 18 */;
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
const Map = global.Map;
let map = new Map();
map = importDefault(3) /* metro dependency 3: Logger */;
@@ -19,221 +21,234 @@ function _fun99948(global, require, importDefault, importAll, module, exports, d
map = importDefault(13084) /* metro dependency 13084: BaseSoundboardManager */;
map = _fun99952(map);
map = new map();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardManager.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardManager.tsx');
exports.default = map;
}
function _isNativeReflectConstruct_99949() { // fn#99949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:188, offset: 0x021da5a8, 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_99949_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun99952(a0) { // fn#99952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:439, offset: 0x021da60a, size: 42 bytes, params: 2, frame: 14
const closure = SoundboardManager;
env0_8(closure, a0);
return env0_4(closure);
}
function SoundboardManager(a0) { // fn#99953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:451, offset: 0x021da634, size: 175 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_5;
binding(this, SoundboardManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_7(SoundboardManager);
binding = env1_6;
if (_isNativeReflectConstruct_99949()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_7(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value._stopAndClearSounds = _stopAndClearSounds;
value._playSound = _playSound;
value._playSoundWithListener = _fun99957();
return value;
}
function SoundboardManager_stopAndClearSounds() { // fn#99954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:710, owner: SoundboardManager._stopAndClearSounds, offset: 0x021da6e3, size: 62 bytes, params: 1, frame: 12
env2_12.forEach(function(a0) {
a0.stop();
});
const Map = global.Map;
const map = new Map();
}
function SoundboardManager_playSound(a0) { // fn#99956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:766, owner: SoundboardManager._playSound, offset: 0x021da732, size: 321 bytes, params: 2, frame: 22
var value2;
var value3;
var binding;
var value4;
var sound;
let value = a1;
const r3 = value !== undefined ? value : 1;
value = environment.__proto__.__proto__;
const getVoiceChannelId = SelectedChannelStore.getVoiceChannelId;
if (Reflect.apply(getVoiceChannelId, SelectedChannelStore, []) === a3) {
if (!MediaEngineStore.isDeaf()) {
if (!SoundboardStore.isLocalSoundboardMuted(a2)) {
value2 = (importDefault(13082) /* metro dependency 13082: getVolumeForSound */)(r3);
value3 = '' + a2 + '-' + a0;
binding = env2_12;
value4 = binding.get(value3);
if (value4 != null) {
value4.stop();
}
sound = (require(10756) /* metro dependency 10756: SoundUtils */).createSound((importDefault(13083) /* metro dependency 13083: getSoundboardSoundURL */)(a0),
'soundboard_sound', value2);
sound.volume = value2;
binding = env2_12;
binding.set(value3, sound);
(require(6944) /* metro dependency 6944: SoundboardActionCreators */).reportSoundStartedPlaying(a0, a2);
binding = env0_0;
binding._playSoundWithListener({sound: sound, soundKey: value3, soundId: a0, userId: a2});
}
}
} else if (a3 == null) {
if (!MediaEngineStore.isDeaf()) {
if (!SoundboardStore.isLocalSoundboardMuted(a2)) {
value2 = (importDefault(13082) /* metro dependency 13082: getVolumeForSound */)(r3);
value3 = '' + a2 + '-' + a0;
binding = env2_12;
value4 = binding.get(value3);
if (value4 != null) {
value4.stop();
}
sound = (require(10756) /* metro dependency 10756: SoundUtils */).createSound((importDefault(13083) /* metro dependency 13083: getSoundboardSoundURL */)(a0),
'soundboard_sound', value2);
sound.volume = value2;
binding = env2_12;
binding.set(value3, sound);
(require(6944) /* metro dependency 6944: SoundboardActionCreators */).reportSoundStartedPlaying(a0, a2);
binding = env0_0;
binding._playSoundWithListener({sound: sound, soundKey: value3, soundId: a0, userId: a2});
}
}
}
}
function _fun99957() { // fn#99957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:1147, offset: 0x021da873, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun99959);
return _fun99960;
}
async function _fun99959({sound, soundKey, soundId, userId}) { // fn#99959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:1167, offset: 0x021da8ab, size: 181 bytes, params: 2, frame: 20
var r5;
var playWithListener;
var value4;
var error;
var binding;
if (true) {
await undefined;
if (false) {
return undefined;
}
function _isNativeReflectConstruct_99949() { // fn#99949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:188, offset: 0x021da5a8, 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 {
playWithListener = sound.playWithListener;
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) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_13;
binding.error('Failed to play sound', {error: error});
value = true;
r5 = value;
if (r5) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
}
return undefined;
}
try {
value = Reflect.apply(playWithListener, sound, []);
} catch (error) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_13;
binding.error('Failed to play sound', {error: error});
value = true;
r5 = value;
if (r5) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
return (_isNativeReflectConstruct_99949_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun99952(a0) { // fn#99952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:439, offset: 0x021da60a, size: 42 bytes, params: 2, frame: 14
const SoundboardManager2 = SoundboardManager;
Inherits(SoundboardManager2, a0);
return CreateClass(SoundboardManager2);
function SoundboardManager(a0) { // fn#99953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:451, offset: 0x021da634, size: 175 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_5;
binding(this, SoundboardManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_7(SoundboardManager);
binding = env1_6;
if (_isNativeReflectConstruct_99949()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_7(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
return undefined;
}
await value;
try {
value = undefined;
value4 = false;
} catch (error) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_13;
binding.error('Failed to play sound', {error: error});
value = true;
r5 = value;
if (r5) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
}
return undefined;
}
if (value4) {
value = binding(this, r0);
value._stopAndClearSounds = _stopAndClearSounds;
value._playSound = _playSound;
value._playSoundWithListener = _fun99957();
return value;
function _stopAndClearSounds() { // fn#99954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:710, owner: SoundboardManager._stopAndClearSounds, offset: 0x021da6e3, size: 62 bytes, params: 1, frame: 12
env2_12.forEach(function(a0) {
a0.stop();
});
const Map = global.Map;
const map = new Map();
}
function _playSound(a0) { // fn#99956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:766, owner: SoundboardManager._playSound, offset: 0x021da732, size: 321 bytes, params: 2, frame: 22
var mediaEngineStoreBinding;
var soundboardStoreBinding;
var value2;
var value3;
var binding;
var value4;
var sound;
let value = a1;
const r3 = value !== undefined ? value : 1;
value = environment.__proto__.__proto__;
const selectedChannelStoreBinding = SelectedChannelStore;
const getVoiceChannelId = selectedChannelStoreBinding.getVoiceChannelId;
if (Reflect.apply(getVoiceChannelId, selectedChannelStoreBinding, []) === a3) {
mediaEngineStoreBinding = MediaEngineStore;
if (!mediaEngineStoreBinding.isDeaf()) {
soundboardStoreBinding = SoundboardStore;
if (!soundboardStoreBinding.isLocalSoundboardMuted(a2)) {
value2 = (importDefault(13082) /* metro dependency 13082: getVolumeForSound */)(r3);
value3 = '' + a2 + '-' + a0;
binding = env2_12;
value4 = binding.get(value3);
if (value4 != null) {
value4.stop();
}
sound = (require(10756) /* metro dependency 10756: SoundUtils */).createSound((importDefault(13083) /* metro dependency 13083: getSoundboardSoundURL */)(a0),
'soundboard_sound', value2);
sound.volume = value2;
binding = env2_12;
binding.set(value3, sound);
(require(6944) /* metro dependency 6944: SoundboardActionCreators */).reportSoundStartedPlaying(a0, a2);
binding = env0_0;
binding._playSoundWithListener({sound: sound, soundKey: value3, soundId: a0, userId: a2});
}
}
} else if (a3 == null) {
mediaEngineStoreBinding = MediaEngineStore;
if (!mediaEngineStoreBinding.isDeaf()) {
soundboardStoreBinding = SoundboardStore;
if (!soundboardStoreBinding.isLocalSoundboardMuted(a2)) {
value2 = (importDefault(13082) /* metro dependency 13082: getVolumeForSound */)(r3);
value3 = '' + a2 + '-' + a0;
binding = env2_12;
value4 = binding.get(value3);
if (value4 != null) {
value4.stop();
}
sound = (require(10756) /* metro dependency 10756: SoundUtils */).createSound((importDefault(13083) /* metro dependency 13083: getSoundboardSoundURL */)(a0),
'soundboard_sound', value2);
sound.volume = value2;
binding = env2_12;
binding.set(value3, sound);
(require(6944) /* metro dependency 6944: SoundboardActionCreators */).reportSoundStartedPlaying(a0, a2);
binding = env0_0;
binding._playSoundWithListener({sound: sound, soundKey: value3, soundId: a0, userId: a2});
}
}
}
}
function _fun99957() { // fn#99957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:1147, offset: 0x021da873, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun99959);
return _fun99960;
async function _fun99959({sound, soundKey, soundId, userId}) { // fn#99959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:1167, offset: 0x021da8ab, size: 181 bytes, params: 2, frame: 20
var r5;
var playWithListener;
var value4;
var error;
var binding;
if (true) {
await undefined;
if (false) {
return undefined;
}
try {
playWithListener = sound.playWithListener;
} catch (error) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_13;
binding.error('Failed to play sound', {error: error});
value = true;
r5 = value;
if (r5) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
}
return undefined;
}
try {
value = Reflect.apply(playWithListener, sound, []);
} catch (error) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_13;
binding.error('Failed to play sound', {error: error});
value = true;
r5 = value;
if (r5) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
}
return undefined;
}
await value;
try {
value = undefined;
value4 = false;
} catch (error) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_13;
binding.error('Failed to play sound', {error: error});
value = true;
r5 = value;
if (r5) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
}
return undefined;
}
if (value4) {
return value;
}
if (value) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
}
}
}
function _fun99960() { // fn#99960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13271:1384, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
}
if (value) {
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_12;
binding.delete(soundKey);
binding = env4_0;
value = binding(env4_2[13]);
value.reportSoundFinishedPlaying(soundId, userId);
}
}
}
global.__d(_fun99948, 13081, [5, 7, 6, 15, 17, 18, 4259, 1934, 4613, 3, 13082, 13083, 10756, 6944, 13084,
2]) /* metro module 13081, dependencies: [5, 7, 6, 15, 17, 18, 4259, 1934, 4613, 3, 13082, 13083, 10756, 6944, 13084, 2] */;
@@ -1,125 +1,173 @@
/* Metro module 15416; source: modules/soundboard/native/SoundboardSoundPicker.tsx; dependencies: [57, 31, 27, 15417, 4294, 1878, 15418, 661, 33, 4501, 697, 4017, 632, 15419, 6948, 5463, 6771, 6789, 8742, 480, 477, 8575, 6275, 4027, 4573, 1244, 6984, 15422, 15430, 15431, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import RTCConnectionStore from '../../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */
import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
import UseTrackImpression from '../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
import UseSoundGrid from '../useSoundGrid.tsx'; /* Metro dependency 15419 */
import SoundboardSoundPickerCategories from './SoundboardSoundPickerCategories.tsx'; /* Metro dependency 15431 */
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 AnalyticsUtilsModule from '../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as UseAnalyticsLocationsModule from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
import * as SearchSoundsModule from '../searchSounds.tsx'; /* Metro dependency 6948 */
import * as SearchFieldNativeModule from '../../../design/components/TextField/native/SearchField.native.tsx'; /* Metro dependency 6984 */
import * as ExpressionPickerStoreModule from '../../expression_picker/ExpressionPickerStore.tsx'; /* Metro dependency 15417 */
import * as SoundboardStyleConstantsModule from './SoundboardStyleConstants.tsx'; /* Metro dependency 15418 */
import * as UseSoundGridModule from '../useSoundGrid.tsx'; /* Metro dependency 15419 */
import * as SoundboardSoundPickerListModule from './SoundboardSoundPickerList.tsx'; /* Metro dependency 15422 */
function _fun117920(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:6, offset: 0x024c5246, size: 422 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const expressionPickerStoreModule = require(15417) /* metro dependency 15417: ExpressionPickerStore */;
const env0_6 = expressionPickerStoreModule.setSearchQuery;
const env0_7 = expressionPickerStoreModule.useExpressionPickerStore;
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const SOUND_ROW_HORIZONTAL_PADDING = (require(15418) /* metro dependency 15418: SoundboardStyleConstants */).SOUND_ROW_HORIZONTAL_PADDING;
const env0_10 = (require(661) /* metro dependency 661: Constants */).EXPRESSION_FOOTER_HEIGHT;
const value3 = require(33) /* metro dependency 33 */;
const env0_11 = value3.jsx;
const env0_12 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object = {paddingHorizontal: SOUND_ROW_HORIZONTAL_PADDING};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.padding = PX_8;
object.width = '100%';
const env0_13 = Reflect.apply(createStyles, createStylesModule, [{title: {marginBottom: 8}, container: {'flex': 1,
'alignItems': 'center'}, header: object, body: {'flex': 1, 'width': '100%'}}]);
let value = ReactModule;
const SOUND_ROW_HORIZONTAL_PADDING = (SoundboardStyleConstantsModule).SOUND_ROW_HORIZONTAL_PADDING;
const createStyles = CreateStylesModule.createStyles;
const object2 = {paddingHorizontal: SOUND_ROW_HORIZONTAL_PADDING};
const PX_8 = (Native).space.PX_8;
object2.padding = PX_8;
object2.width = '100%';
const env0_13 = Reflect.apply(createStyles, CreateStylesModule, [{title: {marginBottom: 8}, container: {'flex': 1,
'alignItems': 'center'}, header: object2, body: {'flex': 1, 'width': '100%'}}]);
value = value.memo(_fun117921);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPicker.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPicker.tsx');
exports.default = value;
}
function _fun117921({channel, analyticsSource}) { // fn#117921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:505, offset: 0x024c53ec, size: 1332 bytes, params: 2, frame: 44
var object2;
const styles = useStyles();
const binding = env0_4;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [0]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
const property2 = value4[1];
const value5 = binding.useRef(null);
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const currentUser = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
function() {
return UserStore.getCurrentUser();
});
const mediaSessionId = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([RTCConnectionStore],
function() {
return RTCConnectionStore.getMediaSessionId();
});
const {categories, availableSounds} = (importDefault(15419) /* metro dependency 15419: useSoundGrid */)(channel,
{filterOutEmptyCurrentGuild: true});
const value8 = useExpressionPickerStore(function(a0) {
return a0.searchQuery;
});
useState = binding.useState;
const searchSoundsModule = require(6948) /* metro dependency 6948: searchSounds */;
const value9 = binding2(Reflect.apply(useState, binding, [searchSoundsModule.searchSounds(value8, availableSounds,
currentUser, channel)]), 2);
const property3 = value9[0];
var env0_3 = value9[1];
const value10 = (require(15419) /* metro dependency 15419: useSoundGrid */).useSearchCategories(categories,
property3, value8);
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({isKeyboardAwareOnAndroid: false}).insets;
const defaultImport3 = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const SOUNDBOARD_ACTION_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).SOUNDBOARD_ACTION_SHEET;
const analyticsLocations = defaultImport3(SOUNDBOARD_ACTION_SHEET).analyticsLocations;
const value11 = binding.useCallback(_fun117925, [channel, currentUser, availableSounds]);
const defaultImport4 = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
object2 = {};
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
const HALFSHEET = ImpressionTypes.HALFSHEET;
object2.type = HALFSHEET;
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
const SOUNDBOARD_POPOUT = ImpressionNames.SOUNDBOARD_POPOUT;
object2.name = SOUNDBOARD_POPOUT;
object2.properties = {source: analyticsSource, guild_id: channel.guild_id, media_session_id: mediaSessionId};
defaultImport4(object2);
const value12 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
const value13 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
const r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component animatedSheetIndex={value12} portalHostName="soundboard-footer" />)(importDefault(8575) /* metro dependency 8575: PortalKeyboardFooterIOSIos */);
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const r8 = platformUtilsModule.isAndroid() ? ((PortalHost) => <PortalHost name="soundboard-footer" />)((require(4027) /* metro dependency 4027 */).PortalHost) : undefined;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const ABjMWI = (require(1244) /* metro dependency 1244: indexNative */).t.ABjMWI;
const items2 = [<Text accessibilityRole="header" variant="heading-lg/bold" style={styles.title}>{Reflect.apply(string,
intl, [ABjMWI])}</Text>];
const SearchField = (require(6984) /* metro dependency 6984: SearchFieldNative */).SearchField;
items2[1] = <View style={styles.header}><SearchField size="md" placeholder={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sKt3xS)} onChange={value11} /></View>;
const SoundboardSoundPickerList = (require(15422) /* metro dependency 15422: SoundboardSoundPickerList */).SoundboardSoundPickerList;
const value17 = EXPRESSION_FOOTER_HEIGHT + insets.bottom;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
items2[2] = <View style={styles.body}><SoundboardSoundPickerList listRef={value5} channel={channel} insetBottom={value17 + PX_16} scrollPosition={value6} setCategoryIndex={property2} categories={value10} shouldShowPremiumUpsell={value13} /></View>;
items2[3] = ((Component) => <Component shouldShow={value13} />)(importDefault(15430) /* metro dependency 15430: PremiumSoundboardFeatureUpsell */);
return (
<AnalyticsLocationProvider value={analyticsLocations}>
{r5}
<BottomSheet
animatedIndex={value12}
scrollable
startExpanded
footer={r8}
function _fun117921({channel, analyticsSource}) { // fn#117921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:505, offset: 0x024c53ec, size: 1332 bytes, params: 2, frame: 44
const styles = useStyles();
const binding = env0_4;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [0]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
const property2 = value4[1];
const value5 = binding.useRef(null);
const value6 = (ReanimatedRexportModule).useSharedValue(0);
const currentUser = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
function() {
return UserStore.getCurrentUser();
});
const mediaSessionId = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([RTCConnectionStore],
function() {
return RTCConnectionStore.getMediaSessionId();
});
const {categories, availableSounds} = (UseSoundGrid)(channel,
{filterOutEmptyCurrentGuild: true});
const value8 = useExpressionPickerStore(function(a0) {
return a0.searchQuery;
});
useState = binding.useState;
const value9 = binding2(Reflect.apply(useState, binding, [SearchSoundsModule.searchSounds(value8, availableSounds,
currentUser, channel)]), 2);
const property3 = value9[0];
var env0_3 = value9[1];
const value10 = (UseSoundGridModule).useSearchCategories(categories,
property3, value8);
const insets = (UseSafeAreaInsetsKeyboardAwareNative)({isKeyboardAwareOnAndroid: false}).insets;
const defaultImport3 = UseAnalyticsLocations;
const SOUNDBOARD_ACTION_SHEET = (AnalyticsLocation).SOUNDBOARD_ACTION_SHEET;
const analyticsLocations = defaultImport3(SOUNDBOARD_ACTION_SHEET).analyticsLocations;
const value11 = binding.useCallback(_fun117925, [channel, currentUser, availableSounds]);
const defaultImport4 = UseTrackImpression;
object = {};
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const HALFSHEET = ImpressionTypes.HALFSHEET;
object.type = HALFSHEET;
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const SOUNDBOARD_POPOUT = ImpressionNames.SOUNDBOARD_POPOUT;
object.name = SOUNDBOARD_POPOUT;
object.properties = {source: analyticsSource, guild_id: channel.guild_id, media_session_id: mediaSessionId};
defaultImport4(object);
const value12 = (ReanimatedRexportModule).useSharedValue(-1);
const value13 = (ReanimatedRexportModule).useSharedValue(false);
const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider;
const r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component animatedSheetIndex={value12} portalHostName="soundboard-footer" />)(importDefault(8575) /* metro dependency 8575: PortalKeyboardFooterIOSIos */);
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const r8 = (
platformUtilsModule.isAndroid()
? ((PortalHost) => <PortalHost name="soundboard-footer" />)((require(4027) /* metro dependency 4027 */).PortalHost)
: undefined
);
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const ABjMWI = (require(1244) /* metro dependency 1244: indexNative */).t.ABjMWI;
const items2 = [
<Text
accessibilityRole="header"
variant="heading-lg/bold"
style={styles.title}
>
<View style={styles.container}>
{items2}
</View>
{((Component) => <Component guildId={channel.guild_id} listRef={value5} categories={categories} categoryIndex={property} />)(importDefault(15431) /* metro dependency 15431: SoundboardSoundPickerCategories */)}
</BottomSheet>
</AnalyticsLocationProvider>
);
}
{Reflect.apply(string, intl, [ABjMWI])}
</Text>,
];
const SearchField = (SearchFieldNativeModule).SearchField;
items2[1] = (
<View style={styles.header}>
<SearchField
size="md"
placeholder={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sKt3xS)}
onChange={value11}
/>
</View>
);
const SoundboardSoundPickerList = (SoundboardSoundPickerListModule).SoundboardSoundPickerList;
const value17 = EXPRESSION_FOOTER_HEIGHT + insets.bottom;
const PX_16 = (Native).space.PX_16;
items2[2] = (
<View style={styles.body}>
<SoundboardSoundPickerList
listRef={value5}
channel={channel}
insetBottom={value17 + PX_16}
scrollPosition={value6}
setCategoryIndex={property2}
categories={value10}
shouldShowPremiumUpsell={value13}
/>
</View>
);
items2[3] = ((Component) => <Component shouldShow={value13} />)(importDefault(15430) /* metro dependency 15430: PremiumSoundboardFeatureUpsell */);
return (
<AnalyticsLocationProvider value={analyticsLocations}>
{r5}
<BottomSheet
animatedIndex={value12}
scrollable
startExpanded
footer={r8}
>
<View style={styles.container}>
{items2}
</View>
{((Component) => <Component guildId={channel.guild_id} listRef={value5} categories={categories} categoryIndex={property} />)(SoundboardSoundPickerCategories)}
</BottomSheet>
</AnalyticsLocationProvider>
);
function _fun117925(a0) { // fn#117925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:1098, offset: 0x024c593e, size: 79 bytes, params: 2, frame: 19
let value = environment.__proto__;
setSearchQuery(a0);
const binding = env0_3;
value = require(6948) /* metro dependency 6948: searchSounds */;
binding(value.searchSounds(a0, availableSounds, currentUser, channel));
}
}
function _fun117925(a0) { // fn#117925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:1098, offset: 0x024c593e, size: 79 bytes, params: 2, frame: 19
let value = environment.__proto__;
setSearchQuery(a0);
const binding = env0_3;
value = require(6948) /* metro dependency 6948: searchSounds */;
binding(value.searchSounds(a0, availableSounds, currentUser, channel));
}
global.__d(_fun117920, 15416, [57, 31, 27, 15417, 4294, 1878, 15418, 661, 33, 4501, 697, 4017, 632, 15419, 6948,
5463, 6771, 6789, 8742, 480, 477, 8575, 6275, 4027, 4573, 1244, 6984, 15422, 15430, 15431,
2]) /* metro module 15416, dependencies: [57, 31, 27, 15417, 4294, 1878, 15418, 661, 33, 4501, 697, 4017, 632, 15419, 6948, 5463, 6771, 6789, 8742, 480, 477, 8575, 6275, 4027, 4573, 1244, 6984, 15422, 15430, 15431, 2] */;
@@ -1,251 +1,254 @@
/* Metro module 15431; source: modules/soundboard/native/SoundboardSoundPickerCategories.tsx; dependencies: [31, 27, 15417, 1878, 661, 33, 4501, 697, 6639, 6819, 1244, 11053, 15429, 5278, 1305, 6705, 4081, 4082, 566, 3802, 7898, 1585, 4027, 8670, 2] */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
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 '../../../Constants.tsx'; /* Metro dependency 661 */
import * as Module04027Module from '../../../by-id/module-04027.js'; /* Metro dependency 4027 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as ExpressionPickerStoreModule from '../../expression_picker/ExpressionPickerStore.tsx'; /* Metro dependency 15417 */
function _fun118040(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:6, offset: 0x024c9c92, size: 691 bytes, params: 8, frame: 29
var object3;
const env0_0 = require;
const getItemLayout_118043 = function(a0, a1) {
return {length: EXPRESSION_FOOTER_HEIGHT, offset: EXPRESSION_FOOTER_HEIGHT * a1, index: a1};
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const StyleSheet = value2.StyleSheet;
const env0_5 = value2.View;
const env0_6 = value2.FlatList;
const env0_7 = (require(15417) /* metro dependency 15417: ExpressionPickerStore */).setSearchQuery;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const CATEGORY_ICON_SIZE = constantsModule.CATEGORY_ICON_SIZE;
const env0_9 = constantsModule.EXPRESSION_FOOTER_HEIGHT;
const NODE_MARGIN = constantsModule.NODE_MARGIN;
const NODE_SIZE = constantsModule.NODE_SIZE;
const value4 = require(33) /* metro dependency 33 */;
const env0_10 = value4.jsx;
const env0_11 = value4.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {'borderTopWidth': null, 'paddingHorizontal': 8, 'flexDirection': 'row', 'alignItems': 'center'};
object4.borderTopWidth = StyleSheet.hairlineWidth;
let value = ReactModule;
const StyleSheet = ReactNativeModule.StyleSheet;
const CATEGORY_ICON_SIZE = ConstantsModule.CATEGORY_ICON_SIZE;
const NODE_MARGIN = ConstantsModule.NODE_MARGIN;
const NODE_SIZE = ConstantsModule.NODE_SIZE;
const createStyles = CreateStylesModule.createStyles;
object = {};
const object2 = {'borderTopWidth': null, 'paddingHorizontal': 8, 'flexDirection': 'row', 'alignItems': 'center'};
object2.borderTopWidth = StyleSheet.hairlineWidth;
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
object2.backgroundColor = BACKGROUND_SURFACE_HIGH;
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object4.borderTopColor = BACKGROUND_BASE_LOWEST;
object3.container = object4;
object3.item = {margin: NODE_MARGIN, height: NODE_SIZE, width: NODE_SIZE,
object2.borderTopColor = BACKGROUND_BASE_LOWEST;
object.container = object2;
object.item = {margin: NODE_MARGIN, height: NODE_SIZE, width: NODE_SIZE,
borderRadius: NODE_SIZE / 2, alignItems: 'center', justifyContent: 'center'};
object3.fadedItem = {opacity: 0.5};
object.fadedItem = {opacity: 0.5};
const INTERACTIVE_BACKGROUND_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_ACTIVE;
object3.activeItem = {opacity: 1, backgroundColor: INTERACTIVE_BACKGROUND_ACTIVE};
object3.guildItem = {height: CATEGORY_ICON_SIZE, width: CATEGORY_ICON_SIZE, borderRadius: CATEGORY_ICON_SIZE / 2};
object3.keyboardItem = {height: CATEGORY_ICON_SIZE, width: CATEGORY_ICON_SIZE};
const object5 = {'width': 12, 'height': 12, 'position': 'absolute', 'bottom': 0, 'end': 0, 'backgroundColor': null,
object.activeItem = {opacity: 1, backgroundColor: INTERACTIVE_BACKGROUND_ACTIVE};
object.guildItem = {height: CATEGORY_ICON_SIZE, width: CATEGORY_ICON_SIZE, borderRadius: CATEGORY_ICON_SIZE / 2};
object.keyboardItem = {height: CATEGORY_ICON_SIZE, width: CATEGORY_ICON_SIZE};
const object6 = {'width': 12, 'height': 12, 'position': 'absolute', 'bottom': 0, 'end': 0, 'backgroundColor': null,
'borderRadius': null, 'alignItems': 'center', 'justifyContent': 'center'};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object5.backgroundColor = BACKGROUND_BASE_LOW;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object3.lockContainer = object5;
object6.backgroundColor = BACKGROUND_BASE_LOW;
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.lockContainer = object6;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
object3.lock = {'width': 7.5, 'height': 7.5, tintColor: TEXT_DEFAULT};
const env0_12 = Reflect.apply(createStyles, createStylesModule, [object3]);
object.lock = {'width': 7.5, 'height': 7.5, tintColor: TEXT_DEFAULT};
const env0_12 = Reflect.apply(createStyles, CreateStylesModule, [object]);
const env0_13 = value.memo(value.forwardRef(_fun118044));
value = value.memo(SoundboardSoundPickerCategories);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPickerCategories.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPickerCategories.tsx');
exports.default = value;
}
function SoundCategoryItem({category, handlePressCategory, index, style, locked}) { // fn#118041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:1087, offset: 0x024c9f45, size: 774 bytes, params: 2, frame: 28
var r3;
var r10;
var r14;
var SEARCH;
var value2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var value3;
var defaultImport;
var value4;
var defaultImport2;
var value5;
var value6;
var defaultImport3;
var value7;
var guild;
var name;
var value8;
var value9;
locked = !(locked === undefined) && locked;
const styles = useStyles();
const type = category.categoryInfo.type;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (GUILD === type) {
guild = category.categoryInfo.guild;
name = guild.name;
value8 = ((Component) => <Component guild={guild} style={styles.guildItem} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */);
value9 = null;
r3 = name;
r10 = value8;
r14 = value9;
} else if ((require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType.FAVORITES === type) {
value6 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y3LQCG);
defaultImport3 = importDefault(11053) /* metro dependency 11053 */;
value7 = null;
r3 = value6;
r10 = value7;
r14 = defaultImport3;
} else if ((require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType.DEFAULTS === type) {
value4 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Rtvk9X);
defaultImport2 = importDefault(15429) /* metro dependency 15429 */;
value5 = null;
r3 = value4;
r10 = value5;
r14 = defaultImport2;
} else {
SEARCH = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType.SEARCH;
value2 = null;
if (SEARCH !== type) {
r3 = value2;
r10 = value2;
r14 = value2;
function SoundCategoryItem({category, handlePressCategory, index, style, locked}) { // fn#118041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:1087, offset: 0x024c9f45, size: 774 bytes, params: 2, frame: 28
var r3;
var r10;
var r14;
var SEARCH;
var value2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var value3;
var defaultImport;
var value4;
var defaultImport2;
var value5;
var value6;
var defaultImport3;
var value7;
var guild;
var name;
var value8;
var value9;
locked = !(locked === undefined) && locked;
const styles = useStyles();
const type = category.categoryInfo.type;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (GUILD === type) {
guild = category.categoryInfo.guild;
name = guild.name;
value8 = ((Component) => <Component guild={guild} style={styles.guildItem} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */);
value9 = null;
r3 = name;
r10 = value8;
r14 = value9;
} else if ((require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType.FAVORITES === type) {
value6 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y3LQCG);
defaultImport3 = importDefault(11053) /* metro dependency 11053 */;
value7 = null;
r3 = value6;
r10 = value7;
r14 = defaultImport3;
} else if ((require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType.DEFAULTS === type) {
value4 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Rtvk9X);
defaultImport2 = importDefault(15429) /* metro dependency 15429 */;
value5 = null;
r3 = value4;
r10 = value5;
r14 = defaultImport2;
} else {
value3 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sKt3xS);
defaultImport = importDefault(15429) /* metro dependency 15429 */;
r3 = value3;
r10 = value2;
r14 = defaultImport;
SEARCH = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType.SEARCH;
value2 = null;
if (SEARCH !== type) {
r3 = value2;
r10 = value2;
r14 = value2;
} else {
value3 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sKt3xS);
defaultImport = importDefault(15429) /* metro dependency 15429 */;
r3 = value3;
r10 = value2;
r14 = defaultImport;
}
}
const PressableOpacity = (PressablesModule).PressableOpacity;
const items2 = [styles.item, style];
r10 = r10 ?? ((Icon) => <Icon style={styles.keyboardItem} source={r14} />)((require(1305) /* metro dependency 1305: native */).Icon);
return (
<PressableOpacity
onPress={function() {
return handlePressCategory(index);
}}
accessibilityRole="button"
accessibilityLabel={r3}
key={r3}
>
<View style={items2}>
{r10}
{locked && <View style={styles.lockContainer}>{((LockIcon) => <LockIcon style={styles.lock} />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon)}</View>}
</View>
</PressableOpacity>
);
}
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const items2 = [styles.item, style];
r10 = r10 ?? ((Icon) => <Icon style={styles.keyboardItem} source={r14} />)((require(1305) /* metro dependency 1305: native */).Icon);
return (
<PressableOpacity
onPress={function() {
return handlePressCategory(index);
}}
accessibilityRole="button"
accessibilityLabel={r3}
key={r3}
>
<View style={items2}>
{r10}
{locked && <View style={styles.lockContainer}>{((LockIcon) => <LockIcon style={styles.lock} />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon)}</View>}
</View>
</PressableOpacity>
);
}
function _fun118044(a0, a1) { // fn#118044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2011, offset: 0x024ca26e, size: 45 bytes, params: 3, frame: 14
return <FlatList {...a0} {...{['ref']: a1}} />;
}
function _fun118044(a0, a1) { // fn#118044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2011, offset: 0x024ca26e, size: 45 bytes, params: 3, frame: 14
return <FlatList {...a0} {...{['ref']: a1}} />;
}
function SoundboardSoundPickerCategories({guildId, categories, categoryIndex, style, listRef}) { // fn#118045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2117, offset: 0x024ca29b, size: 579 bytes, params: 2, frame: 29
const styles = useStyles();
const binding = styles;
const value2 = binding.useRef(null);
const env0_5 = binding.useRef(null);
const env0_6 = binding.useRef(null);
binding.useEffect(_fun118046, [categoryIndex]);
const value3 = binding.useCallback(_fun118047, []);
const value4 = binding.useCallback(_fun118048, []);
const value7 = binding.useCallback(_fun118052,
[(require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return importDefault(dependencyMap[19]).canUseSoundboardEverywhere(UserStore.getCurrentUser());
}), guildId, binding.useCallback(function(a0) {
var env0_0 = a0;
setSearchQuery('');
global.setImmediate(_fun118050);
}, [listRef]), categoryIndex, styles.activeItem, styles.fadedItem]);
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
const Portal = (require(4027) /* metro dependency 4027 */).Portal;
return (
<Portal hostName="soundboard-footer">
<View style={[styles.container, {paddingBottom: bottom}, style]}>
{((Component) => <Component style={StyleSheet.absoluteFill} />)(importDefault(8670) /* metro dependency 8670: VisualEffectViewThemed */)}
{((Component) => <Component ref={value2} getItemLayout={getItemLayout_118043} onLayout={value3} onScroll={value4} data={categories} keyboardShouldPersistTaps="always" horizontal keyExtractor={function(a0) {
var String = global.String;
return String(a0.key);
}} renderItem={value7} showsHorizontalScrollIndicator={false} />)(env0_13)}
</View>
</Portal>
);
}
function _fun118046() { // fn#118046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2292, offset: 0x024ca4de, size: 122 bytes, params: 1, frame: 12
var categoryIndexBinding;
var value2;
var value3;
let current = env0_5.current;
if (current != null) {
current = env0_6.current;
if (current != null) {
current = env0_4.current;
function SoundboardSoundPickerCategories({guildId, categories, categoryIndex, style, listRef}) { // fn#118045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2117, offset: 0x024ca29b, size: 579 bytes, params: 2, frame: 29
const styles = useStyles();
const binding = styles;
const value2 = binding.useRef(null);
const env0_5 = binding.useRef(null);
const env0_6 = binding.useRef(null);
binding.useEffect(_fun118046, [categoryIndex]);
const value3 = binding.useCallback(_fun118047, []);
const value4 = binding.useCallback(_fun118048, []);
const value7 = binding.useCallback(_fun118052,
[(require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return importDefault(dependencyMap[19]).canUseSoundboardEverywhere(UserStore.getCurrentUser());
}), guildId, binding.useCallback(function(a0) {
var env0_0 = a0;
setSearchQuery('');
global.setImmediate(_fun118050);
}, [listRef]), categoryIndex, styles.activeItem, styles.fadedItem]);
const bottom = (UseSafeAreaInsetsNative)().bottom;
const Portal = (Module04027Module).Portal;
return (
<Portal hostName="soundboard-footer">
<View style={[styles.container, {paddingBottom: bottom}, style]}>
{((Component) => <Component style={StyleSheet.absoluteFill} />)(importDefault(8670) /* metro dependency 8670: VisualEffectViewThemed */)}
{((Component) => <Component ref={value2} getItemLayout={getItemLayout_118043} onLayout={value3} onScroll={value4} data={categories} keyboardShouldPersistTaps="always" horizontal keyExtractor={function(a0) {
var String = global.String;
return String(a0.key);
}} renderItem={value7} showsHorizontalScrollIndicator={false} />)(env0_13)}
</View>
</Portal>
);
function _fun118046() { // fn#118046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2292, offset: 0x024ca4de, size: 122 bytes, params: 1, frame: 12
var categoryIndexBinding;
var value2;
var value3;
let current = env0_5.current;
if (current != null) {
categoryIndexBinding = categoryIndex;
value2 = environment.__proto__;
value3 = categoryIndexBinding * EXPRESSION_FOOTER_HEIGHT;
current = env0_6.current;
if (value3 > current || value3 < env0_5.current) {
if (current != null) {
current = env0_4.current;
current.scrollToOffset({offset: value3});
if (current != null) {
categoryIndexBinding = categoryIndex;
value2 = environment.__proto__;
value3 = categoryIndexBinding * EXPRESSION_FOOTER_HEIGHT;
current = env0_6.current;
if (value3 > current || value3 < env0_5.current) {
current = env0_4.current;
current.scrollToOffset({offset: value3});
}
}
}
}
}
function _fun118047({nativeEvent}) { // fn#118047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2455, offset: 0x024ca558, size: 49 bytes, params: 2, frame: 4
const layout = nativeEvent.layout;
env0_5.current = 0;
env0_6.current = layout.width;
}
function _fun118048({nativeEvent}) { // fn#118048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2539, offset: 0x024ca589, size: 67 bytes, params: 2, frame: 5
const contentOffset = nativeEvent.contentOffset;
const layoutMeasurement = nativeEvent.layoutMeasurement;
env0_5.current = contentOffset.x;
env0_6.current = contentOffset.x + layoutMeasurement.width;
}
function _fun118049(a0) { // fn#118049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2662, offset: 0x024ca5cc, size: 49 bytes, params: 2, frame: 12
const env0_0 = a0;
setSearchQuery('');
global.setImmediate(_fun118050);
function _fun118050() { // fn#118050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2686, offset: 0x024ca5fd, size: 131 bytes, params: 1, frame: 14
var moduleValue;
const listRefBinding = listRef;
const value2 = undefined;
if ((listRefBinding == null ? value2 : listRef.current) != null) {
listRef.current.scrollToLocation({section: env0_0, item: 0});
value = environment.__proto__.__proto__;
moduleValue = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
}
return value2;
}
}
function _fun118052({item, index}) { // fn#118052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2952, offset: 0x024ca6b3, size: 162 bytes, params: 2, frame: 17
var r0;
var value3;
var moduleValue;
const binding = env0_8;
if (binding) {
r0 = !binding;
} else {
value3 = environment.__proto__;
moduleValue = require(7898) /* metro dependency 7898: PremiumFeatureUpsellUtils */;
r0 = moduleValue.isSoundboardSectionNitroLocked(guildId, item.categoryInfo);
}
return (
<SoundCategoryItem
category={item}
index={index}
style={categoryIndex == null ? styles.fadedItem : index === categoryIndex ? styles.activeItem : styles.fadedItem}
handlePressCategory={ExpressionPickerStoreModule.setSearchQuery}
locked={r0}
/>
);
}
}
}
function _fun118047({nativeEvent}) { // fn#118047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2455, offset: 0x024ca558, size: 49 bytes, params: 2, frame: 4
const layout = nativeEvent.layout;
env0_5.current = 0;
env0_6.current = layout.width;
}
function _fun118048({nativeEvent}) { // fn#118048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2539, offset: 0x024ca589, size: 67 bytes, params: 2, frame: 5
const contentOffset = nativeEvent.contentOffset;
const layoutMeasurement = nativeEvent.layoutMeasurement;
env0_5.current = contentOffset.x;
env0_6.current = contentOffset.x + layoutMeasurement.width;
}
function _fun118049(a0) { // fn#118049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2662, offset: 0x024ca5cc, size: 49 bytes, params: 2, frame: 12
const env0_0 = a0;
setSearchQuery('');
global.setImmediate(_fun118050);
}
function _fun118052({item, index}) { // fn#118052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2952, offset: 0x024ca6b3, size: 162 bytes, params: 2, frame: 17
var r0;
var value3;
var moduleValue;
const binding = env0_8;
if (binding) {
r0 = !binding;
} else {
value3 = environment.__proto__;
moduleValue = require(7898) /* metro dependency 7898: PremiumFeatureUpsellUtils */;
r0 = moduleValue.isSoundboardSectionNitroLocked(guildId, item.categoryInfo);
}
return (
<SoundCategoryItem
category={item}
index={index}
style={categoryIndex == null ? styles.fadedItem : index === categoryIndex ? styles.activeItem : styles.fadedItem}
handlePressCategory={env0_7}
locked={r0}
/>
);
}
function _fun118050() { // fn#118050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15628:2686, offset: 0x024ca5fd, size: 131 bytes, params: 1, frame: 14
var moduleValue;
const listRefBinding = listRef;
const value2 = undefined;
if ((listRefBinding == null ? value2 : listRef.current) != null) {
listRef.current.scrollToLocation({section: env0_0, item: 0});
value = environment.__proto__.__proto__;
moduleValue = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
}
return value2;
}
global.__d(_fun118040, 15431, [31, 27, 15417, 1878, 661, 33, 4501, 697, 6639, 6819, 1244, 11053, 15429, 5278, 1305,
6705, 4081, 4082, 566, 3802, 7898, 1585, 4027, 8670,
2]) /* metro module 15431, dependencies: [31, 27, 15417, 1878, 661, 33, 4501, 697, 6639, 6819, 1244, 11053, 15429, 5278, 1305, 6705, 4081, 4082, 566, 3802, 7898, 1585, 4027, 8670, 2] */;
@@ -1,6 +1,21 @@
/* Metro module 15422; source: modules/soundboard/native/SoundboardSoundPickerList.tsx; dependencies: [31, 27, 1878, 15418, 33, 4501, 697, 6639, 1244, 8646, 566, 3802, 7898, 8597, 15423, 4584, 22, 6819, 1305, 15429, 11053, 8596, 8140, 4573, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import FastList from '../../../lib/native/FastList.tsx'; /* Metro dependency 8140 */
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 IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as UseFontScaleModule from '../../screen/native/useFontScale.tsx'; /* Metro dependency 4584 */
import * as SoundboardTypesModule from '../SoundboardTypes.tsx'; /* Metro dependency 6639 */
import * as PremiumUpsellSectionDividerModule from '../../premium/roadblocks/native/views/PremiumUpsellSectionDivider.tsx'; /* Metro dependency 8596 */
import * as SoundboardStyleConstantsModule from './SoundboardStyleConstants.tsx'; /* Metro dependency 15418 */
function _fun117974(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:6, offset: 0x024c6f89, size: 431 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
const _arrayLikeToArray_117977 = function(a0, a1) {
var r0;
@@ -47,452 +62,466 @@ function _fun117974(global, require, importDefault, importAll, module, exports,
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const soundboardStyleConstantsModule = require(15418) /* metro dependency 15418: SoundboardStyleConstants */;
const SOUND_BUTTON_HEIGHT = soundboardStyleConstantsModule.SOUND_BUTTON_HEIGHT;
const SOUND_ROW_HORIZONTAL_PADDING = soundboardStyleConstantsModule.SOUND_ROW_HORIZONTAL_PADDING;
const SOUND_ROW_SPACING = soundboardStyleConstantsModule.SOUND_ROW_SPACING;
const env0_6 = soundboardStyleConstantsModule.SOUNDS_PER_ROW;
let value3 = require(33) /* metro dependency 33 */;
let value = ReactModule;
const SOUND_BUTTON_HEIGHT = SoundboardStyleConstantsModule.SOUND_BUTTON_HEIGHT;
const SOUND_ROW_HORIZONTAL_PADDING = SoundboardStyleConstantsModule.SOUND_ROW_HORIZONTAL_PADDING;
const SOUND_ROW_SPACING = SoundboardStyleConstantsModule.SOUND_ROW_SPACING;
let value3 = JsxRuntimeModule;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
let value4 = SOUND_BUTTON_HEIGHT + 8;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
object2.row = {'height': null, 'display': 'flex', 'flexDirection': 'row', height: value4,
const createStyles = CreateStylesModule.createStyles;
object = {};
object.row = {'height': null, 'display': 'flex', 'flexDirection': 'row', height: value4,
paddingHorizontal: SOUND_ROW_HORIZONTAL_PADDING};
const MOBILE_ACTIONSHEET_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_ACTIONSHEET_BACKGROUND;
object2.sectionHeader = {'flex': 1, 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
const MOBILE_ACTIONSHEET_BACKGROUND = (Native).colors.MOBILE_ACTIONSHEET_BACKGROUND;
object.sectionHeader = {'flex': 1, 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
'paddingTop': 16, 'paddingBottom': 8, backgroundColor: MOBILE_ACTIONSHEET_BACKGROUND,
paddingHorizontal: SOUND_ROW_HORIZONTAL_PADDING};
object2.sectionIcon = {'height': 16, 'width': 16, 'borderRadius': 8, 'marginRight': 4};
object2.soundButtonNotFirst = {marginLeft: SOUND_ROW_SPACING};
const env0_10 = Reflect.apply(createStyles, createStylesModule, [object2]);
object.sectionIcon = {'height': 16, 'width': 16, 'borderRadius': 8, 'marginRight': 4};
object.soundButtonNotFirst = {marginLeft: SOUND_ROW_SPACING};
const env0_10 = Reflect.apply(createStyles, CreateStylesModule, [object]);
value = value.memo(_fun117982);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPickerList.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPickerList.tsx');
exports.SoundboardSoundPickerList = value;
}
function _createForOfIteratorHelperLoose_117975(a0, a1) { // fn#117975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:276, offset: 0x024c7138, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
function _createForOfIteratorHelperLoose_117975(a0, a1) { // fn#117975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:276, offset: 0x024c7138, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
return _fun117976;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_117977(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun117976;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_117977(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_117977(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_117977(a0, value);
r6 = value;
} else {
r6 = value;
}
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun117976;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function getSectionLabel(a0) { // fn#117978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:1580, offset: 0x024c72ac, size: 308 bytes, params: 2, frame: 16
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const type = a0.category.categoryInfo.type;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (GUILD === type) {
return a0.category.categoryInfo.guild.name;
}
const DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
if (DEFAULTS === type) {
return intl.string(t.Rtvk9X);
}
const FAVORITES = SoundboardSoundGridSectionType.FAVORITES;
if (FAVORITES === type) {
return intl.string(t.y3LQCG);
}
const SEARCH = SoundboardSoundGridSectionType.SEARCH;
if (SEARCH === type) {
return null;
}
}
function SoundPickerButtonRow({row, section, channel}) { // fn#117979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:2031, offset: 0x024c73e0, size: 290 bytes, params: 2, frame: 22
var r9;
var moduleValue2;
const styles = useStyles();
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return importDefault(dependencyMap[11]).canUseSoundboardEverywhere(UserStore.getCurrentUser());
});
if (section == null) {
return null;
}
if (value2) {
r9 = !value2;
} else {
moduleValue2 = require(7898) /* metro dependency 7898: PremiumFeatureUpsellUtils */;
r9 = moduleValue2.isSoundboardSectionNitroLocked(channel.guild_id, section.category.categoryInfo);
}
const items2 = [styles.row];
r9 = r9 && ((PremiumUpsellGradientBackground) => <PremiumUpsellGradientBackground />)((require(8597) /* metro dependency 8597: PremiumUpsellGradientBackground */).PremiumUpsellGradientBackground);
const property = section.soundsByRow[row];
return (
<View style={items2}>
{[r9, property.map(_fun117981)]}
</View>
);
}
function _fun117982({channel, insetBottom, listRef, scrollPosition, onScroll, setCategoryIndex, shouldShowPremiumUpsell, categories}) { // fn#117982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:2723, offset: 0x024c7641, size: 752 bytes, params: 2, frame: 32
var r11;
var r10;
var value;
var value5;
var items2;
var Math;
var ceil;
var length;
var value6;
var push;
var value7;
var value10;
var defaultImport;
var value11;
var value12;
var value13;
var value14;
reducibleJoin2: while (true) {
if (insetBottom !== undefined) {
break reducibleJoin2;
}
value = 0;
insetBottom = value;
break reducibleJoin2;
}
let env0_9 = undefined;
const env0_5 = useStyles();
const value2 = (require(4584) /* metro dependency 4584: useFontScale */).useFontScale();
const items4 = [];
const value3 = _createForOfIteratorHelperLoose_117975(categories);
const value4 = value3();
let done = value4.done;
if (!done) {
r11 = value4;
reducibleLoop3: while (true) {
value5 = r11.value;
items2 = value5.items;
Math = global.Math;
ceil = Math.ceil;
length = items2.length;
value6 = Reflect.apply(ceil, Math, [length / SOUNDS_PER_ROW]);
push = items4.push;
Reflect.apply(push, items4, [value6]);
value7 = value3();
done = value7.done;
if (done) {
break reducibleLoop3;
}
r11 = value7;
continue reducibleLoop3;
}
}
const items3 = [];
const value8 = _createForOfIteratorHelperLoose_117975(categories);
const value9 = value8();
done = value9.done;
if (!done) {
r10 = value9;
reducibleLoop5: while (true) {
value10 = r10.value;
defaultImport = importDefault(8646) /* metro dependency 8646 */;
items2 = value10.items;
value11 = defaultImport(items2, SOUNDS_PER_ROW);
length = value11.length;
value12 = length * env0_9;
value13 = 18 * value2;
push = items3.push;
Reflect.apply(push, items3, [{category: value10, height: value12 + (value13 + 8), soundsByRow: value11}]);
value14 = value8();
done = value14.done;
if (done) {
break reducibleLoop5;
}
r10 = value14;
continue reducibleLoop5;
}
}
const binding = setCategoryIndex;
const env0_7 = binding.useMemo(_fun117987, [items3]);
const value15 = binding.useCallback(_fun117989, [items3, channel]);
const env0_8 = (require(22) /* metro dependency 22 */).debounce(function(a0) {
setCategoryIndex(calculateCategory(a0, 0));
});
env0_9 = (require(22) /* metro dependency 22 */).debounce(_fun117991);
const env0_10 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return importDefault(dependencyMap[11]).canUseSoundboardEverywhere(UserStore.getCurrentUser());
});
return ((Component) => <Component onLayout={onLayout_117993} sections={items4} sectionSize={sectionSize} itemSize={itemSize} sectionFooterSize={sectionFooterSize} ref={listRef} renderItem={value15} renderSection={renderSection} renderSectionFooter={renderSectionFooter} insetEnd={insetBottom} onScroll={onScroll_117999} keyboardShouldPersistTaps="handled" optimizeListItemRender inActionSheet />)(importDefault(8140) /* metro dependency 8140: FastList */);
}
function _fun117981(a0, a1) { // fn#117981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:2391, offset: 0x024c7535, size: 268 bytes, params: 3, frame: 19
var sound;
const type = a0.type;
const value = environment.__proto__;
const SoundboardSoundItemType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundItemType;
const SOUND = SoundboardSoundItemType.SOUND;
if (SOUND === type) {
sound = a0.sound;
const SoundButton = (require(15423) /* metro dependency 15423: SoundButton */).SoundButton;
return (
<SoundButton
sound={sound}
channel={channel}
style={a1 > 0 ? styles.soundButtonNotFirst : null}
isSectionLocked={env0_3}
key={'' + section.category.key + '-' + sound.soundId}
/>
);
}
const ADD_SOUND = SoundboardSoundItemType.ADD_SOUND;
if (ADD_SOUND === type) {
throw new global.Error('ADD_SOUND Not implemented');
}
}
function calculateCategory(a0, a1) { // fn#117983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3399, offset: 0x024c7931, size: 118 bytes, params: 3, frame: 16
var r1;
var r2;
var r3;
var r0;
var value4;
var value5;
var value6;
var value7;
const Math = global.Math;
const value = Math.round(a0);
let length = env0_7.length;
const value3 = 0;
if (value3 < length) {
value4 = a1 + env0_7[value3];
if (value >= value4) {
r1 = value3;
r2 = value3;
r3 = value4;
while (true) {
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
value6 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
length = env0_7.length;
if (!(value6 < length)) {
r0 = value5;
break;
}
value7 = r3 + env0_7[value6];
if (value >= value7) {
r1 = value6;
r2 = value5;
r3 = value7;
continue;
}
r0 = value5;
break;
r5 = r6;
}
} else {
r0 = value3;
r5 = value;
}
} else {
r0 = value3;
if (r5) {
if (r5) {
}
return _fun117976;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun117976() { // fn#117976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:847, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
return r0;
}
function getSectionIcon(a0) { // fn#117984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3783, offset: 0x024c79a7, size: 423 bytes, params: 2, frame: 18
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const type = a0.category.categoryInfo.type;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (GUILD === type) {
return ((Component) => <Component size={(require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes.XXSMALL_12} guild={a0.category.categoryInfo.guild} style={styles.sectionIcon} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */);
function getSectionLabel(a0) { // fn#117978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:1580, offset: 0x024c72ac, size: 308 bytes, params: 2, frame: 16
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const type = a0.category.categoryInfo.type;
const SoundboardSoundGridSectionType = (SoundboardTypesModule).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (GUILD === type) {
return a0.category.categoryInfo.guild.name;
}
const DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
if (DEFAULTS === type) {
return intl.string(t.Rtvk9X);
}
const FAVORITES = SoundboardSoundGridSectionType.FAVORITES;
if (FAVORITES === type) {
return intl.string(t.y3LQCG);
}
const SEARCH = SoundboardSoundGridSectionType.SEARCH;
if (SEARCH === type) {
return null;
}
}
const DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
if (DEFAULTS === type) {
return <Icon source={importDefault(15429) /* metro dependency 15429 */} style={styles.sectionIcon} />;
}
const FAVORITES = SoundboardSoundGridSectionType.FAVORITES;
if (FAVORITES === type) {
return <Icon source={importDefault(11053) /* metro dependency 11053 */} style={styles.sectionIcon} />;
}
const SEARCH = SoundboardSoundGridSectionType.SEARCH;
if (SEARCH === type) {
return null;
}
}
function isSectionLocked(a0) { // fn#117985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4319, offset: 0x024c7b4e, size: 100 bytes, params: 2, frame: 15
var value4;
var moduleValue;
let r0 = !env0_10 && env0_6[a0] != null;
if (r0) {
value4 = environment.__proto__;
moduleValue = require(7898) /* metro dependency 7898: PremiumFeatureUpsellUtils */;
r0 = moduleValue.isSoundboardSectionNitroLocked(channel.guild_id, env0_6[a0].category.categoryInfo);
}
return r0;
}
function getSectionPosition(a0) { // fn#117986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4449, offset: 0x024c7bb2, size: 134 bytes, params: 2, frame: 14
const PremiumUpsellSectionDividerPosition = (require(8596) /* metro dependency 8596: PremiumUpsellSectionDivider */).PremiumUpsellSectionDividerPosition;
const isSectionLockedBinding = isSectionLocked;
const isSectionLockedBinding2 = isSectionLockedBinding(a0 - 1);
const isSectionLocked2 = isSectionLockedBinding(a0);
const isSectionLocked3 = isSectionLockedBinding(a0 + 1);
return isSectionLocked2 ? isSectionLocked2 ? isSectionLocked3 ? null : PremiumUpsellSectionDividerPosition.END : null : isSectionLocked3 ? isSectionLockedBinding2 ? isSectionLocked2 ? isSectionLocked3 ? null : PremiumUpsellSectionDividerPosition.END : null : PremiumUpsellSectionDividerPosition.START : isSectionLocked2 ? isSectionLocked3 ? null : PremiumUpsellSectionDividerPosition.END : null;
}
function _fun117987() { // fn#117987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3281, offset: 0x024c7c38, size: 28 bytes, params: 1, frame: 11
return env0_6.map(function(a0) {
return a0.height;
});
}
function _fun117989(a0, a1) { // fn#117989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3329, offset: 0x024c7c54, size: 58 bytes, params: 3, frame: 15
return (
<SoundPickerButtonRow
row={a1}
section={env0_6[a0]}
channel={channel}
/>
);
}
function _fun117991(a0, a1) { // fn#117991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3594, offset: 0x024c7cad, size: 91 bytes, params: 3, frame: 18
const value2 = calculateCategory(a0, -a1 / 2);
const shouldShowPremiumUpsellBinding = shouldShowPremiumUpsell;
const set = shouldShowPremiumUpsellBinding.set;
const isSectionLockedBinding = isSectionLocked;
const Math = global.Math;
Reflect.apply(set, shouldShowPremiumUpsellBinding, [isSectionLockedBinding(Math.min(value2, env0_7.length - 1))]);
}
function onLayout_117993({nativeEvent}) { // fn#117993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4709, offset: 0x024c7d08, size: 39 bytes, params: 2, frame: 13
return env0_9(0, nativeEvent.layout.height);
}
function sectionSize(a0) { // fn#117994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4768, offset: 0x024c7d2f, size: 48 bytes, params: 2, frame: 12
var r0;
var value;
const property = env0_6[a0];
if (property == null) {
r0 = 0;
} else {
value = environment.__proto__;
value = getSectionLabel(property) == null;
r0 = value ? 0 : 42;
}
return r0;
}
function itemSize(a0) { // fn#117995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4847, offset: 0x024c7d5f, size: 34 bytes, params: 2, frame: 2
return env0_6[a0] == null ? 0 : env1_9;
}
function sectionFooterSize(a0) { // fn#117996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4900, offset: 0x024c7d81, size: 78 bytes, params: 2, frame: 14
var r0;
let value = getSectionPosition(a0);
value = 0;
if (value == null) {
r0 = value;
} else {
value = environment.__proto__;
value = (require(8596) /* metro dependency 8596: PremiumUpsellSectionDivider */).PREMIUM_UPSELL_SECTION_DIVIDER_HEIGHT + (require(8596) /* metro dependency 8596: PremiumUpsellSectionDivider */).PREMIUM_UPSELL_SECTION_DIVIDER_MARGIN;
r0 = value;
}
return r0;
}
function renderSection(a0) { // fn#117997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:5079, offset: 0x024c7dcf, size: 222 bytes, params: 2, frame: 24
const property = env0_6[a0];
const items2 = [isSectionLocked(a0) && ((PremiumUpsellGradientBackground) => <PremiumUpsellGradientBackground />)((require(8597) /* metro dependency 8597: PremiumUpsellGradientBackground */).PremiumUpsellGradientBackground)];
items2[1] = getSectionIcon(property);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[2] = <Text accessibilityRole="header" lineClamp={1} variant="heading-sm/semibold">{getSectionLabel(property)}</Text>;
return (
<View key={property.category.key}>
<View style={styles.sectionHeader}>
{items2}
function SoundPickerButtonRow({row, section, channel}) { // fn#117979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:2031, offset: 0x024c73e0, size: 290 bytes, params: 2, frame: 22
var r9;
var moduleValue2;
const styles = useStyles();
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return importDefault(dependencyMap[11]).canUseSoundboardEverywhere(UserStore.getCurrentUser());
});
if (section == null) {
return null;
}
if (value2) {
r9 = !value2;
} else {
moduleValue2 = require(7898) /* metro dependency 7898: PremiumFeatureUpsellUtils */;
r9 = moduleValue2.isSoundboardSectionNitroLocked(channel.guild_id, section.category.categoryInfo);
}
const items2 = [styles.row];
r9 = r9 && ((PremiumUpsellGradientBackground) => <PremiumUpsellGradientBackground />)((require(8597) /* metro dependency 8597: PremiumUpsellGradientBackground */).PremiumUpsellGradientBackground);
const property = section.soundsByRow[row];
return (
<View style={items2}>
{[r9, property.map(_fun117981)]}
</View>
</View>
);
}
function renderSectionFooter(a0) { // fn#117998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:5408, offset: 0x024c7ead, size: 67 bytes, params: 2, frame: 16
var r0;
var value3;
let value = getSectionPosition(a0);
const value2 = null;
if (value2 != value) {
value3 = environment.__proto__;
value = ((Component) => <Component position={value} />)(importDefault(8596) /* metro dependency 8596: PremiumUpsellSectionDivider */);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function onScroll_117999(a0) { // fn#117999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:5515, offset: 0x024c7ef0, size: 146 bytes, params: 2, frame: 16
const nativeEvent = a0.nativeEvent;
const y = nativeEvent.contentOffset.y;
env0_8(y);
env0_9(y, nativeEvent.layoutMeasurement.height);
if (!(nativeEvent.layoutMeasurement.height + nativeEvent.contentOffset.y >= nativeEvent.contentSize.height - 20)) {
if (scrollPosition != null) {
scrollPosition.set(y);
}
if (onScroll != null) {
onScroll(a0);
);
function _fun117981(a0, a1) { // fn#117981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:2391, offset: 0x024c7535, size: 268 bytes, params: 3, frame: 19
var sound;
const type = a0.type;
const value = environment.__proto__;
const SoundboardSoundItemType = (SoundboardTypesModule).SoundboardSoundItemType;
const SOUND = SoundboardSoundItemType.SOUND;
if (SOUND === type) {
sound = a0.sound;
const SoundButton = (require(15423) /* metro dependency 15423: SoundButton */).SoundButton;
return (
<SoundButton
sound={sound}
channel={channel}
style={a1 > 0 ? styles.soundButtonNotFirst : null}
isSectionLocked={env0_3}
key={'' + section.category.key + '-' + sound.soundId}
/>
);
}
const ADD_SOUND = SoundboardSoundItemType.ADD_SOUND;
if (ADD_SOUND === type) {
throw new global.Error('ADD_SOUND Not implemented');
}
}
}
function _fun117982({channel, insetBottom, listRef, scrollPosition, onScroll, setCategoryIndex, shouldShowPremiumUpsell, categories}) { // fn#117982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:2723, offset: 0x024c7641, size: 752 bytes, params: 2, frame: 32
var r11;
var r10;
var value;
var value5;
var items2;
var Math;
var ceil;
var length;
var value6;
var push;
var value7;
var value10;
var defaultImport;
var value11;
var value12;
var value13;
var value14;
reducibleJoin2: while (true) {
if (insetBottom !== undefined) {
break reducibleJoin2;
}
value = 0;
insetBottom = value;
break reducibleJoin2;
}
let env0_9 = undefined;
const env0_5 = useStyles();
const value2 = (UseFontScaleModule).useFontScale();
const items4 = [];
const value3 = _createForOfIteratorHelperLoose_117975(categories);
const value4 = value3();
let done = value4.done;
if (!done) {
r11 = value4;
reducibleLoop3: while (true) {
value5 = r11.value;
items2 = value5.items;
Math = global.Math;
ceil = Math.ceil;
length = items2.length;
value6 = Reflect.apply(ceil, Math, [length / SOUNDS_PER_ROW]);
push = items4.push;
Reflect.apply(push, items4, [value6]);
value7 = value3();
done = value7.done;
if (done) {
break reducibleLoop3;
}
r11 = value7;
continue reducibleLoop3;
}
}
const items3 = [];
const value8 = _createForOfIteratorHelperLoose_117975(categories);
const value9 = value8();
done = value9.done;
if (!done) {
r10 = value9;
reducibleLoop5: while (true) {
value10 = r10.value;
defaultImport = importDefault(8646) /* metro dependency 8646 */;
items2 = value10.items;
value11 = defaultImport(items2, SOUNDS_PER_ROW);
length = value11.length;
value12 = length * env0_9;
value13 = 18 * value2;
push = items3.push;
Reflect.apply(push, items3, [{category: value10, height: value12 + (value13 + 8), soundsByRow: value11}]);
value14 = value8();
done = value14.done;
if (done) {
break reducibleLoop5;
}
r10 = value14;
continue reducibleLoop5;
}
}
const binding = setCategoryIndex;
const env0_7 = binding.useMemo(_fun117987, [items3]);
const value15 = binding.useCallback(_fun117989, [items3, channel]);
const env0_8 = (require(22) /* metro dependency 22 */).debounce(function(a0) {
setCategoryIndex(calculateCategory(a0, 0));
});
env0_9 = (require(22) /* metro dependency 22 */).debounce(_fun117991);
const env0_10 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return importDefault(dependencyMap[11]).canUseSoundboardEverywhere(UserStore.getCurrentUser());
});
return ((Component) => <Component onLayout={onLayout_117993} sections={items4} sectionSize={sectionSize_117994} itemSize={itemSize_117995} sectionFooterSize={sectionFooterSize} ref={listRef} renderItem={value15} renderSection={renderSection_117997} renderSectionFooter={renderSectionFooter} insetEnd={insetBottom} onScroll={onScroll_117999} keyboardShouldPersistTaps="handled" optimizeListItemRender inActionSheet />)(FastList);
function calculateCategory(a0, a1) { // fn#117983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3399, offset: 0x024c7931, size: 118 bytes, params: 3, frame: 16
var r1;
var r2;
var r3;
var r0;
var value4;
var value5;
var value6;
var value7;
const Math = global.Math;
const value = Math.round(a0);
let length = env0_7.length;
const value3 = 0;
if (value3 < length) {
value4 = a1 + env0_7[value3];
if (value >= value4) {
r1 = value3;
r2 = value3;
r3 = value4;
while (true) {
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
value6 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
length = env0_7.length;
if (!(value6 < length)) {
r0 = value5;
break;
}
value7 = r3 + env0_7[value6];
if (value >= value7) {
r1 = value6;
r2 = value5;
r3 = value7;
continue;
}
r0 = value5;
break;
}
} else {
r0 = value3;
}
} else {
r0 = value3;
}
return r0;
}
function getSectionIcon(a0) { // fn#117984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3783, offset: 0x024c79a7, size: 423 bytes, params: 2, frame: 18
const Icon = (NativeModule).Icon;
const type = a0.category.categoryInfo.type;
const SoundboardSoundGridSectionType = (SoundboardTypesModule).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (GUILD === type) {
return ((Component) => <Component size={(require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes.XXSMALL_12} guild={a0.category.categoryInfo.guild} style={styles.sectionIcon} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */);
}
const DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
if (DEFAULTS === type) {
return <Icon source={importDefault(15429) /* metro dependency 15429 */} style={styles.sectionIcon} />;
}
const FAVORITES = SoundboardSoundGridSectionType.FAVORITES;
if (FAVORITES === type) {
return <Icon source={importDefault(11053) /* metro dependency 11053 */} style={styles.sectionIcon} />;
}
const SEARCH = SoundboardSoundGridSectionType.SEARCH;
if (SEARCH === type) {
return null;
}
}
function isSectionLocked(a0) { // fn#117985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4319, offset: 0x024c7b4e, size: 100 bytes, params: 2, frame: 15
var value4;
var moduleValue;
let r0 = !env0_10 && SoundboardStyleConstantsModule.SOUNDS_PER_ROW[a0] != null;
if (r0) {
value4 = environment.__proto__;
moduleValue = require(7898) /* metro dependency 7898: PremiumFeatureUpsellUtils */;
r0 = moduleValue.isSoundboardSectionNitroLocked(channel.guild_id, SoundboardStyleConstantsModule.SOUNDS_PER_ROW[a0].category.categoryInfo);
}
return r0;
}
function getSectionPosition(a0) { // fn#117986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4449, offset: 0x024c7bb2, size: 134 bytes, params: 2, frame: 14
const PremiumUpsellSectionDividerPosition = (PremiumUpsellSectionDividerModule).PremiumUpsellSectionDividerPosition;
const isSectionLockedBinding = isSectionLocked;
const isSectionLockedBinding2 = isSectionLockedBinding(a0 - 1);
const isSectionLocked2 = isSectionLockedBinding(a0);
const isSectionLocked3 = isSectionLockedBinding(a0 + 1);
return isSectionLocked2 ? isSectionLocked2 ? isSectionLocked3 ? null : PremiumUpsellSectionDividerPosition.END : null : isSectionLocked3 ? isSectionLockedBinding2 ? isSectionLocked2 ? isSectionLocked3 ? null : PremiumUpsellSectionDividerPosition.END : null : PremiumUpsellSectionDividerPosition.START : isSectionLocked2 ? isSectionLocked3 ? null : PremiumUpsellSectionDividerPosition.END : null;
}
function _fun117987() { // fn#117987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3281, offset: 0x024c7c38, size: 28 bytes, params: 1, frame: 11
return SoundboardStyleConstantsModule.SOUNDS_PER_ROW.map(function(a0) {
return a0.height;
});
}
function _fun117989(a0, a1) { // fn#117989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3329, offset: 0x024c7c54, size: 58 bytes, params: 3, frame: 15
return (
<SoundPickerButtonRow
row={a1}
section={SoundboardStyleConstantsModule.SOUNDS_PER_ROW[a0]}
channel={channel}
/>
);
}
function _fun117991(a0, a1) { // fn#117991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:3594, offset: 0x024c7cad, size: 91 bytes, params: 3, frame: 18
const value2 = calculateCategory(a0, -a1 / 2);
const shouldShowPremiumUpsellBinding = shouldShowPremiumUpsell;
const set = shouldShowPremiumUpsellBinding.set;
const isSectionLockedBinding = isSectionLocked;
const Math = global.Math;
Reflect.apply(set, shouldShowPremiumUpsellBinding, [isSectionLockedBinding(Math.min(value2, env0_7.length - 1))]);
}
function onLayout_117993({nativeEvent}) { // fn#117993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4709, offset: 0x024c7d08, size: 39 bytes, params: 2, frame: 13
return env0_9(0, nativeEvent.layout.height);
}
function sectionSize_117994(a0) { // fn#117994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4768, offset: 0x024c7d2f, size: 48 bytes, params: 2, frame: 12
var r0;
var value;
const property = SoundboardStyleConstantsModule.SOUNDS_PER_ROW[a0];
if (property == null) {
r0 = 0;
} else {
value = environment.__proto__;
value = getSectionLabel(property) == null;
r0 = value ? 0 : 42;
}
return r0;
}
function itemSize_117995(a0) { // fn#117995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4847, offset: 0x024c7d5f, size: 34 bytes, params: 2, frame: 2
return SoundboardStyleConstantsModule.SOUNDS_PER_ROW[a0] == null ? 0 : env1_9;
}
function sectionFooterSize(a0) { // fn#117996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:4900, offset: 0x024c7d81, size: 78 bytes, params: 2, frame: 14
var r0;
let value = getSectionPosition(a0);
value = 0;
if (value == null) {
r0 = value;
} else {
value = environment.__proto__;
value = (require(8596) /* metro dependency 8596: PremiumUpsellSectionDivider */).PREMIUM_UPSELL_SECTION_DIVIDER_HEIGHT + (require(8596) /* metro dependency 8596: PremiumUpsellSectionDivider */).PREMIUM_UPSELL_SECTION_DIVIDER_MARGIN;
r0 = value;
}
return r0;
}
function renderSection_117997(a0) { // fn#117997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:5079, offset: 0x024c7dcf, size: 222 bytes, params: 2, frame: 24
const property = SoundboardStyleConstantsModule.SOUNDS_PER_ROW[a0];
const items2 = [
isSectionLocked(a0) && ((PremiumUpsellGradientBackground) => <PremiumUpsellGradientBackground />)((require(8597) /* metro dependency 8597: PremiumUpsellGradientBackground */).PremiumUpsellGradientBackground),
];
items2[1] = getSectionIcon(property);
const Text = (TextModule).Text;
items2[2] = (
<Text
accessibilityRole="header"
lineClamp={1}
variant="heading-sm/semibold"
>
{getSectionLabel(property)}
</Text>
);
return (
<View key={property.category.key}>
<View style={styles.sectionHeader}>
{items2}
</View>
</View>
);
}
function renderSectionFooter(a0) { // fn#117998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:5408, offset: 0x024c7ead, size: 67 bytes, params: 2, frame: 16
var r0;
var value3;
let value = getSectionPosition(a0);
const value2 = null;
if (value2 != value) {
value3 = environment.__proto__;
value = ((Component) => <Component position={value} />)(importDefault(8596) /* metro dependency 8596: PremiumUpsellSectionDivider */);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function onScroll_117999(a0) { // fn#117999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15619:5515, offset: 0x024c7ef0, size: 146 bytes, params: 2, frame: 16
const nativeEvent = a0.nativeEvent;
const y = nativeEvent.contentOffset.y;
env0_8(y);
env0_9(y, nativeEvent.layoutMeasurement.height);
if (!(nativeEvent.layoutMeasurement.height + nativeEvent.contentOffset.y >= nativeEvent.contentSize.height - 20)) {
if (scrollPosition != null) {
scrollPosition.set(y);
}
if (onScroll != null) {
onScroll(a0);
}
}
}
}
}
global.__d(_fun117974, 15422, [31, 27, 1878, 15418, 33, 4501, 697, 6639, 1244, 8646, 566, 3802, 7898, 8597, 15423,
4584, 22, 6819, 1305, 15429, 11053, 8596, 8140, 4573,
2]) /* metro module 15422, dependencies: [31, 27, 1878, 15418, 33, 4501, 697, 6639, 1244, 8646, 566, 3802, 7898, 8597, 15423, 4584, 22, 6819, 1305, 15429, 11053, 8596, 8140, 4573, 2] */;
@@ -1,150 +1,171 @@
/* Metro module 15428; source: modules/soundboard/native/SoundboardSoundPreviewActionSheet.tsx; dependencies: [29, 31, 27, 1878, 4613, 661, 33, 4501, 697, 477, 566, 6771, 6944, 6951, 6639, 4583, 6805, 6739, 11508, 4573, 4578, 8633, 8635, 1244, 8146, 4017, 2] */
import ObjectWithoutProperties from '../../../by-id/module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import SoundboardStore from '../SoundboardStore.tsx'; /* Metro dependency 4613 */
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule 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 TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as ButtonHooksNativeModule from '../../../design/components/Button/native/ButtonHooks.native.tsx'; /* Metro dependency 4583 */
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
function _fun118030(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:6, offset: 0x024c927c, size: 641 bytes, params: 8, frame: 25
var object2;
const env0_0 = require;
const env0_3 = ['style'];
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = undefined;
const env0_4 = importDefault(29) /* metro dependency 29 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_6 = value2.View;
const env0_7 = value2.Image;
const StyleSheet = value2.StyleSheet;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
const env0_10 = (require(661) /* metro dependency 661: Constants */).AnalyticsObjects;
const value3 = require(33) /* metro dependency 33 */;
const env0_11 = value3.jsx;
const env0_12 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
const StyleSheet = ReactNativeModule.StyleSheet;
const createStyles = CreateStylesModule.createStyles;
object = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.emoji = {'marginTop': null, 'width': 64, 'height': 64, 'alignSelf': 'center', marginTop: PX_16};
object2.emojiFastImage = {'width': 128, 'height': 128};
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
object2.emojiText = {fontSize: platformUtilsModule.isIOS() ? 60 : value, lineHeight: 74};
object.emoji = {'marginTop': null, 'width': 64, 'height': 64, 'alignSelf': 'center', marginTop: PX_16};
object.emojiFastImage = {'width': 128, 'height': 128};
object.emojiText = {fontSize: PlatformUtilsModule.isIOS() ? 60 : value, lineHeight: 74};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.text = {marginTop: PX_16, alignSelf: 'center'};
const object3 = {};
object.text = {marginTop: PX_16, alignSelf: 'center'};
const object5 = {};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.gap = PX_8;
object5.gap = PX_8;
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
object3.marginTop = PX_24;
object2.buttonContainer = object3;
object5.marginTop = PX_24;
object.buttonContainer = object5;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
object2.star = {'width': 16, 'height': 16, tintColor: TEXT_DEFAULT};
const object4 = {'borderColor': 'transparent', 'borderWidth': 1, 'borderRadius': null, 'pointerEvents': 'none'};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
copyDataProperties(object4, StyleSheet.absoluteFillObject, undefined);
object2.border = object4;
object.star = {'width': 16, 'height': 16, tintColor: TEXT_DEFAULT};
const object6 = {'borderColor': 'transparent', 'borderWidth': 1, 'borderRadius': null, 'pointerEvents': 'none'};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
copyDataProperties(object6, StyleSheet.absoluteFillObject, undefined);
object.border = object6;
const TEXT_FEEDBACK_POSITIVE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_POSITIVE;
object2.borderPlaying = {borderColor: TEXT_FEEDBACK_POSITIVE};
const env0_13 = Reflect.apply(createStyles, createStylesModule, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPreviewActionSheet.tsx');
object.borderPlaying = {borderColor: TEXT_FEEDBACK_POSITIVE};
const env0_13 = Reflect.apply(createStyles, CreateStylesModule, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPreviewActionSheet.tsx');
exports.default = SoundboardSoundPreviewActionSheet;
return value;
}
function SoundboardSoundPreviewActionSheet({channelId, sound}) { // fn#118031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:943, offset: 0x024c94fd, size: 1057 bytes, params: 2, frame: 38
const styles = useStyles();
const env0_2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun118032);
const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
const env0_3 = analyticsLocations;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([SoundboardStore],
_fun118033);
const isPlayingSound = value2.isPlayingSound;
const env0_4 = isPlayingSound;
const isFavorite = value2.isFavorite;
const binding = isFavorite;
const value3 = binding.useCallback(_fun118034, [isFavorite, sound, analyticsLocations]);
const value4 = binding.useCallback(_fun118035, [channelId, sound, isPlayingSound]);
const value5 = (require(4583) /* metro dependency 4583: ButtonHooksNative */).useButtonPressAnimationProps();
const style = value5.style;
const value6 = env0_4(value5, env0_3);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const items3 = [((Component) => <Component fastImageStyle={[styles.emoji,
styles.emojiFastImage]} textEmojiStyle={[styles.emoji,
styles.emojiText]} src={(importDefault(11508) /* metro dependency 11508: getSoundboardEmojiUrl */)(sound,
64)} name={sound.emojiName ?? ''} />)(importDefault(6739) /* metro dependency 6739: Emoji */)];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items3[1] = <Text style={styles.text} variant="heading-lg/extrabold">{sound.name}</Text>;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const buttonProps2 = {variant: 'primary',
icon: ((Component) => <Component style={styles.star} />)(isFavorite ? (require(8633) /* metro dependency 8633: StarIcon */).StarIcon : (require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
buttonProps2.text = isFavorite ? Reflect.apply(string, intl, [t.aBUcp3]) : Reflect.apply(string, intl, [t.yZFibY]);
buttonProps2.onPress = value3;
const button = <Button {...buttonProps2} />;
const buttonProps = {...value6};
buttonProps['variant'] = 'secondary';
buttonProps['icon'] = <Image style={styles.star} source={importDefault(8146) /* metro dependency 8146 */} />;
string = intl.string;
const Kd4uxG = (require(1244) /* metro dependency 1244: indexNative */).t.Kd4uxG;
buttonProps['text'] = Reflect.apply(string, intl, [Kd4uxG]);
buttonProps['onPress'] = value4;
const button2 = <Button {...buttonProps} />;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
items3[2] = <View style={styles.buttonContainer}>{button}<View>{button2}<View2 style={[styles.border,
isPlayingSound && styles.borderPlaying, style]} /></View></View>;
return (
<ActionSheet startExpanded>
<View>
{items3}
function SoundboardSoundPreviewActionSheet({channelId, sound}) { // fn#118031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:943, offset: 0x024c94fd, size: 1057 bytes, params: 2, frame: 38
const styles = useStyles();
const env0_2 = (FluxModule).useStateFromStores([UserStore], _fun118032);
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
const analyticsLocations2 = analyticsLocations;
const value2 = (FluxModule).useStateFromStoresObject([SoundboardStore],
_fun118033);
const isPlayingSound = value2.isPlayingSound;
const isPlayingSound2 = isPlayingSound;
const isFavorite = value2.isFavorite;
const binding = isFavorite;
const value3 = binding.useCallback(_fun118034, [isFavorite, sound, analyticsLocations]);
const value4 = binding.useCallback(_fun118035, [channelId, sound, isPlayingSound]);
const value5 = (ButtonHooksNativeModule).useButtonPressAnimationProps();
const style = value5.style;
const isPlayingSound22 = isPlayingSound2(value5, analyticsLocations2);
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
const items3 = [
((Component) => <Component fastImageStyle={[styles.emoji, styles.emojiFastImage]} textEmojiStyle={[styles.emoji,
styles.emojiText]} src={(importDefault(11508) /* metro dependency 11508: getSoundboardEmojiUrl */)(sound,
64)} name={sound.emojiName ?? ''} />)(importDefault(6739) /* metro dependency 6739: Emoji */),
];
const Text = (TextModule).Text;
items3[1] = (
<Text style={styles.text} variant="heading-lg/extrabold">
{sound.name}
</Text>
);
const Button = (ButtonNativeModule).Button;
const buttonProps2 = {variant: 'primary',
icon: ((Component) => <Component style={styles.star} />)(isFavorite ? (require(8633) /* metro dependency 8633: StarIcon */).StarIcon : (require(8635) /* metro dependency 8635: StarOutlineIcon */).StarOutlineIcon)};
const intl = (IndexNativeModule).intl;
let string = intl.string;
const t = (IndexNativeModule).t;
buttonProps2.text = isFavorite ? Reflect.apply(string, intl, [t.aBUcp3]) : Reflect.apply(string, intl, [t.yZFibY]);
buttonProps2.onPress = value3;
const button = <Button {...buttonProps2} />;
const buttonProps = {...isPlayingSound22};
buttonProps['variant'] = 'secondary';
buttonProps['icon'] = <Image style={styles.star} source={importDefault(8146) /* metro dependency 8146 */} />;
string = intl.string;
const Kd4uxG = (IndexNativeModule).t.Kd4uxG;
buttonProps['text'] = Reflect.apply(string, intl, [Kd4uxG]);
buttonProps['onPress'] = value4;
const button2 = <Button {...buttonProps} />;
const View2 = (ReanimatedRexport).View;
items3[2] = (
<View style={styles.buttonContainer}>
{button}
<View>
{button2}
<View2 style={[styles.border, isPlayingSound && styles.borderPlaying, style]} />
</View>
</View>
</ActionSheet>
);
}
);
return (
<ActionSheet startExpanded>
<View>
{items3}
</View>
</ActionSheet>
);
function _fun118032() { // fn#118032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1056, offset: 0x024c991e, size: 34 bytes, params: 1, frame: 10
const value = environment.__proto__;
return UserStore.getCurrentUser()?.id;
}
function _fun118032() { // fn#118032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1056, offset: 0x024c991e, size: 34 bytes, params: 1, frame: 10
const value = environment.__proto__;
return UserStore.getCurrentUser()?.id;
}
function _fun118033() { // fn#118033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1191, offset: 0x024c9940, size: 82 bytes, params: 1, frame: 14
const r2 = env0_2 != null && SoundboardStore.isUserPlayingSounds(env0_2);
const soundboardStoreBinding = SoundboardStore;
return {isPlayingSound: r2, isFavorite: soundboardStoreBinding.isFavoriteSound(sound.soundId)};
}
function _fun118033() { // fn#118033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1191, offset: 0x024c9940, size: 82 bytes, params: 1, frame: 14
return {isPlayingSound: env0_2 != null && SoundboardStore.isUserPlayingSounds(env0_2),
isFavorite: SoundboardStore.isFavoriteSound(sound.soundId)};
}
function _fun118034() { // fn#118034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1341, offset: 0x024c9992, size: 163 bytes, params: 1, frame: 20
var moduleValue;
var trackSoundFavorited;
var object;
var soundBinding;
var object2;
var moduleValue2;
var value;
if (isFavorite) {
moduleValue2 = require(6944) /* metro dependency 6944: SoundboardActionCreators */;
moduleValue2.removeFavoriteSound(sound.soundId);
} else {
moduleValue = require(6951) /* metro dependency 6951: SoundboardUtils */;
trackSoundFavorited = moduleValue.trackSoundFavorited;
object = {};
soundBinding = sound;
object.sound = soundBinding;
object2 = {};
copyDataProperties(object2, analyticsLocations, undefined);
object2['object'] = AnalyticsObjects.SOUNDBOARD_SOUND;
object.location = object2;
Reflect.apply(trackSoundFavorited, moduleValue, [object]);
value = require(6944) /* metro dependency 6944: SoundboardActionCreators */;
value.addFavoriteSound(soundBinding.soundId);
}
}
function _fun118034() { // fn#118034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1341, offset: 0x024c9992, size: 163 bytes, params: 1, frame: 20
var moduleValue;
var trackSoundFavorited;
var object3;
var soundBinding;
var object4;
var moduleValue2;
var value;
if (isFavorite) {
moduleValue2 = require(6944) /* metro dependency 6944: SoundboardActionCreators */;
moduleValue2.removeFavoriteSound(sound.soundId);
} else {
moduleValue = require(6951) /* metro dependency 6951: SoundboardUtils */;
trackSoundFavorited = moduleValue.trackSoundFavorited;
object3 = {};
soundBinding = sound;
object3.sound = soundBinding;
object4 = {};
copyDataProperties(object4, analyticsLocations, undefined);
object4['object'] = AnalyticsObjects.SOUNDBOARD_SOUND;
object3.location = object4;
Reflect.apply(trackSoundFavorited, moduleValue, [object3]);
value = require(6944) /* metro dependency 6944: SoundboardActionCreators */;
value.addFavoriteSound(soundBinding.soundId);
}
}
function _fun118035() { // fn#118035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1537, offset: 0x024c9a35, size: 84 bytes, params: 1, frame: 18
var value2;
var moduleValue;
if (!isPlayingSound) {
value2 = environment.__proto__;
moduleValue = require(6944) /* metro dependency 6944: SoundboardActionCreators */;
moduleValue.playSoundLocally(channelId, sound,
(require(6639) /* metro dependency 6639: SoundboardTypes */).LocalSoundTrigger.SOUNDBOARD);
}
}
function _fun118035() { // fn#118035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15625:1537, offset: 0x024c9a35, size: 84 bytes, params: 1, frame: 18
var value2;
var moduleValue;
if (!isPlayingSound) {
value2 = environment.__proto__;
moduleValue = require(6944) /* metro dependency 6944: SoundboardActionCreators */;
moduleValue.playSoundLocally(channelId, sound,
(require(6639) /* metro dependency 6639: SoundboardTypes */).LocalSoundTrigger.SOUNDBOARD);
}
}
global.__d(_fun118030, 15428, [29, 31, 27, 1878, 4613, 661, 33, 4501, 697, 477, 566, 6771, 6944, 6951, 6639, 4583,
6805, 6739, 11508, 4573, 4578, 8633, 8635, 1244, 8146, 4017,
2]) /* metro module 15428, dependencies: [29, 31, 27, 1878, 4613, 661, 33, 4501, 697, 477, 566, 6771, 6944, 6951, 6639, 4583, 6805, 6739, 11508, 4573, 4578, 8633, 8635, 1244, 8146, 4017, 2] */;
@@ -1,8 +1,10 @@
/* Metro module 15418; source: modules/soundboard/native/SoundboardStyleConstants.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun117939(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15615:6, offset: 0x024c5daf, size: 117 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/SoundboardStyleConstants.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardStyleConstants.tsx');
exports.SOUND_BUTTON_HEIGHT = 88;
exports.SOUND_ROW_HORIZONTAL_PADDING = 12;
exports.SOUND_ROW_SPACING = 8;
@@ -10,3 +12,4 @@ function _fun117939(global, require, importDefault, importAll, module, exports,
exports.SOUND_ROW_PADDING = 40;
}
global.__d(_fun117939, 15418, [2]) /* metro module 15418, dependencies: [2] */;
@@ -1,21 +1,24 @@
/* Metro module 11508; source: modules/soundboard/native/utils/getSoundboardEmojiUrl.tsx; dependencies: [1423, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun88116(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11694:6, offset: 0x01fd5c22, size: 99 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/utils/getSoundboardEmojiUrl.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/utils/getSoundboardEmojiUrl.tsx');
exports.default = getSoundboardEmojiUrl;
}
function getSoundboardEmojiUrl({emojiId}, a1) { // fn#88117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11694:193, offset: 0x01fd5c85, size: 77 bytes, params: 3, frame: 14
var r0;
let value = undefined;
if (emojiId == null) {
r0 = value;
} else {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: emojiId, animated: false, size: a1});
r0 = value;
function getSoundboardEmojiUrl({emojiId}, a1) { // fn#88117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11694:193, offset: 0x01fd5c85, size: 77 bytes, params: 3, frame: 14
var r0;
let value = undefined;
if (emojiId == null) {
r0 = value;
} else {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: emojiId, animated: false, size: a1});
r0 = value;
}
return r0;
}
return r0;
}
global.__d(_fun88116, 11508, [1423, 2]) /* metro module 11508, dependencies: [1423, 2] */;
@@ -1,17 +1,20 @@
/* Metro module 15427; source: modules/soundboard/native/utils/openSoundboardSoundPreviewActionSheet.tsx; dependencies: [4080, 15428, 1962, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun118028(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15624:6, offset: 0x024c91b5, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/native/utils/openSoundboardSoundPreviewActionSheet.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/utils/openSoundboardSoundPreviewActionSheet.tsx');
exports.default = openSoundboardSoundPreviewActionSheet;
function openSoundboardSoundPreviewActionSheet(a0, a1) { // fn#118029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15624:209, offset: 0x024c921c, size: 96 bytes, params: 3, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'SoundboardSoundPreviewActionSheet', {channelId: a0, sound: a1}]);
}
}
function openSoundboardSoundPreviewActionSheet(a0, a1) { // fn#118029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15624:209, offset: 0x024c921c, size: 96 bytes, params: 3, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'SoundboardSoundPreviewActionSheet', {channelId: a0, sound: a1}]);
}
global.__d(_fun118028, 15427, [4080, 15428, 1962, 2]) /* metro module 15427, dependencies: [4080, 15428, 1962, 2] */;
+87 -84
View File
@@ -1,4 +1,10 @@
/* Metro module 6948; source: modules/soundboard/searchSounds.tsx; dependencies: [6540, 661, 6949, 683, 3797, 6590, 6951, 2] */
import EmojiStore from '../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
import defaultImport3 from '../../by-id/module-06590.js'; /* Metro dependency 6590 */
import Module06949 from '../../by-id/module-06949.js'; /* Metro dependency 6949 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun55262(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:6, offset: 0x0137a1f9, size: 217 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = function(a0, a1) {
@@ -14,99 +20,96 @@ function _fun55262(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.AnalyticEvents;
const env0_5 = constantsModule.SearchTypes;
const env0_6 = (importDefault(6949) /* metro dependency 6949 */)(closure, 350);
const env0_7 = (importDefault(6949) /* metro dependency 6949 */)(closure2, 350);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/searchSounds.tsx');
const env0_6 = (Module06949)(closure, 350);
const env0_7 = (Module06949)(closure2, 350);
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/searchSounds.tsx');
exports.trackSearchStart = closure;
exports.trackSearchResultViewed = closure2;
exports.searchSounds = searchSounds;
}
function searchSounds(a0, a1, a2, a3, a4) { // fn#55265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:681, offset: 0x0137a387, size: 130 bytes, params: 6, frame: 19
const env0_0 = a0;
const env0_1 = a2;
const env0_2 = a3;
const env0_3 = a4;
const env0_4 = a1.reduce(_fun55266, {});
let value = a1.filter(_fun55271);
value = value.sort(_fun55272);
env0_7(value, a4, a3?.id, a0);
return value;
function _fun55266(a0, a1) { // fn#55266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:730, offset: 0x0137a409, size: 102 bytes, params: 3, frame: 19
env1_6(env0_3, importAll?.id);
a0[a1.soundId] = getScore(env0_0.toLocaleLowerCase(), a1, importDefault, importAll);
return a0;
function getScore(a0, a1, a2, a3) { // fn#55267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:776, offset: 0x0137a46f, size: 506 bytes, params: 5, frame: 21
var environment;
var r8;
var r1;
var value5;
var defaultImport;
const env0_0 = a0;
let name = a1.name;
let value = name.toLocaleLowerCase();
const emojiId = a1.emojiId;
const value2 = null;
const r0 = value2 != emojiId ? EmojiStore.getCustomEmojiById(a1.emojiId) : value2;
if (value2 != a1.emojiName) {
value5 = environment.__proto__.__proto__;
defaultImport = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */;
r8 = defaultImport.convertSurrogateToName(a1.emojiName, false);
} else {
r8 = value2;
}
let r4 = value2 != r8 ? (importDefault(3797) /* metro dependency 3797: UnicodeEmojis */).getByName(r8) : value2;
const r7 = value2 != r0 ? [r0.name] : value2 != (value2 == r4 ? undefined : r4.names) ? value2 == r4 ? undefined : r4.names : [];
const value10 = 0;
let r5 = a0 !== value ? value10 : 8;
r4 = r7.includes(a0) ? r5 + 7 : r5;
r5 = value.startsWith(a0) ? r4 + 6 : r4;
r4 = r7.some(_fun55268) ? r5 + 5 : r5;
const r3 = value.endsWith(a0) ? r4 + 4 : r4;
r8 = r7.some(_fun55269) ? r3 + 3 : r3;
value = environment.__proto__.__proto__;
name = a1.name;
r5 = defaultImport3(a0, name.toLocaleLowerCase()) ? r8 + 2 : r8;
const r2 = r7.some(_fun55270) ? r5 + 1 : r5;
const value17 = r2 > value10;
if (value17) {
value = require(6951) /* metro dependency 6951: SoundboardUtils */;
value = value.canUseSoundboardSound(a2, a1, a3);
r1 = value;
} else {
r1 = value17;
}
return r1 ? r2 + 100 : r2;
function _fun55268(a0) { // fn#55268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1137, offset: 0x0137a669, size: 23 bytes, params: 2, frame: 11
return a0.startsWith(env0_0);
}
function searchSounds(a0, a1, a2, a3, a4) { // fn#55265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:681, offset: 0x0137a387, size: 130 bytes, params: 6, frame: 19
const env0_0 = a0;
const env0_1 = a2;
const env0_2 = a3;
const env0_3 = a4;
const env0_4 = a1.reduce(_fun55266, {});
let value = a1.filter(_fun55271);
value = value.sort(_fun55272);
env0_7(value, a4, a3?.id, a0);
return value;
}
function _fun55269(a0) { // fn#55269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1196, offset: 0x0137a680, size: 23 bytes, params: 2, frame: 11
return a0.endsWith(env0_0);
}
function _fun55266(a0, a1) { // fn#55266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:730, offset: 0x0137a409, size: 102 bytes, params: 3, frame: 19
env1_6(env0_3, importAll?.id);
a0[a1.soundId] = getScore(env0_0.toLocaleLowerCase(), a1, importDefault, importAll);
return a0;
}
function _fun55270(a0) { // fn#55270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1277, offset: 0x0137a697, size: 43 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__.__proto__;
return (defaultImport3)(env0_0, a0);
}
function _fun55271({soundId}) { // fn#55271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1407, offset: 0x0137a6c2, size: 28 bytes, params: 2, frame: 2
return env0_4[soundId] > 0;
}
}
function _fun55272({soundId}, {soundId}) { // fn#55272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1433, offset: 0x0137a6de, size: 39 bytes, params: 3, frame: 3
const binding = env0_4;
return binding[soundId] - binding[soundId];
}
}
function _fun55271({soundId}) { // fn#55271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1407, offset: 0x0137a6c2, size: 28 bytes, params: 2, frame: 2
return env0_4[soundId] > 0;
}
function _fun55272({soundId}, {soundId}) { // fn#55272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1433, offset: 0x0137a6de, size: 39 bytes, params: 3, frame: 3
const binding = env0_4;
return binding[soundId] - binding[soundId];
}
function getScore(a0, a1, a2, a3) { // fn#55267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:776, offset: 0x0137a46f, size: 506 bytes, params: 5, frame: 21
var environment;
var r8;
var r1;
var value5;
var defaultImport;
const env0_0 = a0;
let name = a1.name;
let value = name.toLocaleLowerCase();
const emojiId = a1.emojiId;
const value2 = null;
const r0 = value2 != emojiId ? EmojiStore.getCustomEmojiById(a1.emojiId) : value2;
if (value2 != a1.emojiName) {
value5 = environment.__proto__.__proto__;
defaultImport = importDefault(3797) /* metro dependency 3797: UnicodeEmojis */;
r8 = defaultImport.convertSurrogateToName(a1.emojiName, false);
} else {
r8 = value2;
}
let r4 = value2 != r8 ? (importDefault(3797) /* metro dependency 3797: UnicodeEmojis */).getByName(r8) : value2;
const r7 = value2 != r0 ? [r0.name] : value2 != (value2 == r4 ? undefined : r4.names) ? value2 == r4 ? undefined : r4.names : [];
const value10 = 0;
let r5 = a0 !== value ? value10 : 8;
r4 = r7.includes(a0) ? r5 + 7 : r5;
r5 = value.startsWith(a0) ? r4 + 6 : r4;
r4 = r7.some(_fun55268) ? r5 + 5 : r5;
const r3 = value.endsWith(a0) ? r4 + 4 : r4;
r8 = r7.some(_fun55269) ? r3 + 3 : r3;
value = environment.__proto__.__proto__;
const defaultImport3 = importDefault(6590) /* metro dependency 6590 */;
name = a1.name;
r5 = defaultImport3(a0, name.toLocaleLowerCase()) ? r8 + 2 : r8;
const r2 = r7.some(_fun55270) ? r5 + 1 : r5;
const value17 = r2 > value10;
if (value17) {
value = require(6951) /* metro dependency 6951: SoundboardUtils */;
value = value.canUseSoundboardSound(a2, a1, a3);
r1 = value;
} else {
r1 = value17;
}
return r1 ? r2 + 100 : r2;
}
function _fun55268(a0) { // fn#55268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1137, offset: 0x0137a669, size: 23 bytes, params: 2, frame: 11
return a0.startsWith(env0_0);
}
function _fun55269(a0) { // fn#55269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1196, offset: 0x0137a680, size: 23 bytes, params: 2, frame: 11
return a0.endsWith(env0_0);
}
function _fun55270(a0) { // fn#55270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7126:1277, offset: 0x0137a697, size: 43 bytes, params: 2, frame: 13
const value = environment.__proto__.__proto__.__proto__;
return (importDefault(6590) /* metro dependency 6590 */)(env0_0, a0);
}
global.__d(_fun55262, 6948, [6540, 661, 6949, 683, 3797, 6590, 6951,
2]) /* metro module 6948, dependencies: [6540, 661, 6949, 683, 3797, 6590, 6951, 2] */;
+43 -36
View File
@@ -1,43 +1,50 @@
/* Metro module 6979; source: modules/soundboard/trackSoundPlayed.tsx; dependencies: [4266, 1379, 4294, 1934, 4614, 661, 1880, 683, 2] */
import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import RunningGameStoreNative from '../game_detection/RunningGameStore.native.tsx'; /* Metro dependency 4266 */
import RTCConnectionStore from '../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as PremiumConstantsModule from '../premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as SoundboardConstantsModule from './SoundboardConstants.tsx'; /* Metro dependency 4614 */
function _fun55358(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7157:6, offset: 0x013a4468, size: 236 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const runningGameStoreNative = importDefault(4266) /* metro dependency 4266: RunningGameStoreNative */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
const env0_6 = (require(4614) /* metro dependency 4614: SoundboardConstants */).DEFAULT_SOUND_GUILD_ID;
const env0_7 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const premiumConstantsModule = require(1880) /* metro dependency 1880: PremiumConstants */;
const env0_8 = premiumConstantsModule.AnalyticsPremiumFeatureNames;
const env0_9 = premiumConstantsModule.AnalyticsPremiumFeatureTiers;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/trackSoundPlayed.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/trackSoundPlayed.tsx');
exports.default = trackSoundPlayed;
function trackSoundPlayed(a0, a1, a2, a3, a4) { // fn#55359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7157:353, offset: 0x013a4554, size: 387 bytes, params: 6, frame: 25
const channelStoreBinding = ChannelStore;
const getChannel = channelStoreBinding.getChannel;
const selectedChannelStoreBinding = SelectedChannelStore;
const getVoiceChannelId = selectedChannelStoreBinding.getVoiceChannelId;
const value2 = Reflect.apply(getChannel, channelStoreBinding, [Reflect.apply(getVoiceChannelId,
selectedChannelStoreBinding, [])]);
const value3 = null;
const value4 = undefined;
const r12 = value3 == value2 ? value4 : value2.getGuildId();
const rtcConnectionStoreBinding = RTCConnectionStore;
const mediaSessionId = rtcConnectionStoreBinding.getMediaSessionId();
const rTCConnectionId = rtcConnectionStoreBinding.getRTCConnectionId();
const currentGameForAnalytics = RunningGameStoreNative.getCurrentGameForAnalytics();
const name = value3 == currentGameForAnalytics ? value4 : currentGameForAnalytics.name;
let r13 = r12 !== a2.guildId && a2.guildId !== DEFAULT_SOUND_GUILD_ID;
const r8 = a2.guildId === DEFAULT_SOUND_GUILD_ID ? 'default' : r13 ? 'custom-external' : 'custom';
const defaultImport = AnalyticsUtils;
const track = defaultImport.track;
const PREMIUM_FEATURE_USAGE = AnalyticEvents.PREMIUM_FEATURE_USAGE;
const SOUNDBOARD_PLAY = AnalyticsPremiumFeatureNames.SOUNDBOARD_PLAY;
r13 = r13 ? AnalyticsPremiumFeatureTiers.PREMIUM_STANDARD : AnalyticsPremiumFeatureTiers.FREE;
Reflect.apply(track, defaultImport, [PREMIUM_FEATURE_USAGE, {feature_name: SOUNDBOARD_PLAY, feature_tier: r13,
guild_id: r12, home_guild_id: a2.guildId, location_stack: a0, rtc_connection_id: rTCConnectionId,
media_session_id: mediaSessionId, in_overlay: a1, application_name: name,
emoji_count: value3 != a2.emojiId || value3 != a2.emojiName ? 1 : 0, feature_selection: r8,
feature_selection_id: a2.soundId, sound_type: a3, sequence_number: value3 != a4 ? a4 + 1 : value3}]);
return value4;
}
}
function trackSoundPlayed(a0, a1, a2, a3, a4) { // fn#55359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7157:353, offset: 0x013a4554, size: 387 bytes, params: 6, frame: 25
const getChannel = ChannelStore.getChannel;
const getVoiceChannelId = SelectedChannelStore.getVoiceChannelId;
const value2 = Reflect.apply(getChannel, ChannelStore, [Reflect.apply(getVoiceChannelId, SelectedChannelStore, [])]);
const value3 = null;
const value4 = undefined;
const r12 = value3 == value2 ? value4 : value2.getGuildId();
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
const rTCConnectionId = RTCConnectionStore.getRTCConnectionId();
const currentGameForAnalytics = RunningGameStoreNative.getCurrentGameForAnalytics();
const name = value3 == currentGameForAnalytics ? value4 : currentGameForAnalytics.name;
let r13 = r12 !== a2.guildId && a2.guildId !== DEFAULT_SOUND_GUILD_ID;
const r8 = a2.guildId === DEFAULT_SOUND_GUILD_ID ? 'default' : r13 ? 'custom-external' : 'custom';
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const PREMIUM_FEATURE_USAGE = AnalyticEvents.PREMIUM_FEATURE_USAGE;
const SOUNDBOARD_PLAY = AnalyticsPremiumFeatureNames.SOUNDBOARD_PLAY;
r13 = r13 ? AnalyticsPremiumFeatureTiers.PREMIUM_STANDARD : AnalyticsPremiumFeatureTiers.FREE;
Reflect.apply(track, defaultImport, [PREMIUM_FEATURE_USAGE, {feature_name: SOUNDBOARD_PLAY, feature_tier: r13,
guild_id: r12, home_guild_id: a2.guildId, location_stack: a0, rtc_connection_id: rTCConnectionId,
media_session_id: mediaSessionId, in_overlay: a1, application_name: name,
emoji_count: value3 != a2.emojiId || value3 != a2.emojiName ? 1 : 0, feature_selection: r8,
feature_selection_id: a2.soundId, sound_type: a3, sequence_number: value3 != a4 ? a4 + 1 : value3}]);
return value4;
}
global.__d(_fun55358, 6979, [4266, 1379, 4294, 1934, 4614, 661, 1880, 683,
2]) /* metro module 6979, dependencies: [4266, 1379, 4294, 1934, 4614, 661, 1880, 683, 2] */;
@@ -1,59 +1,62 @@
/* Metro module 6981; source: modules/soundboard/useCustomJoinSound.tsx; dependencies: [1348, 4614, 566, 2] */
import UserSettingsProtoStore from '../user_settings/UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as SoundboardConstantsModule from './SoundboardConstants.tsx'; /* Metro dependency 4614 */
function _fun55362(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:6, offset: 0x013a47aa, size: 198 bytes, params: 8, frame: 19
var object2;
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
const env0_3 = (require(4614) /* metro dependency 4614: SoundboardConstants */).CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID;
object2 = {GLOBAL: 0};
object2[0] = 'GLOBAL';
object2.GUILD = 1;
object2[1] = 'GUILD';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/useCustomJoinSound.tsx');
exports.CustomSoundType = object2;
object = {GLOBAL: 0};
object[0] = 'GLOBAL';
object.GUILD = 1;
object[1] = 'GUILD';
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/useCustomJoinSound.tsx');
exports.CustomSoundType = object;
exports.useCustomJoinSound = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([UserSettingsProtoStore], _fun55365);
};
exports.getCustomJoinSound = getCustomJoinSound;
}
function _getCustomJoinSound(a0, a1) { // fn#55363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:222, offset: 0x013a4870, size: 121 bytes, params: 3, frame: 16
var r0;
var object2;
let property = a1[a0];
const value = undefined;
const joinSound = property == null ? value : property.joinSound;
property = a1[CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID];
const value3 = property == null;
const r5 = joinSound ?? (value3 ? value : property.joinSound);
if (r5 != null) {
object2 = {};
copyDataProperties(object2, r5, value3);
object2['type'] = joinSound != null ? env0_4.GUILD : env0_4.GLOBAL;
r0 = object2;
} else {
r0 = value;
function _getCustomJoinSound(a0, a1) { // fn#55363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:222, offset: 0x013a4870, size: 121 bytes, params: 3, frame: 16
var r0;
var object;
let property = a1[a0];
const value = undefined;
const joinSound = property == null ? value : property.joinSound;
property = a1[CUSTOM_CALL_SOUND_GLOBAL_GUILD_ID];
const value3 = property == null;
const r5 = joinSound ?? (value3 ? value : property.joinSound);
if (r5 != null) {
object = {};
copyDataProperties(object, r5, value3);
object['type'] = joinSound != null ? env0_4.GUILD : env0_4.GLOBAL;
r0 = object;
} else {
r0 = value;
}
return r0;
}
return r0;
}
function useCustomJoinSound(a0) { // fn#55364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:525, offset: 0x013a48e9, size: 64 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([UserSettingsProtoStore], _fun55365);
}
function useCustomJoinSound(a0) { // fn#55364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:525, offset: 0x013a48e9, size: 64 bytes, params: 2, frame: 14
const env0_0 = a0;
return (FluxModule).useStateFromStores([UserSettingsProtoStore], _fun55365);
function _fun55365() { // fn#55365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:595, offset: 0x013a4929, size: 63 bytes, params: 1, frame: 15
let guilds = UserSettingsProtoStore.settings.guilds;
guilds = guilds?.guilds;
return _getCustomJoinSound(env0_0, guilds ?? ({}));
}
function getCustomJoinSound(a0) { // fn#55366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:726, offset: 0x013a4968, size: 59 bytes, params: 2, frame: 15
const _getCustomJoinSoundBinding = _getCustomJoinSound;
let guilds = UserSettingsProtoStore.settings.guilds;
guilds = guilds?.guilds;
return _getCustomJoinSoundBinding(a0, guilds ?? ({}));
}
}
function getCustomJoinSound(a0) { // fn#55366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:726, offset: 0x013a4968, size: 59 bytes, params: 2, frame: 15
const _getCustomJoinSoundBinding = _getCustomJoinSound;
let guilds = UserSettingsProtoStore.settings.guilds;
guilds = guilds?.guilds;
return _getCustomJoinSoundBinding(a0, guilds ?? ({}));
}
function _fun55365() { // fn#55365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7159:595, offset: 0x013a4929, size: 63 bytes, params: 1, frame: 15
let guilds = UserSettingsProtoStore.settings.guilds;
guilds = guilds?.guilds;
return _getCustomJoinSound(env0_0, guilds ?? ({}));
}
global.__d(_fun55362, 6981, [1348, 4614, 566, 2]) /* metro module 6981, dependencies: [1348, 4614, 566, 2] */;
@@ -1,4 +1,9 @@
/* Metro module 6945; source: modules/soundboard/useGuildIdsToFetchSoundsFor.tsx; dependencies: [31, 1867, 4613, 632, 2] */
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import SoundboardStore from './SoundboardStore.tsx'; /* Metro dependency 4613 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
function _fun55229(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:6, offset: 0x013793ac, size: 171 bytes, params: 8, frame: 19
let env0_0 = require;
const _getGuildIdsToFetchSoundsFor = function(a0, a1) {
@@ -7,37 +12,40 @@ function _fun55229(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(31) /* metro dependency 31 */).useMemo;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/useGuildIdsToFetchSoundsFor.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/useGuildIdsToFetchSoundsFor.tsx');
exports.useGuildIdsToFetchSoundsFor = useGuildIdsToFetchSoundsFor;
exports.getGuildIdsToFetchSoundsFor = getGuildIdsToFetchSoundsFor;
function _getGuildIdsToFetchSoundsFor(a0, a1) { // fn#55230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:134, offset: 0x01379457, size: 29 bytes, params: 3, frame: 11
const env0_0 = a1;
return a0.filter(_fun55231);
function _fun55231(a0) { // fn#55231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:194, offset: 0x01379474, size: 28 bytes, params: 2, frame: 11
return require.get(a0) == null;
}
}
function useGuildIdsToFetchSoundsFor() { // fn#55232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:328, offset: 0x01379490, size: 130 bytes, params: 1, frame: 19
const value2 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStoresArray([GuildStore],
function() {
return GuildStore.getGuildIds();
});
const useStateFromStoresModule = require(632) /* metro dependency 632: useStateFromStores */;
const useStateFromStores = useStateFromStoresModule.useStateFromStores;
return useMemo(_fun55235, [value2, Reflect.apply(useStateFromStores, useStateFromStoresModule, [[SoundboardStore],
function() {
return SoundboardStore.getSounds();
}])]);
function _fun55235() { // fn#55235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:496, offset: 0x01379538, size: 28 bytes, params: 1, frame: 13
return _getGuildIdsToFetchSoundsFor(env0_0, sounds);
}
}
function getGuildIdsToFetchSoundsFor() { // fn#55236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:573, offset: 0x01379554, size: 45 bytes, params: 1, frame: 13
return _getGuildIdsToFetchSoundsFor(GuildStore.getGuildIds(), SoundboardStore.getSounds());
}
}
function _getGuildIdsToFetchSoundsFor(a0, a1) { // fn#55230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:134, offset: 0x01379457, size: 29 bytes, params: 3, frame: 11
const env0_0 = a1;
return a0.filter(_fun55231);
}
function useGuildIdsToFetchSoundsFor() { // fn#55232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:328, offset: 0x01379490, size: 130 bytes, params: 1, frame: 19
const value2 = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStoresArray([GuildStore],
function() {
return GuildStore.getGuildIds();
});
const useStateFromStoresModule = require(632) /* metro dependency 632: useStateFromStores */;
const useStateFromStores = useStateFromStoresModule.useStateFromStores;
return useMemo(_fun55235, [value2, Reflect.apply(useStateFromStores, useStateFromStoresModule, [[SoundboardStore],
function() {
return SoundboardStore.getSounds();
}])]);
}
function getGuildIdsToFetchSoundsFor() { // fn#55236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:573, offset: 0x01379554, size: 45 bytes, params: 1, frame: 13
return _getGuildIdsToFetchSoundsFor(GuildStore.getGuildIds(), SoundboardStore.getSounds());
}
function _fun55231(a0) { // fn#55231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7123:194, offset: 0x01379474, size: 28 bytes, params: 2, frame: 11
return require.get(a0) == null;
}
global.__d(_fun55229, 6945, [31, 1867, 4613, 632,
2]) /* metro module 6945, dependencies: [31, 1867, 4613, 632, 2] */;
@@ -1,65 +1,69 @@
/* Metro module 15421; source: modules/soundboard/useSortedGuildIdsForSoundboard.tsx; dependencies: [31, 3784, 4896, 1878, 661, 482, 632, 3802, 2] */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import SortedGuildStore from '../../stores/SortedGuildStore.tsx'; /* Metro dependency 4896 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../external/discord_common/js/shared/Constants.tsx'; /* Metro dependency 482 */
import * as ConstantsModule2 from '../../Constants.tsx'; /* Metro dependency 661 */
function _fun117967(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15618:6, offset: 0x024c6ce3, size: 213 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const sortedGuildStore = importDefault(4896) /* metro dependency 4896: SortedGuildStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_7 = (require(661) /* metro dependency 661: Constants */).EMPTY_STRING_SNOWFLAKE_ID;
const env0_8 = (require(482) /* metro dependency 482: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/useSortedGuildIdsForSoundboard.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/useSortedGuildIdsForSoundboard.tsx');
exports.useSortedGuildIdsForSoundboard = useSortedGuildIdsForSoundboard;
}
function useSortedGuildIdsForSoundboard(a0, a1) { // fn#117968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15618:314, offset: 0x024c6db8, size: 245 bytes, params: 3, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const value2 = undefined;
const currentUser = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
function() {
return UserStore.getCurrentUser();
});
const r6 = (a0 == null ? value2 : a0.guild_id) ?? EMPTY_STRING_SNOWFLAKE_ID;
return r6.useMemo(_fun117972, [currentUser, a1, r6,
(require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([SortedGuildStore],
function() {
return SortedGuildStore.getFlattenedGuildIds();
}), (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([PermissionStore],
_fun117971)]);
}
function _fun117971() { // fn#117971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15618:565, offset: 0x024c6ead, size: 67 bytes, params: 1, frame: 14
let r0 = env0_0 == null || env0_0.guild_id == null;
r0 = !r0 ? PermissionStore.can(Permissions.USE_EXTERNAL_SOUNDS, env0_0) : r0;
return r0;
}
function _fun117972() { // fn#117972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15618:647, offset: 0x024c6ef0, size: 137 bytes, params: 1, frame: 14
var environment;
var r0;
var flattenedGuildIdsBinding;
let value = environment.__proto__;
if (!Reflect.apply((importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseSoundboardEverywhere,
value, [currentUser])) {
if (require) {
return [env0_3];
function useSortedGuildIdsForSoundboard(a0, a1) { // fn#117968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15618:314, offset: 0x024c6db8, size: 245 bytes, params: 3, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const value2 = undefined;
const currentUser = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
function() {
return UserStore.getCurrentUser();
});
const r6 = (a0 == null ? value2 : a0.guild_id) ?? EMPTY_STRING_SNOWFLAKE_ID;
return r6.useMemo(_fun117972, [currentUser, a1, r6,
(require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([SortedGuildStore],
function() {
return SortedGuildStore.getFlattenedGuildIds();
}), (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([PermissionStore],
_fun117971)]);
function _fun117971() { // fn#117971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15618:565, offset: 0x024c6ead, size: 67 bytes, params: 1, frame: 14
let r0 = env0_0 == null || env0_0.guild_id == null;
r0 = !r0 ? PermissionStore.can(Permissions.USE_EXTERNAL_SOUNDS, env0_0) : r0;
return r0;
}
}
if (env0_5) {
value = env0_3 !== '';
flattenedGuildIdsBinding = flattenedGuildIds;
r0 = value ? flattenedGuildIdsBinding.filter(_fun117973) : flattenedGuildIdsBinding;
if (value) {
r0.unshift(env0_3);
function _fun117972() { // fn#117972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15618:647, offset: 0x024c6ef0, size: 137 bytes, params: 1, frame: 14
var environment;
var r0;
var flattenedGuildIdsBinding;
let value = environment.__proto__;
if (!Reflect.apply((importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUseSoundboardEverywhere,
value, [currentUser])) {
if (require) {
return [ReactModule];
}
}
if (env0_5) {
value = ReactModule !== '';
flattenedGuildIdsBinding = flattenedGuildIds;
r0 = value ? flattenedGuildIdsBinding.filter(_fun117973) : flattenedGuildIdsBinding;
if (value) {
r0.unshift(ReactModule);
}
return r0;
}
return [ReactModule];
function _fun117973(a0) { // fn#117973, offset: 0x024c6f79, size: 16 bytes, params: 2, frame: 2
return a0 !== env1_3;
}
}
return r0;
}
return [env0_3];
}
function _fun117973(a0) { // fn#117973, offset: 0x024c6f79, size: 16 bytes, params: 2, frame: 2
return a0 !== env1_3;
}
global.__d(_fun117967, 15421, [31, 3784, 4896, 1878, 661, 482, 632, 3802,
2]) /* metro module 15421, dependencies: [31, 3784, 4896, 1878, 661, 482, 632, 3802, 2] */;
+489 -462
View File
@@ -1,4 +1,18 @@
/* Metro module 15419; source: modules/soundboard/useSoundGrid.tsx; dependencies: [57, 31, 1867, 3784, 1878, 4613, 4614, 1880, 6639, 8249, 15420, 566, 3802, 15421, 9077, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import PremiumUtils from '../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */
import SoundboardStore from './SoundboardStore.tsx'; /* Metro dependency 4613 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as PremiumConstantsModule from '../premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as SoundboardConstantsModule from './SoundboardConstants.tsx'; /* Metro dependency 4614 */
import * as SoundboardTypesModule from './SoundboardTypes.tsx'; /* Metro dependency 6639 */
import * as UseSoundOrganizerModule from './useSoundOrganizer.tsx'; /* Metro dependency 15420 */
import * as UseSortedGuildIdsForSoundboardModule from './useSortedGuildIdsForSoundboard.tsx'; /* Metro dependency 15421 */
function _fun117940(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:6, offset: 0x024c5e24, size: 312 bytes, params: 8, frame: 19
const env0_0 = require;
const _arrayLikeToArray_117943 = function(a0, a1) {
@@ -57,497 +71,510 @@ function _fun117940(global, require, importDefault, importAll, module, exports,
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
const soundboardConstantsModule = require(4614) /* metro dependency 4614: SoundboardConstants */;
const env0_9 = soundboardConstantsModule.DEFAULT_SOUND_GUILD_ID;
const env0_10 = soundboardConstantsModule.EMPTY_SOUND_LIST;
const env0_11 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/useSoundGrid.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/useSoundGrid.tsx');
exports.default = useSoundGrid;
exports.useSearchCategories = useSearchCategories;
}
function _createForOfIteratorHelperLoose_117941(a0, a1) { // fn#117941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:244, offset: 0x024c5f5c, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
function _createForOfIteratorHelperLoose_117941(a0, a1) { // fn#117941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:244, offset: 0x024c5f5c, size: 372 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
return _fun117942;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_117943(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun117942;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_117943(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_117943(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_117943(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun117942;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
function _fun117942() { // fn#117942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:815, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function createSoundItems(a0, a1) { // fn#117944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1154, offset: 0x024c60d0, size: 43 bytes, params: 3, frame: 12
var r2;
let value = a0;
if (a1 == null) {
r2 = value;
} else {
value = a1(value);
r2 = value;
}
return r2.map(function(a0, a1) {
var object = {};
object.type = require(dependencyMap[8]).SoundboardSoundItemType.SOUND;
object.sound = a0;
object.index = a1;
return object;
});
function _fun117945(a0, a1) { // fn#117945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1217, offset: 0x024c60fb, size: 60 bytes, params: 3, frame: 12
const SoundboardSoundItemType = (SoundboardTypesModule).SoundboardSoundItemType;
const SOUND = SoundboardSoundItemType.SOUND;
return {type: SOUND, sound: a0, index: a1};
}
}
function addDefaultSection(a0, a1) { // fn#117946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1290, offset: 0x024c6137, size: 150 bytes, params: 3, frame: 19
const r6 = a1.get(DEFAULT_SOUND_GUILD_ID) ?? EMPTY_SOUND_LIST;
const push = a0.push;
const object = {};
const SoundboardSoundGridSectionType = (SoundboardTypesModule).SoundboardSoundGridSectionType;
let DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
object.key = DEFAULTS;
DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
object.categoryInfo = {type: DEFAULTS};
object.items = createSoundItems(r6,
(require(15420) /* metro dependency 15420: useSoundOrganizer */).sortSoundsOldestToNewestCreationDate);
Reflect.apply(push, a0, [object]);
}
function useSoundGrid(a0) { // fn#117947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1640, offset: 0x024c61cd, size: 560 bytes, params: 2, frame: 32
const value = a1;
const value2 = a2;
const env0_0 = a0;
let filterOutEmptyCurrentGuild = (value !== undefined ? value : {}).filterOutEmptyCurrentGuild;
filterOutEmptyCurrentGuild = !(filterOutEmptyCurrentGuild === undefined) && filterOutEmptyCurrentGuild;
const r7 = value2 !== undefined ? value2 : false;
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const defaultImport = PremiumUtils;
const isPremium = defaultImport.isPremium;
const TIER_2 = PremiumTypes.TIER_2;
const isPremium2 = Reflect.apply(isPremium, defaultImport, [currentUser, TIER_2]);
const isPremium22 = isPremium2;
const fluxModule = require(566) /* metro dependency 566: flux */;
let useStateFromStoresArray = fluxModule.useStateFromStoresArray;
const isPremium222 = isPremium22(Reflect.apply(useStateFromStoresArray, fluxModule, [[SoundboardStore],
_fun117949]), 3);
const property = isPremium222[0];
const property4 = property;
const property2 = isPremium222[1];
const property3 = isPremium222[2];
const value5 = (UseSoundOrganizerModule).useSoundOrganizer();
const value6 = (UseSortedGuildIdsForSoundboardModule).useSortedGuildIdsForSoundboard(a0,
false);
const moduleValue5 = fluxModule;
useStateFromStoresArray = moduleValue5.useStateFromStoresArray;
const guildStoreBinding = GuildStore;
const value7 = Reflect.apply(useStateFromStoresArray, moduleValue5, [[guildStoreBinding], _fun117950]);
const canUseSoundboardEverywhere2 = defaultImport.canUseSoundboardEverywhere(currentUser);
const guild = fluxModule.useStateFromStores([guildStoreBinding], _fun117952);
return property4.useMemo(_fun117954, [value6, property, property2, guild,
fluxModule.useStateFromStores([PermissionStore], _fun117953, [guild]), filterOutEmptyCurrentGuild,
canUseSoundboardEverywhere2, value7, r7, property3, isPremium2, value5]);
function _fun117949() { // fn#117949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1846, offset: 0x024c63fd, size: 57 bytes, params: 1, frame: 10
const value = environment.__proto__;
const soundboardStoreBinding = SoundboardStore;
const items2 = [soundboardStoreBinding.getSounds()];
const getFavorites = soundboardStoreBinding.getFavorites;
items2[1] = Reflect.apply(getFavorites, soundboardStoreBinding, []);
items2[2] = soundboardStoreBinding.isFetching();
return items2;
}
function _fun117950() { // fn#117950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2052, offset: 0x024c6436, size: 36 bytes, params: 1, frame: 12
env0_8.forEach(_fun117951);
return [];
function _fun117951(a0) { // fn#117951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2084, offset: 0x024c645a, size: 48 bytes, params: 2, frame: 11
let value = environment.__proto__.__proto__;
value = GuildStore.getGuild(a0);
if (value != null) {
env0_0.push(value);
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
function _fun117952() { // fn#117952, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2212, offset: 0x01de3a05, size: 47 bytes, params: 1, frame: 13
return GuildStore.getGuild(env0_0?.guild_id);
}
return _fun117942;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function createSoundItems(a0, a1) { // fn#117944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1154, offset: 0x024c60d0, size: 43 bytes, params: 3, frame: 12
var r2;
let value = a0;
if (a1 == null) {
r2 = value;
} else {
value = a1(value);
r2 = value;
}
return r2.map(function(a0, a1) {
var object = {};
object.type = require(dependencyMap[8]).SoundboardSoundItemType.SOUND;
object.sound = a0;
object.index = a1;
return object;
});
}
function addDefaultSection(a0, a1) { // fn#117946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1290, offset: 0x024c6137, size: 150 bytes, params: 3, frame: 19
const r6 = a1.get(DEFAULT_SOUND_GUILD_ID) ?? EMPTY_SOUND_LIST;
const push = a0.push;
const object2 = {};
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
let DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
object2.key = DEFAULTS;
DEFAULTS = SoundboardSoundGridSectionType.DEFAULTS;
object2.categoryInfo = {type: DEFAULTS};
object2.items = createSoundItems(r6,
(require(15420) /* metro dependency 15420: useSoundOrganizer */).sortSoundsOldestToNewestCreationDate);
Reflect.apply(push, a0, [object2]);
}
function useSoundGrid(a0) { // fn#117947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1640, offset: 0x024c61cd, size: 560 bytes, params: 2, frame: 32
const value = a1;
const value2 = a2;
const env0_0 = a0;
let filterOutEmptyCurrentGuild = (value !== undefined ? value : {}).filterOutEmptyCurrentGuild;
filterOutEmptyCurrentGuild = !(filterOutEmptyCurrentGuild === undefined) && filterOutEmptyCurrentGuild;
const r7 = value2 !== undefined ? value2 : false;
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const defaultImport = importDefault(3802) /* metro dependency 3802: PremiumUtils */;
const isPremium = defaultImport.isPremium;
const TIER_2 = PremiumTypes.TIER_2;
const isPremium2 = Reflect.apply(isPremium, defaultImport, [currentUser, TIER_2]);
const env0_3 = isPremium2;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStoresArray = fluxModule.useStateFromStoresArray;
const value4 = env0_3(Reflect.apply(useStateFromStoresArray, fluxModule, [[SoundboardStore], _fun117949]), 3);
const property = value4[0];
const env0_4 = property;
const property2 = value4[1];
const property3 = value4[2];
const value5 = (require(15420) /* metro dependency 15420: useSoundOrganizer */).useSoundOrganizer();
const value6 = (require(15421) /* metro dependency 15421: useSortedGuildIdsForSoundboard */).useSortedGuildIdsForSoundboard(a0,
false);
const value7 = fluxModule.useStateFromStoresArray([GuildStore], _fun117950);
const canUseSoundboardEverywhere2 = defaultImport.canUseSoundboardEverywhere(currentUser);
const guild = fluxModule.useStateFromStores([GuildStore], _fun117952);
return env0_4.useMemo(_fun117954, [value6, property, property2, guild,
fluxModule.useStateFromStores([PermissionStore], _fun117953, [guild]), filterOutEmptyCurrentGuild,
canUseSoundboardEverywhere2, value7, r7, property3, isPremium2, value5]);
}
function useSearchCategories(a0, a1, a2) { // fn#117959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:4821, offset: 0x024c6ac9, size: 71 bytes, params: 4, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return env0_4.useMemo(_fun117960, [a0, a2.length, a1]);
}
function _fun117949() { // fn#117949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:1846, offset: 0x024c63fd, size: 57 bytes, params: 1, frame: 10
const value = environment.__proto__;
const items2 = [SoundboardStore.getSounds()];
const getFavorites = SoundboardStore.getFavorites;
items2[1] = Reflect.apply(getFavorites, SoundboardStore, []);
items2[2] = SoundboardStore.isFetching();
return items2;
}
function _fun117950() { // fn#117950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2052, offset: 0x024c6436, size: 36 bytes, params: 1, frame: 12
env0_8.forEach(_fun117951);
return [];
}
function _fun117953() { // fn#117953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2292, offset: 0x024c648a, size: 51 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(9077) /* metro dependency 9077: useManageResourcePermissions */;
const getManageResourcePermissions = value.getManageResourcePermissions;
return Reflect.apply(getManageResourcePermissions, value, [guild]).canCreateExpressions;
}
function _fun117954() { // fn#117954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2383, offset: 0x024c64bd, size: 1039 bytes, params: 1, frame: 35
var environment;
var r10;
var r5;
var id;
var r9;
var r0;
var object5;
var Array;
var from;
var value2;
var value3;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
var guildBinding;
var object6;
var currentGuildHasAddPermissions;
var allSounds;
var filterOutEmptyCurrentGuild2;
var sortSoundsFn;
var get;
var createSoundItemsBinding;
var soundItems;
var length;
var moduleValue;
var value6;
var push;
var object8;
var GUILD;
var object9;
var sections;
var guilds;
var currentGuildId;
var hasNitro;
var value9;
var value10;
var done;
var value11;
var value12;
var soundItems2;
var value13;
var object12;
var binding;
var value15;
var object13;
const env0_0 = 0;
const env0_1 = 0;
const items = [];
if (env0_2) {
value15 = environment.__proto__;
addDefaultSection(items, env0_4);
object13 = {categories: items};
object13.availableSounds = env0_4.get(DEFAULT_SOUND_GUILD_ID) ?? EMPTY_SOUND_LIST;
object13.isFetching = env0_6;
object13.soundCounts = {'favoriteSoundCount': 0, 'unlockedCustomSoundCount': 0, 'lockedCustomSoundCount': 0};
r0 = object13;
} else {
object5 = {sections: items, guildIds: env0_8, allSounds: env0_4};
Array = global.Array;
object5.potentialSoundIdsForSection = Array.from(env0_5);
value2 = environment.__proto__;
value3 = undefined;
object5.sectionType = SoundboardSoundGridSectionType.FAVORITES;
object5.sortSoundsFn = (require(15420) /* metro dependency 15420: useSoundOrganizer */).sortSoundsOldestToNewestCreationDate;
_addSectionForPotentialSoundIds(object5);
guildBinding = guild;
if (value3 !== guildBinding) {
guildBinding = guild;
object6 = {currentGuildHasAddPermissions: env0_12, allSounds: env0_4};
object6.filterOutEmptyCurrentGuild = filterOutEmptyCurrentGuild;
object6.sortSoundsFn = env0_7;
currentGuildHasAddPermissions = object6.currentGuildHasAddPermissions;
allSounds = object6.allSounds;
filterOutEmptyCurrentGuild2 = object6.filterOutEmptyCurrentGuild;
sortSoundsFn = object6.sortSoundsFn;
r10 = allSounds.get(guildBinding.id) ?? [];
soundItems = createSoundItems(r10, sortSoundsFn);
length = r10.length;
moduleValue = require(8249) /* metro dependency 8249: GuildBoostingUtils */;
r10 = length < moduleValue.getMaxSoundboardSlots(guildBinding) && currentGuildHasAddPermissions;
length = soundItems.length;
value6 = length === 0;
r10 = !r10 && !value6;
r10 = !r10 ? filterOutEmptyCurrentGuild2 : r10;
if (!r10) {
push = soundItems.push;
object8 = {};
object8.type = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundItemType.ADD_SOUND;
object8.guild = guildBinding;
Reflect.apply(push, soundItems, [object8]);
}
if (!(filterOutEmptyCurrentGuild2 && value6)) {
push = items.push;
GUILD = SoundboardSoundGridSectionType.GUILD;
Reflect.apply(push, items, [{categoryInfo: {type: GUILD, guild: guildBinding, isNitroLocked: false},
key: guildBinding.id, items: soundItems}]);
}
function _fun117953() { // fn#117953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2292, offset: 0x024c648a, size: 51 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(9077) /* metro dependency 9077: useManageResourcePermissions */;
const getManageResourcePermissions = value.getManageResourcePermissions;
return Reflect.apply(getManageResourcePermissions, value, [guild]).canCreateExpressions;
}
if (!env0_10) {
addDefaultSection(items, env0_4);
}
object9 = {sections: items, guilds: env0_9};
id = guild == null ? value3 : guild.id;
object9.currentGuildId = id;
object9.allSounds = env0_4;
object9.hasNitro = env0_3;
object9.sortSoundsFn = env0_7;
sections = object9.sections;
guilds = object9.guilds;
currentGuildId = object9.currentGuildId;
allSounds = object9.allSounds;
hasNitro = object9.hasNitro;
sortSoundsFn = object9.sortSoundsFn;
value9 = _createForOfIteratorHelperLoose_117941(guilds);
value10 = value9();
done = value10.done;
if (!done) {
r9 = value10;
while (true) {
value11 = r9.value;
id = value11.id;
if (id !== currentGuildId) {
createSoundItemsBinding = createSoundItems;
get = allSounds.get;
id = value11.id;
value12 = Reflect.apply(get, allSounds, [id]);
if (value12 != null) {
r5 = value12;
function _fun117954() { // fn#117954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2383, offset: 0x024c64bd, size: 1039 bytes, params: 1, frame: 35
var environment;
var r10;
var r5;
var id;
var r9;
var r0;
var object;
var Array;
var from;
var value2;
var value3;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
var guildBinding;
var object2;
var currentGuildHasAddPermissions;
var allSounds;
var filterOutEmptyCurrentGuild2;
var sortSoundsFn;
var get;
var createSoundItemsBinding;
var soundItems;
var length;
var moduleValue;
var value6;
var push;
var object3;
var GUILD;
var object4;
var sections;
var guilds;
var currentGuildId;
var hasNitro;
var value9;
var value10;
var done;
var value11;
var value12;
var soundItems2;
var value13;
var object7;
var binding;
var value15;
var object10;
const env0_0 = 0;
const env0_1 = 0;
const items2 = [];
if (env0_2) {
value15 = environment.__proto__;
addDefaultSection(items2, ReactModule);
object10 = {categories: items2};
object10.availableSounds = ReactModule.get(DEFAULT_SOUND_GUILD_ID) ?? EMPTY_SOUND_LIST;
object10.isFetching = env0_6;
object10.soundCounts = {'favoriteSoundCount': 0, 'unlockedCustomSoundCount': 0, 'lockedCustomSoundCount': 0};
r0 = object10;
} else {
object = {sections: items2, guildIds: env0_8, allSounds: ReactModule};
Array = global.Array;
object.potentialSoundIdsForSection = Array.from(env0_5);
value2 = environment.__proto__;
value3 = undefined;
object.sectionType = SoundboardSoundGridSectionType.FAVORITES;
object.sortSoundsFn = (require(15420) /* metro dependency 15420: useSoundOrganizer */).sortSoundsOldestToNewestCreationDate;
_addSectionForPotentialSoundIds(object);
guildBinding = guild;
if (value3 !== guildBinding) {
guildBinding = guild;
object2 = {currentGuildHasAddPermissions: env0_12, allSounds: ReactModule};
object2.filterOutEmptyCurrentGuild = filterOutEmptyCurrentGuild;
object2.sortSoundsFn = env0_7;
currentGuildHasAddPermissions = object2.currentGuildHasAddPermissions;
allSounds = object2.allSounds;
filterOutEmptyCurrentGuild2 = object2.filterOutEmptyCurrentGuild;
sortSoundsFn = object2.sortSoundsFn;
r10 = allSounds.get(guildBinding.id) ?? [];
soundItems = createSoundItems(r10, sortSoundsFn);
length = r10.length;
moduleValue = require(8249) /* metro dependency 8249: GuildBoostingUtils */;
r10 = length < moduleValue.getMaxSoundboardSlots(guildBinding) && currentGuildHasAddPermissions;
length = soundItems.length;
value6 = length === 0;
r10 = !r10 && !value6;
r10 = !r10 ? filterOutEmptyCurrentGuild2 : r10;
if (!r10) {
push = soundItems.push;
object3 = {};
object3.type = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundItemType.ADD_SOUND;
object3.guild = guildBinding;
Reflect.apply(push, soundItems, [object3]);
}
if (!(filterOutEmptyCurrentGuild2 && value6)) {
push = items2.push;
GUILD = SoundboardSoundGridSectionType.GUILD;
Reflect.apply(push, items2, [{categoryInfo: {type: GUILD, guild: guildBinding, isNitroLocked: false},
key: guildBinding.id, items: soundItems}]);
}
}
if (!SoundboardConstantsModule.EMPTY_SOUND_LIST) {
addDefaultSection(items2, ReactModule);
}
object4 = {sections: items2, guilds: SoundboardConstantsModule.DEFAULT_SOUND_GUILD_ID};
id = guild == null ? value3 : guild.id;
object4.currentGuildId = id;
object4.allSounds = ReactModule;
object4.hasNitro = Module00057;
object4.sortSoundsFn = env0_7;
sections = object4.sections;
guilds = object4.guilds;
currentGuildId = object4.currentGuildId;
allSounds = object4.allSounds;
hasNitro = object4.hasNitro;
sortSoundsFn = object4.sortSoundsFn;
value9 = _createForOfIteratorHelperLoose_117941(guilds);
value10 = value9();
done = value10.done;
if (!done) {
r9 = value10;
while (true) {
value11 = r9.value;
id = value11.id;
if (id !== currentGuildId) {
createSoundItemsBinding = createSoundItems;
get = allSounds.get;
id = value11.id;
value12 = Reflect.apply(get, allSounds, [id]);
if (value12 != null) {
r5 = value12;
continue;
}
soundItems2 = createSoundItemsBinding([], sortSoundsFn);
length = soundItems2.length;
if (length > 0) {
push = sections.push;
GUILD = SoundboardSoundGridSectionType.GUILD;
id = value11.id;
Reflect.apply(push, sections, [{categoryInfo: {type: GUILD, guild: value11,
isNitroLocked: !hasNitro},
key: id,
items: soundItems2}]);
break;
}
break;
}
value13 = value9();
done = value13.done;
if (done) {
break;
}
r9 = value13;
continue;
}
soundItems2 = createSoundItemsBinding([], sortSoundsFn);
length = soundItems2.length;
if (length > 0) {
}
if (SoundboardConstantsModule.EMPTY_SOUND_LIST) {
addDefaultSection(items2, ReactModule);
}
items2.forEach(_fun117958);
object7 = {categories: items2};
Array = global.Array;
from = Array.from;
binding = ReactModule;
object7.availableSounds = Reflect.apply(from, Array, [binding.values()]).flat();
object7.isFetching = env0_6;
object7.soundCounts = {favoriteSoundCount: env0_5.size, unlockedCustomSoundCount: env0_0,
lockedCustomSoundCount: env0_1};
r0 = object7;
}
return r0;
function _addSectionForPotentialSoundIds({sections, guildIds, allSounds, potentialSoundIdsForSection, sectionType, sortSoundsFn}) { // fn#117955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2596, offset: 0x024c68cc, size: 306 bytes, params: 2, frame: 28
var r7;
var r4;
var r14;
var r8;
var property;
var _addSectionForPotentialSoundIds_loop2;
var _createForOfIteratorHelperLoose_117941Binding;
var get;
var value4;
var value5;
var value6;
var done;
var value7;
var value8;
var value9;
var value12;
var push;
var value13;
const object = {};
const items2 = [];
const value2 = arraySpread(items2, guildIds, 0, undefined);
items2[value2] = DEFAULT_SOUND_GUILD_ID;
value2 + 1;
let length = items2.length;
if (0 < length) {
r7 = 0;
reducibleLoop1: while (true) {
property = items2[r7];
_addSectionForPotentialSoundIds_loop2 = _addSectionForPotentialSoundIds_loop;
_createForOfIteratorHelperLoose_117941Binding = _createForOfIteratorHelperLoose_117941;
get = allSounds.get;
value4 = Reflect.apply(get, allSounds, [property]);
reducibleJoin3: while (true) {
if (value4 != null) {
r4 = value4;
break reducibleJoin3;
}
r4 = [];
break reducibleJoin3;
}
value5 = _createForOfIteratorHelperLoose_117941Binding(r4);
value6 = value5();
done = value6.done;
if (!done) {
r14 = value6;
reducibleLoop4: while (true) {
value7 = r14.value;
_addSectionForPotentialSoundIds_loop2(value7);
value8 = value5();
done = value8.done;
if (done) {
break reducibleLoop4;
}
r14 = value8;
continue reducibleLoop4;
}
}
value9 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
length = items2.length;
if (value9 < length) {
r7 = value9;
continue reducibleLoop1;
}
break reducibleLoop1;
}
}
const items3 = [];
const value10 = _createForOfIteratorHelperLoose_117941(potentialSoundIdsForSection);
const value11 = value10();
done = value11.done;
if (!done) {
r8 = value11;
reducibleLoop7: while (true) {
value12 = r8.value;
property = object[value12];
reducibleJoin9: while (true) {
if (property == null) {
break reducibleJoin9;
}
push = items3.push;
Reflect.apply(push, items3, [property]);
break reducibleJoin9;
}
value13 = value10();
done = value13.done;
if (done) {
break reducibleLoop7;
}
r8 = value13;
continue reducibleLoop7;
}
}
const soundItems = createSoundItems(items3, sortSoundsFn);
reducibleJoin12: while (true) {
if (soundItems.length > 0) {
push = sections.push;
GUILD = SoundboardSoundGridSectionType.GUILD;
id = value11.id;
Reflect.apply(push, sections, [{categoryInfo: {type: GUILD, guild: value11,
isNitroLocked: !hasNitro},
key: id,
items: soundItems2}]);
break;
Reflect.apply(push, sections, [{key: sectionType, categoryInfo: {type: sectionType}, items: soundItems}]);
break reducibleJoin12;
}
break;
break reducibleJoin12;
}
value13 = value9();
done = value13.done;
if (done) {
break;
function _addSectionForPotentialSoundIds_loop(a0) { // fn#117956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2801, owner: _addSectionForPotentialSoundIds._loop, offset: 0x024c69fe, size: 58 bytes, params: 2, frame: 13
const env0_0 = a0;
if (potentialSoundIdsForSection.find(_fun117957) != null) {
env0_1[a0.soundId] = a0;
}
function _fun117957(a0) { // fn#117957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2827, offset: 0x024c6a38, size: 22 bytes, params: 2, frame: 2
return a0 === env0_0.soundId;
}
}
r9 = value13;
continue;
}
}
if (env0_10) {
addDefaultSection(items, env0_4);
}
items.forEach(_fun117958);
object12 = {categories: items};
Array = global.Array;
from = Array.from;
binding = env0_4;
object12.availableSounds = Reflect.apply(from, Array, [binding.values()]).flat();
object12.isFetching = env0_6;
object12.soundCounts = {favoriteSoundCount: env0_5.size, unlockedCustomSoundCount: env0_0,
lockedCustomSoundCount: env0_1};
r0 = object12;
}
return r0;
}
function _fun117960() { // fn#117960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:4875, offset: 0x024c6b10, size: 130 bytes, params: 1, frame: 17
var r0;
var object2;
var value2;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
var SEARCH;
if (importDefault.length > 0) {
object2 = {};
value2 = environment.__proto__;
SEARCH = SoundboardSoundGridSectionType.SEARCH;
object2.key = SEARCH;
SEARCH = SoundboardSoundGridSectionType.SEARCH;
object2.categoryInfo = {type: SEARCH};
object2.items = createSoundItems(require);
r0 = [object2];
} else {
r0 = env0_0;
}
return r0;
}
function _fun117951(a0) { // fn#117951, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2084, offset: 0x024c645a, size: 48 bytes, params: 2, frame: 11
let value = environment.__proto__.__proto__;
value = GuildStore.getGuild(a0);
if (value != null) {
env0_0.push(value);
}
}
function _addSectionForPotentialSoundIds({sections, guildIds, allSounds, potentialSoundIdsForSection, sectionType, sortSoundsFn}) { // fn#117955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2596, offset: 0x024c68cc, size: 306 bytes, params: 2, frame: 28
var r7;
var r4;
var r14;
var r8;
var property;
var closure;
var _createForOfIteratorHelperLoose_117941Binding;
var get;
var value4;
var value5;
var value6;
var done;
var value7;
var value8;
var value9;
var value12;
var push;
var value13;
const object2 = {};
const items2 = [];
const value2 = arraySpread(items2, guildIds, 0, undefined);
items2[value2] = DEFAULT_SOUND_GUILD_ID;
value2 + 1;
let length = items2.length;
if (0 < length) {
r7 = 0;
reducibleLoop1: while (true) {
property = items2[r7];
closure = _addSectionForPotentialSoundIds_loop;
_createForOfIteratorHelperLoose_117941Binding = _createForOfIteratorHelperLoose_117941;
get = allSounds.get;
value4 = Reflect.apply(get, allSounds, [property]);
reducibleJoin3: while (true) {
if (value4 != null) {
r4 = value4;
break reducibleJoin3;
}
r4 = [];
break reducibleJoin3;
}
value5 = _createForOfIteratorHelperLoose_117941Binding(r4);
value6 = value5();
done = value6.done;
if (!done) {
r14 = value6;
reducibleLoop4: while (true) {
value7 = r14.value;
closure(value7);
value8 = value5();
done = value8.done;
if (done) {
break reducibleLoop4;
function _fun117958(a0) { // fn#117958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:4458, offset: 0x024c6a4e, size: 123 bytes, params: 2, frame: 13
const type = a0.categoryInfo.type;
const SoundboardSoundGridSectionType = (SoundboardTypesModule).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (type === GUILD) {
if (a0.categoryInfo.isNitroLocked) {
env0_1 = env0_1 + a0.items.length;
} else {
env0_0 = env0_0 + a0.items.length;
}
r14 = value8;
continue reducibleLoop4;
}
}
value9 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
length = items2.length;
if (value9 < length) {
r7 = value9;
continue reducibleLoop1;
}
}
function useSearchCategories(a0, a1, a2) { // fn#117959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:4821, offset: 0x024c6ac9, size: 71 bytes, params: 4, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return ReactModule.useMemo(_fun117960, [a0, a2.length, a1]);
function _fun117960() { // fn#117960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:4875, offset: 0x024c6b10, size: 130 bytes, params: 1, frame: 17
var r0;
var object;
var value2;
const SoundboardSoundGridSectionType = (SoundboardTypesModule).SoundboardSoundGridSectionType;
var SEARCH;
if (importDefault.length > 0) {
object = {};
value2 = environment.__proto__;
SEARCH = SoundboardSoundGridSectionType.SEARCH;
object.key = SEARCH;
SEARCH = SoundboardSoundGridSectionType.SEARCH;
object.categoryInfo = {type: SEARCH};
object.items = createSoundItems(require);
r0 = [object];
} else {
r0 = env0_0;
}
break reducibleLoop1;
return r0;
}
}
const items3 = [];
const value10 = _createForOfIteratorHelperLoose_117941(potentialSoundIdsForSection);
const value11 = value10();
done = value11.done;
if (!done) {
r8 = value11;
reducibleLoop7: while (true) {
value12 = r8.value;
property = object2[value12];
reducibleJoin9: while (true) {
if (property == null) {
break reducibleJoin9;
}
push = items3.push;
Reflect.apply(push, items3, [property]);
break reducibleJoin9;
}
value13 = value10();
done = value13.done;
if (done) {
break reducibleLoop7;
}
r8 = value13;
continue reducibleLoop7;
}
}
const soundItems = createSoundItems(items3, sortSoundsFn);
reducibleJoin12: while (true) {
if (soundItems.length > 0) {
push = sections.push;
Reflect.apply(push, sections, [{key: sectionType, categoryInfo: {type: sectionType}, items: soundItems}]);
break reducibleJoin12;
}
break reducibleJoin12;
}
}
function _fun117958(a0) { // fn#117958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:4458, offset: 0x024c6a4e, size: 123 bytes, params: 2, frame: 13
const type = a0.categoryInfo.type;
const SoundboardSoundGridSectionType = (require(6639) /* metro dependency 6639: SoundboardTypes */).SoundboardSoundGridSectionType;
const GUILD = SoundboardSoundGridSectionType.GUILD;
if (type === GUILD) {
if (a0.categoryInfo.isNitroLocked) {
env0_1 = env0_1 + a0.items.length;
} else {
env0_0 = env0_0 + a0.items.length;
}
}
}
function _addSectionForPotentialSoundIds_loop(a0) { // fn#117956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2801, owner: _addSectionForPotentialSoundIds._loop, offset: 0x024c69fe, size: 58 bytes, params: 2, frame: 13
const env0_0 = a0;
if (potentialSoundIdsForSection.find(_fun117957) != null) {
env0_1[a0.soundId] = a0;
}
}
function _fun117957(a0) { // fn#117957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15616:2827, offset: 0x024c6a38, size: 22 bytes, params: 2, frame: 2
return a0 === env0_0.soundId;
}
global.__d(_fun117940, 15419, [57, 31, 1867, 3784, 1878, 4613, 4614, 1880, 6639, 8249, 15420, 566, 3802, 15421,
9077,
2]) /* metro module 15419, dependencies: [57, 31, 1867, 3784, 1878, 4613, 4614, 1880, 6639, 8249, 15420, 566, 3802, 15421, 9077, 2] */;
@@ -1,4 +1,7 @@
/* Metro module 15420; source: modules/soundboard/useSoundOrganizer.tsx; dependencies: [21, 2] */
import SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun117961(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:6, offset: 0x024c6b92, size: 116 bytes, params: 8, frame: 18
const closure = function(a0) {
var r4;
@@ -18,43 +21,48 @@ function _fun117961(global, require, importDefault, importAll, module, exports,
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/useSoundOrganizer.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/useSoundOrganizer.tsx');
exports.sortSoundsOldestToNewestCreationDate = closure;
exports.useSoundOrganizer = function() {
return sortSoundsOldestToNewestCreationDate;
};
}
function sortSoundsOldestToNewestCreationDate(a0) { // fn#117962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:44, offset: 0x024c6c06, size: 67 bytes, params: 2, frame: 16
var r0;
let value = a1;
const r4 = !(value !== undefined) || value;
const items2 = [];
arraySpread(items2, a0, 0, items2);
value = items2.sort(_fun117963);
if (r4) {
value = ((a0) => {
var items = [];
arraySpread(items, a0, 0, items);
return items.sort(_fun117965);
})(value);
r0 = value;
} else {
r0 = value;
}
return r0;
function _fun117963({soundId}, {soundId}) { // fn#117963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:117, offset: 0x024c6c49, size: 56 bytes, params: 3, frame: 13
const value = environment.__proto__;
return (SnowflakeUtils).compare(soundId, soundId);
}
function _positionUnavailableSoundsAtEnd(a0) { // fn#117964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:172, owner: sortSoundsOldestToNewestCreationDate._positionUnavailableSoundsAtEnd, offset: 0x024c6c81, size: 38 bytes, params: 2, frame: 13
const items2 = [];
arraySpread(items2, a0, 0, items2);
return items2.sort(function(a0, a1) {
return a0.available ? a1.available ? a0.available ? 0 : a1.available ? 1 : 0 : -1 : a0.available ? 0 : a1.available ? 1 : 0;
});
}
function sortSoundsOldestToNewestCreationDate(a0) { // fn#117962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:44, offset: 0x024c6c06, size: 67 bytes, params: 2, frame: 16
var r0;
let value = a1;
const r4 = !(value !== undefined) || value;
const items2 = [];
arraySpread(items2, a0, 0, items2);
value = items2.sort(_fun117963);
if (r4) {
value = ((a0) => {
var items = [];
arraySpread(items, a0, 0, items);
return items.sort(_fun117965);
})(value);
r0 = value;
} else {
r0 = value;
}
return r0;
}
function _fun117963({soundId}, {soundId}) { // fn#117963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:117, offset: 0x024c6c49, size: 56 bytes, params: 3, frame: 13
const value = environment.__proto__;
return (importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare(soundId, soundId);
}
function _positionUnavailableSoundsAtEnd(a0) { // fn#117964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:172, owner: sortSoundsOldestToNewestCreationDate._positionUnavailableSoundsAtEnd, offset: 0x024c6c81, size: 38 bytes, params: 2, frame: 13
const items2 = [];
arraySpread(items2, a0, 0, items2);
return items2.sort(function(a0, a1) {
return a0.available ? a1.available ? a0.available ? 0 : a1.available ? 1 : 0 : -1 : a0.available ? 0 : a1.available ? 1 : 0;
});
function _fun117965(a0, a1) { // fn#117965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15617:235, offset: 0x024c6ca7, size: 60 bytes, params: 3, frame: 5
return a0.available ? a1.available ? a0.available ? 0 : a1.available ? 1 : 0 : -1 : a0.available ? 0 : a1.available ? 1 : 0;
}
global.__d(_fun117961, 15420, [21, 2]) /* metro module 15420, dependencies: [21, 2] */;
@@ -1,55 +1,61 @@
/* Metro module 15425; source: modules/soundboard/useSoundboardSoundPlayer.native.tsx; dependencies: [31, 4613, 8900, 3829, 15426, 566, 6951, 2] */
import SoundboardStore from './SoundboardStore.tsx'; /* Metro dependency 4613 */
import SoundPlayerContext from '../soundplayer/SoundPlayerContext.tsx'; /* Metro dependency 15426 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../sound_playback/Constants.tsx'; /* Metro dependency 8900 */
function _fun118022(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15622:6, offset: 0x024c8eff, size: 159 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const soundboardStore = importDefault(4613) /* metro dependency 4613: SoundboardStore */;
const env0_5 = (require(8900) /* metro dependency 8900: Constants */).SoundOutputChannel;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/soundboard/useSoundboardSoundPlayer.native.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/useSoundboardSoundPlayer.native.tsx');
exports.default = useSoundboardSoundPlayer;
function useSoundboardSoundPlayer(a0, a1) { // fn#118023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15622:243, offset: 0x024c8f9e, size: 283 bytes, params: 3, frame: 20
var setting;
const env0_0 = a0;
const env0_1 = a1;
let value = undefined;
if (a2 === value) {
setting = (require(3829) /* metro dependency 3829: UserSettings */).SoundboardSettings.getSetting();
(setting == null ? value : setting.volume) != null;
}
if (a3 === value) {
SoundOutputChannel.DEFAULT;
}
const useContext = ReactModule.useContext;
const audioRef = Reflect.apply(useContext, ReactModule,
[SoundPlayerContext]).audioRef;
const useStateFromStores = (FluxModule).useStateFromStores;
value = Reflect.apply(useStateFromStores, value, [[SoundboardStore], _fun118024, [a0]]);
const useCallback = ReactModule.useCallback;
return {playSoundboardSound: Reflect.apply(useCallback, ReactModule, [_fun118025, [a0, audioRef, a1]]),
isPlayingSound: value, previewSound: function() {
var Promise = global.Promise;
return Promise.resolve();
}, isPreviewingSound: false};
function _fun118024() { // fn#118024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15622:460, offset: 0x024c90b9, size: 33 bytes, params: 1, frame: 11
const soundboardStoreBinding = SoundboardStore;
return soundboardStoreBinding.isPlayingSound(env0_0.soundId);
}
function _fun118025(a0) { // fn#118025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15622:540, offset: 0x024c90da, size: 98 bytes, params: 2, frame: 15
var value2;
var moduleValue;
if (audioRef.current != null) {
audioRef.current.pause();
}
if (require != null) {
value2 = environment.__proto__;
moduleValue = require(6951) /* metro dependency 6951: SoundboardUtils */;
moduleValue.playSound(env0_0, require, a0);
}
}
}
}
function useSoundboardSoundPlayer(a0, a1) { // fn#118023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15622:243, offset: 0x024c8f9e, size: 283 bytes, params: 3, frame: 20
var setting;
const env0_0 = a0;
const env0_1 = a1;
let value = undefined;
if (a2 === value) {
setting = (require(3829) /* metro dependency 3829: UserSettings */).SoundboardSettings.getSetting();
(setting == null ? value : setting.volume) != null;
}
if (a3 === value) {
SoundOutputChannel.DEFAULT;
}
const binding = env0_3;
const useContext = binding.useContext;
const audioRef = Reflect.apply(useContext, binding,
[importDefault(15426) /* metro dependency 15426: SoundPlayerContext */]).audioRef;
const useStateFromStores = (require(566) /* metro dependency 566: flux */).useStateFromStores;
value = Reflect.apply(useStateFromStores, value, [[SoundboardStore], _fun118024, [a0]]);
const useCallback = binding.useCallback;
return {playSoundboardSound: Reflect.apply(useCallback, binding, [_fun118025, [a0, audioRef, a1]]),
isPlayingSound: value, previewSound: function() {
var Promise = global.Promise;
return Promise.resolve();
}, isPreviewingSound: false};
}
function _fun118024() { // fn#118024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15622:460, offset: 0x024c90b9, size: 33 bytes, params: 1, frame: 11
return SoundboardStore.isPlayingSound(env0_0.soundId);
}
function _fun118025(a0) { // fn#118025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15622:540, offset: 0x024c90da, size: 98 bytes, params: 2, frame: 15
var value2;
var moduleValue;
if (audioRef.current != null) {
audioRef.current.pause();
}
if (require != null) {
value2 = environment.__proto__;
moduleValue = require(6951) /* metro dependency 6951: SoundboardUtils */;
moduleValue.playSound(env0_0, require, a0);
}
}
global.__d(_fun118022, 15425, [31, 4613, 8900, 3829, 15426, 566, 6951,
2]) /* metro module 15425, dependencies: [31, 4613, 8900, 3829, 15426, 566, 6951, 2] */;