Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
302 lines
14 KiB
TypeScript
302 lines
14 KiB
TypeScript
// Module ID: 14984
|
|
// Function ID: 14985
|
|
// Name: FamilyCenterSettingsControls
|
|
// Dependencies: [19, 17, 7590, 1074, 21, 4605, 576, 4601, 1114, 2396, 4808, 14985, 1896, 14987, 5655, 8715, 14971, 7645, 1483, 14988, 5023, 5737, 5025, 7638, 4618, 14903, 7591, 14989, 2]
|
|
// Exports: default
|
|
|
|
// Module 14984 (FamilyCenterSettingsControls)
|
|
import nativeDefault from "native" /* 576 */;
|
|
import asyncRequireImpl from "asyncRequireImpl" /* 1896 */;
|
|
import _modDef2396 from "module_2396" /* 2396 */;
|
|
import Text_Text from "Text/Text" /* 4601 */;
|
|
import ChannelActionCreatorsDefault from "ChannelActionCreators" /* 4618 */;
|
|
import ModalActionCreatorsDefault from "ModalActionCreators" /* 4808 */;
|
|
import FamilyCenterActionCreatorsDefault from "FamilyCenterActionCreators" /* 7591 */;
|
|
import LayerActionCreators from "LayerActionCreators" /* 7638 */;
|
|
import useUserIsTeenAgeGroupDefault from "useUserIsTeenAgeGroup" /* 14989 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
require = fn;
|
|
function SpendingLimitRow(teenId) {
|
|
teenId = teenId.teenId;
|
|
const tmp = closure_9();
|
|
const spendingLimitDisplayState = teenId(14987).useSpendingLimitDisplayState(teenId.cap);
|
|
const kind = spendingLimitDisplayState.kind;
|
|
if ("off" === kind) {
|
|
const obj2 = { trailing: null };
|
|
const intl2 = tmp2(1114).intl;
|
|
const obj3 = { variant: "text-sm/normal", color: "text-muted", children: intl2.string(_modDef2396.YEnpaj) };
|
|
obj2.trailing = closure_7(tmp2(4601).Text, obj3);
|
|
let tmp8 = obj2;
|
|
const stringResult = intl2.string(_modDef2396.YEnpaj);
|
|
} else if ("on" === kind) {
|
|
const obj4 = { trailing: null };
|
|
const obj5 = { variant: "text-sm/normal", color: "text-muted", children: spendingLimitDisplayState.monthlyText };
|
|
obj4.trailing = closure_7(tmp2(4601).Text, obj5);
|
|
tmp8 = obj4;
|
|
} else if ("close-to-limit" === kind) {
|
|
const obj6 = { trailing: null, subLabel: null };
|
|
const obj7 = { variant: "text-sm/normal", color: "text-muted", children: spendingLimitDisplayState.monthlyText };
|
|
obj6.trailing = closure_7(tmp2(4601).Text, obj7);
|
|
const obj8 = { variant: "text-sm/normal", style: tmp.subLabelWarning, children: spendingLimitDisplayState.remainingText };
|
|
obj6.subLabel = closure_7(tmp2(4601).Text, obj8);
|
|
tmp8 = obj6;
|
|
} else if ("spent" === kind) {
|
|
const obj9 = { trailing: null, subLabel: null };
|
|
const obj10 = { variant: "text-sm/normal", color: "text-muted", children: spendingLimitDisplayState.monthlyText };
|
|
obj9.trailing = closure_7(tmp2(4601).Text, obj10);
|
|
const intl = tmp2(1114).intl;
|
|
const obj11 = { variant: "text-sm/normal", style: tmp.subLabelCritical, children: intl.string(_modDef2396.Q2msVQ) };
|
|
obj9.subLabel = closure_7(tmp2(4601).Text, obj11);
|
|
tmp8 = obj9;
|
|
const stringResult1 = intl.string(_modDef2396.Q2msVQ);
|
|
} else if ("blocked" === kind) {
|
|
const obj12 = { trailing: null, subLabel: null };
|
|
const intl4 = tmp2(1114).intl;
|
|
const obj13 = { variant: "text-sm/normal", color: "text-muted", children: intl4.string(_modDef2396.kGFuGn) };
|
|
obj12.trailing = closure_7(tmp2(4601).Text, obj13);
|
|
const intl5 = tmp2(1114).intl;
|
|
const stringResult2 = intl4.string(_modDef2396.kGFuGn);
|
|
const obj14 = { variant: "text-sm/normal", style: tmp.subLabelCritical, children: intl5.string(_modDef2396.FUu2b0) };
|
|
obj12.subLabel = closure_7(tmp2(4601).Text, obj14);
|
|
tmp8 = obj12;
|
|
const stringResult3 = intl5.string(_modDef2396.FUu2b0);
|
|
}
|
|
({ trailing, subLabel } = tmp8);
|
|
const obj15 = { label: null, trailing: null, subLabel: null, onPress: null, arrow: null, disabled: null };
|
|
const intl3 = tmp2(1114).intl;
|
|
obj15.label = intl3.string(_modDef2396.gMeekL);
|
|
obj15.trailing = trailing;
|
|
obj15.subLabel = subLabel;
|
|
let fn;
|
|
if (null != teenId) {
|
|
fn = () => {
|
|
ModalActionCreatorsDefault.pushLazy(asyncRequireImpl(14985, dependencyMap.paths), { teenId }, undefined, { animation: "slide_from_right" });
|
|
};
|
|
}
|
|
obj15.onPress = fn;
|
|
obj15.arrow = null != teenId;
|
|
obj15.disabled = null == teenId;
|
|
return closure_7(teenId(5655).TableRow, obj15);
|
|
}
|
|
function FamilyCenterSettingsTeenControls() {
|
|
function handleOpenSettings() {
|
|
navigation.navigate(UserSettingsSections.CONTENT_AND_SOCIAL);
|
|
}
|
|
const tmp = closure_9();
|
|
activeLinkUserIds = activeLinkUserIds(handleOpenSettings[15]).useActiveLinkUserIds();
|
|
let obj = activeLinkUserIds(handleOpenSettings[15]);
|
|
const selectedTeenUser = activeLinkUserIds(handleOpenSettings[16]).useSelectedTeenUser();
|
|
const obj2 = activeLinkUserIds(handleOpenSettings[16]);
|
|
let isFamilyCenterV3Enabled = activeLinkUserIds(handleOpenSettings[17]).useIsFamilyCenterV3Enabled({ location: "FamilyCenterSettingsControls" });
|
|
const obj3 = activeLinkUserIds(handleOpenSettings[17]);
|
|
importDefault = activeLinkUserIds(handleOpenSettings[18]).useNavigation();
|
|
let rules;
|
|
if (selectedTeenUser != null) {
|
|
const restrictedSchedule = selectedTeenUser.restrictedSchedule;
|
|
if (restrictedSchedule != null) {
|
|
rules = restrictedSchedule.rules;
|
|
}
|
|
}
|
|
if (rules == null) {
|
|
rules = [];
|
|
}
|
|
const obj4 = activeLinkUserIds(handleOpenSettings[18]);
|
|
const spendingLimitFromUserSettings = activeLinkUserIds(handleOpenSettings[13]).useSpendingLimitFromUserSettings();
|
|
const tmp2Result = activeLinkUserIds(handleOpenSettings[13]);
|
|
({ subLabel, trailing } = require("useScheduleTimeControlsRowProps")(rules));
|
|
const obj5 = { style: tmp.teenControlsContainer, children: null };
|
|
const obj6 = { style: tmp.controlledSettingsHeader, children: null };
|
|
const obj7 = { variant: "text-sm/semibold", children: null };
|
|
const intl = tmp2(tmp3[8]).intl;
|
|
obj7.children = intl.string(require("module_2396").ahKIJO);
|
|
const items = [closure_7(activeLinkUserIds(handleOpenSettings[7]).Text, obj7), ];
|
|
const obj8 = { variant: "text-sm/medium", color: "text-muted", children: null };
|
|
const intl2 = tmp2(tmp3[8]).intl;
|
|
obj8.children = intl2.format(require("module_2396").X9rW0j, {
|
|
openSettingsHook(children, arg1) {
|
|
return React5(Text_Text.Text, { variant: "text-sm/medium", color: "text-link", onPress: handleOpenSettings, children }, arg1);
|
|
}
|
|
});
|
|
items[1] = closure_7(activeLinkUserIds(handleOpenSettings[7]).Text, obj8);
|
|
obj6.children = items;
|
|
const items1 = [closure_8(activeLinkUserIds(handleOpenSettings[20]).Stack, obj6), , ];
|
|
if (isFamilyCenterV3Enabled) {
|
|
const obj10 = { style: tmp.controlsGroup, children: null };
|
|
const obj11 = { cap: spendingLimitFromUserSettings };
|
|
const items2 = [tmp10(SpendingLimitRow, obj11), ];
|
|
const obj12 = { label: null, subLabel: null, trailing: null, onPress: null, arrow: null };
|
|
const intl3 = tmp2(tmp3[8]).intl;
|
|
obj12.label = intl3.string(tmp7(tmp3[9])["1Op+NP"]);
|
|
obj12.subLabel = subLabel;
|
|
obj12.trailing = trailing;
|
|
let fn;
|
|
if (rules.length > 0) {
|
|
fn = () => {
|
|
navigation.navigate(UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS, { selectedSubPage: FamilyCenterSubPages.SCREEN_TIME_CONTROLS });
|
|
};
|
|
}
|
|
const obj13 = { hasIcons: false, children: null };
|
|
obj12.onPress = fn;
|
|
obj12.arrow = rules.length > 0;
|
|
items2[1] = tmp10(tmp2(tmp3[14]).TableRow, obj12);
|
|
obj13.children = items2;
|
|
obj10.children = tmp9(tmp2(tmp3[21]).TableRowGroup, obj13);
|
|
isFamilyCenterV3Enabled = tmp10(View, obj10);
|
|
}
|
|
items1[1] = isFamilyCenterV3Enabled;
|
|
const obj14 = { text: null, onPress: null, shrink: true, grow: false, variant: "secondary", size: "sm" };
|
|
const intl4 = tmp2(tmp3[8]).intl;
|
|
obj14.text = intl4.formatToPlainString(require("module_2396").w0JA3P, { count: activeLinkUserIds.length });
|
|
obj14.onPress = function onPress() {
|
|
LayerActionCreators.popLayer();
|
|
ChannelActionCreatorsDefault.openPrivateChannel({ recipientIds: activeLinkUserIds });
|
|
};
|
|
items1[2] = closure_7(activeLinkUserIds(handleOpenSettings[22]).Button, obj14);
|
|
obj5.children = items1;
|
|
return closure_8(activeLinkUserIds(handleOpenSettings[20]).Stack, obj5);
|
|
}
|
|
function FamilyCenterSettingsParentalControls() {
|
|
const tmp = closure_9();
|
|
selectedTeenUser = selectedTeenUser(14971).useSelectedTeenUser();
|
|
let obj = selectedTeenUser(14971);
|
|
const shouldLoadSettingsForSelectedTeenUser = selectedTeenUser(14971).useShouldLoadSettingsForSelectedTeenUser();
|
|
const obj2 = selectedTeenUser(14971);
|
|
const isFamilyCenterV3Enabled = selectedTeenUser(7645).useIsFamilyCenterV3Enabled({ location: "FamilyCenterSettingsControls" });
|
|
const obj3 = selectedTeenUser(7645);
|
|
dependencyMap = selectedTeenUser(1483).useNavigation();
|
|
let rules;
|
|
if (selectedTeenUser != null) {
|
|
const restrictedSchedule = selectedTeenUser.restrictedSchedule;
|
|
if (restrictedSchedule != null) {
|
|
rules = restrictedSchedule.rules;
|
|
}
|
|
}
|
|
if (rules == null) {
|
|
rules = [];
|
|
}
|
|
const ParentalControlledSpendingLimit = tmp2(14903).ParentalControlledSpendingLimit;
|
|
let id;
|
|
if (selectedTeenUser != null) {
|
|
id = selectedTeenUser.id;
|
|
}
|
|
let id1;
|
|
const controlledSetting = ParentalControlledSpendingLimit.useControlledSetting(id);
|
|
if (selectedTeenUser != null) {
|
|
id1 = selectedTeenUser.id;
|
|
}
|
|
const items = [id1, shouldLoadSettingsForSelectedTeenUser];
|
|
const effect = rules.useEffect(() => {
|
|
let id;
|
|
if (selectedTeenUser != null) {
|
|
id = tmp.id;
|
|
}
|
|
if (tmp3) {
|
|
const teenSettingsAndConsents = FamilyCenterActionCreatorsDefault.fetchTeenSettingsAndConsents(tmp.id);
|
|
}
|
|
}, items);
|
|
const obj4 = selectedTeenUser(1483);
|
|
const tmp12 = shouldLoadSettingsForSelectedTeenUser;
|
|
({ subLabel, trailing } = shouldLoadSettingsForSelectedTeenUser(14988)(rules));
|
|
const obj5 = { style: tmp.parentalControlsContainer, children: null };
|
|
const obj6 = { variant: "text-sm/semibold", children: null };
|
|
const intl = tmp2(1114).intl;
|
|
obj6.children = intl.string(shouldLoadSettingsForSelectedTeenUser(2396).ahKIJO);
|
|
const items1 = [closure_7(selectedTeenUser(4601).Text, obj6), , ];
|
|
const obj7 = { variant: "text-sm/medium", color: "text-muted", children: null };
|
|
const intl2 = tmp2(1114).intl;
|
|
obj7.children = intl2.string(shouldLoadSettingsForSelectedTeenUser(2396).Sv236e);
|
|
items1[1] = closure_7(selectedTeenUser(4601).Text, obj7);
|
|
const obj8 = { style: tmp.controlsGroup, children: null };
|
|
const obj9 = { label: null, onPress: null, arrow: true };
|
|
const intl3 = tmp2(1114).intl;
|
|
obj9.label = intl3.string(selectedTeenUser(1114).t["+o1pDZ"]);
|
|
obj9.onPress = function onPress() {
|
|
navigation.navigate(UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS, { selectedSubPage: FamilyCenterSubPages.CONTENT_AND_SOCIAL });
|
|
};
|
|
const items2 = [closure_7(selectedTeenUser(5655).TableRow, obj9), , , ];
|
|
const obj10 = { label: null, onPress: null, arrow: true };
|
|
const intl4 = tmp2(1114).intl;
|
|
obj10.label = intl4.string(selectedTeenUser(1114).t.OAuOHD);
|
|
obj10.onPress = function onPress() {
|
|
navigation.navigate(UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS, { selectedSubPage: FamilyCenterSubPages.DATA_AND_PRIVACY });
|
|
};
|
|
items2[1] = closure_7(selectedTeenUser(5655).TableRow, obj10);
|
|
let tmp15Result = isFamilyCenterV3Enabled;
|
|
if (isFamilyCenterV3Enabled) {
|
|
let id2;
|
|
if (selectedTeenUser != null) {
|
|
id2 = selectedTeenUser.id;
|
|
}
|
|
tmp15Result = null != id2;
|
|
}
|
|
if (tmp15Result) {
|
|
const obj11 = { cap: controlledSetting, teenId: selectedTeenUser.id };
|
|
tmp15Result = tmp15(SpendingLimitRow, obj11);
|
|
}
|
|
items2[2] = tmp15Result;
|
|
let tmp15Result2 = isFamilyCenterV3Enabled;
|
|
if (isFamilyCenterV3Enabled) {
|
|
let id3;
|
|
if (selectedTeenUser != null) {
|
|
id3 = selectedTeenUser.id;
|
|
}
|
|
tmp15Result2 = null != id3;
|
|
}
|
|
if (tmp15Result2) {
|
|
const obj12 = { label: null, subLabel: null, trailing: null, onPress: null, arrow: true };
|
|
const intl5 = tmp2(1114).intl;
|
|
obj12.label = intl5.string(tmp12(2396)["1Op+NP"]);
|
|
obj12.subLabel = subLabel;
|
|
obj12.trailing = trailing;
|
|
obj12.onPress = function onPress() {
|
|
const obj = { selectedSubPage: FamilyCenterSubPages.SCREEN_TIME_CONTROLS, autoOpenCreate: null };
|
|
let tmp2 = 0 === rules.length;
|
|
if (tmp2) {
|
|
let id;
|
|
if (selectedTeenUser != null) {
|
|
id = selectedTeenUser.id;
|
|
}
|
|
tmp2 = null != id;
|
|
}
|
|
obj.autoOpenCreate = tmp2;
|
|
navigation.navigate(UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS, obj);
|
|
};
|
|
tmp15Result2 = tmp15(tmp2(5655).TableRow, obj12);
|
|
}
|
|
items2[3] = tmp15Result2;
|
|
obj8.children = closure_8(selectedTeenUser(5737).TableRowGroup, { hasIcons: false, children: items2 });
|
|
items1[2] = closure_7(View, obj8);
|
|
obj5.children = items1;
|
|
return closure_8(selectedTeenUser(5023).Stack, obj5);
|
|
}
|
|
const View = fn(17).View;
|
|
const FamilyCenterSubPages = fn(7590).FamilyCenterSubPages;
|
|
const UserSettingsSections = fn(1074).UserSettingsSections;
|
|
const jsxProd = fn(21);
|
|
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
|
|
const createStyles = fn(4605);
|
|
let obj2 = { teenControlsContainer: { gap: nativeDefault.space.PX_16 }, controlledSettingsHeader: null, parentalControlsContainer: null, controlsGroup: null, subLabelWarning: null, subLabelCritical: null };
|
|
let obj3 = { gap: nativeDefault.space.PX_16 };
|
|
obj2.controlledSettingsHeader = { gap: nativeDefault.space.PX_4 };
|
|
let obj4 = { gap: nativeDefault.space.PX_4 };
|
|
obj2.parentalControlsContainer = { gap: nativeDefault.space.PX_4 };
|
|
let obj5 = { gap: nativeDefault.space.PX_4 };
|
|
obj2.controlsGroup = { marginTop: nativeDefault.space.PX_8 };
|
|
let obj6 = { marginTop: nativeDefault.space.PX_8 };
|
|
obj2.subLabelWarning = { color: nativeDefault.colors.ICON_FEEDBACK_WARNING };
|
|
let obj7 = { color: nativeDefault.colors.ICON_FEEDBACK_WARNING };
|
|
obj2.subLabelCritical = { color: nativeDefault.colors.TEXT_FEEDBACK_CRITICAL };
|
|
let closure_9 = createStyles.createStyles(obj2);
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/parent_tools/native/FamilyCenterSettingsControls.tsx");
|
|
|
|
export default function FamilyCenterSettingsControls() {
|
|
const tmp = useUserIsTeenAgeGroupDefault();
|
|
if (0 === obj.useActiveLinkUserIds().length) {
|
|
return null;
|
|
} else {
|
|
const obj2 = { children: React5(tmp ? FamilyCenterSettingsTeenControls : FamilyCenterSettingsParentalControls, {}) };
|
|
React5(View, obj2);
|
|
}
|
|
};
|