141 lines
3.9 KiB
JavaScript
141 lines
3.9 KiB
JavaScript
// Metro module 1150 (f1151).
|
|
import { getNavigationContext, getActiveRootSpan } from "./pickSplat";
|
|
import { WINDOW } from "./Module1024";
|
|
import { DEBUG_BUILD } from "./Module1142";
|
|
import { debug, isThenable, addNonEnumerableProperty } from "./Module817";
|
|
function $mk68233($env) {
|
|
return (a0) => {
|
|
if (Array.isArray(a0)) {
|
|
const r13 = $env;
|
|
const r4 = r13[2];
|
|
const r3 = r13[0];
|
|
let r14 = r13[3];
|
|
if (r14 == null) {
|
|
r14 = void 0;
|
|
}
|
|
r4(a0, r3, r14, r13[4]);
|
|
}
|
|
};
|
|
}
|
|
function $mk68234($env) {
|
|
return (a0) => {
|
|
const r1 = $env.$parent;
|
|
const r3 = r1[0];
|
|
const r2 = r1[1];
|
|
if (r3(r2[2]).DEBUG_BUILD) {
|
|
const r12 = $env;
|
|
r3(r2[3]).debug.warn(`Error resolving async handler '${r12[1]}' for route`, r12[0], a0);
|
|
}
|
|
};
|
|
}
|
|
let checkRouteForAsyncHandler;
|
|
let env957 = {};
|
|
export function createAsyncHandlerProxy(a0, c12853_0, c12853_1, c12853_2) {
|
|
const proxy = new Proxy(a0, {
|
|
apply: (a0, a1, a2) => {
|
|
const r3 = env957;
|
|
let r4 = (function captureCurrentLocation() {
|
|
let r22;
|
|
const navigationContext = getNavigationContext();
|
|
if (navigationContext?.targetPath) {
|
|
return {
|
|
pathname: navigationContext.targetPath,
|
|
search: "",
|
|
hash: "",
|
|
state: null,
|
|
key: "default"
|
|
};
|
|
}
|
|
L14: {
|
|
if (WINDOW !== void 0) {
|
|
try {
|
|
const location2 = WINDOW.location;
|
|
if (!location2) {
|
|
break L14;
|
|
}
|
|
r22 = {
|
|
pathname: location2.pathname,
|
|
search: location2.search || "",
|
|
hash: location2.hash || "",
|
|
state: null,
|
|
key: "default"
|
|
};
|
|
} catch ($e) {
|
|
if (!DEBUG_BUILD) {
|
|
break L14;
|
|
}
|
|
debug.warn("[React Router] Could not access window.location");
|
|
break L14;
|
|
}
|
|
return r22;
|
|
}
|
|
}
|
|
return null;
|
|
})();
|
|
const navigationContext = getNavigationContext();
|
|
const r7 = navigationContext ? navigationContext.span : getActiveRootSpan();
|
|
let env24250;
|
|
const r25 = a0.apply(a1, a2);
|
|
const r29 = env24250 = {
|
|
$parent: r3
|
|
};
|
|
env24250[0] = c12853_0;
|
|
env24250[1] = c12853_1;
|
|
env24250[2] = c12853_2;
|
|
env24250[3] = r4;
|
|
env24250[4] = r7;
|
|
if (isThenable(r25)) {
|
|
r25.then($mk68233(r29)).catch($mk68234(r29));
|
|
} else if (Array.isArray(r25)) {
|
|
if (r4 == null) {
|
|
r4 = void 0;
|
|
}
|
|
c12853_2(r25, c12853_0, r4, r7);
|
|
}
|
|
return r25;
|
|
}
|
|
});
|
|
addNonEnumerableProperty(proxy, "__sentry_proxied__", true);
|
|
return proxy;
|
|
}
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
checkRouteForAsyncHandler = function checkRouteForAsyncHandler(a0, a1) {
|
|
if (a0.handle && typeof a0.handle === "object") {
|
|
for (const item of Object.keys(a0.handle)) {
|
|
const r38 = a0.handle[item];
|
|
if (!(typeof r38 === "function" ? r38.__sentry_proxied__ : typeof r38 !== "function")) {
|
|
const handle = a0.handle;
|
|
handle[item] = createAsyncHandlerProxy(r38, a0, item, a1);
|
|
}
|
|
}
|
|
}
|
|
if (Array.isArray(a0.children)) {
|
|
for (const item2 of a0.children) {
|
|
checkRouteForAsyncHandler(item2, a1);
|
|
}
|
|
}
|
|
};
|
|
export { checkRouteForAsyncHandler };
|
|
export function handleAsyncHandlerResult(a0, a1, a2, a3, a4, a5) {
|
|
let env12854;
|
|
const r2 = env12854 = {
|
|
$parent: env957
|
|
};
|
|
env12854[0] = a1;
|
|
env12854[1] = a2;
|
|
env12854[2] = a3;
|
|
let r4 = a4;
|
|
env12854[3] = a4;
|
|
env12854[4] = a5;
|
|
if (isThenable(a0)) {
|
|
a0.then($mk68233(r2)).catch($mk68234(r2));
|
|
} else if (Array.isArray(a0)) {
|
|
if (a4 == null) {
|
|
r4 = void 0;
|
|
}
|
|
a3(a0, a1, r4, a5);
|
|
}
|
|
}
|