/* Metro module 13420; source: modules/parent_tools/native/ChangeSpendingLimitModal.tsx; dependencies: [5, 31, 27, 33, 4501, 697, 8129, 4573, 1244, 2224, 13421, 3857, 4073, 5080, 3856, 5137, 6258, 6259, 4572, 7981, 10120, 6261, 4578, 5282, 10121, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import FamilyCenterMessages from '../FamilyCenter.messages.js'; /* Metro dependency 2224 */ import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as StackNativeModule from '../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */ import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */ import * as ModalScreenNativeModule from '../../../design/components/Modal/native/ModalScreen.native.tsx'; /* Metro dependency 6258 */ import * as ModalContentNativeModule from '../../../design/components/Modal/native/ModalContent.native.tsx'; /* Metro dependency 6259 */ import * as ButtonGroupNativeModule from '../../../design/components/ButtonGroup/native/ButtonGroup.native.tsx'; /* Metro dependency 6261 */ import * as TextInputNativeModule from '../../../design/components/TextInput/native/TextInput.native.tsx'; /* Metro dependency 7981 */ import * as ModalFooterNativeModule from '../../../design/components/Modal/native/ModalFooter.native.tsx'; /* Metro dependency 10120 */ import * as ModalNativeModule from '../../../design/components/Modal/native/Modal.native.tsx'; /* Metro dependency 10121 */ import * as ChangeSpendingLimitFormStateModule from '../ChangeSpendingLimitFormState.tsx'; /* Metro dependency 13421 */ function _fun102109(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13610:6, offset: 0x0222d270, size: 449 bytes, params: 8, frame: 24 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactNativeModule; const StyleSheet = value.StyleSheet; const env0_5 = value.View; value = require(33) /* metro dependency 33 */; const env0_6 = value.jsx; const env0_7 = value.jsxs; value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object = {}; const object2 = {}; copyDataProperties(object2, StyleSheet.absoluteFillObject, undefined); const INPUT_FIELD_RADIUS_LG = (importDefault(697) /* metro dependency 697: native */).modules.mobile.INPUT_FIELD_RADIUS_LG; object2['borderRadius'] = INPUT_FIELD_RADIUS_LG; object2['borderWidth'] = 1; let ICON_FEEDBACK_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_WARNING; object2['borderColor'] = ICON_FEEDBACK_WARNING; const BACKGROUND_FEEDBACK_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_FEEDBACK_WARNING; object2['backgroundColor'] = BACKGROUND_FEEDBACK_WARNING; object.warningOverlay = object2; const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object.warningRow = {'flexDirection': 'row', 'gap': null, 'alignItems': 'flex-start', gap: PX_8}; ICON_FEEDBACK_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_WARNING; object.warningText = {flex: 1, color: ICON_FEEDBACK_WARNING}; const env0_8 = Reflect.apply(createStyles, value, [object]); (FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/native/ChangeSpendingLimitModal.tsx'); exports.default = ChangeSpendingLimitModal; function renderMonthlySpendLine(a0, a1, a2, a3) { // fn#102110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13610:568, offset: 0x0222d431, size: 388 bytes, params: 5, frame: 25 var r1; var r0; const Text = (TextModule).Text; const intl = (IndexNativeModule).intl; var items2; const value = null; if (value == a0) { r0 = value; } else { if (a1) { var viewBindingProps = {style: a3.warningRow}; const WarningIcon = (require(8129) /* metro dependency 8129: WarningIcon */).WarningIcon; items2 = [ , ]; items2[1] = ( {intl.formatToPlainString((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).Tk6x4X, {amount: a0, date: a2})} ); r1 = ( {items2} ); } else { r1 = ( {intl.formatToPlainString((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).pfAlRY, {amount: a0})} ); } r0 = r1; } return r0; } function ChangeSpendingLimitScreen({teenId}) { // fn#102111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13610:1016, offset: 0x0222d5b5, size: 1295 bytes, params: 2, frame: 54 var r11; var object3; var object4; const styles = useStyles(); const value3 = (ChangeSpendingLimitFormStateModule).useChangeSpendingLimitFormState(teenId); const amountInput = value3.amountInput; const handleAmountChange = value3.handleAmountChange; const currency = value3.currency; const currencySymbol = value3.currencySymbol; const exponent = value3.exponent; const isClearingCap = value3.isClearingCap; const isOverspending = value3.isOverspending; const canSave = value3.canSave; const isSubmitting = value3.isSubmitting; const renewalDate = value3.renewalDate; const monthlySpend = value3.monthlySpend; const env0_0 = value3.save; const value4 = _fun102112(); const r22 = monthlySpend != null && monthlySpend > 0 ? (require(5137) /* metro dependency 5137: PriceUtils */).formatPrice(monthlySpend, currency) : null; const value7 = amountInput.length > 0; const ModalScreen = (ModalScreenNativeModule).ModalScreen; const ModalContent = (ModalContentNativeModule).ModalContent; const Stack = (StackNativeModule).Stack; const PX_16 = (Native).space.PX_16; const Text = (TextModule).Text; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; let string = intl.string; const IFguF2 = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).IFguF2; const text = ( {Reflect.apply(string, intl, [IFguF2])} ); const Stack2 = (StackNativeModule).Stack; const PX_8 = (Native).space.PX_8; const items2 = [ {(require(1244) /* metro dependency 1244: indexNative */).intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['1fHSu2'])} , ]; const TextInput = (TextInputNativeModule).TextInput; const textInputProps = {accessibilityLabel: (require(1244) /* metro dependency 1244: indexNative */).intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['1fHSu2']), value: amountInput, onChange: handleAmountChange, leadingText: value7 ? currencySymbol : undefined}; string = intl.string; const DjSv82 = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).DjSv82; textInputProps.placeholder = Reflect.apply(string, intl, [DjSv82]); textInputProps.keyboardType = exponent > 0 ? 'decimal-pad' : 'number-pad'; textInputProps.isClearable = true; items2[1] = ( { isOverspending ? ( ) : null } ); items2[2] = renderMonthlySpendLine(r22, isOverspending, renewalDate, styles); const modalContent = ( {text} {items2} ); const ModalFooter = (ModalFooterNativeModule).ModalFooter; const ButtonGroup = (ButtonGroupNativeModule).ButtonGroup; const Button = (ButtonNativeModule).Button; if (isClearingCap) { object4 = {variant: 'destructive'}; object4.text = intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).JZDGJ8); object4.onPress = value4; object4.disabled = isSubmitting; object4.loading = isSubmitting; r11 = object4; } else { object3 = {}; object3.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+']); object3.onPress = value4; object3.disabled = canSave ? isSubmitting : !canSave; object3.loading = isSubmitting; r11 = object3; } return ( {modalContent}