Files
discord-decomp/_bundle/Module1027.js
T
2026-11-01 12:12:55 +02:00

114 lines
3.9 KiB
JavaScript

// Metro module 1027 (f1028).
import { WINDOW } from "./ignoreNextOnError";
import { getClient, SDK_VERSION } from "./Module817";
let env841 = {};
Object.defineProperty(exports, Symbol.toStringTag, {
value: "Module"
});
const c841_3 = {
replayIntegration: "replay",
replayCanvasIntegration: "replay-canvas",
feedbackIntegration: "feedback",
feedbackModalIntegration: "feedback-modal",
feedbackScreenshotIntegration: "feedback-screenshot",
captureConsoleIntegration: "captureconsole",
contextLinesIntegration: "contextlines",
linkedErrorsIntegration: "linkederrors",
dedupeIntegration: "dedupe",
extraErrorDataIntegration: "extraerrordata",
graphqlClientIntegration: "graphqlclient",
httpClientIntegration: "httpclient",
reportingObserverIntegration: "reportingobserver",
rewriteFramesIntegration: "rewriteframes",
browserProfilingIntegration: "browserprofiling",
moduleMetadataIntegration: "modulemetadata",
instrumentAnthropicAiClient: "instrumentanthropicaiclient",
instrumentOpenAiClient: "instrumentopenaiclient",
instrumentGoogleGenAIClient: "instrumentgooglegenaiclient",
instrumentLangGraph: "instrumentlanggraph",
createLangChainCallbackHandler: "createlangchaincallbackhandler"
};
export async function lazyLoadIntegration(c24016_0, c24016_1) {
let r51, r143;
let c24016_2;
let c24016_4 = 0;
const r21 = "Could not find parent element to insert lazy-loaded ";
const r12 = env841;
L29: {
L14: {
try {
let env28745;
const r43 = env28745 = {
$parent: r12
};
c24016_2 = r43;
env28745[0] = c24016_0;
env28745[1] = void 0;
env28745[2] = void 0;
env28745[3] = void 0;
const r28 = c841_3[c24016_0];
const Sentry = WINDOW.Sentry || {};
WINDOW.Sentry = Sentry;
env28745[1] = Sentry;
if (r28) {
r51 = Sentry[c24016_0];
if (typeof r51 === "function" && !("_isShim" in r51)) {
break L14;
}
const src = (function getScriptURL(a0) {
const client = getClient();
return new URL(`/${SDK_VERSION}/${a0}.min.js`, (client == null ? void 0 : client.getOptions()?.cdnBaseUrl) || "https://browser.sentry-cdn.com").toString();
})(r28);
const element = WINDOW.document.createElement("script");
env28745[2] = element;
element.src = src;
element.crossOrigin = "anonymous";
element.referrerPolicy = "strict-origin";
if (c24016_1) {
element.setAttribute("nonce", c24016_1);
}
const promise = new Promise((c31187_0, reject) => {
const r4 = env28745[2];
r4.addEventListener("load", () => c31187_0());
r4.addEventListener("error", reject);
});
const currentScript = WINDOW.document.currentScript;
const r80 = WINDOW.document.body || WINDOW.document.head || currentScript?.parentElement;
if (r80) {
r80.appendChild(element);
c24016_4 = 1;
await promise;
c24016_4 = 0;
env28745[3] = env28745[1][env28745[0]];
if (typeof env28745[3] !== "function") {
throw new Error(`Could not load integration: ${env28745[0]}`);
}
r143 = env28745[3];
break L29;
}
throw new Error(HermesInternal.concat.call(r21, c24016_0, " script"));
}
throw new Error(`Cannot lazy load integration: ${c24016_0}`);
} catch ($e) {
let r42 = $e;
if (c24016_4 !== 0) {
while (true) {
try {
c24016_4 = 0;
throw new Error(`Error when loading integration: ${env28745[0]}`);
} catch ($e) {
r42 = $e;
if (c24016_4 === 0) {
break;
}
}
}
}
throw r42;
}
}
return r51;
}
return r143;
}