decord/source/modules/settings/native/renderer/SettingTreeManager.tsx

169 lines
5.1 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 15153
// Function ID: 15154
2026-07-29 08:29:29 +00:00
// Name: get
2026-08-25 06:04:03 +00:00
// Dependencies: [10517, 14101, 14100, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 15153 (get)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-08-25 06:04:03 +00:00
import GUILD_SELECT_ALL_SERVERS_OPTION_ID from "GUILD_SELECT_ALL_SERVERS_OPTION_ID" /* 10517 */;
import map from "map" /* 14100 */;
import frozen from "frozen" /* 14101 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const NodeType = GUILD_SELECT_ALL_SERVERS_OPTION_ID.NodeType;
2026-07-29 08:29:29 +00:00
class SettingTreeManagerCache {
constructor() {
obj = Object.create(new.target.prototype);
obj[0] = {};
return obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype = SettingTreeManagerCache.prototype;
prototype["get"] = function get(arg0) {
return this.cache[arg0];
};
prototype["set"] = function set(arg0, arg1) {
this.cache[arg0] = arg1;
};
prototype["clear"] = function clear() {
this.cache = {};
};
class SettingTreeManager {
constructor() {
tmp = SettingTreeManagerCache;
2026-08-04 21:03:28 +00:00
if (typeof SettingTreeManagerCache !== "function") {
2026-07-29 08:29:29 +00:00
str = "Trying to call a non-function";
throwTypeErrorResult = HermesBuiltin.throwTypeError();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = Object.create(new.target.prototype);
obj1 = Object.create(tmp.prototype);
obj1[0] = {};
obj[0] = obj1;
2026-08-04 21:03:28 +00:00
if (typeof tmp !== "function") {
2026-07-29 08:29:29 +00:00
str2 = "Trying to call a non-function";
throwTypeErrorResult1 = HermesBuiltin.throwTypeError();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj2 = Object.create(tmp.prototype);
obj2[0] = {};
obj[1] = obj2;
return obj;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype2 = SettingTreeManager.prototype;
prototype2["transformParent"] = function transformParent(parent) {
let tmp = null;
if (null != parent) {
let tmp2 = parent;
2026-08-04 21:03:28 +00:00
if (typeof parent !== "string") {
2026-07-29 08:29:29 +00:00
tmp2 = parent();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
};
prototype2["validate"] = function validate() {
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
};
prototype2["getAncestors"] = function getAncestors(field) {
const self = this;
const items = [];
2026-08-24 06:08:38 +00:00
let transformParentResult = this.transformParent(frozen.SETTING_RENDERER_CONFIG[field].parent);
2026-07-29 08:29:29 +00:00
if (null != transformParentResult) {
do {
let arr = items.push(transformParentResult);
let tmp3 = require;
let tmp4 = dependencyMap;
2026-08-24 06:08:38 +00:00
transformParentResult = self.transformParent(frozen.SETTING_RENDERER_CONFIG[transformParentResult].parent);
2026-07-29 08:29:29 +00:00
} while (null != transformParentResult);
}
return items;
};
prototype2["isBlocked"] = function isBlocked(field) {
2026-08-24 06:08:38 +00:00
closure_0 = arg1;
2026-07-29 08:29:29 +00:00
const ancestors = this.getAncestors(field);
ancestors.push(field);
return ancestors.some((arg0) => set.has(arg0));
};
prototype2["getHighestLevelAncestor"] = function getHighestLevelAncestor(setting) {
const self = this;
const highestAncestorCache = this.highestAncestorCache;
const value = highestAncestorCache.get(setting);
if (null != value) {
return value;
} else {
const ancestors = self.getAncestors(setting);
let tmp2 = ancestors[ancestors.length - 1];
if (tmp2 == null) {
tmp2 = setting;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const highestAncestorCache2 = self.highestAncestorCache;
const result = highestAncestorCache2.set(setting, tmp2);
return tmp2;
}
};
prototype2["getNearestRouteAncestorDataOrSelf"] = function getNearestRouteAncestorDataOrSelf(setting) {
2026-08-24 06:08:38 +00:00
const tmp = frozen.SETTING_RENDERER_CONFIG[setting];
2026-07-29 08:29:29 +00:00
if (tmp.type === NodeType.ROUTE) {
return tmp;
} else {
const self = this;
const ancestors = this.getAncestors(setting);
for (const item10013 of ancestors) {
let tmp3 = require;
let tmp4 = dependencyMap;
2026-08-24 06:08:38 +00:00
let tmp5 = frozen.SETTING_RENDERER_CONFIG[item10013];
2026-07-29 08:29:29 +00:00
let tmp6 = tmp5;
let tmp7 = NodeType;
if (tmp5.type === NodeType.ROUTE) {
let tmp8 = obj;
obj.return();
return tmp5;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const _Error = Error;
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
error = new Error("[SettingTree] No route ancestor found for setting: " + setting);
2026-07-29 08:29:29 +00:00
throw error;
}
};
prototype2["getBreadcrumbs"] = function getBreadcrumbs(setting) {
const self = this;
const breadcrumbCache = this.breadcrumbCache;
const value = breadcrumbCache.get(setting);
if (null != value) {
return value;
} else {
const items = [];
const ancestors = self.getAncestors(setting);
for (const item10009 of ancestors) {
let tmp3 = require;
let tmp4 = dependencyMap;
2026-08-24 06:08:38 +00:00
let obj = map;
2026-07-29 08:29:29 +00:00
let cachedSettingTitle = obj.getCachedSettingTitle(item10009);
if (null != cachedSettingTitle) {
let tmp7 = cachedSettingTitle;
let arr = items.push(tmp6);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const breadcrumbCache2 = self.breadcrumbCache;
const result = breadcrumbCache2.set(setting, items.reverse());
return items;
}
};
prototype2["clearCaches"] = function clearCaches() {
const breadcrumbCache = this.breadcrumbCache;
breadcrumbCache.clear();
const highestAncestorCache = this.highestAncestorCache;
highestAncestorCache.clear();
};
let obj = Object.create(SettingTreeManager.prototype);
obj = Object.create(SettingTreeManagerCache.prototype);
obj[0] = {};
obj[0] = obj;
let obj1 = Object.create(SettingTreeManagerCache.prototype);
obj1[0] = {};
obj[1] = obj1;
2026-08-24 06:08:38 +00:00
let result = set.fileFinishedImporting("modules/settings/native/renderer/SettingTreeManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default obj;