Files
discord-decomp/sources/by-id/module-01779.js
T
2026-07-28 01:06:53 +03:00

220 lines
15 KiB
JavaScript

/* Metro module 1779; source: unknown; dependencies: [1621] */
import * as Module01621Module from './module-01621.js'; /* Metro dependency 1621 */
function _fun19591(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#19591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:6, offset: 0x00eaeae3, size: 275 bytes, params: 8, frame: 17
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = {code: 'function getVal_Pnpm_interpolationTs1(type,coef,val,leftEdgeOutput,rightEdgeOutput,x){const{Extrapolation}=this.__closure;switch(type){case Extrapolation.IDENTITY:return x;case Extrapolation.CLAMP:if(coef*val<coef*leftEdgeOutput){return leftEdgeOutput;}return rightEdgeOutput;case Extrapolation.EXTEND:default:return val;}}'};
const env0_4 = _fun19592();
const env0_5 = {code: 'function isExtrapolate_Pnpm_interpolationTs2(value){const{Extrapolation}=this.__closure;return value===Extrapolation.EXTEND||value===Extrapolation.CLAMP||value===Extrapolation.IDENTITY;}'};
const env0_6 = _fun19594();
const env0_7 = {code: 'function validateType_Pnpm_interpolationTs3(type){const{Extrapolation,isExtrapolate}=this.__closure;const extrapolationConfig={extrapolateLeft:Extrapolation.EXTEND,extrapolateRight:Extrapolation.EXTEND};if(!type){return extrapolationConfig;}if(typeof type===\'string\'){if(!isExtrapolate(type)){throw new ReanimatedError("Unsupported value for \\"interpolate\\" \\nSupported values: [\\"extend\\", \\"clamp\\", \\"identity\\", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\\n Valid example:\\n interpolate(value, [inputRange], [outputRange], \\"clamp\\")");}extrapolationConfig.extrapolateLeft=type;extrapolationConfig.extrapolateRight=type;return extrapolationConfig;}if(type.extrapolateLeft&&!isExtrapolate(type.extrapolateLeft)||type.extrapolateRight&&!isExtrapolate(type.extrapolateRight)){throw new ReanimatedError("Unsupported value for \\"interpolate\\" \\nSupported values: [\\"extend\\", \\"clamp\\", \\"identity\\", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\\n Valid example:\\n interpolate(value, [inputRange], [outputRange], {\\n extrapolateLeft: Extrapolation.CLAMP,\\n extrapolateRight: Extrapolation.IDENTITY\\n }})");}Object.assign(extrapolationConfig,type);return extrapolationConfig;}'};
const env0_8 = _fun19596();
const env0_9 = {code: 'function internalInterpolate_Pnpm_interpolationTs4(x,narrowedInput,extrapolationConfig){const{getVal}=this.__closure;const{leftEdgeInput:leftEdgeInput,rightEdgeInput:rightEdgeInput,leftEdgeOutput:leftEdgeOutput,rightEdgeOutput:rightEdgeOutput}=narrowedInput;if(rightEdgeInput-leftEdgeInput===0){return leftEdgeOutput;}const progress=(x-leftEdgeInput)/(rightEdgeInput-leftEdgeInput);const val=leftEdgeOutput+progress*(rightEdgeOutput-leftEdgeOutput);const coef=rightEdgeOutput>=leftEdgeOutput?1:-1;if(coef*val<coef*leftEdgeOutput){return getVal(extrapolationConfig.extrapolateLeft,coef,val,leftEdgeOutput,rightEdgeOutput,x);}else if(coef*val>coef*rightEdgeOutput){return getVal(extrapolationConfig.extrapolateRight,coef,val,leftEdgeOutput,rightEdgeOutput,x);}return val;}'};
const env0_10 = _fun19598();
const env0_11 = {code: "function interpolate_Pnpm_interpolationTs5(x,inputRange,outputRange,type){const{validateType,internalInterpolate}=this.__closure;if(inputRange.length<2||outputRange.length<2){throw new ReanimatedError('Interpolation input and output ranges should contain at least two values.');}const extrapolationConfig=validateType(type);const length=inputRange.length;const narrowedInput={leftEdgeInput:inputRange[0],rightEdgeInput:inputRange[1],leftEdgeOutput:outputRange[0],rightEdgeOutput:outputRange[1]};if(length>2){if(x>inputRange[length-1]){narrowedInput.leftEdgeInput=inputRange[length-2];narrowedInput.rightEdgeInput=inputRange[length-1];narrowedInput.leftEdgeOutput=outputRange[length-2];narrowedInput.rightEdgeOutput=outputRange[length-1];}else{for(let i=1;i<length;++i){if(x<=inputRange[i]){narrowedInput.leftEdgeInput=inputRange[i-1];narrowedInput.rightEdgeInput=inputRange[i];narrowedInput.leftEdgeOutput=outputRange[i-1];narrowedInput.rightEdgeOutput=outputRange[i];break;}}}}return internalInterpolate(x,narrowedInput,extrapolationConfig);}"};
const value = _fun19600();
const env0_12 = {code: 'function clamp_Pnpm_interpolationTs6(value,min,max){return Math.min(Math.max(value,min),max);}'};
const value2 = _fun19602();
exports.Extrapolation = {IDENTITY: 'identity', CLAMP: 'clamp', EXTEND: 'extend'};
exports.interpolate = value;
exports.clamp = value2;
function _fun19592() { // fn#19592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:518, offset: 0x00eaebf6, size: 55 bytes, params: 1, frame: 4
const getVal2 = getVal;
getVal2.__closure = {Extrapolation: env0_2};
getVal2.__workletHash = 15103214376416;
getVal2.__initData = env0_3;
return getVal2;
function getVal(a0, a1, a2, a3, a4, a5) { // fn#19593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:535, offset: 0x00eaec2d, size: 80 bytes, params: 7, frame: 7
const value = a3;
const value2 = a4;
const IDENTITY = env1_2.IDENTITY;
if (IDENTITY === a0) {
return a5;
}
const CLAMP = env1_2.CLAMP;
if (CLAMP === a0) {
return a1 * a2 < a1 * value ? value : value2;
}
env1_2.EXTEND;
return a2;
}
}
function _fun19594() { // fn#19594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:951, offset: 0x00eaec7d, size: 55 bytes, params: 1, frame: 4
const isExtrapolate2 = isExtrapolate;
isExtrapolate2.__closure = {Extrapolation: env0_2};
isExtrapolate2.__workletHash = 1560831703072;
isExtrapolate2.__initData = env0_5;
return isExtrapolate2;
function isExtrapolate(a0) { // fn#19595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:968, offset: 0x00eaecb4, size: 56 bytes, params: 2, frame: 4
const value = environment.__proto__;
const EXTEND = env1_2.EXTEND;
let r0 = a0 === EXTEND || a0 === env1_2.CLAMP;
r0 = !r0 ? a0 === env1_2.IDENTITY : r0;
return r0;
}
}
function _fun19596() { // fn#19596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:2436, offset: 0x00eaecec, size: 66 bytes, params: 1, frame: 4
const validateType2 = validateType;
validateType2.__closure = {Extrapolation: env0_2, isExtrapolate: env0_6};
validateType2.__workletHash = 9722315466599;
validateType2.__initData = env0_7;
return validateType2;
function validateType(a0) { // fn#19597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:2453, offset: 0x00eaed2e, size: 268 bytes, params: 2, frame: 15
const ReanimatedError = (Module01621Module).ReanimatedError;
const object = {};
const value = environment.__proto__;
const binding = env1_2;
let EXTEND = binding.EXTEND;
object.extrapolateLeft = EXTEND;
EXTEND = binding.EXTEND;
object.extrapolateRight = EXTEND;
if (a0) {
if (typeof a0 === 'string') {
if (env1_6(a0)) {
object.extrapolateLeft = a0;
object.extrapolateRight = a0;
return object;
}
throw new ReanimatedError('Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\n Valid example:\n interpolate(value, [inputRange], [outputRange], "clamp")');
}
if (a0.extrapolateLeft) {
if (env1_6(a0.extrapolateLeft)) {
if (a0.extrapolateRight) {
if (env1_6(a0.extrapolateRight)) {
global.Object.assign(object, a0);
return object;
}
throw new ReanimatedError('Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\n Valid example:\n interpolate(value, [inputRange], [outputRange], {\n extrapolateLeft: Extrapolation.CLAMP,\n extrapolateRight: Extrapolation.IDENTITY\n }})');
}
global.Object.assign(object, a0);
return object;
}
throw new ReanimatedError('Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\n Valid example:\n interpolate(value, [inputRange], [outputRange], {\n extrapolateLeft: Extrapolation.CLAMP,\n extrapolateRight: Extrapolation.IDENTITY\n }})');
}
if (a0.extrapolateRight) {
if (env1_6(a0.extrapolateRight)) {
global.Object.assign(object, a0);
return object;
}
throw new ReanimatedError('Unsupported value for "interpolate" \nSupported values: ["extend", "clamp", "identity", Extrapolatation.CLAMP, Extrapolatation.EXTEND, Extrapolatation.IDENTITY]\n Valid example:\n interpolate(value, [inputRange], [outputRange], {\n extrapolateLeft: Extrapolation.CLAMP,\n extrapolateRight: Extrapolation.IDENTITY\n }})');
}
global.Object.assign(object, a0);
}
return object;
}
}
function _fun19598() { // fn#19598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:4301, offset: 0x00eaee3a, size: 57 bytes, params: 1, frame: 4
const internalInterpolate2 = internalInterpolate;
internalInterpolate2.__closure = {getVal: env0_4};
internalInterpolate2.__workletHash = 16257995045856;
internalInterpolate2.__initData = env0_9;
return internalInterpolate2;
function internalInterpolate(a0, {leftEdgeInput, rightEdgeInput, leftEdgeOutput, rightEdgeOutput}, a2) { // fn#19599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:4318, offset: 0x00eaee73, size: 187 bytes, params: 4, frame: 23
var r1;
var value6;
var value7;
if (rightEdgeInput - leftEdgeInput == 0) {
return leftEdgeOutput;
}
let value = a0 - leftEdgeInput;
value /= rightEdgeInput - leftEdgeInput;
value = leftEdgeOutput + value * (rightEdgeOutput - leftEdgeOutput);
const r5 = rightEdgeOutput >= leftEdgeOutput ? 1 : -1;
if (r5 * value < r5 * leftEdgeOutput) {
value7 = environment.__proto__;
value = env1_4(a2.extrapolateLeft, r5, value, leftEdgeOutput, rightEdgeOutput, a0);
r1 = value;
} else if (r5 * value > r5 * rightEdgeOutput) {
value6 = environment.__proto__;
value = env1_4(a2.extrapolateRight, r5, value, leftEdgeOutput, rightEdgeOutput, a0);
r1 = value;
} else {
r1 = value;
}
return r1;
}
}
function _fun19600() { // fn#19600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:5717, offset: 0x00eaef2e, size: 68 bytes, params: 1, frame: 4
const interpolate_196012 = interpolate_19601;
interpolate_196012.__closure = {validateType: env0_8, internalInterpolate: env0_10};
interpolate_196012.__workletHash = 16263308339935;
interpolate_196012.__initData = env0_11;
return interpolate_196012;
function interpolate_19601(a0, a1, a2, a3) { // fn#19601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:5734, offset: 0x00eaef72, size: 330 bytes, params: 5, frame: 23
var r11;
var value;
var value4;
const ReanimatedError = (Module01621Module).ReanimatedError;
let length = a1.length;
if (length < 2) {
value = environment.__proto__;
throw new ReanimatedError('Interpolation input and output ranges should contain at least two values.');
}
if (a2.length < 2) {
value = environment.__proto__;
throw new ReanimatedError('Interpolation input and output ranges should contain at least two values.');
}
value = environment.__proto__;
const value2 = env1_8(a3);
length = a1.length;
const object = {leftEdgeInput: a1[0]};
const value3 = 1;
object.rightEdgeInput = a1[value3];
object.leftEdgeOutput = a2[0];
object.rightEdgeOutput = a2[value3];
if (length > 2) {
if (a0 > a1[length - value3]) {
object.leftEdgeInput = a1[length - 2];
object.rightEdgeInput = a1[length - value3];
object.leftEdgeOutput = a2[length - 2];
object.rightEdgeOutput = a2[length - value3];
} else if (value3 < length) {
r11 = value3;
loopExit5: while (true) {
if (a0 <= a1[r11]) {
object.leftEdgeInput = a1[r11 - value3];
object.rightEdgeInput = a1[r11];
object.leftEdgeOutput = a2[r11 - value3];
object.rightEdgeOutput = a2[r11];
break loopExit5;
}
value4 = typeof r11 === 'bigint' ? r11 + 1n : +r11 + 1;
if (value4 < length) {
r11 = value4;
continue;
}
break loopExit5;
}
}
}
return env1_10(a0, object, value2);
}
}
function _fun19602() { // fn#19602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1906:6491, offset: 0x00eaf0bc, size: 46 bytes, params: 1, frame: 2
const closure = function(a0, a1, a2) {
var Math = global.Math;
var Math2 = global.Math;
return Math.min(Math2.max(a0, a1), a2);
};
closure.__closure = {};
closure.__workletHash = 13846341562950;
closure.__initData = env0_12;
return closure;
}
}
global.__d(_fun19591, 1779, [1621]) /* metro module 1779, dependencies: [1621] */;