{"version":3,"names":["useTheme","React","Platform","ScreenStackHeaderBackButtonImage","ScreenStackHeaderCenterView","ScreenStackHeaderConfig","ScreenStackHeaderLeftView","ScreenStackHeaderRightView","ScreenStackHeaderSearchBarView","SearchBar","isSearchBarAvailableForCurrentPlatform","executeNativeBackPress","useBackPressSubscription","processFonts","HeaderConfig","_ref","backButtonImage","backButtonInCustomView","direction","disableBackButtonMenu","headerBackTitle","headerBackTitleStyle","headerBackTitleVisible","headerCenter","headerHideBackButton","headerHideShadow","headerLargeStyle","headerLargeTitle","headerLargeTitleHideShadow","headerLargeTitleStyle","headerLeft","headerRight","headerShown","headerStyle","headerTintColor","headerTitle","headerTitleStyle","headerTopInsetEnabled","headerTranslucent","route","searchBar","title","colors","tintColor","primary","handleAttached","handleDetached","clearSubscription","createSubscription","onBackPress","isDisabled","disableBackButtonOverride","backTitleFontFamily","largeTitleFontFamily","titleFontFamily","fontFamily","useEffect","processedSearchBarOptions","useMemo","OS","onFocus","_searchBar$onFocus","_len","arguments","length","args","Array","_key","call","onClose","_searchBar$onClose","_len2","_key2","createElement","backgroundColor","card","backTitle","backTitleFontSize","fontSize","backTitleVisible","blurEffect","color","hidden","hideBackButton","hideShadow","largeTitle","largeTitleBackgroundColor","largeTitleColor","largeTitleFontSize","largeTitleFontWeight","fontWeight","largeTitleHideShadow","undefined","name","titleColor","text","titleFontSize","titleFontWeight","topInsetEnabled","translucent","onAttached","onDetached","key","source"],"sources":["HeaderConfig.tsx"],"sourcesContent":["import { Route, useTheme } from '@react-navigation/native';\nimport * as React from 'react';\nimport { Platform } from 'react-native';\nimport {\n ScreenStackHeaderBackButtonImage,\n ScreenStackHeaderCenterView,\n ScreenStackHeaderConfig,\n ScreenStackHeaderLeftView,\n ScreenStackHeaderRightView,\n ScreenStackHeaderSearchBarView,\n SearchBar,\n SearchBarProps,\n isSearchBarAvailableForCurrentPlatform,\n executeNativeBackPress,\n} from 'react-native-screens';\nimport { NativeStackNavigationOptions } from '../types';\nimport { useBackPressSubscription } from '../utils/useBackPressSubscription';\nimport { processFonts } from './FontProcessor';\n\ntype Props = NativeStackNavigationOptions & {\n route: Route;\n};\n\nexport default function HeaderConfig({\n backButtonImage,\n backButtonInCustomView,\n direction,\n disableBackButtonMenu,\n headerBackTitle,\n headerBackTitleStyle = {},\n headerBackTitleVisible = true,\n headerCenter,\n headerHideBackButton,\n headerHideShadow,\n headerLargeStyle = {},\n headerLargeTitle,\n headerLargeTitleHideShadow,\n headerLargeTitleStyle = {},\n headerLeft,\n headerRight,\n headerShown,\n headerStyle = {},\n headerTintColor,\n headerTitle,\n headerTitleStyle = {},\n headerTopInsetEnabled = true,\n headerTranslucent,\n route,\n searchBar,\n title,\n}: Props): JSX.Element {\n const { colors } = useTheme();\n const tintColor = headerTintColor ?? colors.primary;\n\n // We need to use back press subscription here to override back button behavior on JS side.\n // Because screens are usually used with react-navigation and this library overrides back button\n // we need to handle it first in case when search bar is open\n const {\n handleAttached,\n handleDetached,\n clearSubscription,\n createSubscription,\n } = useBackPressSubscription({\n onBackPress: executeNativeBackPress,\n isDisabled: !searchBar || !!searchBar.disableBackButtonOverride,\n });\n\n const [backTitleFontFamily, largeTitleFontFamily, titleFontFamily] =\n processFonts([\n headerBackTitleStyle.fontFamily,\n headerLargeTitleStyle.fontFamily,\n headerTitleStyle.fontFamily,\n ]);\n\n // We want to clear clearSubscription only when components unmounts or search bar changes\n // eslint-disable-next-line react-hooks/exhaustive-deps\n React.useEffect(() => clearSubscription, [searchBar]);\n\n const processedSearchBarOptions = React.useMemo(() => {\n if (\n Platform.OS === 'android' &&\n searchBar &&\n !searchBar.disableBackButtonOverride\n ) {\n const onFocus: SearchBarProps['onFocus'] = (...args) => {\n createSubscription();\n searchBar.onFocus?.(...args);\n };\n const onClose: SearchBarProps['onClose'] = (...args) => {\n clearSubscription();\n searchBar.onClose?.(...args);\n };\n\n return { ...searchBar, onFocus, onClose };\n }\n return searchBar;\n }, [searchBar, createSubscription, clearSubscription]);\n\n return (\n