Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,282 @@
|
||||
/* Metro module 7717; source: modules/device/native/DeviceOrientation.tsx; dependencies: [31, 27, 629, 477, 690, 4092, 7718, 2] */
|
||||
function _fun61716(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:6, offset: 0x01b49394, size: 470 bytes, params: 8, frame: 27
|
||||
var object2;
|
||||
const env0_0 = require;
|
||||
const closure = handleOrientationChange;
|
||||
const consumeUnlockAfterRotationToLockRequest = function() {
|
||||
unlockOrientation({unlockAfterRotatingToPreviousLock: false});
|
||||
env0_8 = false;
|
||||
};
|
||||
const closure2 = unlockOrientation;
|
||||
const closure3 = lockOrientation;
|
||||
const closure4 = function(a0) {
|
||||
if (!(require(dependencyMap[3]).isAndroid() || require(dependencyMap[5]).isIpadOS() && a0 == null)) {
|
||||
lockOrientation(a0);
|
||||
}
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const AppState = (require(27) /* metro dependency 27 */).AppState;
|
||||
object2 = {PORTRAIT: 0};
|
||||
object2[0] = 'PORTRAIT';
|
||||
object2.LANDSCAPE = 1;
|
||||
object2[1] = 'LANDSCAPE';
|
||||
const env0_5 = ['PORTRAIT', 'PORTRAITUPSIDEDOWN'];
|
||||
let value = require(629) /* metro dependency 629 */;
|
||||
value = value.create(_fun61728);
|
||||
(importDefault(7718) /* metro dependency 7718 */).addOrientationDegreesChangeListener(handleOrientationDegreesChange);
|
||||
(importDefault(7718) /* metro dependency 7718 */).addOrientationListener(closure);
|
||||
const value4 = importDefault(7718) /* metro dependency 7718 */;
|
||||
const getInitialOrientation = value4.getInitialOrientation;
|
||||
closure(Reflect.apply(getInitialOrientation, value4, []));
|
||||
AppState.addEventListener('change', applyLockStateOnAppActive);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/device/native/DeviceOrientation.tsx');
|
||||
exports.OrientationType = object2;
|
||||
exports.useStore = value;
|
||||
exports.handleOrientationChange = closure;
|
||||
exports.unlockOrientation = closure2;
|
||||
exports.lockOrientation = closure3;
|
||||
exports.lockOrientationForiOS = closure4;
|
||||
exports.toggleOrientation = toggleOrientation;
|
||||
exports.getOrientation = getOrientation;
|
||||
exports.getOrientationLock = getOrientationLock;
|
||||
exports.useOrientation = useOrientation;
|
||||
exports.useOrientationListener = useOrientationListener;
|
||||
exports.restoreDefaultOrientation = restoreDefaultOrientation;
|
||||
}
|
||||
|
||||
function handleOrientationChange(a0) { // fn#61717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:329, offset: 0x01b4956a, size: 276 bytes, params: 2, frame: 17
|
||||
var r3;
|
||||
var binding;
|
||||
var orientationLock;
|
||||
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
||||
if (platformUtilsModule.isIOS()) {
|
||||
handleDeviceOrientationChange(a0);
|
||||
}
|
||||
if (env0_7 !== a0) {
|
||||
env0_7 = a0;
|
||||
binding = env0_6;
|
||||
orientationLock = binding.getState().orientationLock;
|
||||
r3 = orientationLock != null && env0_5.includes(orientationLock);
|
||||
if (env0_7 !== 'LANDSCAPE') {
|
||||
r3 = env0_7 === 'PORTRAIT' || (require(4092) /* metro dependency 4092: DeviceUtils */).isIpadOS() && env0_7 === 'PORTRAITUPSIDEDOWN';
|
||||
r3 = r3 && orientationLock !== 'LANDSCAPE';
|
||||
if (r3) {
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61718);
|
||||
}
|
||||
} else if (r3) {
|
||||
r3 = env0_7 === 'PORTRAIT' || (require(4092) /* metro dependency 4092: DeviceUtils */).isIpadOS() && env0_7 === 'PORTRAITUPSIDEDOWN';
|
||||
r3 = r3 && orientationLock !== 'LANDSCAPE';
|
||||
if (r3) {
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61718);
|
||||
}
|
||||
} else {
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61719);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handleDeviceOrientationChange(a0) { // fn#61720, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:721, offset: 0x01b496c8, size: 83 bytes, params: 2, frame: 12
|
||||
const binding = env0_6;
|
||||
const getState = binding.getState;
|
||||
const orientationLock = Reflect.apply(getState, binding, []).orientationLock;
|
||||
if (env0_8) {
|
||||
if (a0 === 'LANDSCAPE') {
|
||||
if (orientationLock === 'LANDSCAPE') {
|
||||
consumeUnlockAfterRotationToLockRequest();
|
||||
}
|
||||
} else if (a0 === 'PORTRAIT') {
|
||||
if (orientationLock === 'PORTRAIT') {
|
||||
consumeUnlockAfterRotationToLockRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unlockOrientation({unlockAfterRotatingToPreviousLock}) { // fn#61722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:1082, offset: 0x01b49738, size: 239 bytes, params: 2, frame: 16
|
||||
var moduleValue2;
|
||||
const binding = env0_6;
|
||||
const getState = binding.getState;
|
||||
const orientationLock = Reflect.apply(getState, binding, []).orientationLock;
|
||||
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
||||
if (platformUtilsModule.isAndroid()) {
|
||||
if (unlockAfterRotatingToPreviousLock) {
|
||||
if (orientationLock == null) {
|
||||
(importDefault(7718) /* metro dependency 7718 */).ignoreAutoRotate(false);
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61723);
|
||||
}
|
||||
} else {
|
||||
(importDefault(7718) /* metro dependency 7718 */).ignoreAutoRotate(false);
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61723);
|
||||
}
|
||||
} else {
|
||||
moduleValue2 = platformUtilsModule;
|
||||
if (moduleValue2.isIOS()) {
|
||||
if ((require(4092) /* metro dependency 4092: DeviceUtils */).getSystemVersionMajor() >= 16) {
|
||||
if (unlockAfterRotatingToPreviousLock) {
|
||||
if (orientationLock == null) {
|
||||
(importDefault(7718) /* metro dependency 7718 */).ignoreAutoRotate(false);
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61723);
|
||||
}
|
||||
} else {
|
||||
(importDefault(7718) /* metro dependency 7718 */).ignoreAutoRotate(false);
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61723);
|
||||
}
|
||||
} else {
|
||||
(importDefault(7718) /* metro dependency 7718 */).ignoreAutoRotate(false);
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61723);
|
||||
}
|
||||
} else {
|
||||
(importDefault(7718) /* metro dependency 7718 */).ignoreAutoRotate(false);
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61723);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function lockOrientation(a0, a1) { // fn#61724, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:1404, offset: 0x01b49846, size: 192 bytes, params: 3, frame: 17
|
||||
let value = a1;
|
||||
const defaultImport = importDefault(7718) /* metro dependency 7718 */;
|
||||
defaultImport.ignoreAutoRotate(value != null && value);
|
||||
if (a0 === 'LANDSCAPE') {
|
||||
value = defaultImport;
|
||||
value.lockToLandscapeLeft();
|
||||
value = require(690) /* metro dependency 690: ReactBatchUpdatesNative */;
|
||||
value.batchUpdates(_fun61725);
|
||||
} else {
|
||||
value = importDefault(7718) /* metro dependency 7718 */;
|
||||
value.lockToPortrait();
|
||||
value = require(690) /* metro dependency 690: ReactBatchUpdatesNative */;
|
||||
value.batchUpdates(_fun61726);
|
||||
}
|
||||
}
|
||||
|
||||
function _fun61728() { // fn#61728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:263, offset: 0x01b499a9, size: 29 bytes, params: 1, frame: 2
|
||||
const PORTRAIT = env0_4.PORTRAIT;
|
||||
return {orientation: PORTRAIT, orientationLock: null};
|
||||
}
|
||||
|
||||
function handleOrientationDegreesChange(a0) { // fn#61729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:1846, offset: 0x01b499c6, size: 198 bytes, params: 2, frame: 14
|
||||
let r1 = a0 >= 0 && a0 <= 5;
|
||||
r1 = !r1 ? a0 >= 355 : r1;
|
||||
value = 'PORTRAIT';
|
||||
const r0 = r1 === true ? value : (a0 >= 85 && a0 <= 95) === true ? 'LANDSCAPE-RIGHT' : (a0 >= 175 && a0 <= 185) === true ? 'PORTRAITUPSIDEDOWN' : (a0 >= 265 && a0 <= 275) === true ? 'LANDSCAPE-LEFT' : 'UNKNOWN';
|
||||
if (r0 === 'LANDSCAPE-LEFT') {
|
||||
handleDeviceOrientationChange('LANDSCAPE');
|
||||
} else if (r0 === 'LANDSCAPE-RIGHT') {
|
||||
handleDeviceOrientationChange('LANDSCAPE');
|
||||
} else if (value === r0) {
|
||||
handleDeviceOrientationChange(value);
|
||||
}
|
||||
}
|
||||
|
||||
function applyLockStateOnAppActive(a0) { // fn#61730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:2422, offset: 0x01b49a8c, size: 64 bytes, params: 2, frame: 13
|
||||
const binding = env0_6;
|
||||
const getState = binding.getState;
|
||||
const orientationLock = Reflect.apply(getState, binding, []).orientationLock;
|
||||
if (a0 === 'active' && orientationLock != null) {
|
||||
lockOrientation(orientationLock, true);
|
||||
}
|
||||
}
|
||||
|
||||
function toggleOrientation() { // fn#61731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:2841, offset: 0x01b49acc, size: 274 bytes, params: 1, frame: 16
|
||||
const {orientation, orientationLock} = env0_6.getState();
|
||||
const r3 = orientationLock != null && env0_5.includes(orientationLock);
|
||||
const LANDSCAPE = env0_4.LANDSCAPE;
|
||||
if (orientation !== LANDSCAPE) {
|
||||
if (!(orientation !== env0_4.PORTRAIT || r3)) {
|
||||
(importDefault(7718) /* metro dependency 7718 */).lockToLandscapeLeft();
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61733);
|
||||
}
|
||||
} else if (orientationLock !== 'LANDSCAPE') {
|
||||
(importDefault(7718) /* metro dependency 7718 */).lockToPortrait();
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61732);
|
||||
} else if (!(orientation !== env0_4.PORTRAIT || r3)) {
|
||||
(importDefault(7718) /* metro dependency 7718 */).lockToLandscapeLeft();
|
||||
(importDefault(7718) /* metro dependency 7718 */).unlockAllOrientations();
|
||||
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun61733);
|
||||
}
|
||||
}
|
||||
|
||||
function getOrientation() { // fn#61734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:3250, offset: 0x01b49bde, size: 25 bytes, params: 1, frame: 9
|
||||
const binding = env0_6;
|
||||
const getState = binding.getState;
|
||||
return Reflect.apply(getState, binding, []).orientation;
|
||||
}
|
||||
|
||||
function getOrientationLock() { // fn#61735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:3330, offset: 0x01b49bf7, size: 25 bytes, params: 1, frame: 9
|
||||
const binding = env0_6;
|
||||
const getState = binding.getState;
|
||||
return Reflect.apply(getState, binding, []).orientationLock;
|
||||
}
|
||||
|
||||
function useOrientation() { // fn#61736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:3414, offset: 0x01b49c10, size: 21 bytes, params: 1, frame: 9
|
||||
return env0_6().orientation;
|
||||
}
|
||||
|
||||
function useOrientationListener(a0) { // fn#61737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:3489, offset: 0x01b49c25, size: 44 bytes, params: 2, frame: 14
|
||||
const env0_0 = a0;
|
||||
env0_3.useEffect(_fun61738, [a0]);
|
||||
}
|
||||
|
||||
function restoreDefaultOrientation() { // fn#61739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:3591, offset: 0x01b49c6c, size: 129 bytes, params: 1, frame: 13
|
||||
var moduleValue2;
|
||||
var binding;
|
||||
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
||||
if (platformUtilsModule.isIOS()) {
|
||||
moduleValue2 = require(4092) /* metro dependency 4092: DeviceUtils */;
|
||||
if (moduleValue2.isIpadOS()) {
|
||||
unlockOrientation({unlockAfterRotatingToPreviousLock: false});
|
||||
lockOrientationForiOS();
|
||||
return undefined;
|
||||
}
|
||||
binding = env0_6;
|
||||
if (binding.getState().orientationLock !== 'PORTRAIT') {
|
||||
unlockOrientation({unlockAfterRotatingToPreviousLock: false});
|
||||
lockOrientationForiOS();
|
||||
return undefined;
|
||||
}
|
||||
} else {
|
||||
unlockOrientation({unlockAfterRotatingToPreviousLock: false});
|
||||
lockOrientationForiOS();
|
||||
}
|
||||
}
|
||||
|
||||
function _fun61718() { // fn#61718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:611, offset: 0x01b4967e, size: 37 bytes, params: 1, frame: 12
|
||||
const binding = env1_6;
|
||||
const setState = binding.setState;
|
||||
const PORTRAIT = env1_4.PORTRAIT;
|
||||
return Reflect.apply(setState, binding, [{orientation: PORTRAIT}]);
|
||||
}
|
||||
|
||||
function _fun61719() { // fn#61719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:676, offset: 0x01b496a3, size: 37 bytes, params: 1, frame: 12
|
||||
const binding = env1_6;
|
||||
const setState = binding.setState;
|
||||
const LANDSCAPE = env1_4.LANDSCAPE;
|
||||
return Reflect.apply(setState, binding, [{orientation: LANDSCAPE}]);
|
||||
}
|
||||
|
||||
function _fun61723() { // fn#61723, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:1360, offset: 0x01b49827, size: 31 bytes, params: 1, frame: 12
|
||||
env1_6.setState({orientationLock: null});
|
||||
}
|
||||
|
||||
function _fun61725() { // fn#61725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:1547, offset: 0x01b49906, size: 33 bytes, params: 1, frame: 12
|
||||
env1_6.setState({orientationLock: 'LANDSCAPE'});
|
||||
}
|
||||
|
||||
function _fun61726() { // fn#61726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:1649, offset: 0x01b49927, size: 33 bytes, params: 1, frame: 12
|
||||
env1_6.setState({orientationLock: 'PORTRAIT'});
|
||||
}
|
||||
|
||||
function _fun61738() { // fn#61738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7895:3537, offset: 0x01b49c51, size: 27 bytes, params: 1, frame: 11
|
||||
return env1_6.subscribe(env0_0);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user