decord/source/modules/client_themes/native/ThemedGradient.tsx

614 lines
20 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 9128
// Function ID: 9129
2026-07-29 08:29:29 +00:00
// Name: getMixedGradientColor
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 4199, 21, 4668, 1363, 4228, 4227, 1494, 4761, 4314, 712, 4230, 4198, 689, 1208, 647, 4232, 4313, 1349, 2]
2026-07-29 08:29:29 +00:00
// Exports: CustomThemedGradient, default, validateColors
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 9128 (getMixedGradientColor)
import ThemesDefault from "Themes" /* 712 */;
import AccessibilityAnnouncer from "AccessibilityAnnouncer" /* 1363 */;
import useWindowDimensionsDefault from "useWindowDimensions" /* 1494 */;
import hexToRgba from "hexToRgba" /* 4227 */;
import hslToRgbDefault from "hslToRgb" /* 4228 */;
import set from "set" /* 4230 */;
import getGuildIdFromNavigationStateDefault from "getGuildIdFromNavigationState" /* 4232 */;
import useThemeDefault from "useTheme" /* 4314 */;
import LinearGradientDefault from "LinearGradient" /* 4761 */;
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_5 from "isSyncedModeThemesEnabled" /* 4199 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function getMixedGradientColor(mixColorOverride) {
({ mixAmount, theme } = mixColorOverride);
let obj = { mixAmount, mixColorOverride: mixColorOverride.mixColorOverride, theme };
mixAmount = obj.mixAmount;
2026-07-20 16:05:17 +00:00
if (mixAmount === undefined) {
mixAmount = {};
}
2026-07-29 08:29:29 +00:00
({ mixColorOverride, darkFallbackOpacity, theme: theme2 } = obj);
2026-07-20 16:05:17 +00:00
if (darkFallbackOpacity === undefined) {
darkFallbackOpacity = 0.7;
}
2026-07-29 08:29:29 +00:00
let num = obj.lightFallbackOpacity;
2026-07-20 16:05:17 +00:00
if (num === undefined) {
num = 0.8;
}
2026-07-29 08:29:29 +00:00
if (null == mixColorOverride) {
2026-08-24 06:08:38 +00:00
const isThemeDarkResult = AccessibilityAnnouncer.isThemeDark(theme2);
2026-07-20 16:05:17 +00:00
if (isThemeDarkResult) {
num = darkFallbackOpacity;
}
2026-07-29 08:29:29 +00:00
let tmp4 = isThemeDarkResult ? mixAmount.dark : mixAmount.light;
if (tmp4 == null) {
tmp4 = num;
2026-07-20 16:05:17 +00:00
}
let num2 = 255;
if (isThemeDarkResult) {
num2 = 0;
}
2026-08-24 06:08:38 +00:00
mixColorOverride = new hslToRgbDefault(num2, num2, num2, tmp4);
const obj3 = AccessibilityAnnouncer;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { mixAmount, theme };
let mixAmount1 = obj.mixAmount;
if (mixAmount1 === undefined) {
mixAmount1 = {};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ darkFallbackAmount, theme: theme3 } = obj);
2026-07-20 16:05:17 +00:00
if (darkFallbackAmount === undefined) {
darkFallbackAmount = 0.3;
}
2026-07-29 08:29:29 +00:00
let num3 = obj.lightFallbackAmount;
if (num3 === undefined) {
num3 = 0.2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (obj6.isThemeDark(theme3)) {
if (null != mixAmount1.dark) {
darkFallbackAmount = 1 - mixAmount1.dark;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
num3 = darkFallbackAmount;
} else if (null != mixAmount1.light) {
num3 = 1 - mixAmount1.light;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let tmp12Result = tmp12(4227);
obj6 = AccessibilityAnnouncer;
2026-07-29 08:29:29 +00:00
({ r, g, b } = tmp12Result.hexToRgb(mixColorOverride.color));
2026-08-24 06:08:38 +00:00
tmp12Result = tmp12(4227);
2026-07-29 08:29:29 +00:00
const hexToRgbResult = tmp12Result.hexToRgb(mixColorOverride.color);
2026-08-24 06:08:38 +00:00
const tmp15 = new hslToRgbDefault(r, g, b, num3);
return tmp12Result.mixColors(mixColorOverride, new hslToRgbDefault(r, g, b, num3)).toHexString();
2026-07-20 16:05:17 +00:00
}
function GradientBase(angleCenter) {
angleCenter = angleCenter.angleCenter;
({ colors, locations, angle } = angleCenter);
if (angleCenter === undefined) {
angleCenter = closure_9;
}
({ absolute, wide, tall } = angleCenter);
const tmp = callback3();
2026-08-24 06:08:38 +00:00
({ width, height } = useWindowDimensionsDefault());
2026-07-29 08:29:29 +00:00
let obj = { colors, locations, angle, angleCenter, useAngle: true, style: null };
2026-08-24 06:08:38 +00:00
const tmp2 = useWindowDimensionsDefault();
2026-07-20 16:05:17 +00:00
const tmp3 = closure_6;
if (wide) {
2026-07-29 08:29:29 +00:00
obj = { width: null };
obj[0] = width;
2026-07-20 16:05:17 +00:00
wide = obj;
}
const items = [wide, , , , ];
if (tall) {
2026-07-29 08:29:29 +00:00
obj = { height: null };
obj[0] = height;
2026-07-20 16:05:17 +00:00
tall = obj;
}
items[1] = tall;
items[2] = tmp.linearGradient;
if (absolute) {
absolute = tmp.absolute;
}
items[3] = absolute;
items[4] = angleCenter.componentStyles;
2026-07-29 08:29:29 +00:00
obj[5] = items;
2026-08-24 06:08:38 +00:00
return tmp3(LinearGradientDefault, obj);
2026-07-20 16:05:17 +00:00
}
class Gradient {
constructor(arg0) {
2026-07-23 10:11:24 +00:00
({ gradient, angleOverride, mix, mixAmount } = global);
2026-07-20 16:05:17 +00:00
({ absolute, wide, tall, componentStyles } = global);
if (mixAmount === undefined) {
mixAmount = {};
}
2026-08-24 06:08:38 +00:00
closure_1 = mixAmount;
2026-07-23 10:11:24 +00:00
mixColorOverride = global.mixColorOverride;
2026-08-24 06:08:38 +00:00
closure_3 = undefined;
closure_3 = require("useTheme")();
2026-07-20 16:05:17 +00:00
colors = gradient.colors;
obj = {
colors: colors.map((arg0) => {
if (closure_0) {
2026-07-29 08:29:29 +00:00
const obj = { color: null, mixAmount: null, mixColorOverride: null, theme: null };
obj[0] = mixAmount(mixColorOverride[11]).unsafe_rawColors[arg0.token];
obj[1] = mixAmount;
obj[2] = mixColorOverride;
2026-08-24 06:08:38 +00:00
obj[3] = closure_3;
let tmp3 = closure_1_11(obj);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = mixAmount(mixColorOverride[11]).unsafe_rawColors[arg0.token];
}
return tmp3;
}),
2026-07-29 08:29:29 +00:00
locations: colors1.map((stop) => stop.stop / 100),
angle: null,
angleCenter: null,
absolute: null,
wide: null,
tall: null,
componentStyles: null
2026-07-20 16:05:17 +00:00
};
colors1 = gradient.colors;
tmp = jsx;
tmp2 = GradientBase;
2026-07-29 08:29:29 +00:00
if (angleOverride == null) {
2026-07-20 16:05:17 +00:00
angleOverride = gradient.angle;
}
2026-07-29 08:29:29 +00:00
obj[2] = angleOverride;
2026-07-20 16:05:17 +00:00
angleCenter = gradient.angleCenter;
2026-07-29 08:29:29 +00:00
if (angleCenter == null) {
2026-08-24 06:08:38 +00:00
angleCenter = closure_9;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = angleCenter;
obj[4] = absolute;
obj[5] = wide;
obj[6] = tall;
obj[7] = componentStyles;
2026-07-20 16:05:17 +00:00
return tmp(tmp2, obj);
}
}
function GuildThemePresetGradient(mixColorOverride) {
2026-07-23 10:11:24 +00:00
({ angleOverride, mix: require, mixAmount } = mixColorOverride);
2026-07-20 16:05:17 +00:00
({ preset, absolute, wide, tall, componentStyles } = mixColorOverride);
if (mixAmount === undefined) {
mixAmount = {};
}
2026-07-23 10:11:24 +00:00
mixColorOverride = mixColorOverride.mixColorOverride;
2026-08-24 06:08:38 +00:00
closure_3 = undefined;
2026-07-23 10:11:24 +00:00
const tmp = mixAmount(mixColorOverride[10])();
2026-08-24 06:08:38 +00:00
closure_3 = tmp;
2026-07-23 10:11:24 +00:00
let obj = require(mixColorOverride[12]);
2026-07-20 16:05:17 +00:00
const guildThemePresetAppearance = obj.getGuildThemePresetAppearance(preset, tmp);
const colors = guildThemePresetAppearance.colors;
obj = {
colors: colors.map((hex) => {
if (closure_0) {
2026-07-29 08:29:29 +00:00
const obj = { color: null, mixAmount: null, mixColorOverride: null, theme: null };
obj[0] = hex.hex;
obj[1] = mixAmount;
obj[2] = mixColorOverride;
2026-08-24 06:08:38 +00:00
obj[3] = closure_3;
hex = closure_1_11(obj);
2026-07-20 16:05:17 +00:00
} else {
hex = hex.hex;
}
return hex;
}),
2026-07-29 08:29:29 +00:00
locations: colors1.map((stop) => stop.stop / 100),
angle: null,
angleCenter: null,
absolute: null,
wide: null,
tall: null,
componentStyles: null
2026-07-20 16:05:17 +00:00
};
2026-07-23 10:11:24 +00:00
colors1 = guildThemePresetAppearance.colors;
2026-07-29 08:29:29 +00:00
if (angleOverride == null) {
2026-07-20 16:05:17 +00:00
angleOverride = guildThemePresetAppearance.angle;
}
2026-07-29 08:29:29 +00:00
obj[2] = angleOverride;
obj[3] = closure_9;
obj[4] = absolute;
obj[5] = wide;
obj[6] = tall;
obj[7] = componentStyles;
2026-07-20 16:05:17 +00:00
return closure_6(GradientBase, obj);
}
function CustomThemesGradient(arg0) {
2026-07-29 08:29:29 +00:00
({ colors, gradientColorStops, absolute, wide, tall, mixAmount } = arg0);
({ baseMix, gradientAngle, mix } = arg0);
2026-07-20 16:05:17 +00:00
if (mixAmount === undefined) {
mixAmount = {};
}
2026-07-29 08:29:29 +00:00
let reduced;
reduced = undefined;
2026-07-20 16:05:17 +00:00
({ mixColorOverride, componentStyles, theme } = arg0);
2026-07-29 08:29:29 +00:00
const tmp = callback3();
reduced = undefined;
mixColorOverride = undefined;
theme = undefined;
reduced = baseMix;
({ width, height } = reduced(mixColorOverride[8])());
if (mixAmount === undefined) {
mixAmount = {};
}
reduced = mixAmount;
let mapped = colors;
if (mix) {
mapped = colors.map((PRIMARY_800) => {
let obj = reduced;
let tmp2 = mixColorOverride;
2026-08-24 06:08:38 +00:00
let num = closure_1_10;
2026-07-29 08:29:29 +00:00
obj = reduced;
const result = reduced / 100;
if (reduced === undefined) {
obj = {};
}
if (null == tmp2) {
const diff = 1 - result;
let sum = num + 0.2 * diff;
const isThemeDarkResult = reduced(mixColorOverride[5]).isThemeDark(tmp3);
if (isThemeDarkResult) {
sum = num + 0.25 * diff;
}
let tmp6 = isThemeDarkResult ? obj.dark : obj.light;
if (tmp6 == null) {
tmp6 = sum;
}
let num3 = 255;
if (isThemeDarkResult) {
num3 = 0;
}
tmp2 = new reduced(mixColorOverride[6])(num3, num3, num3, tmp6);
const obj7 = reduced(mixColorOverride[5]);
const tmp21 = mixColorOverride;
}
if (reduced === undefined) {
obj = {};
}
let num4 = num;
if (num === undefined) {
num4 = 0.3;
}
if (num === undefined) {
num = 0.2;
}
if (obj3.isThemeDark(theme)) {
if (null != obj.dark) {
num4 = 1 - obj.dark;
}
num = num4;
} else if (null != obj.light) {
num = 1 - obj.light;
}
let tmp14Result = tmp14(tmp15[7]);
obj3 = reduced(mixColorOverride[5]);
({ r, g, b } = tmp14Result.hexToRgb(PRIMARY_800));
tmp14Result = tmp14(tmp15[7]);
const hexToRgbResult = tmp14Result.hexToRgb(PRIMARY_800);
const tmp17 = new reduced(mixColorOverride[6])(r, g, b, num);
const mixColorsResult = tmp14Result.mixColors(tmp2, new reduced(mixColorOverride[6])(r, g, b, num));
return reduced(mixColorOverride[13]).colorToHex(mixColorsResult);
});
}
let arr2 = mapped;
if (1 === mapped.length) {
const items = [mapped[0], mapped[0]];
arr2 = items;
}
reduced = arr2;
let result = (gradientAngle - 90) * Math.PI / 180;
2026-07-20 16:05:17 +00:00
const cosResult = Math.cos(result);
const sinResult = Math.sin(result);
2026-07-29 08:29:29 +00:00
let obj = { x: 0.6 - 0.7142857142857143 * cosResult, y: 0.5 - 0.7142857142857143 * sinResult };
obj = { x: 0.6 + 0.7142857142857143 * cosResult, y: 0.5 + 0.7142857142857143 * sinResult };
2026-08-04 21:03:28 +00:00
reduced = arr2.reduce((arr, str) => {
if (typeof str === "string") {
if (regex.test(str)) {
arr.push(str);
2026-07-29 08:29:29 +00:00
return arr;
}
}
try {
2026-08-04 21:03:28 +00:00
arr.push(reduced(mixColorOverride[14])(str).hex("rgb"));
2026-07-29 08:29:29 +00:00
return arr;
} catch (err) {
}
}, []);
if (gradientColorStops === undefined) {
gradientColorStops = [];
}
if (gradientColorStops.length === reduced.length) {
let mapped1 = gradientColorStops.map((arg0) => arg0 / 100);
} else if (1 === reduced.length) {
mapped1 = [0, 1];
} else {
mapped1 = reduced.map((arg0, arg1) => arg1 / (reduced.length - 1));
}
const items1 = [reduced, arr2];
const effect = theme.useEffect(() => {
if (reduced.length < 2) {
let obj = reduced(mixColorOverride[15]);
2026-07-20 16:05:17 +00:00
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("Invalid custom theme gradient colors");
2026-07-29 08:29:29 +00:00
obj = { extra: null };
obj = { gradientColors: null };
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
2026-07-29 08:29:29 +00:00
obj[0] = JSON.stringify(reduced);
obj[0] = obj;
2026-07-20 16:05:17 +00:00
obj.captureException(error, obj);
}
2026-07-29 08:29:29 +00:00
}, items1);
2026-07-20 16:05:17 +00:00
let tmp10Result = null;
2026-07-29 08:29:29 +00:00
if (reduced.length >= 2) {
obj = { colors: null, locations: null, start: null, end: null, style: null };
obj[0] = reduced;
obj[1] = mapped1;
obj[2] = obj;
obj[3] = obj;
2026-07-20 16:05:17 +00:00
if (wide) {
2026-08-24 06:08:38 +00:00
obj1 = { width: null };
2026-07-29 08:29:29 +00:00
obj1[0] = width;
wide = obj1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items2 = [wide, , , , ];
2026-07-20 16:05:17 +00:00
if (tall) {
2026-07-29 08:29:29 +00:00
const obj2 = { height: null };
obj2[0] = height;
tall = obj2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items2[1] = tall;
items2[2] = tmp.linearGradient;
2026-07-20 16:05:17 +00:00
if (absolute) {
absolute = tmp.absolute;
}
2026-07-29 08:29:29 +00:00
items2[3] = absolute;
items2[4] = componentStyles;
obj[4] = items2;
tmp10Result = closure_6(reduced(mixColorOverride[9]), obj);
2026-07-20 16:05:17 +00:00
const tmp10 = closure_6;
2026-07-29 08:29:29 +00:00
const tmp2Result = reduced(mixColorOverride[9]);
2026-07-20 16:05:17 +00:00
}
return tmp10Result;
}
function ActiveGuildThemeGradient(arg0) {
({ activeGuildTheme, theme } = arg0);
2026-07-29 08:29:29 +00:00
const merged = Object.assign(arg0, Object.create(null));
2026-07-20 16:05:17 +00:00
if ("custom" === activeGuildTheme.type) {
const customUserThemeSettings = activeGuildTheme.customUserThemeSettings;
2026-07-29 08:29:29 +00:00
let obj = {};
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
const items = [];
2026-08-24 06:08:38 +00:00
HermesBuiltin.arraySpread(set.getSingleColorGuildThemeGradientColors(customUserThemeSettings.colors[0], theme), 0);
2026-07-29 08:29:29 +00:00
obj.colors = items;
obj.gradientColorStops = [];
let num2 = customUserThemeSettings.gradientAngle;
if (num2 == null) {
num2 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.gradientAngle = num2;
2026-07-20 16:05:17 +00:00
let GUILD_THEME_DEFAULT_BASE_MIX = customUserThemeSettings.baseMix;
2026-07-29 08:29:29 +00:00
if (GUILD_THEME_DEFAULT_BASE_MIX == null) {
2026-08-24 06:08:38 +00:00
GUILD_THEME_DEFAULT_BASE_MIX = set.GUILD_THEME_DEFAULT_BASE_MIX;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.baseMix = GUILD_THEME_DEFAULT_BASE_MIX;
obj.theme = theme;
2026-07-20 16:05:17 +00:00
return callback(CustomThemesGradient, obj);
} else {
obj = {};
const merged2 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.preset = activeGuildTheme.preset;
2026-07-20 16:05:17 +00:00
return callback(GuildThemePresetGradient, obj);
}
}
2026-07-29 08:29:29 +00:00
({ jsx: closure_6, jsxs: error } = jsxProd);
let closure_8 = createCacheKey.createStyles({ softenGradient: { flex: 1 }, linearGradient: { flex: 1 }, absolute: { position: "absolute", top: 0, bottom: 0, left: 0, right: 0 } });
2026-07-23 10:11:24 +00:00
let closure_9 = { x: 0.5, y: 0.5 };
let c10 = 0.5;
2026-07-29 08:29:29 +00:00
const re15 = /^#(?:[0-9a-fA-F]{3}){1,2}$/;
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/client_themes/native/ThemedGradient.tsx");
2026-07-20 16:05:17 +00:00
export default function ThemedGradient(overlayOpacity) {
let num = overlayOpacity.overlayOpacity;
if (num === undefined) {
num = 0.7;
}
const gradientOverride = overlayOpacity.gradientOverride;
2026-07-29 08:29:29 +00:00
const merged = Object.assign(overlayOpacity, Object.create(null));
const tmp2 = callback3();
2026-08-24 06:08:38 +00:00
let obj = AccessibilityAnnouncer;
const tmp5 = useThemeDefault();
const unsafe_rawColors = ThemesDefault.unsafe_rawColors;
const tmp8 = obj.isThemeDark(useThemeDefault()) ? unsafe_rawColors.BLACK : unsafe_rawColors.WHITE;
2026-07-20 16:05:17 +00:00
const withOverlay = merged.withOverlay;
2026-08-24 06:08:38 +00:00
const isThemeDarkResult = obj.isThemeDark(useThemeDefault());
2026-07-29 08:29:29 +00:00
let tmp6Result = tmp6(647);
2026-08-24 06:08:38 +00:00
const items = [closure_5];
2026-07-29 08:29:29 +00:00
const preset = tmp6Result.useStateFromStoresObject(items, () => ({ preset: gradientPreset.gradientPreset })).preset;
2026-08-24 06:08:38 +00:00
const tmp10 = getGuildIdFromNavigationStateDefault();
tmp6Result = tmp6(4313);
2026-07-29 08:29:29 +00:00
const customThemeDisplaySettings = tmp6Result.useCustomThemeDisplaySettings();
2026-07-20 16:05:17 +00:00
if (null != gradientOverride) {
2026-07-29 08:29:29 +00:00
if (tmp12) {
2026-08-11 06:20:06 +00:00
if (gradientOverride.type === tmp6(1349).ClientThemeType.CUSTOM_BACKGROUND_GRADIENT) {
2026-07-20 16:05:17 +00:00
obj = {};
const merged1 = Object.assign(merged);
const merged2 = Object.assign(gradientOverride.customThemeSettings);
2026-07-29 08:29:29 +00:00
obj.theme = gradientOverride.theme;
const tmp59 = callback(CustomThemesGradient, obj);
let tmp60 = tmp59;
if (withOverlay) {
obj = { style: null, children: null };
obj[0] = tmp2.absolute;
const items1 = [tmp59, ];
2026-08-24 06:08:38 +00:00
obj1 = { style: null };
2026-07-29 08:29:29 +00:00
const items2 = [tmp2.softenGradient, ];
const obj2 = { backgroundColor: null };
2026-08-24 06:08:38 +00:00
obj2[0] = tmp6(4227).hexWithOpacity(tmp8, num);
2026-07-29 08:29:29 +00:00
items2[1] = obj2;
obj1[0] = items2;
items1[1] = callback(View, obj1);
obj[1] = items1;
tmp60 = callback2(View, obj);
2026-08-24 06:08:38 +00:00
const tmp6Result1 = tmp6(4227);
2026-07-29 08:29:29 +00:00
}
return tmp60;
2026-07-20 16:05:17 +00:00
}
}
2026-08-11 06:20:06 +00:00
if (gradientOverride.type === tmp6(1349).ClientThemeType.BACKGROUND_GRADIENT_PRESET) {
2026-07-29 08:29:29 +00:00
const obj3 = {};
2026-07-20 16:05:17 +00:00
const merged3 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj3.gradient = gradientOverride;
const tmp48 = callback(Gradient, obj3);
let tmp49 = tmp48;
if (withOverlay) {
const obj4 = { style: null, children: null };
obj4[0] = tmp2.absolute;
const items3 = [tmp48, ];
const obj5 = { style: null };
const items4 = [tmp2.softenGradient, ];
const obj6 = { backgroundColor: null };
2026-08-24 06:08:38 +00:00
obj6[0] = tmp6(4227).hexWithOpacity(tmp8, num);
2026-07-29 08:29:29 +00:00
items4[1] = obj6;
obj5[0] = items4;
items3[1] = callback(View, obj5);
obj4[1] = items3;
tmp49 = callback2(View, obj4);
2026-08-24 06:08:38 +00:00
const tmp6Result2 = tmp6(4227);
2026-07-29 08:29:29 +00:00
}
return tmp49;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (null != tmp10) {
const obj7 = {};
2026-07-20 16:05:17 +00:00
const merged4 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj7.activeGuildTheme = tmp10;
obj7.theme = tmp9;
const tmp39 = callback(ActiveGuildThemeGradient, obj7);
let tmp40 = tmp39;
if (withOverlay) {
const obj8 = { style: null, children: null };
obj8[0] = tmp2.absolute;
const items5 = [tmp39, ];
const obj9 = { style: null };
const items6 = [tmp2.softenGradient, ];
const obj10 = { backgroundColor: null };
2026-08-24 06:08:38 +00:00
obj10[0] = tmp6(4227).hexWithOpacity(tmp8, num);
2026-07-29 08:29:29 +00:00
items6[1] = obj10;
obj9[0] = items6;
items5[1] = tmp34(View, obj9);
obj8[1] = items5;
tmp40 = callback2(View, obj8);
2026-08-24 06:08:38 +00:00
const tmp6Result3 = tmp6(4227);
2026-07-29 08:29:29 +00:00
}
let tmp13 = tmp40;
tmp34 = callback;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (tmp12) {
if (tmp12) {
const obj11 = {};
2026-07-20 16:05:17 +00:00
const merged5 = Object.assign(merged);
const merged6 = Object.assign(customThemeDisplaySettings.customTheme);
2026-07-29 08:29:29 +00:00
obj11.theme = customThemeDisplaySettings.baseTheme;
const tmp30 = callback(CustomThemesGradient, obj11);
let tmp31 = tmp30;
if (withOverlay) {
const obj12 = { style: null, children: null };
obj12[0] = tmp2.absolute;
const items7 = [tmp30, ];
const obj13 = { style: null };
const items8 = [tmp2.softenGradient, ];
const obj14 = { backgroundColor: null };
2026-08-24 06:08:38 +00:00
obj14[0] = tmp6(4227).hexWithOpacity(tmp8, num);
2026-07-29 08:29:29 +00:00
items8[1] = obj14;
obj13[0] = items8;
items7[1] = tmp23(View, obj13);
obj12[1] = items7;
tmp31 = callback2(View, obj12);
2026-08-24 06:08:38 +00:00
const tmp6Result4 = tmp6(4227);
2026-07-29 08:29:29 +00:00
}
tmp13 = tmp31;
tmp23 = callback;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
tmp13 = null;
2026-07-20 16:05:17 +00:00
if (null != preset) {
2026-07-29 08:29:29 +00:00
const obj15 = {};
2026-07-20 16:05:17 +00:00
const merged7 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj15.gradient = preset;
const tmp19 = callback(Gradient, obj15);
let tmp20 = tmp19;
if (withOverlay) {
const obj16 = { style: null, children: null };
obj16[0] = tmp2.absolute;
const items9 = [tmp19, ];
const obj17 = { style: null };
const items10 = [tmp2.softenGradient, ];
const obj18 = { backgroundColor: null };
2026-08-24 06:08:38 +00:00
obj18[0] = tmp6(4227).hexWithOpacity(tmp8, num);
2026-07-29 08:29:29 +00:00
items10[1] = obj18;
obj17[0] = items10;
items9[1] = tmp14(View, obj17);
obj16[1] = items9;
tmp20 = callback2(View, obj16);
2026-08-24 06:08:38 +00:00
const tmp6Result5 = tmp6(4227);
2026-07-29 08:29:29 +00:00
}
tmp13 = tmp20;
tmp14 = callback;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp13;
2026-07-20 16:05:17 +00:00
};
export { Gradient };
2026-07-29 08:29:29 +00:00
export const validateColors = function validateColors(arr) {
2026-08-04 21:03:28 +00:00
return arr.reduce((arr, str) => {
if (typeof str === "string") {
if (regex.test(str)) {
arr.push(str);
2026-07-29 08:29:29 +00:00
return arr;
}
}
try {
2026-08-04 21:03:28 +00:00
arr.push(reduced(mixColorOverride[14])(str).hex("rgb"));
2026-07-29 08:29:29 +00:00
return arr;
} catch (err) {
}
}, []);
};
2026-07-20 16:05:17 +00:00
export const CustomThemedGradient = function CustomThemedGradient(overlayOpacity) {
let num = overlayOpacity.overlayOpacity;
if (num === undefined) {
num = 0.7;
}
const customTheme = overlayOpacity.customTheme;
2026-07-29 08:29:29 +00:00
const merged = Object.assign(overlayOpacity, Object.create(null));
const tmp2 = callback3();
2026-08-24 06:08:38 +00:00
let obj = AccessibilityAnnouncer;
const tmp4 = useThemeDefault();
2026-07-29 08:29:29 +00:00
const tmp5 = require;
2026-08-24 06:08:38 +00:00
const unsafe_rawColors = ThemesDefault.unsafe_rawColors;
2026-07-20 16:05:17 +00:00
obj = {};
2026-08-24 06:08:38 +00:00
const isThemeDarkResult = obj.isThemeDark(useThemeDefault());
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
const merged2 = Object.assign(customTheme.customThemeSettings);
2026-07-29 08:29:29 +00:00
obj.theme = customTheme.theme;
const tmp11 = callback(CustomThemesGradient, obj);
let tmp12 = tmp11;
if (merged.withOverlay) {
obj = { style: null, children: null };
obj[0] = tmp2.absolute;
const items = [tmp11, ];
2026-08-24 06:08:38 +00:00
obj1 = { style: null };
2026-07-29 08:29:29 +00:00
const items1 = [tmp2.softenGradient, ];
const obj2 = { backgroundColor: null };
2026-08-24 06:08:38 +00:00
obj2[0] = hexToRgba.hexWithOpacity(tmp7, num);
2026-07-29 08:29:29 +00:00
items1[1] = obj2;
obj1[0] = items1;
items[1] = callback(View, obj1);
obj[1] = items;
tmp12 = callback2(View, obj);
2026-08-24 06:08:38 +00:00
const tmp5Result = hexToRgba;
2026-07-29 08:29:29 +00:00
}
return tmp12;
2026-07-20 16:05:17 +00:00
};