309 lines
18 KiB
TypeScript
309 lines
18 KiB
TypeScript
/* Metro module 10818; source: components_native/common/VoiceSensitivity.tsx; dependencies: [5, 57, 31, 27, 4259, 4607, 7030, 661, 4661, 33, 4501, 697, 4000, 1478, 566, 4662, 4406, 3869, 1244, 1305, 7972, 7992, 477, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import UseWindowDimensionsNative from '../../modules/screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
|
|
import MediaEngineStore from '../../stores/MediaEngineStore.tsx'; /* Metro dependency 4259 */
|
|
import SpeakingStore from '../../stores/SpeakingStore.tsx'; /* Metro dependency 4607 */
|
|
import AppStateStore from '../../stores/native/AppStateStore.tsx'; /* Metro dependency 7030 */
|
|
import Module07992 from '../../by-id/module-07992.jsx'; /* Metro dependency 7992 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as PlatformUtilsModule from '../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as AccessibilityAnnouncerAndroidModule from '../../external/discord_common/js/packages/design/components/AccessibilityAnnouncer/AccessibilityAnnouncer.android.tsx'; /* Metro dependency 3869 */
|
|
import * as ColorUtilsModule from '../../utils/ColorUtils.tsx'; /* Metro dependency 4000 */
|
|
import * as MediaEngineModule from '../../external/discord_common/js/packages/media-engine/index.tsx'; /* Metro dependency 4406 */
|
|
import * as NativePermissionConstantsModule from '../../modules/native_permissions/NativePermissionConstants.tsx'; /* Metro dependency 4661 */
|
|
|
|
function _fun83008(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:6, offset: 0x01f09b8c, size: 614 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = JsxRuntimeModule;
|
|
const env0_12 = value.jsx;
|
|
const env0_13 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {sensitivity: {'position': 'relative', 'height': 20}, sensitivityBar: {'position': 'absolute', 'top': 7,
|
|
'left': 0, 'right': 0, 'bottom': 7, 'flexDirection': 'row'}};
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
|
object.sensitivityFill = {'position': 'absolute', 'backgroundColor': null, 'opacity': 0.5, 'top': 7, 'left': 0,
|
|
'right': 0, 'bottom': 7, backgroundColor: WHITE};
|
|
object.sensitivityCommon = {'height': 6, 'borderRadius': 3};
|
|
const YELLOW_300 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.YELLOW_300;
|
|
object.sensitivityMin = {backgroundColor: YELLOW_300};
|
|
let GREEN_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360;
|
|
object.sensitivityMax = {backgroundColor: GREEN_360};
|
|
const hexWithOpacity = ColorUtilsModule.hexWithOpacity;
|
|
const PRIMARY_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_400;
|
|
object.sensitivityDefault = {flex: 1, backgroundColor: Reflect.apply(hexWithOpacity, ColorUtilsModule, [PRIMARY_400,
|
|
0.6])};
|
|
GREEN_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360;
|
|
object.sensitivitySpeaking = {flex: 1, backgroundColor: GREEN_360};
|
|
object.sensitivitySlider = {'flex': 1, 'backgroundColor': 'transparent', 'marginVertical': -10};
|
|
const env0_14 = Reflect.apply(createStyles, value, [object]);
|
|
(FileImportTrackerModule).fileFinishedImporting('components_native/common/VoiceSensitivity.tsx');
|
|
exports.default = VoiceSensitivity;
|
|
function VoiceSensitivity({auto, threshold, onThresholdChange}) { // fn#83009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1075, offset: 0x01f09df2, size: 1377 bytes, params: 2, frame: 34
|
|
var r15;
|
|
var AccessibilityFocusView;
|
|
var object2;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
const t = (IndexNativeModule).t;
|
|
var items7;
|
|
var FormHint;
|
|
const styles = useStyles();
|
|
const value4 = threshold + 100;
|
|
const value5 = ReactModule.useRef(null);
|
|
const value6 = ReactModule.useRef(null);
|
|
const value7 = ReactModule.useRef(null);
|
|
let useState = ReactModule.useState;
|
|
const speakingStoreBinding = SpeakingStore;
|
|
const value8 = Reflect.apply(useState, ReactModule, [speakingStoreBinding.isCurrentUserSpeaking()]);
|
|
const value9 = Module00057(value8, 2);
|
|
const property = value9[0];
|
|
const env0_3 = value9[1];
|
|
const width = (UseWindowDimensionsNative)().width;
|
|
const value11 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AppStateStore], function() {
|
|
return AppStateStore.getState();
|
|
}, []);
|
|
useState = ReactModule.useState;
|
|
const value12 = Module00057(Reflect.apply(useState, ReactModule, [0]), 2);
|
|
const property2 = value12[0];
|
|
const env0_7 = value12[1];
|
|
useState = ReactModule.useState;
|
|
const value13 = Module00057(Reflect.apply(useState, ReactModule, [value4]), 2);
|
|
const property3 = value13[0];
|
|
const env0_9 = value13[1];
|
|
useState = ReactModule.useState;
|
|
const value14 = Module00057(Reflect.apply(useState, ReactModule, [property3 / 100]), 2);
|
|
const property4 = value14[0];
|
|
const env0_10 = value14[1];
|
|
useState = ReactModule.useState;
|
|
const value15 = Module00057(Reflect.apply(useState, ReactModule, [width * (1 - property2 / -100)]), 2);
|
|
const property5 = value15[0];
|
|
const env0_11 = value15[1];
|
|
ReactModule.useEffect(_fun83011, [auto, property3]);
|
|
ReactModule.useEffect(_fun83012, [auto, property2, width]);
|
|
const value16 = ReactModule.useCallback(_fun83013, []);
|
|
const value17 = ReactModule.useCallback(_fun83014, []);
|
|
ReactModule.useEffect(_fun83015, [value16, value11]);
|
|
const env0_13 = ReactModule.useRef(false);
|
|
const env0_14 = ReactModule.useRef(false);
|
|
const env0_15 = ReactModule.useRef(null);
|
|
ReactModule.useEffect(_fun83021, [auto, property]);
|
|
if (auto) {
|
|
r15 = property ? styles.sensitivitySpeaking : styles.sensitivityDefault;
|
|
AccessibilityFocusView = (require(1305) /* metro dependency 1305: native */).AccessibilityFocusView;
|
|
object2 = {'accessible': true, 'role': 'meter', 'aria-label': null, 'aria-valuenow': null, 'aria-valuemin': 0,
|
|
'aria-valuemax': 100};
|
|
string = intl.string;
|
|
object2['aria-label'] = Reflect.apply(string, intl, [t.yZcOjo]);
|
|
object2['aria-valuenow'] = property ? 100 : 0;
|
|
string = intl.string;
|
|
object2['aria-valuetext'] = property ? Reflect.apply(string, intl, [t.haLKZ0]) : Reflect.apply(string, intl,
|
|
[t.X2hJL7]);
|
|
object2.onAccessibilityFocus = onAccessibilityFocus;
|
|
object2.onAccessibilityBlur = onAccessibilityBlur;
|
|
object2.style = styles.sensitivity;
|
|
items7 = [
|
|
<AccessibilityFocusView {...object2}>
|
|
<View style={styles.sensitivityBar}>
|
|
<View style={[styles.sensitivityCommon, r15]} />
|
|
</View>
|
|
</AccessibilityFocusView>,
|
|
];
|
|
FormHint = (require(7972) /* metro dependency 7972: native */).FormHint;
|
|
string = intl.string;
|
|
items7[1] = (
|
|
<FormHint inset>
|
|
{Reflect.apply(string, intl, [t.W3K5Im])}
|
|
</FormHint>
|
|
);
|
|
return (
|
|
<View>
|
|
{items7}
|
|
</View>
|
|
);
|
|
}
|
|
const items4 = [
|
|
<View style={styles.sensitivityBar}>
|
|
<View ref={value5} style={[styles.sensitivityCommon, styles.sensitivityMin, {flex: property4}]} />
|
|
<View ref={value6} style={[styles.sensitivityCommon, styles.sensitivityMax, {flex: 1 - property4}]} />
|
|
</View>,
|
|
];
|
|
items4[1] = <View ref={value7} style={[styles.sensitivityFill, {left: property5}]} />;
|
|
const defaultImport = Module07992;
|
|
items4[2] = ((Component) => <Component style={styles.sensitivitySlider} value={value4} minimumValue={0} maximumValue={100} minimumTrackTintColor="transparent" maximumTrackTintColor="transparent" onValueChange={value17} onSlidingComplete={function(a0) {
|
|
onThresholdChange(-1 * (100 - a0));
|
|
}} onResponderGrant={PlatformUtilsModule.isAndroid() ? function() {
|
|
return true;
|
|
} : undefined} />)(defaultImport);
|
|
return (
|
|
<View style={styles.sensitivity}>
|
|
{items4}
|
|
</View>
|
|
);
|
|
function _fun83011() { // fn#83011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1535, offset: 0x01f0a366, size: 36 bytes, params: 1, frame: 11
|
|
if (!auto) {
|
|
env0_10(env0_8 / 100);
|
|
}
|
|
}
|
|
|
|
function _fun83012() { // fn#83012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1574, offset: 0x01f0a38a, size: 54 bytes, params: 1, frame: 12
|
|
if (!auto) {
|
|
env0_11(width * (1 - ReactNativeModule.View / -100));
|
|
}
|
|
}
|
|
|
|
function _fun83013(a0, a1) { // fn#83013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1630, offset: 0x01f0a3c0, size: 31 bytes, params: 3, frame: 12
|
|
env0_3(a1);
|
|
env0_7(a0);
|
|
}
|
|
|
|
function _fun83014(a0) { // fn#83014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1671, offset: 0x01f0a3df, size: 19 bytes, params: 2, frame: 11
|
|
env0_9(a0);
|
|
}
|
|
|
|
function _fun83015() { // fn#83015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1699, offset: 0x01f0a3f2, size: 69 bytes, params: 1, frame: 10
|
|
const ACTIVE = AppStates.ACTIVE;
|
|
if (ReactModule === ACTIVE) {
|
|
(function() {
|
|
return _listenOnlyIfWeHavePermission.apply(this, arguments);
|
|
})();
|
|
return _fun83020;
|
|
}
|
|
function _listenOnlyIfWeHavePermission() { // fn#83016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1927, offset: 0x01f0a437, size: 53 bytes, params: 1, frame: 13
|
|
var environment;
|
|
const value = environment.__proto__.__proto__;
|
|
return env2_3(_fun83018).apply(this, arguments);
|
|
function* _fun83018() { // fn#83018, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:2008, offset: 0x01f0a477, size: 169 bytes, params: 1, frame: 17
|
|
var mediaEngine;
|
|
var on;
|
|
var VoiceActivity;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
var binding = env4_1;
|
|
var value3 = binding(env4_2[15]);
|
|
var hasPermission = value3.hasPermission;
|
|
var AUDIO = env4_11.AUDIO;
|
|
yield Reflect.apply(hasPermission, value3, [AUDIO, {showAuthorizationError: false}]);
|
|
var value4 = undefined;
|
|
if (false) {
|
|
return value4;
|
|
}
|
|
if (value4 && !auto) {
|
|
binding = env4_7;
|
|
mediaEngine = binding.getMediaEngine();
|
|
on = mediaEngine.on;
|
|
binding = env4_0;
|
|
VoiceActivity = binding(env4_2[16]).MediaEngineEvent.VoiceActivity;
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
Reflect.apply(on, mediaEngine, [VoiceActivity, env3_12]);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun83020() { // fn#83020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:1839, offset: 0x01f0a520, size: 81 bytes, params: 1, frame: 14
|
|
const mediaEngine = MediaEngineStore.getMediaEngine();
|
|
const removeListener = mediaEngine.removeListener;
|
|
const MediaEngineEvent = (MediaEngineModule).MediaEngineEvent;
|
|
const VoiceActivity = MediaEngineEvent.VoiceActivity;
|
|
Reflect.apply(removeListener, mediaEngine, [VoiceActivity, env1_12]);
|
|
}
|
|
|
|
}
|
|
|
|
function _fun83021() { // fn#83021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:2261, offset: 0x01f0a571, size: 254 bytes, params: 1, frame: 18
|
|
var environment;
|
|
var autoBinding;
|
|
var binding;
|
|
var binding2;
|
|
var clearTimeout;
|
|
var AccessibilityAnnouncer;
|
|
var announce;
|
|
var intl;
|
|
if (env0_13.current) {
|
|
autoBinding = auto;
|
|
binding = env0_14;
|
|
if (autoBinding) {
|
|
if (binding.current) {
|
|
binding = env0_2;
|
|
binding2 = env0_15;
|
|
if (binding) {
|
|
if (binding2.current != null) {
|
|
clearTimeout = global.clearTimeout;
|
|
binding = env0_15;
|
|
clearTimeout(binding.current);
|
|
binding.current = null;
|
|
}
|
|
value = environment.__proto__;
|
|
AccessibilityAnnouncer = (require(3869) /* metro dependency 3869: AccessibilityAnnouncerAndroid */).AccessibilityAnnouncer;
|
|
announce = AccessibilityAnnouncer.announce;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
Reflect.apply(announce, AccessibilityAnnouncer,
|
|
[intl.string((require(1244) /* metro dependency 1244: indexNative */).t.haLKZ0)]);
|
|
} else {
|
|
binding2.current = global.setTimeout(_fun83022, 1000);
|
|
}
|
|
return _fun83023;
|
|
}
|
|
return undefined;
|
|
}
|
|
binding.current = false;
|
|
} else {
|
|
env0_13.current = true;
|
|
}
|
|
function _fun83022() { // fn#83022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:2471, offset: 0x01f0a66f, size: 106 bytes, params: 1, frame: 16
|
|
env1_15.current = null;
|
|
const AccessibilityAnnouncer = (AccessibilityAnnouncerAndroidModule).AccessibilityAnnouncer;
|
|
const announce = AccessibilityAnnouncer.announce;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const X2hJL7 = (IndexNativeModule).t.X2hJL7;
|
|
Reflect.apply(announce, AccessibilityAnnouncer, [Reflect.apply(string, intl, [X2hJL7])]);
|
|
}
|
|
|
|
function _fun83023() { // fn#83023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:2580, offset: 0x01f0a6d9, size: 52 bytes, params: 1, frame: 13
|
|
var clearTimeout;
|
|
var binding;
|
|
if (env1_15.current != null) {
|
|
clearTimeout = global.clearTimeout;
|
|
binding = env1_15;
|
|
clearTimeout(binding.current);
|
|
binding.current = null;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function onAccessibilityFocus() { // fn#83024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:3063, owner: VoiceSensitivity.onAccessibilityFocus, offset: 0x01f0a70d, size: 19 bytes, params: 1, frame: 2
|
|
env0_14.current = true;
|
|
}
|
|
|
|
function onAccessibilityBlur() { // fn#83025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11004:3102, owner: VoiceSensitivity.onAccessibilityBlur, offset: 0x01f0a720, size: 64 bytes, params: 1, frame: 13
|
|
var clearTimeout;
|
|
var binding;
|
|
env0_14.current = false;
|
|
if (env0_15.current != null) {
|
|
clearTimeout = global.clearTimeout;
|
|
binding = env0_15;
|
|
clearTimeout(binding.current);
|
|
binding.current = null;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun83008, 10818, [5, 57, 31, 27, 4259, 4607, 7030, 661, 4661, 33, 4501, 697, 4000, 1478, 566, 4662,
|
|
4406, 3869, 1244, 1305, 7972, 7992, 477,
|
|
2]) /* metro module 10818, dependencies: [5, 57, 31, 27, 4259, 4607, 7030, 661, 4661, 33, 4501, 697, 4000, 1478, 566, 4662, 4406, 3869, 1244, 1305, 7972, 7992, 477, 2] */;
|