Files
discord-decomp/sources/modules/collectibles/createUseCollectiblesShopStyles.tsx
2026-07-28 01:06:53 +03:00

168 lines
8.3 KiB
TypeScript

/* Metro module 7592; source: modules/collectibles/createUseCollectiblesShopStyles.tsx; dependencies: [57, 4502, 7593, 5132, 632, 2] */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import AccessibilityStore from '../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
import Module05132 from '../../by-id/module-05132.js'; /* Metro dependency 5132 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun60889(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#60889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:6, offset: 0x01713e8b, size: 168 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/collectibles/createUseCollectiblesShopStyles.tsx');
exports.default = function(a0) {
var env0_0 = a0;
return _fun60895;
};
function getMidpointColor(a0, a1) { // fn#60890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:135, offset: 0x01713f33, size: 196 bytes, params: 3, frame: 20
let value = a0.toRgb();
const value2 = a1.toRgb();
value = (require(7593) /* metro dependency 7593: UserProfileGradientUtils */).getValueInColorGradientByPercentage([value.r,
value.g, value.b], [value2.r, value2.g, value2.b], 50);
value = Module00057(value, 3);
return (Module05132)({r: value[0], g: value[1], b: value[2]});
}
function getBackgroundColors(a0, a1) { // fn#60891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:331, offset: 0x01713ff7, size: 268 bytes, params: 3, frame: 19
var r0;
var object;
var value;
var property;
var getMidpointColorBinding;
let length = a1.length;
if (length !== 0) {
length = a1.length;
if (length === 1) {
object = {primary: a1[0], secondary: a1[0]};
property = a1[0];
object.border = property.setAlpha(0.4);
property = a1[0];
object.label = property.isLight() ? a0.dark : a0.light;
r0 = object;
} else {
object = {primary: a1[0], secondary: a1[1]};
length = a1.length;
value = undefined;
object.tertiary = length > 2 ? a1[2] : value;
getMidpointColorBinding = getMidpointColor;
property = a1[0];
object.border = getMidpointColorBinding(property, a1[1]).setAlpha(0.4);
property = a1[0];
value = getMidpointColorBinding(property, a1[1]);
object.label = value.isLight() ? a0.dark : a0.light;
r0 = object;
}
return r0;
}
}
function getButtonColors(a0, a1) { // fn#60892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:652, offset: 0x01714103, size: 169 bytes, params: 3, frame: 17
var r0;
var object;
var midpointColor;
var property;
if (a1.length !== 0) {
if (a1.length === 1) {
property = a1[0];
r0 = {primary: a1[0], secondary: a1[0], text: property.isLight() ? a0.dark : a0.light};
} else {
object = {primary: a1[0], secondary: a1[1]};
midpointColor = getMidpointColor(a1[0], a1[1]);
object.text = midpointColor.isLight() ? a0.dark : a0.light;
r0 = object;
}
return r0;
}
}
function desaturate_60893(a0, a1) { // fn#60893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:861, offset: 0x017141ac, size: 81 bytes, params: 3, frame: 14
const value = a0.toHsl();
return (Module05132)({h: value.h, s: value.s * a1, l: value.l});
}
function _default_60894(a0) { // fn#60894, offset: 0x017141fd, size: 16 bytes, params: 2, frame: 2
const env0_0 = a0;
return _fun60895;
function _fun60895(a0) { // fn#60895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7770:948, offset: 0x0171420d, size: 464 bytes, params: 2, frame: 21
var object5;
var r3;
var r0;
var object;
var object2;
var desaturate_60893Binding;
var object3;
var object4;
const value2 = undefined;
const saturation = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.saturation;
});
const saturation2 = saturation;
if (a0 == null) {
return {};
}
object5 = {};
const getBackgroundColorsBinding = getBackgroundColors;
const binding = saturation2;
let backgroundColors = a0.backgroundColors;
object5.backgroundColors = getBackgroundColorsBinding(binding, backgroundColors);
const getButtonColorsBinding = getButtonColors;
let buttonColors = a0.buttonColors;
object5.buttonColors = getButtonColorsBinding(binding, buttonColors);
object5.confettiColors = a0.confettiColors;
if (saturation === 1) {
object4 = {};
copyDataProperties(object4, object5, undefined);
r0 = object4;
} else {
object = {};
backgroundColors = object5.backgroundColors;
if (backgroundColors != null) {
object2 = {};
desaturate_60893Binding = desaturate_60893;
backgroundColors = object5.backgroundColors;
object2.primary = desaturate_60893Binding(backgroundColors.primary, saturation);
backgroundColors = object5.backgroundColors;
object2.secondary = desaturate_60893Binding(backgroundColors.secondary, saturation);
backgroundColors = object5.backgroundColors;
object2.tertiary = backgroundColors.tertiary != null ? desaturate_60893(object5.backgroundColors.tertiary,
saturation) : value2;
desaturate_60893Binding = desaturate_60893;
backgroundColors = object5.backgroundColors;
object2.border = desaturate_60893Binding(backgroundColors.border, saturation);
backgroundColors = object5.backgroundColors;
object2.label = desaturate_60893Binding(backgroundColors.label, saturation);
r3 = object2;
} else {
r3 = value2;
}
object.backgroundColors = r3;
buttonColors = object5.buttonColors;
if (buttonColors != null) {
object3 = {};
desaturate_60893Binding = desaturate_60893;
buttonColors = object5.buttonColors;
object3.primary = desaturate_60893Binding(buttonColors.primary, saturation);
buttonColors = object5.buttonColors;
object3.secondary = desaturate_60893Binding(buttonColors.secondary, saturation);
buttonColors = object5.buttonColors;
object3.text = desaturate_60893Binding(buttonColors.text, saturation);
r3 = object3;
} else {
r3 = value2;
}
object.buttonColors = r3;
object.confettiColors = object5.confettiColors.map(function(a0) {
return desaturate_60893(a0, saturation);
});
r0 = object;
}
return r0;
}
}
}
global.__d(_fun60889, 7592, [57, 4502, 7593, 5132, 632,
2]) /* metro module 7592, dependencies: [57, 4502, 7593, 5132, 632, 2] */;