91 lines
4.3 KiB
React
91 lines
4.3 KiB
React
/* Metro module 413; source: unknown; dependencies: [57, 29, 31, 33, 325, 414] */
|
|
function _fun5825(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#5825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:454:6, offset: 0x00ce6927, size: 237 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const env0_3 = ['ref'];
|
|
const env0_4 = ['disabled', 'ios_backgroundColor', 'onChange', 'onValueChange', 'style', 'thumbColor', 'trackColor',
|
|
'value'];
|
|
const env0_5 = ['onTintColor', 'tintColor'];
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_6 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_7 = importDefault(29) /* metro dependency 29 */;
|
|
importAll(31) /* metro dependency 31 */;
|
|
const value = require(31) /* metro dependency 31 */;
|
|
const env0_8 = value.useLayoutEffect;
|
|
const env0_9 = value.useRef;
|
|
const env0_10 = value.useState;
|
|
const env0_11 = (require(33) /* metro dependency 33 */).jsx;
|
|
const returnsFalse = function() {
|
|
return false;
|
|
};
|
|
const returnsTrue = function() {
|
|
return true;
|
|
};
|
|
exports.default = Switch;
|
|
}
|
|
|
|
function Switch(a0) { // fn#5828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:454:417, offset: 0x00ce6a14, size: 521 bytes, params: 2, frame: 31
|
|
var object2;
|
|
const ref = a0.ref;
|
|
const binding = env0_7;
|
|
const value2 = undefined;
|
|
const value3 = binding(a0, env0_3);
|
|
const disabled = value3.disabled;
|
|
value3.ios_backgroundColor;
|
|
const env0_0 = value3.onChange;
|
|
const env0_1 = value3.onValueChange;
|
|
const style = value3.style;
|
|
const thumbColor = value3.thumbColor;
|
|
const trackColor = value3.trackColor;
|
|
const value4 = value3.value;
|
|
const value5 = binding(value3, env0_4);
|
|
let r1 = trackColor == null ? value2 : trackColor.false;
|
|
const r2 = trackColor == null ? value2 : trackColor.true;
|
|
const value7 = (importDefault(325) /* metro dependency 325 */)(useRef(null), ref);
|
|
const [property, env0_5] = env0_6(useState({value: null}), 2);
|
|
useLayoutEffect(_fun5829, [value4, property]);
|
|
value5.onTintColor;
|
|
value5.tintColor;
|
|
const value10 = env0_7(value5, env0_5);
|
|
const accessibilityState = value10.accessibilityState;
|
|
const r14 = disabled ?? (accessibilityState == null ? value2 : accessibilityState.disabled);
|
|
object2 = {accessibilityState: r14 === (accessibilityState == null ? value2 : accessibilityState.disabled) ? accessibilityState : global.Object.assign({},
|
|
accessibilityState, {disabled: r14}), enabled: r14 !== true};
|
|
const value12 = value4 === true;
|
|
object2.on = value12;
|
|
object2.style = style;
|
|
object2.thumbTintColor = thumbColor;
|
|
object2.trackColorForFalse = r1;
|
|
object2.trackColorForTrue = r2;
|
|
r1 = value12 ? r2 : r1;
|
|
object2.trackTintColor = r1;
|
|
const defaultImport = importDefault(414) /* metro dependency 414 */;
|
|
const Object = global.Object;
|
|
return ((Component) => <Component {...Object.assign({}, value10, object2,
|
|
{accessibilityRole: value3.accessibilityRole ?? 'switch', onChange: onChange_5830,
|
|
onResponderTerminationRequest: returnsFalse, onStartShouldSetResponder: returnsTrue,
|
|
ref: value7})} />)(defaultImport);
|
|
}
|
|
|
|
function _fun5829() { // fn#5829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:454:702, offset: 0x00ce6c1d, size: 134 bytes, params: 1, frame: 16
|
|
var value10;
|
|
var Commands;
|
|
const value3 = value === true;
|
|
if (env0_4.value != null && env0_4.value !== value3 && env0_3.current?.setNativeProps != null) {
|
|
value10 = environment.__proto__;
|
|
Commands = (require(414) /* metro dependency 414 */).Commands;
|
|
Commands.setNativeValue(env0_3.current, value3);
|
|
}
|
|
}
|
|
|
|
function SwitchOnChange(a0) { // fn#5830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:454:1279, owner: Switch.onChange, offset: 0x00ce6ca3, size: 87 bytes, params: 2, frame: 13
|
|
if (onChange != null) {
|
|
onChange(a0);
|
|
}
|
|
if (onValueChange != null) {
|
|
onValueChange(a0.nativeEvent.value);
|
|
}
|
|
env0_5({value: a0.nativeEvent.value});
|
|
}
|
|
|