Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
66 lines
2.3 KiB
TypeScript
66 lines
2.3 KiB
TypeScript
// Module ID: 7439
|
|
// Function ID: 7440
|
|
// Name: useAnalyticsLocations
|
|
// Dependencies: [32, 19, 21, 12, 1331, 2]
|
|
// Exports: AnalyticsLocationProvider, default, useLocationStackFromLocationContext
|
|
|
|
// Module 7439 (useAnalyticsLocations)
|
|
import _modDef12 from "module_12" /* 12 */;
|
|
import _modDef1331 from "module_1331" /* 1331 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const jsx = fn(21).jsx;
|
|
let context = noop.createContext([]);
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/app_analytics/useAnalyticsLocations.tsx");
|
|
|
|
export default function useAnalyticsLocations() {
|
|
let items = [...arguments];
|
|
first = undefined;
|
|
_slicedToArray = undefined;
|
|
context = undefined;
|
|
[first, _slicedToArray] = context.useState(items);
|
|
context = context.useContext(context);
|
|
const items1 = [first, context];
|
|
const memo = context.useMemo(() => {
|
|
let tmp3 = context;
|
|
if (0 !== first.length) {
|
|
const flattenResult = _modDef12.flatten(tmp2);
|
|
items = [];
|
|
HermesBuiltin.arraySpread(flattenResult, HermesBuiltin.arraySpread(tmp, 0));
|
|
tmp3 = items;
|
|
}
|
|
return tmp3;
|
|
}, items1);
|
|
const items2 = [first, context];
|
|
const memo1 = context.useMemo(() => {
|
|
const substr = first.slice(0, first.length - 1);
|
|
let tmp2 = context;
|
|
if (0 !== substr.length) {
|
|
const flattenResult = _modDef12.flatten(substr);
|
|
items = [];
|
|
HermesBuiltin.arraySpread(flattenResult, HermesBuiltin.arraySpread(tmp, 0));
|
|
tmp2 = items;
|
|
}
|
|
return tmp2;
|
|
}, items2);
|
|
const items3 = [items, first];
|
|
const effect = context.useEffect(() => {
|
|
if (!_modDef1331(items, first)) {
|
|
closure_2(items);
|
|
}
|
|
}, items3);
|
|
return { analyticsLocations: memo, sourceAnalyticsLocations: memo1, parentAnalyticsLocation: memo1[memo1.length - 1], newestAnalyticsLocation: memo[memo.length - 1] };
|
|
};
|
|
export const LocationContext = context;
|
|
export const AnalyticsLocationProvider = function AnalyticsLocationProvider(value) {
|
|
return <context.Provider value={arg0.value}>{arg0.children}</context.Provider>;
|
|
};
|
|
export const useLocationStackFromLocationContext = function useLocationStackFromLocationContext() {
|
|
context = noop.useContext(context);
|
|
if (context == null) {
|
|
context = [];
|
|
}
|
|
return context;
|
|
};
|