Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,44 @@
|
||||
/* Metro module 7701; source: modules/client_themes/native/ClientThemesOverrides.tsx; dependencies: [31, 4501, 3963, 7702, 2] */
|
||||
function _fun61486(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:6, offset: 0x01b41d2e, size: 195 bytes, params: 8, frame: 20
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_4 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({none: {backgroundColor: 'transparent'}});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/ClientThemesOverrides.tsx');
|
||||
exports.useGradientBottom = useGradientBottom;
|
||||
exports.useGradientTop = useGradientTop;
|
||||
exports.useGradientMidpoint = useGradientMidpoint;
|
||||
exports.useClientThemesOverride = function(a0) {
|
||||
return importDefault(dependencyMap[3])() ? a0 ?? useStyles().none : undefined;
|
||||
};
|
||||
}
|
||||
|
||||
function useGradientBottom() { // fn#61487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:277, offset: 0x01b41df1, size: 93 bytes, params: 1, frame: 17
|
||||
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
|
||||
const useGradientValue = clientThemesUtilsModule.useGradientValue;
|
||||
const GradientPercentage = clientThemesUtilsModule.GradientPercentage;
|
||||
const END = GradientPercentage.END;
|
||||
return env0_3.useMemo(_fun61488, [Reflect.apply(useGradientValue, clientThemesUtilsModule, [END])]);
|
||||
}
|
||||
|
||||
function useGradientTop() { // fn#61489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:426, offset: 0x01b41e6f, size: 93 bytes, params: 1, frame: 17
|
||||
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
|
||||
const useGradientValue = clientThemesUtilsModule.useGradientValue;
|
||||
const GradientPercentage = clientThemesUtilsModule.GradientPercentage;
|
||||
const START = GradientPercentage.START;
|
||||
return env0_3.useMemo(_fun61490, [Reflect.apply(useGradientValue, clientThemesUtilsModule, [START])]);
|
||||
}
|
||||
|
||||
function useGradientMidpoint() { // fn#61491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:582, offset: 0x01b41ecc, size: 93 bytes, params: 1, frame: 17
|
||||
const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */;
|
||||
const useGradientValue = clientThemesUtilsModule.useGradientValue;
|
||||
const GradientPercentage = clientThemesUtilsModule.GradientPercentage;
|
||||
const MID = GradientPercentage.MID;
|
||||
return env0_3.useMemo(_fun61492, [Reflect.apply(useGradientValue, clientThemesUtilsModule, [MID])]);
|
||||
}
|
||||
|
||||
function _fun61488() { // fn#61488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7879:363, offset: 0x01b41e4e, size: 33 bytes, params: 1, frame: 3
|
||||
return env0_0 != null ? {backgroundColor: env0_0} : undefined;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,354 @@
|
||||
/* Metro module 3963; source: modules/client_themes/native/ClientThemesUtils.tsx; dependencies: [57, 31, 1310, 3964, 1354, 697, 674, 4000, 4001, 3966, 4002, 4003, 4048, 4045, 2] */
|
||||
function _fun32428(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#32428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:6, offset: 0x0101522b, size: 844 bytes, params: 8, frame: 25
|
||||
var object4;
|
||||
const env0_0 = require;
|
||||
const closure = getClientThemesGradientColorByPercentage;
|
||||
const closure2 = function({colors}) {
|
||||
return colors.map(_fun32433);
|
||||
};
|
||||
const getGradientAngle = function(a0) {
|
||||
return a0.type === require(dependencyMap[9]).ClientThemeType.BACKGROUND_GRADIENT_PRESET ? a0.angle : a0.customThemeSettings.gradientAngle;
|
||||
};
|
||||
const closure3 = function(a0, a1) {
|
||||
return calculateGradientValueWithOpacity(a0, a1, a0.theme);
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
||||
const env0_4 = importAll(31) /* metro dependency 31 */;
|
||||
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
|
||||
const clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
|
||||
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
|
||||
object4 = {LEVEL_9: 0.9};
|
||||
object4[0.9] = 'LEVEL_9';
|
||||
object4.LEVEL_85 = 0.85;
|
||||
object4[0.85] = 'LEVEL_85';
|
||||
object4.LEVEL_8 = 0.8;
|
||||
object4[0.8] = 'LEVEL_8';
|
||||
object4.LEVEL_75 = 0.75;
|
||||
object4[0.75] = 'LEVEL_75';
|
||||
object4.LEVEL_7 = 0.7;
|
||||
object4[0.7] = 'LEVEL_7';
|
||||
object4.LEVEL_6 = 0.6;
|
||||
object4[0.6] = 'LEVEL_6';
|
||||
object4.LEVEL_5 = 0.5;
|
||||
object4[0.5] = 'LEVEL_5';
|
||||
object4.LEVEL_4 = 0.4;
|
||||
object4[0.4] = 'LEVEL_4';
|
||||
object4.LEVEL_35 = 0.35;
|
||||
object4[0.35] = 'LEVEL_35';
|
||||
object4.LEVEL_3 = 0.3;
|
||||
object4[0.3] = 'LEVEL_3';
|
||||
object4.LEVEL_25 = 0.25;
|
||||
object4[0.25] = 'LEVEL_25';
|
||||
object4.LEVEL_2 = 0.2;
|
||||
object4[0.2] = 'LEVEL_2';
|
||||
object4.LEVEL_15 = 0.15;
|
||||
object4[0.15] = 'LEVEL_15';
|
||||
object4.LEVEL_1 = 0.1;
|
||||
object4[0.1] = 'LEVEL_1';
|
||||
const object5 = {};
|
||||
const BLACK = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BLACK;
|
||||
object5.DARK = BLACK;
|
||||
const WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
|
||||
object5.LIGHT = WHITE;
|
||||
const object6 = {START: 0};
|
||||
object6[0] = 'START';
|
||||
object6.MID = 50;
|
||||
object6[50] = 'MID';
|
||||
object6.END = 100;
|
||||
object6[100] = 'END';
|
||||
const closure4 = colorToHex;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/ClientThemesUtils.tsx');
|
||||
exports.GRADIENT_ANGLE_BREAKPOINT = 128;
|
||||
exports.OverlayOpacity = object4;
|
||||
exports.OverlayColors = object5;
|
||||
exports.GradientPercentage = object6;
|
||||
exports.colorToHex = closure4;
|
||||
exports.getClientThemesGradientColorByPercentage = closure;
|
||||
exports.getClientThemesGradientHexColors = closure2;
|
||||
exports.getGradientThemeMetadata = getGradientThemeMetadata;
|
||||
exports.getGradientValue = closure3;
|
||||
exports.useGradientValue = useGradientValue;
|
||||
exports.getEmbedScrollGradientBackground = getEmbedScrollGradientBackground;
|
||||
exports.getEmbedBackground = getEmbedBackground;
|
||||
}
|
||||
|
||||
function getMixWithOpacity({r, g, b}, {r, g, b}, a2) { // fn#32429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:791, offset: 0x01015577, size: 164 bytes, params: 4, frame: 25
|
||||
const colorToHexBinding = colorToHex;
|
||||
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
|
||||
const mixColors = colorUtilsModule.mixColors;
|
||||
let value = importDefault(4001) /* metro dependency 4001: Color */;
|
||||
value = new value(r, g, b, a2);
|
||||
const defaultImport = importDefault(4001) /* metro dependency 4001: Color */;
|
||||
const value3 = 1 - a2;
|
||||
const value4 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
|
||||
const defaultImport2 = new defaultImport(r, g, b, value3);
|
||||
return colorToHexBinding(Reflect.apply(mixColors, colorUtilsModule, [value,
|
||||
defaultImport2 instanceof Object ? defaultImport2 : value4]));
|
||||
}
|
||||
|
||||
function getClientThemesGradientColorByPercentage(a0, a1) { // fn#32430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:924, offset: 0x0101561b, size: 149 bytes, params: 3, frame: 16
|
||||
const value = env0_3((importDefault(674) /* metro dependency 674 */).scale(getClientThemesGradientHexColors(a0)).domain(a0.colors.map(function(a0) {
|
||||
return a0.stop;
|
||||
}))(a1).rgb(), 3);
|
||||
return {r: value[0], g: value[1], b: value[2]};
|
||||
}
|
||||
|
||||
function getClientThemesGradientHexColors({colors}) { // fn#32432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1126, offset: 0x010156bb, size: 27 bytes, params: 2, frame: 11
|
||||
return colors.map(function(a0) {
|
||||
return importDefault(dependencyMap[5]).unsafe_rawColors[a0.token];
|
||||
});
|
||||
}
|
||||
|
||||
function getGradientColorByPercentage(a0, a1) { // fn#32435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1373, offset: 0x0101574a, size: 254 bytes, params: 3, frame: 19
|
||||
const type = a0.type;
|
||||
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
|
||||
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
|
||||
if (type === BACKGROUND_GRADIENT_PRESET) {
|
||||
return getClientThemesGradientColorByPercentage(a0, a1);
|
||||
}
|
||||
const colors = a0.customThemeSettings.colors;
|
||||
if (colors.length === 1) {
|
||||
return (require(4000) /* metro dependency 4000: ColorUtils */).hexToRgb(colors[0]);
|
||||
}
|
||||
const value2 = colors.map(function(a0, a1) {
|
||||
return a1 / (colors.length - 1) * 100;
|
||||
});
|
||||
const value3 = (importDefault(674) /* metro dependency 674 */).scale(colors);
|
||||
const value = env0_3(value3.domain(value2)(a1).rgb(), 3);
|
||||
return {r: value[0], g: value[1], b: value[2]};
|
||||
}
|
||||
|
||||
function getBottomColorWithOpacity(a0, a1, a2) { // fn#32437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1733, offset: 0x0101586b, size: 76 bytes, params: 4, frame: 17
|
||||
return getMixWithOpacity(getGradientColorByPercentage(a0,
|
||||
getGradientAngle(a0) > env0_8 ? env0_11.END : env0_11.START), a1, a2);
|
||||
}
|
||||
|
||||
function getTopColorWithOpacity(a0, a1, a2) { // fn#32438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:1873, offset: 0x010158b7, size: 76 bytes, params: 4, frame: 17
|
||||
return getMixWithOpacity(getGradientColorByPercentage(a0,
|
||||
getGradientAngle(a0) > env0_8 ? env0_11.START : env0_11.END), a1, a2);
|
||||
}
|
||||
|
||||
function calculateGradientValueWithOpacity(a0, a1, a2, a3) { // fn#32439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:2010, offset: 0x01015903, size: 512 bytes, params: 5, frame: 23
|
||||
var r3;
|
||||
var r0;
|
||||
var isThemeDark3;
|
||||
let value = a1;
|
||||
const value2 = a3;
|
||||
const isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(a2);
|
||||
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
|
||||
const hexToRgb = colorUtilsModule.hexToRgb;
|
||||
let binding = env0_10;
|
||||
const r4 = isThemeDark2 ? Reflect.apply(hexToRgb, colorUtilsModule, [binding.DARK]) : Reflect.apply(hexToRgb,
|
||||
colorUtilsModule, [binding.LIGHT]);
|
||||
let type = a0.type;
|
||||
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
|
||||
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
|
||||
let r8 = type !== BACKGROUND_GRADIENT_PRESET ? env0_11.MID : a0.midpointPercentage ?? env0_11.MID;
|
||||
r8 = value ?? r8;
|
||||
type = a0.type;
|
||||
const CUSTOM_BACKGROUND_GRADIENT = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
|
||||
if (type === CUSTOM_BACKGROUND_GRADIENT) {
|
||||
value = a0.customThemeSettings.baseMix / 100;
|
||||
if (value2 != null) {
|
||||
r0 = value2;
|
||||
} else {
|
||||
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(a2);
|
||||
value = 0.2 * value;
|
||||
r0 = isThemeDark3 ? 0.12 + value : 0.3 + value;
|
||||
}
|
||||
r3 = r0;
|
||||
} else if (value2 != null) {
|
||||
r3 = value2;
|
||||
} else {
|
||||
value = require(4002) /* metro dependency 4002: shared */;
|
||||
value = value.isThemeDark(a2);
|
||||
binding = env0_9;
|
||||
r3 = value ? binding.LEVEL_2 : binding.LEVEL_4;
|
||||
}
|
||||
value = getGradientAngle(a0);
|
||||
const START = env0_11.START;
|
||||
return r8 === START ? value < env0_8 ? getBottomColorWithOpacity(a0, r4, r3) : getTopColorWithOpacity(a0, r4,
|
||||
r3) : r8 === env0_11.END ? value > env0_8 ? getBottomColorWithOpacity(a0, r4, r3) : getTopColorWithOpacity(a0,
|
||||
r4, r3) : getMixWithOpacity(getGradientColorByPercentage(a0, r8), r4, r3);
|
||||
}
|
||||
|
||||
function colorToHex({red, green, blue}) { // fn#32441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:742, offset: 0x01015b21, size: 76 bytes, params: 2, frame: 15
|
||||
let value = importDefault(674) /* metro dependency 674 */;
|
||||
value = value.rgb(red, green, blue);
|
||||
return value.hex('rgb');
|
||||
}
|
||||
|
||||
function getGradientThemeMetadata(a0, a1) { // fn#32442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:3241, offset: 0x01015b6d, size: 608 bytes, params: 3, frame: 33
|
||||
var r10;
|
||||
var r3;
|
||||
var r4;
|
||||
var colors;
|
||||
var value7;
|
||||
var indexOf;
|
||||
var Math;
|
||||
var min;
|
||||
var items;
|
||||
var value9;
|
||||
var defaultImport;
|
||||
var max;
|
||||
var value10;
|
||||
if (a0 == null) {
|
||||
return null;
|
||||
}
|
||||
if (a1 == null) {
|
||||
return null;
|
||||
}
|
||||
var value;
|
||||
const getGradientValueBinding = getGradientValue;
|
||||
const START = env0_11.START;
|
||||
const gradientValueBinding = getGradientValueBinding(a1, START);
|
||||
const MID = env0_11.MID;
|
||||
const gradientValueBinding2 = getGradientValueBinding(a1, MID);
|
||||
const END = env0_11.END;
|
||||
const gradientValueBinding3 = getGradientValueBinding(a1, END);
|
||||
const gradientAngle = getGradientAngle(a1);
|
||||
const r6 = gradientAngle > env0_8 ? gradientValueBinding : gradientValueBinding3;
|
||||
const r5 = gradientAngle > env0_8 ? gradientValueBinding3 : gradientValueBinding;
|
||||
let type = a1.type;
|
||||
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
|
||||
const BACKGROUND_GRADIENT_PRESET = ClientThemeType.BACKGROUND_GRADIENT_PRESET;
|
||||
const r11 = type === BACKGROUND_GRADIENT_PRESET ? getClientThemesGradientHexColors(a1) : a1.customThemeSettings.colors;
|
||||
const property = r11[0];
|
||||
const property2 = r11[r11.length - 1];
|
||||
type = a1.type;
|
||||
const CUSTOM_BACKGROUND_GRADIENT = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
|
||||
if (type !== CUSTOM_BACKGROUND_GRADIENT) {
|
||||
r3 = property2;
|
||||
r4 = property;
|
||||
} else {
|
||||
colors = a1.customThemeSettings.colors;
|
||||
value7 = colors.map(_fun32443);
|
||||
value = importDefault(674) /* metro dependency 674 */;
|
||||
indexOf = value7.indexOf;
|
||||
Math = global.Math;
|
||||
min = Math.min;
|
||||
items = [];
|
||||
value = value(colors[Reflect.apply(indexOf, value7, [apply(min, items, Math, arraySpread(items, value7, 0,
|
||||
undefined))])]);
|
||||
value = value.set('hsl.s', 0.2);
|
||||
value9 = value.set('hsl.l', 0.7).hex();
|
||||
defaultImport = importDefault(674) /* metro dependency 674 */;
|
||||
indexOf = value7.indexOf;
|
||||
Math = global.Math;
|
||||
max = Math.max;
|
||||
items = [];
|
||||
arraySpread(items, value7, 0, value);
|
||||
value = defaultImport(colors[Reflect.apply(indexOf, value7, [apply(max, items, Math, value)])]);
|
||||
value = value.set('hsl.s', 0.2);
|
||||
value = value.set('hsl.l', 0.9);
|
||||
value = value.hex();
|
||||
value10 = a0 === 'dark';
|
||||
r10 = value10 ? value9 : value;
|
||||
r3 = value10 ? value : value9;
|
||||
r4 = r10;
|
||||
}
|
||||
return {theme: a0, colors: {['gradient.start']: gradientValueBinding, ['gradient.mid']: gradientValueBinding2,
|
||||
['gradient.end']: gradientValueBinding3, ['gradient.top']: r6, ['gradient.bottom']: r5,
|
||||
['gradient.primary']: r4, ['gradient.secondary']: r3}};
|
||||
}
|
||||
|
||||
function useGradientValue(a0, a1) { // fn#32444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4184, offset: 0x01015dfa, size: 147 bytes, params: 3, frame: 20
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
const value2 = undefined;
|
||||
return env0_4.useMemo(_fun32445, [(importDefault(4003) /* metro dependency 4003: useColorThemeBackground */)(),
|
||||
a1 == null ? value2 : a1.dark, a1 == null ? value2 : a1.light, a0,
|
||||
(importDefault(4048) /* metro dependency 4048: useTheme */)()]);
|
||||
}
|
||||
|
||||
function getEmbedScrollGradientBackground() { // fn#32446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4682, offset: 0x01015fa7, size: 83 bytes, params: 1, frame: 14
|
||||
const customBackgroundGradient = (require(4045) /* metro dependency 4045: MobileThemesUtils */).getCustomBackgroundGradient();
|
||||
const value3 = null;
|
||||
const r4 = value3 != customBackgroundGradient ? customBackgroundGradient : ClientThemesBackgroundStore.gradientPreset;
|
||||
const r2 = value3 != r4 ? r4 : value3;
|
||||
return value3 == r2 ? value3 : getGradientValue(r2);
|
||||
}
|
||||
|
||||
function getEmbedBackground() { // fn#32447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4884, offset: 0x01015ffa, size: 144 bytes, params: 1, frame: 15
|
||||
var r3;
|
||||
var moduleValue;
|
||||
var isThemeDark2;
|
||||
var binding;
|
||||
var moduleValue2;
|
||||
const hasCustomTheme2 = CustomThemeMobileStore.hasCustomTheme();
|
||||
if (ClientThemesBackgroundStore.gradientPreset != null) {
|
||||
moduleValue = require(4002) /* metro dependency 4002: shared */;
|
||||
isThemeDark2 = moduleValue.isThemeDark(ThemeStore.theme);
|
||||
binding = env0_10;
|
||||
r3 = isThemeDark2 ? binding.DARK : binding.LIGHT;
|
||||
moduleValue2 = require(4000) /* metro dependency 4000: ColorUtils */;
|
||||
return moduleValue2.hexWithOpacity(r3, env0_9.LEVEL_1);
|
||||
}
|
||||
if (hasCustomTheme2) {
|
||||
moduleValue = require(4002) /* metro dependency 4002: shared */;
|
||||
isThemeDark2 = moduleValue.isThemeDark(ThemeStore.theme);
|
||||
binding = env0_10;
|
||||
r3 = isThemeDark2 ? binding.DARK : binding.LIGHT;
|
||||
moduleValue2 = require(4000) /* metro dependency 4000: ColorUtils */;
|
||||
return moduleValue2.hexWithOpacity(r3, env0_9.LEVEL_1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function _fun32443(a0) { // fn#32443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:3748, offset: 0x01015dcd, size: 45 bytes, params: 2, frame: 11
|
||||
let value = environment.__proto__;
|
||||
value = importDefault(674) /* metro dependency 674 */;
|
||||
value = value(a0);
|
||||
return value.luminance();
|
||||
}
|
||||
|
||||
function _fun32445() { // fn#32445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4112:4265, offset: 0x01015e8d, size: 282 bytes, params: 1, frame: 20
|
||||
var r5;
|
||||
var r7;
|
||||
var calculateGradientValueWithOpacityBinding;
|
||||
var binding;
|
||||
var value4;
|
||||
var isThemeDark2;
|
||||
var isThemeDark3;
|
||||
var value5;
|
||||
var binding3;
|
||||
var binding4;
|
||||
if (env0_2 == null) {
|
||||
return null;
|
||||
}
|
||||
const value2 = undefined;
|
||||
if ((require == null ? value2 : require.dark) != null) {
|
||||
value4 = environment.__proto__;
|
||||
isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
|
||||
binding = env1_9;
|
||||
r5 = isThemeDark2 ? binding.LEVEL_2 : binding.LEVEL_4;
|
||||
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
|
||||
value5 = require == null;
|
||||
r7 = isThemeDark3 ? value5 ? value2 : require.dark : value5 ? value2 : require.light;
|
||||
calculateGradientValueWithOpacityBinding = calculateGradientValueWithOpacity;
|
||||
binding = env0_2;
|
||||
binding3 = env0_0;
|
||||
binding4 = env0_3;
|
||||
r5 = r7 ?? r5;
|
||||
return calculateGradientValueWithOpacityBinding(binding, binding3, binding4, r5);
|
||||
}
|
||||
if ((require == null ? value2 : require.light) != null) {
|
||||
value4 = environment.__proto__;
|
||||
isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
|
||||
binding = env1_9;
|
||||
r5 = isThemeDark2 ? binding.LEVEL_2 : binding.LEVEL_4;
|
||||
isThemeDark3 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(env0_3);
|
||||
value5 = require == null;
|
||||
r7 = isThemeDark3 ? value5 ? value2 : require.dark : value5 ? value2 : require.light;
|
||||
calculateGradientValueWithOpacityBinding = calculateGradientValueWithOpacity;
|
||||
binding = env0_2;
|
||||
binding3 = env0_0;
|
||||
binding4 = env0_3;
|
||||
r5 = r7 ?? r5;
|
||||
return calculateGradientValueWithOpacityBinding(binding, binding3, binding4, r5);
|
||||
}
|
||||
return calculateGradientValueWithOpacity(env0_2, env0_0, env0_3);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/* Metro module 11515; source: modules/client_themes/native/CustomThemeMobileActionCreators.tsx; dependencies: [694, 2] */
|
||||
function _fun88166(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:6, offset: 0x01fd741b, size: 138 bytes, params: 8, frame: 17
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/CustomThemeMobileActionCreators.tsx');
|
||||
exports.updateCustomTheme = updateCustomTheme;
|
||||
exports.resetCustomTheme = resetCustomTheme;
|
||||
exports.previewCustomTheme = previewCustomTheme;
|
||||
exports.clearPreviewTheme = clearPreviewTheme;
|
||||
}
|
||||
|
||||
function updateCustomTheme(a0, a1) { // fn#88167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:210, offset: 0x01fd74a5, size: 64 bytes, params: 3, frame: 13
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'UPDATE_CUSTOM_THEME', customTheme: a0,
|
||||
theme: a1});
|
||||
}
|
||||
|
||||
function resetCustomTheme() { // fn#88168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:307, offset: 0x01fd74e5, size: 48 bytes, params: 1, frame: 13
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'RESET_CUSTOM_THEME'});
|
||||
}
|
||||
|
||||
function previewCustomTheme(a0) { // fn#88169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:380, offset: 0x01fd7515, size: 56 bytes, params: 2, frame: 13
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'PREVIEW_CUSTOM_THEME',
|
||||
previewCustomTheme: a0});
|
||||
}
|
||||
|
||||
function clearPreviewTheme() { // fn#88170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11701:474, offset: 0x01fd754d, size: 48 bytes, params: 1, frame: 13
|
||||
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CLEAR_PREVIEW_CUSTOM_THEME'});
|
||||
}
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
/* Metro module 1354; source: modules/client_themes/native/CustomThemeMobileStore.tsx; dependencies: [6, 7, 15, 17, 18, 1311, 1348, 1313, 670, 1314, 566, 694, 2] */
|
||||
function _fun15541(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#15541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:6, offset: 0x00e35c82, size: 462 bytes, params: 8, frame: 21
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_5 = importDefault(6) /* metro dependency 6 */;
|
||||
const env0_6 = importDefault(7) /* metro dependency 7 */;
|
||||
const env0_7 = importDefault(15) /* metro dependency 15 */;
|
||||
const env0_8 = importDefault(17) /* metro dependency 17 */;
|
||||
const env0_9 = importDefault(18) /* metro dependency 18 */;
|
||||
const selectivelySyncedUserSettingsStore = importDefault(1311) /* metro dependency 1311: SelectivelySyncedUserSettingsStore */;
|
||||
const userSettingsProtoStore = importDefault(1348) /* metro dependency 1348: UserSettingsProtoStore */;
|
||||
const env0_12 = (require(1313) /* metro dependency 1313: ThemeConstants */).PROTO_THEME_MAP_MOBILE;
|
||||
const env0_13 = (require(670) /* metro dependency 670: UserSettingsConstants */).UserSettingsTypes;
|
||||
const closure = function() {
|
||||
env0_2 = undefined;
|
||||
env0_3 = undefined;
|
||||
env0_4 = undefined;
|
||||
};
|
||||
const closure2 = function() {
|
||||
var appearance;
|
||||
if (syncThemesEnabled()) {
|
||||
appearance = UserSettingsProtoStore.settings.appearance;
|
||||
if (appearance != null) {
|
||||
updateThemeSettings(appearance);
|
||||
}
|
||||
}
|
||||
};
|
||||
const handleSelectivelySyncedUserSettingsUpdate = function() {
|
||||
var appearance;
|
||||
if (syncThemesEnabled()) {
|
||||
appearance = UserSettingsProtoStore.settings.appearance;
|
||||
if (appearance != null) {
|
||||
updateThemeSettings(appearance);
|
||||
}
|
||||
}
|
||||
};
|
||||
const syncThemesEnabled = function() {
|
||||
return SelectivelySyncedUserSettingsStore.shouldSync('appearance');
|
||||
};
|
||||
const updateThemeSettings = function(a0) {
|
||||
var property = a0.theme;
|
||||
env0_2 = PROTO_THEME_MAP_MOBILE[property ?? require(dependencyMap[9]).Theme.UNSET];
|
||||
property = a0.clientThemeSettings;
|
||||
var value2 = undefined;
|
||||
env0_3 = property == null ? value2 : property.customUserThemeSettings;
|
||||
return value2;
|
||||
};
|
||||
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
|
||||
let value = _fun15552(PersistedStore);
|
||||
value.displayName = 'CustomThemeMobileStore';
|
||||
value.persistKey = 'CustomThemeMobileStore';
|
||||
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
||||
{UPDATE_CUSTOM_THEME: function({customTheme, theme}) {
|
||||
env0_3 = customTheme;
|
||||
env0_2 = theme;
|
||||
}, PREVIEW_CUSTOM_THEME: function(a0) {
|
||||
env0_4 = a0.previewCustomTheme;
|
||||
}, CLEAR_PREVIEW_CUSTOM_THEME: function() {
|
||||
env0_4 = undefined;
|
||||
}, RESET_CUSTOM_THEME: closure, CACHE_LOADED: closure2, POST_CONNECTION_OPEN: closure2,
|
||||
USER_SETTINGS_PROTO_UPDATE: function({settings}) {
|
||||
var value2;
|
||||
if (syncThemesEnabled()) {
|
||||
value2 = getAppearanceSettings(settings);
|
||||
if (value2 != null) {
|
||||
updateThemeSettings(value2);
|
||||
}
|
||||
}
|
||||
}, LOGOUT: closure});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/CustomThemeMobileStore.tsx');
|
||||
exports.default = value;
|
||||
}
|
||||
|
||||
function _isNativeReflectConstruct_15542() { // fn#15542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:235, offset: 0x00e35e50, size: 94 bytes, params: 1, frame: 18
|
||||
var Boolean;
|
||||
var prototype;
|
||||
var valueOf;
|
||||
var call;
|
||||
var Reflect;
|
||||
var construct;
|
||||
var closure;
|
||||
var value;
|
||||
var error;
|
||||
try {
|
||||
Boolean = global.Boolean;
|
||||
prototype = Boolean.prototype;
|
||||
valueOf = prototype.valueOf;
|
||||
call = valueOf.call;
|
||||
Reflect = global.Reflect;
|
||||
construct = Reflect.construct;
|
||||
Boolean = global.Boolean;
|
||||
closure = function() {
|
||||
};
|
||||
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
||||
value = Reflect.apply(call, valueOf, [value]);
|
||||
var result = !value;
|
||||
} catch (error) {
|
||||
}
|
||||
return (_isNativeReflectConstruct_15542_isNativeReflectConstruct = function() {
|
||||
return !!result;
|
||||
})();
|
||||
}
|
||||
|
||||
function validate_15545() { // fn#15545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1033, offset: 0x00e35eae, size: 52 bytes, params: 1, frame: 4
|
||||
return env0_2 != null && (env0_3 != null && env0_3.colors.length !== 0);
|
||||
}
|
||||
|
||||
function getAppearanceSettings(a0) { // fn#15550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:788, offset: 0x00e35f3e, size: 55 bytes, params: 2, frame: 5
|
||||
const type = a0.type;
|
||||
const PRELOADED_USER_SETTINGS = UserSettingsTypes.PRELOADED_USER_SETTINGS;
|
||||
return type !== PRELOADED_USER_SETTINGS ? null : a0.proto == undefined ? undefined : a0.proto.appearance;
|
||||
}
|
||||
|
||||
function _fun15552(a0) { // fn#15552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1106, offset: 0x00e35fd5, size: 210 bytes, params: 2, frame: 16
|
||||
const closure = CustomThemeMobileStore;
|
||||
env0_9(closure, a0);
|
||||
return env0_6(closure, [{key: 'initialize', value: value_15554}, {key: 'getState', value: value_15555},
|
||||
{key: 'getCustomTheme', value: value_15556}, {key: 'getBaseTheme', value: value_15557}, {key: 'getPreviewTheme',
|
||||
value: value_15558}, {key: 'getCustomThemeDisplaySettings', value: value_15559}, {key: 'hasCustomTheme',
|
||||
value: function() {
|
||||
return validate_15545();
|
||||
}}]);
|
||||
}
|
||||
|
||||
function CustomThemeMobileStore() { // fn#15553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1118, offset: 0x00e360a7, size: 113 bytes, params: 1, frame: 20
|
||||
const value = environment.__proto__;
|
||||
env1_5(this, CustomThemeMobileStore);
|
||||
const value3 = env1_8(CustomThemeMobileStore);
|
||||
return env1_7(this, _isNativeReflectConstruct_15542() ? global.Reflect.construct(value3, arguments,
|
||||
env1_8(this).constructor) : value3.apply(this, arguments));
|
||||
}
|
||||
|
||||
function value_15554(a0) { // fn#15554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1446, offset: 0x00e36118, size: 86 bytes, params: 2, frame: 14
|
||||
var theme;
|
||||
var value;
|
||||
var customTheme;
|
||||
if (a0 != null) {
|
||||
theme = a0.theme;
|
||||
value = environment.__proto__;
|
||||
customTheme = a0.customTheme;
|
||||
}
|
||||
this.waitFor(UserSettingsProtoStore, SelectivelySyncedUserSettingsStore);
|
||||
this.syncWith([SelectivelySyncedUserSettingsStore], handleSelectivelySyncedUserSettingsUpdate);
|
||||
}
|
||||
|
||||
function value_15555() { // fn#15555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1598, offset: 0x00e3616e, size: 56 bytes, params: 1, frame: 11
|
||||
const value2 = validate_15545();
|
||||
const object2 = {};
|
||||
if (value2) {
|
||||
object2.theme = env1_2;
|
||||
object2.customTheme = env1_3;
|
||||
} else {
|
||||
object2.theme = undefined;
|
||||
object2.customTheme = undefined;
|
||||
}
|
||||
return object2;
|
||||
}
|
||||
|
||||
function value_15556() { // fn#15556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1715, offset: 0x00e361a6, size: 24 bytes, params: 1, frame: 10
|
||||
if (validate_15545()) {
|
||||
return env1_3;
|
||||
}
|
||||
}
|
||||
|
||||
function value_15557() { // fn#15557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1777, offset: 0x00e361be, size: 24 bytes, params: 1, frame: 10
|
||||
if (validate_15545()) {
|
||||
return env1_2;
|
||||
}
|
||||
}
|
||||
|
||||
function value_15559() { // fn#15559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1481:1907, offset: 0x00e361df, size: 57 bytes, params: 1, frame: 11
|
||||
const value2 = undefined;
|
||||
return value2 !== env1_4 ? env1_4 : validate_15545() ? {baseTheme: env1_2, customTheme: env1_3} : value2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
/* Metro module 4045; source: modules/client_themes/native/MobileThemesUtils.tsx; dependencies: [4046, 1354, 3965, 1244, 2422, 3966, 4047, 1357, 566, 2] */
|
||||
function _fun33363(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:6, offset: 0x0102d0e7, size: 250 bytes, params: 8, frame: 22
|
||||
const env0_0 = require;
|
||||
const getCustomThemesName = function() {
|
||||
return require(dependencyMap[3]).intl.string(importDefault(dependencyMap[4]).yl1iMm);
|
||||
};
|
||||
const closure = function() {
|
||||
var r0;
|
||||
var object;
|
||||
var value2 = CustomThemeMobileStore.getCustomThemeDisplaySettings();
|
||||
if (value2 === undefined) {
|
||||
r0 = null;
|
||||
} else {
|
||||
object = {};
|
||||
object.type = require(dependencyMap[5]).ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
|
||||
object.getName = getCustomThemesName;
|
||||
object.theme = value2.baseTheme;
|
||||
object.customThemeSettings = value2.customTheme;
|
||||
r0 = object;
|
||||
}
|
||||
return r0;
|
||||
};
|
||||
const closure2 = function(a0) {
|
||||
var r0;
|
||||
var object;
|
||||
var value2 = require(dependencyMap[6]).useCustomThemeDisplaySettings(a0);
|
||||
if (value2 === undefined) {
|
||||
r0 = null;
|
||||
} else {
|
||||
object = {};
|
||||
object.type = require(dependencyMap[5]).ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
|
||||
object.getName = getCustomThemesName;
|
||||
object.theme = value2.baseTheme;
|
||||
object.customThemeSettings = value2.customTheme;
|
||||
r0 = object;
|
||||
}
|
||||
return r0;
|
||||
};
|
||||
const getMobileThemesArrayWithMaybeCustomTheme = function(a0, a1) {
|
||||
var r5;
|
||||
var r0;
|
||||
var items;
|
||||
var value3;
|
||||
r5 = a1 ? REFRESH_STANDARD_BACKGROUND_THEMES : LEGACY_STANDARD_BACKGROUND_THEMES;
|
||||
if (a0 != null) {
|
||||
items = [];
|
||||
value3 = arraySpread(items, r5, 0, r5);
|
||||
items[value3] = a0;
|
||||
arraySpread(items, BACKGROUND_GRADIENT_PRESETS_MOBILE, value3 + 1, r5);
|
||||
r0 = items;
|
||||
} else {
|
||||
items = [];
|
||||
arraySpread(items, BACKGROUND_GRADIENT_PRESETS_MOBILE, arraySpread(items, r5, 0, r5), r5);
|
||||
r0 = items;
|
||||
}
|
||||
return r0;
|
||||
};
|
||||
const closure3 = useSavedCustomTheme;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const savedCustomThemeStore = importDefault(4046) /* metro dependency 4046: SavedCustomThemeStore */;
|
||||
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
|
||||
const clientThemesConstantsModule = require(3965) /* metro dependency 3965: ClientThemesConstants */;
|
||||
const env0_5 = clientThemesConstantsModule.BACKGROUND_GRADIENT_PRESETS_MOBILE;
|
||||
const env0_6 = clientThemesConstantsModule.LEGACY_STANDARD_BACKGROUND_THEMES;
|
||||
const env0_7 = clientThemesConstantsModule.REFRESH_STANDARD_BACKGROUND_THEMES;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/MobileThemesUtils.tsx');
|
||||
exports.getCustomBackgroundGradient = closure;
|
||||
exports.useCustomBackgroundGradient = closure2;
|
||||
exports.getAllMobileThemes = getAllMobileThemes;
|
||||
exports.useAllMobileThemes = useAllMobileThemes;
|
||||
exports.useSavedCustomTheme = closure3;
|
||||
}
|
||||
|
||||
function useSavedCustomTheme() { // fn#33368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:953, offset: 0x0102d362, size: 69 bytes, params: 1, frame: 13
|
||||
const savedCustomTheme = (require(566) /* metro dependency 566: flux */).useStateFromStores([SavedCustomThemeStore],
|
||||
function() {
|
||||
return SavedCustomThemeStore.getSavedCustomTheme();
|
||||
});
|
||||
const value = null;
|
||||
return value != savedCustomTheme ? savedCustomTheme : value;
|
||||
}
|
||||
|
||||
function getAllMobileThemes() { // fn#33370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1295, offset: 0x0102d3bc, size: 62 bytes, params: 1, frame: 15
|
||||
const getMobileThemesArrayWithMaybeCustomThemeBinding = getMobileThemesArrayWithMaybeCustomTheme;
|
||||
const customBackgroundGradient = getCustomBackgroundGradient();
|
||||
const value = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */;
|
||||
return getMobileThemesArrayWithMaybeCustomThemeBinding(customBackgroundGradient,
|
||||
value.isMobileVisualRefreshEnabled('MobileThemesUtils'));
|
||||
}
|
||||
|
||||
function useAllMobileThemes() { // fn#33371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1484, offset: 0x0102d3fa, size: 65 bytes, params: 1, frame: 15
|
||||
return getMobileThemesArrayWithMaybeCustomTheme(useCustomBackgroundGradient(useSavedCustomTheme()),
|
||||
(importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('MobileThemesUtils'));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,449 @@
|
||||
/* Metro module 7704; source: modules/client_themes/native/ThemedGradient.tsx; dependencies: [31, 27, 3964, 33, 4501, 4002, 4001, 4000, 1478, 4589, 4048, 697, 4004, 3963, 674, 1216, 632, 4006, 4047, 3966, 2] */
|
||||
function _fun61503(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61503, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:6, offset: 0x01b42256, size: 425 bytes, params: 8, frame: 21
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
||||
const clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
|
||||
const value = require(33) /* metro dependency 33 */;
|
||||
const env0_6 = value.jsx;
|
||||
const env0_7 = value.jsxs;
|
||||
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({softenGradient: {flex: 1},
|
||||
linearGradient: {flex: 1}, absolute: {'position': 'absolute', 'top': 0, 'bottom': 0, 'left': 0, 'right': 0}});
|
||||
const env0_9 = {'x': 0.5, 'y': 0.5};
|
||||
const closure = Gradient;
|
||||
const env0_14 = RegExp('^#(?:[0-9a-fA-F]{3}){1,2}$', '');
|
||||
const closure2 = function(a0) {
|
||||
return a0.reduce(_fun61522, []);
|
||||
};
|
||||
const useThemedGradientCommon = function() {
|
||||
var value2 = useStyles();
|
||||
var value3 = importDefault(dependencyMap[10])();
|
||||
var object = {styles: value2};
|
||||
var isThemeDark = require(dependencyMap[5]).isThemeDark(value3);
|
||||
var property = importDefault(dependencyMap[11]).unsafe_rawColors;
|
||||
object.overlayColor = isThemeDark ? property.BLACK : property.WHITE;
|
||||
return object;
|
||||
};
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/ThemedGradient.tsx');
|
||||
exports.default = _default_61526;
|
||||
exports.Gradient = closure;
|
||||
exports.validateColors = closure2;
|
||||
exports.CustomThemedGradient = CustomThemedGradient;
|
||||
}
|
||||
|
||||
function getThemeMixColor({mixAmount = {}, mixColorOverride, theme, darkFallbackOpacity, lightFallbackOpacity}) { // fn#61504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:319, offset: 0x01b423ff, size: 206 bytes, params: 2, frame: 22
|
||||
darkFallbackOpacity = darkFallbackOpacity === undefined ? 0.7 : darkFallbackOpacity;
|
||||
lightFallbackOpacity = lightFallbackOpacity === undefined ? 0.8 : lightFallbackOpacity;
|
||||
if (mixColorOverride != null) {
|
||||
return mixColorOverride;
|
||||
}
|
||||
const isThemeDark2 = (require(4002) /* metro dependency 4002: shared */).isThemeDark(theme);
|
||||
let r4 = isThemeDark2 ? darkFallbackOpacity : lightFallbackOpacity;
|
||||
let r3 = isThemeDark2 ? mixAmount.dark : mixAmount.light;
|
||||
r4 = r3 ?? r4;
|
||||
r3 = isThemeDark2 ? 0 : 255;
|
||||
let value = importDefault(4001) /* metro dependency 4001: Color */;
|
||||
const value4 = Object.create(value.prototype, {constructor: {value: value}});
|
||||
value = new value(r3, r3, r3, r4);
|
||||
return value instanceof Object ? value : value4;
|
||||
}
|
||||
|
||||
function getThemedMixAmount({mixAmount = {}, theme, darkFallbackAmount, lightFallbackAmount}) { // fn#61505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:578, offset: 0x01b424cd, size: 157 bytes, params: 2, frame: 16
|
||||
darkFallbackAmount = darkFallbackAmount === undefined ? 0.3 : darkFallbackAmount;
|
||||
lightFallbackAmount = lightFallbackAmount === undefined ? 0.2 : lightFallbackAmount;
|
||||
const value = require(4002) /* metro dependency 4002: shared */;
|
||||
return value.isThemeDark(theme) ? mixAmount.dark == null ? darkFallbackAmount : 1 - mixAmount.dark : mixAmount.light == null ? lightFallbackAmount : 1 - mixAmount.light;
|
||||
}
|
||||
|
||||
function getMixedGradientColor({color, mixAmount, mixColorOverride, theme}) { // fn#61506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:762, offset: 0x01b4256a, size: 197 bytes, params: 2, frame: 22
|
||||
const themeMixColor = getThemeMixColor({mixAmount: mixAmount, mixColorOverride: mixColorOverride, theme: theme});
|
||||
const themedMixAmount = getThemedMixAmount({mixAmount: mixAmount, theme: theme});
|
||||
const {r, g, b} = (require(4000) /* metro dependency 4000: ColorUtils */).hexToRgb(color);
|
||||
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
|
||||
const mixColors = colorUtilsModule.mixColors;
|
||||
let value = importDefault(4001) /* metro dependency 4001: Color */;
|
||||
value = new value(r, g, b, themedMixAmount);
|
||||
value = Reflect.apply(mixColors, colorUtilsModule, [themeMixColor, value]);
|
||||
return value.toHexString();
|
||||
}
|
||||
|
||||
function CustomThemesGradient({colors, baseMix, gradientAngle, gradientColorStops, absolute, wide, tall, mix, mixAmount = {}, mixColorOverride, componentStyles, theme}) { // fn#61507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2500, offset: 0x01b4262f, size: 541 bytes, params: 2, frame: 29
|
||||
var r0;
|
||||
var value;
|
||||
const styles = useStyles();
|
||||
const {width, height} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
|
||||
const value3 = ((a0) => {
|
||||
var r3;
|
||||
var property = a0.colors;
|
||||
var env0_0 = a0.baseMix;
|
||||
var mix = a0.mix;
|
||||
var mixAmount = a0.mixAmount;
|
||||
var env0_1 = mixAmount !== undefined ? mixAmount : {};
|
||||
var env0_2 = a0.mixColorOverride;
|
||||
var env0_3 = a0.theme;
|
||||
r3 = mix ? property.map(_fun61509) : property;
|
||||
return r3.length !== 1 ? r3 : [r3[0], r3[0]];
|
||||
})({colors: colors, mix: mix, mixAmount: mixAmount, mixColorOverride: mixColorOverride, theme: theme,
|
||||
baseMix: baseMix});
|
||||
const value4 = gradientAngle - 90;
|
||||
let Math = global.Math;
|
||||
const PI = Math.PI;
|
||||
const value5 = value4 * PI / 180;
|
||||
Math = global.Math;
|
||||
const value6 = Math.cos(value5);
|
||||
Math = global.Math;
|
||||
const value7 = Math.sin(value5);
|
||||
const {start, end} = {start: {x: 0.6 - 0.7142857142857143 * value6, y: 0.5 - 0.7142857142857143 * value7},
|
||||
end: {x: 0.6 + 0.7142857142857143 * value6, y: 0.5 + 0.7142857142857143 * value7}};
|
||||
const value8 = validateColors(value3);
|
||||
const value9 = ((a0) => {
|
||||
var r3;
|
||||
var value = a1;
|
||||
var env0_0 = a0;
|
||||
r3 = value !== undefined ? value : [];
|
||||
return r3.length === a0.length ? r3.map(_fun61511) : a0.length === 1 ? [0, 1] : a0.map(_fun61512);
|
||||
})(value8, gradientColorStops);
|
||||
env0_3.useEffect(_fun61513, [value8, value3]);
|
||||
if (value8.length < 2) {
|
||||
r0 = null;
|
||||
} else {
|
||||
value = importDefault(4589) /* metro dependency 4589 */;
|
||||
absolute = absolute && styles.absolute;
|
||||
value = ((Component) => <Component colors={value8} locations={value9} start={start} end={end} style={[wide && ({width: width}),
|
||||
|
||||
tall && ({height: height}), styles.linearGradient, absolute, componentStyles]} />)(value);
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function GradientBase({colors, locations, angle, angleCenter = env0_9, absolute, wide, tall, componentStyles}) { // fn#61514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1076, offset: 0x01b42ada, size: 227 bytes, params: 2, frame: 25
|
||||
const styles = useStyles();
|
||||
const {width, height} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)();
|
||||
const value = importDefault(4589) /* metro dependency 4589 */;
|
||||
absolute = absolute && styles.absolute;
|
||||
return ((Component) => <Component colors={colors} locations={locations} angle={angle} angleCenter={angleCenter} useAngle style={[wide && ({width: width}),
|
||||
tall && ({height: height}), styles.linearGradient, absolute, componentStyles]} />)(value);
|
||||
}
|
||||
|
||||
function Gradient({gradient, absolute, wide, tall, angleOverride, componentStyles, mix, mixAmount = {}, mixColorOverride}) { // fn#61515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1368, offset: 0x01b42bbd, size: 237 bytes, params: 2, frame: 23
|
||||
const env0_3 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
||||
return (
|
||||
<GradientBase
|
||||
colors={gradient.colors.map(_fun61516)}
|
||||
locations={gradient.colors.map(function(a0) {
|
||||
return a0.stop / 100;
|
||||
})}
|
||||
angle={angleOverride ?? gradient.angle}
|
||||
angleCenter={gradient.angleCenter ?? env0_9}
|
||||
absolute={absolute}
|
||||
wide={wide}
|
||||
tall={tall}
|
||||
componentStyles={componentStyles}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function GuildThemePresetGradient({preset, absolute, wide, tall, angleOverride, componentStyles, mix, mixAmount = {}, mixColorOverride}) { // fn#61518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1876, offset: 0x01b42d44, size: 255 bytes, params: 2, frame: 23
|
||||
const guildThemePresetAppearance = (require(4004) /* metro dependency 4004: GuildThemePresets */).getGuildThemePresetAppearance(preset,
|
||||
(importDefault(4048) /* metro dependency 4048: useTheme */)());
|
||||
return (
|
||||
<GradientBase
|
||||
colors={guildThemePresetAppearance.colors.map(_fun61519)}
|
||||
locations={guildThemePresetAppearance.colors.map(function(a0) {
|
||||
return a0.stop / 100;
|
||||
})}
|
||||
angle={angleOverride ?? guildThemePresetAppearance.angle}
|
||||
angleCenter={env0_9}
|
||||
absolute={absolute}
|
||||
wide={wide}
|
||||
tall={tall}
|
||||
componentStyles={componentStyles}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
function validateColors(a0) { // fn#61521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2366, offset: 0x01b42e8f, size: 28 bytes, params: 2, frame: 13
|
||||
return a0.reduce(_fun61522, []);
|
||||
}
|
||||
|
||||
function wrapWithOverlayIfNeeded(a0, a1, a2, a3, a4) { // fn#61523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4037, offset: 0x01b42f28, size: 145 bytes, params: 6, frame: 23
|
||||
var r0;
|
||||
var items3;
|
||||
var items2;
|
||||
var object;
|
||||
let value = a0;
|
||||
if (a1) {
|
||||
var viewBindingProps = {style: a2.absolute};
|
||||
items3 = [value];
|
||||
items2 = [a2.softenGradient];
|
||||
object = {};
|
||||
value = require(4000) /* metro dependency 4000: ColorUtils */;
|
||||
object.backgroundColor = value.hexWithOpacity(a3, a4);
|
||||
items2[1] = object;
|
||||
items3[1] = <View style={items2} />;
|
||||
value = <View {...viewBindingProps}>{items3}</View>;
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function ActiveGuildThemeGradient(a0) { // fn#61525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4369, offset: 0x01b43031, size: 298 bytes, params: 2, frame: 23
|
||||
var customUserThemeSettings;
|
||||
var property;
|
||||
var items2;
|
||||
const activeGuildTheme = a0.activeGuildTheme;
|
||||
const theme = a0.theme;
|
||||
let value = Object.create(null);
|
||||
const value2 = 0;
|
||||
value.activeGuildTheme = value2;
|
||||
value.theme = value2;
|
||||
const value3 = copyDataProperties({}, a0, value, undefined);
|
||||
if (activeGuildTheme.type === 'custom') {
|
||||
customUserThemeSettings = activeGuildTheme.customUserThemeSettings;
|
||||
property = customUserThemeSettings.colors[value2];
|
||||
var customThemesGradientBindingProps = {...value3};
|
||||
value = require(4004) /* metro dependency 4004: GuildThemePresets */;
|
||||
value = value.getSingleColorGuildThemeGradientColors(property, theme);
|
||||
items2 = [];
|
||||
arraySpread(items2, value, value2, property);
|
||||
customThemesGradientBindingProps['colors'] = items2;
|
||||
customThemesGradientBindingProps['gradientColorStops'] = [];
|
||||
customThemesGradientBindingProps['gradientAngle'] = customUserThemeSettings.gradientAngle ?? value2;
|
||||
customThemesGradientBindingProps['baseMix'] = customUserThemeSettings.baseMix ?? (require(4004) /* metro dependency 4004: GuildThemePresets */).GUILD_THEME_DEFAULT_BASE_MIX;
|
||||
customThemesGradientBindingProps['theme'] = theme;
|
||||
return <CustomThemesGradient {...customThemesGradientBindingProps} />;
|
||||
}
|
||||
return <GuildThemePresetGradient {...value3} {...{['preset']: activeGuildTheme.preset}} />;
|
||||
}
|
||||
|
||||
function _default_61526(a0) { // fn#61526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:4794, offset: 0x01b4315b, size: 667 bytes, params: 2, frame: 30
|
||||
var type;
|
||||
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
|
||||
let overlayOpacity = a0.overlayOpacity;
|
||||
overlayOpacity = overlayOpacity === undefined ? 0.7 : overlayOpacity;
|
||||
const gradientOverride = a0.gradientOverride;
|
||||
const value = null;
|
||||
const value2 = Object.create(value);
|
||||
value2.overlayOpacity = 0;
|
||||
value2.gradientOverride = 0;
|
||||
const value3 = copyDataProperties({}, a0, value2, undefined);
|
||||
const {styles, overlayColor} = useThemedGradientCommon();
|
||||
const withOverlay = value3.withOverlay;
|
||||
const value6 = (importDefault(4048) /* metro dependency 4048: useTheme */)();
|
||||
const useStateFromStoresModule = require(632) /* metro dependency 632: useStateFromStores */;
|
||||
const useStateFromStoresObject = useStateFromStoresModule.useStateFromStoresObject;
|
||||
const preset = Reflect.apply(useStateFromStoresObject, useStateFromStoresModule, [[ClientThemesBackgroundStore],
|
||||
function() {
|
||||
return {preset: ClientThemesBackgroundStore.gradientPreset};
|
||||
}]).preset;
|
||||
const value7 = (importDefault(4006) /* metro dependency 4006: useRoutedActiveGuildTheme */)();
|
||||
const value8 = (require(4047) /* metro dependency 4047: useCustomThemeDisplaySettings */).useCustomThemeDisplaySettings();
|
||||
const value9 = value8 !== undefined;
|
||||
if (value != gradientOverride) {
|
||||
if (value9) {
|
||||
type = gradientOverride.type;
|
||||
if (type === ClientThemeType.CUSTOM_BACKGROUND_GRADIENT) {
|
||||
return wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...gradientOverride.customThemeSettings} {...{['theme']: gradientOverride.theme}} />,
|
||||
|
||||
|
||||
|
||||
withOverlay, styles, overlayColor, overlayOpacity);
|
||||
}
|
||||
type = gradientOverride.type;
|
||||
if (type === ClientThemeType.BACKGROUND_GRADIENT_PRESET) {
|
||||
return wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: gradientOverride}} />,
|
||||
withOverlay,
|
||||
styles,
|
||||
overlayColor, overlayOpacity);
|
||||
}
|
||||
return value != value7 ? wrapWithOverlayIfNeeded(<ActiveGuildThemeGradient {...value3} {...{['activeGuildTheme']: value7}} {...{['theme']: value6}} />,
|
||||
|
||||
|
||||
withOverlay, styles, overlayColor,
|
||||
overlayOpacity) : value9 && value9 ? wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...value8.customTheme} {...{['theme']: value8.baseTheme}} />,
|
||||
|
||||
|
||||
withOverlay, styles, overlayColor,
|
||||
overlayOpacity) : value != preset ? wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: preset}} />,
|
||||
|
||||
|
||||
withOverlay, styles, overlayColor, overlayOpacity) : value;
|
||||
}
|
||||
type = gradientOverride.type;
|
||||
if (type === ClientThemeType.BACKGROUND_GRADIENT_PRESET) {
|
||||
return wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: gradientOverride}} />, withOverlay,
|
||||
styles,
|
||||
overlayColor, overlayOpacity);
|
||||
}
|
||||
}
|
||||
return value != value7 ? wrapWithOverlayIfNeeded(<ActiveGuildThemeGradient {...value3} {...{['activeGuildTheme']: value7}} {...{['theme']: value6}} />,
|
||||
withOverlay, styles, overlayColor,
|
||||
overlayOpacity) : value9 && value9 ? wrapWithOverlayIfNeeded(<CustomThemesGradient {...value3} {...value8.customTheme} {...{['theme']: value8.baseTheme}} />,
|
||||
withOverlay, styles, overlayColor,
|
||||
overlayOpacity) : value != preset ? wrapWithOverlayIfNeeded(<Gradient {...value3} {...{['gradient']: preset}} />,
|
||||
withOverlay, styles, overlayColor, overlayOpacity) : value;
|
||||
}
|
||||
|
||||
function CustomThemedGradient(a0) { // fn#61528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:5890, offset: 0x01b4340c, size: 158 bytes, params: 2, frame: 23
|
||||
let overlayOpacity = a0.overlayOpacity;
|
||||
overlayOpacity = overlayOpacity === undefined ? 0.7 : overlayOpacity;
|
||||
const customTheme = a0.customTheme;
|
||||
let value = Object.create(null);
|
||||
value.overlayOpacity = 0;
|
||||
value.customTheme = 0;
|
||||
value = copyDataProperties({}, a0, value, undefined);
|
||||
const {styles, overlayColor} = useThemedGradientCommon();
|
||||
return wrapWithOverlayIfNeeded(<CustomThemesGradient {...value} {...customTheme.customThemeSettings} {...{['theme']: customTheme.theme}} />,
|
||||
value.withOverlay, styles, overlayColor, overlayOpacity);
|
||||
}
|
||||
|
||||
function getGradientColorsForCustomThemesGradient({colors, baseMix, mix, mixAmount = {}, mixColorOverride, theme}) { // fn#61508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2726, owner: CustomThemesGradient.getGradientColorsForCustomThemesGradient, offset: 0x01b4284c, size: 127 bytes, params: 2, frame: 14
|
||||
const r3 = mix ? colors.map(_fun61509) : colors;
|
||||
return r3.length !== 1 ? r3 : [r3[0], r3[0]];
|
||||
}
|
||||
|
||||
function getGradientLocationsForCustomThemesGradient(a0) { // fn#61510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3547, owner: CustomThemesGradient.getGradientLocationsForCustomThemesGradient, offset: 0x01b429ef, size: 94 bytes, params: 2, frame: 13
|
||||
const value = a1;
|
||||
const env0_0 = a0;
|
||||
const r3 = value !== undefined ? value : [];
|
||||
return r3.length === a0.length ? r3.map(function(a0) {
|
||||
return a0 / 100;
|
||||
}) : a0.length === 1 ? [0, 1] : a0.map(_fun61512);
|
||||
}
|
||||
|
||||
function _fun61513() { // fn#61513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:3729, offset: 0x01b42a59, size: 129 bytes, params: 1, frame: 17
|
||||
var value2;
|
||||
var defaultImport;
|
||||
var captureException;
|
||||
var error;
|
||||
var object;
|
||||
if (env0_1.length < 2) {
|
||||
value2 = environment.__proto__;
|
||||
defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */;
|
||||
captureException = defaultImport.captureException;
|
||||
error = new global.Error('Invalid custom theme gradient colors');
|
||||
object = {};
|
||||
object.gradientColors = global.JSON.stringify(env0_0);
|
||||
Reflect.apply(captureException, defaultImport, [error, {extra: object}]);
|
||||
}
|
||||
}
|
||||
|
||||
function _fun61516(a0) { // fn#61516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:1520, offset: 0x01b42caa, size: 136 bytes, params: 2, frame: 16
|
||||
var r0;
|
||||
var getMixedGradientColorBinding;
|
||||
var object2;
|
||||
if (mix) {
|
||||
getMixedGradientColorBinding = getMixedGradientColor;
|
||||
object2 = {};
|
||||
object2.color = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors[a0.token];
|
||||
object2.mixAmount = env0_1;
|
||||
object2.mixColorOverride = mixColorOverride;
|
||||
object2.theme = env0_3;
|
||||
r0 = getMixedGradientColorBinding(object2);
|
||||
} else {
|
||||
r0 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors[a0.token];
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun61519(a0) { // fn#61519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2071, offset: 0x01b42e43, size: 76 bytes, params: 2, frame: 13
|
||||
return mix ? getMixedGradientColor({color: a0.hex, mixAmount: env0_1, mixColorOverride: mixColorOverride,
|
||||
theme: env0_3}) : a0.hex;
|
||||
}
|
||||
|
||||
function _fun61522(a0, a1) { // fn#61522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2379, offset: 0x01b42eab, size: 125 bytes, params: 3, frame: 15
|
||||
var value;
|
||||
var push;
|
||||
var property;
|
||||
var hex;
|
||||
var error;
|
||||
if (typeof a1 !== 'string') {
|
||||
try {
|
||||
push = a0.push;
|
||||
value = environment.__proto__;
|
||||
property = dependencyMap[14];
|
||||
value = importDefault(property);
|
||||
value = value(a1);
|
||||
value = value.hex('rgb');
|
||||
Reflect.apply(push, a0, [value]);
|
||||
} catch (error) {
|
||||
}
|
||||
} else {
|
||||
value = environment.__proto__;
|
||||
var binding = env1_14;
|
||||
if (binding.test(a1)) {
|
||||
a0.push(a1);
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
push = a0.push;
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
value = environment.__proto__;
|
||||
try {
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
property = dependencyMap[14];
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
value = importDefault(property);
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
value = value(a1);
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
hex = value.hex;
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
value = Reflect.apply(hex, value, ['rgb']);
|
||||
} catch (error) {
|
||||
return a0;
|
||||
}
|
||||
try {
|
||||
Reflect.apply(push, a0, [value]);
|
||||
} catch (error) {
|
||||
}
|
||||
}
|
||||
return a0;
|
||||
}
|
||||
|
||||
function _fun61509(a0) { // fn#61509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7882:2874, offset: 0x01b428cb, size: 292 bytes, params: 2, frame: 23
|
||||
const value2 = 1 - baseMix / 100;
|
||||
const getThemeMixColorBinding = getThemeMixColor;
|
||||
const binding = env0_1;
|
||||
const themeBinding = theme;
|
||||
let value = getThemeMixColorBinding({mixAmount: binding, mixColorOverride: mixColorOverride, theme: themeBinding,
|
||||
darkFallbackOpacity: env2_10 + 0.25 * value2, lightFallbackOpacity: env2_10 + 0.2 * value2});
|
||||
const themedMixAmount = getThemedMixAmount({mixAmount: binding, theme: themeBinding, darkFallbackAmount: env2_10,
|
||||
lightFallbackAmount: env2_10});
|
||||
const {r, g, b} = (require(4000) /* metro dependency 4000: ColorUtils */).hexToRgb(a0);
|
||||
const colorUtilsModule = require(4000) /* metro dependency 4000: ColorUtils */;
|
||||
const mixColors = colorUtilsModule.mixColors;
|
||||
const defaultImport = importDefault(4001) /* metro dependency 4001: Color */;
|
||||
const value6 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
|
||||
const defaultImport2 = new defaultImport(r, g, b, themedMixAmount);
|
||||
value = Reflect.apply(mixColors, colorUtilsModule, [value,
|
||||
defaultImport2 instanceof Object ? defaultImport2 : value6]);
|
||||
return (require(3963) /* metro dependency 3963: ClientThemesUtils */).colorToHex(value);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,227 @@
|
||||
/* Metro module 11514; source: modules/client_themes/native/chat/SharedCustomThemeActionSheet.tsx; dependencies: [57, 31, 27, 3808, 661, 1880, 33, 4501, 697, 683, 11515, 3998, 6275, 6758, 1244, 2422, 4573, 7896, 4578, 566, 3802, 7040, 6789, 1305, 3999, 2] */
|
||||
function _fun88150(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:6, offset: 0x01fd6a7e, size: 451 bytes, params: 8, frame: 21
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
||||
const env0_4 = importAll(31) /* metro dependency 31 */;
|
||||
let value = require(31) /* metro dependency 31 */;
|
||||
const env0_5 = value.useEffect;
|
||||
const env0_6 = value.useLayoutEffect;
|
||||
const env0_7 = value.useRef;
|
||||
const env0_8 = (require(27) /* metro dependency 27 */).View;
|
||||
const subscriptionStore = importDefault(3808) /* metro dependency 3808: SubscriptionStore */;
|
||||
const env0_10 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
||||
const env0_11 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes;
|
||||
value = require(33) /* metro dependency 33 */;
|
||||
const env0_12 = value.jsx;
|
||||
const env0_13 = value.jsxs;
|
||||
value = require(4501) /* metro dependency 4501: createStyles */;
|
||||
const createStyles = value.createStyles;
|
||||
let object = {};
|
||||
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
||||
const env0_14 = Reflect.apply(createStyles, value, [{contentWrapper: {'paddingHorizontal': 43.5,
|
||||
'paddingVertical': 12}, centeredText: {textAlign: 'center'}, ctaContainer: {'paddingHorizontal': 15,
|
||||
'flexDirection': 'column', 'display': 'flex', 'gap': 6}, nitroWheelButton: {'marginStart': -2, 'width': 20,
|
||||
'height': 20}, getNitroButton: object}]);
|
||||
const sharedClientThemeToThemeSettings = function(a0) {
|
||||
var object;
|
||||
if (a0 !== undefined) {
|
||||
object = {};
|
||||
object.colors = a0.colors.map(_fun88152);
|
||||
object.gradientColorStops = [];
|
||||
object.gradientAngle = a0.gradient_angle;
|
||||
object.baseMix = a0.base_mix;
|
||||
return object;
|
||||
}
|
||||
};
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/SharedCustomThemeActionSheet.tsx');
|
||||
exports.default = _default_88158;
|
||||
}
|
||||
|
||||
function sharedClientThemeToThemeSettings(a0) { // fn#88151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:606, offset: 0x01fd6c41, size: 74 bytes, params: 2, frame: 13
|
||||
var object2;
|
||||
if (a0 !== undefined) {
|
||||
object2 = {};
|
||||
object2.colors = a0.colors.map(function(a0) {
|
||||
return '#' + a0;
|
||||
});
|
||||
object2.gradientColorStops = [];
|
||||
object2.gradientAngle = a0.gradient_angle;
|
||||
object2.baseMix = a0.base_mix;
|
||||
return object2;
|
||||
}
|
||||
}
|
||||
|
||||
function PrimaryActionButton_88153({onPressApply}) { // fn#88153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:759, offset: 0x01fd6ca6, size: 345 bytes, params: 2, frame: 22
|
||||
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
const styles = useStyles();
|
||||
const fluxModule = require(566) /* metro dependency 566: flux */;
|
||||
const useStateFromStores = fluxModule.useStateFromStores;
|
||||
const premiumTypeFromSubscription = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).getPremiumTypeFromSubscription(Reflect.apply(useStateFromStores,
|
||||
fluxModule, [[SubscriptionStore], function() {
|
||||
return SubscriptionStore.getPremiumTypeSubscription();
|
||||
}]));
|
||||
const TIER_2 = PremiumTypes.TIER_2;
|
||||
if (premiumTypeFromSubscription !== TIER_2) {
|
||||
const ShinyButton = (require(1305) /* metro dependency 1305: native */).ShinyButton;
|
||||
return (
|
||||
<ShinyButton
|
||||
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pj0XBN)}
|
||||
onPress={function() {
|
||||
var defaultImport = importDefault(dependencyMap[21]);
|
||||
var object = {};
|
||||
object.premiumType = PremiumTypes.TIER_2;
|
||||
var SHARE_CUSTOM_CLIENT_THEME_EMBED = importDefault(dependencyMap[22]).SHARE_CUSTOM_CLIENT_THEME_EMBED;
|
||||
object.analyticsLocations = [SHARE_CUSTOM_CLIENT_THEME_EMBED];
|
||||
object.analyticsLocation = {};
|
||||
defaultImport(object);
|
||||
}}
|
||||
renderIcon={renderIcon}
|
||||
style={styles.getNitroButton}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
||||
return (
|
||||
<Button
|
||||
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['1Qm822'])}
|
||||
onPress={onPressApply}
|
||||
variant="primary"
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function getBaseThemeFromSharedClientTheme(a0) { // fn#88157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1346, offset: 0x01fd6eaf, size: 53 bytes, params: 2, frame: 13
|
||||
var value;
|
||||
if (a0 !== undefined) {
|
||||
value = require(3999) /* metro dependency 3999: ClientThemesUtils */;
|
||||
return value.getBaseTheme(a0.base_theme);
|
||||
}
|
||||
}
|
||||
|
||||
function _default_88158(a0) { // fn#88158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1417, offset: 0x01fd6ee4, size: 712 bytes, params: 2, frame: 29
|
||||
const sharedClientTheme = a0.message.sharedClientTheme;
|
||||
const styles = useStyles();
|
||||
const value2 = useRef(null);
|
||||
const binding = env0_4;
|
||||
let useState = binding.useState;
|
||||
const value3 = Reflect.apply(useState, binding, [sharedClientThemeToThemeSettings(sharedClientTheme)]);
|
||||
const binding2 = env0_3;
|
||||
const value4 = binding2(value3, 2);
|
||||
const property = value4[0];
|
||||
var env0_3 = value4[1];
|
||||
useState = binding.useState;
|
||||
const value5 = binding2(Reflect.apply(useState, binding, [getBaseThemeFromSharedClientTheme(sharedClientTheme)]), 2);
|
||||
const property2 = value5[0];
|
||||
const env0_5 = value5[1];
|
||||
useState = binding.useState;
|
||||
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
||||
const property3 = value6[0];
|
||||
const env0_7 = value6[1];
|
||||
const value7 = binding.useRef(true);
|
||||
useEffect(_fun88159, [sharedClientTheme]);
|
||||
useEffect(_fun88160, [property, property2]);
|
||||
useLayoutEffect(_fun88161, [property3]);
|
||||
useEffect(function() {
|
||||
return _fun88163;
|
||||
}, [value7]);
|
||||
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
||||
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
||||
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
const items2 = [<BottomSheetTitleHeader title={intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */)['3ej1LT'])} />];
|
||||
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
||||
items2[1] = <View style={styles.contentWrapper}><Text variant="heading-md/medium" style={styles.centeredText}>{intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).qZMUoL)}</Text></View>;
|
||||
const primaryActionButton_88153 = <PrimaryActionButton_88153 onPressApply={onPressApply} />;
|
||||
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
||||
items2[2] = <View style={styles.ctaContainer}>{primaryActionButton_88153}<Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])} onPress={onPress_88165} variant="secondary" /></View>;
|
||||
return (
|
||||
<BottomSheet ref={value2} backdropOpacity={0}>
|
||||
{items2}
|
||||
</BottomSheet>
|
||||
);
|
||||
}
|
||||
|
||||
function PrimaryActionButton_88153RenderIcon() { // fn#88156, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1133, owner: PrimaryActionButton_88153.renderIcon, offset: 0x01fd6e69, size: 70 bytes, params: 1, frame: 15
|
||||
const NitroWheel = (require(1305) /* metro dependency 1305: native */).NitroWheel;
|
||||
return <NitroWheel style={[styles.nitroWheelButton]} />;
|
||||
}
|
||||
|
||||
function _fun88159() { // fn#88159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1683, offset: 0x01fd71ac, size: 93 bytes, params: 1, frame: 15
|
||||
const binding = env0_3;
|
||||
const sharedClientThemeToThemeSettingsBinding = sharedClientThemeToThemeSettings;
|
||||
const sharedClientThemeBinding = sharedClientTheme;
|
||||
binding(sharedClientThemeToThemeSettingsBinding(sharedClientThemeBinding));
|
||||
env0_5(getBaseThemeFromSharedClientTheme(sharedClientThemeBinding));
|
||||
const value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
const track = value.track;
|
||||
const CUSTOM_THEME_SHARE_PREVIEWED = AnalyticEvents.CUSTOM_THEME_SHARE_PREVIEWED;
|
||||
Reflect.apply(track, value, [CUSTOM_THEME_SHARE_PREVIEWED, {}]);
|
||||
}
|
||||
|
||||
function _fun88160() { // fn#88160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1826, offset: 0x01fd7209, size: 105 bytes, params: 1, frame: 16
|
||||
var value4;
|
||||
var moduleValue;
|
||||
if (env0_2 !== undefined && env0_4 !== undefined) {
|
||||
value4 = environment.__proto__;
|
||||
moduleValue = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
|
||||
moduleValue.previewCustomTheme({baseTheme: env0_4, customTheme: env0_2});
|
||||
(require(3998) /* metro dependency 3998: ThemeActionCreators */).refreshTheme();
|
||||
}
|
||||
}
|
||||
|
||||
function _fun88161() { // fn#88161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1950, offset: 0x01fd7272, size: 24 bytes, params: 1, frame: 2
|
||||
env0_8.current = !env0_6;
|
||||
}
|
||||
|
||||
function _fun88162() { // fn#88162, offset: 0x01fd728a, size: 11 bytes, params: 1, frame: 1
|
||||
return _fun88163;
|
||||
}
|
||||
|
||||
function onPressApply() { // fn#88164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:2428, owner: _default_88158.onPressApply, offset: 0x01fd72e1, size: 216 bytes, params: 1, frame: 20
|
||||
var value5;
|
||||
var moduleValue;
|
||||
var updateCustomTheme;
|
||||
var binding;
|
||||
var binding2;
|
||||
var moduleValue2;
|
||||
var defaultImport;
|
||||
if (env0_2 !== undefined && env0_4 !== undefined && env0_1.current !== null) {
|
||||
env0_7(true);
|
||||
value5 = environment.__proto__;
|
||||
moduleValue = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
|
||||
updateCustomTheme = moduleValue.updateCustomTheme;
|
||||
binding = env0_2;
|
||||
binding2 = env0_4;
|
||||
Reflect.apply(updateCustomTheme, moduleValue, [binding, binding2]);
|
||||
moduleValue2 = require(7896) /* metro dependency 7896: UserSettingsActionCreators */;
|
||||
moduleValue2.saveClientTheme({customUserThemeSettings: binding, theme: binding2});
|
||||
(require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */).clearPreviewTheme();
|
||||
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
||||
defaultImport.track(AnalyticEvents.CUSTOM_THEME_SHARE_APPLIED, {});
|
||||
env0_1.current.closeActionSheet();
|
||||
}
|
||||
}
|
||||
|
||||
function _default_88158OnPress() { // fn#88165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:2760, owner: _default_88158.onPress, offset: 0x01fd73b9, size: 98 bytes, params: 1, frame: 14
|
||||
var value2;
|
||||
if (env0_1.current !== null) {
|
||||
value2 = environment.__proto__;
|
||||
(require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */).clearPreviewTheme();
|
||||
(require(3998) /* metro dependency 3998: ThemeActionCreators */).refreshTheme();
|
||||
env0_1.current.closeActionSheet();
|
||||
}
|
||||
}
|
||||
|
||||
function _fun88163() { // fn#88163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11700:1982, offset: 0x01fd7295, size: 76 bytes, params: 1, frame: 13
|
||||
let value = environment.__proto__;
|
||||
if (env1_8.current) {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = require(11515) /* metro dependency 11515: CustomThemeMobileActionCreators */;
|
||||
value.clearPreviewTheme();
|
||||
value = require(3998) /* metro dependency 3998: ThemeActionCreators */;
|
||||
value.refreshTheme();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/* Metro module 8439; source: modules/client_themes/native/chat/formatSharedClientThemeData.tsx; dependencies: [27, 7955, 1244, 2422, 2] */
|
||||
function _fun67004(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8624:6, offset: 0x01c11f6c, size: 124 bytes, params: 8, frame: 18
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = (require(27) /* metro dependency 27 */).Image;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/formatSharedClientThemeData.tsx');
|
||||
exports.formatSharedClientThemeData = formatSharedClientThemeData;
|
||||
}
|
||||
|
||||
function formatSharedClientThemeData({sharedClientTheme}, a1, a2) { // fn#67005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8624:241, offset: 0x01c11fe8, size: 319 bytes, params: 4, frame: 20
|
||||
var object2;
|
||||
var uri;
|
||||
var value;
|
||||
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
||||
if (sharedClientTheme !== undefined) {
|
||||
object2 = {};
|
||||
object2.colors = sharedClientTheme.colors;
|
||||
object2.gradientAngle = sharedClientTheme.gradient_angle;
|
||||
object2.createdBy = a2;
|
||||
uri = a1.uri;
|
||||
value = '';
|
||||
object2.createdByAvatarUrl = uri === undefined ? value : a1.uri;
|
||||
uri = Image.resolveAssetSource(importDefault(7955) /* metro dependency 7955 */).uri;
|
||||
object2.nitroWheelIconUrl = uri;
|
||||
object2.previewLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.SKNnqq);
|
||||
object2.previewHeading = intl.string((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).yl1iMm);
|
||||
object2.createdByLabel = value + intl.format((importDefault(2422) /* metro dependency 2422: ClientThemesMessages */).fQPSEf,
|
||||
|
||||
{username: '__USERNAME__'});
|
||||
return object2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/* Metro module 11513; source: modules/client_themes/native/chat/previewSharedClientTheme.tsx; dependencies: [4080, 11514, 1962, 2] */
|
||||
function _fun88148(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11699:6, offset: 0x01fd69b1, size: 103 bytes, params: 8, frame: 18
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/previewSharedClientTheme.tsx');
|
||||
exports.handleTapPreviewSharedClientTheme = handleTapPreviewSharedClientTheme;
|
||||
}
|
||||
|
||||
function handleTapPreviewSharedClientTheme({message}) { // fn#88149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11699:224, offset: 0x01fd6a18, size: 102 bytes, params: 2, frame: 17
|
||||
const defaultImport = importDefault(dependencyMap[0]);
|
||||
const openLazy = defaultImport.openLazy;
|
||||
let value = require(dependencyMap[2]);
|
||||
value = value(dependencyMap[1], dependencyMap.paths);
|
||||
Reflect.apply(openLazy, defaultImport, [value, 'custom-theme-preview', {message: message, backdropKind: 'none'}]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/* Metro module 11516; source: modules/client_themes/native/chat/sharedClientThemeViewed.tsx; dependencies: [8742, 480, 2] */
|
||||
function _fun88171(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11702:6, offset: 0x01fd757d, size: 96 bytes, params: 8, frame: 18
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/chat/sharedClientThemeViewed.tsx');
|
||||
exports.handleSharedClientThemeViewed = handleSharedClientThemeViewed;
|
||||
}
|
||||
|
||||
function handleSharedClientThemeViewed() { // fn#88172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11702:219, offset: 0x01fd75dd, size: 99 bytes, params: 1, frame: 16
|
||||
const value = require(8742) /* metro dependency 8742: useTrackImpression */;
|
||||
const trackImpression = value.trackImpression;
|
||||
const object2 = {};
|
||||
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
|
||||
const VIEW = ImpressionTypes.VIEW;
|
||||
object2.type = VIEW;
|
||||
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
|
||||
const CUSTOM_THEME_SHARE = ImpressionNames.CUSTOM_THEME_SHARE;
|
||||
object2.name = CUSTOM_THEME_SHARE;
|
||||
object2.properties = {};
|
||||
Reflect.apply(trackImpression, value, [object2]);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/* Metro module 7703; source: modules/client_themes/native/useActiveTheme.tsx; dependencies: [1312, 3964, 1354, 1313, 566, 4006, 2] */
|
||||
function _fun61496(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:6, offset: 0x01b41fe7, size: 206 bytes, params: 8, frame: 20
|
||||
const env0_0 = require;
|
||||
const closure = useActiveThemeType;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const unsyncedUserSettingsStore = importDefault(1312) /* metro dependency 1312: UnsyncedUserSettingsStore */;
|
||||
const clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
|
||||
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
|
||||
const themeConstantsModule = require(1313) /* metro dependency 1313: ThemeConstants */;
|
||||
const env0_6 = themeConstantsModule.SystemThemeState;
|
||||
const env0_7 = themeConstantsModule.ActiveThemeType;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useActiveTheme.tsx');
|
||||
exports.useIsCustomThemeActive = function() {
|
||||
return useActiveThemeType() === ActiveThemeType.CUSTOM;
|
||||
};
|
||||
exports.useIsClientThemeOrCustomThemeActive = useIsClientThemeOrCustomThemeActive;
|
||||
exports.useActiveThemeType = closure;
|
||||
}
|
||||
|
||||
function useActiveThemeType() { // fn#61497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:177, offset: 0x01b420b5, size: 287 bytes, params: 1, frame: 20
|
||||
const value2 = undefined;
|
||||
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([CustomThemeMobileStore],
|
||||
function() {
|
||||
return CustomThemeMobileStore.hasCustomTheme();
|
||||
});
|
||||
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ClientThemesBackgroundStore],
|
||||
function() {
|
||||
return ClientThemesBackgroundStore.gradientPreset != null;
|
||||
});
|
||||
const value5 = (importDefault(4006) /* metro dependency 4006: useRoutedActiveGuildTheme */)();
|
||||
const useSystemTheme = (require(566) /* metro dependency 566: flux */).useStateFromStores([UnsyncedUserSettingsStore],
|
||||
function() {
|
||||
return UnsyncedUserSettingsStore.useSystemTheme;
|
||||
});
|
||||
const ON = SystemThemeState.ON;
|
||||
return (value5 == null ? value2 : value5.type) === 'custom' ? ActiveThemeType.CUSTOM : (value5 == null ? value2 : value5.type) === 'preset' ? ActiveThemeType.CLIENT : value3 ? ActiveThemeType.CUSTOM : value4 ? ActiveThemeType.CLIENT : useSystemTheme === ON ? ActiveThemeType.SYSTEM : ActiveThemeType.DEFAULT;
|
||||
}
|
||||
|
||||
function useIsClientThemeOrCustomThemeActive() { // fn#61502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7881:764, offset: 0x01b42228, size: 46 bytes, params: 1, frame: 11
|
||||
const value2 = useActiveThemeType();
|
||||
const CLIENT = ActiveThemeType.CLIENT;
|
||||
return value2 === CLIENT || value2 === ActiveThemeType.CUSTOM;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/* Metro module 4003; source: modules/client_themes/native/useColorThemeBackground.tsx; dependencies: [31, 1310, 3964, 1244, 3966, 4004, 4006, 632, 4045, 2] */
|
||||
function _fun32944(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#32944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:6, offset: 0x01022ca0, size: 160 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const getGuildThemeName = function() {
|
||||
return require(dependencyMap[3]).intl.string(require(dependencyMap[3]).t.CFzDOG);
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
|
||||
const clientThemesBackgroundStore = importDefault(3964) /* metro dependency 3964: ClientThemesBackgroundStore */;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useColorThemeBackground.tsx');
|
||||
exports.default = useColorThemeBackground;
|
||||
}
|
||||
|
||||
function useColorThemeBackground() { // fn#32946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:300, offset: 0x01022d7e, size: 192 bytes, params: 1, frame: 20
|
||||
return env0_3.useMemo(_fun32949, [(importDefault(4006) /* metro dependency 4006: useRoutedActiveGuildTheme */)(),
|
||||
(require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ThemeStore], function() {
|
||||
return ThemeStore.theme;
|
||||
})]) ?? (require(4045) /* metro dependency 4045: MobileThemesUtils */).useCustomBackgroundGradient() ?? (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ClientThemesBackgroundStore],
|
||||
function() {
|
||||
return ClientThemesBackgroundStore.gradientPreset;
|
||||
});
|
||||
}
|
||||
|
||||
function _fun32949() { // fn#32949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:511, offset: 0x01022e5c, size: 28 bytes, params: 1, frame: 13
|
||||
return getGuildThemeBackground(env0_0, theme);
|
||||
}
|
||||
|
||||
function getGuildThemeBackground(a0, a1) { // fn#32950, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4161:515, offset: 0x01022e78, size: 394 bytes, params: 3, frame: 22
|
||||
var environment;
|
||||
var value;
|
||||
var object4;
|
||||
const ClientThemeType = (require(3966) /* metro dependency 3966: ClientThemesTypes */).ClientThemeType;
|
||||
var colors;
|
||||
var customUserThemeSettings;
|
||||
var property;
|
||||
var value3;
|
||||
var object5;
|
||||
var singleColorGuildThemeGradientColors;
|
||||
var items2;
|
||||
if (a0 == null) {
|
||||
return null;
|
||||
}
|
||||
if (a0.type === 'custom') {
|
||||
customUserThemeSettings = a0.customUserThemeSettings;
|
||||
colors = customUserThemeSettings.colors;
|
||||
value = 0;
|
||||
property = colors[value];
|
||||
object4 = {};
|
||||
value3 = environment.__proto__.__proto__;
|
||||
object4.type = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
|
||||
object4.getName = getGuildThemeName;
|
||||
object4.theme = a1;
|
||||
object5 = {};
|
||||
singleColorGuildThemeGradientColors = (require(4004) /* metro dependency 4004: GuildThemePresets */).getSingleColorGuildThemeGradientColors(property,
|
||||
|
||||
a1);
|
||||
items2 = [];
|
||||
arraySpread(items2, singleColorGuildThemeGradientColors, value, a1);
|
||||
object5.colors = items2;
|
||||
object5.gradientColorStops = [];
|
||||
object5.gradientAngle = customUserThemeSettings.gradientAngle ?? value;
|
||||
object5.baseMix = customUserThemeSettings.baseMix ?? (require(4004) /* metro dependency 4004: GuildThemePresets */).GUILD_THEME_DEFAULT_BASE_MIX;
|
||||
object4.customThemeSettings = object5;
|
||||
} else {
|
||||
value = environment.__proto__.__proto__;
|
||||
var guildThemePresetAppearance = (require(4004) /* metro dependency 4004: GuildThemePresets */).getGuildThemePresetAppearance(a0.preset,
|
||||
|
||||
a1);
|
||||
object4 = {};
|
||||
object4.type = ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
|
||||
object4.getName = getGuildThemeName;
|
||||
object4.theme = a1;
|
||||
var object6 = {};
|
||||
object6.colors = guildThemePresetAppearance.colors.map(function(a0) {
|
||||
return a0.hex;
|
||||
});
|
||||
object6.gradientAngle = guildThemePresetAppearance.angle;
|
||||
object6.gradientColorStops = guildThemePresetAppearance.colors.map(function(a0) {
|
||||
return a0.stop;
|
||||
});
|
||||
object6.baseMix = guildThemePresetAppearance.baseMix;
|
||||
object4.customThemeSettings = object6;
|
||||
}
|
||||
return object4;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/* Metro module 4047; source: modules/client_themes/native/useCustomThemeDisplaySettings.tsx; dependencies: [57, 1354, 566, 2] */
|
||||
function _fun33391(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:6, offset: 0x0102d9b5, size: 128 bytes, params: 8, frame: 19
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_2 = importDefault(57) /* metro dependency 57 */;
|
||||
const customThemeMobileStore = importDefault(1354) /* metro dependency 1354: CustomThemeMobileStore */;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useCustomThemeDisplaySettings.tsx');
|
||||
exports.useCustomThemeDisplaySettings = useCustomThemeDisplaySettings;
|
||||
}
|
||||
|
||||
function useCustomThemeDisplaySettings(a0) { // fn#33392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:244, offset: 0x0102da35, size: 187 bytes, params: 2, frame: 17
|
||||
const fluxModule = require(566) /* metro dependency 566: flux */;
|
||||
const useStateFromStoresArray = fluxModule.useStateFromStoresArray;
|
||||
const value = env0_2(Reflect.apply(useStateFromStoresArray, fluxModule, [[CustomThemeMobileStore], _fun33393]), 3);
|
||||
const property = value[0];
|
||||
const property2 = value[1];
|
||||
const property3 = value[2];
|
||||
if (property3 !== undefined) {
|
||||
return property3;
|
||||
}
|
||||
if (property !== undefined) {
|
||||
if (property2 !== undefined) {
|
||||
return {baseTheme: property2, customTheme: property};
|
||||
}
|
||||
}
|
||||
if (a0 != null) {
|
||||
return {baseTheme: a0.base_theme, customTheme: {colors: a0.colors, gradientAngle: a0.gradient_angle,
|
||||
baseMix: a0.base_mix, gradientColorStops: []}};
|
||||
}
|
||||
}
|
||||
|
||||
function _fun33393() { // fn#33393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4205:291, offset: 0x0102daf0, size: 57 bytes, params: 1, frame: 10
|
||||
const value = environment.__proto__;
|
||||
const items2 = [CustomThemeMobileStore.getCustomTheme()];
|
||||
const getBaseTheme = CustomThemeMobileStore.getBaseTheme;
|
||||
items2[1] = Reflect.apply(getBaseTheme, CustomThemeMobileStore, []);
|
||||
const getPreviewTheme = CustomThemeMobileStore.getPreviewTheme;
|
||||
items2[2] = Reflect.apply(getPreviewTheme, CustomThemeMobileStore, []);
|
||||
return items2;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
/* Metro module 7702; source: modules/client_themes/native/useIsUsingClientTheme.tsx; dependencies: [7703, 2] */
|
||||
function _fun61494(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7880:6, offset: 0x01b41f65, size: 94 bytes, params: 8, frame: 18
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useIsUsingClientTheme.tsx');
|
||||
exports.default = useIsUsingClientTheme;
|
||||
}
|
||||
|
||||
function useIsUsingClientTheme() { // fn#61495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7880:190, offset: 0x01b41fc3, size: 36 bytes, params: 1, frame: 11
|
||||
return (require(7703) /* metro dependency 7703: useActiveTheme */).useIsClientThemeOrCustomThemeActive();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
/* Metro module 15133; source: modules/client_themes/native/useThemedHeaderOptions.tsx; dependencies: [31, 33, 7704, 7702, 1585, 477, 4092, 2] */
|
||||
function _fun115368(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:6, offset: 0x0245e2b1, size: 169 bytes, params: 8, frame: 18
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
|
||||
object = {headerBackground: undefined, contentStyle: undefined};
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/client_themes/native/useThemedHeaderOptions.tsx');
|
||||
exports.default = useThemedHeaderOptions;
|
||||
}
|
||||
|
||||
function headerBackground() { // fn#115369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:185, offset: 0x0245e35a, size: 51 bytes, params: 1, frame: 13
|
||||
return ((Component) => <Component absolute tall wide />)(importDefault(7704) /* metro dependency 7704: ThemedGradient */);
|
||||
}
|
||||
|
||||
function useThemedHeaderOptions() { // fn#115370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:329, offset: 0x0245e38d, size: 96 bytes, params: 1, frame: 16
|
||||
return env0_3.useMemo(_fun115371, [(importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().top,
|
||||
(importDefault(7702) /* metro dependency 7702: useIsUsingClientTheme */)()]);
|
||||
}
|
||||
|
||||
function _fun115371() { // fn#115371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15330:413, offset: 0x0245e3ed, size: 186 bytes, params: 1, frame: 15
|
||||
var value3;
|
||||
var moduleValue;
|
||||
if (env0_0) {
|
||||
value3 = 5;
|
||||
moduleValue = require(dependencyMap[value3]);
|
||||
if (moduleValue.isIOS()) {
|
||||
return {headerBackground: headerBackground,
|
||||
contentStyle: {marginTop: -top + (top > 50 ? value3 : 0) + (56 - ((require(4092) /* metro dependency 4092: DeviceUtils */).isIpadOS() ? 46 : 44))}};
|
||||
}
|
||||
return {headerBackground: headerBackground, contentStyle: env1_5.contentStyle};
|
||||
}
|
||||
return env1_5;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user