290 lines
11 KiB
TypeScript
290 lines
11 KiB
TypeScript
/* Metro module 14147; source: modules/settings/native/renderer/SettingTreeManager.tsx; dependencies: [6, 7, 9693, 13177, 13176, 2] */
|
|
function _fun107043(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#107043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:6, offset: 0x022f1abb, size: 213 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_107046 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_3 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_4 = (require(9693) /* metro dependency 9693: SettingRendererConstants */).NodeType;
|
|
const env0_5 = _fun107047();
|
|
let value = _fun107052();
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/settings/native/renderer/SettingTreeManager.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_107044(a0, a1) { // fn#107044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:140, offset: 0x022f1b90, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun107045;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_107046(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_107046(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_107046(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun107045;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function _fun107047() { // fn#107047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:1056, offset: 0x022f1d04, size: 109 bytes, params: 1, frame: 15
|
|
return env0_3(SettingTreeManagerCache, [{key: 'get', value: function(a0) {
|
|
return this.cache[a0];
|
|
}}, {key: 'set', value: function(a0, a1) {
|
|
this.cache[a0] = a1;
|
|
}}, {key: 'clear', value: function() {
|
|
this.cache = {};
|
|
}}]);
|
|
}
|
|
|
|
function _fun107052() { // fn#107052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:1319, offset: 0x022f1da3, size: 234 bytes, params: 1, frame: 15
|
|
return env0_3(SettingTreeManager, [{key: 'transformParent', value: function(a0) {
|
|
var r1;
|
|
var r0;
|
|
var value = a0;
|
|
var value2 = null;
|
|
if (value2 == value) {
|
|
r0 = value2;
|
|
} else {
|
|
if (typeof value === 'string') {
|
|
r1 = value;
|
|
} else {
|
|
value = value();
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}}, {key: 'validate', value: function() {
|
|
}}, {key: 'getAncestors', value: function(a0) {
|
|
var r1;
|
|
var value3;
|
|
var items = [];
|
|
var SETTING_RENDERER_CONFIG = require(dependencyMap[3]).SETTING_RENDERER_CONFIG;
|
|
var value2 = this.transformParent(SETTING_RENDERER_CONFIG[a0].parent);
|
|
if (value2 != null) {
|
|
for (r1 = value2; true; r1 = value3) {
|
|
items.push(r1);
|
|
value3 = this.transformParent(require(dependencyMap[3]).SETTING_RENDERER_CONFIG[r1].parent);
|
|
if (value3 == null) {
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return items;
|
|
}}, {key: 'isBlocked', value: function(a0, a1) {
|
|
var env0_0 = a1;
|
|
var value = this.getAncestors(a0);
|
|
value.push(a0);
|
|
return value.some(_fun107058);
|
|
}}, {key: 'getHighestLevelAncestor', value: function(a0) {
|
|
var value = a0;
|
|
var value2 = this.highestAncestorCache.get(value);
|
|
if (value2 != null) {
|
|
return value2;
|
|
}
|
|
var value3 = this.getAncestors(value);
|
|
var r1 = value3[value3.length - 1] ?? value;
|
|
this.highestAncestorCache.set(value, r1);
|
|
return r1;
|
|
}}, {key: 'getNearestRouteAncestorDataOrSelf', value: value_107060}, {key: 'getBreadcrumbs', value: value_107061},
|
|
{key: 'clearCaches', value: function() {
|
|
this.breadcrumbCache.clear();
|
|
this.highestAncestorCache.clear();
|
|
}}]);
|
|
}
|
|
|
|
function SettingTreeManagerCache() { // fn#107048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:1077, offset: 0x022f1d71, size: 35 bytes, params: 1, frame: 13
|
|
env1_2(this, SettingTreeManagerCache);
|
|
this.cache = {};
|
|
}
|
|
|
|
function SettingTreeManager() { // fn#107053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:1340, offset: 0x022f1e8d, size: 83 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__;
|
|
let binding = env1_2;
|
|
binding(this, SettingTreeManager);
|
|
binding = env1_5;
|
|
this.highestAncestorCache = new binding();
|
|
this.breadcrumbCache = new binding();
|
|
}
|
|
|
|
function value_107057(a0, a1) { // fn#107057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:1821, offset: 0x022f1f83, size: 56 bytes, params: 3, frame: 12
|
|
const env0_0 = a1;
|
|
const ancestors = this.getAncestors(a0);
|
|
ancestors.push(a0);
|
|
return ancestors.some(function(a0) {
|
|
return require.has(a0);
|
|
});
|
|
}
|
|
|
|
function value_107060(a0) { // fn#107060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:2163, offset: 0x022f2011, size: 222 bytes, params: 2, frame: 18
|
|
var value4;
|
|
var value5;
|
|
var Error;
|
|
var concat;
|
|
const value = environment.__proto__;
|
|
const SETTING_RENDERER_CONFIG = (require(13177) /* metro dependency 13177: SettingsRendererConfig */).SETTING_RENDERER_CONFIG;
|
|
let property = SETTING_RENDERER_CONFIG[a0];
|
|
let type = property.type;
|
|
let ROUTE = NodeType.ROUTE;
|
|
if (type !== ROUTE) {
|
|
var _createForOfIteratorHelperLoose_107044Binding = _createForOfIteratorHelperLoose_107044;
|
|
var getAncestors = this.getAncestors;
|
|
var value2 = _createForOfIteratorHelperLoose_107044Binding(Reflect.apply(getAncestors, this, [a0]));
|
|
var value3 = value2();
|
|
var done = value3.done;
|
|
if (done) {
|
|
throw new global.Error('[SettingTree] No route ancestor found for setting: ' + a0);
|
|
}
|
|
var r3 = value3;
|
|
loopExit2: while (true) {
|
|
value4 = r3.value;
|
|
property = SETTING_RENDERER_CONFIG[value4];
|
|
type = property.type;
|
|
ROUTE = NodeType.ROUTE;
|
|
if (type === ROUTE) {
|
|
break loopExit2;
|
|
}
|
|
value5 = value2();
|
|
done = value5.done;
|
|
if (done) {
|
|
Error = global.Error;
|
|
concat = global.HermesInternal.concat;
|
|
throw new Error('[SettingTree] No route ancestor found for setting: ' + a0);
|
|
}
|
|
r3 = value5;
|
|
continue;
|
|
}
|
|
}
|
|
return property;
|
|
}
|
|
|
|
function value_107061(a0) { // fn#107061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14344:2514, offset: 0x022f20ef, size: 168 bytes, params: 2, frame: 22
|
|
var r4;
|
|
var value5;
|
|
var moduleValue;
|
|
var cachedSettingTitle;
|
|
var value7;
|
|
let breadcrumbCache = this.breadcrumbCache;
|
|
let value = breadcrumbCache.get(a0);
|
|
if (value != null) {
|
|
return value;
|
|
}
|
|
const items2 = [];
|
|
value = environment.__proto__;
|
|
const value3 = _createForOfIteratorHelperLoose_107044(this.getAncestors(a0));
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r4 = value4;
|
|
while (true) {
|
|
value5 = r4.value;
|
|
moduleValue = require(13176) /* metro dependency 13176: SettingHookHarness */;
|
|
cachedSettingTitle = moduleValue.getCachedSettingTitle(value5);
|
|
if (cachedSettingTitle != null) {
|
|
items2.push(cachedSettingTitle);
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r4 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
breadcrumbCache = this.breadcrumbCache;
|
|
breadcrumbCache.set(a0, items2.reverse());
|
|
return items2;
|
|
}
|
|
|