91 lines
4.8 KiB
React
91 lines
4.8 KiB
React
/* Metro module 413; source: unknown; dependencies: [57, 29, 31, 33, 325, 414] */
|
|
import ObjectWithoutProperties from './module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
|
|
import Module00057 from './module-00057.js'; /* Metro dependency 57 */
|
|
import Module00325 from './module-00325.js'; /* Metro dependency 325 */
|
|
import Module00414 from './module-00414.js'; /* Metro dependency 414 */
|
|
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from './module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
|
|
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});
|
|
ReactModule;
|
|
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
|
|
const ref = a0.ref;
|
|
const value2 = undefined;
|
|
const value3 = ObjectWithoutProperties(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 = ObjectWithoutProperties(value3, env0_4);
|
|
let r1 = trackColor == null ? value2 : trackColor.false;
|
|
const r2 = trackColor == null ? value2 : trackColor.true;
|
|
const value7 = (Module00325)(useRef(null), ref);
|
|
const [property, env0_5] = Module00057(useState({value: null}), 2);
|
|
useLayoutEffect(_fun5829, [value4, property]);
|
|
value5.onTintColor;
|
|
value5.tintColor;
|
|
const value10 = ObjectWithoutProperties(value5, env0_5);
|
|
const accessibilityState = value10.accessibilityState;
|
|
const r14 = disabled ?? (accessibilityState == null ? value2 : accessibilityState.disabled);
|
|
object = {accessibilityState: r14 === (accessibilityState == null ? value2 : accessibilityState.disabled) ? accessibilityState : global.Object.assign({},
|
|
accessibilityState, {disabled: r14}), enabled: r14 !== true};
|
|
const value12 = value4 === true;
|
|
object.on = value12;
|
|
object.style = style;
|
|
object.thumbTintColor = thumbColor;
|
|
object.trackColorForFalse = r1;
|
|
object.trackColorForTrue = r2;
|
|
r1 = value12 ? r2 : r1;
|
|
object.trackTintColor = r1;
|
|
const defaultImport = Module00414;
|
|
const Object = global.Object;
|
|
return ((Component) => <Component {...Object.assign({}, value10, object,
|
|
{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 = ReactModule === 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});
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun5825, 413, [57, 29, 31, 33, 325,
|
|
414]) /* metro module 413, dependencies: [57, 29, 31, 33, 325, 414] */;
|