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

230 lines
9.0 KiB
React

/* Metro module 4703; source: unknown; dependencies: [] */
function _fun40654(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:6, offset: 0x01107313, size: 181 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
exports.getFileChunk = undefined;
exports.fetchFromObject = undefined;
exports.findMatroskaDocTypeElements = undefined;
exports.isftypStringIncluded = undefined;
exports.isFlvStringIncluded = undefined;
exports.isFileContaineJfiforExifHeader = undefined;
exports.isAvifStringIncluded = undefined;
exports.isHeicSignatureIncluded = undefined;
exports.getFileChunk = getFileChunk;
exports.fetchFromObject = fetchFromObject;
exports.findMatroskaDocTypeElements = function(a0) {
var r0;
var value = a0.map(_fun40662);
value = value.join('');
var value2 = 'webm';
if (value.includes(value2)) {
r0 = value2;
} else {
value = value.includes('matroska');
r0 = value ? 'mkv' : undefined;
}
return r0;
};
exports.isftypStringIncluded = function(a0) {
var r3;
var r8;
var r2;
var value4;
var value5;
var items = [102, 116, 121, 112];
var property = a0.length;
var value = 0;
var value2 = true;
var value3 = false;
if (value < property - items.length) {
r3 = value;
while (true) {
if (value < items.length) {
r8 = value;
while (true) {
property = a0[r3 + r8];
if (property !== items[r8]) {
r2 = value3;
break;
}
value4 = typeof r8 === 'bigint' ? r8 + 1n : +r8 + 1;
if (value4 < items.length) {
r8 = value4;
continue;
}
r2 = value2;
break;
}
} else {
r2 = value2;
}
if (r2) {
return value2;
}
value5 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
property = a0.length;
if (value5 < property - items.length) {
r3 = value5;
continue;
}
break;
}
}
return value3;
};
exports.isFlvStringIncluded = function(a0) {
var value = a0.slice(0, 3);
var value3 = new global.TextDecoder();
value = new global.Uint8Array(value);
value = value3.decode(value);
return value.includes('FLV');
};
exports.isFileContaineJfiforExifHeader = function([, , , property]) {
return property === 224 || property === 225;
};
exports.isAvifStringIncluded = function(a0) {
var value = a0.slice(4, 12);
value = value.map(_fun40667);
value = value.join('');
return value === 'ftypavif';
};
exports.isHeicSignatureIncluded = function(a0) {
var env0_0 = a0.map(_fun40669).join('');
return ['ftypheic', 'ftyphevc', 'ftypmif1', 'ftypmsf1'].some(_fun40670);
};
}
function getFileChunk(a0) { // fn#40655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:305, offset: 0x011073c8, size: 284 bytes, params: 2, frame: 19
var r7;
var uint8Array;
var TypeError;
let value = a0;
const value2 = 32;
const r8 = arguments.length > 1 ? arguments[1] === undefined ? value2 : arguments[1] : value2;
let ArrayBuffer = global.ArrayBuffer;
if (value instanceof ArrayBuffer) {
uint8Array = new global.Uint8Array(value);
} else {
r7 = value;
}
let Array = global.Array;
if (Array.isArray(value)) {
if (((a0) => a0.every(_fun40657))(value)) {
Array = global.Array;
value = Array.from(r7.slice(0, r8));
if (((a0) => a0.every(_fun40659))(value)) {
return value;
}
throw new global.TypeError('File content contains illegal values');
}
if (value instanceof global.ArrayBuffer) {
Array = global.Array;
value = Array.from(r7.slice(0, r8));
if (((a0) => a0.every(_fun40659))(value)) {
return value;
}
throw new global.TypeError('File content contains illegal values');
}
if (value instanceof global.Uint8Array) {
Array = global.Array;
value = Array.from(r7.slice(0, r8));
if (((a0) => a0.every(_fun40659))(value)) {
return value;
}
throw new global.TypeError('File content contains illegal values');
}
TypeError = global.TypeError;
value = 'Expected the `file` argument to be of type `Array<number>`, `Uint8Array`, or `ArrayBuffer`, got `' + typeof value + '`';
throw new TypeError(value);
}
ArrayBuffer = global.ArrayBuffer;
if (value instanceof ArrayBuffer) {
Array = global.Array;
value = Array.from(r7.slice(0, r8));
if (((a0) => a0.every(_fun40659))(value)) {
return value;
}
throw new global.TypeError('File content contains illegal values');
}
const Uint8Array = global.Uint8Array;
if (value instanceof Uint8Array) {
Array = global.Array;
value = Array.from(r7.slice(0, r8));
if (((a0) => a0.every(_fun40659))(value)) {
return value;
}
throw new global.TypeError('File content contains illegal values');
}
TypeError = global.TypeError;
value = 'Expected the `file` argument to be of type `Array<number>`, `Uint8Array`, or `ArrayBuffer`, got `' + typeof value + '`';
const value6 = Object.create(TypeError.prototype, {constructor: {value: TypeError}});
const typeError = new TypeError(value);
throw typeError instanceof Object ? typeError : value6;
}
function fetchFromObject(a0, a1) { // fn#40660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:966, offset: 0x01107512, size: 88 bytes, params: 3, frame: 16
var r0;
var property;
var fetchFromObjectBinding;
let value = a1.indexOf('.');
if (value > -1) {
fetchFromObjectBinding = fetchFromObject;
property = a0[a1.slice(0, value)];
value = a1.slice(value + 1);
value = fetchFromObjectBinding(property, value);
r0 = value;
} else {
r0 = a0[a1];
}
return r0;
}
function findMatroskaDocTypeElements(a0) { // fn#40661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:1111, offset: 0x0110756a, size: 85 bytes, params: 2, frame: 12
var r0;
let value = a0.map(function(a0) {
var String = global.String;
return String.fromCharCode(a0);
});
value = value.join('');
const includes = value.includes;
const value2 = 'webm';
if (Reflect.apply(includes, value, [value2])) {
r0 = value2;
} else {
value = value.includes('matroska');
r0 = value ? 'mkv' : undefined;
}
return r0;
}
function isAvifStringIncluded(a0) { // fn#40666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:1761, offset: 0x011076ce, size: 63 bytes, params: 2, frame: 13
let value = a0.slice(4, 12);
value = value.map(function(a0) {
var String = global.String;
return String.fromCharCode(a0);
});
value = value.join('');
return value === 'ftypavif';
}
function isHeicSignatureIncluded(a0) { // fn#40668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:1913, offset: 0x0110770d, size: 66 bytes, params: 2, frame: 12
const env0_0 = a0.map(function(a0) {
var String = global.String;
return String.fromCharCode(a0);
}).join('');
return ['ftypheic', 'ftyphevc', 'ftypmif1', 'ftypmsf1'].some(_fun40670);
}
function isArrayofNumbers(a0) { // fn#40656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:469, owner: getFileChunk.isArrayofNumbers, offset: 0x011074e4, size: 23 bytes, params: 2, frame: 11
return a0.every(function(a0) {
return typeof a0 === 'number';
});
}
function isLegalChunk(a0) { // fn#40658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4881:757, owner: getFileChunk.isLegalChunk, offset: 0x011074fb, size: 23 bytes, params: 2, frame: 11
return a0.every(function(a0) {
return typeof a0 === 'number' && !(0, global.isNaN)(a0);
});
}