300 lines
18 KiB
TypeScript
300 lines
18 KiB
TypeScript
/* Metro module 13419; source: modules/parent_tools/native/FamilyCenterSettingsControls.tsx; dependencies: [31, 27, 5117, 661, 33, 4501, 697, 4573, 1244, 2224, 5080, 13420, 1962, 13422, 6238, 8170, 13406, 5188, 1484, 13423, 4572, 6231, 4578, 5177, 4603, 13348, 5118, 13424, 2] */
|
|
function _fun102091(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:6, offset: 0x0222c2f9, size: 464 bytes, params: 8, frame: 22
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const env0_5 = (require(5117) /* metro dependency 5117: FamilyCenterConstants */).FamilyCenterSubPages;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).UserSettingsSections;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_7 = value.jsx;
|
|
const env0_8 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {};
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.teenControlsContainer = {gap: PX_16};
|
|
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object2.controlledSettingsHeader = {gap: PX_4};
|
|
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
|
|
object2.parentalControlsContainer = {gap: PX_4};
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.controlsGroup = {marginTop: PX_8};
|
|
const ICON_FEEDBACK_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_WARNING;
|
|
object2.subLabelWarning = {color: ICON_FEEDBACK_WARNING};
|
|
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
|
|
object2.subLabelCritical = {color: TEXT_FEEDBACK_CRITICAL};
|
|
const env0_9 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/parent_tools/native/FamilyCenterSettingsControls.tsx');
|
|
exports.default = FamilyCenterSettingsControls;
|
|
}
|
|
|
|
function SpendingLimitRow({cap, teenId}) { // fn#102092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:575, offset: 0x0222c4c9, size: 221 bytes, params: 2, frame: 22
|
|
const styles = useStyles();
|
|
const {trailing,
|
|
subLabel} = getSpendingLimitRowProps((require(13422) /* metro dependency 13422: SpendingLimitDisplay */).useSpendingLimitDisplayState(cap),
|
|
styles);
|
|
const value5 = teenId == null;
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
return (
|
|
<TableRow
|
|
label={intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).gMeekL)}
|
|
trailing={trailing}
|
|
subLabel={subLabel}
|
|
onPress={value5 ? undefined : _fun102096}
|
|
arrow={!value5}
|
|
disabled={value5}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function FamilyCenterSettingsTeenControls() { // fn#102097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:1793, offset: 0x0222c869, size: 907 bytes, params: 1, frame: 36
|
|
var r5;
|
|
var TableRowGroup;
|
|
var items3;
|
|
var TableRow;
|
|
var object9;
|
|
var length;
|
|
const value2 = undefined;
|
|
const styles = useStyles();
|
|
const value3 = (require(8170) /* metro dependency 8170: useUserLinks */).useActiveLinkUserIds();
|
|
const value4 = (require(13406) /* metro dependency 13406: useSelectedTeenUser */).useSelectedTeenUser();
|
|
const value5 = (require(5188) /* metro dependency 5188: FamilyCenterV3Experiment */).useIsFamilyCenterV3Enabled({location: 'FamilyCenterSettingsControls'});
|
|
const env0_1 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const r6 = (value4 == null || value4.restrictedSchedule == null ? value2 : value4.restrictedSchedule.rules) ?? [];
|
|
const value6 = (require(13422) /* metro dependency 13422: SpendingLimitDisplay */).useSpendingLimitFromUserSettings();
|
|
const {subLabel,
|
|
trailing} = (importDefault(13423) /* metro dependency 13423: useScheduleTimeControlsRowProps */)(r6);
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const Stack2 = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const text = <Text variant="text-sm/semibold">{intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).ahKIJO)}</Text>;
|
|
const format = intl.format;
|
|
const X9rW0j = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).X9rW0j;
|
|
const stack = <Stack2 style={styles.controlledSettingsHeader}>{text}<Text variant="text-sm/medium" color="text-muted">{Reflect.apply(format,
|
|
intl, [X9rW0j, {openSettingsHook: openSettingsHook}])}</Text></Stack2>;
|
|
if (value5) {
|
|
var viewBindingProps = {style: styles.controlsGroup};
|
|
TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
items3 = [<SpendingLimitRow cap={value6} />];
|
|
TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
var tableRowProps = {label: intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['1Op+NP']),
|
|
|
|
subLabel: subLabel, trailing: trailing};
|
|
length = r6.length;
|
|
tableRowProps.onPress = length > 0 ? _fun102100 : value2;
|
|
length = r6.length;
|
|
tableRowProps.arrow = length > 0;
|
|
items3[1] = <TableRow {...tableRowProps} />;
|
|
r5 = <View {...viewBindingProps}><TableRowGroup hasIcons={false}>{items3}</TableRowGroup></View>;
|
|
} else {
|
|
r5 = value5;
|
|
}
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
return (
|
|
<Stack style={styles.teenControlsContainer}>
|
|
{stack}
|
|
{r5}
|
|
<Button
|
|
text={intl.formatToPlainString((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).w0JA3P,
|
|
{count: value3.length})}
|
|
onPress={onPress_102101}
|
|
shrink
|
|
grow={false}
|
|
variant="secondary"
|
|
size="sm"
|
|
/>
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
function FamilyCenterSettingsParentalControls() { // fn#102102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3263, offset: 0x0222cce8, size: 1009 bytes, params: 1, frame: 38
|
|
const value2 = undefined;
|
|
const styles = useStyles();
|
|
const value3 = (require(13406) /* metro dependency 13406: useSelectedTeenUser */).useSelectedTeenUser();
|
|
const value4 = (require(13406) /* metro dependency 13406: useSelectedTeenUser */).useShouldLoadSettingsForSelectedTeenUser();
|
|
const value5 = (require(5188) /* metro dependency 5188: FamilyCenterV3Experiment */).useIsFamilyCenterV3Enabled({location: 'FamilyCenterSettingsControls'});
|
|
const env0_2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const r1 = (value3 == null || value3.restrictedSchedule == null ? value2 : value3.restrictedSchedule.rules) ?? [];
|
|
const env0_3 = r1;
|
|
const ParentalControlledSpendingLimit = (require(13348) /* metro dependency 13348: ParentalControlledUserSettings */).ParentalControlledSpendingLimit;
|
|
const value6 = ParentalControlledSpendingLimit.useControlledSetting(value3 == null ? value2 : value3.id);
|
|
env0_3.useEffect(_fun102103, [value3 == null ? value2 : value3.id, value4]);
|
|
const {subLabel,
|
|
trailing} = (importDefault(13423) /* metro dependency 13423: useScheduleTimeControlsRowProps */)(r1);
|
|
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const items3 = [<Text variant="text-sm/semibold">{Reflect.apply(string, intl,
|
|
[(importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).ahKIJO])}</Text>];
|
|
string = intl.string;
|
|
const Sv236e = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).Sv236e;
|
|
items3[1] = <Text variant="text-sm/medium" color="text-muted">{Reflect.apply(string, intl, [Sv236e])}</Text>;
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const items2 = [<TableRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+o1pDZ'])} onPress={function() {
|
|
return handleSettingsClick(FamilyCenterSubPages.CONTENT_AND_SOCIAL);
|
|
}} arrow />];
|
|
string = intl.string;
|
|
const OAuOHD = (require(1244) /* metro dependency 1244: indexNative */).t.OAuOHD;
|
|
items2[1] = <TableRow label={Reflect.apply(string, intl, [OAuOHD])} onPress={function() {
|
|
return handleSettingsClick(FamilyCenterSubPages.DATA_AND_PRIVACY);
|
|
}} arrow />;
|
|
items2[2] = value5 && (value3 == null ? value2 : value3.id) != null && <SpendingLimitRow cap={value6} teenId={value3.id} />;
|
|
items2[3] = value5 && (value3 == null ? value2 : value3.id) != null && <TableRow label={intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['1Op+NP'])} subLabel={subLabel} trailing={trailing} onPress={onPress_102107} arrow />;
|
|
items3[2] = <View style={styles.controlsGroup}><TableRowGroup hasIcons={false}>{items2}</TableRowGroup></View>;
|
|
return (
|
|
<Stack style={styles.parentalControlsContainer}>
|
|
{items3}
|
|
</Stack>
|
|
);
|
|
}
|
|
|
|
function FamilyCenterSettingsControls() { // fn#102108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:4976, offset: 0x0222d201, size: 111 bytes, params: 1, frame: 17
|
|
const value2 = (importDefault(13424) /* metro dependency 13424: useUserIsTeenAgeGroup */)();
|
|
const useUserLinksModule = require(8170) /* metro dependency 8170: useUserLinks */;
|
|
const useActiveLinkUserIds = useUserLinksModule.useActiveLinkUserIds;
|
|
return Reflect.apply(useActiveLinkUserIds, useUserLinksModule,
|
|
[]).length === 0 ? null : <View>{((Component) => <Component />)(value2 ? FamilyCenterSettingsTeenControls : FamilyCenterSettingsParentalControls)}</View>;
|
|
}
|
|
|
|
function getSpendingLimitRowProps(a0, a1) { // fn#102093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:608, owner: SpendingLimitRow.getSpendingLimitRowProps, offset: 0x0222c5a6, size: 467 bytes, params: 3, frame: 23
|
|
var environment;
|
|
var object2;
|
|
var value;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const closure = getSpendingLimitRowPropsRenderTrailing;
|
|
const closure2 = renderSubLabel;
|
|
const kind = a0.kind;
|
|
if (kind === 'off') {
|
|
object2 = {};
|
|
value = environment.__proto__;
|
|
object2.trailing = closure(intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).YEnpaj));
|
|
return object2;
|
|
}
|
|
if (kind === 'on') {
|
|
object2 = {};
|
|
object2.trailing = closure(a0.monthlyText);
|
|
return object2;
|
|
}
|
|
if (kind === 'close-to-limit') {
|
|
object2 = {};
|
|
object2.trailing = closure(a0.monthlyText);
|
|
object2.subLabel = closure2(a0.remainingText, a1.subLabelWarning);
|
|
return object2;
|
|
}
|
|
if (kind === 'spent') {
|
|
object2 = {};
|
|
object2.trailing = closure(a0.monthlyText);
|
|
value = environment.__proto__;
|
|
value = intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).Q2msVQ);
|
|
object2.subLabel = closure2(value, a1.subLabelCritical);
|
|
return object2;
|
|
}
|
|
if (kind === 'blocked') {
|
|
object2 = {};
|
|
value = environment.__proto__;
|
|
object2.trailing = closure(intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).kGFuGn));
|
|
value = intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).FUu2b0);
|
|
object2.subLabel = closure2(value, a1.subLabelCritical);
|
|
return object2;
|
|
}
|
|
}
|
|
|
|
function _fun102096() { // fn#102096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:1596, offset: 0x0222c7fc, size: 109 bytes, params: 1, frame: 18
|
|
const teenIdBinding = teenId;
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(dependencyMap[10]);
|
|
const pushLazy = defaultImport.pushLazy;
|
|
value = require(dependencyMap[12]);
|
|
value = value(dependencyMap[11], dependencyMap.paths);
|
|
Reflect.apply(pushLazy, defaultImport, [value, {teenId: teenIdBinding}, undefined, {animation: 'slide_from_right'}]);
|
|
}
|
|
|
|
function handleOpenSettings() { // fn#102098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:2124, owner: FamilyCenterSettingsTeenControls.handleOpenSettings, offset: 0x0222cbf4, size: 35 bytes, params: 1, frame: 11
|
|
const binding = env0_1;
|
|
const navigate = binding.navigate;
|
|
const CONTENT_AND_SOCIAL = UserSettingsSections.CONTENT_AND_SOCIAL;
|
|
Reflect.apply(navigate, binding, [CONTENT_AND_SOCIAL]);
|
|
}
|
|
|
|
function openSettingsHook(a0, a1) { // fn#102099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:2541, owner: FamilyCenterSettingsTeenControls.openSettingsHook, offset: 0x0222cc17, size: 78 bytes, params: 3, frame: 15
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text
|
|
variant="text-sm/medium"
|
|
color="text-link"
|
|
onPress={handleOpenSettings}
|
|
key={a1}
|
|
>
|
|
{a0}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function _fun102100() { // fn#102100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:2878, offset: 0x0222cc65, size: 53 bytes, params: 1, frame: 14
|
|
const binding = env0_1;
|
|
const navigate = binding.navigate;
|
|
const FAMILY_CENTER_PARENTAL_CONTROLS = UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS;
|
|
const SCREEN_TIME_CONTROLS = FamilyCenterSubPages.SCREEN_TIME_CONTROLS;
|
|
Reflect.apply(navigate, binding, [FAMILY_CENTER_PARENTAL_CONTROLS, {selectedSubPage: SCREEN_TIME_CONTROLS}]);
|
|
}
|
|
|
|
function FamilyCenterSettingsTeenControlsOnPress() { // fn#102101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3100, owner: FamilyCenterSettingsTeenControls.onPress, offset: 0x0222cc9a, size: 78 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
(require(5177) /* metro dependency 5177: LayerActionCreators */).popLayer();
|
|
(importDefault(4603) /* metro dependency 4603: ChannelActionCreators */).openPrivateChannel({recipientIds: env0_0});
|
|
}
|
|
|
|
function _fun102103() { // fn#102103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3647, offset: 0x0222d0d9, size: 88 bytes, params: 1, frame: 13
|
|
var value4;
|
|
var defaultImport;
|
|
const value2 = undefined;
|
|
if ((env0_0 == null ? value2 : env0_0.id) != null && env0_1) {
|
|
value4 = environment.__proto__;
|
|
defaultImport = importDefault(5118) /* metro dependency 5118: FamilyCenterActionCreators */;
|
|
defaultImport.fetchTeenSettingsAndConsents(env0_0.id);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function handleSettingsClick(a0) { // fn#102104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3779, owner: FamilyCenterSettingsParentalControls.handleSettingsClick, offset: 0x0222d131, size: 46 bytes, params: 2, frame: 14
|
|
const binding = env0_2;
|
|
const navigate = binding.navigate;
|
|
const FAMILY_CENTER_PARENTAL_CONTROLS = UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS;
|
|
Reflect.apply(navigate, binding, [FAMILY_CENTER_PARENTAL_CONTROLS, {selectedSubPage: a0}]);
|
|
}
|
|
|
|
function FamilyCenterSettingsParentalControlsOnPress_102107() { // fn#102107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:4701, owner: FamilyCenterSettingsParentalControls.onPress, offset: 0x0222d199, size: 104 bytes, params: 1, frame: 18
|
|
const binding = env0_2;
|
|
const navigate = binding.navigate;
|
|
const FAMILY_CENTER_PARENTAL_CONTROLS = UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS;
|
|
const SCREEN_TIME_CONTROLS = FamilyCenterSubPages.SCREEN_TIME_CONTROLS;
|
|
Reflect.apply(navigate, binding, [FAMILY_CENTER_PARENTAL_CONTROLS, {selectedSubPage: SCREEN_TIME_CONTROLS,
|
|
autoOpenCreate: env0_3.length === 0 && env0_0?.id != null}]);
|
|
}
|
|
|
|
function getSpendingLimitRowPropsRenderTrailing(a0) { // fn#102094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:666, owner: SpendingLimitRow.getSpendingLimitRowProps.renderTrailing, offset: 0x0222c779, size: 63 bytes, params: 2, frame: 14
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text variant="text-sm/normal" color="text-muted">
|
|
{a0}
|
|
</Text>
|
|
);
|
|
}
|
|
|
|
function renderSubLabel(a0, a1) { // fn#102095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:757, owner: SpendingLimitRow.getSpendingLimitRowProps.renderSubLabel, offset: 0x0222c7b8, size: 68 bytes, params: 3, frame: 14
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
return (
|
|
<Text variant="text-sm/normal" style={a1}>
|
|
{a0}
|
|
</Text>
|
|
);
|
|
}
|
|
|