decord/source/modules/parent_tools/native/ParentalConsentWarningManager.tsx

135 lines
4.2 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 16396
// Function ID: 16397
2026-07-29 08:29:29 +00:00
// Name: maybePresentModal
2026-08-05 07:35:12 +00:00
// Dependencies: [3948, 6890, 13991, 6891, 676, 13992, 4223, 16397, 1959, 5214, 16399, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 16396 (maybePresentModal)
2026-07-29 08:29:29 +00:00
import setContent from "setContent";
import freshTeenActivityWithMap from "freshTeenActivityWithMap";
import initialize from "initialize";
2026-07-23 10:11:24 +00:00
import items from "items";
import { AppStates } from "ME";
2026-07-29 08:29:29 +00:00
import "initialize";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function maybePresentModal(daysRemaining) {
daysRemaining = undefined;
if (daysRemaining != null) {
daysRemaining = daysRemaining.daysRemaining;
2026-07-20 16:05:17 +00:00
}
let hasItem;
2026-07-29 08:29:29 +00:00
if (daysRemaining != null) {
const surfaces = daysRemaining.surfaces;
if (surfaces != null) {
2026-08-05 07:35:12 +00:00
hasItem = surfaces.includes(require(13992) /* frozen */.ParentalConsentWarningSurface.MODAL);
2026-07-20 16:05:17 +00:00
}
}
let tmp5 = true === hasItem && null != daysRemaining;
if (tmp5) {
tmp5 = daysRemaining >= 0;
}
if (tmp5) {
2026-07-29 08:29:29 +00:00
tmp5 = !initialize.hasShownModalToday();
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
const _Object = Object;
2026-07-29 08:29:29 +00:00
const values = Object.values(linkedUsers.getLinkedUsers());
tmp5 = !values.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
tmp5 = !open.isOpen();
}
if (tmp5) {
2026-07-29 08:29:29 +00:00
const obj = { daysRemaining: null };
obj[0] = daysRemaining;
2026-08-05 07:35:12 +00:00
importDefault(4223).openLazy(require(1959) /* asyncRequireImpl */(16397, dependencyMap.paths), "ParentalConsentWarningModal", obj);
const obj2 = importDefault(4223);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
({ UserLinkStatus: error, UserLinkType: metroImportAll } = items);
let prototype = function ParentalConsentWarningManager() {
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = {
PARENTAL_CONSENT_WARNING_FETCH_SUCCESS(warning) {
callback2(warning.warning);
},
POST_CONNECTION_OPEN() {
const values = Object.values(linkedUsers.getLinkedUsers());
let closure_3 = values.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
2026-08-05 07:35:12 +00:00
callback(16399).maybeFetchWarning();
2026-07-29 08:29:29 +00:00
if (!initialize.shouldFetchToday()) {
callback2(initialize.getWarning());
}
},
APP_STATE_UPDATE(state) {
if (state.state === constants.ACTIVE) {
2026-08-05 07:35:12 +00:00
callback(16399).maybeFetchWarning();
2026-07-29 08:29:29 +00:00
if (!initialize.shouldFetchToday()) {
callback2(obj2.getWarning());
}
2026-08-05 07:35:12 +00:00
const obj = callback(16399);
2026-07-29 08:29:29 +00:00
obj2 = initialize;
}
},
CURRENT_USER_UPDATE(user) {
user = user.user;
if (undefined !== user.linked_users) {
const linked_users = user.linked_users;
const someResult = linked_users.some((link_status) => {
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
let closure_3 = someResult;
if (tmp) {
if (someResult) {
const warning = initialize.getWarning();
let hasItem;
if (warning != null) {
const surfaces = warning.surfaces;
if (surfaces != null) {
2026-08-05 07:35:12 +00:00
hasItem = surfaces.includes(callback(13992).ParentalConsentWarningSurface.BANNER);
2026-07-29 08:29:29 +00:00
}
}
if (true === hasItem) {
2026-08-05 07:35:12 +00:00
callback(16399).forceFetchWarning();
const obj2 = callback(16399);
2026-07-29 08:29:29 +00:00
}
} else {
2026-08-05 07:35:12 +00:00
callback(16399).forceFetchWarning();
const obj = callback(16399);
2026-07-29 08:29:29 +00:00
}
}
tmp = undefined !== closure_3 && closure_3 !== someResult;
}
},
LOGOUT() {
let c3;
2026-08-05 07:35:12 +00:00
callback(16399).resetFetchState();
2026-07-29 08:29:29 +00:00
}
};
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
prototype = new prototype();
const result = require("initialize").fileFinishedImporting("modules/parent_tools/native/ParentalConsentWarningManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default prototype;