// Metro module 5370 (f5371). import { useMemo, useRef, memo } from "react"; import { StatusBar, View } from "react-native"; import { styles } from "./Module5371"; import { useStableCallback } from "./Module5250"; import { WINDOW_HEIGHT } from "./Module5246"; const r27 = memo(function BottomSheetHostingContainerComponent(props) { const { containerHeight, containerOffset, topInset = 0 } = props; const top = topInset; let bottomInset = props.bottomInset; if (bottomInset === void 0) { bottomInset = 0; } const bottom = bottomInset; const { shouldCalculateHeight = true, detached, style, children } = props; const ref = useRef(null); const memo = useMemo(() => [style, styles.container, { top, bottom, overflow: detached ? "visible" : "hidden" }], [style, detached, top, bottom]); const stableCallback = useStableCallback(function handleLayoutEvent(a0) { const height = a0.nativeEvent.layout.height; containerHeight.value = height; const current = ref.current; if (current != null) { current.measure((a0, a1, a2, a3, a4, a5) => { if (containerOffset.value) { let r10 = a5; const top2 = a5 == null ? 0 : a5; const r7 = Math; if (a5 == null) { r10 = 0; } const r20 = r10 + height; let currentHeight = StatusBar.currentHeight; if (currentHeight == null) { currentHeight = 0; } containerOffset.value = { top: top2, left: 0, right: 0, bottom: r7.max(0, WINDOW_HEIGHT - (r20 + currentHeight)) }; } }); } }); return {children}; }); r27.displayName = "BottomSheetHostingContainer"; export { r27 as BottomSheetHostingContainer };