2026-08-15 05:55:55 +00:00
|
|
|
// Module ID: 1587
|
|
|
|
|
// Function ID: 1588
|
2026-08-06 08:05:19 +00:00
|
|
|
// Name: useNavigationCache
|
2026-08-15 05:55:55 +00:00
|
|
|
// Dependencies: [109, 19, 1530, 1505]
|
2026-08-06 08:05:19 +00:00
|
|
|
// Exports: useNavigationCache
|
|
|
|
|
|
2026-08-15 05:55:55 +00:00
|
|
|
// Module 1587 (useNavigationCache)
|
2026-08-24 06:08:38 +00:00
|
|
|
import closure_3 from "_objectWithoutProperties" /* 109 */;
|
|
|
|
|
import closure_4 from "noop" /* 19 */;
|
2026-08-06 08:05:19 +00:00
|
|
|
|
|
|
|
|
const require = arg1;
|
|
|
|
|
let closure_2 = ["emit"];
|
|
|
|
|
|
|
|
|
|
export const useNavigationCache = function useNavigationCache(getState) {
|
|
|
|
|
getState = getState.getState;
|
|
|
|
|
const navigation = getState.navigation;
|
|
|
|
|
const setOptions = getState.setOptions;
|
|
|
|
|
const router = getState.router;
|
|
|
|
|
const emitter = getState.emitter;
|
|
|
|
|
let base;
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_6 = undefined;
|
2026-08-06 08:05:19 +00:00
|
|
|
let navigations;
|
|
|
|
|
const stackRef = emitter.useContext(getState(navigation[2]).NavigationBuilderContext).stackRef;
|
|
|
|
|
let items = [navigation, router.actionCreators];
|
|
|
|
|
base = emitter.useMemo(() => {
|
|
|
|
|
const tmp = router(dispatch, setOptions);
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = tmp;
|
2026-08-06 08:05:19 +00:00
|
|
|
let obj = {};
|
|
|
|
|
const merged = Object.assign(router.actionCreators);
|
|
|
|
|
const merged1 = Object.assign(getState(navigation[3]).CommonActions);
|
|
|
|
|
dispatch = function dispatch() {
|
2026-08-24 06:08:38 +00:00
|
|
|
error = new Error("Actions cannot be dispatched from a placeholder screen.");
|
2026-08-06 08:05:19 +00:00
|
|
|
throw error;
|
|
|
|
|
};
|
|
|
|
|
const keys = Object.keys(obj);
|
|
|
|
|
const reduced = keys.reduce((arg0, arg1) => {
|
|
|
|
|
arg0[arg1] = dispatch;
|
|
|
|
|
return arg0;
|
|
|
|
|
}, {});
|
|
|
|
|
obj = {};
|
|
|
|
|
const merged2 = Object.assign(tmp);
|
|
|
|
|
const merged3 = Object.assign(reduced);
|
|
|
|
|
obj.addListener = function addListener() {
|
|
|
|
|
return () => {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
obj.removeListener = function removeListener() {
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
obj.dispatch = dispatch;
|
|
|
|
|
obj.getParent = function getParent(arg0) {
|
|
|
|
|
if (undefined !== arg0) {
|
2026-08-24 06:08:38 +00:00
|
|
|
if (arg0 === store.getId()) {
|
|
|
|
|
let parent = closure_1_5;
|
2026-08-06 08:05:19 +00:00
|
|
|
}
|
|
|
|
|
return parent;
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
parent = store.getParent(arg0);
|
2026-08-06 08:05:19 +00:00
|
|
|
};
|
|
|
|
|
obj.setOptions = function setOptions() {
|
2026-08-24 06:08:38 +00:00
|
|
|
error = new Error("Options cannot be set from a placeholder screen.");
|
2026-08-06 08:05:19 +00:00
|
|
|
throw error;
|
|
|
|
|
};
|
|
|
|
|
obj.isFocused = function isFocused() {
|
|
|
|
|
return false;
|
|
|
|
|
};
|
|
|
|
|
return obj;
|
|
|
|
|
}, items);
|
|
|
|
|
const items1 = [base, getState, navigation, setOptions, emitter];
|
|
|
|
|
closure_6 = emitter.useMemo(() => ({ current: {} }), items1);
|
|
|
|
|
const routes = getState.state.routes;
|
|
|
|
|
navigations = routes.reduce((arg0, key) => {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg0;
|
|
|
|
|
closure_1 = key;
|
2026-08-06 08:05:19 +00:00
|
|
|
if (ref.current[key.key]) {
|
|
|
|
|
arg0[key.key] = tmp;
|
|
|
|
|
} else {
|
|
|
|
|
function dispatch(arg0) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
function withStack(arg0) {
|
|
|
|
|
arg0();
|
|
|
|
|
}
|
|
|
|
|
let obj = {};
|
|
|
|
|
let merged = Object.assign(withStack.actionCreators);
|
|
|
|
|
let merged1 = Object.assign(getState(navigation[3]).CommonActions);
|
|
|
|
|
const _Object = Object;
|
|
|
|
|
const keys = Object.keys(obj);
|
|
|
|
|
const reduced = keys.reduce((arg0, arg1) => {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg1;
|
2026-08-06 08:05:19 +00:00
|
|
|
arg0[arg1] = () => {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = [...arguments];
|
|
|
|
|
closure_1_3(() => {
|
2026-08-06 08:05:19 +00:00
|
|
|
const items = [...closure_0];
|
2026-08-24 06:08:38 +00:00
|
|
|
const applyResult = closure_2_4[args].apply(items);
|
|
|
|
|
if (typeof closure_2_2 !== "function") {
|
2026-08-06 08:05:19 +00:00
|
|
|
HermesBuiltin.throwTypeError();
|
|
|
|
|
}
|
|
|
|
|
let applyResultResult = applyResult;
|
|
|
|
|
if (typeof applyResult === "function") {
|
|
|
|
|
applyResultResult = applyResult(args());
|
|
|
|
|
}
|
|
|
|
|
if (null != applyResultResult) {
|
2026-08-24 06:08:38 +00:00
|
|
|
obj = { source: null };
|
|
|
|
|
obj[0] = closure_2_1.key;
|
2026-08-06 08:05:19 +00:00
|
|
|
const merged = Object.assign(applyResultResult);
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_1_1.dispatch(obj);
|
2026-08-06 08:05:19 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
return arg0;
|
|
|
|
|
}, {});
|
|
|
|
|
obj = {};
|
|
|
|
|
let merged2 = Object.assign(base);
|
|
|
|
|
const merged3 = Object.assign(reduced);
|
|
|
|
|
const merged4 = Object.assign(obj.create(key.key));
|
|
|
|
|
obj.dispatch = function dispatch(arg0) {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg0;
|
2026-08-06 08:05:19 +00:00
|
|
|
withStack(() => {
|
2026-08-24 06:08:38 +00:00
|
|
|
if (typeof closure_1_2 !== "function") {
|
2026-08-06 08:05:19 +00:00
|
|
|
HermesBuiltin.throwTypeError();
|
|
|
|
|
}
|
|
|
|
|
let tmpResult = tmp;
|
|
|
|
|
if (typeof callback === "function") {
|
|
|
|
|
tmpResult = tmp(callback());
|
|
|
|
|
}
|
|
|
|
|
if (null != tmpResult) {
|
2026-08-24 06:08:38 +00:00
|
|
|
obj = { source: null };
|
|
|
|
|
obj[0] = closure_1_1.key;
|
2026-08-06 08:05:19 +00:00
|
|
|
const merged = Object.assign(tmpResult);
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_1_1.dispatch(obj);
|
2026-08-06 08:05:19 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
obj.getParent = function getParent(arg0) {
|
|
|
|
|
if (undefined !== arg0) {
|
2026-08-24 06:08:38 +00:00
|
|
|
if (arg0 === closure_1_5.getId()) {
|
2026-08-06 08:05:19 +00:00
|
|
|
let parent = table[key.key];
|
|
|
|
|
}
|
|
|
|
|
return parent;
|
|
|
|
|
}
|
2026-08-24 06:08:38 +00:00
|
|
|
parent = closure_1_5.getParent(arg0);
|
2026-08-06 08:05:19 +00:00
|
|
|
};
|
|
|
|
|
obj.setOptions = function setOptions(arg0) {
|
2026-08-24 06:08:38 +00:00
|
|
|
closure_0 = arg0;
|
2026-08-06 08:05:19 +00:00
|
|
|
dispatch((arg0) => {
|
2026-08-24 06:08:38 +00:00
|
|
|
obj = {};
|
2026-08-06 08:05:19 +00:00
|
|
|
const merged = Object.assign(arg0);
|
|
|
|
|
obj = {};
|
2026-08-24 06:08:38 +00:00
|
|
|
const merged1 = Object.assign(arg0[closure_1_1.key]);
|
2026-08-06 08:05:19 +00:00
|
|
|
const merged2 = Object.assign(closure_0);
|
2026-08-24 06:08:38 +00:00
|
|
|
obj[closure_1_1.key] = obj;
|
2026-08-06 08:05:19 +00:00
|
|
|
return obj;
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
obj.isFocused = function isFocused() {
|
2026-08-24 06:08:38 +00:00
|
|
|
const state = closure_1_5.getState();
|
2026-08-06 08:05:19 +00:00
|
|
|
let tmp2 = state.routes[state.index].key === key.key;
|
|
|
|
|
if (tmp2) {
|
|
|
|
|
let isFocusedResult = !key;
|
|
|
|
|
if (key) {
|
|
|
|
|
isFocusedResult = obj.isFocused();
|
|
|
|
|
}
|
|
|
|
|
tmp2 = isFocusedResult;
|
|
|
|
|
obj = key;
|
|
|
|
|
}
|
|
|
|
|
return tmp2;
|
|
|
|
|
};
|
|
|
|
|
arg0[key.key] = obj;
|
|
|
|
|
}
|
|
|
|
|
return arg0;
|
|
|
|
|
}, {});
|
|
|
|
|
const insertionEffect = emitter.useInsertionEffect(() => {
|
|
|
|
|
closure_6.current = navigations;
|
|
|
|
|
});
|
|
|
|
|
return { base, navigations };
|
|
|
|
|
};
|