96 lines
5.0 KiB
JavaScript
96 lines
5.0 KiB
JavaScript
/* Metro module 938; source: unknown; dependencies: [65, 857, 832, 833, 828] */
|
|
import * as Module00065Module from './module-00065.js'; /* Metro dependency 65 */
|
|
import * as Module00857Module from './module-00857.js'; /* Metro dependency 857 */
|
|
|
|
function _fun9986(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1065:6, offset: 0x00d7876b, size: 150 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _INTERNAL_insertToFlagBuffer2 = _INTERNAL_insertToFlagBuffer;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports._INTERNAL_FLAG_BUFFER_SIZE = 100;
|
|
exports._INTERNAL_MAX_FLAGS_PER_SPAN = 10;
|
|
exports._INTERNAL_addFeatureFlagToActiveSpan = _INTERNAL_addFeatureFlagToActiveSpan;
|
|
exports._INTERNAL_copyFlagsFromScopeToEvent = _INTERNAL_copyFlagsFromScopeToEvent;
|
|
exports._INTERNAL_insertFlagToScope = _INTERNAL_insertFlagToScope;
|
|
exports._INTERNAL_insertToFlagBuffer = _INTERNAL_insertToFlagBuffer2;
|
|
function _INTERNAL_insertToFlagBuffer(a0, a1, a2, a3) { // fn#9987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1065:130, offset: 0x00d78801, size: 223 bytes, params: 5, frame: 16
|
|
var index;
|
|
const env0_0 = a1;
|
|
if (typeof a2 === 'boolean') {
|
|
if (a0.length > a3) {
|
|
if ((require(832) /* metro dependency 832 */).DEBUG_BUILD) {
|
|
(require(833) /* metro dependency 833 */).debug.error('[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=' + a3);
|
|
}
|
|
} else {
|
|
index = a0.findIndex(function({flag}) {
|
|
return flag === require;
|
|
});
|
|
if (index !== -1) {
|
|
a0.splice(index, 1);
|
|
}
|
|
if (a0.length === a3) {
|
|
a0.shift();
|
|
}
|
|
a0.push({flag: a1, result: a2});
|
|
}
|
|
}
|
|
}
|
|
|
|
function _INTERNAL_addFeatureFlagToActiveSpan(a0, a1) { // fn#9989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1065:573, offset: 0x00d788f6, size: 270 bytes, params: 3, frame: 20
|
|
var activeSpan;
|
|
var data;
|
|
let value = 10;
|
|
if (typeof a1 === 'boolean') {
|
|
activeSpan = (require(828) /* metro dependency 828 */).getActiveSpan();
|
|
if (activeSpan) {
|
|
value = require(828) /* metro dependency 828 */;
|
|
data = value.spanToJSON(activeSpan).data;
|
|
if ('' + 'flag.evaluation.' + a0 in data) {
|
|
activeSpan.setAttribute('' + 'flag.evaluation.' + a0, a1);
|
|
} else {
|
|
value = global.Object.keys(data);
|
|
if (value.filter(function(a0) {
|
|
return a0.startsWith('flag.evaluation.');
|
|
}).length < (arguments.length > 2 ? arguments[2] === undefined ? value : arguments[2] : value)) {
|
|
activeSpan.setAttribute('' + 'flag.evaluation.' + a0, a1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function _INTERNAL_copyFlagsFromScopeToEvent(a0) { // fn#9991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1065:974, offset: 0x00d78a1a, size: 128 bytes, params: 2, frame: 14
|
|
const currentScope = (Module00857Module).getCurrentScope();
|
|
const getScopeData = currentScope.getScopeData;
|
|
let contexts = Reflect.apply(getScopeData, currentScope, []).contexts;
|
|
const flags = contexts.flags;
|
|
const r4 = flags ? flags.values : [];
|
|
if (r4.length) {
|
|
contexts = a0.contexts;
|
|
if (contexts === undefined) {
|
|
a0.contexts = {};
|
|
}
|
|
contexts = a0.contexts;
|
|
contexts.flags = {values: Module00065Module(r4)};
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function _INTERNAL_insertFlagToScope(a0, a1) { // fn#9992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1065:1221, offset: 0x00d78a9a, size: 142 bytes, params: 3, frame: 17
|
|
const value = 100;
|
|
const r5 = arguments.length > 2 ? arguments[2] === undefined ? value : arguments[2] : value;
|
|
const currentScope = (Module00857Module).getCurrentScope();
|
|
const getScopeData = currentScope.getScopeData;
|
|
const contexts = Reflect.apply(getScopeData, currentScope, []).contexts;
|
|
if (!contexts.flags) {
|
|
contexts.flags = {values: []};
|
|
}
|
|
_INTERNAL_insertToFlagBuffer(contexts.flags.values, a0, a1, r5);
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun9986, 938, [65, 857, 832, 833, 828]) /* metro module 938, dependencies: [65, 857, 832, 833, 828] */;
|