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

183 lines
6.7 KiB
JavaScript

// Metro module 6443 (f6444).
import { defineIntegration } from "./setupIntegration_6424";
import { DEBUG_BUILD } from "./Module6396";
import { logger } from "./consoleSandbox_6368";
import { getEventDescription } from "./Module6379";
import { stringMatchesSomePattern } from "./Module6377";
let c4142_2;
const _getEventFilterUrl = function _getEventFilterUrl(a0) {
let r11, frames;
try {
try {
frames = a0.exception.values[0].stacktrace.frames;
} catch ($e) {}
r11 = frames ? (function _getLastValidUrl(r8 = []) {
let r0 = r8.length - 1;
while (0 <= r0) {
const r10 = r8[r0];
const r1 = r0;
if (r10 && r10.filename !== "<anonymous>" && r10.filename !== "[native code]") {
return r10.filename || null;
}
r0 = r1 - 1;
}
return null;
})(frames) : null;
} catch ($e) {
if (DEBUG_BUILD) {
logger.error(`Cannot extract url for event ${getEventDescription(a0)}`);
}
return null;
}
return r11;
};
c4142_2 = [/^Script error\.?$/, /^Javascript error: Script error\.? on line 0$/, /^ResizeObserver loop completed with undelivered notifications.$/, /^Cannot redefine property: googletag$/, "undefined is not an object (evaluating 'a.L')", "can't redefine non-configurable property \"solana\"", "vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)", "Can't find variable: _AutofillCallbackHandler", /^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/];
export const inboundFiltersIntegration = defineIntegration(function(r1 = {}) {
let c15736_0 = r1;
return {
name: "InboundFilters",
processEvent: (a0, a1, a2) => {
let r121;
let r20 = a2.getOptions();
let r22 = c15736_0;
if (r22 === void 0) {
r22 = {};
}
if (r20 === void 0) {
r20 = {};
}
const r14 = [...r22.allowUrls || [], ...r20.allowUrls || []];
const r15 = [...r22.denyUrls || [], ...r20.denyUrls || []];
const r11 = [...r22.ignoreErrors || [], ...r20.ignoreErrors || [], ...r22.disableErrorDefaults ? [] : c4142_2];
const r16 = [...r22.ignoreTransactions || [], ...r20.ignoreTransactions || []];
const r66 = r22.ignoreInternal === void 0 || r22.ignoreInternal;
L67: {
if (r66 && (function _isSentryError(a0) {
let type;
try {
type = a0.exception.values[0].type;
} catch ($e) {
return false;
}
return type === "SentryError";
})(a0)) {
r121 = true;
if (!DEBUG_BUILD) {
break L67;
}
logger.warn(`Event dropped due to being internal Sentry Error.
Event: ${getEventDescription(a0)}`);
r121 = true;
} else {
let c25882_0 = r11;
if (a0.type ? false : r11.length ? (function _getPossibleEventMessages(a0) {
let r16;
const r0 = [];
if (a0.message) {
r0.push(a0.message);
}
try {
r16 = a0.exception.values[a0.exception.values.length - 1];
} catch ($e) {}
if (r16 && r16.value) {
const r21 = r16;
r0.push(r21.value);
if (r21.type) {
r0.push(`${r16.type}: ${r16.value}`);
}
}
return r0;
})(a0).some((item) => stringMatchesSomePattern(item, c25882_0)) : false) {
r121 = true;
if (DEBUG_BUILD) {
logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${getEventDescription(a0)}`);
r121 = true;
}
} else {
const type = a0.type;
let r3 = false;
if (!type) {
const exception = a0.exception;
r3 = false;
if (exception) {
const values = a0.exception.values;
r3 = false;
if (values) {
const length = a0.exception.values.length;
r3 = false;
if (length !== 0) {
const message = a0.message;
r3 = message ? !message : !a0.exception.values.some((value) => value.stacktrace || value.type && value.type !== "Error" || value.value);
}
}
}
}
if (r3) {
r121 = true;
if (DEBUG_BUILD) {
logger.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${getEventDescription(a0)}`);
r121 = true;
}
} else {
const type2 = a0.type;
let r91 = false;
if (type2 === "transaction") {
const length2 = r16.length;
r91 = false;
if (length2) {
const transaction = a0.transaction;
r91 = !!transaction && stringMatchesSomePattern(transaction, r16);
}
}
if (r91) {
r121 = true;
if (DEBUG_BUILD) {
logger.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${getEventDescription(a0)}`);
r121 = true;
}
} else {
const length3 = r15.length;
let r101 = false;
if (length3) {
const r103 = _getEventFilterUrl(a0);
r101 = !!r103 && stringMatchesSomePattern(r103, r15);
}
if (r101) {
r121 = true;
if (DEBUG_BUILD) {
logger.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${getEventDescription(a0)}.
Url: ${_getEventFilterUrl(a0)}`);
r121 = true;
}
} else {
const length4 = r14.length;
let r112 = true;
if (length4) {
const r114 = _getEventFilterUrl(a0);
r112 = r114 ? stringMatchesSomePattern(r114, r14) : !r114;
}
r121 = false;
if (!r112) {
r121 = true;
if (DEBUG_BUILD) {
logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${getEventDescription(a0)}.
Url: ${_getEventFilterUrl(a0)}`);
r121 = true;
}
}
}
}
}
}
}
}
return r121 ? null : a0;
}
};
});