{"ast":null,"code":"import React from \"react\";\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport View from \"react-native-web/dist/exports/View\";\nimport registerRootComponent from \"./fork/expo/registerRootComponent\";\nimport { SplashScreen, _internal_preventAutoHideAsync } from \"./views/Splash\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction isBaseObject(obj) {\n  if (Object.prototype.toString.call(obj) !== \"[object Object]\") {\n    return false;\n  }\n  var proto = Object.getPrototypeOf(obj);\n  if (proto === null) {\n    return true;\n  }\n  return proto === Object.prototype;\n}\nfunction isErrorShaped(error) {\n  return error && typeof error === \"object\" && typeof error.name === \"string\" && typeof error.message === \"string\";\n}\nfunction convertError(error) {\n  if (isErrorShaped(error)) {\n    return error;\n  }\n  if (process.env.NODE_ENV === \"development\") {\n    if (error == null) {\n      return new Error(\"A null/undefined error was thrown.\");\n    }\n  }\n  if (isBaseObject(error)) {\n    return new Error(JSON.stringify(error));\n  }\n  return new Error(String(error));\n}\nexport function renderRootComponent(Component) {\n  try {\n    setTimeout(function () {\n      _internal_preventAutoHideAsync();\n    });\n    registerRootComponent(Component);\n  } catch (e) {\n    SplashScreen.hideAsync();\n    var error = convertError(e);\n    registerRootComponent(function () {\n      return _jsx(View, {});\n    });\n    if (Platform.OS === \"web\") {\n      console.error(error);\n      console.error(`A runtime error has occurred while rendering the root component.`);\n    }\n    setTimeout(function () {\n      throw error;\n    });\n  }\n}","map":{"version":3,"names":["React","Platform","View","registerRootComponent","SplashScreen","_internal_preventAutoHideAsync","jsx","_jsx","isBaseObject","obj","Object","prototype","toString","call","proto","getPrototypeOf","isErrorShaped","error","name","message","convertError","process","env","NODE_ENV","Error","JSON","stringify","String","renderRootComponent","Component","setTimeout","e","hideAsync","OS","console"],"sources":["/Users/Daniel.Antelo/Workspaces/expo-template-reactrouter-nativebase/node_modules/expo-router/src/renderRootComponent.tsx"],"sourcesContent":["import React from \"react\";\nimport { Platform, View } from \"react-native\";\n\nimport registerRootComponent from \"./fork/expo/registerRootComponent\";\nimport { SplashScreen, _internal_preventAutoHideAsync } from \"./views/Splash\";\n\nfunction isBaseObject(obj: any) {\n  if (Object.prototype.toString.call(obj) !== \"[object Object]\") {\n    return false;\n  }\n  const proto = Object.getPrototypeOf(obj);\n  if (proto === null) {\n    return true;\n  }\n  return proto === Object.prototype;\n}\n\nfunction isErrorShaped(error: any): error is Error {\n  return (\n    error &&\n    typeof error === \"object\" &&\n    typeof error.name === \"string\" &&\n    typeof error.message === \"string\"\n  );\n}\n\n/**\n * After we throw this error, any number of tools could handle it.\n * This check ensures the error is always in a reason state before surfacing it to the runtime.\n */\nfunction convertError(error: any) {\n  if (isErrorShaped(error)) {\n    return error;\n  }\n\n  if (process.env.NODE_ENV === \"development\") {\n    if (error == null) {\n      return new Error(\"A null/undefined error was thrown.\");\n    }\n  }\n\n  if (isBaseObject(error)) {\n    return new Error(JSON.stringify(error));\n  }\n\n  return new Error(String(error));\n}\n\n/**\n * Register and mount the root component using the predefined rendering\n * method. This function ensures the Splash Screen and errors are handled correctly.\n */\nexport function renderRootComponent(Component: React.ComponentType<any>) {\n  try {\n    // This must be delayed so the user has a chance to call it first.\n    setTimeout(() => {\n      _internal_preventAutoHideAsync();\n    });\n\n    registerRootComponent(Component);\n  } catch (e) {\n    // Hide the splash screen if there was an error so the user can see it.\n    SplashScreen.hideAsync();\n\n    const error = convertError(e);\n    // Prevent the app from throwing confusing:\n    //  ERROR  Invariant Violation: \"main\" has not been registered. This can happen if:\n    // * Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.\n    // * A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called.\n    registerRootComponent(() => <View />);\n\n    // Console is pretty useless on native, on web you get interactive stack traces.\n    if (Platform.OS === \"web\") {\n      console.error(error);\n      console.error(\n        `A runtime error has occurred while rendering the root component.`\n      );\n    }\n\n    // Give React a tick to render before throwing.\n    setTimeout(() => {\n      throw error;\n    });\n\n    // TODO: Render a production-only error screen.\n  }\n}\n"],"mappings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