303 lines
15 KiB
JavaScript
303 lines
15 KiB
JavaScript
/* Metro module 4738; source: unknown; dependencies: [4731, 4734] */
|
|
import * as Module04731Module from './module-04731.js'; /* Metro dependency 4731 */
|
|
|
|
function _fun40894(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:6, offset: 0x0110f416, size: 346 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.default = {isPngFile: isPngFile, findPngOffsets: findPngOffsets};
|
|
exports.PNG_CHUNK_TYPE_SIZE = 4;
|
|
exports.PNG_CHUNK_LENGTH_OFFSET = 0;
|
|
exports.PNG_CHUNK_TYPE_OFFSET = 4;
|
|
exports.PNG_CHUNK_DATA_OFFSET = 8;
|
|
exports.TYPE_TEXT = 'tEXt';
|
|
exports.TYPE_ITXT = 'iTXt';
|
|
exports.TYPE_ZTXT = 'zTXt';
|
|
exports.TYPE_PHYS = 'pHYs';
|
|
exports.TYPE_TIME = 'tIME';
|
|
exports.TYPE_EXIF = 'eXIf';
|
|
exports.TYPE_ICCP = 'iCCP';
|
|
function isPngImageHeaderChunk(a0, a1) { // fn#40895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:1427, offset: 0x0110f570, size: 67 bytes, params: 3, frame: 15
|
|
const getStringFromDataView = Module04731Module.getStringFromDataView;
|
|
return Reflect.apply(getStringFromDataView, Module04731Module, [a0, a1 + env0_7, env0_5]) === 'IHDR';
|
|
}
|
|
|
|
function isPngXmpChunk(a0, a1) { // fn#40896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:1517, offset: 0x0110f5b3, size: 123 bytes, params: 3, frame: 19
|
|
var r0;
|
|
var moduleValue2;
|
|
const getStringFromDataView = Module04731Module.getStringFromDataView;
|
|
const value4 = Reflect.apply(getStringFromDataView, Module04731Module, [a0, a1 + env0_7, env0_5]) === env0_11;
|
|
if (value4) {
|
|
moduleValue2 = Module04731Module;
|
|
r0 = moduleValue2.getStringFromDataView(a0, a1 + env0_8, env0_9.length) === env0_9;
|
|
} else {
|
|
r0 = value4;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isPngTextChunk(a0, a1, a2) { // fn#40897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:1646, offset: 0x0110f62e, size: 99 bytes, params: 4, frame: 17
|
|
const value = a2;
|
|
const stringFromDataView = (Module04731Module).getStringFromDataView(a0, a1 + env0_7,
|
|
env0_5);
|
|
let r0 = stringFromDataView === env0_10 || stringFromDataView === env0_11;
|
|
r0 = !r0 ? stringFromDataView === env0_12 && value : r0;
|
|
return r0;
|
|
}
|
|
|
|
function isPngExifChunk(a0, a1) { // fn#40898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:1752, offset: 0x0110f691, size: 65 bytes, params: 3, frame: 16
|
|
const getStringFromDataView = Module04731Module.getStringFromDataView;
|
|
return Reflect.apply(getStringFromDataView, Module04731Module, [a0, a1 + env0_7, env0_5]) === env0_15;
|
|
}
|
|
|
|
function isPngIccpChunk(a0, a1) { // fn#40899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:1831, offset: 0x0110f6d2, size: 65 bytes, params: 3, frame: 16
|
|
const getStringFromDataView = Module04731Module.getStringFromDataView;
|
|
return Reflect.apply(getStringFromDataView, Module04731Module, [a0, a1 + env0_7, env0_5]) === env0_16;
|
|
}
|
|
|
|
function isPngChunk(a0, a1) { // fn#40900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:1910, offset: 0x0110f713, size: 87 bytes, params: 3, frame: 16
|
|
const items2 = [env0_13, env0_14];
|
|
const getStringFromDataView = Module04731Module.getStringFromDataView;
|
|
return items2.includes(Reflect.apply(getStringFromDataView, Module04731Module, [a0, a1 + env0_7, env0_5]));
|
|
}
|
|
|
|
function getPngXmpDataOffset(a0, a1) { // fn#40901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:2009, offset: 0x0110f76a, size: 138 bytes, params: 3, frame: 18
|
|
var r4;
|
|
var r5;
|
|
var r9;
|
|
var r0;
|
|
var r1;
|
|
var getUint8;
|
|
let value = a1 + (env0_8 + env0_9.length + 1 + 1);
|
|
let byteLength = a0.byteLength;
|
|
const value2 = 0;
|
|
if (value < byteLength) {
|
|
r4 = value2;
|
|
r5 = value;
|
|
while (true) {
|
|
getUint8 = a0.getUint8;
|
|
r9 = value2 !== Reflect.apply(getUint8, a0, [r5]) ? r4 : typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
|
|
value = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
|
|
if (r9 < 2) {
|
|
byteLength = a0.byteLength;
|
|
if (value < byteLength) {
|
|
r4 = r9;
|
|
r5 = value;
|
|
continue;
|
|
}
|
|
r0 = value;
|
|
r1 = r9;
|
|
break;
|
|
}
|
|
r0 = value;
|
|
r1 = r9;
|
|
break;
|
|
}
|
|
} else {
|
|
r0 = value;
|
|
r1 = value2;
|
|
}
|
|
if (r1 < 2) {
|
|
return undefined;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function parseIccHeader(a0, a1) { // fn#40902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:2140, offset: 0x0110f7f4, size: 92 bytes, params: 3, frame: 14
|
|
let value = Module04731Module;
|
|
value = value.getNullTerminatedStringFromDataView(a0, a1);
|
|
const value2 = a1 + (value.length + 1);
|
|
const object = {profileName: value};
|
|
object.compressionMethod = a0.getUint8(value2);
|
|
object.compressedProfileOffset = value2 + 1;
|
|
return object;
|
|
}
|
|
|
|
function isPngFile(a0) { // fn#40903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:109, offset: 0x0110f850, size: 68 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var moduleValue;
|
|
if (a0) {
|
|
moduleValue = require(4731) /* metro dependency 4731 */;
|
|
r0 = moduleValue.getStringFromDataView(a0, 0, env0_3.length) === env0_3;
|
|
} else {
|
|
r0 = !!a0;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function findPngOffsets(a0, a1) { // fn#40904, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4916:206, offset: 0x0110f894, size: 977 bytes, params: 3, frame: 43
|
|
var r15;
|
|
var USE_PNG_FILE;
|
|
var USE_XMP;
|
|
var USE_ICC;
|
|
var pngChunkOffsets;
|
|
var push;
|
|
var getUint32;
|
|
var value4;
|
|
var value5;
|
|
var iccHeader;
|
|
var profileName;
|
|
var compressionMethod;
|
|
var compressedProfileOffset;
|
|
var iccChunks;
|
|
var moduleValue;
|
|
var getStringFromDataView;
|
|
var value6;
|
|
var value7;
|
|
var pngTextChunks;
|
|
var pngXmpDataOffset;
|
|
var object;
|
|
var value9;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var value13;
|
|
var value14;
|
|
const object4 = {hasAppMarkers: false};
|
|
const length = env0_3.length;
|
|
const value3 = length + env0_4 + env0_5;
|
|
let byteLength = a0.byteLength;
|
|
if (value3 <= byteLength) {
|
|
r15 = length;
|
|
reducibleLoop1: while (true) {
|
|
USE_PNG_FILE = (importDefault(4734) /* metro dependency 4734 */).USE_PNG_FILE;
|
|
reducibleJoin24: while (true) {
|
|
reducibleJoin5: while (true) {
|
|
if (USE_PNG_FILE) {
|
|
if (isPngImageHeaderChunk(a0, r15)) {
|
|
object4.hasAppMarkers = true;
|
|
object4.pngHeaderOffset = r15 + env0_8;
|
|
break reducibleJoin24;
|
|
}
|
|
if ((importDefault(4734) /* metro dependency 4734 */).USE_XMP) {
|
|
if (isPngXmpChunk(a0, r15)) {
|
|
pngXmpDataOffset = getPngXmpDataOffset(a0, r15);
|
|
if (pngXmpDataOffset === undefined) {
|
|
break reducibleJoin24;
|
|
}
|
|
object4.hasAppMarkers = true;
|
|
object = {dataOffset: pngXmpDataOffset};
|
|
getUint32 = a0.getUint32;
|
|
value9 = Reflect.apply(getUint32, a0, [r15 + env0_6]);
|
|
object.length = value9 - (pngXmpDataOffset - (r15 + env0_8));
|
|
object4.xmpChunks = [object];
|
|
break reducibleJoin24;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
USE_XMP = (importDefault(4734) /* metro dependency 4734 */).USE_XMP;
|
|
if (USE_XMP) {
|
|
if (isPngXmpChunk(a0, r15)) {
|
|
pngXmpDataOffset = getPngXmpDataOffset(a0, r15);
|
|
if (pngXmpDataOffset === undefined) {
|
|
break reducibleJoin24;
|
|
}
|
|
object4.hasAppMarkers = true;
|
|
object = {dataOffset: pngXmpDataOffset};
|
|
getUint32 = a0.getUint32;
|
|
value9 = Reflect.apply(getUint32, a0, [r15 + env0_6]);
|
|
object.length = value9 - (pngXmpDataOffset - (r15 + env0_8));
|
|
object4.xmpChunks = [object];
|
|
break reducibleJoin24;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
if (isPngTextChunk(a0, r15, a1)) {
|
|
object4.hasAppMarkers = true;
|
|
moduleValue = require(4731) /* metro dependency 4731 */;
|
|
getStringFromDataView = moduleValue.getStringFromDataView;
|
|
value6 = r15 + env0_7;
|
|
value7 = Reflect.apply(getStringFromDataView, moduleValue, [a0, value6, env0_5]);
|
|
pngTextChunks = object4.pngTextChunks;
|
|
reducibleJoin20: while (true) {
|
|
if (pngTextChunks) {
|
|
break reducibleJoin20;
|
|
}
|
|
object4.pngTextChunks = [];
|
|
break reducibleJoin20;
|
|
}
|
|
pngTextChunks = object4.pngTextChunks;
|
|
push = pngTextChunks.push;
|
|
getUint32 = a0.getUint32;
|
|
Reflect.apply(push, pngTextChunks, [{length: Reflect.apply(getUint32, a0, [r15 + env0_6]),
|
|
type: value7,
|
|
offset: r15 + env0_8}]);
|
|
break reducibleJoin24;
|
|
}
|
|
if (isPngExifChunk(a0, r15)) {
|
|
object4.hasAppMarkers = true;
|
|
object4.tiffHeaderOffset = r15 + env0_8;
|
|
break reducibleJoin24;
|
|
}
|
|
USE_ICC = (importDefault(4734) /* metro dependency 4734 */).USE_ICC;
|
|
if (USE_ICC) {
|
|
if (a1) {
|
|
if (isPngIccpChunk(a0, r15)) {
|
|
object4.hasAppMarkers = true;
|
|
getUint32 = a0.getUint32;
|
|
value4 = Reflect.apply(getUint32, a0, [r15 + env0_6]);
|
|
value5 = r15 + env0_8;
|
|
iccHeader = parseIccHeader(a0, value5);
|
|
profileName = iccHeader.profileName;
|
|
compressionMethod = iccHeader.compressionMethod;
|
|
compressedProfileOffset = iccHeader.compressedProfileOffset;
|
|
iccChunks = object4.iccChunks;
|
|
reducibleJoin16: while (true) {
|
|
if (iccChunks) {
|
|
break reducibleJoin16;
|
|
}
|
|
object4.iccChunks = [];
|
|
break reducibleJoin16;
|
|
}
|
|
iccChunks = object4.iccChunks;
|
|
push = iccChunks.push;
|
|
Reflect.apply(push, iccChunks, [{offset: compressedProfileOffset,
|
|
length: value4 - (compressedProfileOffset - value5), chunkNumber: 1, chunksTotal: 1,
|
|
profileName: profileName,
|
|
compressionMethod: compressionMethod}]);
|
|
break reducibleJoin24;
|
|
}
|
|
}
|
|
}
|
|
if (isPngChunk(a0, r15)) {
|
|
object4.hasAppMarkers = true;
|
|
pngChunkOffsets = object4.pngChunkOffsets;
|
|
reducibleJoin13: while (true) {
|
|
if (pngChunkOffsets) {
|
|
break reducibleJoin13;
|
|
}
|
|
object4.pngChunkOffsets = [];
|
|
break reducibleJoin13;
|
|
}
|
|
pngChunkOffsets = object4.pngChunkOffsets;
|
|
push = pngChunkOffsets.push;
|
|
Reflect.apply(push, pngChunkOffsets, [r15 + env0_6]);
|
|
break reducibleJoin24;
|
|
}
|
|
break reducibleJoin24;
|
|
}
|
|
getUint32 = a0.getUint32;
|
|
value10 = Reflect.apply(getUint32, a0, [r15 + env0_6]);
|
|
value11 = value10 + env0_4;
|
|
value12 = r15 + (value11 + env0_5 + 4);
|
|
value13 = value12 + env0_4;
|
|
value14 = value13 + env0_5;
|
|
byteLength = a0.byteLength;
|
|
if (value14 <= byteLength) {
|
|
r15 = value12;
|
|
continue reducibleLoop1;
|
|
}
|
|
break reducibleLoop1;
|
|
}
|
|
}
|
|
return object4;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun40894, 4738, [4731, 4734]) /* metro module 4738, dependencies: [4731, 4734] */;
|