Files
discord-decomp/sources/by-id/module-01766.jsx
T
2026-07-27 16:20:00 +03:00

224 lines
12 KiB
React

/* Metro module 1766; source: unknown; dependencies: [31, 1635, 1654, 1617] */
function _fun19481(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#19481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:6, offset: 0x00eab662, size: 207 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = require(31) /* metro dependency 31 */;
const env0_2 = value.useEffect;
const env0_3 = value.useMemo;
const env0_4 = value.useRef;
object = {code: 'function eulerToQuaternion_Pnpm_useAnimatedSensorTs1(pitch,roll,yaw){const c1=Math.cos(pitch/2);const s1=Math.sin(pitch/2);const c2=Math.cos(roll/2);const s2=Math.sin(roll/2);const c3=Math.cos(yaw/2);const s3=Math.sin(yaw/2);return[s1*c2*c3-c1*s2*s3,c1*s2*c3+s1*c2*s3,c1*c2*s3+s1*s2*c3,c1*c2*c3-s1*s2*s3];}'};
const env0_6 = _fun19482();
object = {code: 'function adjustRotationToInterfaceOrientation_Pnpm_useAnimatedSensorTs2(data){const{InterfaceOrientation,eulerToQuaternion}=this.__closure;const{interfaceOrientation:interfaceOrientation,pitch:pitch,roll:roll,yaw:yaw}=data;if(interfaceOrientation===InterfaceOrientation.ROTATION_90){data.pitch=roll;data.roll=-pitch;data.yaw=yaw-Math.PI/2;}else if(interfaceOrientation===InterfaceOrientation.ROTATION_270){data.pitch=-roll;data.roll=pitch;data.yaw=yaw+Math.PI/2;}else if(interfaceOrientation===InterfaceOrientation.ROTATION_180){data.pitch*=-1;data.roll*=-1;data.yaw*=-1;}const q=eulerToQuaternion(data.pitch,data.roll,data.yaw);data.qx=q[0];data.qy=q[1];data.qz=q[2];data.qw=q[3];return data;}'};
const env0_8 = _fun19484();
object = {code: 'function adjustVectorToInterfaceOrientation_Pnpm_useAnimatedSensorTs3(data){const{InterfaceOrientation}=this.__closure;const{interfaceOrientation:interfaceOrientation,x:x,y:y}=data;if(interfaceOrientation===InterfaceOrientation.ROTATION_90){data.x=-y;data.y=x;}else if(interfaceOrientation===InterfaceOrientation.ROTATION_270){data.x=y;data.y=-x;}else if(interfaceOrientation===InterfaceOrientation.ROTATION_180){data.x*=-1;data.y*=-1;}return data;}'};
const env0_10 = _fun19486();
object = {code: 'function pnpm_useAnimatedSensorTs4(data){const{adjustToInterfaceOrientation,sensorType,SensorType,adjustRotationToInterfaceOrientation,adjustVectorToInterfaceOrientation,sensorData,callMicrotasks}=this.__closure;if(adjustToInterfaceOrientation){if(sensorType===SensorType.ROTATION){data=adjustRotationToInterfaceOrientation(data);}else{data=adjustVectorToInterfaceOrientation(data);}}sensorData.value=data;callMicrotasks();}'};
exports.useAnimatedSensor = useAnimatedSensor;
}
function _fun19482() { // fn#19482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:463, offset: 0x00eab731, size: 46 bytes, params: 1, frame: 2
const closure = eulerToQuaternion;
closure.__closure = {};
closure.__workletHash = 14525486759705;
closure.__initData = env0_5;
return closure;
}
function _fun19484() { // fn#19484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:1451, offset: 0x00eab851, size: 90 bytes, params: 1, frame: 14
const closure = adjustRotationToInterfaceOrientation;
const InterfaceOrientation = (require(1635) /* metro dependency 1635 */).InterfaceOrientation;
closure.__closure = {InterfaceOrientation: InterfaceOrientation, eulerToQuaternion: env0_6};
closure.__workletHash = 16635654688360;
closure.__initData = env0_7;
return closure;
}
function _fun19486() { // fn#19486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:2510, offset: 0x00eaba1c, size: 79 bytes, params: 1, frame: 14
const closure = adjustVectorToInterfaceOrientation;
const InterfaceOrientation = (require(1635) /* metro dependency 1635 */).InterfaceOrientation;
closure.__closure = {InterfaceOrientation: InterfaceOrientation};
closure.__workletHash = 5352466445526;
closure.__initData = env0_9;
return closure;
}
function useAnimatedSensor(a0, a1) { // fn#19488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:3388, offset: 0x00eabb34, size: 325 bytes, params: 3, frame: 20
var object2;
const env0_0 = a0;
const value2 = undefined;
const value3 = useRef(a1);
const current = value3.current;
let r3 = (current == null ? value2 : current.adjustToInterfaceOrientation) !== (a1 == null ? value2 : a1.adjustToInterfaceOrientation) || (value3.current == null ? value2 : value3.current.interval) !== (a1 == null ? value2 : a1.interval);
r3 = !r3 ? (value3.current == null ? value2 : value3.current.iosReferenceFrame) !== (a1 == null ? value2 : a1.iosReferenceFrame) : r3;
if (r3) {
value3.current = global.Object.assign({}, a1);
}
const value7 = useMemo(_fun19489, [value3.current]);
object2 = {};
object2.sensor = (require(1654) /* metro dependency 1654 */).initializeSensor(a0, value7);
object2.unregister = function() {
};
object2.isAvailable = false;
object2.config = value7;
const value8 = useRef(object2);
useEffect(_fun19491, [a0, value7]);
return value8.current;
}
function eulerToQuaternion(a0, a1, a2) { // fn#19483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:480, offset: 0x00eab75f, size: 242 bytes, params: 4, frame: 18
let Math = global.Math;
let value = Math.cos(a0 / 2);
Math = global.Math;
const value2 = Math.sin(a0 / 2);
Math = global.Math;
const value3 = Math.cos(a1 / 2);
Math = global.Math;
const value4 = Math.sin(a1 / 2);
Math = global.Math;
const value5 = Math.cos(a2 / 2);
Math = global.Math;
const value6 = Math.sin(a2 / 2);
const items2 = [value2 * value3 * value5 - value * value4 * value6];
items2[1] = value * value4 * value5 + value2 * value3 * value6;
items2[2] = value * value3 * value6 + value2 * value4 * value5;
value = value * value3 * value5;
items2[3] = value - value2 * value4 * value6;
return items2;
}
function adjustRotationToInterfaceOrientation(a0) { // fn#19485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:1468, offset: 0x00eab8ab, size: 369 bytes, params: 2, frame: 20
const interfaceOrientation = a0.interfaceOrientation;
const pitch = a0.pitch;
const roll = a0.roll;
const yaw = a0.yaw;
let value = environment.__proto__;
const InterfaceOrientation = (require(1635) /* metro dependency 1635 */).InterfaceOrientation;
const ROTATION_90 = InterfaceOrientation.ROTATION_90;
if (interfaceOrientation === ROTATION_90) {
a0.pitch = roll;
a0.roll = -pitch;
a0.yaw = yaw - global.Math.PI / 2;
} else if (interfaceOrientation === InterfaceOrientation.ROTATION_270) {
a0.pitch = -roll;
a0.roll = pitch;
a0.yaw = yaw + global.Math.PI / 2;
} else if (interfaceOrientation === InterfaceOrientation.ROTATION_180) {
a0.pitch = a0.pitch * -1;
a0.roll = a0.roll * -1;
a0.yaw = a0.yaw * -1;
}
value = env1_6(a0.pitch, a0.roll, a0.yaw);
a0.qx = value[0];
a0.qy = value[1];
a0.qz = value[2];
a0.qw = value[3];
return a0;
}
function adjustVectorToInterfaceOrientation(a0) { // fn#19487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:2527, offset: 0x00eaba6b, size: 201 bytes, params: 2, frame: 17
const interfaceOrientation = a0.interfaceOrientation;
const x = a0.x;
const y = a0.y;
const InterfaceOrientation = (require(1635) /* metro dependency 1635 */).InterfaceOrientation;
const ROTATION_90 = InterfaceOrientation.ROTATION_90;
if (interfaceOrientation === ROTATION_90) {
a0.x = -y;
a0.y = x;
} else if (interfaceOrientation === InterfaceOrientation.ROTATION_270) {
a0.x = y;
a0.y = -x;
} else if (interfaceOrientation === InterfaceOrientation.ROTATION_180) {
a0.x = a0.x * -1;
a0.y = a0.y * -1;
}
return a0;
}
function _fun19489() { // fn#19489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:3751, offset: 0x00eabc79, size: 89 bytes, params: 1, frame: 15
const Object = global.Object;
const assign = Object.assign;
const IOSReferenceFrame = (require(1635) /* metro dependency 1635 */).IOSReferenceFrame;
const Auto = IOSReferenceFrame.Auto;
return Reflect.apply(assign, Object, [{'interval': 'auto', 'adjustToInterfaceOrientation': true,
iosReferenceFrame: Auto}, env0_1.current]);
}
function _fun19491() { // fn#19491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:4021, offset: 0x00eabcd2, size: 382 bytes, params: 1, frame: 25
var object2;
let binding = env0_3;
const moduleValue = require(1654) /* metro dependency 1654 */;
const initializeSensor = moduleValue.initializeSensor;
const binding2 = env0_0;
binding.current = {sensor: Reflect.apply(initializeSensor, moduleValue, [binding2, env0_2]),
unregister: function() {
}, isAvailable: false, config: env0_2};
let current = env0_3.current;
const sensor = current.sensor;
const adjustToInterfaceOrientation = env0_3.current.config.adjustToInterfaceOrientation;
const moduleValue2 = moduleValue;
const registerSensor = moduleValue2.registerSensor;
binding = env0_2;
const closure = pnpm_useAnimatedSensorTs4;
object2 = {adjustToInterfaceOrientation: adjustToInterfaceOrientation, sensorType: binding2};
const SensorType = (require(1635) /* metro dependency 1635 */).SensorType;
object2.SensorType = SensorType;
object2.adjustRotationToInterfaceOrientation = env1_8;
object2.adjustVectorToInterfaceOrientation = env1_10;
object2.sensorData = sensor;
object2.callMicrotasks = (require(1617) /* metro dependency 1617 */).callMicrotasks;
closure.__closure = object2;
closure.__workletHash = 6807952122364;
closure.__initData = env1_11;
if (Reflect.apply(registerSensor, moduleValue2, [binding2, binding, closure]) !== -1) {
current = env0_3.current;
current.unregister = unregister_19494;
current = env0_3.current;
current.isAvailable = true;
} else {
current = env0_3.current;
current.unregister = function() {
};
current = env0_3.current;
current.isAvailable = false;
}
return _fun19496;
}
function pnpm_useAnimatedSensorTs4(a0) { // fn#19493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:4246, offset: 0x00eabe50, size: 134 bytes, params: 2, frame: 16
var r2;
var r1;
var value3;
var binding;
var value4;
let value = a0;
if (adjustToInterfaceOrientation) {
value3 = environment.__proto__;
binding = env1_0;
value4 = environment.__proto__.__proto__;
if (binding === (require(1635) /* metro dependency 1635 */).SensorType.ROTATION) {
value = env2_8(value);
r2 = value;
} else {
value = env2_10(value);
r2 = value;
}
r1 = r2;
} else {
r1 = value;
}
sensor.value = r1;
value = environment.__proto__.__proto__;
(require(1617) /* metro dependency 1617 */).callMicrotasks();
}
function unregister_19494() { // fn#19494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:4667, offset: 0x00eabed6, size: 45 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
return (require(1654) /* metro dependency 1654 */).unregisterSensor(env0_2);
}
function _fun19496() { // fn#19496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1893:4801, offset: 0x00eabf03, size: 26 bytes, params: 1, frame: 9
env1_3.current.unregister();
}