2026-09-30 07:29:52 +00:00
|
|
|
// Module ID: 11624
|
|
|
|
|
// Function ID: 11625
|
2026-07-29 08:29:29 +00:00
|
|
|
// Name: ContentClassificationVisibility
|
2026-09-30 07:29:52 +00:00
|
|
|
// Dependencies: [1372, 5622, 5624, 504, 2]
|
2026-07-29 08:29:29 +00:00
|
|
|
// Exports: getContentClassificationVisibility, useContentClassificationVisibility
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-09-30 07:29:52 +00:00
|
|
|
// Module 11624 (ContentClassificationVisibility)
|
2026-09-05 10:56:28 +00:00
|
|
|
import initialize from "initialize" /* 504 */;
|
2026-09-30 07:29:52 +00:00
|
|
|
import ContentClassificationToAgeRestriction from "ContentClassificationToAgeRestriction" /* 5622 */;
|
|
|
|
|
import AgeRestrictionStatus from "AgeRestrictionStatus" /* 5624 */;
|
2026-09-15 14:23:42 +00:00
|
|
|
import UserStore from "UserStore" /* 1372 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
require = fn;
|
|
|
|
|
const ContentClassificationVisibility = { DISPLAY: "display", BLOCK_UNDERAGE: "block_underage", BLOCK_CHANNEL_RESTRICTION: "block_channel_restriction" };
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
let result = size.fileFinishedImporting("modules/content_classification/ContentClassificationVisibility.tsx");
|
2026-07-29 08:29:29 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
export { ContentClassificationVisibility };
|
2026-07-29 08:29:29 +00:00
|
|
|
export const getContentClassificationVisibility = function getContentClassificationVisibility(contentClassification, channel, nsfwAllowed) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != contentClassification) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const obj = ContentClassificationToAgeRestriction;
|
|
|
|
|
const obj2 = { type: ContentClassificationToAgeRestriction.ContentClassificationVariant.MINIMAL, data: contentClassification };
|
|
|
|
|
const result = obj.contentClassificationToAgeRestriction(obj2);
|
2026-08-24 06:08:38 +00:00
|
|
|
if (result === AgeRestrictionStatus.AgeRestrictionStatus.ADULT) {
|
2026-07-20 16:05:17 +00:00
|
|
|
if (true !== nsfwAllowed) {
|
|
|
|
|
let DISPLAY = obj.BLOCK_UNDERAGE;
|
|
|
|
|
} else {
|
|
|
|
|
if (!channel.isPrivate()) {
|
|
|
|
|
if (!channel.nsfw) {
|
|
|
|
|
DISPLAY = obj.BLOCK_CHANNEL_RESTRICTION;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DISPLAY = obj.DISPLAY;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return DISPLAY;
|
|
|
|
|
}
|
|
|
|
|
DISPLAY = obj.DISPLAY;
|
2026-07-29 08:29:29 +00:00
|
|
|
};
|
2026-09-10 05:38:07 +00:00
|
|
|
export const useContentClassificationVisibility = function useContentClassificationVisibility(data, isPrivate) {
|
2026-08-24 06:08:38 +00:00
|
|
|
initialize;
|
2026-09-10 05:38:07 +00:00
|
|
|
[][0] = UserStore;
|
|
|
|
|
if (null != data) {
|
2026-09-30 07:29:52 +00:00
|
|
|
const obj = { type: tmp(5622).ContentClassificationVariant.MINIMAL, data };
|
|
|
|
|
const result = tmp(5622).contentClassificationToAgeRestriction(obj);
|
|
|
|
|
if (result === tmp(5624).AgeRestrictionStatus.ADULT) {
|
2026-07-29 08:29:29 +00:00
|
|
|
if (true !== tmp4) {
|
|
|
|
|
let DISPLAY = obj.BLOCK_UNDERAGE;
|
|
|
|
|
} else {
|
|
|
|
|
if (!isPrivate.isPrivate()) {
|
|
|
|
|
if (!isPrivate.nsfw) {
|
|
|
|
|
DISPLAY = obj.BLOCK_CHANNEL_RESTRICTION;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
DISPLAY = obj.DISPLAY;
|
|
|
|
|
}
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
return DISPLAY;
|
|
|
|
|
}
|
|
|
|
|
DISPLAY = obj.DISPLAY;
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|