557 lines
20 KiB
React
557 lines
20 KiB
React
/* Metro module 7450; source: unknown; dependencies: [57, 65, 7451, 7452, 7453, 7376, 7414, 7378, 7368, 7369, 7375] */
|
|
function _fun60094(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:6, offset: 0x016fb418, size: 262 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const closure = extractRequestData;
|
|
const closure2 = winterCGHeadersToDict_60100;
|
|
const closure3 = headersToDict_60102;
|
|
const closure4 = function(a0) {
|
|
var r1;
|
|
var property;
|
|
var prototype;
|
|
var value2;
|
|
var value3;
|
|
var value4;
|
|
var value5;
|
|
var error;
|
|
var value = undefined;
|
|
if (a0) {
|
|
try {
|
|
property = global.URL;
|
|
prototype = property.prototype;
|
|
value2 = Object.create(prototype, {constructor: {value: property}});
|
|
value3 = new property(a0, 'http://dogs.are.great');
|
|
value4 = value3 instanceof Object ? value3 : value2;
|
|
property = value4.search;
|
|
value5 = property.slice(1);
|
|
property = value5.length;
|
|
r1 = property ? value5 : value;
|
|
} catch (error) {
|
|
return value;
|
|
}
|
|
return r1;
|
|
}
|
|
return value;
|
|
};
|
|
const env0_2 = require(57) /* metro dependency 57 */;
|
|
const env0_3 = require(65) /* metro dependency 65 */;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = {'ip': false, 'request': true, 'user': true};
|
|
const env0_5 = ['cookies', 'data', 'headers', 'method', 'query_string', 'url'];
|
|
exports.DEFAULT_USER_INCLUDES = ['id', 'username', 'email'];
|
|
exports.addNormalizedRequestDataToEvent = addNormalizedRequestDataToEvent;
|
|
exports.addRequestDataToEvent = addRequestDataToEvent;
|
|
exports.extractPathForTransaction = extractPathForTransaction;
|
|
exports.extractQueryParamsFromUrl = closure4;
|
|
exports.extractRequestData = closure;
|
|
exports.headersToDict = closure3;
|
|
exports.httpRequestToRequestData = httpRequestToRequestData_60110;
|
|
exports.winterCGHeadersToDict = closure2;
|
|
exports.winterCGRequestToRequestData = function(a0) {
|
|
var value2 = winterCGHeadersToDict_60100(a0.headers);
|
|
var object = {method: a0.method, url: a0.url};
|
|
object.query_string = extractQueryParamsFromUrl_60104(a0.url);
|
|
object.headers = value2;
|
|
return object;
|
|
};
|
|
}
|
|
|
|
function extractUserData(a0, a1) { // fn#60095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:227, offset: 0x016fb51e, size: 63 bytes, params: 3, frame: 13
|
|
const value = a1;
|
|
const env0_0 = a0;
|
|
const Array = global.Array;
|
|
(Array.isArray(value) ? value : env0_6).forEach(_fun60096);
|
|
return {};
|
|
}
|
|
|
|
function extractRequestData(a0) { // fn#60097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:344, offset: 0x016fb589, size: 273 bytes, params: 2, frame: 21
|
|
const env0_0 = a0;
|
|
let r2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
const include = r2.include;
|
|
const r3 = include !== undefined ? include : env0_5;
|
|
r2 = a0.headers || ({});
|
|
const env0_4 = a0.method;
|
|
let r9 = r2.host || a0.hostname;
|
|
r9 = !r9 ? a0.host : r9;
|
|
r9 = !r9 ? '<no host>' : r9;
|
|
const protocol = a0.protocol;
|
|
let value = 'https';
|
|
const r8 = value === protocol || a0.socket && a0.socket.encrypted ? value : 'http';
|
|
r2 = a0.originalUrl || a0.url;
|
|
r2 = !r2 ? '' : r2;
|
|
if (!r2.startsWith(r8)) {
|
|
value = '' + r8 + '://' + r9 + r2;
|
|
}
|
|
r3.forEach(_fun60098);
|
|
return {};
|
|
}
|
|
|
|
function winterCGHeadersToDict_60100(a0) { // fn#60100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:1540, offset: 0x016fba02, size: 114 bytes, params: 2, frame: 13
|
|
var environment;
|
|
var closure;
|
|
var error;
|
|
var value;
|
|
var DEBUG_BUILD;
|
|
var logger;
|
|
try {
|
|
closure = _fun60101;
|
|
a0.forEach(closure);
|
|
} catch (error) {
|
|
value = environment;
|
|
DEBUG_BUILD = (require(7368) /* metro dependency 7368 */).DEBUG_BUILD;
|
|
if (DEBUG_BUILD) {
|
|
logger = (require(7369) /* metro dependency 7369 */).logger;
|
|
logger.warn('Sentry failed extracting headers from a request object. If you see this, please file an issue.');
|
|
}
|
|
}
|
|
return {};
|
|
}
|
|
|
|
function headersToDict_60102(a0) { // fn#60102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:1801, offset: 0x016fba74, size: 148 bytes, params: 2, frame: 16
|
|
var environment;
|
|
var value2;
|
|
var closure;
|
|
var error;
|
|
var value3;
|
|
var DEBUG_BUILD;
|
|
var logger;
|
|
let Object = global.Object;
|
|
const value = Object.create(null);
|
|
try {
|
|
Object = global.Object;
|
|
value2 = Object.entries(a0);
|
|
closure = _fun60103;
|
|
value2.forEach(closure);
|
|
} catch (error) {
|
|
value3 = environment;
|
|
DEBUG_BUILD = (require(7368) /* metro dependency 7368 */).DEBUG_BUILD;
|
|
if (DEBUG_BUILD) {
|
|
logger = (require(7369) /* metro dependency 7369 */).logger;
|
|
logger.warn('Sentry failed extracting headers from a request object. If you see this, please file an issue.');
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function addNormalizedRequestDataToEvent(a0, a1, a2, a3) { // fn#60105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:2320, offset: 0x016fbb9f, size: 455 bytes, params: 5, frame: 21
|
|
var r7;
|
|
var r0;
|
|
var Array;
|
|
var isArray;
|
|
var value5;
|
|
var moduleValue;
|
|
var headers;
|
|
let value = a3;
|
|
let Object = global.Object;
|
|
let assign = Object.assign;
|
|
const binding = env0_4;
|
|
let r6 = value && value.include;
|
|
value = Reflect.apply(assign, Object, [{}, binding, r6]);
|
|
let request = value.request;
|
|
if (request) {
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
request = value.request;
|
|
r6 = Reflect.apply(isArray, Array, [request]) ? env0_3(value.request) : [].concat(env0_5);
|
|
if (value.ip) {
|
|
r6.push('ip');
|
|
}
|
|
value5 = extractNormalizedRequestData(a1, {include: r6});
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
request = a0.request;
|
|
a0.request = Reflect.apply(assign, Object, [{}, request, value5]);
|
|
}
|
|
const user = value.user;
|
|
if (user) {
|
|
if (a2.user) {
|
|
moduleValue = require(7376) /* metro dependency 7376 */;
|
|
r7 = moduleValue.isPlainObject(a2.user) ? extractUserData(a2.user, value.user) : {};
|
|
} else {
|
|
r7 = {};
|
|
}
|
|
Object = global.Object;
|
|
if (Object.keys(r7).length) {
|
|
Object = global.Object;
|
|
a0.user = Object.assign({}, r7, a0.user);
|
|
}
|
|
}
|
|
if (value.ip) {
|
|
headers = a1.headers;
|
|
if (headers) {
|
|
value = require(7452) /* metro dependency 7452 */;
|
|
value = value.getClientIPAddress(a1.headers);
|
|
r0 = value;
|
|
} else {
|
|
r0 = headers;
|
|
}
|
|
r0 = !r0 ? a2.ipAddress : r0;
|
|
if (r0) {
|
|
Object = global.Object;
|
|
a0.user = Object.assign({}, a0.user, {ip_address: r0});
|
|
}
|
|
}
|
|
}
|
|
|
|
function addRequestDataToEvent(a0, a1, a2) { // fn#60108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:3429, offset: 0x016fbf02, size: 476 bytes, params: 4, frame: 20
|
|
var r6;
|
|
var r1;
|
|
var Array;
|
|
var isArray;
|
|
var value5;
|
|
var moduleValue;
|
|
var headers;
|
|
let value = a2;
|
|
let Object = global.Object;
|
|
let assign = Object.assign;
|
|
const binding = env0_4;
|
|
let r5 = value && value.include;
|
|
value = Reflect.apply(assign, Object, [{}, binding, r5]);
|
|
let request = value.request;
|
|
if (request) {
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
request = value.request;
|
|
r5 = Reflect.apply(isArray, Array, [request]) ? env0_3(value.request) : [].concat(env0_5);
|
|
if (value.ip) {
|
|
r5.push('ip');
|
|
}
|
|
value5 = extractRequestData(a1, {include: r5});
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
request = a0.request;
|
|
a0.request = Reflect.apply(assign, Object, [{}, request, value5]);
|
|
}
|
|
const user = value.user;
|
|
if (user) {
|
|
if (a1.user) {
|
|
moduleValue = require(7376) /* metro dependency 7376 */;
|
|
r6 = moduleValue.isPlainObject(a1.user) ? extractUserData(a1.user, value.user) : {};
|
|
} else {
|
|
r6 = {};
|
|
}
|
|
Object = global.Object;
|
|
if (Object.keys(r6).length) {
|
|
Object = global.Object;
|
|
a0.user = Object.assign({}, a0.user, r6);
|
|
}
|
|
}
|
|
if (value.ip) {
|
|
headers = a1.headers;
|
|
if (headers) {
|
|
value = require(7452) /* metro dependency 7452 */;
|
|
value = value.getClientIPAddress(a1.headers);
|
|
r1 = value;
|
|
} else {
|
|
r1 = headers;
|
|
}
|
|
r1 = !r1 ? a1.ip : r1;
|
|
r1 = !r1 ? a1.socket && a1.socket.remoteAddress : r1;
|
|
if (r1) {
|
|
Object = global.Object;
|
|
a0.user = Object.assign({}, a0.user, {ip_address: r1});
|
|
}
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function extractPathForTransaction(a0) { // fn#60109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:4019, offset: 0x016fc0de, size: 331 bytes, params: 2, frame: 20
|
|
var r6;
|
|
var baseUrl;
|
|
var r5;
|
|
var r1;
|
|
var r3;
|
|
var value;
|
|
var value2;
|
|
var moduleValue;
|
|
var stripUrlQueryAndFragment;
|
|
const r2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
let r0 = a0.method && a0.method.toUpperCase();
|
|
let customRoute = r2.customRoute;
|
|
if (customRoute) {
|
|
customRoute = r2.customRoute;
|
|
if (customRoute) {
|
|
r5 = customRoute;
|
|
} else {
|
|
baseUrl = a0.baseUrl;
|
|
baseUrl = !baseUrl ? '' : baseUrl;
|
|
r5 = '' + baseUrl + (a0.route && a0.route.path);
|
|
}
|
|
r1 = 'route';
|
|
r3 = r5;
|
|
} else if (a0.route) {
|
|
customRoute = r2.customRoute;
|
|
if (customRoute) {
|
|
r5 = customRoute;
|
|
} else {
|
|
baseUrl = a0.baseUrl;
|
|
baseUrl = !baseUrl ? '' : baseUrl;
|
|
r5 = '' + baseUrl + (a0.route && a0.route.path);
|
|
}
|
|
r1 = 'route';
|
|
r3 = r5;
|
|
} else {
|
|
r6 = a0.originalUrl || a0.url;
|
|
value = '';
|
|
value2 = 'url';
|
|
if (r6) {
|
|
moduleValue = require(7451) /* metro dependency 7451 */;
|
|
stripUrlQueryAndFragment = moduleValue.stripUrlQueryAndFragment;
|
|
r6 = a0.originalUrl || a0.url;
|
|
r6 = !r6 ? value : r6;
|
|
value = Reflect.apply(stripUrlQueryAndFragment, moduleValue, [r6]);
|
|
r1 = value2;
|
|
r3 = value;
|
|
} else {
|
|
r1 = value2;
|
|
r3 = value;
|
|
}
|
|
}
|
|
r5 = r2.method && r0 ? String(r0) : '';
|
|
r0 = r2.method && r2.path ? r5 + ' ' : r5;
|
|
return [r2.path && r3 ? r0 + r3 : r0, r1];
|
|
}
|
|
|
|
function httpRequestToRequestData_60110(a0) { // fn#60110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:4594, offset: 0x016fc229, size: 243 bytes, params: 2, frame: 22
|
|
const r7 = a0.headers || ({});
|
|
let host = r7.host;
|
|
host = !host ? '<no host>' : host;
|
|
const r3 = a0.socket && a0.socket.encrypted ? 'https' : 'http';
|
|
let url = a0.url;
|
|
url = !url ? '' : url;
|
|
const r10 = url.startsWith(r3) ? url : '' + r3 + '://' + host + url;
|
|
let body = a0.body;
|
|
body = !body ? undefined : body;
|
|
const cookies = a0.cookies;
|
|
const moduleValue = require(7375) /* metro dependency 7375 */;
|
|
const dropUndefinedKeys = moduleValue.dropUndefinedKeys;
|
|
const object2 = {url: r10};
|
|
object2.method = a0.method;
|
|
object2.query_string = extractQueryParamsFromUrl_60104(url);
|
|
object2.headers = headersToDict_60102(r7);
|
|
object2.cookies = cookies;
|
|
object2.data = body;
|
|
return Reflect.apply(dropUndefinedKeys, moduleValue, [object2]);
|
|
}
|
|
|
|
function _fun60096(a0) { // fn#60096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:304, offset: 0x016fb55d, size: 44 bytes, params: 2, frame: 4
|
|
if (env0_0 && a0 in env0_0) {
|
|
env0_1[a0] = env0_0[a0];
|
|
}
|
|
}
|
|
|
|
function _fun60098(a0) { // fn#60098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:691, offset: 0x016fb69a, size: 848 bytes, params: 2, frame: 19
|
|
var environment;
|
|
var r2;
|
|
var r1;
|
|
var r3;
|
|
var r0;
|
|
var hasOwnProperty;
|
|
var value;
|
|
var binding;
|
|
var body;
|
|
var value2;
|
|
var moduleValue;
|
|
var moduleValue2;
|
|
var moduleValue3;
|
|
var JSON;
|
|
var stringify;
|
|
var moduleValue4;
|
|
var binding2;
|
|
var query;
|
|
var URL;
|
|
var prototype;
|
|
var value8;
|
|
var uRL;
|
|
var value9;
|
|
var search;
|
|
var value10;
|
|
var length;
|
|
var error;
|
|
var cookies;
|
|
var cookie;
|
|
var value11;
|
|
var moduleValue5;
|
|
var includes;
|
|
if (a0 === 'headers') {
|
|
binding = env0_2;
|
|
binding.headers = env0_3;
|
|
binding = env0_1;
|
|
includes = binding.includes;
|
|
if (!Reflect.apply(includes, binding, ['cookies'])) {
|
|
delete env0_2.headers.cookie;
|
|
}
|
|
binding = env0_1;
|
|
includes = binding.includes;
|
|
if (!Reflect.apply(includes, binding, ['ip'])) {
|
|
value = environment.__proto__;
|
|
(require(7452) /* metro dependency 7452 */).ipHeaderNames.forEach(_fun60099);
|
|
}
|
|
} else if (a0 === 'method') {
|
|
env0_2.method = method;
|
|
} else if (a0 === 'url') {
|
|
env0_2.url = env0_5;
|
|
} else if (a0 === 'cookies') {
|
|
binding = env0_2;
|
|
cookies = env0_0.cookies;
|
|
if (cookies) {
|
|
r0 = cookies;
|
|
} else {
|
|
cookie = env0_3.cookie;
|
|
if (cookie) {
|
|
value11 = environment.__proto__;
|
|
moduleValue5 = require(7453) /* metro dependency 7453 */;
|
|
r2 = moduleValue5.parseCookie(env0_3.cookie);
|
|
} else {
|
|
r2 = cookie;
|
|
}
|
|
r0 = r2;
|
|
}
|
|
r0 = !r0 ? {} : r0;
|
|
binding.cookies = r0;
|
|
} else if (a0 === 'query_string') {
|
|
binding = env0_2;
|
|
binding2 = env0_0;
|
|
value = undefined;
|
|
r3 = binding2.originalUrl || binding2.url;
|
|
r3 = !r3 ? '' : r3;
|
|
if (r3) {
|
|
try {
|
|
query = binding2.query;
|
|
if (query) {
|
|
r3 = query;
|
|
} else {
|
|
URL = global.URL;
|
|
prototype = URL.prototype;
|
|
value8 = Object.create(prototype, {constructor: {value: URL}});
|
|
uRL = new URL(r3.startsWith('/') ? 'http://dogs.are.great' + r3 : r3);
|
|
value9 = uRL instanceof Object ? uRL : value8;
|
|
search = value9.search;
|
|
value10 = search.slice(1);
|
|
r3 = value10;
|
|
}
|
|
length = r3.length;
|
|
r3 = !length ? value : r3;
|
|
r0 = r3;
|
|
} catch (error) {
|
|
r0 = value;
|
|
}
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
binding.query_string = r0;
|
|
} else if (a0 === 'data') {
|
|
if (method !== 'GET') {
|
|
if (method !== 'HEAD') {
|
|
body = env0_0.body;
|
|
if (body !== undefined) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(7376) /* metro dependency 7376 */;
|
|
if (moduleValue.isString(body)) {
|
|
r1 = body;
|
|
} else {
|
|
moduleValue2 = require(7376) /* metro dependency 7376 */;
|
|
if (moduleValue2.isPlainObject(body)) {
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
moduleValue4 = require(7414) /* metro dependency 7414 */;
|
|
r2 = Reflect.apply(stringify, JSON, [moduleValue4.normalize(body)]);
|
|
} else {
|
|
moduleValue3 = require(7378) /* metro dependency 7378 */;
|
|
r2 = moduleValue3.truncate('' + body, 1024);
|
|
}
|
|
r1 = r2;
|
|
}
|
|
if (r1) {
|
|
env0_2.data = r1;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
hasOwnProperty = ({}).hasOwnProperty;
|
|
if (hasOwnProperty.call(env0_0, a0)) {
|
|
env0_2[a0] = env0_0[a0];
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun60103(a0) { // fn#60103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:1884, offset: 0x016fbb08, size: 58 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__;
|
|
value = env1_2(a0, 2);
|
|
const property = value[0];
|
|
const property2 = value[1];
|
|
if (typeof property2 === 'string') {
|
|
env0_0[property] = property2;
|
|
}
|
|
}
|
|
|
|
function extractNormalizedRequestData(a0, {include}) { // fn#60106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:2505, owner: addNormalizedRequestDataToEvent.extractNormalizedRequestData, offset: 0x016fbd66, size: 412 bytes, params: 3, frame: 19
|
|
var environment;
|
|
var r3;
|
|
var r2;
|
|
var value2;
|
|
var cookies;
|
|
var value3;
|
|
var value4;
|
|
var moduleValue;
|
|
const r4 = include ? global.Array.isArray(include) ? include : env1_5 : [];
|
|
const object2 = {};
|
|
const Object = global.Object;
|
|
let value = Object.assign({}, a0.headers);
|
|
let includes = r4.includes;
|
|
if (Reflect.apply(includes, r4, ['headers'])) {
|
|
object2.headers = value;
|
|
includes = include.includes;
|
|
if (!Reflect.apply(includes, include, ['cookies'])) {
|
|
delete value.cookie;
|
|
}
|
|
includes = include.includes;
|
|
if (!Reflect.apply(includes, include, ['ip'])) {
|
|
value2 = environment.__proto__;
|
|
(require(7452) /* metro dependency 7452 */).ipHeaderNames.forEach(_fun60107);
|
|
}
|
|
}
|
|
if (r4.includes('method')) {
|
|
object2.method = a0.method;
|
|
}
|
|
if (r4.includes('url')) {
|
|
object2.url = a0.url;
|
|
}
|
|
if (r4.includes('cookies')) {
|
|
cookies = a0.cookies;
|
|
if (cookies) {
|
|
r2 = cookies;
|
|
} else {
|
|
value3 = undefined;
|
|
if (value) {
|
|
if (value.cookie) {
|
|
value4 = environment.__proto__;
|
|
moduleValue = require(7453) /* metro dependency 7453 */;
|
|
value = moduleValue.parseCookie(value.cookie);
|
|
r3 = value;
|
|
} else {
|
|
r3 = value3;
|
|
}
|
|
} else {
|
|
r3 = value3;
|
|
}
|
|
r2 = r3;
|
|
}
|
|
r2 = !r2 ? {} : r2;
|
|
object2.cookies = r2;
|
|
}
|
|
if (r4.includes('query_string')) {
|
|
object2.query_string = a0.query_string;
|
|
}
|
|
if (r4.includes('data')) {
|
|
object2.data = a0.data;
|
|
}
|
|
return object2;
|
|
}
|
|
|
|
function _fun60099(a0) { // fn#60099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7628:835, offset: 0x016fb9ea, size: 24 bytes, params: 2, frame: 2
|
|
delete env1_2.headers[a0];
|
|
}
|
|
|