decord/source/1647_isReducedMotionEnabledInSystem.js
2026-07-29 08:29:29 +00:00

44 lines
1.3 KiB
JavaScript

// Module ID: 1647
// Function ID: 1648
// Name: isReducedMotionEnabledInSystem
// Dependencies: [1609, 1643]
// Exports: isReducedMotionEnabledInSystem
// Module 1647 (isReducedMotionEnabledInSystem)
import isJest from "isJest";
import addCompilerSafeGetAndSet from "addCompilerSafeGetAndSet";
if (isJest.isWeb()) {
const _module1 = require("isJest");
let matches = _module1.isWindowAvailable();
if (matches) {
let _window = window;
matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
let prop = matches;
} else {
prop = global._REANIMATED_IS_REDUCED_MOTION;
}
const obj = { jsValue: prop, uiValue: null, setEnabled: null };
function isReducedMotionEnabledInSystem() {
if (obj.isWeb()) {
let matches = require(1609) /* isJest */.isWindowAvailable();
if (matches) {
const _window = window;
matches = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
}
let prop = matches;
const tmpResult = require(1609) /* isJest */;
} else {
prop = global._REANIMATED_IS_REDUCED_MOTION;
}
return prop;
}
obj[1] = addCompilerSafeGetAndSet.makeMutable(prop);
obj[2] = function setEnabled(jsValue) {
obj.jsValue = jsValue;
obj.uiValue.value = jsValue;
};
export { isReducedMotionEnabledInSystem };
export const ReducedMotionManager = obj;