Initial commit

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

No files matched your search

@@ -0,0 +1,37 @@
/* Metro module 11465; source: modules/voice_messages/VoiceMessageAnalytics.tsx; dependencies: [661, 683, 2] */
function _fun87780(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11651:6, offset: 0x01fcb079, size: 212 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/VoiceMessageAnalytics.tsx');
exports.VoiceMessageRecordingResult = {SENT: 'sent', CANCELLED_DURATION: 'cancelled_duration',
CANCELLED_USER_REQUESTED: 'cancelled_user_requested', CANCELLED_GESTURE_CONFLICT: 'cancelled_gesture_conflict',
CANCELLED_ON_BACKGROUND: 'cancelled_on_background'};
exports.logVoiceMessagePlaybackStarted = function(a0, a1, a2, a3) {
var value = a1;
var value2 = a2;
var defaultImport = importDefault(dependencyMap[1]);
var track = defaultImport.track;
var VOICE_MESSAGE_PLAYBACK_STARTED = AnalyticEvents.VOICE_MESSAGE_PLAYBACK_STARTED;
var Math = global.Math;
Reflect.apply(track, defaultImport, [VOICE_MESSAGE_PLAYBACK_STARTED, {message_id: a0,
total_duration_secs: value,
start_duration_secs: Math.min(value ?? value2, value2), sender_user_id: a3}]);
};
exports.logVoiceMessagePlaybackEnded = function(a0, a1, a2, a3, a4) {
var value = a1;
var value2 = a2;
var defaultImport = importDefault(dependencyMap[1]);
var track = defaultImport.track;
var VOICE_MESSAGE_PLAYBACK_ENDED = AnalyticEvents.VOICE_MESSAGE_PLAYBACK_ENDED;
var Math = global.Math;
Reflect.apply(track, defaultImport, [VOICE_MESSAGE_PLAYBACK_ENDED, {message_id: a0, total_duration_secs: value,
end_duration_secs: Math.min(value ?? value2, value2), sender_user_id: a3, duration_listening_secs: a4}]);
};
exports.logVoiceMessagePlaybackFailed = function(a0, a1) {
var defaultImport = importDefault(dependencyMap[1]);
var VOICE_MESSAGE_PLAYBACK_FAILED = AnalyticEvents.VOICE_MESSAGE_PLAYBACK_FAILED;
defaultImport.track(VOICE_MESSAGE_PLAYBACK_FAILED, {message_id: a0, error_message: a1});
};
}
@@ -0,0 +1,27 @@
/* Metro module 11528; source: modules/voice_messages/VoiceMessageConstants.tsx; dependencies: [2] */
function _fun88304(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11714:6, offset: 0x01fdec33, size: 256 bytes, params: 8, frame: 17
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {SENDING: 0};
object2[0] = 'SENDING';
object2.CANCELLING = 1;
object2[1] = 'CANCELLING';
object2.LOCKING = 2;
object2[2] = 'LOCKING';
object2.LOCKED = 3;
object2[3] = 'LOCKED';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/VoiceMessageConstants.tsx');
exports.VoiceMessageAnimationState = object2;
exports.VOICE_RECORDING_MIN_DB = -100;
exports.VOICE_RECORDING_MAX_DB = 0;
exports.VOICE_RECORDING_MIN_DURATION_MILLIS = 500;
exports.VOICE_RECORDING_MAX_DURATION_OFFSET = 500;
exports.VOICE_RECORDING_MAX_DURATION_MILLIS = 1199500;
exports.VOICE_RECORDING_WARN_DURATION_MILLIS = 1169500;
exports.VOICE_RECORDING_REALLY_WARN_DURATION_MILLIS = 1184500;
exports.WAVEFORM_WAVE_MAX_VALUE = 255;
exports.WAVEFORM_MAX_SAMPLES = 256;
exports.PLAYBACK_RATES = [0.75, 1, 1.5, 2];
}
@@ -0,0 +1,83 @@
/* Metro module 11779; source: modules/voice_messages/downsampleWaveform.tsx; dependencies: [44, 2] */
function _fun90244(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11965:6, offset: 0x02031812, size: 99 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/downsampleWaveform.tsx');
exports.default = downsampleWaveform;
}
function downsampleWaveform(a0, a1) { // fn#90245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11965:182, offset: 0x02031875, size: 232 bytes, params: 3, frame: 25
var r3;
var r12;
var r13;
var r2;
var r11;
var Math;
var round;
var value3;
var value4;
var value5;
var value6;
const value = 0;
const defaultImport = importDefault(dependencyMap[value]);
let length = a0.length;
defaultImport(length >= a1, 'Waveform smaller than samples');
if (a0.length === a1) {
return a0;
}
const value2 = a0.length / a1;
const items2 = [];
length = items2.length;
if (length < a1) {
r3 = value;
while (true) {
Math = global.Math;
round = Math.round;
length = items2.length;
value3 = Reflect.apply(round, Math, [(length + 1) * value2]);
if (r3 < value3) {
length = a0.length;
if (!(r3 < length)) {
r2 = value;
r11 = value;
break;
}
r12 = value;
r13 = value;
while (true) {
value4 = r13 + a0[r3];
value5 = typeof r12 === 'bigint' ? r12 + 1n : +r12 + 1;
value6 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
if (!(value6 < value3)) {
r2 = value5;
r11 = value4;
break;
}
length = a0.length;
if (value6 < length) {
r3 = value6;
r12 = value5;
r13 = value4;
continue;
}
r2 = value5;
r11 = value4;
break;
}
} else {
r2 = value;
r11 = value;
}
length = items2.length;
items2[length] = r11 / r2;
length = items2.length;
if (length < a1) {
r3 = value3;
continue;
}
break;
}
}
return items2;
}
@@ -0,0 +1,571 @@
/* Metro module 11778; source: modules/voice_messages/native/VoiceMessageUtils.tsx; dependencies: [5, 4259, 11527, 11528, 661, 3, 11779, 206, 22, 4406, 683, 4081, 477, 2] */
function _fun90221(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:6, offset: 0x02030f70, size: 528 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = generateBase64EncodedWaveform;
const closure2 = function() {
return _stopAndCacheAudioRecording.apply(this, arguments);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */;
let value = require(11527) /* metro dependency 11527: VoiceMessagesUIStore */;
const env0_5 = value.addVoiceMessageWave;
const env0_6 = value.resetVoiceMessageState;
const env0_7 = value.setSavedVoiceMessageUploadData;
const env0_8 = value.setVoiceMessageRecordingId;
const env0_9 = value.setVoiceMessageRecordingState;
const env0_10 = value.setVoiceMessageStartTimeMillis;
const env0_11 = value.useVoiceMessagesUIStore;
const env0_12 = value.VoiceMessageRecordingStatus;
value = require(11528) /* metro dependency 11528: VoiceMessageConstants */;
const env0_13 = value.WAVEFORM_WAVE_MAX_VALUE;
const env0_14 = value.VOICE_RECORDING_MIN_DB;
const env0_15 = value.VOICE_RECORDING_MAX_DB;
const env0_16 = value.WAVEFORM_MAX_SAMPLES;
const env0_17 = value.VOICE_RECORDING_MAX_DURATION_MILLIS;
const env0_18 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('VoiceMessages');
const env0_21 = (importDefault(22) /* metro dependency 22 */).throttle(_fun90239, 100);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/native/VoiceMessageUtils.tsx');
exports.generateBase64EncodedWaveform = closure;
exports.startAudioRecording = function() {
return _startAudioRecording.apply(this, arguments);
};
exports.endAudioRecording = function() {
return _endAudioRecording.apply(this, arguments);
};
exports.stopAndCacheAudioRecording = closure2;
exports.emitVoiceMessageRecorded = emitVoiceMessageRecorded;
exports.triggerHaptic = function() {
var moduleValue = require(dependencyMap[11]);
var triggerHapticFeedback = moduleValue.triggerHapticFeedback;
var isAndroid = require(dependencyMap[12]).isAndroid();
var HapticFeedbackTypes = require(dependencyMap[11]).HapticFeedbackTypes;
Reflect.apply(triggerHapticFeedback, moduleValue,
[isAndroid ? HapticFeedbackTypes.IMPACT_LIGHT : HapticFeedbackTypes.IMPACT_MEDIUM]);
};
}
function generateBase64EncodedWaveform(a0) { // fn#90222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:595, offset: 0x02031180, size: 135 bytes, params: 2, frame: 16
var r3;
let value = a0;
if (value.length <= WAVEFORM_MAX_SAMPLES) {
r3 = value;
} else {
value = (importDefault(11779) /* metro dependency 11779: downsampleWaveform */)(value, WAVEFORM_MAX_SAMPLES);
r3 = value;
}
value = r3.map(function(a0) {
var Math = global.Math;
return Math.min(a0, WAVEFORM_WAVE_MAX_VALUE);
});
const defaultImport = importDefault(206) /* metro dependency 206 */;
const fromByteArray = defaultImport.fromByteArray;
const Uint8Array = global.Uint8Array;
const value3 = Object.create(Uint8Array.prototype, {constructor: {value: Uint8Array}});
const uint8Array = new Uint8Array(value);
return Reflect.apply(fromByteArray, defaultImport, [uint8Array instanceof Object ? uint8Array : value3]);
}
function _startAudioRecording() { // fn#90224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:990, offset: 0x02031226, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun90226).apply(this, arguments);
}
function resetAudioRecording() { // fn#90227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:1657, offset: 0x020313f8, size: 77 bytes, params: 1, frame: 15
const mediaEngine = MediaEngineStore.getMediaEngine();
const removeListener = mediaEngine.removeListener;
const MediaEngineEvent = (require(4406) /* metro dependency 4406: mediaEngine */).MediaEngineEvent;
const VoiceActivity = MediaEngineEvent.VoiceActivity;
Reflect.apply(removeListener, mediaEngine, [VoiceActivity, env0_21]);
resetVoiceMessageState();
}
function stopAndGetAudioRecording() { // fn#90228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:1768, offset: 0x02031445, size: 114 bytes, params: 1, frame: 14
setVoiceMessageRecordingId(null);
setVoiceMessageRecordingState(null);
const generateBase64EncodedWaveformBinding = generateBase64EncodedWaveform;
const getState = useVoiceMessagesUIStore.getState;
const waveform = Reflect.apply(getState, useVoiceMessagesUIStore, []).waveform;
const env0_0 = generateBase64EncodedWaveformBinding(waveform.map(function(a0) {
var iterator = a0[Symbol.iterator]();
var item2 = iterator.next();
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
var r0 = value2 ? value : item;
if (!value2) {
item2.return();
}
return r0;
}));
const Promise = global.Promise;
let value = Object.create(Promise.prototype, {constructor: {value: Promise}});
const promise = new Promise(_fun90230);
return promise instanceof Object ? promise : value;
}
function _endAudioRecording() { // fn#90232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:2023, offset: 0x0203151f, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun90234).apply(this, arguments);
}
function _stopAndCacheAudioRecording() { // fn#90236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:2517, offset: 0x02031602, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun90238).apply(this, arguments);
}
function _fun90239(a0) { // fn#90239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:808, offset: 0x020316ad, size: 134 bytes, params: 2, frame: 16
const state = useVoiceMessagesUIStore.getState();
if (state.startTimeMillis != null) {
addVoiceMessageWave(WAVEFORM_WAVE_MAX_VALUE * ((a0 - VOICE_RECORDING_MIN_DB) / (VOICE_RECORDING_MAX_DB - VOICE_RECORDING_MIN_DB)));
if (state.savedVoiceMessageUploadData == null && global.performance.now() - state.startTimeMillis >= VOICE_RECORDING_MAX_DURATION_MILLIS) {
stopAndCacheAudioRecording();
}
}
}
function emitVoiceMessageRecorded(a0, a1, a2) { // fn#90242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:3190, offset: 0x02031733, size: 123 bytes, params: 4, frame: 17
var defaultImport;
var track;
var VOICE_MESSAGE_RECORDED;
var object2;
if (a2 != null) {
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
VOICE_MESSAGE_RECORDED = AnalyticEvents.VOICE_MESSAGE_RECORDED;
object2 = {recording_start_timestamp: a2};
object2.recording_stop_timestamp = global.Date.now();
object2.duration_secs = a1;
object2.result = a0;
object2.initialize_secs = env0_19;
Reflect.apply(track, defaultImport, [VOICE_MESSAGE_RECORDED, object2]);
}
}
function* _fun90226(a0) { // fn#90226, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:1053, offset: 0x02031263, size: 405 bytes, params: 2, frame: 21
var performance;
var now;
var value4;
var value5;
var startLocalAudioRecording;
var object3;
var getEchoCancellation;
var value6;
var getNoiseSuppression;
var value7;
var object4;
var getAutomaticGainControl;
var value8;
var getNoiseCancellation;
var value9;
var value10;
var value11;
var value12;
var value13;
var value14;
var log;
var binding2;
var getState;
var value15;
var recordingId;
var value16;
var binding3;
var STARTED;
var Date;
var value17;
var error;
if (true) {
value = environment.__proto__.__proto__;
var binding = env2_9;
var REQUESTED = env2_12.REQUESTED;
binding(REQUESTED);
env2_8(a0);
var mediaEngine = env2_4.getMediaEngine();
var on = mediaEngine.on;
var MediaEngineEvent = env2_0(env2_2[9]).MediaEngineEvent;
var VoiceActivity = MediaEngineEvent.VoiceActivity;
Reflect.apply(on, mediaEngine, [VoiceActivity, env2_21]);
try {
performance = global.performance;
} catch (error) {
env2_24();
throw error;
}
try {
now = performance.now;
} catch (error) {
env2_24();
throw error;
}
try {
value4 = Reflect.apply(now, performance, []);
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_4;
} catch (error) {
env2_24();
throw error;
}
try {
getMediaEngine = binding.getMediaEngine;
} catch (error) {
env2_24();
throw error;
}
try {
value5 = Reflect.apply(getMediaEngine, binding, []);
} catch (error) {
env2_24();
throw error;
}
try {
startLocalAudioRecording = value5.startLocalAudioRecording;
} catch (error) {
env2_24();
throw error;
}
try {
object3 = {};
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_4;
} catch (error) {
env2_24();
throw error;
}
try {
getEchoCancellation = binding.getEchoCancellation;
} catch (error) {
env2_24();
throw error;
}
try {
value6 = Reflect.apply(getEchoCancellation, binding, []);
} catch (error) {
env2_24();
throw error;
}
try {
object3.echoCancellation = value6;
} catch (error) {
env2_24();
throw error;
}
try {
object3.echoCancellationPreEcho = false;
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_4;
} catch (error) {
env2_24();
throw error;
}
try {
getNoiseSuppression = binding.getNoiseSuppression;
} catch (error) {
env2_24();
throw error;
}
try {
value7 = Reflect.apply(getNoiseSuppression, binding, []);
} catch (error) {
env2_24();
throw error;
}
try {
object3.noiseSuppression = value7;
} catch (error) {
env2_24();
throw error;
}
try {
object4 = {};
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_4;
} catch (error) {
env2_24();
throw error;
}
try {
getAutomaticGainControl = binding.getAutomaticGainControl;
} catch (error) {
env2_24();
throw error;
}
try {
value8 = Reflect.apply(getAutomaticGainControl, binding, []);
} catch (error) {
env2_24();
throw error;
}
try {
object4.enabled = value8;
} catch (error) {
env2_24();
throw error;
}
try {
object3.automaticGainControlConfig = object4;
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_4;
} catch (error) {
env2_24();
throw error;
}
try {
getNoiseCancellation = binding.getNoiseCancellation;
} catch (error) {
env2_24();
throw error;
}
try {
value9 = Reflect.apply(getNoiseCancellation, binding, []);
} catch (error) {
env2_24();
throw error;
}
try {
object3.noiseCancellation = value9;
} catch (error) {
env2_24();
throw error;
}
try {
value10 = Reflect.apply(startLocalAudioRecording, value5, [object3]);
} catch (error) {
env2_24();
throw error;
}
yield value10;
try {
value11 = undefined;
value12 = false;
} catch (error) {
env2_24();
throw error;
}
if (value12) {
return value11;
}
try {
performance = global.performance;
} catch (error) {
env2_24();
throw error;
}
try {
now = performance.now;
} catch (error) {
env2_24();
throw error;
}
try {
value13 = Reflect.apply(now, performance, []);
} catch (error) {
env2_24();
throw error;
}
try {
value14 = value13 - value4;
} catch (error) {
env2_24();
throw error;
}
try {
env2_19 = value14;
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_20;
} catch (error) {
env2_24();
throw error;
}
try {
log = binding.log;
} catch (error) {
env2_24();
throw error;
}
try {
binding2 = env2_19;
} catch (error) {
env2_24();
throw error;
}
try {
Reflect.apply(log, binding, ['Voice message audio startup latency:', binding2]);
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_11;
} catch (error) {
env2_24();
throw error;
}
try {
getState = binding.getState;
} catch (error) {
env2_24();
throw error;
}
try {
value15 = Reflect.apply(getState, binding, []);
} catch (error) {
env2_24();
throw error;
}
try {
recordingId = value15.recordingId;
} catch (error) {
env2_24();
throw error;
}
try {
value16 = recordingId !== a0;
} catch (error) {
env2_24();
throw error;
}
if (!value16) {
try {
binding = env2_9;
} catch (error) {
env2_24();
throw error;
}
try {
binding3 = env2_12;
} catch (error) {
env2_24();
throw error;
}
try {
STARTED = binding3.STARTED;
} catch (error) {
env2_24();
throw error;
}
try {
binding(STARTED);
} catch (error) {
env2_24();
throw error;
}
try {
binding = env2_10;
} catch (error) {
env2_24();
throw error;
}
try {
Date = global.Date;
} catch (error) {
env2_24();
throw error;
}
try {
now = Date.now;
} catch (error) {
env2_24();
throw error;
}
try {
value17 = Reflect.apply(now, Date, []);
} catch (error) {
env2_24();
throw error;
}
try {
binding(value17);
} catch (error) {
env2_24();
throw error;
}
}
}
}
function _fun90230(a0) { // fn#90230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:1915, offset: 0x020314b7, size: 48 bytes, params: 2, frame: 11
var environment;
const env0_0 = a0;
const value = environment.__proto__;
MediaEngineStore.getMediaEngine().stopLocalAudioRecording(_fun90231);
}
function* _fun90234() { // fn#90234, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:2082, offset: 0x0203155c, size: 166 bytes, params: 1, frame: 14
var r4;
var startTimeMillis;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_11;
const state = binding.getState();
const savedVoiceMessageUploadData = state.savedVoiceMessageUploadData;
if (savedVoiceMessageUploadData == null && state.recordingStatus === env2_12.REQUESTED) {
env2_25();
r4 = {'filename': '', 'durationSecs': 0, 'waveform': ''};
} else {
r4 = savedVoiceMessageUploadData;
}
if (r4 != null) {
binding = env2_11;
startTimeMillis = binding.getState().startTimeMillis;
} else {
yield env2_25();
var value6 = undefined;
if (false) {
return value6;
}
r4 = value6;
binding = env2_11;
startTimeMillis = binding.getState().startTimeMillis;
}
env2_24();
return {data: r4, startTimeMillis: startTimeMillis};
}
function* _fun90238() { // fn#90238, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:2594, offset: 0x0203163f, size: 110 bytes, params: 1, frame: 18
if (true) {
value = environment.__proto__.__proto__;
yield env2_25();
var value3 = undefined;
if (false) {
return value3;
}
var mediaEngine = env2_4.getMediaEngine();
var removeListener = mediaEngine.removeListener;
var MediaEngineEvent = env2_0(env2_2[9]).MediaEngineEvent;
var VoiceActivity = MediaEngineEvent.VoiceActivity;
Reflect.apply(removeListener, mediaEngine, [VoiceActivity, env2_21]);
env2_7(value3);
}
}
function _fun90231(a0, a1) { // fn#90231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11964:1963, offset: 0x020314e7, size: 56 bytes, params: 3, frame: 12
env0_0({filename: a0, durationSecs: a1 / 1000, waveform: env1_0});
}
@@ -0,0 +1,199 @@
/* Metro module 13085; source: modules/voice_messages/native/VoiceMessagesPlaybackManager.tsx; dependencies: [6, 7, 15, 17, 18, 27, 4502, 1934, 477, 13086, 4560, 694, 4561, 2] */
function _fun99980(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:6, offset: 0x021db066, size: 349 bytes, params: 8, frame: 22
const env0_0 = require;
const closure = pauseCurrentAudioPlayer;
const closure2 = playCurrentAudioPlayer;
const closure3 = handleVoiceMessageDeleted;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
let value = require(27) /* metro dependency 27 */;
const env0_8 = value.AppState;
const env0_9 = value.NativeModules;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
value = importDefault(4561) /* metro dependency 4561: LifecycleManager */;
value = _fun99987(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/native/VoiceMessagesPlaybackManager.tsx');
exports.default = value;
exports.pauseCurrentAudioPlayer = closure;
exports.playCurrentAudioPlayer = closure2;
exports.handleVoiceMessageDeleted = closure3;
}
function _isNativeReflectConstruct_99981() { // fn#99981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:209, offset: 0x021db1c3, 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_99981_isNativeReflectConstruct = function() {
return !!result;
})();
}
function pauseCurrentAudioPlayer(a0) { // fn#99984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:402, offset: 0x021db225, size: 103 bytes, params: 2, frame: 13
var DCDAudioPlayerManager;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
(importDefault(13086) /* metro dependency 13086: NativeAudioPlayerModule */).pauseCurrentPlayer(a0);
} else {
DCDAudioPlayerManager = NativeModules.DCDAudioPlayerManager;
if (DCDAudioPlayerManager != null) {
DCDAudioPlayerManager.pauseCurrentPlayer(a0);
}
}
}
function playCurrentAudioPlayer() { // fn#99985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:553, offset: 0x021db28c, size: 98 bytes, params: 1, frame: 12
var DCDAudioPlayerManager;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
(importDefault(13086) /* metro dependency 13086: NativeAudioPlayerModule */).maybePlayCurrentPlayer();
} else {
DCDAudioPlayerManager = NativeModules.DCDAudioPlayerManager;
if (DCDAudioPlayerManager != null) {
DCDAudioPlayerManager.maybePlayCurrentPlayer();
}
}
}
function handleVoiceMessageDeleted(a0) { // fn#99986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:708, offset: 0x021db2ee, size: 103 bytes, params: 2, frame: 13
var DCDAudioPlayerManager;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
(importDefault(13086) /* metro dependency 13086: NativeAudioPlayerModule */).handleVoiceMessageDeleted(a0);
} else {
DCDAudioPlayerManager = NativeModules.DCDAudioPlayerManager;
if (DCDAudioPlayerManager != null) {
DCDAudioPlayerManager.handleVoiceMessageDeleted(a0);
}
}
}
function _fun99987(a0) { // fn#99987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:885, offset: 0x021db355, size: 97 bytes, params: 2, frame: 16
const closure = VoiceMessagesPlaybackManager;
env0_7(closure, a0);
return env0_4(closure, [{key: '_terminate', value: value_99993}, {key: '_initialize', value: value_99994}]);
}
function VoiceMessagesPlaybackManager(a0) { // fn#99988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:897, offset: 0x021db3b6, size: 200 bytes, params: 2, frame: 21
var environment;
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let value2 = environment.__proto__;
let binding = env1_3;
binding(this, VoiceMessagesPlaybackManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_6(VoiceMessagesPlaybackManager);
binding = env1_5;
if (_isNativeReflectConstruct_99981()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_6(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value.appState = AppState.currentState;
value.handleSetPrefersReducedMotion = handleSetPrefersReducedMotion;
value.handleMessageDelete = function({id, channelId}) {
var value2 = channelId === SelectedChannelStore.getCurrentlySelectedChannelId();
if (value2 != null && value2) {
if (handleVoiceMessageDeleted != null) {
handleVoiceMessageDeleted(id);
}
}
};
value.handleLogout = function() {
pauseCurrentAudioPlayer(false);
};
value.handleAppStateChanged = handleAppStateChanged_99992;
return value;
}
function value_99993() { // fn#99993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:1911, offset: 0x021db5a5, size: 147 bytes, params: 1, frame: 18
let value = environment.__proto__;
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('LOGOUT', this.handleLogout);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('MESSAGE_DELETE', this.handleMessageDelete);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('APP_STATE_UPDATE', this.handleAppStateChanged);
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.unsubscribe('ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION', this.handleSetPrefersReducedMotion);
}
function value_99994() { // fn#99994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:2230, offset: 0x021db638, size: 179 bytes, params: 1, frame: 19
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
defaultImport.subscribe('LOGOUT', this.handleLogout);
const defaultImport2 = defaultImport;
defaultImport2.subscribe('MESSAGE_DELETE', this.handleMessageDelete);
const defaultImport3 = defaultImport;
defaultImport3.subscribe('APP_STATE_UPDATE', this.handleAppStateChanged);
const defaultImport4 = defaultImport;
defaultImport4.subscribe('ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION', this.handleSetPrefersReducedMotion);
this.handleSetPrefersReducedMotion({type: 'ACCESSIBILITY_SET_PREFERS_REDUCED_MOTION',
prefersReducedMotion: AccessibilityStore.rawPrefersReducedMotion});
}
function handleSetPrefersReducedMotion(a0) { // fn#99989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:1225, owner: VoiceMessagesPlaybackManager.handleSetPrefersReducedMotion, offset: 0x021db47e, size: 109 bytes, params: 2, frame: 14
var DCDAccessibilityManager;
let value = environment.__proto__.__proto__;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
value = importDefault(4560) /* metro dependency 4560: NativeDeviceAccessibilityModule */;
value.handleSetPrefersReducedMotion(a0.prefersReducedMotion);
} else {
DCDAccessibilityManager = NativeModules.DCDAccessibilityManager;
DCDAccessibilityManager.handleSetPrefersReducedMotion(a0.prefersReducedMotion);
}
}
function VoiceMessagesPlaybackManagerHandleAppStateChanged({state}) { // fn#99992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13275:1634, owner: VoiceMessagesPlaybackManager.handleAppStateChanged, offset: 0x021db533, size: 114 bytes, params: 2, frame: 14
var binding;
var appState;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
binding = env0_0;
appState = binding.appState;
binding.appState = state;
if (state !== 'active') {
if (state !== 'active' && appState === 'active') {
pauseCurrentAudioPlayer(true);
}
} else if (appState !== 'active') {
playCurrentAudioPlayer();
} else if (state !== 'active' && appState === 'active') {
pauseCurrentAudioPlayer(true);
}
}
}
@@ -0,0 +1,181 @@
/* Metro module 11527; source: modules/voice_messages/native/VoiceMessagesUIStore.tsx; dependencies: [11528, 629, 4017, 690, 4577, 2] */
function _fun88278(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:6, offset: 0x01fde553, size: 349 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = require(11528) /* metro dependency 11528: VoiceMessageConstants */;
const env0_2 = value.VoiceMessageAnimationState;
const env0_3 = value.WAVEFORM_WAVE_MAX_VALUE;
object2 = {REQUESTED: 0};
object2[0] = 'REQUESTED';
object2.STARTED = 1;
object2[1] = 'STARTED';
value = require(629) /* metro dependency 629 */;
value = value.create(_fun88279);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/native/VoiceMessagesUIStore.tsx');
exports.VoiceMessageRecordingStatus = object2;
exports.useVoiceMessagesUIStore = value;
exports.setShowRecordingOverlay = setShowRecordingOverlay;
exports.setVoiceMessageRecordingState = setVoiceMessageRecordingState;
exports.setVoiceMessageRecordingId = setVoiceMessageRecordingId;
exports.setVoiceMessageStartTimeMillis = setVoiceMessageStartTimeMillis;
exports.setVoiceMessageAnimationState = setVoiceMessageAnimationState;
exports.addVoiceMessageWave = addVoiceMessageWave;
exports.showVoiceMessagesTooltip = showVoiceMessagesTooltip;
exports.hideVoiceMessagesTooltip = hideVoiceMessagesTooltip;
exports.resetVoiceMessageState = resetVoiceMessageState;
exports.setSavedVoiceMessageUploadData = setSavedVoiceMessageUploadData;
exports.setIsVoiceMessageButtonMounted = setIsVoiceMessageButtonMounted;
exports.setIsUsingHoldGesture = setIsUsingHoldGesture;
}
function _fun88279() { // fn#88279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:265, offset: 0x01fde6b0, size: 135 bytes, params: 1, frame: 15
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const makeMutable = reanimatedRexportModule.makeMutable;
let SENDING = VoiceMessageAnimationState.SENDING;
const items2 = [SENDING];
SENDING = VoiceMessageAnimationState.SENDING;
items2[1] = SENDING;
return {'voiceMessageAnimationState': null, 'recordingStatus': null, 'recordingId': null, 'currWaveHeight': null,
'showRecordingOverlay': false, voiceMessageAnimationState: Reflect.apply(makeMutable, reanimatedRexportModule,
[items2]), currWaveHeight: undefined, startTimeMillis: undefined, waveform: [], waveformVersion: 0,
showVoiceMessagesTooltip: false, savedVoiceMessageUploadData: undefined, isVoiceMessageButtonMounted: false,
isUsingHoldGesture: false};
}
function setShowRecordingOverlay(a0) { // fn#88280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:776, offset: 0x01fde737, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88281);
}
function setVoiceMessageRecordingState(a0) { // fn#88282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:912, offset: 0x01fde791, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88283);
}
function setVoiceMessageRecordingId(a0) { // fn#88284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1046, offset: 0x01fde7eb, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88285);
}
function setVoiceMessageStartTimeMillis(a0) { // fn#88286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1177, offset: 0x01fde845, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88287);
}
function setVoiceMessageAnimationState(a0) { // fn#88288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1315, offset: 0x01fde89f, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88289);
}
function addVoiceMessageWave(a0) { // fn#88290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1429, offset: 0x01fde8fb, size: 184 bytes, params: 2, frame: 18
var set;
var moduleValue;
const binding = env0_5;
let getState = binding.getState;
const waveform = Reflect.apply(getState, binding, []).waveform;
getState = binding.getState;
const waveformVersion = Reflect.apply(getState, binding, []).waveformVersion;
getState = binding.getState;
const currWaveHeight = Reflect.apply(getState, binding, []).currWaveHeight;
if (currWaveHeight != null) {
set = currWaveHeight.set;
moduleValue = require(4577) /* metro dependency 4577: spring */;
Reflect.apply(set, currWaveHeight, [moduleValue.withSpring(a0 / WAVEFORM_WAVE_MAX_VALUE)]);
}
waveform.push([a0, waveformVersion]);
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88291);
}
function showVoiceMessagesTooltip() { // fn#88292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1696, offset: 0x01fde9de, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88293);
}
function hideVoiceMessagesTooltip() { // fn#88294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1832, offset: 0x01fdea2c, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88295);
}
function resetVoiceMessageState() { // fn#88296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1966, offset: 0x01fdea7a, size: 115 bytes, params: 1, frame: 14
var set;
var value;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88297);
const binding = env0_5;
const getState = binding.getState;
const currWaveHeight = Reflect.apply(getState, binding, []).currWaveHeight;
if (currWaveHeight != null) {
set = currWaveHeight.set;
value = require(4577) /* metro dependency 4577: spring */;
Reflect.apply(set, currWaveHeight, [value.withSpring(0)]);
}
}
function setSavedVoiceMessageUploadData(a0) { // fn#88298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:2262, offset: 0x01fdeb25, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88299);
}
function setIsVoiceMessageButtonMounted(a0) { // fn#88300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:2413, offset: 0x01fdeb7f, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88301);
}
function setIsUsingHoldGesture(a0) { // fn#88302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:2555, offset: 0x01fdebd9, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88303);
}
function _fun88281() { // fn#88281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:834, offset: 0x01fde76d, size: 36 bytes, params: 1, frame: 12
env1_4.setState({showRecordingOverlay: env0_0});
}
function _fun88283() { // fn#88283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:976, offset: 0x01fde7c7, size: 36 bytes, params: 1, frame: 12
env1_4.setState({recordingStatus: env0_0});
}
function _fun88285() { // fn#88285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1107, offset: 0x01fde821, size: 36 bytes, params: 1, frame: 12
env1_4.setState({recordingId: env0_0});
}
function _fun88287() { // fn#88287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1242, offset: 0x01fde87b, size: 36 bytes, params: 1, frame: 12
env1_4.setState({startTimeMillis: env0_0});
}
function _fun88289() { // fn#88289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1379, offset: 0x01fde8d5, size: 38 bytes, params: 1, frame: 13
const value = environment.__proto__;
const binding = env1_4;
const setState = binding.setState;
const object2 = {};
copyDataProperties(object2, env0_0, environment);
Reflect.apply(setState, binding, [object2]);
}
function _fun88291() { // fn#88291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1626, offset: 0x01fde9b3, size: 43 bytes, params: 1, frame: 13
env1_4.setState({waveformVersion: waveformVersion + 1});
}
function _fun88293() { // fn#88293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1754, offset: 0x01fdea0d, size: 31 bytes, params: 1, frame: 12
env1_4.setState({showVoiceMessagesTooltip: true});
}
function _fun88295() { // fn#88295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:1890, offset: 0x01fdea5b, size: 31 bytes, params: 1, frame: 12
env1_4.setState({showVoiceMessagesTooltip: false});
}
function _fun88297() { // fn#88297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:2022, offset: 0x01fdeaed, size: 56 bytes, params: 1, frame: 13
env1_4.setState({'waveform': null, 'waveformVersion': 0, 'showRecordingOverlay': false, waveform: [],
startTimeMillis: undefined, savedVoiceMessageUploadData: undefined});
}
function _fun88299() { // fn#88299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:2327, offset: 0x01fdeb5b, size: 36 bytes, params: 1, frame: 12
env1_4.setState({savedVoiceMessageUploadData: env0_0});
}
function _fun88301() { // fn#88301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:2478, offset: 0x01fdebb5, size: 36 bytes, params: 1, frame: 12
env1_4.setState({isVoiceMessageButtonMounted: env0_0});
}
function _fun88303() { // fn#88303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11713:2611, offset: 0x01fdec0f, size: 36 bytes, params: 1, frame: 12
env1_4.setState({isUsingHoldGesture: env0_0});
}
@@ -0,0 +1,799 @@
/* Metro module 11777; source: modules/voice_messages/native/components/VoiceMessageButton.tsx; dependencies: [5, 57, 31, 27, 3849, 7074, 1379, 11527, 11528, 661, 4503, 4661, 33, 4501, 697, 8222, 4007, 7709, 11778, 4017, 7701, 11335, 1478, 11465, 4648, 4650, 7067, 7880, 11004, 1239, 3857, 1244, 10915, 4008, 4662, 3856, 9104, 5321, 11780, 11759, 10280, 2] */
function _fun90180(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:6, offset: 0x0202f712, size: 738 bytes, params: 8, frame: 24
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(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_6 = value2.View;
const env0_7 = value2.AppState;
const actionSheetStore = importDefault(3849) /* metro dependency 3849: ActionSheetStore */;
const pendingReplyStore = importDefault(7074) /* metro dependency 7074: PendingReplyStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const voiceMessagesUIStoreModule = require(11527) /* metro dependency 11527: VoiceMessagesUIStore */;
const env0_11 = voiceMessagesUIStoreModule.setIsVoiceMessageButtonMounted;
const env0_12 = voiceMessagesUIStoreModule.setIsUsingHoldGesture;
const env0_13 = voiceMessagesUIStoreModule.setVoiceMessageAnimationState;
const env0_14 = voiceMessagesUIStoreModule.showVoiceMessagesTooltip;
const env0_15 = voiceMessagesUIStoreModule.useVoiceMessagesUIStore;
const env0_16 = voiceMessagesUIStoreModule.setShowRecordingOverlay;
const env0_17 = voiceMessagesUIStoreModule.hideVoiceMessagesTooltip;
const voiceMessageConstantsModule = require(11528) /* metro dependency 11528: VoiceMessageConstants */;
const env0_18 = voiceMessageConstantsModule.VoiceMessageAnimationState;
const env0_19 = voiceMessageConstantsModule.VOICE_RECORDING_MIN_DURATION_MILLIS;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_20 = constantsModule.ComponentActions;
const env0_21 = constantsModule.ComponentActionsKeyed;
const env0_22 = constantsModule.MessageFlags;
const env0_23 = (require(4503) /* metro dependency 4503: MessageConstants */).MessageSendLocation;
const env0_24 = (require(4661) /* metro dependency 4661: NativePermissionConstants */).NativePermissionTypes;
const env0_25 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
let createStyles = createStylesModule.createStyles;
const object3 = {};
const BACKGROUND_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_FEEDBACK_CRITICAL;
object3.backgroundColor = BACKGROUND_FEEDBACK_CRITICAL;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object3.padding = PX_4;
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object3.marginLeft = PX_4;
const env0_26 = Reflect.apply(createStyles, createStylesModule, [{icon: object3}]);
const value7 = createStylesModule;
createStyles = value7.createStyles;
const CARD_SECONDARY_BG = (importDefault(697) /* metro dependency 697: native */).colors.CARD_SECONDARY_BG;
const env0_27 = Reflect.apply(createStyles, value7, [{themedChatInput: {backgroundColor: CARD_SECONDARY_BG}}]);
object = {code: 'function VoiceMessageButtonTsx1(newValue){const{voiceMessageAnimationState,runOnJS,triggerHapticGuarded}=this.__closure;if(voiceMessageAnimationState.get()[1]===newValue)return;const prevValue=voiceMessageAnimationState.get()[1];voiceMessageAnimationState.set([prevValue,newValue]);runOnJS(triggerHapticGuarded)();}'};
object = {code: 'function VoiceMessageButtonTsx2(){const{runOnJS,handleFinalize}=this.__closure;runOnJS(handleFinalize)();}'};
object = {code: 'function VoiceMessageButtonTsx3(e){const{isGestureActiveValue,LOCK_THRESHOLD,cancelThresholdX,handleUpdateValue,VoiceMessageAnimationState}=this.__closure;if(!isGestureActiveValue.get())return;if(e.translationY<=-LOCK_THRESHOLD&&e.absoluteX>=cancelThresholdX){handleUpdateValue(VoiceMessageAnimationState.LOCKING);}else if(e.absoluteX<cancelThresholdX){handleUpdateValue(VoiceMessageAnimationState.CANCELLING);}else if(e.absoluteX>=cancelThresholdX){handleUpdateValue(VoiceMessageAnimationState.SENDING);}}'};
object = {code: 'function VoiceMessageButtonTsx4(e){const{isGestureActiveValue,runOnJS,setIsUsingHoldGesture,voiceMessageAnimationState,VoiceMessageAnimationState,startRecording}=this.__closure;if(e.numberOfTouches>1)return;if(isGestureActiveValue.get())return;runOnJS(setIsUsingHoldGesture)(true);voiceMessageAnimationState.set([VoiceMessageAnimationState.SENDING,VoiceMessageAnimationState.SENDING]);runOnJS(startRecording)();}'};
value = value.memo(_fun90183);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/native/components/VoiceMessageButton.tsx');
exports.default = value;
}
function VoiceMessageRecordingCancelledToastIcon() { // fn#90181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:831, offset: 0x0202f9f4, size: 128 bytes, params: 1, frame: 19
const styles = useStyles();
const viewBindingProps = {style: styles.icon};
viewBindingProps['aria-hidden'] = true;
const XSmallBoldIcon = (require(8222) /* metro dependency 8222: XSmallBoldIcon */).XSmallBoldIcon;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
return (
<View {...viewBindingProps}>
<XSmallBoldIcon color={WHITE} size="xs" />
</View>
);
}
function triggerHapticGuarded() { // fn#90182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:1111, offset: 0x0202fa74, size: 62 bytes, params: 1, frame: 11
const getState = useVoiceMessagesUIStore.getState;
if (Reflect.apply(getState, useVoiceMessagesUIStore, []).showRecordingOverlay) {
(require(11778) /* metro dependency 11778: VoiceMessageUtils */).triggerHaptic();
}
}
function _fun90183({disabled, channelId}) { // fn#90183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:2604, offset: 0x0202fab2, size: 1043 bytes, params: 2, frame: 32
var object2;
const styles = useStyles();
const value2 = (require(7701) /* metro dependency 7701: ClientThemesOverrides */).useClientThemesOverride(styles.themedChatInput);
const value3 = useVoiceMessagesUIStore(function(a0) {
return a0.voiceMessageAnimationState;
});
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const env0_3 = value4;
const value6 = env0_4(useIsGestureActive(), 3);
const property = value6[0];
const property2 = value6[1];
const env0_5 = property2;
const property3 = value6[2];
const binding = env0_5;
const env0_7 = binding.useRef(true);
const env0_8 = binding.useRef(AppState.currentState);
const env0_9 = binding.useRef(null);
const value7 = (importDefault(11335) /* metro dependency 11335: useChatWidth */)();
const width = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width;
let useCallback = binding.useCallback;
const value9 = Reflect.apply(useCallback, binding, [_fun90187(), [channelId, property3]]);
binding.useEffect(_fun90192, [channelId, value9]);
let closure = function() {
setIsVoiceMessageButtonMounted(true);
return _fun90195;
};
binding.useEffect(closure, []);
binding.useEffect(function() {
var env0_0 = AppState.addEventListener('change', _fun90197);
return _fun90199;
}, []);
binding.useEffect(_fun90200, [property, property3]);
const value10 = (require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */).useIsModalOpen();
binding.useEffect(_fun90202, [property, property3, channelId]);
binding.useEffect(_fun90210, [value4, value10]);
useCallback = binding.useCallback;
const binding2 = env0_3;
const value12 = Reflect.apply(useCallback, binding, [binding2(_fun90212), [property, property3, channelId]]);
useCallback = binding.useCallback;
closure = Q_90213;
object2 = {voiceMessageAnimationState: value3};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.triggerHapticGuarded = triggerHapticGuarded;
closure.__closure = object2;
closure.__workletHash = 9127775028714;
closure.__initData = env0_28;
const value13 = Reflect.apply(useCallback, binding, [closure, [value3]]);
const value14 = binding.useCallback(_fun90214, [value3, property, value9, property3]);
const defaultImport = importDefault(9104) /* metro dependency 9104: useAccessibilityPress */;
const value15 = binding2(_fun90216);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const {accessibilityActions, onAccessibilityAction} = defaultImport(value15,
intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lwy6aX));
const value19 = binding.useMemo(_fun90217, [disabled, property2, value3, value12, 0.5 * value7 + (width - value7),
value13, value14]);
const tooltipTargetRef = (importDefault(11780) /* metro dependency 11780: useVoiceMessageTooltip */)().tooltipTargetRef;
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const chatInputActionButton = importDefault(11759) /* metro dependency 11759: ChatInputActionButton */;
const MicrophoneIcon = (require(10280) /* metro dependency 10280: MicrophoneIcon */).MicrophoneIcon;
return (
<GestureDetector gesture={value19}>
{((Component) => <Component ref={tooltipTargetRef} IconComponent={MicrophoneIcon} active={false} accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lwy6aX)} accessibilityActions={accessibilityActions} onAccessibilityAction={onAccessibilityAction} disabled={disabled} style={value2} />)(chatInputActionButton)}
</GestureDetector>
);
}
function useIsGestureActive() { // fn#90185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:2773, offset: 0x0202fed0, size: 110 bytes, params: 1, frame: 16
var environment;
let value = environment.__proto__;
const binding = env1_5;
const value2 = binding.useRef(false);
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.useSharedValue(false);
const useCallback = binding.useCallback;
let items2 = [value2, value];
items2 = [value2, value, Reflect.apply(useCallback, binding, [_fun90186, items2])];
return items2;
}
function _fun90187() { // fn#90187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:3057, offset: 0x0202ff60, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_3(_fun90189);
return _fun90191;
}
function _fun90192() { // fn#90192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:4344, offset: 0x020302f4, size: 78 bytes, params: 1, frame: 15
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
const subscribeKeyed = ComponentDispatch.subscribeKeyed;
const VOICE_MESSAGE_SEND = ComponentActionsKeyed.VOICE_MESSAGE_SEND;
Reflect.apply(subscribeKeyed, ComponentDispatch, [VOICE_MESSAGE_SEND, channelId, env0_10]);
return _fun90193;
}
function _fun90194() { // fn#90194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:4515, offset: 0x02030387, size: 27 bytes, params: 1, frame: 11
setIsVoiceMessageButtonMounted(true);
return function() {
setIsVoiceMessageButtonMounted(false);
};
}
function _fun90196() { // fn#90196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:4557, offset: 0x020303b4, size: 45 bytes, params: 1, frame: 14
const env0_0 = AppState.addEventListener('change', _fun90197);
return _fun90199;
}
function _fun90200() { // fn#90200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5000, offset: 0x020304f7, size: 39 bytes, params: 1, frame: 4
env0_7.current = true;
const env0_0 = env0_4.current;
return _fun90201;
}
function _fun90202() { // fn#90202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5223, offset: 0x0203058d, size: 131 bytes, params: 1, frame: 16
var environment;
const closure = function() {
return _cancel.apply(this, arguments);
};
const closure2 = handleActionSheetChange;
const closure3 = handleNavigationChange_90208;
closure();
let value = environment.__proto__;
ActionSheetStore.addReactChangeListener(closure2);
value = require(4008) /* metro dependency 4008: RootNavigationRefNative */;
value = value.getRootNavigationRef();
if (value != null) {
value.addListener('state', closure3);
}
return _fun90209;
}
function _fun90210() { // fn#90210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:6127, offset: 0x020307e4, size: 30 bytes, params: 1, frame: 11
setVoiceMessageAnimationState({currWaveHeight: env0_3});
}
function* _fun90212() { // fn#90212, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:6188, offset: 0x0203080d, size: 620 bytes, params: 1, frame: 22
var r4;
var r2;
var openModalKey;
var value8;
var value9;
var binding3;
var property;
var value17;
var startAudioRecording;
var value18;
var value19;
var value20;
var voiceMessageAnimationState;
var error;
var value25;
let value = undefined;
if (true) {
value = undefined;
var binding = env2_0;
var isModalOpen2 = binding(env2_2[16]).isModalOpen();
var value5 = false;
if (isModalOpen2) {
openModalKey = env2_0(env2_2[16]).getOpenModalKey();
value8 = openModalKey == null;
if (value8) {
r4 = value8;
} else {
value9 = env2_0(env2_2[17]);
r4 = !value9.isVoiceChannelModalKey(openModalKey);
}
r2 = r4;
} else {
r2 = value5;
}
if (r2) {
return value;
}
var current = AppState.current;
if (!current) {
return value;
}
binding = env2_8;
if (binding.isOpen()) {
return value;
}
binding = env2_10;
if (binding.getChannel(importDefault) == null) {
return value;
}
View(true);
binding = env2_0;
var binding2 = env2_2;
var ComponentDispatch = binding(binding2[29]).ComponentDispatch;
var dispatch = ComponentDispatch.dispatch;
var VOICE_MESSAGE_BUTTON_PRESSED = env2_20.VOICE_MESSAGE_BUTTON_PRESSED;
Reflect.apply(dispatch, ComponentDispatch, [VOICE_MESSAGE_BUTTON_PRESSED]);
binding = env2_1;
var value13 = binding(binding2[34]);
var requestPermission = value13.requestPermission;
var AUDIO = env2_24.AUDIO;
yield Reflect.apply(requestPermission, value13, [AUDIO]);
var value14 = undefined;
if (false) {
return value14;
}
if (!value14) {
return value;
}
current = env1_4.current;
if (!current) {
return value;
}
env2_17();
var value16 = global.performance.now();
env2_16(true);
try {
binding = env2_0;
} catch (error) {
View(value5);
binding = env2_0;
value25 = binding(env2_2[35]);
value25.showVoiceRecordingFailed();
return value;
}
try {
binding3 = env2_2;
} catch (error) {
View(value5);
binding = env2_0;
value25 = binding(env2_2[35]);
value25.showVoiceRecordingFailed();
return value;
}
try {
property = binding3[18];
} catch (error) {
View(value5);
binding = env2_0;
value25 = binding(env2_2[35]);
value25.showVoiceRecordingFailed();
return value;
}
try {
value17 = binding(property);
} catch (error) {
View(value5);
binding = env2_0;
value25 = binding(env2_2[35]);
value25.showVoiceRecordingFailed();
return value;
}
try {
startAudioRecording = value17.startAudioRecording;
} catch (error) {
View(value5);
binding = env2_0;
value25 = binding(env2_2[35]);
value25.showVoiceRecordingFailed();
return value;
}
try {
value18 = Reflect.apply(startAudioRecording, value17, [value16]);
} catch (error) {
View(value5);
binding = env2_0;
value25 = binding(env2_2[35]);
value25.showVoiceRecordingFailed();
return value;
}
yield value18;
try {
value19 = undefined;
value20 = false;
} catch (error) {
View(value5);
binding = env2_0;
value25 = binding(env2_2[35]);
value25.showVoiceRecordingFailed();
return value;
}
if (value20) {
return value19;
}
binding = env2_15;
var state = binding.getState();
if (state.recordingId === value16) {
voiceMessageAnimationState = state.voiceMessageAnimationState;
if ((voiceMessageAnimationState == null ? value : voiceMessageAnimationState.get()[1]) === env2_18.LOCKED) {
env2_0(env2_2[18]).triggerHaptic();
} else if (env1_4.current) {
env2_0(env2_2[18]).triggerHaptic();
} else {
env2_0(env2_2[18]).endAudioRecording();
}
}
}
return value;
}
function Q_90213(a0) { // fn#90213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:6892, offset: 0x02030a79, size: 116 bytes, params: 2, frame: 13
var moduleValue;
let binding = env0_2;
if (binding.get()[1] !== a0) {
binding = env0_2;
binding.set([binding.get()[1], a0]);
value = environment.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(triggerHapticGuarded)();
}
}
function _fun90214() { // fn#90214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:7176, offset: 0x02030aed, size: 307 bytes, params: 1, frame: 17
var property;
var value3;
var value;
if (env0_4.current) {
env0_6(false);
property = env0_2.get()[1];
value3 = environment.__proto__;
if (VoiceMessageAnimationState.SENDING === property) {
env0_10({isCancelling: false});
return undefined;
}
if (VoiceMessageAnimationState.CANCELLING === property) {
env0_10({isCancelling: true});
return undefined;
}
if (VoiceMessageAnimationState.LOCKING === property) {
setIsUsingHoldGesture(false);
env0_2.set([VoiceMessageAnimationState.LOCKING, VoiceMessageAnimationState.LOCKED]);
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(triggerHapticGuarded)();
return undefined;
}
} else {
value = environment.__proto__;
}
(require(11778) /* metro dependency 11778: VoiceMessageUtils */).endAudioRecording();
}
function* _fun90216() { // fn#90216, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:7507, offset: 0x02030c2b, size: 95 bytes, params: 1, frame: 16
if (true) {
value = environment.__proto__;
yield setIsVoiceMessageButtonMounted();
if (false) {
return undefined;
}
env2_12(false);
var set = dependencyMap.set;
var binding = env2_18;
var LOCKED = binding.LOCKED;
var items2 = [LOCKED];
LOCKED = binding.LOCKED;
items2[1] = LOCKED;
Reflect.apply(set, dependencyMap, [items2]);
}
}
function _fun90217() { // fn#90217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:7689, offset: 0x02030c8a, size: 369 bytes, params: 1, frame: 22
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value2 = Gesture.Pan();
const value5 = value2.enabled(!disabled).minDistance(0);
const onTouchesDown = value5.onTouchesDown;
let closure = n_90218;
const object2 = {};
const binding = env0_5;
object2.isGestureActiveValue = binding;
const runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.runOnJS = runOnJS;
object2.setIsUsingHoldGesture = setIsUsingHoldGesture;
object2.voiceMessageAnimationState = env0_2;
object2.VoiceMessageAnimationState = VoiceMessageAnimationState;
object2.startRecording = env0_11;
closure.__closure = object2;
closure.__workletHash = 15771181123252;
closure.__initData = env1_31;
const value6 = Reflect.apply(onTouchesDown, value5, [closure]);
const onUpdate = value6.onUpdate;
closure = t_90219;
closure.__closure = {isGestureActiveValue: binding, LOCK_THRESHOLD: 40, cancelThresholdX: env0_14,
handleUpdateValue: env0_12, VoiceMessageAnimationState: VoiceMessageAnimationState};
closure.__workletHash = 9262214665783;
closure.__initData = env1_30;
const value7 = Reflect.apply(onUpdate, value6, [closure]);
const onFinalize = value7.onFinalize;
closure = e_90220;
closure.__closure = {runOnJS: runOnJS, handleFinalize: env0_13};
closure.__workletHash = 2411654680943;
closure.__initData = env1_29;
return Reflect.apply(onFinalize, value7, [closure]);
}
function _fun90186(a0) { // fn#90186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:2869, offset: 0x0202ff3e, size: 34 bytes, params: 2, frame: 11
env0_0.current = a0;
env0_1.set(a0);
}
async function _fun90189({isCancelling, cancelReason}) { // fn#90189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:3077, offset: 0x0202ff98, size: 767 bytes, params: 2, frame: 33
var environment;
var r7;
var binding;
var durationSecs;
var emitVoiceMessageRecorded;
var binding3;
var CloudUpload;
var object;
var filename;
var id;
var value10;
var cloudUpload;
var pendingReply;
var binding5;
var sendMessageOptionsForReply;
var value15;
var sendMessage;
var object2;
var binding6;
var value16;
if (true) {
r7 = cancelReason !== undefined ? cancelReason : env3_0(env3_2[23]).VoiceMessageRecordingResult.CANCELLED_USER_REQUESTED;
await undefined;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__.__proto__;
var value4 = env3_0(env3_2[18]);
await value4.endAudioRecording();
if (false) {
return undefined;
}
var data = undefined.data;
var startTimeMillis = undefined.startTimeMillis;
View(false);
if (isCancelling) {
PendingReplyStore.current = r7;
value = env3_0(env3_2[18]);
value.emitVoiceMessageRecorded(r7, data.durationSecs, startTimeMillis);
} else {
durationSecs = data.durationSecs;
if (durationSecs < env3_19 / 1000) {
binding = env3_0;
binding6 = env3_2;
value16 = binding(binding6[18]);
value16.emitVoiceMessageRecorded(binding(binding6[23]).VoiceMessageRecordingResult.CANCELLED_DURATION,
data.durationSecs, startTimeMillis);
env3_14();
return undefined;
}
binding = env3_0;
var binding2 = env3_2;
var value8 = binding(binding2[18]);
emitVoiceMessageRecorded = value8.emitVoiceMessageRecorded;
var SENT = binding(binding2[23]).VoiceMessageRecordingResult.SENT;
durationSecs = data.durationSecs;
Reflect.apply(emitVoiceMessageRecorded, value8, [SENT, durationSecs, startTimeMillis]);
binding = env3_10;
var channel = binding.getChannel(importDefault);
if (channel != null) {
binding = env3_0;
binding3 = env3_2;
CloudUpload = binding(binding3[24]).CloudUpload;
object = {};
filename = data.filename;
object.uri = filename;
filename = data.filename;
object.originalUri = filename;
object.mimeType = 'audio/ogg';
object.filename = 'voice-message.ogg';
object.platform = binding(binding3[25]).UploadPlatform.REACT_NATIVE;
object.durationSecs = data.durationSecs;
object.waveform = data.waveform;
id = channel.id;
value10 = Object.create(CloudUpload.prototype, {constructor: {value: CloudUpload}});
cloudUpload = new CloudUpload();
object = [cloudUpload instanceof Object ? cloudUpload : value10];
pendingReply = env3_9.getPendingReply(importDefault);
binding5 = env3_1;
sendMessageOptionsForReply = binding5(binding3[26]).getSendMessageOptionsForReply(pendingReply);
value15 = binding5(binding3[26]);
sendMessage = value15.sendMessage;
id = channel.id;
object2 = {};
object2.flags = env3_22.IS_VOICE_MESSAGE;
object2.location = env3_23.VOICE_MESSAGE;
object2.attachmentsToUpload = object;
object2.onAttachmentUploadError = onAttachmentUploadError_90190;
copyDataProperties(object2, sendMessageOptionsForReply, undefined);
Reflect.apply(sendMessage, value15, [id, {'content': '', 'tts': false, invalidEmojis: [],
validNonShortcutEmojis: []}, undefined, object2]);
binding(binding3[28]).deletePendingReply(importDefault);
}
}
}
}
function _fun90193() { // fn#90193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:4417, offset: 0x02030342, size: 69 bytes, params: 1, frame: 16
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
const unsubscribeKeyed = ComponentDispatch.unsubscribeKeyed;
const VOICE_MESSAGE_SEND = ComponentActionsKeyed.VOICE_MESSAGE_SEND;
Reflect.apply(unsubscribeKeyed, ComponentDispatch, [VOICE_MESSAGE_SEND, channelId, env1_10]);
}
function _fun90197(a0) { // fn#90197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:4597, offset: 0x020303e1, size: 255 bytes, params: 2, frame: 19
var defaultImport;
var open;
var object2;
var intl;
const current = env1_8.current;
const current2 = env1_9.current;
const VoiceMessageRecordingResult = (require(11465) /* metro dependency 11465: VoiceMessageAnalytics */).VoiceMessageRecordingResult;
const CANCELLED_ON_BACKGROUND = VoiceMessageRecordingResult.CANCELLED_ON_BACKGROUND;
let r3 = a0 !== 'active' || current !== 'inactive' && current !== 'background';
r3 = !r3 ? !(current2 === CANCELLED_ON_BACKGROUND) : r3;
if (!r3) {
defaultImport = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
open = defaultImport.open;
object2 = {key: 'VOICE_MESSAGE_CANCELLED_ON_BACKGROUND'};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.content = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.JM7Y2D);
object2.icon = icon_90198;
object2.position = 'bottom';
Reflect.apply(open, defaultImport, [object2]);
env1_9.current = null;
}
env1_8.current = a0;
}
function _fun90201() { // fn#90201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5040, offset: 0x0203051e, size: 111 bytes, params: 1, frame: 14
const value = environment.__proto__;
env1_7.current = false;
const state = useVoiceMessagesUIStore.getState();
let r2 = state.showRecordingOverlay || state.recordingStatus != null;
r2 = !r2 ? current : r2;
if (r2) {
env1_6(false);
(require(11778) /* metro dependency 11778: VoiceMessageUtils */).endAudioRecording();
}
}
function _cancel() { // fn#90204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5289, offset: 0x02030610, size: 53 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__.__proto__;
return env2_3(_fun90206).apply(this, arguments);
}
function handleActionSheetChange() { // fn#90207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5631, offset: 0x0203071c, size: 37 bytes, params: 1, frame: 9
if (ActionSheetStore.isOpen()) {
cancel_90203();
}
}
function handleNavigationChange_90208() { // fn#90208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5687, offset: 0x02030741, size: 78 bytes, params: 1, frame: 11
var value2;
let value = environment.__proto__.__proto__;
value = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
value = value.getFocusedChannelId();
if (value != null) {
value2 = environment.__proto__;
if (value !== channelId) {
cancel_90203();
}
} else {
cancel_90203();
}
}
function _fun90209() { // fn#90209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5946, offset: 0x0203078f, size: 85 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
ActionSheetStore.removeReactChangeListener(handleActionSheetChange);
value = require(4008) /* metro dependency 4008: RootNavigationRefNative */;
value = value.getRootNavigationRef();
if (value != null) {
value.removeListener('state', handleNavigationChange_90208);
}
}
function n_90218({numberOfTouches}) { // fn#90218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:7778, offset: 0x02030dfb, size: 162 bytes, params: 2, frame: 18
var r0;
var binding;
var moduleValue;
var runOnJS;
var value3;
var set;
var SENDING;
var items2;
let value = numberOfTouches > 1;
if (value) {
r0 = value;
} else {
value = environment.__proto__;
value = env1_5.get();
r0 = value;
}
if (!r0) {
value = environment.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = moduleValue.runOnJS;
Reflect.apply(runOnJS, moduleValue, [setIsUsingHoldGesture])(true);
value3 = environment.__proto__;
binding = env1_2;
set = binding.set;
SENDING = VoiceMessageAnimationState.SENDING;
items2 = [SENDING];
SENDING = VoiceMessageAnimationState.SENDING;
items2[1] = SENDING;
Reflect.apply(set, binding, [items2]);
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = value.runOnJS;
Reflect.apply(runOnJS, value, [env1_11])();
}
}
function t_90219(a0) { // fn#90219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:8120, offset: 0x02030e9d, size: 163 bytes, params: 2, frame: 12
let binding = env1_5;
const get = binding.get;
if (Reflect.apply(get, binding, [])) {
if (a0.translationY <= -40) {
if (a0.absoluteX >= env1_14) {
binding = env1_12;
value = environment.__proto__.__proto__;
binding(VoiceMessageAnimationState.LOCKING);
} else if (a0.absoluteX < env1_14) {
binding = env1_12;
value = environment.__proto__.__proto__;
binding(VoiceMessageAnimationState.CANCELLING);
} else if (a0.absoluteX >= env1_14) {
binding = env1_12;
value = environment.__proto__.__proto__;
binding(VoiceMessageAnimationState.SENDING);
}
} else if (a0.absoluteX < env1_14) {
binding = env1_12;
value = environment.__proto__.__proto__;
binding(VoiceMessageAnimationState.CANCELLING);
} else if (a0.absoluteX >= env1_14) {
binding = env1_12;
value = environment.__proto__.__proto__;
binding(VoiceMessageAnimationState.SENDING);
}
}
}
function e_90220() { // fn#90220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:8443, offset: 0x02030f40, size: 48 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env1_13)();
}
function onAttachmentUploadError_90190(a0, a1, a2) { // fn#90190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:4101, offset: 0x02030297, size: 93 bytes, params: 4, frame: 14
let value = environment.__proto__.__proto__.__proto__.__proto__;
value = env4_0(env4_2[27]);
const handleUploadMessageAttachmentsErrors = value.handleUploadMessageAttachmentsErrors;
const object2 = {file: a0};
object2.guildId = env0_0.getGuildId();
object2.analyticsLocations = [];
object2.code = a1;
object2.reason = a2;
Reflect.apply(handleUploadMessageAttachmentsErrors, value, [object2]);
}
function icon_90198() { // fn#90198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:4857, offset: 0x020304e0, size: 23 bytes, params: 1, frame: 13
return <VoiceMessageRecordingCancelledToastIcon />;
}
function* _fun90206() { // fn#90206, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11963:5326, offset: 0x02030650, size: 204 bytes, params: 1, frame: 18
var value5;
var value6;
var value7;
var binding2;
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__;
var binding = env4_15;
var state = binding.getState();
if (state.showRecordingOverlay) {
value5 = environment.__proto__.__proto__.__proto__;
View(false);
binding = env4_0;
value6 = binding(env4_2[18]);
yield value6.endAudioRecording();
value7 = undefined;
if (false) {
return value7;
}
binding = env4_0;
binding2 = env4_2;
value = binding(binding2[18]);
value.emitVoiceMessageRecorded(binding(binding2[23]).VoiceMessageRecordingResult.CANCELLED_GESTURE_CONFLICT,
value7.data.durationSecs, value7.startTimeMillis);
} else {
if (state.recordingStatus != null) {
value5 = environment.__proto__.__proto__.__proto__;
View(false);
binding = env4_0;
value6 = binding(env4_2[18]);
yield value6.endAudioRecording();
value7 = undefined;
if (false) {
return value7;
}
binding = env4_0;
binding2 = env4_2;
value = binding(binding2[18]);
value.emitVoiceMessageRecorded(binding(binding2[23]).VoiceMessageRecordingResult.CANCELLED_GESTURE_CONFLICT,
value7.data.durationSecs, value7.startTimeMillis);
return undefined;
}
if (env3_4.current) {
value5 = environment.__proto__.__proto__.__proto__;
View(false);
binding = env4_0;
value6 = binding(env4_2[18]);
yield value6.endAudioRecording();
value7 = undefined;
if (false) {
return value7;
}
binding = env4_0;
binding2 = env4_2;
value = binding(binding2[18]);
value.emitVoiceMessageRecorded(binding(binding2[23]).VoiceMessageRecordingResult.CANCELLED_GESTURE_CONFLICT,
value7.data.durationSecs, value7.startTimeMillis);
return undefined;
}
}
}
}
@@ -0,0 +1,407 @@
/* Metro module 11964; source: modules/voice_messages/native/components/VoiceMessageChat.tsx; dependencies: [57, 31, 27, 4502, 11527, 11528, 661, 33, 4017, 4501, 697, 477, 4577, 4504, 3860, 4690, 3868, 4573, 2] */
function _fun91820(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:6, offset: 0x02073ea3, size: 895 bytes, params: 8, frame: 29
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = undefined;
const env0_3 = importDefault(57) /* metro dependency 57 */;
const value2 = importAll(31) /* metro dependency 31 */;
const value3 = require(27) /* metro dependency 27 */;
const ActivityIndicator = value3.ActivityIndicator;
const env0_5 = value3.View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_7 = (require(11527) /* metro dependency 11527: VoiceMessagesUIStore */).useVoiceMessagesUIStore;
const voiceMessageConstantsModule = require(11528) /* metro dependency 11528: VoiceMessageConstants */;
const env0_8 = voiceMessageConstantsModule.VOICE_RECORDING_MAX_DURATION_MILLIS;
const env0_9 = voiceMessageConstantsModule.VOICE_RECORDING_MAX_DURATION_OFFSET;
const env0_10 = voiceMessageConstantsModule.VOICE_RECORDING_REALLY_WARN_DURATION_MILLIS;
const env0_11 = voiceMessageConstantsModule.VOICE_RECORDING_WARN_DURATION_MILLIS;
const env0_12 = voiceMessageConstantsModule.WAVEFORM_WAVE_MAX_VALUE;
const env0_13 = (require(661) /* metro dependency 661: Constants */).ThemeTypes;
const value5 = require(33) /* metro dependency 33 */;
const env0_14 = value5.jsx;
const env0_15 = value5.jsxs;
const env0_16 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(ActivityIndicator);
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {'height': '100%', 'flexDirection': 'row', 'alignItems': 'center', 'paddingVertical': null,
'paddingHorizontal': 12};
const value8 = 'center';
let mobile = (importDefault(697) /* metro dependency 697: native */).modules.mobile;
const VOICE_MESSAGE_RECORDING_CONTAINER_PADDING_VERTICAL = mobile.VOICE_MESSAGE_RECORDING_CONTAINER_PADDING_VERTICAL;
object4.paddingVertical = VOICE_MESSAGE_RECORDING_CONTAINER_PADDING_VERTICAL;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
object3.container = object4;
object3.loading = {'position': 'absolute', 'left': 12};
const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
object3.dot = {'height': 6, 'width': 6, 'backgroundColor': null, 'marginHorizontal': 4, 'borderRadius': 6,
backgroundColor: RED_400};
object3.dotDismissed = {backgroundColor: 'transparent'};
object3.waveformContainer = {'flex': 1, 'height': '100%', 'overflow': 'hidden', 'justifyContent': 'flex-end',
'flexDirection': 'row', 'alignItems': 'center', 'marginLeft': 8};
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object3.waveformBar = {backgroundColor: WHITE, borderRadius: 1};
object3.durationContainer = {'flexDirection': 'row', 'alignItems': 'center'};
const object5 = {};
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const isAndroid2 = platformUtilsModule.isAndroid();
mobile = (importDefault(697) /* metro dependency 697: native */).modules.mobile;
object5.lineHeight = isAndroid2 ? mobile.VOICE_MESSAGE_DURATION_LINE_HEIGHT_ANDROID : mobile.VOICE_MESSAGE_DURATION_LINE_HEIGHT_IOS;
const value10 = platformUtilsModule;
object5.textAlignVertical = value10.isAndroid() ? value8 : value;
object3.duration = object5;
const env0_17 = Reflect.apply(createStyles, createStylesModule, [object3]);
object3 = {code: 'function VoiceMessageChatTsx1(){const{animatedHeight,animatedWidth,animatedMargin}=this.__closure;return{height:animatedHeight.get(),width:animatedWidth.get(),marginRight:animatedMargin.get()};}'};
object3 = {WARN: 0};
object3[0] = 'WARN';
object3.REALLY_WARN = 1;
object3[1] = 'REALLY_WARN';
object3.ENDED = 2;
object3[2] = 'ENDED';
object3 = {code: 'function VoiceMessageChatTsx2(){const{animationValue}=this.__closure;return{opacity:animationValue.get()};}'};
object3 = {code: 'function VoiceMessageChatTsx3(){const{initialAnimation,isRecording}=this.__closure;return initialAnimation.get()===1&&isRecording;}'};
object3 = {code: 'function VoiceMessageChatTsx4(result,previous){const{animationValue,withTiming,Easing,loadingOpacity}=this.__closure;if(result&&result!==previous){animationValue.set(withTiming(1,{easing:Easing.quad,duration:200}));loadingOpacity.set(0);}}'};
object3 = {code: 'function VoiceMessageChatTsx5(){const{initialAnimation,backgroundColor}=this.__closure;return{width:80+20*initialAnimation.get()+"%",backgroundColor:backgroundColor.get()};}'};
object3 = {code: 'function VoiceMessageChatTsx6(){const{loadingOpacity}=this.__closure;return{opacity:loadingOpacity.get()};}'};
const value11 = value2.memo(_fun91843);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/native/components/VoiceMessageChat.tsx');
exports.default = value11;
return value;
}
function WaveformBar({value}) { // fn#91821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:1618, offset: 0x02074222, size: 314 bytes, params: 2, frame: 24
const styles = useStyles();
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value5 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = WaveformBarO;
closure.__closure = {animatedHeight: value3, animatedWidth: value4, animatedMargin: value5};
closure.__workletHash = 8768145898720;
closure.__initData = env0_18;
const value6 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
env0_4.useEffect(_fun91823, [value3, value]);
env0_4.useEffect(_fun91824, [value4, value5]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return <View style={[styles.waveformBar, value6]} />;
}
function Waveform() { // fn#91825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:2281, offset: 0x020744c0, size: 184 bytes, params: 1, frame: 18
const styles = useStyles();
useVoiceMessagesUIStore(function(a0) {
return a0.waveformVersion;
});
const value2 = useVoiceMessagesUIStore(function(a0) {
return a0.waveform;
});
const [property, env0_0] = env0_3(env0_4.useState(0), 2);
return (
<View style={styles.waveformContainer} onLayout={env0_4.useCallback(_fun91828, [])}>
{value2.slice(-property).map(_fun91829)}
</View>
);
}
function Duration({animationValue}) { // fn#91830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:2824, offset: 0x0207462b, size: 685 bytes, params: 2, frame: 29
const styles = useStyles();
const value2 = useVoiceMessagesUIStore(function(a0) {
return a0.startTimeMillis;
});
var [property, env0_3] = env0_3Binding(env0_4.useState(_fun91832), 2);
const value6 = env0_3Binding(env0_4.useState(undefined), 2);
const property2 = value6[0];
var env0_4 = property2;
const env0_5 = value6[1];
const value7 = useVoiceMessagesUIStore(function(a0) {
return a0.savedVoiceMessageUploadData != null;
});
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const VOICE_MESSAGE_DURATION_TEXT_STYLE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.VOICE_MESSAGE_DURATION_TEXT_STYLE;
const value8 = Reflect.apply(useToken, useTokenModule, [VOICE_MESSAGE_DURATION_TEXT_STYLE]);
env0_4.useEffect(_fun91834, [value2, value7]);
const value9 = env0_4.useMemo(_fun91837, [property]);
var [property, env0_7] = env0_3Binding(env0_4.useState(false), 2);
env0_4.useEffect(_fun91838, [property2]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = function() {
var object = {};
object.opacity = animationValue.get();
return object;
};
closure.__closure = {animationValue: animationValue};
closure.__workletHash = 4012974382717;
closure.__initData = env0_20;
const value12 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const ThemeContextProvider = (require(3868) /* metro dependency 3868: native */).ThemeContextProvider;
const DARK = ThemeTypes.DARK;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items2 = [styles.durationContainer, value12];
const view = <View style={[styles.dot, !(value2 != null && !value7) && styles.dotDismissed]} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<ThemeContextProvider theme={DARK}>
<View2 style={items2}>
{view}
<Text
style={styles.duration}
variant={value8}
color={property ? 'text-feedback-critical' : 'always-white'}
tabularNumbers
>
{value9}
</Text>
</View2>
</ThemeContextProvider>
);
}
function _fun91843({isRecording, initialAnimation, backgroundColor}) { // fn#91843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:4807, offset: 0x02074aee, size: 638 bytes, params: 2, frame: 27
var object2;
const styles = useStyles();
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
env0_4.useEffect(function() {
if (isRecording) {
return undefined;
}
var env0_0 = global.setTimeout(_fun91845, 1000);
return _fun91846;
}, [value2, isRecording]);
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
let closure = function() {
return initialAnimation.get() === 1 && isRecording;
};
closure.__closure = {initialAnimation: initialAnimation, isRecording: isRecording};
closure.__workletHash = 7599681139161;
closure.__initData = env0_21;
const closure2 = c_91848;
object2 = {animationValue: value3};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
const Easing = reanimatedRexportModule.Easing;
object2.Easing = Easing;
object2.loadingOpacity = value2;
closure2.__closure = object2;
closure2.__workletHash = 7661977794788;
closure2.__initData = env0_22;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
const moduleValue4 = reanimatedRexportModule;
let useAnimatedStyle = moduleValue4.useAnimatedStyle;
closure = function() {
var object = {};
object.width = 80 + 20 * initialAnimation.get() + '%';
object.backgroundColor = backgroundColor.get();
return object;
};
closure.__closure = {initialAnimation: initialAnimation, backgroundColor: backgroundColor};
closure.__workletHash = 9739486182352;
closure.__initData = env0_23;
const value4 = Reflect.apply(useAnimatedStyle, moduleValue4, [closure]);
const moduleValue5 = reanimatedRexportModule;
useAnimatedStyle = moduleValue5.useAnimatedStyle;
closure = E_91850;
closure.__closure = {loadingOpacity: value2};
closure.__workletHash = 17421928475897;
closure.__initData = env0_24;
const value5 = Reflect.apply(useAnimatedStyle, moduleValue5, [closure]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View style={[styles.container, value4]}>
{isRecording ? null : ((Component) => <Component style={[styles.loading,
value5]} color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE} size="small" />)(env0_16)}
<Duration animationValue={value3} />
<Waveform />
</View>
);
}
function WaveformBarO() { // fn#91822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:1777, owner: WaveformBar.o, offset: 0x0207435c, size: 59 bytes, params: 1, frame: 11
const object2 = {};
object2.height = env0_1.get();
object2.width = env0_2.get();
object2.marginRight = env0_3.get();
return object2;
}
function _fun91823() { // fn#91823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:1978, offset: 0x02074397, size: 129 bytes, params: 1, frame: 18
let Math = global.Math;
const value5 = 20 * Math.min(1, value / WAVEFORM_WAVE_MAX_VALUE * 1.25);
const binding = env0_1;
const set = binding.set;
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
Math = global.Math;
Reflect.apply(set, binding, [Reflect.apply(withSpring, springModule, [Math.max(2, value5)])]);
}
function _fun91824() { // fn#91824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:2077, offset: 0x02074418, size: 168 bytes, params: 1, frame: 22
let binding = env0_2;
let set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const Easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [2, {duration: 300, easing: Easing.linear}])]);
binding = env0_3;
set = binding.set;
const value = timingModule;
Reflect.apply(set, binding, [value.withTiming(4, {duration: 300, easing: Easing.linear})]);
}
function _fun91828({nativeEvent}) { // fn#91828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:2436, offset: 0x0207458e, size: 68 bytes, params: 2, frame: 13
const binding = env0_0;
const Math = global.Math;
binding(Math.round(nativeEvent.layout.width / 6) + 2);
}
function _fun91829(a0) { // fn#91829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:2557, offset: 0x020745d2, size: 89 bytes, params: 2, frame: 18
var r0;
var r1;
var r3;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r5 = value2 ? value : item;
if (value2) {
r0 = item2;
r1 = value2;
r3 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r0 = item3;
r1 = value3;
r3 = value;
} else {
r0 = item3;
r1 = value3;
r3 = item;
}
}
if (!r1) {
r0.return();
}
return <WaveformBar value={r5} key={r3} />;
}
function _fun91832() { // fn#91832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:2914, offset: 0x020748e3, size: 45 bytes, params: 1, frame: 11
return env0_1 != null ? global.Date.now() - env0_1 : 0;
}
function _fun91834() { // fn#91834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:3148, offset: 0x02074910, size: 100 bytes, params: 1, frame: 15
var environment;
var binding;
var value2;
if (env0_6) {
binding = env0_3;
value2 = environment.__proto__;
binding(VOICE_RECORDING_MAX_DURATION_MILLIS + VOICE_RECORDING_MAX_DURATION_OFFSET);
binding = env0_5;
binding(env1_19.ENDED);
return undefined;
}
const env0_0 = global.setInterval(_fun91835, 100);
return _fun91836;
}
function _fun91837() { // fn#91837, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:3347, offset: 0x020749e4, size: 65 bytes, params: 1, frame: 14
const value = environment.__proto__;
return (require(4690) /* metro dependency 4690: TimeUtils */).getTimeFormat(env0_2 / 1000, {padMinutes: false});
}
function _fun91838() { // fn#91838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:3456, offset: 0x02074a25, size: 147 bytes, params: 1, frame: 14
var environment;
var r1;
var binding;
var value2;
if (env0_4 != null) {
binding = env0_4;
value2 = environment.__proto__;
if (binding !== env1_19.ENDED) {
r1 = AccessibilityStore.useReducedMotion ? 1000 : env0_4 !== env1_19.WARN ? 250 : 500;
flash();
return _fun91841;
}
env0_7(true);
} else {
env0_7(false);
}
}
function _fun91844() { // fn#91844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:4921, offset: 0x02074d6c, size: 56 bytes, params: 1, frame: 14
if (isRecording) {
return undefined;
}
const env0_0 = global.setTimeout(_fun91845, 1000);
return _fun91846;
}
function c_91848(a0, a1) { // fn#91848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:5273, offset: 0x02074e24, size: 133 bytes, params: 3, frame: 19
var binding;
var set;
var value2;
var moduleValue;
var withTiming;
var object2;
const value = a0;
if (value && value !== a1) {
binding = env0_4;
set = binding.set;
value2 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
object2 = {};
object2.easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing.quad;
object2.duration = 200;
Reflect.apply(set, binding, [Reflect.apply(withTiming, moduleValue, [1, object2])]);
binding = env0_3;
binding.set(0);
}
}
function _fun91835() { // fn#91835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:3207, offset: 0x02074974, size: 112 bytes, params: 1, frame: 13
var value3;
var value4;
if (env1_1 != null) {
value3 = global.Date.now() - env1_1;
env1_3(value3);
value4 = environment.__proto__.__proto__;
if (value3 > VOICE_RECORDING_REALLY_WARN_DURATION_MILLIS) {
env1_5(env2_19.REALLY_WARN);
} else if (value3 > VOICE_RECORDING_WARN_DURATION_MILLIS) {
env1_5(env2_19.WARN);
}
}
}
function flash() { // fn#91839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:3546, offset: 0x02074ab8, size: 54 bytes, params: 1, frame: 14
env1_7(function(a0) {
return !a0;
});
env0_0 = global.setTimeout(flash, env0_1);
}
function _fun91845() { // fn#91845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12150:4951, offset: 0x02074da4, size: 96 bytes, params: 1, frame: 18
let value = environment.__proto__;
const binding = env1_3;
const set = binding.set;
value = environment.__proto__.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
const withTiming = value.withTiming;
const Easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing;
Reflect.apply(set, binding, [Reflect.apply(withTiming, value, [1, {easing: Easing.quad, duration: 200}])]);
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,62 @@
/* Metro module 11780; source: modules/voice_messages/native/useVoiceMessageTooltip.tsx; dependencies: [31, 1480, 11527, 1244, 6996, 8544, 2] */
function _fun90246(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11966:6, offset: 0x0203195d, size: 175 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const subscribeToKeyboardUIStore = importDefault(1480) /* metro dependency 1480: subscribeToKeyboardUIStore */;
const voiceMessagesUIStoreModule = require(11527) /* metro dependency 11527: VoiceMessagesUIStore */;
const env0_4 = voiceMessagesUIStoreModule.hideVoiceMessagesTooltip;
const env0_5 = voiceMessagesUIStoreModule.showVoiceMessagesTooltip;
const env0_6 = voiceMessagesUIStoreModule.useVoiceMessagesUIStore;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_messages/native/useVoiceMessageTooltip.tsx');
exports.default = useVoiceMessageTooltip;
}
function useVoiceMessageTooltip() { // fn#90247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11966:312, offset: 0x02031a0c, size: 145 bytes, params: 1, frame: 18
const binding = env0_2;
const value2 = binding.useRef(null);
const value3 = useVoiceMessagesUIStore(function(a0) {
return a0.showVoiceMessagesTooltip;
});
const value4 = binding.useMemo(_fun90249, [value3]);
binding.useEffect(_fun90250, [value3]);
(require(8544) /* metro dependency 8544: useTooltipNative */).useTooltip(value2, value4);
return {tooltipTargetRef: value2, showVoiceMessagesTooltip: showVoiceMessagesTooltip};
}
function _fun90249() { // fn#90249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11966:417, offset: 0x02031aa8, size: 90 bytes, params: 1, frame: 15
const object2 = {position: 'top'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['hP6+07']);
object2.visible = env0_0;
return object2;
}
function _fun90250() { // fn#90250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11966:523, offset: 0x02031b02, size: 125 bytes, params: 1, frame: 16
var environment;
if (env0_0) {
value = environment.__proto__;
var env0_0 = (require(6996) /* metro dependency 6996: useKeyboardIsOpen */).getKeyboardIsOpen({includeCustomKeyboard: true});
var env0_1 = subscribeToKeyboardUIStore(_fun90251);
var env0_2 = global.setTimeout(function() {
hideVoiceMessagesTooltip();
}, 2000);
return _fun90253;
}
}
function _fun90251() { // fn#90251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11966:599, offset: 0x02031b7f, size: 66 bytes, params: 1, frame: 15
const binding = env0_0;
const useKeyboardIsOpenModule = require(6996) /* metro dependency 6996: useKeyboardIsOpen */;
const getKeyboardIsOpen = useKeyboardIsOpenModule.getKeyboardIsOpen;
if (binding !== Reflect.apply(getKeyboardIsOpen, useKeyboardIsOpenModule, [{includeCustomKeyboard: true}])) {
hideVoiceMessagesTooltip();
}
}
function _fun90253() { // fn#90253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11966:706, offset: 0x02031bd0, size: 32 bytes, params: 1, frame: 12
global.clearTimeout(env0_2);
env0_1();
}