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,SAA1B;;AAEO,SAASC,sBAAT,CACLC,MADK,EAEsB;EAAA;;EAC3B;EACA;EACA,uBAAIA,MAAM,CAACC,OAAX,4CAAI,gBAAgBC,MAApB,EAA4B;IAAA;;IAC1B,MAAMA,MAAM,uBAAGF,MAAM,CAACC,OAAV,qDAAG,iBAAgBC,MAA/B;IACA,OAAO;MACLC,OAAO,6BAAED,MAAM,CAACC,OAAT,6DAAoBD,MAAM,CAACE,KAA3B,uCAAoC,IADtC;MAELC,MAAM,6BAAEH,MAAM,CAACG,MAAT,2DAAmBH,MAAM,CAACE,KAA1B,yCAAmC,IAFpC;MAGLE,KAAK,4BAAEJ,MAAM,CAACI,KAAT,yDAAkBJ,MAAM,CAACE,KAAzB,yCAAkC,IAHlC;MAILG,IAAI,2BAAEL,MAAM,CAACK,IAAT,uDAAiBL,MAAM,CAACE,KAAxB,yCAAiC,IAJhC;MAKLI,IAAI,2BAAEN,MAAM,CAACM,IAAT,uDAAiBN,MAAM,CAACE,KAAxB,yCAAiC,IALhC;MAMLK,eAAe,2BAAEP,MAAM,CAACO,eAAT,yEAA4B,IANtC;MAOLC,UAAU,wBAAER,MAAM,CAACQ,UAAT,mEAAuBZ;IAP5B,CAAP;EASD;;EAED,IAAIE,MAAM,C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