1"use strict"; 2 3Object.defineProperty(exports, "__esModule", { 4 value: true 5}); 6exports.PORTRAIT_ORIENTATIONS = exports.LANDSCAPE_ORIENTATIONS = void 0; 7exports.getOrientation = getOrientation; 8exports.setOrientation = setOrientation; 9exports.withOrientation = void 0; 10function _iosPlugins() { 11 const data = require("../plugins/ios-plugins"); 12 _iosPlugins = function () { 13 return data; 14 }; 15 return data; 16} 17const withOrientation = (0, _iosPlugins().createInfoPlistPluginWithPropertyGuard)(setOrientation, { 18 infoPlistProperty: 'UISupportedInterfaceOrientations', 19 expoConfigProperty: 'orientation' 20}, 'withOrientation'); 21exports.withOrientation = withOrientation; 22function getOrientation(config) { 23 var _config$orientation; 24 return (_config$orientation = config.orientation) !== null && _config$orientation !== void 0 ? _config$orientation : null; 25} 26const PORTRAIT_ORIENTATIONS = ['UIInterfaceOrientationPortrait', 'UIInterfaceOrientationPortraitUpsideDown']; 27exports.PORTRAIT_ORIENTATIONS = PORTRAIT_ORIENTATIONS; 28const LANDSCAPE_ORIENTATIONS = ['UIInterfaceOrientationLandscapeLeft', 'UIInterfaceOrientationLandscapeRight']; 29exports.LANDSCAPE_ORIENTATIONS = LANDSCAPE_ORIENTATIONS; 30function getUISupportedInterfaceOrientations(orientation) { 31 if (orientation === 'portrait') { 32 return PORTRAIT_ORIENTATIONS; 33 } else if (orientation === 'landscape') { 34 return LANDSCAPE_ORIENTATIONS; 35 } else { 36 return [...PORTRAIT_ORIENTATIONS, ...LANDSCAPE_ORIENTATIONS]; 37 } 38} 39function setOrientation(config, infoPlist) { 40 const orientation = getOrientation(config); 41 return { 42 ...infoPlist, 43 UISupportedInterfaceOrientations: getUISupportedInterfaceOrientations(orientation) 44 }; 45} 46//# sourceMappingURL=Orientation.js.map