Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
61 lines
2.4 KiB
TypeScript
61 lines
2.4 KiB
TypeScript
// Module ID: 12223
|
|
// Function ID: 12224
|
|
// Name: ContentClassificationVisibility
|
|
// Dependencies: [1372, 5361, 5363, 504, 2]
|
|
// Exports: getContentClassificationVisibility, useContentClassificationVisibility
|
|
|
|
// Module 12223 (ContentClassificationVisibility)
|
|
import initialize from "initialize" /* 504 */;
|
|
import ContentClassificationToAgeRestriction from "ContentClassificationToAgeRestriction" /* 5361 */;
|
|
import AgeRestrictionStatus from "AgeRestrictionStatus" /* 5363 */;
|
|
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(5361).ContentClassificationVariant.MINIMAL, data };
|
|
const result = tmp(5361).contentClassificationToAgeRestriction(obj);
|
|
if (result === tmp(5363).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;
|
|
};
|