decord/alpha/source/modules/threads/ThreadAutoArchive.tsx

74 lines
2.4 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 8841
// Function ID: 8842
// Name: ThreadAutoArchive
2026-10-06 11:16:32 +00:00
// Dependencies: [1125, 1102, 1126, 606, 4467, 2]
2026-07-20 16:05:17 +00:00
// Exports: getAutoArchiveDuration, getAutoArchiveDurationText
2026-10-06 11:16:32 +00:00
// Module 8841 (ThreadAutoArchive)
2026-10-03 08:58:59 +00:00
import memoizeDefault from "memoize" /* 606 */;
import DurationsDefault from "Durations" /* 1102 */;
import ThreadConstants from "ThreadConstants" /* 1125 */;
import intl5 from "intl" /* 1126 */;
2026-10-06 11:16:32 +00:00
import _modDef4467 from "module_4467" /* 4467 */;
import size from "module_2" /* 2 */;
2026-07-22 07:54:56 +00:00
2026-07-20 16:05:17 +00:00
function getAutoArchiveOptions() {
2026-10-03 08:58:59 +00:00
let intl;
let intl2;
let intl3;
let intl4;
const obj = { id: "1hour", label: intl.string(intl5.t.cs8A1c), value: DurationsDefault.Minutes.HOUR };
intl = intl5.intl;
2026-07-20 16:05:17 +00:00
const items = [obj, , , ];
2026-10-03 08:58:59 +00:00
const obj2 = { id: "24hours", label: intl2.string(intl5.t.zFKbrF), value: DurationsDefault.Minutes.DAY };
intl2 = intl5.intl;
items[1] = obj2;
2026-10-03 08:58:59 +00:00
const obj3 = { id: "3days", label: intl3.string(intl5.t.TmPIZX), value: 3 * DurationsDefault.Minutes.DAY };
intl3 = intl5.intl;
items[2] = obj3;
2026-10-03 08:58:59 +00:00
const obj4 = { id: "1week", label: intl4.string(intl5.t["/7i2el"]), value: DurationsDefault.Minutes.WEEK };
intl4 = intl5.intl;
items[3] = obj4;
2026-07-20 16:05:17 +00:00
return items;
}
let closure_3 = ThreadConstants.DEFAULT_AUTO_ARCHIVE_DURATION;
let items = [DurationsDefault.Minutes.HOUR, DurationsDefault.Minutes.DAY, 3 * DurationsDefault.Minutes.DAY, DurationsDefault.Minutes.WEEK];
2026-10-03 08:58:59 +00:00
const tmp2 = memoizeDefault(() => {
const arr = getAutoArchiveOptions();
return arr.map((value) => value.value);
});
const result = size.fileFinishedImporting("modules/threads/ThreadAutoArchive.tsx");
2026-07-20 16:05:17 +00:00
export const AUTO_ARCHIVE_OPTION_VALUES = items;
export { getAutoArchiveOptions };
2026-10-03 08:58:59 +00:00
export const getAutoArchiveDurations = tmp2;
2026-07-20 16:05:17 +00:00
export const getAutoArchiveDurationText = function getAutoArchiveDurationText(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0 = arg0;
const arr = getAutoArchiveOptions();
const found = arr.find((value) => value.value === closure_0);
2026-07-20 16:05:17 +00:00
let label;
2026-07-29 08:29:29 +00:00
if (found != null) {
2026-07-20 16:05:17 +00:00
label = found.label;
}
2026-07-29 08:29:29 +00:00
if (label == null) {
2026-10-06 11:16:32 +00:00
const obj = _modDef4467;
2026-10-03 08:58:59 +00:00
const durationResult = obj.duration(arg0, "minutes");
label = durationResult.humanize();
2026-07-20 16:05:17 +00:00
}
return label;
};
export const getAutoArchiveDuration = function getAutoArchiveDuration(channel, arg1) {
let tmp = arg1;
2026-07-29 08:29:29 +00:00
if (arg1 == null) {
2026-07-20 16:05:17 +00:00
let prop;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
prop = channel.defaultAutoArchiveDuration;
}
tmp = prop;
}
2026-07-29 08:29:29 +00:00
if (tmp == null) {
2026-07-20 16:05:17 +00:00
tmp = closure_3;
}
return tmp;
};