{"version":3,"sources":["jsdelivr-header.js","/npm/expo-exceptions@0.1.1/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,oBAAqB,iBAAoB,oBAElD,MAAM,qBAAuB,oBAAoB,wBAC3C,QAAU,IAAI,aAAkC,6BAehD,SAAU,sBACd,EACA,GAAmB,GAEnB,IAAK,SAAW,EAAkB,CAEhC,MAAM,EAAkB,WAAW,mBAEnC,WAAW,kBAAiB,CAAC,EAAO,KAClC,EAAc,EAAO,GAGrB,EAAgB,EAAO,EAAQ,GAEnC,CACF,QAGM,SAAU,iCAAiC,GAC/C,MAAM,QAAE,EAAO,4BAAE,GAA8B,GAAU,EAErD,GACF,sBAAsB,EAAS,EAEnC,QAGM,SAAU,0BACd,EACA,GAAmB,EACnB,GAAmB,GAEnB,GAAI,qBAAsB,CAExB,MAAM,EAAe,QAAQ,YAC3B,qBACA,EAAG,kBACG,EACF,EAAc,GAEd,YAAW,KACT,EAAc,EAAY,GACzB,EACL,IAOJ,OAFA,qBAAqB,0BAA0B,GAExC,KACL,EAAa,QAAQ,CAEzB,CAEE,OADA,QAAQ,KAAK,0DACN,MAEX,QAGM,SAAU,qCAAqC,GACnD,MAAM,iBAAE,GAAmB,EAAK,QAAE,GAAY,EAC1C,GACF,0BAA0B,EAAS,GAAkB,EAEzD,QAGM,SAAU,gBACd,OAAI,qBACK,qBAAqB,gBAEvB,QAAQ,QAAQ,GACzB","file":"/npm/expo-exceptions@0.1.1/build/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/expo-exceptions@0.1.1/build/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { requireNativeModule, EventEmitter } from 'expo-modules-core';\n\nconst ExpoExceptionHandler = requireNativeModule('ExpoExceptionHandler');\nconst emitter = new EventEmitter<Record<string, any>>(ExpoExceptionHandler);\n\n// Interface for JS exception handling options\nexport interface JSExceptionHandlerOptions {\n  onError?: (error: Error, isFatal?: boolean) => void;\n  catchErrorsNotCaughtByReact?: boolean;\n}\n\n// Interface for native exception handling options\nexport interface NativeExceptionHandlerOptions {\n  forceQuitOnError?: boolean;\n  onError?: (errorString: string) => void;\n}\n\n// Set up the JavaScript exception handler\nexport function setJSExceptionHandler(\n  customHandler: (error: Error, isFatal?: boolean) => void,\n  allowedInDevMode = false\n): void {\n  if (!__DEV__ || allowedInDevMode) {\n    // Store the custom handler\n    const previousHandler = ErrorUtils.getGlobalHandler();\n\n    ErrorUtils.setGlobalHandler((error, isFatal) => {\n      customHandler(error, isFatal);\n\n      // Call the previous handler\n      previousHandler(error, isFatal);\n    });\n  }\n}\n\n// Set up enhanced JavaScript exception handler with more options\nexport function setJSExceptionHandlerWithOptions(options: JSExceptionHandlerOptions): void {\n  const { onError, catchErrorsNotCaughtByReact = false } = options;\n\n  if (onError) {\n    setJSExceptionHandler(onError, catchErrorsNotCaughtByReact);\n  }\n}\n\n// Set up the native exception handler\nexport function setNativeExceptionHandler(\n  customHandler: (errorString: string) => void,\n  forceQuitOnError = false,\n  executeInContext = false\n) {\n  if (ExpoExceptionHandler) {\n    // Set up the event listener for native crashes\n    const subscription = emitter.addListener(\n      'exceptionCaptured',\n      ({ errorString }) => {\n        if (executeInContext) {\n          customHandler(errorString);\n        } else {\n          setTimeout(() => {\n            customHandler(errorString);\n          }, 0);\n        }\n      }\n    );\n\n    // Set up the native exception handler\n    ExpoExceptionHandler.setNativeExceptionHandler(forceQuitOnError);\n\n    return () => {\n      subscription.remove();\n    };\n  } else {\n    console.warn('ExpoExceptionHandler is not available on this platform');\n    return () => {}\n  }\n}\n\n// Set up enhanced native exception handler with more options\nexport function setNativeExceptionHandlerWithOptions(options: NativeExceptionHandlerOptions): void {\n  const { forceQuitOnError = false, onError } = options;\n  if (onError) {\n    setNativeExceptionHandler(onError, forceQuitOnError, true);\n  }\n}\n\n// Get the device info for error reporting\nexport function getDeviceInfo(): Promise<any> {\n  if (ExpoExceptionHandler) {\n    return ExpoExceptionHandler.getDeviceInfo();\n  }\n  return Promise.resolve({});\n}\n"]}