Files
2026-07-28 01:06:53 +03:00

486 lines
21 KiB
JavaScript

/* Metro module 915; source: unknown; dependencies: [57] */
import * as Module00057Module from './module-00057.js'; /* Metro dependency 57 */
function _fun9803(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:6, offset: 0x00d72870, size: 198 bytes, params: 8, frame: 21
let closure = function(a0) {
var closure;
var error;
try {
closure = _fun9805;
a0.forEach(closure);
} catch (error) {
}
return {};
};
const closure2 = function(a0) {
var value2;
var closure;
var error;
var property = global.Object;
var value = property.create(null);
var env0_0 = value;
try {
property = global.Object;
value2 = property.entries(a0);
closure = _fun9807;
value2.forEach(closure);
} catch (error) {
}
return value;
};
const normalizeAttributeKey = function(a0) {
return a0.replace(RegExp('-', 'g'), '_');
};
const addSpanAttribute = function(a0, a1, a2, a3, a4) {
var r3;
var value = a1;
var value2 = a2;
var normalizeAttributeKeyBinding = normalizeAttributeKey;
var value4 = normalizeAttributeKeyBinding(value);
r3 = value2 ? 'http.request.header.' + value4 + '.' + normalizeAttributeKeyBinding(value2) : 'http.request.header.' + value4;
value = _fun9810(value2 || value, a3, a4);
if (value !== undefined) {
a0[r3] = value;
}
};
const closure3 = 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://s.io');
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;
};
let env0_0 = Module00057Module;
const Object = global.Object;
const defineProperty = Object.defineProperty;
const Symbol = global.Symbol;
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
const env0_1 = ['auth', 'token', 'secret', 'session', 'password', 'passwd', 'pwd', 'key', 'jwt', 'bearer', 'sso',
'saml', 'csrf', 'xsrf', 'credentials', 'set-cookie', 'cookie'];
const env0_2 = ['x-forwarded-', '-user'];
exports.extractQueryParamsFromUrl = closure3;
exports.headersToDict = closure2;
exports.httpHeadersToSpanAttributes = function(a0) {
var r6;
var r3;
var property;
var closure;
var error;
var value = arguments.length > 1;
if (value) {
value = arguments[1] !== undefined;
r6 = value;
} else {
r6 = value;
}
if (r6) {
value = arguments[1];
r3 = value;
} else {
r3 = r6;
}
var env0_0 = r3;
try {
property = global.Object;
value = property.entries(a0);
closure = _fun9816;
value.forEach(closure);
} catch (error) {
}
return {};
};
exports.httpRequestToRequestData = httpRequestToRequestData;
exports.winterCGHeadersToDict = closure;
exports.winterCGRequestToRequestData = function(a0) {
var value2 = winterCGHeadersToDict(a0.headers);
var object = {method: a0.method, url: a0.url};
object.query_string = extractQueryParamsFromUrl(a0.url);
object.headers = value2;
return object;
};
function winterCGHeadersToDict(a0) { // fn#9804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:44, offset: 0x00d72936, size: 38 bytes, params: 2, frame: 13
var closure;
var error;
try {
closure = _fun9805;
a0.forEach(closure);
} catch (error) {
}
return {};
function _fun9805(a0, a1) { // fn#9805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:102, offset: 0x00d7295c, size: 32 bytes, params: 3, frame: 3
if (typeof a0 === 'string') {
env0_0[a1] = a0;
}
}
}
function headersToDict(a0) { // fn#9806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:167, offset: 0x00d7297c, size: 72 bytes, params: 2, frame: 15
var value2;
var closure;
var error;
let Object = global.Object;
const value = Object.create(null);
try {
Object = global.Object;
value2 = Object.entries(a0);
closure = _fun9807;
value2.forEach(closure);
} catch (error) {
}
return value;
function _fun9807(a0) { // fn#9807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:250, offset: 0x00d729c4, size: 58 bytes, params: 2, frame: 14
let value = environment.__proto__;
value = env1_0(a0, 2);
const property = value[0];
const property2 = value[1];
if (typeof property2 === 'string') {
env0_0[property] = property2;
}
}
}
function addSpanAttribute(a0, a1, a2, a3, a4) { // fn#9809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:641, offset: 0x00d72a20, size: 124 bytes, params: 6, frame: 19
let value = a1;
const value2 = a2;
const normalizeAttributeKeyBinding = normalizeAttributeKey;
const value4 = normalizeAttributeKeyBinding(value);
const r3 = value2 ? 'http.request.header.' + value4 + '.' + normalizeAttributeKeyBinding(value2) : 'http.request.header.' + value4;
value = handleHttpHeader(value2 || value, a3, a4);
if (value !== undefined) {
a0[r3] = value;
}
function handleHttpHeader(a0, a1, a2) { // fn#9810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:816, owner: addSpanAttribute.handleHttpHeader, offset: 0x00d72a9c, size: 162 bytes, params: 4, frame: 16
var environment;
var r1;
var items2;
const env0_0 = a0;
let value = environment.__proto__;
if (a2) {
r1 = env1_1.some(_fun9811);
} else {
items2 = [];
value = items2.concat(env1_2, env1_1);
value = value.some(_fun9812);
r1 = value;
}
if (r1) {
return '[Filtered]';
}
const Array = global.Array;
if (Array.isArray(a1)) {
return a1.map(function(a0) {
var r0;
var value = a0;
if (value == null) {
r0 = value;
} else {
value = (0, global.String)(value);
r0 = value;
}
return r0;
}).join(';');
}
if (typeof a1 === 'string') {
return a1;
}
function _fun9811(a0) { // fn#9811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:865, offset: 0x00d72b3e, size: 22 bytes, params: 2, frame: 11
return env0_0.includes(a0);
}
function _fun9812(a0) { // fn#9812, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:922, offset: 0x00d72b3e, size: 22 bytes, params: 2, frame: 11
return env0_0.includes(a0);
}
}
}
function httpHeadersToSpanAttributes(a0) { // fn#9815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:1388, offset: 0x00d72bce, size: 95 bytes, params: 2, frame: 17
var r6;
var Object;
var closure;
var error;
let value = arguments.length > 1;
if (value) {
value = arguments[1] !== undefined;
r6 = value;
} else {
r6 = value;
}
value = r6 ? arguments[1] : value;
try {
Object = global.Object;
value = Object.entries(a0);
closure = _fun9816;
value.forEach(closure);
} catch (error) {
}
return {};
function _fun9816(a0) { // fn#9816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:1526, offset: 0x00d72c2d, size: 393 bytes, params: 2, frame: 32
var r3;
var r1;
var r2;
var r14;
var r19;
var value;
var value2;
var property;
var property2;
var toLowerCase;
var value3;
var value4;
var addSpanAttributeBinding;
var binding;
var value5;
var indexOf;
var value6;
var substring;
var value7;
var split;
var value8;
var iterator;
var iterator2;
var value9;
var item;
var item2;
var value10;
var value11;
var value12;
var value13;
var value14;
var value15;
var value16;
var binding2;
var error;
exceptionSkip40: while (true) {
exceptionLanding40: while (true) {
value = environment.__proto__;
value2 = env1_0(a0, 2);
property = value2[0];
property2 = value2[1];
reducibleJoin41: while (true) {
if (property2 == null) {
break reducibleJoin41;
}
toLowerCase = property.toLowerCase;
value3 = Reflect.apply(toLowerCase, property, []);
if (value3 !== 'cookie') {
if (value3 !== 'set-cookie') {
addSpanAttributeBinding = addSpanAttribute;
value = environment;
binding = env0_1;
addSpanAttributeBinding(binding, value3, '', property2, env0_0);
break reducibleJoin41;
}
}
if (typeof property2 === 'string') {
value4 = '';
if (value4 !== property2) {
value5 = value3 === 'set-cookie';
indexOf = property2.indexOf;
value6 = Reflect.apply(indexOf, property2, [';']);
reducibleJoin9: while (true) {
if (value5) {
if (value6 === -1) {
r3 = property2;
break reducibleJoin9;
}
substring = property2.substring;
value7 = Reflect.apply(substring, property2, [0, value6]);
r3 = value7;
break reducibleJoin9;
}
r3 = property2;
break reducibleJoin9;
}
if (value5) {
r1 = [r3];
} else {
split = r3.split;
value8 = Reflect.apply(split, r3, ['; ']);
r1 = value8;
}
iterator = r1[Symbol.iterator]();
iterator2 = iterator.next;
value9 = environment;
r2 = iterator;
reducibleLoop13: while (true) {
item2 = Reflect.apply(iterator2, r2, []);
item = item2.value;
item2 = item2.done ? undefined : r2;
if (item2 === undefined) {
break reducibleJoin41;
}
try {
indexOf = item.indexOf;
} catch (error) {
break exceptionLanding40;
}
try {
value10 = Reflect.apply(indexOf, item, ['=']);
} catch (error) {
break exceptionLanding40;
}
try {
value11 = value10 !== -1;
} catch (error) {
break exceptionLanding40;
}
if (value11) {
try {
substring = item.substring;
} catch (error) {
break exceptionLanding40;
}
try {
value12 = Reflect.apply(substring, item, [0, value10]);
} catch (error) {
break exceptionLanding40;
}
r14 = value12;
} else {
r14 = item;
}
try {
value13 = value10 === -1;
} catch (error) {
break exceptionLanding40;
}
reducibleJoin31: while (true) {
if (value13) {
r19 = value4;
break reducibleJoin31;
}
try {
substring = item.substring;
} catch (error) {
break exceptionLanding40;
}
try {
value14 = value10 + 1;
} catch (error) {
break exceptionLanding40;
}
try {
value15 = Reflect.apply(substring, item, [value14]);
} catch (error) {
break exceptionLanding40;
}
r19 = value15;
break reducibleJoin31;
}
try {
toLowerCase = r14.toLowerCase;
} catch (error) {
break exceptionLanding40;
}
try {
value16 = Reflect.apply(toLowerCase, r14, []);
} catch (error) {
break exceptionLanding40;
}
try {
addSpanAttributeBinding = addSpanAttribute;
} catch (error) {
break exceptionLanding40;
}
try {
binding = env0_1;
} catch (error) {
break exceptionLanding40;
}
try {
binding2 = env0_0;
} catch (error) {
break exceptionLanding40;
}
try {
addSpanAttributeBinding(binding, value3, value16, r19, binding2);
} catch (error) {
break exceptionLanding40;
}
r2 = item2;
continue reducibleLoop13;
}
return undefined;
}
}
addSpanAttributeBinding = addSpanAttribute;
value = environment;
binding = env0_1;
addSpanAttributeBinding(binding, value3, '', property2, env0_0);
break reducibleJoin41;
}
return undefined;
break exceptionSkip40;
}
try {
item2.return();
} catch {
}
throw error;
break exceptionSkip40;
}
}
}
function httpRequestToRequestData(a0) { // fn#9817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1042:1983, offset: 0x00d72db6, size: 335 bytes, params: 2, frame: 22
var host;
const r5 = a0.headers || ({});
const value = undefined;
let r2 = typeof r5['x-forwarded-host'] !== 'string' ? value : r5['x-forwarded-host'];
if (!r2) {
host = r5.host;
host = typeof host !== 'string' ? value : r5.host;
r2 = host;
}
let r1 = typeof r5['x-forwarded-proto'] !== 'string' ? value : r5['x-forwarded-proto'];
r1 = !r1 ? a0.protocol : r1;
r1 = !r1 ? a0.socket != null && a0.socket.encrypted ? 'https' : 'http' : r1;
let url = a0.url;
url = !url ? '' : url;
let object = {url: url, host: r2, protocol: r1};
const url2 = object.url;
const protocol = object.protocol;
host = object.host;
const r6 = url2 == null ? url2 && host ? '' + protocol + '://' + host + url2 : value : url2.startsWith('http') ? url2 : url2 && host ? '' + protocol + '://' + host + url2 : value;
let body = a0.body;
body = !body ? value : body;
const cookies = a0.cookies;
object = {url: r6};
object.method = a0.method;
object.query_string = extractQueryParamsFromUrl(url);
object.headers = headersToDict(r5);
object.cookies = cookies;
object.data = body;
return object;
}
}
global.__d(_fun9803, 915, [57]) /* metro module 915, dependencies: [57] */;