Files
2026-07-28 01:06:53 +03:00

249 lines
9.9 KiB
JavaScript

/* Metro module 7821; source: unknown; dependencies: [31, 27, 7750, 7822, 7752] */
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from './module-00031-React.js'; /* Metro dependency 31 */
function _fun62507(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#62507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7999:6, offset: 0x01b5f44c, size: 164 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_5 = RegExp('^([+-]?\\d+(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)(%?)$', '');
const offsetComparator = function([property], a1) {
return property - a1[0];
};
exports.default = extractGradient;
function percentToFloat(a0) { // fn#62508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7999:197, offset: 0x01b5f4f0, size: 174 bytes, params: 2, frame: 16
var r2;
var r1;
var property;
let value = typeof a0;
if (value === 'number') {
return a0;
}
if (value === 'object') {
if (typeof a0.__getAnimatedValue === 'function') {
return a0.__getAnimatedValue();
}
}
value = value === 'string';
const r4 = value && a0.match(env0_5);
if (r4) {
property = r4[2];
value = Number(r4[1]);
if (property) {
value /= 100;
r2 = value;
} else {
r2 = value;
}
r1 = r2;
} else {
global.console.warn('"' + a0 + '" is not a valid number or percentage string.');
r1 = 0;
}
return r1;
}
function extractGradient(a0, a1) { // fn#62510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7999:551, offset: 0x01b5f59e, size: 596 bytes, params: 3, frame: 42
var r6;
var r0;
var r24;
var r26;
var r25;
var r22;
var r29;
var r27;
var r3;
var object;
var length;
var value4;
var props;
var style;
var offset;
var stopColor;
var stopOpacity;
var percentToFloatBinding;
var value7;
var value8;
var isNaN;
var Math;
var round;
var value9;
var push;
var value10;
var console;
var warn;
var HermesInternal;
var concat;
var value11;
var items3;
var property;
var property2;
var value12;
var defaultImport;
const value = a0;
const env0_0 = a1;
const id = value.id;
const children = value.children;
const gradientTransform = value.gradientTransform;
const transform = value.transform;
const gradientUnits = value.gradientUnits;
if (id) {
object = [];
r6 = children ? Children.map(children, _fun62511) : [];
length = r6.length;
value4 = 0;
if (value4 < length) {
r0 = value4;
reducibleLoop6: while (true) {
props = r6[r0].props;
style = props.style;
offset = props.offset;
reducibleJoin10: while (true) {
if (offset !== undefined) {
r26 = offset;
break reducibleJoin10;
}
reducibleJoin9: while (true) {
if (style) {
offset = style.offset;
r24 = offset;
break reducibleJoin9;
}
r24 = style;
break reducibleJoin9;
}
r26 = r24;
break reducibleJoin10;
}
stopColor = props.stopColor;
reducibleJoin15: while (true) {
if (stopColor !== undefined) {
r25 = stopColor;
break reducibleJoin15;
}
reducibleJoin13: while (true) {
if (style) {
stopColor = style.stopColor;
r24 = stopColor;
break reducibleJoin13;
}
r24 = style;
break reducibleJoin13;
}
if (!r24) {
r24 = '#000';
}
r25 = r24;
break reducibleJoin15;
}
stopOpacity = props.stopOpacity;
reducibleJoin19: while (true) {
if (stopOpacity !== undefined) {
r29 = stopOpacity;
break reducibleJoin19;
}
reducibleJoin18: while (true) {
if (style) {
stopOpacity = style.stopOpacity;
r22 = stopOpacity;
break reducibleJoin18;
}
r22 = style;
break reducibleJoin18;
}
r29 = r22;
break reducibleJoin19;
}
percentToFloatBinding = percentToFloat;
r22 = r26 || value4;
value7 = percentToFloatBinding(r22);
reducibleJoin22: while (true) {
if (r25) {
value8 = processColor(r25);
r27 = value8;
break reducibleJoin22;
}
r27 = r25;
break reducibleJoin22;
}
reducibleJoin26: while (true) {
reducibleJoin25: while (true) {
if (typeof r27 !== 'number') {
break reducibleJoin25;
}
isNaN = global.isNaN;
if (isNaN(value7)) {
break reducibleJoin25;
}
Math = global.Math;
round = Math.round;
value9 = Reflect.apply(round, Math,
[255 * (importDefault(7750) /* metro dependency 7750 */)(r29)]);
push = object.push;
value10 = 16777215 & r27;
Reflect.apply(push, object, [[value7, value10 | value9 << 24]]);
break reducibleJoin26;
}
console = global.console;
warn = console.warn;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(warn, console,
['"' + r25 + '" is not a valid color or "' + r26 + '" is not a valid offset']);
break reducibleJoin26;
}
value11 = typeof r0 === 'bigint' ? r0 + 1n : +r0 + 1;
if (value11 < length) {
r0 = value11;
continue reducibleLoop6;
}
break reducibleLoop6;
}
}
object.sort(offsetComparator);
items3 = [];
length = object.length;
if (value4 < length) {
r0 = value4;
reducibleLoop28: while (true) {
property = object[r0];
push = items3.push;
property2 = property[value4];
Reflect.apply(push, items3, [property2, property[1]]);
value12 = typeof r0 === 'bigint' ? r0 + 1n : +r0 + 1;
if (value12 < length) {
r0 = value12;
continue reducibleLoop28;
}
break reducibleLoop28;
}
}
object = {name: id, gradient: items3, children: r6};
reducibleJoin31: while (true) {
if (gradientUnits) {
property = (importDefault(7822) /* metro dependency 7822 */)[gradientUnits];
r6 = property;
break reducibleJoin31;
}
r6 = gradientUnits;
break reducibleJoin31;
}
r6 = !r6 ? value4 : r6;
object.gradientUnits = r6;
defaultImport = importDefault(7752) /* metro dependency 7752 */;
r3 = gradientTransform || transform;
r3 = !r3 ? value : r3;
object.gradientTransform = defaultImport(r3);
return object;
}
return null;
function _fun62511(a0) { // fn#62511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7999:703, offset: 0x01b5b5e7, size: 37 bytes, params: 2, frame: 13
return env1_2.cloneElement(a0, {parent: require});
}
}
}
global.__d(_fun62507, 7821, [31, 27, 7750, 7822,
7752]) /* metro module 7821, dependencies: [31, 27, 7750, 7822, 7752] */;