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

420 lines
17 KiB
React

/* Metro module 4772; source: unknown; dependencies: [4731, 4773] */
function _fun41239(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#41239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:6, offset: 0x01118eeb, size: 177 bytes, params: 8, frame: 17
const env0_0 = require;
const closure = parseTags_41241;
const sliceToString = function(a0) {
var fromCharCode = global.String.fromCharCode;
var Uint8Array = global.Uint8Array;
return fromCharCode.apply(null, new Uint8Array(a0));
};
const addTag = function(a0, a1, a2) {
if (require(dependencyMap[1]).iccTags[a1]) {
a0[require(dependencyMap[1]).iccTags[a1].name] = {value: a2, description: a2};
} else {
a0[a1] = {value: a2, description: a2};
}
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
exports.default = {read: read_41244};
exports.parseTags = closure;
}
function hasTagsData({length}, a1) { // fn#41240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:1139, offset: 0x01118f9c, size: 28 bytes, params: 3, frame: 3
return length < a1 + env0_8;
}
function parseTags_41241(a0) { // fn#41241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:1185, offset: 0x01118fb8, size: 1308 bytes, params: 2, frame: 64
var r3;
var r7;
var r10;
var r21;
var r45;
var r46;
var r48;
var property;
var property2;
var value4;
var parseInt;
var value5;
var description;
var value6;
var name;
var value7;
var moduleValue;
var getStringFromDataView;
var value11;
var value12;
var value13;
var moduleValue2;
var value14;
var addTagBinding;
var value15;
var value16;
var value17;
var value18;
var value19;
var items2;
var moduleValue3;
var value20;
var moduleValue4;
var value21;
var value22;
var value23;
var moduleValue5;
var getUnicodeStringFromDataView;
var value24;
var push;
var value25;
var value26;
var object2;
var languageCode;
var countryCode;
var HermesInternal;
var concat;
var value27;
var text;
var value28;
var value29;
var value30;
var value31;
var value32;
const buffer = a0.buffer;
if (a0.byteLength !== a0.getUint32()) {
throw new global.Error('ICC profile length not matching');
}
if (a0.byteLength < env0_2) {
throw new global.Error('ICC profile too short');
}
const object3 = {};
const Object = global.Object;
const keys = Object.keys;
const iccProfile = (require(4773) /* metro dependency 4773 */).iccProfile;
const value2 = Reflect.apply(keys, Object, [iccProfile]);
let length = value2.length;
const value3 = 0;
if (value3 < length) {
r3 = value3;
reducibleLoop3: while (true) {
property = value2[r3];
property2 = iccProfile[property];
value4 = property2.value;
parseInt = global.parseInt;
value5 = Reflect.apply(value4, property2, [a0, parseInt(property, 10)]);
description = property2.description;
reducibleJoin5: while (true) {
if (description) {
description = property2.description;
value6 = Reflect.apply(description, property2, [value5]);
r7 = value6;
break reducibleJoin5;
}
r7 = value5;
break reducibleJoin5;
}
name = property2.name;
object3[name] = {value: value5, description: r7};
value7 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
length = value2.length;
if (value7 < length) {
r3 = value7;
continue reducibleLoop3;
}
break reducibleLoop3;
}
}
let sliceToStringBinding = sliceToString;
let slice = buffer.slice;
if (sliceToStringBinding(Reflect.apply(slice, buffer, [36, 40])) !== env0_3) {
throw new global.Error('ICC profile: missing signature');
}
length = buffer.length;
const value9 = 132;
if (!(length < value9)) {
var uint32 = a0.getUint32(128);
if (value3 < uint32) {
r10 = value3;
r21 = value9;
reducibleLoop9: while (true) {
if (hasTagsData(buffer, r21)) {
return object3;
}
moduleValue = require(dependencyMap[value3]);
getStringFromDataView = moduleValue.getStringFromDataView;
value11 = Reflect.apply(getStringFromDataView, moduleValue, [a0, r21, 4]);
getUint32 = a0.getUint32;
value12 = Reflect.apply(getUint32, a0, [r21 + 4]);
getUint32 = a0.getUint32;
value13 = Reflect.apply(getUint32, a0, [r21 + 8]);
length = buffer.length;
if (value12 > length) {
return object3;
}
moduleValue2 = require(dependencyMap[value3]);
getStringFromDataView = moduleValue2.getStringFromDataView;
value14 = Reflect.apply(getStringFromDataView, moduleValue2, [a0, value12, 4]);
if (value14 === env0_4) {
getUint32 = a0.getUint32;
value29 = Reflect.apply(getUint32, a0, [value12 + 8]);
if (value29 > value13) {
return object3;
}
addTagBinding = addTag;
sliceToStringBinding = sliceToString;
slice = buffer.slice;
value30 = value12 + 12;
addTagBinding(object3, value11, sliceToStringBinding(Reflect.apply(slice, buffer, [value30,
value12 + value29 + 11])));
} else if (value14 === env0_5) {
getUint32 = a0.getUint32;
value17 = Reflect.apply(getUint32, a0, [value12 + 8]);
getUint32 = a0.getUint32;
value18 = Reflect.apply(getUint32, a0, [value12 + 12]);
value19 = value12 + 16;
items2 = [];
if (value3 < value17) {
r45 = value3;
r46 = value19;
reducibleLoop18: while (true) {
moduleValue3 = require(dependencyMap[value3]);
getStringFromDataView = moduleValue3.getStringFromDataView;
value20 = Reflect.apply(getStringFromDataView, moduleValue3, [a0, r46 + value3, 2]);
moduleValue4 = require(dependencyMap[value3]);
getStringFromDataView = moduleValue4.getStringFromDataView;
value21 = Reflect.apply(getStringFromDataView, moduleValue4, [a0, r46 + 2, 2]);
getUint32 = a0.getUint32;
value22 = Reflect.apply(getUint32, a0, [r46 + 4]);
getUint32 = a0.getUint32;
value23 = Reflect.apply(getUint32, a0, [r46 + 8]);
moduleValue5 = require(dependencyMap[value3]);
getUnicodeStringFromDataView = moduleValue5.getUnicodeStringFromDataView;
value24 = Reflect.apply(getUnicodeStringFromDataView, moduleValue5, [a0, value12 + value23,
value22]);
push = items2.push;
Reflect.apply(push, items2, [{languageCode: value20, countryCode: value21, text: value24}]);
value25 = r46 + value18;
value26 = typeof r45 === 'bigint' ? r45 + 1n : +r45 + 1;
if (value26 < value17) {
r45 = value26;
r46 = value25;
continue reducibleLoop18;
}
break reducibleLoop18;
}
}
if (value17 === 1) {
addTagBinding = addTag;
text = items2[value3].text;
addTagBinding(object3, value11, text);
} else {
object2 = {};
length = items2.length;
if (value3 < length) {
r48 = value3;
reducibleLoop21: while (true) {
languageCode = items2[r48].languageCode;
countryCode = items2[r48].countryCode;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
value27 = '' + languageCode + '-' + countryCode;
text = items2[r48].text;
object2[value27] = text;
value28 = typeof r48 === 'bigint' ? r48 + 1n : +r48 + 1;
length = items2.length;
if (value28 < length) {
r48 = value28;
continue reducibleLoop21;
}
break reducibleLoop21;
}
}
addTag(object3, value11, object2);
}
} else if (value14 === env0_6) {
addTagBinding = addTag;
sliceToStringBinding = sliceToString;
slice = buffer.slice;
value16 = value12 + 8;
addTagBinding(object3, value11, sliceToStringBinding(Reflect.apply(slice, buffer, [value16,
value12 + value13 - 7])));
} else {
reducibleJoin26: while (true) {
if (value14 !== env0_7) {
break reducibleJoin26;
}
addTagBinding = addTag;
sliceToStringBinding = sliceToString;
slice = buffer.slice;
value15 = value12 + 8;
addTagBinding(object3, value11, sliceToStringBinding(Reflect.apply(slice, buffer, [value15,
value12 + 12])));
break reducibleJoin26;
}
}
value31 = r21 + 12;
value32 = typeof r10 === 'bigint' ? r10 + 1n : +r10 + 1;
if (!(value32 < uint32)) {
return object3;
}
r10 = value32;
r21 = value31;
continue reducibleLoop9;
}
}
}
return object3;
}
function read_41244(a0, a1, a2) { // fn#41244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:106, offset: 0x0111957d, size: 86 bytes, params: 4, frame: 16
if (a2) {
if (a1[0].compressionMethod !== (require(4731) /* metro dependency 4731 */).COMPRESSION_METHOD_NONE) {
return readCompressedIcc(a0, a1);
}
}
return readIcc(a0, a1);
}
function readCompressedIcc(a0, a1) { // fn#41245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:197, owner: read_41244.readCompressedIcc, offset: 0x011195d3, size: 221 bytes, params: 3, frame: 21
var environment;
var DataView;
var buffer;
var value2;
var dataView;
var moduleValue;
var value5;
const compressionMethod = a1[0].compressionMethod;
const value = environment.__proto__;
const COMPRESSION_METHOD_DEFLATE = (require(4731) /* metro dependency 4731 */).COMPRESSION_METHOD_DEFLATE;
if (compressionMethod === COMPRESSION_METHOD_DEFLATE) {
DataView = global.DataView;
buffer = a0.buffer;
value2 = buffer.slice(a1[0].offset, a1[0].offset + a1[0].length);
dataView = new DataView();
moduleValue = require(4731) /* metro dependency 4731 */;
value5 = moduleValue.decompress(dataView, a1[0].compressionMethod, 'utf-8', 'dataview');
return value5.then(parseTags_41241).catch(function() {
return {};
});
}
return {};
}
function readIcc(a0, a1) { // fn#41247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:556, owner: read_41244.readIcc, offset: 0x011196b0, size: 273 bytes, params: 3, frame: 22
var environment;
var buffer;
var r7;
var closure;
var value;
var Uint8Array;
var prototype;
var value2;
var uint8Array;
var Array;
var isArray2;
var DataView;
var value3;
var dataView;
var value6;
var length;
var value7;
var value8;
var value9;
var value10;
var parseTags_41241Binding;
var error;
const env0_0 = a1;
try {
closure = function(a0, a1) {
return a0 + a1.length;
};
value = a1.reduce(closure, 0);
Uint8Array = global.Uint8Array;
prototype = Uint8Array.prototype;
value2 = Object.create(prototype, {constructor: {value: Uint8Array}});
uint8Array = new Uint8Array();
value = uint8Array instanceof Object ? uint8Array : value2;
var env0_1 = value;
var env0_2 = 0;
Array = global.Array;
isArray2 = Array.isArray(a0);
if (isArray2) {
DataView = global.DataView;
Uint8Array = global.Uint8Array;
value3 = Uint8Array.from(a0);
buffer = value3.buffer;
buffer = new DataView().buffer;
} else {
buffer = a0.buffer;
}
var env0_3 = buffer;
closure = readIcc_loop;
value6 = 1;
length = a1.length;
value7 = value6 <= length;
if (value7) {
r7 = value6;
while (true) {
closure(r7);
value8 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
length = a1.length;
value9 = value8 <= length;
if (value9) {
r7 = value8;
continue;
}
break;
}
}
value10 = environment.__proto__;
parseTags_41241Binding = parseTags_41241;
DataView = global.DataView;
buffer = value.buffer;
prototype = DataView.prototype;
value = Object.create(prototype, {constructor: {value: DataView}});
dataView = new DataView();
value = dataView instanceof Object ? dataView : value;
value = parseTags_41241Binding(value);
} catch (error) {
return {};
}
return value;
}
function readIcc_loop(a0) { // fn#41249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:783, owner: read_41244.readIcc._loop, offset: 0x011197c1, size: 198 bytes, params: 2, frame: 16
var bufferBinding;
var slice;
var offset;
var offset2;
var length;
var value4;
var uint8Array;
var binding;
const env0_0 = a0;
const value2 = require.find(_fun41250);
if (value2) {
bufferBinding = buffer;
slice = bufferBinding.slice;
offset = value2.offset;
offset2 = value2.offset;
length = value2.length;
value4 = Reflect.apply(slice, bufferBinding, [offset, offset2 + length]);
uint8Array = new global.Uint8Array();
binding = env0_1;
binding.set(uint8Array, env0_2);
binding = env0_2;
length = uint8Array.length;
env0_2 = binding + length;
return undefined;
}
const Error = global.Error;
const value = 'ICC chunk ' + a0 + ' not found';
const value3 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value3;
}
function _fun41250({chunkNumber}) { // fn#41250, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4950:815, offset: 0x01119887, size: 22 bytes, params: 2, frame: 2
return chunkNumber === env0_0;
}