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

257 lines
14 KiB
JavaScript

/* Metro module 6435; source: unknown; dependencies: [6374, 6375, 6436, 6441] */
import ClassCallCheck from './module-06374-ClassCallCheck.js'; /* Metro dependency 6374 */
import CreateClass from './module-06375-CreateClass.js'; /* Metro dependency 6375 */
function _fun50504(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:6, offset: 0x0121ba83, size: 101 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
exports.default = _fun50505();
function _fun50505() { // fn#50505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:118, offset: 0x0121bae8, size: 147 bytes, params: 1, frame: 15
return CreateClass(ViewabilityHelper_50506, [{key: 'dispose', value: function() {
this.timers.forEach(global.clearTimeout);
}}, {key: 'updateViewableItems', value: value_50508}, {key: 'checkViewableIndicesChanges', value: function(a0) {
var env0_0 = this;
var value = a0.filter(_fun50512);
var env0_1 = value;
var value2 = value.filter(_fun50513);
var value3 = this.lastReportedViewableIndices.filter(_fun50514);
if (value2.length > 0 || value3.length > 0) {
this.lastReportedViewableIndices = value;
this.viewableIndicesChanged(value, value2, value3);
}
}}, {key: 'clearLastReportedViewableIndices', value: function() {
this.lastReportedViewableIndices = [];
}}, {key: 'isItemViewable', value: value_50516}]);
function ViewabilityHelper_50506(a0, a1) { // fn#50506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:139, offset: 0x01211c39, size: 117 bytes, params: 3, frame: 13
const value = environment.__proto__;
env1_2(this, ViewabilityHelper_50506);
this.possiblyViewableIndices = [];
this.hasInteracted = false;
this.viewableIndices = [];
this.lastReportedViewableIndices = [];
const Set = global.Set;
this.timers = new Set();
this.viewabilityConfig = a0;
this.viewableIndicesChanged = a1;
}
function value_50508(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#50508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:498, offset: 0x0121bb7b, size: 380 bytes, params: 8, frame: 17
var environment;
var waitForInteraction;
var r4;
var value2;
var value4;
var defaultImport;
var multipleViewabilityThresholdTypesNotSupported;
const env0_1 = require;
const value = undefined;
if (value !== dependencyMap) {
this.possiblyViewableIndices = dependencyMap;
}
let viewabilityConfig = this.viewabilityConfig;
if ((viewabilityConfig == null ? value : viewabilityConfig.itemVisiblePercentThreshold) !== null) {
viewabilityConfig = this.viewabilityConfig;
if (value === (viewabilityConfig == null ? value : viewabilityConfig.itemVisiblePercentThreshold)) {
viewabilityConfig = this.viewabilityConfig;
waitForInteraction = viewabilityConfig == null ? value : viewabilityConfig.waitForInteraction;
if (waitForInteraction == null) {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
} else if (waitForInteraction) {
if (this.hasInteracted) {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
}
} else {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
}
return value;
}
viewabilityConfig = this.viewabilityConfig;
if ((viewabilityConfig == null ? value : viewabilityConfig.viewAreaCoveragePercentThreshold) === null) {
viewabilityConfig = this.viewabilityConfig;
waitForInteraction = viewabilityConfig == null ? value : viewabilityConfig.waitForInteraction;
if (waitForInteraction == null) {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
} else if (waitForInteraction) {
if (this.hasInteracted) {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
}
} else {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
}
return value;
}
viewabilityConfig = this.viewabilityConfig;
if (value !== (viewabilityConfig == null ? value : viewabilityConfig.viewAreaCoveragePercentThreshold)) {
value4 = environment.__proto__;
defaultImport = importDefault(dependencyMap[2]);
multipleViewabilityThresholdTypesNotSupported = importDefault(dependencyMap[3]).multipleViewabilityThresholdTypesNotSupported;
throw new defaultImport();
}
}
viewabilityConfig = this.viewabilityConfig;
waitForInteraction = viewabilityConfig == null ? value : viewabilityConfig.waitForInteraction;
if (waitForInteraction == null) {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
} else if (waitForInteraction) {
if (this.hasInteracted) {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
}
} else {
value2 = this.possiblyViewableIndices.filter(_fun50509);
this.viewableIndices = value2;
viewabilityConfig = this.viewabilityConfig;
r4 = (viewabilityConfig == null ? value : viewabilityConfig.minimumViewTime) ?? 250;
if (r4 > 0) {
var env0_8 = global.setTimeout(_fun50510, r4);
} else {
this.checkViewableIndicesChanges(value2);
}
}
return value;
function _fun50509(a0) { // fn#50509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:1166, offset: 0x0121bcf7, size: 118 bytes, params: 2, frame: 29
const binding = env0_6;
const isItemViewable = binding.isItemViewable;
const binding2 = env0_0;
const binding3 = env0_4;
let viewabilityConfig = binding.viewabilityConfig;
const value2 = undefined;
const viewAreaCoveragePercentThreshold = viewabilityConfig == null ? value2 : viewabilityConfig.viewAreaCoveragePercentThreshold;
viewabilityConfig = env0_6.viewabilityConfig;
return Reflect.apply(isItemViewable, binding, [a0, binding2, require, importDefault, importAll, binding3,
viewAreaCoveragePercentThreshold,
viewabilityConfig == null ? value2 : viewabilityConfig.itemVisiblePercentThreshold, env0_5]);
}
function _fun50510() { // fn#50510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:1495, offset: 0x0121bd6d, size: 66 bytes, params: 1, frame: 13
const binding = env0_6;
binding.timers.delete(env0_8);
binding.checkViewableIndicesChanges(env0_7);
binding.timers.add(env0_8);
}
}
function value_50511(a0) { // fn#50511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:1664, offset: 0x0121bdaf, size: 116 bytes, params: 2, frame: 17
const value = a0.filter(_fun50512);
const value2 = value.filter(_fun50513);
const value3 = this.lastReportedViewableIndices.filter(_fun50514);
if (value2.length > 0 || value3.length > 0) {
this.lastReportedViewableIndices = value;
this.viewableIndicesChanged(value, value2, value3);
}
function _fun50512(a0) { // fn#50512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:1727, offset: 0x01211f5a, size: 28 bytes, params: 2, frame: 11
return env0_0.viewableIndices.includes(a0);
}
function _fun50513(a0) { // fn#50513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:1791, offset: 0x01211f76, size: 31 bytes, params: 2, frame: 11
const lastReportedViewableIndices = env0_0.lastReportedViewableIndices;
return !lastReportedViewableIndices.includes(a0);
}
function _fun50514(a0) { // fn#50514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:1898, offset: 0x01211f95, size: 25 bytes, params: 2, frame: 11
const binding = env0_1;
return !binding.includes(a0);
}
}
}
}
function value_50516(a0, a1, a2, a3, a4, a5, a6, a7, a8) { // fn#50516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6613:2190, offset: 0x0121be23, size: 297 bytes, params: 10, frame: 20
const value = a7;
const value2 = a8(a0);
if (value2 === undefined) {
return false;
}
const value3 = (a1 ? value2.x : value2.y) - a2;
const value4 = value3 + (a1 ? value2.width : value2.height);
const value5 = (a1 ? a5.width : a5.height) - a3;
let Math = global.Math;
const value6 = Math.max(value3, a4);
Math = global.Math;
const value7 = Math.min(value4, value5);
Math = global.Math;
const value8 = 0;
const value9 = Math.max(value8, value7 - value6);
let r1 = a1 ? value2.width : value2.height;
Math = global.Math;
if (Math.abs(value9 - r1) <= 0.001) {
return true;
}
if (value9 <= value8) {
return false;
}
const value11 = a6 != null;
r1 = value11 ? value9 / (value5 - a4) : value9 / r1;
return r1 >= (value11 ? 0.01 * a6 : 0.01 * (value ?? value8));
}
global.__d(_fun50504, 6435, [6374, 6375, 6436,
6441]) /* metro module 6435, dependencies: [6374, 6375, 6436, 6441] */;