/* Metro module 1816; source: unknown; dependencies: [29, 31, 27, 33, 1610, 1817, 1804, 1800, 1600, 1818] */
import ObjectWithoutProperties from './module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
import React from './module-00031-React.js'; /* Metro dependency 31 */
import Module01818 from './module-01818.js'; /* Metro dependency 1818 */
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from './module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as moduleValue2 from './module-01610.js'; /* Metro dependency 1610 */
import * as moduleValue5 from './module-01804.js'; /* Metro dependency 1804 */
import * as Module01817Module from './module-01817.js'; /* Metro dependency 1817 */
function _fun19818(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#19818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:6, offset: 0x00eb451d, size: 292 bytes, params: 8, frame: 20
const env0_0 = require;
const env0_3 = ['behavior', 'children', 'contentContainerStyle', 'enabled', 'keyboardVerticalOffset',
'automaticOffset', 'style', 'onLayout'];
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const forwardRef = ReactModule.forwardRef;
const env0_10 = {'x': 0, 'y': 0, 'width': 0, 'height': 0};
object = {code: 'function pnpm_indexTsx1(){const{initialFrame,defaultLayout}=this.__closure;return initialFrame.value||defaultLayout;}'};
object = {code: 'function pnpm_indexTsx2(){const{screenHeight,keyboard,keyboardVerticalOffset,frame}=this.__closure;const keyboardY=screenHeight-keyboard.heightWhenOpened.value-keyboardVerticalOffset;return Math.max(frame.value.y+frame.value.height-keyboardY,0);}'};
object = {code: 'function pnpm_indexTsx3(value){const{interpolate,relativeKeyboardHeight}=this.__closure;return interpolate(value,[0,1],[0,relativeKeyboardHeight()]);}'};
object = {code: 'function pnpm_indexTsx4(layout){const{keyboard,initialFrame,behavior}=this.__closure;if(keyboard.isClosed.value||initialFrame.value===null||behavior!=="height"){initialFrame.value=layout;}}'};
object = {code: 'function pnpm_indexTsx5(){const{enabled,interpolateToRelativeKeyboardHeight,keyboard,translate,padding,frame,behavior}=this.__closure;if(!enabled){return{};}const bottom=interpolateToRelativeKeyboardHeight(keyboard.progress.value);const translateY=interpolateToRelativeKeyboardHeight(translate.value);const paddingBottom=interpolateToRelativeKeyboardHeight(padding.value);const height=frame.value.height-bottom;switch(behavior){case"height":if(!keyboard.isClosed.value&&height>0){return{height:height,flex:0};}return{};case"position":return{bottom:bottom};case"padding":return{paddingBottom:bottom};case"translate-with-padding":return{paddingTop:paddingBottom,transform:[{translateY:-translateY}]};default:return{};}}'};
exports.default = forwardRef(_fun19819);
function _fun19819(a0, a1) { // fn#19819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:1839, offset: 0x00eb4641, size: 970 bytes, params: 3, frame: 36
var View2;
var Object;
var assign;
var object;
const behavior = a0.behavior;
const children = a0.children;
const contentContainerStyle = a0.contentContainerStyle;
const enabled = a0.enabled;
const r17 = enabled === undefined || enabled;
const keyboardVerticalOffset = a0.keyboardVerticalOffset;
const r22 = keyboardVerticalOffset === undefined ? 0 : keyboardVerticalOffset;
const automaticOffset = a0.automaticOffset;
let r0 = automaticOffset !== undefined && automaticOffset;
const env0_3 = r0;
const style = a0.style;
const onLayout = a0.onLayout;
const value2 = onLayout(a0, env0_3);
const value3 = (moduleValue2).useSharedValue(null);
const value4 = React.useRef(null);
const useDerivedValue = moduleValue2.useDerivedValue;
let closure = pnpm_indexTsx1;
let object3 = {initialFrame: value3, defaultLayout: env0_10};
closure.__closure = object3;
closure.__workletHash = 4703969179658;
closure.__initData = env0_11;
const value5 = Reflect.apply(useDerivedValue, moduleValue2, [closure]);
const {translate, padding} = (Module01817Module).useTranslateAnimation();
const value7 = (Module01817Module).useKeyboardAnimation();
const useWindowDimensions = moduleValue5.useWindowDimensions;
const height = Reflect.apply(useWindowDimensions, moduleValue5, []).height;
closure = pnpm_indexTsx2;
closure.__closure = {screenHeight: height, keyboard: value7, keyboardVerticalOffset: r22, frame: value5};
closure.__workletHash = 10539040422992;
closure.__initData = env0_12;
const value8 = useCallback(closure, [height, r22]);
closure = pnpm_indexTsx3;
closure.__closure = {interpolate: moduleValue2.interpolate, relativeKeyboardHeight: value8};
closure.__workletHash = 11482114301276;
closure.__initData = env0_13;
const value9 = useCallback(closure, [value8]);
closure = pnpm_indexTsx4;
closure.__closure = {keyboard: value7, initialFrame: value3, behavior: behavior};
closure.__workletHash = 12256944793057;
closure.__initData = env0_14;
var env0_14 = useCallback(closure, [behavior]);
const value10 = useCallback(_fun19824, [onLayout, r0]);
const useAnimatedStyle = moduleValue2.useAnimatedStyle;
closure = pnpm_indexTsx5;
closure.__closure = {enabled: r17, interpolateToRelativeKeyboardHeight: value9, keyboard: value7,
translate: translate, padding: padding, frame: value5, behavior: behavior};
closure.__workletHash = 6440002265153;
closure.__initData = env0_15;
const value11 = Reflect.apply(useAnimatedStyle, moduleValue2, [closure, [behavior, r17, value9]]);
const value12 = (Module01818)(value4, a1);
const value13 = behavior === 'position';
const value14 = useMemo(_fun19828, [value13 ? contentContainerStyle : style, value11]);
if (value13) {
Object = global.Object;
assign = Object.assign;
object3 = {ref: value12, style: style, onLayout: value10};
object = {};
object.children = ((View) => {children})((importDefault(1610) /* metro dependency 1610 */).View);
r0 = ;
} else {
View2 = (importDefault(1610) /* metro dependency 1610 */).View;
Object = global.Object;
r0 = ;
}
return r0;
function pnpm_indexTsx1() { // fn#19820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:2137, offset: 0x00eb4a0b, size: 24 bytes, params: 1, frame: 2
return ReactModule.useCallback.value || env1_10;
}
function pnpm_indexTsx2() { // fn#19821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:2415, offset: 0x00eb4a23, size: 93 bytes, params: 1, frame: 14
const value4 = height - env0_10.heightWhenOpened.value - env0_2;
const Math = global.Math;
return Math.max(React.value.y + React.value.height - value4, 0);
}
function pnpm_indexTsx3(a0) { // fn#19822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:2658, offset: 0x00eb4a80, size: 78 bytes, params: 2, frame: 15
let value = environment.__proto__;
value = require(1610) /* metro dependency 1610 */;
return value.interpolate(a0, [0, 1], [0, env0_12()]);
}
function pnpm_indexTsx4(a0) { // fn#19823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:2861, offset: 0x00eb4ace, size: 71 bytes, params: 2, frame: 4
let r1 = env0_10.isClosed.value || ReactModule.useCallback.value === null;
r1 = !r1 ? behavior !== 'height' : r1;
if (r1) {
ReactModule.useCallback.value = a0;
}
}
function _fun19824(a0) { // fn#19824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:3059, offset: 0x00eb4b15, size: 218 bytes, params: 2, frame: 17
var environment;
var value2;
var moduleValue;
var nodeHandle;
var value3;
var value;
if (onLayout != null) {
onLayout(a0);
}
const layout = a0.nativeEvent.layout;
if (env0_3) {
value2 = environment.__proto__;
moduleValue = require(1800) /* metro dependency 1800 */;
nodeHandle = moduleValue.findNodeHandle(ReactModule.useMemo.current);
if (nodeHandle !== null) {
value = (require(1600) /* metro dependency 1600 */).KeyboardControllerNative.viewPositionInWindow(nodeHandle);
value = value.then(_fun19825);
return value.catch(_fun19826);
}
value3 = environment.__proto__;
}
return moduleValue2.runOnUI(env0_14)(layout);
function _fun19825({x, y}) { // fn#19825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:3240, offset: 0x00eb4bef, size: 102 bytes, params: 2, frame: 18
let value = environment.__proto__.__proto__;
value = require(1610) /* metro dependency 1610 */;
value = value.runOnUI(env1_14);
const Object = global.Object;
value(Object.assign({}, layout, {x: x, y: y}));
}
function _fun19826() { // fn#19826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:3316, offset: 0x00eb4c55, size: 57 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(1610) /* metro dependency 1610 */;
value = value.runOnUI(env1_14);
value(layout);
}
}
function pnpm_indexTsx5() { // fn#19827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:3421, offset: 0x00eb4c8e, size: 224 bytes, params: 1, frame: 15
var binding;
var value3;
var value5;
var value7;
var value9;
var behaviorBinding;
if (env0_1) {
binding = env0_13;
value3 = binding(env0_10.progress.value);
binding = env0_13;
value5 = binding(translate.value);
binding = env0_13;
value7 = binding(padding.value);
value9 = React.value.height - value3;
behaviorBinding = behavior;
if (behaviorBinding === 'height') {
return env0_10.isClosed.value ? {} : value9 > 0 ? {height: value9, flex: 0} : {};
}
if (behaviorBinding === 'position') {
return {bottom: value3};
}
if (behaviorBinding === 'padding') {
return {paddingBottom: value3};
}
if (behaviorBinding === 'translate-with-padding') {
return {paddingTop: value7, transform: [{translateY: -value5}]};
}
}
return {};
}
function _fun19828() { // fn#19828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1943:3989, offset: 0x00eb4d6e, size: 25 bytes, params: 1, frame: 3
return [env0_16, env0_15];
}
}
}
global.__d(_fun19818, 1816, [29, 31, 27, 33, 1610, 1817, 1804, 1800, 1600,
1818]) /* metro module 1816, dependencies: [29, 31, 27, 33, 1610, 1817, 1804, 1800, 1600, 1818] */;