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

71 lines
3.8 KiB
React

/* Metro module 1688; source: unknown; dependencies: [1686] */
function _fun18422(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#18422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1815:6, offset: 0x00e8bb56, size: 86 bytes, params: 8, frame: 16
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {code: 'function rigidDecay_Pnpm_rigidDecayTs1(animation,now,config){const{SLOPE_FACTOR,VELOCITY_EPS}=this.__closure;const{lastTimestamp:lastTimestamp,startTimestamp:startTimestamp,initialVelocity:initialVelocity,current:current,velocity:velocity}=animation;const deltaTime=Math.min(Math.max(now-lastTimestamp,0),64);const v=velocity*Math.exp(-(1-config.deceleration)*(now-startTimestamp)*SLOPE_FACTOR);animation.current=current+v*config.velocityFactor*deltaTime/1000;animation.velocity=v;animation.lastTimestamp=now;if(config.clamp){if(initialVelocity<0&&animation.current<=config.clamp[0]){animation.current=config.clamp[0];return true;}else if(initialVelocity>0&&animation.current>=config.clamp[1]){animation.current=config.clamp[1];return true;}}return Math.abs(v)<VELOCITY_EPS;}'};
exports.rigidDecay = _fun18423();
}
function _fun18423() { // fn#18423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1815:885, offset: 0x00e8bbac, size: 98 bytes, params: 1, frame: 16
const closure = rigidDecay;
const object2 = {};
const SLOPE_FACTOR = (require(1686) /* metro dependency 1686 */).SLOPE_FACTOR;
object2.SLOPE_FACTOR = SLOPE_FACTOR;
const VELOCITY_EPS = (require(1686) /* metro dependency 1686 */).VELOCITY_EPS;
object2.VELOCITY_EPS = VELOCITY_EPS;
closure.__closure = object2;
closure.__workletHash = 6356485112123;
closure.__initData = env0_2;
return closure;
}
function rigidDecay(a0, a1, a2) { // fn#18424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1815:902, offset: 0x00e8bc0e, size: 347 bytes, params: 4, frame: 26
const VELOCITY_EPS = (require(1686) /* metro dependency 1686 */).VELOCITY_EPS;
const lastTimestamp = a0.lastTimestamp;
const startTimestamp = a0.startTimestamp;
const initialVelocity = a0.initialVelocity;
const current = a0.current;
const velocity = a0.velocity;
let Math = global.Math;
const min = Math.min;
const Math2 = global.Math;
let value = Math2.max(a1 - lastTimestamp, 0);
value = Reflect.apply(min, Math, [value, 64]);
Math = global.Math;
const exp = Math.exp;
const value4 = -(1 - a2.deceleration) * (a1 - startTimestamp);
const SLOPE_FACTOR = (require(1686) /* metro dependency 1686 */).SLOPE_FACTOR;
const value6 = velocity * Reflect.apply(exp, Math, [value4 * SLOPE_FACTOR]);
a0.current = current + value6 * a2.velocityFactor * value / 1000;
a0.velocity = value6;
a0.lastTimestamp = a1;
if (a2.clamp) {
if (initialVelocity < 0) {
if (a0.current <= a2.clamp[0]) {
a0.current = a2.clamp[0];
return true;
}
if (initialVelocity > 0) {
if (a0.current >= a2.clamp[1]) {
a0.current = a2.clamp[1];
return true;
}
return global.Math.abs(value6) < VELOCITY_EPS;
}
return global.Math.abs(value6) < VELOCITY_EPS;
}
if (initialVelocity > 0) {
if (a0.current >= a2.clamp[1]) {
a0.current = a2.clamp[1];
return true;
}
return global.Math.abs(value6) < VELOCITY_EPS;
}
return global.Math.abs(value6) < VELOCITY_EPS;
}
Math = global.Math;
return Math.abs(value6) < VELOCITY_EPS;
}