Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5021.js (118.4 MB)
61 lines
2.4 KiB
TypeScript
61 lines
2.4 KiB
TypeScript
// Module ID: 11421
|
|
// Function ID: 11422
|
|
// Name: ContentClassificationVisibility
|
|
// Dependencies: [1372, 5425, 5427, 504, 2]
|
|
// Exports: getContentClassificationVisibility, useContentClassificationVisibility
|
|
|
|
// Module 11421 (ContentClassificationVisibility)
|
|
import initialize from "initialize" /* 504 */;
|
|
import ContentClassificationToAgeRestriction from "ContentClassificationToAgeRestriction" /* 5425 */;
|
|
import AgeRestrictionStatus from "AgeRestrictionStatus" /* 5427 */;
|
|
import UserStore from "UserStore" /* 1372 */;
|
|
|
|
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");
|
|
|
|
export { ContentClassificationVisibility };
|
|
export const getContentClassificationVisibility = function getContentClassificationVisibility(contentClassification, channel, nsfwAllowed) {
|
|
if (null != contentClassification) {
|
|
const obj = ContentClassificationToAgeRestriction;
|
|
const obj2 = { type: ContentClassificationToAgeRestriction.ContentClassificationVariant.MINIMAL, data: contentClassification };
|
|
const result = obj.contentClassificationToAgeRestriction(obj2);
|
|
if (result === AgeRestrictionStatus.AgeRestrictionStatus.ADULT) {
|
|
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;
|
|
};
|
|
export const useContentClassificationVisibility = function useContentClassificationVisibility(data, isPrivate) {
|
|
initialize;
|
|
[][0] = UserStore;
|
|
if (null != data) {
|
|
const obj = { type: tmp(5425).ContentClassificationVariant.MINIMAL, data };
|
|
const result = tmp(5425).contentClassificationToAgeRestriction(obj);
|
|
if (result === tmp(5427).AgeRestrictionStatus.ADULT) {
|
|
if (true !== tmp4) {
|
|
let DISPLAY = obj.BLOCK_UNDERAGE;
|
|
} else {
|
|
if (!isPrivate.isPrivate()) {
|
|
if (!isPrivate.nsfw) {
|
|
DISPLAY = obj.BLOCK_CHANNEL_RESTRICTION;
|
|
}
|
|
}
|
|
DISPLAY = obj.DISPLAY;
|
|
}
|
|
}
|
|
return DISPLAY;
|
|
}
|
|
DISPLAY = obj.DISPLAY;
|
|
};
|