{"ast":null,"code":"\"use strict\";\n\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/objectWithoutPropertiesLoose\";\nconst _excluded = [\"header\", \"headerShown\", \"headerBackImageSource\", \"headerLeft\", \"headerTransparent\", \"headerBackTitle\", \"presentation\", \"contentStyle\"],\n  _excluded2 = [\"label\"],\n  _excluded3 = [\"tintColor\", \"label\"];\nimport { getHeaderTitle, Header, HeaderBackButton, HeaderBackContext, SafeAreaProviderCompat, Screen, useHeaderHeight } from '@react-navigation/elements';\nimport { useLinkBuilder } from '@react-navigation/native';\nimport * as React from 'react';\nimport Animated from \"react-native-web/dist/exports/Animated\";\nimport Image from \"react-native-web/dist/exports/Image\";\nimport StyleSheet from \"react-native-web/dist/exports/StyleSheet\";\nimport View from \"react-native-web/dist/exports/View\";\nimport { AnimatedHeaderHeightContext } from \"../utils/useAnimatedHeaderHeight.js\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst TRANSPARENT_PRESENTATIONS = ['transparentModal', 'containedTransparentModal'];\nexport function NativeStackView({\n  state,\n  descriptors,\n  describe\n}) {\n  const parentHeaderBack = React.useContext(HeaderBackContext);\n  const {\n    buildHref\n  } = useLinkBuilder();\n  const preloadedDescriptors = state.preloadedRoutes.reduce((acc, route) => {\n    acc[route.key] = acc[route.key] || describe(route, true);\n    return acc;\n  }, {});\n  return _jsx(SafeAreaProviderCompat, {\n    children: state.routes.concat(state.preloadedRoutes).map((route, i) => {\n      const isFocused = state.index === i;\n      const previousKey = state.routes[i - 1]?.key;\n      const nextKey = state.routes[i + 1]?.key;\n      const previousDescriptor = previousKey ? descriptors[previousKey] : undefined;\n      const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;\n      const {\n        options,\n        navigation,\n        render\n      } = descriptors[route.key] ?? preloadedDescriptors[route.key];\n      const headerBack = previousDescriptor ? {\n        title: getHeaderTitle(previousDescriptor.options, previousDescriptor.route.name),\n        href: buildHref(previousDescriptor.route.name, previousDescriptor.route.params)\n      } : parentHeaderBack;\n      const canGoBack = headerBack != null;\n      const {\n          header,\n          headerShown,\n          headerBackImageSource,\n          headerLeft,\n          headerTransparent,\n          headerBackTitle,\n          presentation,\n          contentStyle\n        } = options,\n        rest = _objectWithoutPropertiesLoose(options, _excluded);\n      const nextPresentation = nextDescriptor?.options.presentation;\n      const isPreloaded = preloadedDescriptors[route.key] !== undefined && descriptors[route.key] === undefined;\n      return _jsx(Screen, {\n        focused: isFocused,\n        route: route,\n        navigation: navigation,\n        headerShown: headerShown,\n        headerTransparent: headerTransparent,\n        header: header !== undefined ? header({\n          back: headerBack,\n          options,\n          route,\n          navigation\n        }) : _jsx(Header, Object.assign({}, rest, {\n          back: headerBack,\n          title: getHeaderTitle(options, route.name),\n          headerLeft: typeof headerLeft === 'function' ? _ref => {\n            let {\n                label\n              } = _ref,\n              rest = _objectWithoutPropertiesLoose(_ref, _excluded2);\n            return headerLeft(Object.assign({}, rest, {\n              label: headerBackTitle ?? label\n            }));\n          } : headerLeft === undefined && canGoBack ? _ref2 => {\n            let {\n                tintColor,\n                label\n              } = _ref2,\n              rest = _objectWithoutPropertiesLoose(_ref2, _excluded3);\n            return _jsx(HeaderBackButton, Object.assign({}, rest, {\n              label: headerBackTitle ?? label,\n              tintColor: tintColor,\n              backImage: headerBackImageSource !== undefined ? () => _jsx(Image, {\n                source: headerBackImageSource,\n                resizeMode: \"contain\",\n                tintColor: tintColor,\n                style: styles.backImage\n              }) : undefined,\n              onPress: navigation.goBack\n            }));\n          } : headerLeft,\n          headerTransparent: headerTransparent\n        })),\n        style: [StyleSheet.absoluteFill, {\n          display: (isFocused || nextPresentation != null && TRANSPARENT_PRESENTATIONS.includes(nextPresentation)) && !isPreloaded ? 'flex' : 'none'\n        }, presentation != null && TRANSPARENT_PRESENTATIONS.includes(presentation) ? {\n          backgroundColor: 'transparent'\n        } : null],\n        children: _jsx(HeaderBackContext.Provider, {\n          value: headerBack,\n          children: _jsx(AnimatedHeaderHeightProvider, {\n            children: _jsx(View, {\n              style: [styles.contentContainer, contentStyle],\n              children: render()\n            })\n          })\n        })\n      }, route.key);\n    })\n  });\n}\nconst AnimatedHeaderHeightProvider = ({\n  children\n}) => {\n  const headerHeight = useHeaderHeight();\n  const [animatedHeaderHeight] = React.useState(() => new Animated.Value(headerHeight));\n  React.useEffect(() => {\n    animatedHeaderHeight.setValue(headerHeight);\n  }, [animatedHeaderHeight, headerHeight]);\n  return _jsx(AnimatedHeaderHeightContext.Provider, {\n    value: animatedHeaderHeight,\n    children: children\n  });\n};\nconst styles = StyleSheet.create({\n  contentContainer: {\n    flex: 1\n  },\n  backImage: {\n    height: 24,\n    width: 24,\n    margin: 3\n  }\n});","map":{"version":3,"names":["getHeaderTitle","Header","HeaderBackButton","HeaderBackContext","SafeAreaProviderCompat","Screen","useHeaderHeight","useLinkBuilder","React","Animated","Image","StyleSheet","View","AnimatedHeaderHeightContext","jsx","_jsx","TRANSPARENT_PRESENTATIONS","NativeStackView","state","descriptors","describe","parentHeaderBack","useContext","buildHref","preloadedDescriptors","preloadedRoutes","reduce","acc","route","key","children","routes","concat","map","i","isFocused","index","previousKey","nextKey","previousDescriptor","undefined","nextDescriptor","options","navigation","render","headerBack","title","name","href","params","canGoBack","header","headerShown","headerBackImageSource","headerLeft","headerTransparent","headerBackTitle","presentation","contentStyle","rest","_objectWithoutPropertiesLoose","_excluded","nextPresentation","isPreloaded","focused","back","Object","assign","_ref","label","_excluded2","_ref2","tintColor","_excluded3","backImage","source","resizeMode","style","styles","onPress","goBack","absoluteFill","display","includes","backgroundColor","Provider","value","AnimatedHeaderHeightProvider","contentContainer","headerHeight","animatedHeaderHeight","useState","Value","useEffect","setValue","create","flex","height","width","margin"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/@react-navigation/native-stack/src/views/NativeStackView.tsx"],"sourcesContent":["import {\n  getHeaderTitle,\n  Header,\n  HeaderBackButton,\n  HeaderBackContext,\n  SafeAreaProviderCompat,\n  Screen,\n  useHeaderHeight,\n} from '@react-navigation/elements';\nimport {\n  type ParamListBase,\n  type RouteProp,\n  type StackNavigationState,\n  useLinkBuilder,\n} from '@react-navigation/native';\nimport * as React from 'react';\nimport { Animated, Image, StyleSheet, View } from 'react-native';\n\nimport type {\n  NativeStackDescriptor,\n  NativeStackDescriptorMap,\n  NativeStackNavigationHelpers,\n} from '../types';\nimport { AnimatedHeaderHeightContext } from '../utils/useAnimatedHeaderHeight';\n\ntype Props = {\n  state: StackNavigationState<ParamListBase>;\n  // This is used for the native implementation of the stack.\n  navigation: NativeStackNavigationHelpers;\n  descriptors: NativeStackDescriptorMap;\n  describe: (\n    route: RouteProp<ParamListBase>,\n    placeholder: boolean\n  ) => NativeStackDescriptor;\n};\n\nconst TRANSPARENT_PRESENTATIONS = [\n  'transparentModal',\n  'containedTransparentModal',\n];\n\nexport function NativeStackView({ state, descriptors, describe }: Props) {\n  const parentHeaderBack = React.useContext(HeaderBackContext);\n  const { buildHref } = useLinkBuilder();\n\n  const preloadedDescriptors =\n    state.preloadedRoutes.reduce<NativeStackDescriptorMap>((acc, route) => {\n      acc[route.key] = acc[route.key] || describe(route, true);\n      return acc;\n    }, {});\n\n  return (\n    <SafeAreaProviderCompat>\n      {state.routes.concat(state.preloadedRoutes).map((route, i) => {\n        const isFocused = state.index === i;\n        const previousKey = state.routes[i - 1]?.key;\n        const nextKey = state.routes[i + 1]?.key;\n        const previousDescriptor = previousKey\n          ? descriptors[previousKey]\n          : undefined;\n        const nextDescriptor = nextKey ? descriptors[nextKey] : undefined;\n        const { options, navigation, render } =\n          descriptors[route.key] ?? preloadedDescriptors[route.key];\n\n        const headerBack = previousDescriptor\n          ? {\n              title: getHeaderTitle(\n                previousDescriptor.options,\n                previousDescriptor.route.name\n              ),\n              href: buildHref(\n                previousDescriptor.route.name,\n                previousDescriptor.route.params\n              ),\n            }\n          : parentHeaderBack;\n\n        const canGoBack = headerBack != null;\n\n        const {\n          header,\n          headerShown,\n          headerBackImageSource,\n          headerLeft,\n          headerTransparent,\n          headerBackTitle,\n          presentation,\n          contentStyle,\n          ...rest\n        } = options;\n\n        const nextPresentation = nextDescriptor?.options.presentation;\n\n        const isPreloaded =\n          preloadedDescriptors[route.key] !== undefined &&\n          descriptors[route.key] === undefined;\n\n        return (\n          <Screen\n            key={route.key}\n            focused={isFocused}\n            route={route}\n            navigation={navigation}\n            headerShown={headerShown}\n            headerTransparent={headerTransparent}\n            header={\n              header !== undefined ? (\n                header({\n                  back: headerBack,\n                  options,\n                  route,\n                  navigation,\n                })\n              ) : (\n                <Header\n                  {...rest}\n                  back={headerBack}\n                  title={getHeaderTitle(options, route.name)}\n                  headerLeft={\n                    typeof headerLeft === 'function'\n                      ? ({ label, ...rest }) =>\n                          headerLeft({\n                            ...rest,\n                            label: headerBackTitle ?? label,\n                          })\n                      : headerLeft === undefined && canGoBack\n                        ? ({ tintColor, label, ...rest }) => (\n                            <HeaderBackButton\n                              {...rest}\n                              label={headerBackTitle ?? label}\n                              tintColor={tintColor}\n                              backImage={\n                                headerBackImageSource !== undefined\n                                  ? () => (\n                                      <Image\n                                        source={headerBackImageSource}\n                                        resizeMode=\"contain\"\n                                        tintColor={tintColor}\n                                        style={styles.backImage}\n                                      />\n                                    )\n                                  : undefined\n                              }\n                              onPress={navigation.goBack}\n                            />\n                          )\n                        : headerLeft\n                  }\n                  headerTransparent={headerTransparent}\n                />\n              )\n            }\n            style={[\n              StyleSheet.absoluteFill,\n              {\n                display:\n                  (isFocused ||\n                    (nextPresentation != null &&\n                      TRANSPARENT_PRESENTATIONS.includes(nextPresentation))) &&\n                  !isPreloaded\n                    ? 'flex'\n                    : 'none',\n              },\n              presentation != null &&\n              TRANSPARENT_PRESENTATIONS.includes(presentation)\n                ? { backgroundColor: 'transparent' }\n                : null,\n            ]}\n          >\n            <HeaderBackContext.Provider value={headerBack}>\n              <AnimatedHeaderHeightProvider>\n                <View style={[styles.contentContainer, contentStyle]}>\n                  {render()}\n                </View>\n              </AnimatedHeaderHeightProvider>\n            </HeaderBackContext.Provider>\n          </Screen>\n        );\n      })}\n    </SafeAreaProviderCompat>\n  );\n}\n\nconst AnimatedHeaderHeightProvider = ({\n  children,\n}: {\n  children: React.ReactNode;\n}) => {\n  const headerHeight = useHeaderHeight();\n  const [animatedHeaderHeight] = React.useState(\n    () => new Animated.Value(headerHeight)\n  );\n\n  React.useEffect(() => {\n    animatedHeaderHeight.setValue(headerHeight);\n  }, [animatedHeaderHeight, headerHeight]);\n\n  return (\n    <AnimatedHeaderHeightContext.Provider value={animatedHeaderHeight}>\n      {children}\n    </AnimatedHeaderHeightContext.Provider>\n  );\n};\n\nconst styles = StyleSheet.create({\n  contentContainer: {\n    flex: 1,\n  },\n  backImage: {\n    height: 24,\n    width: 24,\n    margin: 3,\n  },\n});\n"],"mappings":";;;;;;AAAA,SACEA,cAAc,EACdC,MAAM,EACNC,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,EACtBC,MAAM,EACNC,eAAe,QACV,4BAA4B;AACnC,SAIEC,cAAc,QACT,0BAA0B;AACjC,OAAO,KAAKC,KAAK,MAAM,OAAO;AAAA,OAAAC,QAAA;AAAA,OAAAC,KAAA;AAAA,OAAAC,UAAA;AAAA,OAAAC,IAAA;AAQ9B,SAASC,2BAA2B;AAA2C,SAAAC,GAAA,IAAAC,IAAA;AAa/E,MAAMC,yBAAyB,GAAG,CAChC,kBAAkB,EAClB,2BAA2B,CAC5B;AAED,OAAO,SAASC,eAAeA,CAAC;EAAEC,KAAK;EAAEC,WAAW;EAAEC;AAAgB,CAAC,EAAE;EACvE,MAAMC,gBAAgB,GAAGb,KAAK,CAACc,UAAU,CAACnB,iBAAiB,CAAC;EAC5D,MAAM;IAAEoB;EAAU,CAAC,GAAGhB,cAAc,CAAC,CAAC;EAEtC,MAAMiB,oBAAoB,GACxBN,KAAK,CAACO,eAAe,CAACC,MAAM,CAA2B,CAACC,GAAG,EAAEC,KAAK,KAAK;IACrED,GAAG,CAACC,KAAK,CAACC,GAAG,CAAC,GAAGF,GAAG,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