1{"version":3,"file":"Orientation.js","names":["withOrientation","createInfoPlistPluginWithPropertyGuard","setOrientation","infoPlistProperty","expoConfigProperty","getOrientation","config","orientation","PORTRAIT_ORIENTATIONS","LANDSCAPE_ORIENTATIONS","getUISupportedInterfaceOrientations","infoPlist","UISupportedInterfaceOrientations"],"sources":["../../src/ios/Orientation.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { createInfoPlistPluginWithPropertyGuard } from '../plugins/ios-plugins';\nimport { InfoPlist, InterfaceOrientation } from './IosConfig.types';\n\nexport const withOrientation = createInfoPlistPluginWithPropertyGuard(\n setOrientation,\n {\n infoPlistProperty: 'UISupportedInterfaceOrientations',\n expoConfigProperty: 'orientation',\n },\n 'withOrientation'\n);\n\nexport function getOrientation(config: Pick<ExpoConfig, 'orientation'>) {\n return config.orientation ?? null;\n}\n\nexport const PORTRAIT_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationPortrait',\n 'UIInterfaceOrientationPortraitUpsideDown',\n];\n\nexport const LANDSCAPE_ORIENTATIONS: InterfaceOrientation[] = [\n 'UIInterfaceOrientationLandscapeLeft',\n 'UIInterfaceOrientationLandscapeRight',\n];\n\nfunction getUISupportedInterfaceOrientations(orientation: string | null): InterfaceOrientation[] {\n if (orientation === 'portrait') {\n return PORTRAIT_ORIENTATIONS;\n } else if (orientation === 'landscape') {\n return LANDSCAPE_ORIENTATIONS;\n } else {\n return [...PORTRAIT_ORIENTATIONS, ...LANDSCAPE_ORIENTATIONS];\n }\n}\n\nexport function setOrientation(\n config: Pick<ExpoConfig, 'orientation'>,\n infoPlist: InfoPlist\n): InfoPlist {\n const orientation = getOrientation(config);\n\n return {\n ...infoPlist,\n UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation),\n };\n}\n"],"mappings":";;;;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGO,MAAMA,eAAe,GAAG,IAAAC,oDAAA,EAC7BC,cAD6B,EAE7B;EACEC,iBAAiB,EAAE,kCADrB;EAEEC,kBAAkB,EAAE;AAFtB,CAF6B,EAM7B,iBAN6B,CAAxB;;;AASA,SAASC,cAAT,CAAwBC,MAAxB,EAAiE;EAAA;;EACtE,8BAAOA,MAAM,CAACC,WAAd,qEAA6B,IAA7B;AACD;;AAEM,MAAMC,qBAA6C,GAAG,CAC3D,gCAD2D,EAE3D,0CAF2D,CAAtD;;AAKA,MAAMC,sBAA8C,GAAG,CAC5D,qCAD4D,EAE5D,sCAF4D,CAAvD;;;AAKP,SAASC,mCAAT,CAA6CH,WAA7C,EAAiG;EAC/F,IAAIA,WAAW,KAAK,UAApB,EAAgC;IAC9B,OAAOC,qBAAP;EACD,CAFD,MAEO,IAAID,WAAW,KAAK,WAApB,EAAiC;IACtC,OAAOE,sBAAP;EACD,CAFM,MAEA;IACL,OAAO,CAAC,GAAGD,qBAAJ,EAA2B,GAAGC,sBAA9B,CAAP;EACD;AACF;;AAEM,SAASP,cAAT,CACLI,MADK,EAELK,SAFK,EAGM;EACX,MAAMJ,WAAW,GAAGF,cAAc,CAACC,MAAD,CAAlC;EAEA,OAAO,EACL,GAAGK,SADE;IAELC,gCAAgC,EAAEF,mCAAmC,CAACH,WAAD;EAFhE,CAAP;AAID"}