{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/objectWithoutProperties\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nimport { CodedError, NativeModulesProxy } from '@unimodules/core';\nimport Platform from \"react-native-web/dist/exports/Platform\";\nimport { AppOwnership, ExecutionEnvironment, UserInterfaceIdiom } from \"./Constants.types\";\nimport ExponentConstants from \"./ExponentConstants\";\nexport { AppOwnership, ExecutionEnvironment, UserInterfaceIdiom };\n\nif (!ExponentConstants) {\n  console.warn(\"No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?\");\n}\n\nvar manifest = null;\n\nif (NativeModulesProxy.ExpoUpdates) {\n  var updatesManifest;\n\n  if (NativeModulesProxy.ExpoUpdates.manifest) {\n    updatesManifest = NativeModulesProxy.ExpoUpdates.manifest;\n  } else if (NativeModulesProxy.ExpoUpdates.manifestString) {\n    updatesManifest = JSON.parse(NativeModulesProxy.ExpoUpdates.manifestString);\n  }\n\n  if (updatesManifest && Object.keys(updatesManifest).length > 0) {\n    manifest = updatesManifest;\n  }\n}\n\nif (!manifest && ExponentConstants && ExponentConstants.manifest) {\n  manifest = ExponentConstants.manifest;\n\n  if (typeof manifest === 'string') {\n    manifest = JSON.parse(manifest);\n  }\n}\n\nvar _ref = ExponentConstants || {},\n    name = _ref.name,\n    appOwnership = _ref.appOwnership,\n    nativeConstants = _objectWithoutProperties(_ref, [\"name\", \"appOwnership\"]);\n\nvar constants = _objectSpread(_objectSpread({}, nativeConstants), {}, {\n  appOwnership: appOwnership != null ? appOwnership : null,\n  deviceId: nativeConstants.installationId,\n  linkingUrl: nativeConstants.linkingUri\n});\n\nObject.defineProperties(constants, {\n  manifest: {\n    enumerable: true,\n    get: function get() {\n      if (!manifest) {\n        var invalidManifestType = manifest === null ? 'null' : 'undefined';\n\n        if (nativeConstants.executionEnvironment === ExecutionEnvironment.Bare && Platform.OS !== 'web') {\n          console.warn(\"Constants.manifest is \" + invalidManifestType + \" because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.\");\n        } else if (nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient || nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone) {\n          throw new CodedError('ERR_CONSTANTS_MANIFEST_UNAVAILABLE', \"Constants.manifest is \" + invalidManifestType + \", must be an object.\");\n        }\n      }\n\n      return manifest;\n    },\n    set: function set(value) {\n      manifest = value;\n    }\n  }\n});\nexport default constants;","map":{"version":3,"sources":["../src/Constants.ts"],"names":[],"mappings":";;;;;;;AAAA,SAAS,UAAT,EAAqB,kBAArB,QAA+C,kBAA/C;;AAGA,SAEE,YAFF,EAIE,oBAJF,EAQE,kBARF;AAWA,OAAO,iBAAP;AAEA,SAEE,YAFF,EAIE,oBAJF,EAQE,kBARF;;AAYA,IAAI,CAAC,iBAAL,EAAwB;AACtB,EAAA,OAAO,CAAC,IAAR,CACE,wGADF;AAGD;;AAED,IAAI,QAAQ,GAAG,IAAf;;AAEA,IAAI,kBAAkB,CAAC,WAAvB,EAAoC;AAClC,MAAI,eAAJ;;AACA,MAAI,kBAAkB,CAAC,WAAnB,CAA+B,QAAnC,EAA6C;AAC3C,IAAA,eAAe,GAAG,kBAAkB,CAAC,WAAnB,CAA+B,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IACL,eAAe,CAAC,oBAAhB,KAAyC,oBAAoB,CAAC,WAA9D,IACA,eAAe,CAAC,oBAAhB,KAAyC,oBAAoB,CAAC,UAFzD,EAGL;AAGA,gBAAM,IAAI,UAAJ,CACJ,oCADI,6BAEqB,mBAFrB,0BAAN;AAID;AACF;;AACD,aAAO,QAAP;AACD,KAzBO;AA2BR,IAAA,GA3BQ,eA2BJ,KA3BI,EA2BC;AACP,MAAA,QAAQ,GAAG,KAAX;AACD;AA7BO;AADuB,CAAnC;AAkCA,eAAe,SAAf","sourcesContent":["import { CodedError, NativeModulesProxy } from '@unimodules/core';\nimport { Platform } from 'react-native';\n\nimport {\n  AndroidManifest,\n  AppOwnership,\n  Constants,\n  ExecutionEnvironment,\n  IOSManifest,\n  NativeConstants,\n  PlatformManifest,\n  UserInterfaceIdiom,\n  WebManifest,\n} from './Constants.types';\nimport ExponentConstants from './ExponentConstants';\n\nexport {\n  AndroidManifest,\n  AppOwnership,\n  Constants,\n  ExecutionEnvironment,\n  IOSManifest,\n  NativeConstants,\n  PlatformManifest,\n  UserInterfaceIdiom,\n  WebManifest,\n};\n\nif (!ExponentConstants) {\n  console.warn(\n    \"No native ExponentConstants module found, are you sure the expo-constants's module is linked properly?\"\n  );\n}\n\nlet manifest = null;\n// If expo-updates defines a non-empty manifest, prefer that one\nif (NativeModulesProxy.ExpoUpdates) {\n  let updatesManifest;\n  if (NativeModulesProxy.ExpoUpdates.manifest) {\n    updatesManifest = NativeModulesProxy.ExpoUpdates.manifest;\n  } else if (NativeModulesProxy.ExpoUpdates.manifestString) {\n    updatesManifest = JSON.parse(NativeModulesProxy.ExpoUpdates.manifestString);\n  }\n  if (updatesManifest && Object.keys(updatesManifest).length > 0) {\n    manifest = updatesManifest;\n  }\n}\n\n// Fall back to ExponentConstants.manifest if we don't have one from Updates\nif (!manifest && ExponentConstants && ExponentConstants.manifest) {\n  manifest = ExponentConstants.manifest;\n  // On Android we pass the manifest in JSON form so this step is necessary\n  if (typeof manifest === 'string') {\n    manifest = JSON.parse(manifest);\n  }\n}\n\nconst { name, appOwnership, ...nativeConstants } = (ExponentConstants || {}) as any;\n\nconst constants = {\n  ...nativeConstants,\n  // Ensure this is null in bare workflow\n  appOwnership: appOwnership ?? null,\n  // Legacy aliases\n  deviceId: nativeConstants.installationId,\n  linkingUrl: nativeConstants.linkingUri,\n};\n\nObject.defineProperties(constants, {\n  manifest: {\n    enumerable: true,\n    get() {\n      if (!manifest) {\n        const invalidManifestType = manifest === null ? 'null' : 'undefined';\n        if (\n          nativeConstants.executionEnvironment === ExecutionEnvironment.Bare &&\n          Platform.OS !== 'web'\n        ) {\n          console.warn(\n            `Constants.manifest is ${invalidManifestType} because the embedded app.config could not be read. Ensure that you have installed the expo-constants build scripts if you need to read from Constants.manifest.`\n          );\n        } else if (\n          nativeConstants.executionEnvironment === ExecutionEnvironment.StoreClient ||\n          nativeConstants.executionEnvironment === ExecutionEnvironment.Standalone\n        ) {\n          // If we somehow get here, this is a truly exceptional state to be in.\n          // Constants.manifest should *always* be defined in those contexts.\n          throw new CodedError(\n            'ERR_CONSTANTS_MANIFEST_UNAVAILABLE',\n            `Constants.manifest is ${invalidManifestType}, must be an object.`\n          );\n        }\n      }\n      return manifest;\n    },\n    // This setter is only useful to mock the value for tests\n    set(value) {\n      manifest = value;\n    },\n  },\n});\n\nexport default constants as Constants;\n"],"sourceRoot":""},"metadata":{},"sourceType":"module"}