decord/source/__helpers/01xxx/1570__toPropertyKey.js
github-actions f0f877e8ce chore: update source for alpha 347.1
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4824.js (118.4 MB)
2026-09-15 14:23:42 +00:00

202 lines
6.7 KiB
JavaScript

// Module ID: 1570
// Function ID: 1571
// Name: _toPropertyKey
// Dependencies: [109, 32, 19, 21, 1521, 1514, 1571, 1536, 1572, 1525]
// Exports: useDescriptors
// Module 1570 (_toPropertyKey)
import _objectWithoutProperties from "_objectWithoutProperties" /* 109 */;
import _slicedToArray from "module_32" /* 32 */;
import noop from "module_19" /* 19 */;
const require = fn;
function _toPropertyKey(obj) {
let StringResult = obj;
if (typeof obj === "object") {
StringResult = obj;
if (obj) {
const _Symbol = Symbol;
if (undefined !== obj[Symbol.toPrimitive]) {
const call = tmp3.call;
if (typeof call === "unknown") {
let callResult = tmp3("string");
} else {
callResult = call(obj, "string");
}
StringResult = callResult;
if (typeof callResult === "object") {
const _TypeError = TypeError;
const typeError = new TypeError("@@toPrimitive must return a primitive value.");
throw typeError;
}
} else {
const _String = String;
StringResult = String(obj);
}
}
}
let text = StringResult;
if (typeof StringResult !== "symbol") {
text = `${tmp}`;
}
return text;
}
const jsx = fn(21).jsx;
export const useDescriptors = function useDescriptors(state) {
state = state.state;
({ screens: dependencyMap, navigation } = state);
({ screenOptions: _slicedToArray, screenLayout: noop, onAction } = state);
const getState = state.getState;
({ setState: closure_7, addListener } = state);
const addKeyedListener = state.addKeyedListener;
const onRouteFocus = state.onRouteFocus;
c12 = undefined;
c22 = undefined;
c23 = undefined;
({ router, emitter } = state);
const theme = noop.useContext(state(1521).ThemeContext);
[c12, tmp2] = noop.useState({});
c13 = tmp2;
const context = noop.useContext(state(1514).NavigationBuilderContext);
const onDispatchAction = context.onDispatchAction;
const onEmitEvent = context.onEmitEvent;
const onOptionsChange = context.onOptionsChange;
const scheduleUpdate = context.scheduleUpdate;
const flushUpdates = context.flushUpdates;
const stackRef = context.stackRef;
const getIsStateEmitted = context.getIsStateEmitted;
let items = [navigation, onAction, addListener, addKeyedListener, onRouteFocus, onDispatchAction, onEmitEvent, onOptionsChange, getIsStateEmitted, scheduleUpdate, flushUpdates, stackRef];
value = noop.useMemo(() => ({ navigation, onAction, addListener, addKeyedListener, onRouteFocus, onDispatchAction, onEmitEvent, onOptionsChange, getIsStateEmitted, scheduleUpdate, flushUpdates, stackRef }), items);
let tmp = _slicedToArray(noop.useState({}), 2);
const navigationCache = state(1571).useNavigationCache({ state, getState, navigation, setOptions: tmp2, router, emitter });
({ base: c22, navigations: c23 } = navigationCache);
let obj = state(1571);
const routeCache = state(1536).useRouteCache(state.routes);
function getOptions(arg0, arg1, arg2) {
}
function render(route, navigation, options, routeState) {
closure_0 = route;
const props = tmp.props;
let layout = props.layout;
if (layout == null) {
layout = tmp.layout;
}
if (layout == null) {
layout = closure_4;
}
const tmp5 = onAction(state(1572).SceneView, {
navigation,
route,
screen: props,
routeState,
getState,
setState,
options,
clearOptions() {
return c13((arg0) => {
if (route.key in arg0) {
const items = [route.key];
return navigation(arg0, items.map(getState));
} else {
return arg0;
}
});
}
});
let layoutResult = tmp5;
if (null != layout) {
const obj2 = { route, navigation, options, theme, children: tmp5 };
layoutResult = layout(obj2);
}
const obj3 = { value, children: onAction(state(1525).NavigationProvider, { route, navigation, children: layoutResult }) };
return onAction(state(1514).NavigationBuilderContext.Provider, obj3, route.key);
}
let reduced = routeCache.reduce((acc, route, index) => {
if (typeof getOptions === "function") {
state = route;
dependencyMap = tmp;
const items = [closure_3, , ];
if (dependencyMap[route.name].options) {
const options = tmp4.options;
const _Boolean = Boolean;
let found = options.filter(Boolean);
} else {
found = [];
}
const arraySpreadResult = HermesBuiltin.arraySpread(found, 1);
items[arraySpreadResult] = dependencyMap[route.name].props.options;
items[arraySpreadResult + 1] = tmp2;
reduced = items.reduce((acc, fn) => {
let tmp = fn;
if (typeof fn === "function") {
const obj = { route, navigation, theme };
tmp = fn(obj);
}
return Object.assign(acc, tmp);
}, {});
state = render(route, tmp, reduced, state.routes[index].state);
const obj = {
route,
navigation: tmp,
render() {
return closure_0;
},
options: reduced
};
acc[route.key] = obj;
return acc;
} else {
throw new TypeError("Trying to call a non-function");
}
}, {});
return {
describe(route, arg1) {
if (arg1) {
if (typeof getOptions === "function") {
dependencyMap = tmp7;
const items = [closure_3, , ];
if (dependencyMap[route.name].options) {
const options = tmp10.options;
const _Boolean = Boolean;
let found = options.filter(Boolean);
} else {
found = [];
}
const arraySpreadResult = HermesBuiltin.arraySpread(found, 1);
items[arraySpreadResult] = dependencyMap[route.name].props.options;
items[arraySpreadResult + 1] = {};
reduced = items.reduce((acc, fn) => {
let tmp = fn;
if (typeof fn === "function") {
const obj = { route, navigation, theme };
tmp = fn(obj);
}
return Object.assign(acc, tmp);
}, {});
route = render(route, tmp7, reduced, undefined);
const obj2 = {
route,
navigation: tmp7,
render() {
return closure_0;
},
options: reduced
};
return obj2;
} else {
throw new TypeError("Trying to call a non-function");
}
} else if (route.key in reduced) {
return tmp[route.key];
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
const error = new Error("Couldn't find a route with the key " + route.key + ".");
throw error;
}
},
descriptors: reduced
};
};