1{"version":3,"file":"getAndroidSplashConfig.js","names":["defaultResizeMode","getAndroidSplashConfig","config","android","splash","xxxhdpi","image","xxhdpi","xhdpi","hdpi","mdpi","backgroundColor","resizeMode","getAndroidDarkSplashConfig","dark","lightTheme"],"sources":["../../../../src/plugins/unversioned/expo-splash-screen/getAndroidSplashConfig.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nexport type SplashScreenConfig = {\n  xxxhdpi: string | null;\n  xxhdpi: string | null;\n  xhdpi: string | null;\n  hdpi: string | null;\n  mdpi: string | null;\n  backgroundColor: string | null;\n  resizeMode: 'contain' | 'cover' | 'native';\n};\n\nconst defaultResizeMode = 'contain';\n\nexport function getAndroidSplashConfig(\n  config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | null {\n  // Respect the splash screen object, don't mix and match across different splash screen objects\n  // in case the user wants the top level splash to apply to every platform except android.\n  if (config.android?.splash) {\n    const splash = config.android?.splash;\n    return {\n      xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n      xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n      xhdpi: splash.xhdpi ?? splash.image ?? null,\n      hdpi: splash.hdpi ?? splash.image ?? null,\n      mdpi: splash.mdpi ?? splash.image ?? null,\n      backgroundColor: splash.backgroundColor ?? null,\n      resizeMode: splash.resizeMode ?? defaultResizeMode,\n    };\n  }\n\n  if (config.splash) {\n    const splash = config.splash;\n    return {\n      xxxhdpi: splash.image ?? null,\n      xxhdpi: splash.image ?? null,\n      xhdpi: splash.image ?? null,\n      hdpi: splash.image ?? null,\n      mdpi: splash.image ?? null,\n      backgroundColor: splash.backgroundColor ?? null,\n      resizeMode: splash.resizeMode ?? defaultResizeMode,\n    };\n  }\n\n  return null;\n}\n\n// TODO: dark isn't supported in the Expo config spec yet.\nexport function getAndroidDarkSplashConfig(\n  config: Pick<ExpoConfig, 'splash' | 'android'>\n): SplashScreenConfig | null {\n  // Respect the splash screen object, don't mix and match across different splash screen objects\n  // in case the user wants the top level splash to apply to every platform except android.\n  if (config.android?.splash?.dark) {\n    const splash = config.android?.splash?.dark;\n    const lightTheme = getAndroidSplashConfig(config);\n    return {\n      xxxhdpi: splash.xxxhdpi ?? splash.image ?? null,\n      xxhdpi: splash.xxhdpi ?? splash.image ?? null,\n      xhdpi: splash.xhdpi ?? splash.image ?? null,\n      hdpi: splash.hdpi ?? splash.image ?? null,\n      mdpi: splash.mdpi ?? splash.image ?? null,\n      backgroundColor: splash.backgroundColor ?? null,\n      // Can't support dark resizeMode because the resize mode is hardcoded into the MainActivity.java\n      resizeMode: lightTheme?.resizeMode ?? defaultResizeMode,\n    };\n  }\n\n  return null;\n}\n"],"mappings":";;;;;;;AAYA,MAAMA,iBAAiB,GAAG,SAAS;AAE5B,SAASC,sBAAsB,CACpCC,MAA8C,EACnB;EAAA;EAC3B;EACA;EACA,uBAAIA,MAAM,CAACC,OAAO,4CAAd,gBAAgBC,MAAM,EAAE;IAAA;IAC1B,MAAMA,MAAM,uBAAGF,MAAM,CAACC,OAAO,qDAAd,iBAAgBC,MAAM;IACrC,OAAO;MACLC,OAAO,6BAAED,MAAM,CAACC,OAAO,6DAAID,MAAM,CAACE,KAAK,uCAAI,IAAI;MAC/CC,MAAM,6BAAEH,MAAM,CAACG,MAAM,2DAAIH,MAAM,CAACE,KAAK,yCAAI,IAAI;MAC7CE,KAAK,4BAAEJ,MAAM,CAACI,KAAK,yDAAIJ,MAAM,CAACE,KAAK,yCAAI,IAAI;MAC3CG,IAAI,2BAAEL,MAAM,CAACK,IAAI,uDAAIL,MAAM,CAACE,KAAK,yCAAI,IAAI;MACzCI,IAAI,2BAAEN,MAAM,CAACM,IAAI,uDAAIN,MAAM,CAACE,KAAK,yCAAI,IAAI;MACzCK,eAAe,2BAAEP,MAAM,CAACO,eAAe,yEAAI,IAAI;MAC/CC,UAAU,wBAAER,MAAM,CAACQ,UAAU,mEAAIZ;IACnC,CAAC;EACH;EAEA,IAAIE,MAAM,CAACE,MAAM,EAAE;IAA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