Files
2026-07-28 01:06:53 +03:00

124 lines
5.4 KiB
JavaScript

/* Metro module 1561; source: unknown; dependencies: [31, 27, 1487, 1562, 1563] */
import Module01562 from './module-01562.js'; /* Metro dependency 1562 */
import Module01563 from './module-01563.js'; /* Metro dependency 1563 */
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
function _fun17517(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#17517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1688:6, offset: 0x00e6ebcc, size: 118 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(ReactNativeModule).Platform;
const getStateFromParams = function(a0) {
var r0;
var value;
var object2;
if (a0 == null) {
value = undefined;
if (a0 != null) {
if (a0.screen) {
object2 = {name: a0.screen, params: a0.params};
object2.state = a0.screen ? getStateFromParams(a0.params) : value;
r0 = {routes: [object2]};
} else {
r0 = value;
}
} else {
r0 = value;
}
} else if (a0.state) {
r0 = a0.state;
} else {
value = undefined;
if (a0 != null) {
if (a0.screen) {
object2 = {name: a0.screen, params: a0.params};
object2.state = a0.screen ? getStateFromParams(a0.params) : value;
r0 = {routes: [object2]};
} else {
r0 = value;
}
} else {
r0 = value;
}
}
return r0;
};
exports.default = useLinkProps;
function useLinkProps({to, action}) { // fn#17519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1688:306, offset: 0x00e6ecbc, size: 317 bytes, params: 2, frame: 21
var r2;
var object2;
var params;
var getStateFromParamsBinding;
const binding = env0_3;
let useContext = binding.useContext;
const NavigationContainerRefContext = (require(1487) /* metro dependency 1487 */).NavigationContainerRefContext;
const env0_2 = Reflect.apply(useContext, binding, [NavigationContainerRefContext]);
useContext = binding.useContext;
const NavigationHelpersContext = (require(1487) /* metro dependency 1487 */).NavigationHelpersContext;
var env0_3 = Reflect.apply(useContext, binding, [NavigationHelpersContext]);
useContext = binding.useContext;
const options = Reflect.apply(useContext, binding, [Module01562]).options;
const env0_4 = (Module01563)();
let getPathFromState = options?.getPathFromState;
getPathFromState = getPathFromState ?? (require(1487) /* metro dependency 1487 */).getPathFromState;
if (typeof to === 'string') {
r2 = to;
} else {
object2 = {};
object2.name = to.screen;
params = to.params;
object2.params = params;
getStateFromParamsBinding = getStateFromParams;
params = to.params;
object2.state = getStateFromParamsBinding(params);
r2 = getPathFromState({routes: [object2]}, options?.config);
}
return {href: r2, accessibilityRole: 'link', onPress: onPress_17520};
function useLinkPropsOnPress(a0) { // fn#17520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1688:729, owner: useLinkProps.onPress, offset: 0x00e6edf9, size: 134 bytes, params: 2, frame: 12
var binding;
if (a0) {
if (a0.defaultPrevented) {
return undefined;
}
if (action) {
if (env0_3) {
binding = env0_3;
binding.dispatch(action);
return undefined;
}
if (env0_2) {
binding = env0_2;
binding.dispatch(action);
return undefined;
}
throw new global.Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");
}
binding = env0_4;
binding(to);
} else {
if (action) {
if (env0_3) {
binding = env0_3;
binding.dispatch(action);
return undefined;
}
if (env0_2) {
binding = env0_2;
binding.dispatch(action);
return undefined;
}
throw new global.Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");
}
binding = env0_4;
binding(to);
}
}
}
}
global.__d(_fun17517, 1561, [31, 27, 1487, 1562,
1563]) /* metro module 1561, dependencies: [31, 27, 1487, 1562, 1563] */;