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

133 lines
4.7 KiB
TypeScript
Raw Normal View History

// Module ID: 17575
// Function ID: 17576
// Name: ParentalConsentWarningManager
// Dependencies: [4327, 7640, 14956, 7641, 1074, 14957, 4603, 17576, 1896, 7221, 17578, 2]
2026-07-20 16:05:17 +00:00
// Module 17575 (ParentalConsentWarningManager)
import asyncRequireImpl from "asyncRequireImpl" /* 1896 */;
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4603 */;
import ParentalConsentWarningTypes from "ParentalConsentWarningTypes" /* 14957 */;
import ParentalConsentWarningActionCreators from "ParentalConsentWarningActionCreators" /* 17578 */;
import ActionSheetStore from "ActionSheetStore" /* 4327 */;
import FamilyCenterStore from "FamilyCenterStore" /* 7640 */;
import ParentalConsentWarningStore from "ParentalConsentWarningStore" /* 14956 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7221 */;
2026-07-23 10:11:24 +00:00
require = fn;
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) {
hasItem = surfaces.includes(ParentalConsentWarningTypes.ParentalConsentWarningSurface.MODAL);
2026-07-20 16:05:17 +00:00
}
}
let tmp5 = true === hasItem && null != daysRemaining;
if (tmp5) {
tmp5 = daysRemaining >= 0;
}
if (tmp5) {
tmp5 = !ParentalConsentWarningStore.hasShownModalToday();
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
const _Object = Object;
const values = Object.values(FamilyCenterStore.getLinkedUsers());
2026-07-29 08:29:29 +00:00
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 = !ActionSheetStore.isOpen();
2026-07-20 16:05:17 +00:00
}
if (tmp5) {
const obj = { daysRemaining };
ActionSheetActionCreatorsDefault.openLazy(asyncRequireImpl(17576, dependencyMap.paths), "ParentalConsentWarningModal", obj);
2026-07-20 16:05:17 +00:00
}
}
const FamilyCenterConstants = fn(7641);
({ UserLinkStatus: closure_7, UserLinkType: closure_8 } = FamilyCenterConstants);
const AppStates = fn(1074).AppStates;
const prototype = function ParentalConsentWarningManager() {
2026-07-29 08:29:29 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = {
PARENTAL_CONSENT_WARNING_FETCH_SUCCESS(warning) {
maybePresentModal(warning.warning);
2026-07-29 08:29:29 +00:00
},
POST_CONNECTION_OPEN() {
const values = Object.values(linkedUsers.getLinkedUsers());
c3 = values.some((link_status) => {
2026-07-29 08:29:29 +00:00
let tmp = link_status.link_status === constants.ACTIVE;
if (tmp) {
tmp = link_status.link_type === constants2.PARENT;
}
return tmp;
});
ParentalConsentWarningActionCreators.maybeFetchWarning();
if (!ParentalConsentWarningStore.shouldFetchToday()) {
maybePresentModal(ParentalConsentWarningStore.getWarning());
2026-07-29 08:29:29 +00:00
}
},
APP_STATE_UPDATE(state) {
if (state.state === constants.ACTIVE) {
ParentalConsentWarningActionCreators.maybeFetchWarning();
if (!ParentalConsentWarningStore.shouldFetchToday()) {
maybePresentModal(obj2.getWarning());
2026-07-29 08:29:29 +00:00
}
obj2 = ParentalConsentWarningStore;
2026-07-29 08:29:29 +00:00
}
},
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;
});
c3 = someResult;
2026-07-29 08:29:29 +00:00
if (tmp) {
if (someResult) {
const warning = ParentalConsentWarningStore.getWarning();
2026-07-29 08:29:29 +00:00
let hasItem;
if (warning != null) {
const surfaces = warning.surfaces;
if (surfaces != null) {
hasItem = surfaces.includes(ParentalConsentWarningTypes.ParentalConsentWarningSurface.BANNER);
2026-07-29 08:29:29 +00:00
}
}
if (true === hasItem) {
ParentalConsentWarningActionCreators.forceFetchWarning();
2026-07-29 08:29:29 +00:00
}
} else {
ParentalConsentWarningActionCreators.forceFetchWarning();
2026-07-29 08:29:29 +00:00
}
}
tmp = undefined !== c3 && c3 !== someResult;
2026-07-29 08:29:29 +00:00
}
},
LOGOUT() {
2026-08-24 06:08:38 +00:00
c3 = undefined;
ParentalConsentWarningActionCreators.resetFetchState();
2026-07-29 08:29:29 +00:00
}
};
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
2026-07-20 16:05:17 +00:00
}
const prototype1 = new prototype();
const size = fn(2);
const result = size.fileFinishedImporting("modules/parent_tools/native/ParentalConsentWarningManager.tsx");
2026-07-20 16:05:17 +00:00
export default prototype1;