/* Metro module 11533; source: modules/chat_input/native/useChatInputMaxHeight.tsx; dependencies: [57, 31, 1480, 11529, 1851, 5466, 4022, 1583, 1478, 11534, 4504, 4507, 4017, 2] */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import SubscribeToKeyboardUIStore from '../../keyboard/native/subscribeToKeyboardUIStore.tsx'; /* Metro dependency 1480 */ import SubscribeToWindowDimensionsNative from '../../screen/subscribeToWindowDimensions.native.tsx'; /* Metro dependency 11534 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as UseWindowDimensionsNativeModule from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */ import * as KeyboardTypesModule from '../../keyboard/native/KeyboardTypes.tsx'; /* Metro dependency 1583 */ import * as UseSystemKeyboardHeightNativeModule from '../../keyboard/native/useSystemKeyboardHeight.native.tsx'; /* Metro dependency 1851 */ import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import * as UseKeyboardTypeModule from '../../keyboard/native/useKeyboardType.tsx'; /* Metro dependency 4022 */ import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */ import * as UseCustomKeyboardHeightModule from '../../keyboard/native/useCustomKeyboardHeight.tsx'; /* Metro dependency 5466 */ import * as ChatInputConstantsModule from './ChatInputConstants.tsx'; /* Metro dependency 11529 */ function _fun88343(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:6, offset: 0x01fe0014, size: 220 bytes, params: 8, frame: 20 const env0_0 = require; const getChatInputMaxHeight2 = getChatInputMaxHeight; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/chat_input/native/useChatInputMaxHeight.tsx'); exports.default = useChatInputMaxHeight; exports.getChatInputMinHeight = function() { return CHAT_INPUT_PILL_CONTENT_SIZE; }; exports.getChatInputMaxHeight = getChatInputMaxHeight2; exports.getChatInputHeightAnimationTiming = getChatInputHeightAnimationTiming; function getChatInputMaxHeight() { // fn#88344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:169, offset: 0x01fe00f0, size: 215 bytes, params: 1, frame: 17 const systemKeyboardHeight = (UseSystemKeyboardHeightNativeModule).getSystemKeyboardHeight(); const customKeyboardHeight = (UseCustomKeyboardHeightModule).getCustomKeyboardHeight(); const keyboardType = (UseKeyboardTypeModule).getKeyboardType(); const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes; const SYSTEM = KeyboardTypes.SYSTEM; const r2 = keyboardType === SYSTEM ? systemKeyboardHeight : customKeyboardHeight; const getWindowDimensions = UseWindowDimensionsNativeModule.getWindowDimensions; const value5 = Reflect.apply(getWindowDimensions, UseWindowDimensionsNativeModule, [{ignoreKeyboard: true}]).height - r2; const Math = global.Math; const min = Math.min; const Math2 = global.Math; return Reflect.apply(min, Math, [200, Math2.max(2 * CHAT_INPUT_PILL_CONTENT_SIZE, value5 - 200)]); } function useChatInputMaxHeight(a0) { // fn#88345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:538, offset: 0x01fe01c7, size: 90 bytes, params: 2, frame: 16 let env0_0 = a0; const useState = ReactModule.useState; const value = Module00057(Reflect.apply(useState, ReactModule, [getChatInputMaxHeight]), 2); const property = value[0]; let env0_1 = value[1]; ReactModule.useEffect(function() { var closure = _fun88347; var env0_0 = importDefault(dependencyMap[9])(closure); var env0_1 = SubscribeToKeyboardUIStore(closure); return _fun88349; }, [a0]); return property; function _fun88346() { // fn#88346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:655, offset: 0x01fe0221, size: 65 bytes, params: 1, frame: 14 const maybeUpdateMaxHeight2 = maybeUpdateMaxHeight; const env0_0 = (SubscribeToWindowDimensionsNative)(maybeUpdateMaxHeight2); const env0_1 = SubscribeToKeyboardUIStore(maybeUpdateMaxHeight2); return _fun88349; function maybeUpdateMaxHeight() { // fn#88347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:685, offset: 0x01fe0262, size: 25 bytes, params: 1, frame: 11 env1_1(_fun88348); function _fun88348(a0) { // fn#88348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:693, offset: 0x01fe027b, size: 49 bytes, params: 2, frame: 13 var r0; let value = a0; const chatInputMaxHeight = getChatInputMaxHeight(); if (value === chatInputMaxHeight) { r0 = value; } else { value = environment.__proto__.__proto__; if (env2_0 == null) { r0 = chatInputMaxHeight; } else { env2_0(); r0 = chatInputMaxHeight; } } return r0; } } function _fun88349() { // fn#88349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:827, offset: 0x00e6ab0d, size: 23 bytes, params: 1, frame: 10 env0_0(); env0_1(); } } } function getChatInputHeightAnimationTiming(a0) { // fn#88351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11719:1000, offset: 0x01fe02ac, size: 121 bytes, params: 2, frame: 17 const Math = global.Math; const value3 = Math.min(a0, getChatInputMaxHeight()); const withTiming = TimingModule.withTiming; const object = {}; object.duration = (require(4507) /* metro dependency 4507: timingPresets */).timingFastDuration; const Easing = (ReanimatedRexportModule).Easing; object.easing = Easing.linear; return Reflect.apply(withTiming, TimingModule, [value3, object]); } } global.__d(_fun88343, 11533, [57, 31, 1480, 11529, 1851, 5466, 4022, 1583, 1478, 11534, 4504, 4507, 4017, 2]) /* metro module 11533, dependencies: [57, 31, 1480, 11529, 1851, 5466, 4022, 1583, 1478, 11534, 4504, 4507, 4017, 2] */;