Files
discord-decomp/sources/by-id/module-00956.jsx
T
2026-07-27 16:20:00 +03:00

287 lines
10 KiB
React

/* Metro module 956; source: unknown; dependencies: [65, 831, 832, 833, 955] */
function _fun10105(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#10105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1083:6, offset: 0x00d7d1f8, size: 171 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = function(a0) {
wrapMethodHandler(a0, 'tool');
};
const closure2 = function(a0) {
wrapMethodHandler(a0, 'resource');
};
const closure3 = function(a0) {
wrapMethodHandler(a0, 'prompt');
};
const env0_2 = require(65) /* metro dependency 65 */;
const Object = global.Object;
const defineProperty = Object.defineProperty;
const Symbol = global.Symbol;
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
exports.wrapAllMCPHandlers = function(a0) {
wrapToolHandlers(a0);
wrapResourceHandlers(a0);
wrapPromptHandlers(a0);
};
exports.wrapPromptHandlers = closure3;
exports.wrapResourceHandlers = closure2;
exports.wrapToolHandlers = closure;
}
function wrapMethodHandler(a0, a1) { // fn#10106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1083:44, offset: 0x00d7d2a3, size: 57 bytes, params: 3, frame: 16
let env0_0 = a1;
(require(831) /* metro dependency 831 */).fill(a0, a1, function(a0) {
var env0_0 = a0;
return _fun10108;
});
}
function createErrorCapturingHandler(a0, a1, a2, a3) { // fn#10111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1083:665, offset: 0x00d7d4e8, size: 149 bytes, params: 5, frame: 19
var environment;
var r0;
var value;
var value2;
var then;
var value3;
var Promise;
var closure;
var error;
const env0_0 = a1;
const env0_1 = a2;
try {
value = a0.apply(this, a3);
if (value) {
value2 = typeof value !== 'object';
if (value2) {
r0 = value;
} else {
then = value.then;
value3 = typeof then === 'function';
if (value3) {
Promise = global.Promise;
value = Promise.resolve(value);
closure = function(a0) {
captureHandlerError(a0, require, importDefault);
throw a0;
};
value = value.catch(closure);
r0 = value;
} else {
r0 = value;
}
}
} else {
r0 = value;
}
} catch (error) {
value = environment;
captureHandlerError(error, a1, a2);
throw error;
}
return r0;
}
function captureHandlerError(a0, a1, a2) { // fn#10113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1083:916, offset: 0x00d7d59d, size: 492 bytes, params: 4, frame: 19
var object2;
var value;
var property;
var name;
var message;
var error;
try {
object2 = {};
value = a1 === 'tool';
if (value) {
object2.tool_name = a2;
name = a0.name;
value = name === 'ProtocolValidationError';
if (value) {
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'validation', object2);
} else {
message = a0.message;
value = message.includes('validation');
if (value) {
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'validation', object2);
} else {
message = a0.message;
value = message.includes('protocol');
if (value) {
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'validation', object2);
} else {
name = a0.name;
value = name === 'ServerTimeoutError';
if (value) {
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'timeout', object2);
} else {
message = a0.message;
value = message.includes('timed out');
if (value) {
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'timeout', object2);
} else {
message = a0.message;
value = message.includes('timeout');
if (value) {
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'timeout', object2);
} else {
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'tool_execution', object2);
}
}
}
}
}
}
} else {
value = a1 === 'resource';
if (value) {
object2.resource_uri = a2;
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'resource_execution', object2);
} else {
value = a1 !== 'prompt';
if (!value) {
object2.prompt_name = a2;
value = environment;
property = dependencyMap[4];
value = require(property);
value.captureError(a0, 'prompt_execution', object2);
}
}
}
} catch (error) {
}
}
function _fun10107(a0) { // fn#10107, offset: 0x00d7d2dc, size: 16 bytes, params: 2, frame: 2
const env0_0 = a0;
return _fun10108;
}
function _fun10108(a0) { // fn#10108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1083:113, offset: 0x00d7d2ec, size: 267 bytes, params: 2, frame: 24
var environment;
var r1;
var value4;
var value7;
var value8;
var binding;
var call;
var items2;
let value = arguments.length;
const Array = global.Array;
const value2 = 1;
const value3 = 0;
reducibleJoin2: while (true) {
if (value > value2) {
value4 = value - value2;
r1 = value4;
break reducibleJoin2;
}
r1 = value3;
break reducibleJoin2;
}
const array = new Array();
if (value2 < value) {
r1 = value2;
reducibleLoop3: while (true) {
value7 = r1 - value2;
array[value7] = arguments[r1];
value8 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
if (value8 < value) {
r1 = value8;
continue reducibleLoop3;
}
break reducibleLoop3;
}
}
const property = array[array.length - value2];
if (typeof property !== 'function') {
binding = env0_0;
call = binding.call;
items2 = [this, a0];
return call.apply(binding, items2.concat(array));
}
value = environment.__proto__;
value = ((a0, a1, a2) => {
var env0_0 = a0;
var env0_1 = a1;
var env0_2 = a2;
return _fun10110;
})(property, require, a0);
binding = env0_0;
call = binding.call;
items2 = [this, a0];
return call.apply(binding, items2.concat(env2_2(array.slice(value3, -1)), [value]));
}
function createWrappedHandler(a0, a1, a2) { // fn#10109, offset: 0x00d7d3f7, size: 30 bytes, params: 4, frame: 2
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return _fun10110;
}
function _fun10110() { // fn#10110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1083:343, offset: 0x00d7d415, size: 211 bytes, params: 1, frame: 22
var r2;
var value5;
var createErrorCapturingHandlerBinding;
var call;
var value6;
var binding;
var value7;
var error;
var DEBUG_BUILD;
var debug;
let value = arguments.length;
const Array = global.Array;
const array = new Array(value);
const value4 = 0;
if (value4 < value) {
for (r2 = value4; true; r2 = value5) {
array[r2] = arguments[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (!(value5 < value)) {
break;
}
}
}
try {
value = environment.__proto__.__proto__.__proto__.__proto__;
createErrorCapturingHandlerBinding = createErrorCapturingHandler;
call = createErrorCapturingHandlerBinding.call;
value6 = environment;
binding = env0_0;
value7 = Reflect.apply(call, createErrorCapturingHandlerBinding, [this, binding, require, importDefault,
array]);
} catch (error) {
DEBUG_BUILD = (require(832) /* metro dependency 832 */).DEBUG_BUILD;
if (DEBUG_BUILD) {
debug = (require(833) /* metro dependency 833 */).debug;
debug.warn('MCP handler wrapping failed:', error);
}
value = environment;
binding = env0_0;
return binding.apply(this, array);
}
return value7;
}