Files
discord-decomp/sources/design/components/Button/native/ButtonHooks.native.tsx
T
2026-07-27 16:20:00 +03:00

462 lines
27 KiB
TypeScript

/* Metro module 4583; source: design/components/Button/native/ButtonHooks.native.tsx; dependencies: [31, 4501, 3868, 697, 4002, 3860, 4017, 4577, 4581, 4582, 4584, 4580, 4573, 477, 2] */
function _fun38865(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#38865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:6, offset: 0x010ce082, size: 754 bytes, params: 8, frame: 25
var object2;
const env0_0 = require;
const closure = useProfileThemedButtonStyles;
const closure2 = useForegroundColor;
const closure3 = useButtonTextColorStyles;
const closure4 = useButtonScaleStyles;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(4501) /* metro dependency 4501: createStyles */).experimental_createToken(function() {
return '#161CBB';
});
const env0_6 = (require(4501) /* metro dependency 4501: createStyles */).experimental_createToken(function() {
return '#1318A0';
});
object2 = {};
const CONTROL_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_PRIMARY_TEXT_DEFAULT;
object2.primary = CONTROL_PRIMARY_TEXT_DEFAULT;
let WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
object2['experimental_welcome-secondary'] = WHITE;
const CONTROL_SECONDARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_TEXT_DEFAULT;
object2.secondary = CONTROL_SECONDARY_TEXT_DEFAULT;
const REDESIGN_BUTTON_TERTIARY_TEXT = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_TERTIARY_TEXT;
object2.tertiary = REDESIGN_BUTTON_TERTIARY_TEXT;
let CONTROL_CRITICAL_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_CRITICAL_PRIMARY_TEXT_DEFAULT;
object2.destructive = CONTROL_CRITICAL_PRIMARY_TEXT_DEFAULT;
CONTROL_CRITICAL_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_CRITICAL_PRIMARY_TEXT_DEFAULT;
object2['critical-primary'] = CONTROL_CRITICAL_PRIMARY_TEXT_DEFAULT;
const CONTROL_CRITICAL_SECONDARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_CRITICAL_SECONDARY_TEXT_DEFAULT;
object2['critical-secondary'] = CONTROL_CRITICAL_SECONDARY_TEXT_DEFAULT;
const CONTROL_CONNECTED_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_CONNECTED_TEXT_DEFAULT;
object2.active = CONTROL_CONNECTED_TEXT_DEFAULT;
const CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT;
object2['primary-overlay'] = CONTROL_OVERLAY_PRIMARY_TEXT_DEFAULT;
const CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT;
object2['secondary-overlay'] = CONTROL_OVERLAY_SECONDARY_TEXT_DEFAULT;
WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object2['experimental_premium-primary'] = WHITE;
const TEXT_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_BRAND;
object2['experimental_premium-secondary'] = TEXT_BRAND;
const CONTROL_ICON_ONLY_ICON_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_ICON_ONLY_ICON_DEFAULT;
object2['icon-only'] = CONTROL_ICON_ONLY_ICON_DEFAULT;
const CONTROL_EXPRESSIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_EXPRESSIVE_TEXT_DEFAULT;
object2.expressive = CONTROL_EXPRESSIVE_TEXT_DEFAULT;
value = require(4501) /* metro dependency 4501: createStyles */;
value = value.createStyleProperties(_fun38874);
object2 = {code: 'function ButtonHooksNativeTsx1(){const{themedStyles,colors,interpolateColor,pressed}=this.__closure;var _themedStyles$backgro,_themedStyles,_themedStyles$borderC,_themedStyles2;const backgroundColor=(_themedStyles$backgro=(_themedStyles=themedStyles)===null||_themedStyles===void 0?void 0:_themedStyles.backgroundColor)!==null&&_themedStyles$backgro!==void 0?_themedStyles$backgro:[colors.backgroundInactive,colors.backgroundPressed];const borderColor=(_themedStyles$borderC=(_themedStyles2=themedStyles)===null||_themedStyles2===void 0?void 0:_themedStyles2.borderColor)!==null&&_themedStyles$borderC!==void 0?_themedStyles$borderC:[colors.borderInactive,colors.borderPressed];return{backgroundColor:interpolateColor(pressed.get(),[0,1],backgroundColor),borderColor:interpolateColor(pressed.get(),[0,1],borderColor)};}'};
object2 = {code: "function ButtonHooksNativeTsx2(){const{width,scaleAmountInPx,withSpring,interpolate,pressed,ON_PRESS_SPRING}=this.__closure;const scale=width.get()>0?(width.get()-scaleAmountInPx)/width.get():1;return{transform:[{scale:withSpring(interpolate(pressed.get(),[0,1],[1,scale]),ON_PRESS_SPRING,'animate-always')}]};}"};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/Button/native/ButtonHooks.native.tsx');
exports.SAFE_TRANSPARENT_COLOR = 'rgba(0,0,0,0.001)';
exports.useProfileThemedButtonStyles = closure;
exports.useForegroundColor = closure2;
exports.useButtonColorStyles = value;
exports.useButtonTextColorStyles = closure3;
exports.useIconTintStyles = function(a0) {
var object = {};
object.tintColor = useButtonTextColorStyles(a0).color;
return object;
};
exports.useGradientPillStyles = useGradientPillStyles;
exports.useButtonPillStyles = useButtonPillStyles;
exports.useButtonScaleStyles = closure4;
exports.useButtonPressAnimationProps = useButtonPressAnimationProps;
exports.useIconSizeStyles = useIconSizeStyles;
}
function useProfileThemedButtonStyles(a0) { // fn#38866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:232, offset: 0x010ce374, size: 102 bytes, params: 2, frame: 16
const env0_0 = a0;
const {primaryColor, theme} = (require(3868) /* metro dependency 3868: native */).useThemeContext();
return env0_3.useMemo(_fun38867, [theme, primaryColor, a0]);
}
function useForegroundColor(a0) { // fn#38868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:2051, offset: 0x010ce6bb, size: 49 bytes, params: 2, frame: 12
return (require(3860) /* metro dependency 3860: useToken */).useToken(env0_7[a0]);
}
function useButtonTextColorStyles(a0) { // fn#38869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:4922, offset: 0x010ce6ec, size: 55 bytes, params: 2, frame: 14
const value2 = undefined;
const value3 = useProfileThemedButtonStyles(a0);
return {color: (value3 == null ? value2 : value3.color) ?? useForegroundColor(a0)};
}
function useButtonScaleStyles(a0, a1, a2) { // fn#38870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:6236, offset: 0x010ce723, size: 178 bytes, params: 4, frame: 20
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useButtonScaleStylesN;
const object2 = {width: a1, scaleAmountInPx: a2};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.interpolate = reanimatedRexportModule.interpolate;
object2.pressed = a0;
const ON_PRESS_SPRING = (require(4581) /* metro dependency 4581: springPresets */).ON_PRESS_SPRING;
object2.ON_PRESS_SPRING = ON_PRESS_SPRING;
closure.__closure = object2;
closure.__workletHash = 17256006845494;
closure.__initData = env0_10;
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
}
function _fun38874(a0) { // fn#38874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:2157, offset: 0x010ce8b5, size: 1269 bytes, params: 2, frame: 15
var object2;
var colors;
if (a0 === 'primary') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_PRIMARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_PRIMARY_BACKGROUND_ACTIVE;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderInactive = colors.CONTROL_PRIMARY_BORDER_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderPressed = colors.CONTROL_PRIMARY_BORDER_ACTIVE;
return object2;
}
if (a0 === 'secondary') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_SECONDARY_BACKGROUND_ACTIVE;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderInactive = colors.CONTROL_SECONDARY_BORDER_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderPressed = colors.CONTROL_SECONDARY_BORDER_ACTIVE;
return object2;
}
if (a0 === 'tertiary') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.REDESIGN_BUTTON_TERTIARY_BACKGROUND;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.REDESIGN_BUTTON_TERTIARY_PRESSED_BACKGROUND;
object2.borderInactive = env0_4;
object2.borderPressed = env0_4;
return object2;
}
if (a0 === 'critical-primary') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_CRITICAL_PRIMARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_CRITICAL_PRIMARY_BACKGROUND_ACTIVE;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderInactive = colors.CONTROL_CRITICAL_PRIMARY_BORDER_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderPressed = colors.CONTROL_CRITICAL_PRIMARY_BORDER_ACTIVE;
return object2;
}
if (a0 === 'destructive') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_CRITICAL_PRIMARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_CRITICAL_PRIMARY_BACKGROUND_ACTIVE;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderInactive = colors.CONTROL_CRITICAL_PRIMARY_BORDER_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderPressed = colors.CONTROL_CRITICAL_PRIMARY_BORDER_ACTIVE;
return object2;
}
if (a0 === 'critical-secondary') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_CRITICAL_SECONDARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_CRITICAL_SECONDARY_BACKGROUND_ACTIVE;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderInactive = colors.CONTROL_CRITICAL_SECONDARY_BORDER_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderPressed = colors.CONTROL_CRITICAL_SECONDARY_BORDER_ACTIVE;
return object2;
}
if (a0 === 'active') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_CONNECTED_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_CONNECTED_BACKGROUND_ACTIVE;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderInactive = colors.CONTROL_CONNECTED_BORDER_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.borderPressed = colors.CONTROL_CONNECTED_BORDER_ACTIVE;
return object2;
}
if (a0 === 'experimental_premium-secondary') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_ACTIVE;
object2.borderInactive = env0_4;
object2.borderPressed = env0_4;
return object2;
}
if (a0 === 'primary-overlay') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_OVERLAY_PRIMARY_BACKGROUND_ACTIVE;
object2.borderInactive = env0_4;
object2.borderPressed = env0_4;
return object2;
}
if (a0 === 'secondary-overlay') {
object2 = {};
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundInactive = colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_DEFAULT;
colors = (importDefault(697) /* metro dependency 697: native */).colors;
object2.backgroundPressed = colors.CONTROL_OVERLAY_SECONDARY_BACKGROUND_ACTIVE;
object2.borderInactive = env0_4;
object2.borderPressed = env0_4;
return object2;
}
if (a0 === 'experimental_welcome-secondary') {
return {backgroundInactive: env0_5, backgroundPressed: env0_6, borderInactive: env0_4, borderPressed: env0_4};
}
if (a0 === 'experimental_premium-primary') {
object2 = {};
object2.backgroundInactive = env0_4;
object2.backgroundPressed = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_BUTTON_PREMIUM_PRIMARY_PRESSED_BACKGROUND;
object2.borderInactive = env0_4;
object2.borderPressed = env0_4;
return object2;
}
if (a0 === 'icon-only') {
object2 = {};
object2.backgroundInactive = env0_4;
object2.backgroundPressed = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_ICON_ONLY_BACKGROUND_ACTIVE;
object2.borderInactive = env0_4;
object2.borderPressed = env0_4;
return object2;
}
if (a0 === 'expressive') {
return {backgroundInactive: env0_4, backgroundPressed: env0_4, borderInactive: env0_4, borderPressed: env0_4};
}
}
function useGradientPillStyles(a0) { // fn#38876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:7115, offset: 0x010cedc9, size: 32 bytes, params: 2, frame: 12
const object2 = {};
object2.borderColor = env0_8(a0).borderInactive;
return object2;
}
function useButtonPillStyles(a0, a1) { // fn#38877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:7212, offset: 0x010cede9, size: 151 bytes, params: 3, frame: 20
const env0_0 = a1;
const value2 = useProfileThemedButtonStyles(a0);
const value3 = env0_8(a0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = useButtonPillStylesS;
const object2 = {themedStyles: value2, colors: value3};
object2.interpolateColor = reanimatedRexportModule.interpolateColor;
object2.pressed = a1;
closure.__closure = object2;
closure.__workletHash = 2383933325137;
closure.__initData = env0_9;
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
}
function useButtonPressAnimationProps(a0) { // fn#38879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:7851, offset: 0x010cef6b, size: 257 bytes, params: 2, frame: 24
let value = a0;
const value2 = a1;
const r5 = value2 !== undefined ? value2 : 8;
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = a4;
const r3 = value ?? (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const env0_3 = r3;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.useSharedValue(0);
const object2 = {};
object2.onPressIn = env0_3.useCallback(_fun38880, [r3, a3]);
object2.onPressOut = env0_3.useCallback(_fun38881, [r3, a4]);
object2.onLayout = env0_3.useCallback(_fun38882, [value, a2]);
object2.style = useButtonScaleStyles(r3, value, r5);
return object2;
}
function useIconSizeStyles(a0) { // fn#38883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:8247, offset: 0x010cf109, size: 147 bytes, params: 2, frame: 18
const value = a1;
const value2 = a2;
const env0_0 = a0;
const r6 = value !== undefined ? value : false;
const r5 = value2 !== undefined ? value2 : (require(4582) /* metro dependency 4582: ButtonConstantsNative */).BUTTON_DEFAULT_MAX_FONT_SIZE_MULTIPLIER;
const value3 = (require(4584) /* metro dependency 4584: useFontScale */).useFontScale();
return value3.useMemo(_fun38884, [a0, r6, r5, value3]);
}
function _fun38867() { // fn#38867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:350, offset: 0x010ce3da, size: 737 bytes, params: 1, frame: 21
var r10;
var r6;
var value2;
var isThemeLight2;
var moduleValue2;
var setColorOpacity;
var object2;
var items2;
var moduleValue4;
var value5;
var isThemeLight3;
var moduleValue6;
var items3;
var moduleValue8;
var value8;
var WHITE;
var moduleValue9;
var getContrastingColor;
var value9;
var value;
let primaryColorBinding = primaryColor;
if (primaryColorBinding != null) {
var binding = env0_0;
if (binding === 'primary') {
value8 = environment.__proto__;
WHITE = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE;
moduleValue9 = require(3868) /* metro dependency 3868: native */;
getContrastingColor = moduleValue9.getContrastingColor;
primaryColorBinding = primaryColor;
object2 = {base: WHITE};
object2.contrastRatio = (require(3868) /* metro dependency 3868: native */).WCAGContrastRatios.HighContrastText;
value = Reflect.apply(getContrastingColor, moduleValue9, [primaryColorBinding, object2]);
value9 = (require(3868) /* metro dependency 3868: native */).darkenColor(value, 0.5);
return {backgroundColor: [value, value9], borderColor: [value, value9], color: WHITE};
}
if (binding === 'secondary') {
value5 = environment.__proto__;
isThemeLight3 = (require(4002) /* metro dependency 4002: shared */).isThemeLight(theme);
moduleValue6 = require(3868) /* metro dependency 3868: native */;
setColorOpacity = moduleValue6.setColorOpacity;
r6 = isThemeLight3 ? Reflect.apply(setColorOpacity, moduleValue6, ['white',
0.72]) : Reflect.apply(setColorOpacity,
moduleValue6, ['white', 0.24]);
items3 = [r6];
value = (require(4002) /* metro dependency 4002: shared */).isThemeLight(theme);
moduleValue8 = require(3868) /* metro dependency 3868: native */;
setColorOpacity = moduleValue8.setColorOpacity;
r6 = value ? Reflect.apply(setColorOpacity, moduleValue8, ['white', 0.62]) : Reflect.apply(setColorOpacity,
moduleValue8, ['white', 0.34]);
items3[1] = r6;
return {backgroundColor: items3, borderColor: [env1_4, env1_4], color: undefined};
}
if (binding === 'tertiary') {
value2 = environment.__proto__;
isThemeLight2 = (require(4002) /* metro dependency 4002: shared */).isThemeLight(theme);
moduleValue2 = require(3868) /* metro dependency 3868: native */;
setColorOpacity = moduleValue2.setColorOpacity;
r10 = isThemeLight2 ? Reflect.apply(setColorOpacity, moduleValue2, [primaryColor,
0.4]) : Reflect.apply(setColorOpacity, moduleValue2, ['white', 0.1]);
items2 = [r10];
value = (require(4002) /* metro dependency 4002: shared */).isThemeLight(theme);
moduleValue4 = require(3868) /* metro dependency 3868: native */;
items2[1] = value ? moduleValue4.darkenColor(r10, 0.3) : moduleValue4.setColorOpacity('white', 0.2);
return {backgroundColor: items2, borderColor: [env1_4, env1_4], color: undefined};
}
}
return null;
}
function useButtonScaleStylesN() { // fn#38871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:6309, owner: useButtonScaleStyles.n, offset: 0x010ce7d5, size: 208 bytes, params: 1, frame: 22
const r1 = require.get() > 0 ? (require.get() - importDefault) / require.get() : 1;
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = reanimatedRexportModule.interpolate;
let value = env0_0.get();
value = Reflect.apply(interpolate, reanimatedRexportModule, [value, [0, 1], [1, r1]]);
const ON_PRESS_SPRING = (require(4581) /* metro dependency 4581: springPresets */).ON_PRESS_SPRING;
return {transform: [{scale: Reflect.apply(withSpring, springModule, [value, ON_PRESS_SPRING, 'animate-always'])}]};
}
function useButtonPillStylesS() { // fn#38878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:7329, owner: useButtonPillStyles.s, offset: 0x010cee80, size: 235 bytes, params: 1, frame: 22
const value2 = undefined;
const r11 = (env0_1 == null ? value2 : env0_1.backgroundColor) ?? [env0_2.backgroundInactive,
env0_2.backgroundPressed];
const r5 = (env0_1 == null ? value2 : env0_1.borderColor) ?? [env0_2.borderInactive, env0_2.borderPressed];
const object2 = {};
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object2.backgroundColor = reanimatedRexportModule.interpolateColor(require.get(), [0, 1], r11);
const value = reanimatedRexportModule;
object2.borderColor = value.interpolateColor(require.get(), [0, 1], r5);
return object2;
}
function _fun38880(a0) { // fn#38880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:8008, offset: 0x010cf06c, size: 48 bytes, params: 2, frame: 12
env0_3.set(1);
if (importAll != null) {
importAll(a0);
}
}
function _fun38881(a0) { // fn#38881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:8070, offset: 0x010cf09c, size: 47 bytes, params: 2, frame: 12
env0_3.set(0);
if (env0_2 != null) {
env0_2(a0);
}
}
function _fun38882(a0) { // fn#38882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:8130, offset: 0x010cf0cb, size: 62 bytes, params: 2, frame: 13
const binding = env0_4;
binding.set(a0.nativeEvent.layout.width);
if (importDefault != null) {
importDefault(a0);
}
}
function _fun38884() { // fn#38884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4761:8356, offset: 0x010cf19c, size: 364 bytes, params: 1, frame: 19
var r4;
var r5;
var r1;
var moduleValue2;
var moduleValue3;
var TextStyleSheet;
var property;
var Math;
let value = environment.__proto__;
const iconModule = require(4580) /* metro dependency 4580: Icon */;
const getIconSize = iconModule.getIconSize;
const MEDIUM_BUTTON_ICON_SIZE = (require(4582) /* metro dependency 4582: ButtonConstantsNative */).MEDIUM_BUTTON_ICON_SIZE;
const value2 = Reflect.apply(getIconSize, iconModule, [MEDIUM_BUTTON_ICON_SIZE]);
const binding = env0_0;
if (binding === 'sm') {
moduleValue3 = iconModule;
r4 = moduleValue3.getIconSize((require(4582) /* metro dependency 4582: ButtonConstantsNative */).SMALL_BUTTON_ICON_SIZE);
} else if (binding !== 'lg') {
r4 = value2;
} else {
moduleValue2 = require(4580) /* metro dependency 4580: Icon */;
r4 = moduleValue2.getIconSize((require(4582) /* metro dependency 4582: ButtonConstantsNative */).LARGE_BUTTON_ICON_SIZE);
}
if (env0_1) {
if (env0_3 > 1) {
TextStyleSheet = (require(4573) /* metro dependency 4573: Text */).TextStyleSheet;
value = require(4582) /* metro dependency 4582: ButtonConstantsNative */;
property = TextStyleSheet[value.getButtonDefaultTextVariant(env0_0)];
value = require(477) /* metro dependency 477: PlatformUtils */;
r5 = value.isAndroid() ? property.fontSize : property.lineHeight;
if (r4 == null) {
r1 = r4;
} else if (r5 == null) {
r1 = r4;
} else {
Math = global.Math;
value = Math.min(env0_3, env0_2);
Math = global.Math;
value = Math.max(r4, r5 * value);
r1 = value;
}
} else {
r1 = r4;
}
} else {
r1 = r4;
}
return {width: r1, height: r1};
}