Files
discord-decomp/sources/by-id/module-01546.js
T
2026-07-28 01:06:53 +03:00

133 lines
6.9 KiB
JavaScript

/* Metro module 1546; source: unknown; dependencies: [31, 1488, 1509, 1512, 1489] */
import Module01509 from './module-01509.js'; /* Metro dependency 1509 */
import Module01512 from './module-01512.js'; /* Metro dependency 1512 */
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
import * as PrivateValueStoreModule from './module-01488-PrivateValueStore.js'; /* Metro dependency 1488 */
import * as Module01489Module from './module-01489.js'; /* Metro dependency 1489 */
function _fun17430(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:6, offset: 0x00e6ccb5, size: 109 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(PrivateValueStoreModule).PrivateValueStore;
exports.default = useNavigationHelpers;
function useNavigationHelpers({id, onAction, getState, emitter, router}) { // fn#17431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:142, offset: 0x00e6cd22, size: 181 bytes, params: 2, frame: 22
const binding = emitter;
return binding.useMemo(_fun17432, [id, emitter.emit, getState, onAction,
binding.useContext(Module01509),
binding.useContext(Module01512), router]);
function _fun17432() { // fn#17432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:301, offset: 0x00e6cdd7, size: 240 bytes, params: 1, frame: 21
const dispatch_174332 = dispatch_17433;
let Object = global.Object;
let assign = Object.assign;
const actionCreators = router.actionCreators;
const CommonActions = (Module01489Module).CommonActions;
const value3 = Reflect.apply(assign, Object, [{}, actionCreators, CommonActions]);
Object = global.Object;
const value5 = Object.keys(value3).reduce(function(a0, a1) {
var env0_0 = a1;
a0[a1] = _fun17435;
return a0;
}, {});
Object = global.Object;
assign = Object.assign;
const binding = env0_6;
return Reflect.apply(assign, Object, [{}, binding, value5, {dispatch: dispatch_174332, emit: emitter.emit,
isFocused: binding ? env0_6.isFocused : function() {
return true;
}, canGoBack: canGoBack, getId: function() {
return id;
}, getParent: getParent_17439, getState: getState}]);
function dispatch_17433(a0) { // fn#17433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:318, offset: 0x00e6cec7, size: 76 bytes, params: 2, frame: 14
var r2;
var value2;
let value = a0;
if (typeof value !== 'function') {
r2 = value;
} else {
value2 = environment.__proto__;
value = value(getState());
r2 = value;
}
value = environment.__proto__;
if (!(onAction(r2) || env1_5 == null)) {
env1_5(r2);
}
}
function _fun17434(a0, a1) { // fn#17434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:480, offset: 0x00e6cf13, size: 23 bytes, params: 3, frame: 4
const env0_0 = a1;
a0[a1] = _fun17435;
return a0;
function _fun17435() { // fn#17435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:506, offset: 0x00e6cf2a, size: 46 bytes, params: 1, frame: 16
const dispatch_17433Binding = dispatch_17433;
const binding = env1_1;
const property = binding[require];
dispatch_17433Binding(property.apply(binding, arguments));
}
}
function canGoBack() { // fn#17437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:662, offset: 0x00e6cf58, size: 142 bytes, params: 1, frame: 18
const value = environment.__proto__;
const getStateBinding = getState;
const value2 = undefined;
const stateBinding = getStateBinding();
const routerBinding = router;
const getStateForAction = routerBinding.getStateForAction;
const CommonActions = (Module01489Module).CommonActions;
let r0 = Reflect.apply(getStateForAction, routerBinding, [stateBinding, CommonActions.goBack(),
{routeNames: stateBinding.routeNames, routeParamList: {},
routeGetIdList: {}}]) !== null || (env1_6 == null ? value2 : env1_6.canGoBack());
r0 = !!r0 && r0;
return r0;
}
function getParent_17439(a0) { // fn#17439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1673:903, offset: 0x00e6cfef, size: 89 bytes, params: 2, frame: 12
var r2;
var r0;
var value;
var binding;
var getId;
if (a0 !== undefined) {
value = environment;
binding = env0_2;
if (binding) {
getId = binding.getId;
if (a0 === Reflect.apply(getId, binding, [])) {
r0 = binding;
} else {
r2 = binding;
while (true) {
value = r2.getParent();
if (!value) {
r0 = value;
break;
}
getId = value.getId;
if (a0 !== Reflect.apply(getId, value, [])) {
r2 = value;
continue;
}
r0 = value;
break;
}
}
} else {
r0 = binding;
}
return r0;
}
value = environment.__proto__;
return env1_6;
}
}
}
}
global.__d(_fun17430, 1546, [31, 1488, 1509, 1512,
1489]) /* metro module 1546, dependencies: [31, 1488, 1509, 1512, 1489] */;