This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,10 +1,19 @@
/* Metro module 9221; source: design/components/SegmentedControl/native/SegmentedControl.native.tsx; dependencies: [31, 27, 33, 4501, 697, 3860, 4017, 4577, 9222, 5321, 477, 2] */
import Native from '../../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ReanimatedRexport from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as UseTokenModule from '../../../tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as CreateStylesModule from '../../Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as SegmentedControlItemNativeModule from './SegmentedControlItem.native.tsx'; /* Metro dependency 9222 */
function _fun72105(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72105, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6, offset: 0x01d39d52, size: 361 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 */;
let value = require(27) /* metro dependency 27 */;
let value = ReactNativeModule;
const env0_4 = value.View;
const env0_5 = value.ScrollView;
value = require(33) /* metro dependency 33 */;
@@ -12,7 +21,7 @@ function _fun72105(global, require, importDefault, importAll, module, exports, d
const env0_7 = value.jsxs;
const env0_8 = {'mass': 0.3, 'damping': 13, 'stiffness': 100, 'restDisplacementThreshold': 0.001,
'overshootClamping': true};
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun72106);
const env0_9 = (CreateStylesModule).createStyles(_fun72106);
object = {code: 'function SegmentedControlNativeTsx1(){const{indicatorWidth}=this.__closure;return indicatorWidth.get();}'};
object = {code: 'function SegmentedControlNativeTsx2(_,previous){const{previousIndicatorWidth}=this.__closure;if(previous!=null){previousIndicatorWidth.set(previous);}}'};
object = {code: 'function SegmentedControlNativeTsx3(){const{activeIndex,itemCount}=this.__closure;return Math.min(Math.max(activeIndex.get(),0),itemCount-1);}'};
@@ -21,367 +30,380 @@ function _fun72105(global, require, importDefault, importAll, module, exports, d
object = {code: 'function onPanGestureUpdate_SegmentedControlNativeTsx6(event){const{indicatorWidth,panIndex,activeIndex,itemCount}=this.__closure;const progess=event.translationX/indicatorWidth.get();const index=panIndex.get()+progess;activeIndex.set(Math.min(Math.max(index,0),itemCount-1));}'};
object = {code: 'function SegmentedControlNativeTsx7(){const{panIndex,activeIndex,runOnJS,setActiveIndex}=this.__closure;panIndex.set(-1);activeIndex.set(Math.round(activeIndex.get()));runOnJS(setActiveIndex)(activeIndex.get());}'};
object = {code: 'function SegmentedControlNativeTsx8(){const{panIndex,activeIndex}=this.__closure;panIndex.set(activeIndex.get());}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControl.native.tsx');
(FileImportTrackerModule).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControl.native.tsx');
exports.SegmentedControl = SegmentedControl;
}
function _fun72106(a0, a1) { // fn#72106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:286, offset: 0x01d39ebb, size: 166 bytes, params: 3, frame: 18
const object = {};
object.scrollContentContainer = {flexGrow: 1};
const MOBILE_SEGMENTED_CONTROL_BACKGROUND = (Native).colors.MOBILE_SEGMENTED_CONTROL_BACKGROUND;
object.controlsContainer = {'backgroundColor': null, 'borderRadius': null, 'paddingVertical': null,
'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
backgroundColor: MOBILE_SEGMENTED_CONTROL_BACKGROUND, borderRadius: a0 + a1, paddingVertical: a1};
object.indicatorContainer = {'position': 'absolute', 'width': '100%', 'height': '100%', 'borderRadius': null,
'flexDirection': 'row', borderRadius: a0};
const MOBILE_SEGMENTED_CONTROL_INDICATOR_BACKGROUND = (Native).colors.MOBILE_SEGMENTED_CONTROL_INDICATOR_BACKGROUND;
object.indicator = {flex: 1, backgroundColor: MOBILE_SEGMENTED_CONTROL_INDICATOR_BACKGROUND, borderRadius: a0};
return object;
}
function _fun72106(a0, a1) { // fn#72106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:286, offset: 0x01d39ebb, size: 166 bytes, params: 3, frame: 18
const object2 = {};
object2.scrollContentContainer = {flexGrow: 1};
const MOBILE_SEGMENTED_CONTROL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_SEGMENTED_CONTROL_BACKGROUND;
object2.controlsContainer = {'backgroundColor': null, 'borderRadius': null, 'paddingVertical': null,
'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
backgroundColor: MOBILE_SEGMENTED_CONTROL_BACKGROUND, borderRadius: a0 + a1, paddingVertical: a1};
object2.indicatorContainer = {'position': 'absolute', 'width': '100%', 'height': '100%', 'borderRadius': null,
'flexDirection': 'row', borderRadius: a0};
const MOBILE_SEGMENTED_CONTROL_INDICATOR_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_SEGMENTED_CONTROL_INDICATOR_BACKGROUND;
object2.indicator = {flex: 1, backgroundColor: MOBILE_SEGMENTED_CONTROL_INDICATOR_BACKGROUND, borderRadius: a0};
return object2;
}
function SegmentedControl({state, variant, keyboardShouldPersistTaps}) { // fn#72107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:3762, offset: 0x01d39f61, size: 1403 bytes, params: 2, frame: 40
var object2;
variant = variant === undefined ? 'default' : variant;
const activeIndex = state.activeIndex;
const scrollOverflow = state.scrollOverflow;
const env0_3 = scrollOverflow;
const items2 = state.items;
const pressedIndex = state.pressedIndex;
const setActiveIndex = state.setActiveIndex;
const value = variant === 'experimental_Large';
const r20 = value ? 8 : 4;
const env0_8 = r20;
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const SEGMENTED_CONTROL_BORDER_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.SEGMENTED_CONTROL_BORDER_RADIUS;
const styles = useStyles(Reflect.apply(useToken, useTokenModule, [SEGMENTED_CONTROL_BORDER_RADIUS]), r20);
const length = items2.length;
const env0_10 = length;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useSharedValue = reanimatedRexportModule.useSharedValue;
const value6 = Reflect.apply(useSharedValue, reanimatedRexportModule, [-1]);
const env0_11 = value6;
const value7 = reanimatedRexportModule.useSharedValue(0);
const env0_12 = value7;
const value8 = reanimatedRexportModule.useSharedValue(0);
const env0_13 = value8;
const moduleValue5 = reanimatedRexportModule;
const useAnimatedReaction = moduleValue5.useAnimatedReaction;
let closure = SegmentedControlT;
closure.__closure = {indicatorWidth: value7};
closure.__workletHash = 5223249035388;
closure.__initData = env0_10;
const closure2 = SegmentedControlR;
closure2.__closure = {previousIndicatorWidth: value8};
closure2.__workletHash = 14748619096684;
closure2.__initData = env0_11;
Reflect.apply(useAnimatedReaction, moduleValue5, [closure, closure2]);
const binding = env0_3;
const value9 = binding.useCallback(_fun72110, [value7]);
const env0_14 = value9;
const moduleValue6 = reanimatedRexportModule;
useSharedValue = moduleValue6.useSharedValue;
const get = activeIndex.get;
const value10 = Reflect.apply(useSharedValue, moduleValue6, [Reflect.apply(get, activeIndex, [])]);
const moduleValue7 = reanimatedRexportModule;
let useDerivedValue = moduleValue7.useDerivedValue;
closure = function() {
var Math = global.Math;
var Math2 = global.Math;
return Math.min(Math2.max(activeIndex.get(), 0), length - 1);
};
closure.__closure = {activeIndex: activeIndex, itemCount: length};
closure.__workletHash = 790542357728;
closure.__initData = env0_12;
const value11 = Reflect.apply(useDerivedValue, moduleValue7, [closure]);
const env0_16 = value11;
const moduleValue8 = reanimatedRexportModule;
useDerivedValue = moduleValue8.useDerivedValue;
closure = SegmentedControlG;
closure.__closure = {clampedActiveIndex: value11, defaultActiveIndex: value10, indicatorWidth: value7};
closure.__workletHash = 10116271570175;
closure.__initData = env0_13;
const value12 = Reflect.apply(useDerivedValue, moduleValue8, [closure]);
const env0_17 = value12;
const moduleValue9 = reanimatedRexportModule;
const useAnimatedStyle = moduleValue9.useAnimatedStyle;
closure = SegmentedControlB;
object2 = {indicatorTranslateX: value12, pressedIndex: pressedIndex, clampedActiveIndex: value11,
PRESSED_TRANSLATE_AMOUNT: 0.04, indicatorWidth: value7, scrollOverflow: scrollOverflow};
object2.interpolate = reanimatedRexportModule.interpolate;
object2.SCROLL_OVERFLOW_UPPER_BOUND = 50;
object2.SCROLL_OVERFLOW_MAX_SCALE = 0.9;
object2.segmentSpacing = r20;
object2.itemCount = length;
object2.previousIndicatorWidth = value8;
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.SELECTED_INDICATOR_SPRING = env0_8;
closure.__closure = object2;
closure.__workletHash = 5537358752627;
closure.__initData = env0_14;
const value14 = binding.useMemo(function() {
return items.map(_fun72115);
}, [items2, value10, value9, styles.indicator, Reflect.apply(useAnimatedStyle, moduleValue9, [closure])]);
const value15 = binding.useMemo(function() {
return items.map(_fun72117);
}, [items2, length, r20, state, pressedIndex, value, variant, setActiveIndex]);
const value16 = _fun72121();
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value17 = Gesture.Pan();
const onStart = value17.onStart;
closure = SegmentedControlJ;
closure.__closure = {panIndex: value6, activeIndex: activeIndex};
closure.__workletHash = 16822477236158;
closure.__initData = env0_17;
const value19 = Reflect.apply(onStart, value17, [closure]).onUpdate(value16);
const onEnd = value19.onEnd;
closure = SegmentedControlH;
object2 = {panIndex: value6, activeIndex: activeIndex};
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.setActiveIndex = setActiveIndex;
closure.__closure = object2;
closure.__workletHash = 4531135834116;
closure.__initData = env0_16;
const value20 = Reflect.apply(onEnd, value19, [closure]);
const view = <View accessibilityRole={(require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'tablist' : 'tabbar'} style={styles.controlsContainer} key={items2.length}><View accessible={false} style={styles.indicatorContainer}>{value14}</View>{value15}</View>;
if (value) {
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
return (
<GestureDetector gesture={value20}>
{view}
</GestureDetector>
);
} else {
return (
<ScrollView
horizontal
alwaysBounceHorizontal={false}
contentContainerStyle={styles.scrollContentContainer}
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
function SegmentedControl({state, variant, keyboardShouldPersistTaps}) { // fn#72107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:3762, offset: 0x01d39f61, size: 1403 bytes, params: 2, frame: 40
variant = variant === undefined ? 'default' : variant;
const activeIndex = state.activeIndex;
const scrollOverflow = state.scrollOverflow;
const scrollOverflow2 = scrollOverflow;
const items2 = state.items;
const pressedIndex = state.pressedIndex;
const setActiveIndex = state.setActiveIndex;
const value = variant === 'experimental_Large';
const r20 = value ? 8 : 4;
const env0_8 = r20;
const useToken = UseTokenModule.useToken;
const SEGMENTED_CONTROL_BORDER_RADIUS = (Native).modules.mobile.SEGMENTED_CONTROL_BORDER_RADIUS;
const styles = useStyles(Reflect.apply(useToken, UseTokenModule, [SEGMENTED_CONTROL_BORDER_RADIUS]), r20);
const length = items2.length;
const length2 = length;
let useSharedValue = ReanimatedRexportModule.useSharedValue;
const value6 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [-1]);
const env0_11 = value6;
const value7 = ReanimatedRexportModule.useSharedValue(0);
const env0_12 = value7;
const value8 = ReanimatedRexportModule.useSharedValue(0);
const env0_13 = value8;
const useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
let closure = SegmentedControlT;
closure.__closure = {indicatorWidth: value7};
closure.__workletHash = 5223249035388;
closure.__initData = length2;
const SegmentedControlR2 = SegmentedControlR;
SegmentedControlR2.__closure = {previousIndicatorWidth: value8};
SegmentedControlR2.__workletHash = 14748619096684;
SegmentedControlR2.__initData = env0_11;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, SegmentedControlR2]);
const binding = scrollOverflow2;
const value9 = binding.useCallback(_fun72110, [value7]);
const env0_14 = value9;
useSharedValue = ReanimatedRexportModule.useSharedValue;
const get = activeIndex.get;
const value10 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [Reflect.apply(get, activeIndex, [])]);
let useDerivedValue = ReanimatedRexportModule.useDerivedValue;
closure = function() {
var Math = global.Math;
var Math2 = global.Math;
return Math.min(Math2.max(activeIndex.get(), 0), length - 1);
};
closure.__closure = {activeIndex: activeIndex, itemCount: length};
closure.__workletHash = 790542357728;
closure.__initData = env0_12;
const value11 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
const env0_16 = value11;
useDerivedValue = ReanimatedRexportModule.useDerivedValue;
closure = SegmentedControlG;
closure.__closure = {clampedActiveIndex: value11, defaultActiveIndex: value10, indicatorWidth: value7};
closure.__workletHash = 10116271570175;
closure.__initData = env0_13;
const value12 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
const env0_17 = value12;
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = SegmentedControlB;
object = {indicatorTranslateX: value12, pressedIndex: pressedIndex, clampedActiveIndex: value11,
PRESSED_TRANSLATE_AMOUNT: 0.04, indicatorWidth: value7, scrollOverflow: scrollOverflow};
object.interpolate = ReanimatedRexportModule.interpolate;
object.SCROLL_OVERFLOW_UPPER_BOUND = 50;
object.SCROLL_OVERFLOW_MAX_SCALE = 0.9;
object.segmentSpacing = r20;
object.itemCount = length;
object.previousIndicatorWidth = value8;
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object.SELECTED_INDICATOR_SPRING = env0_8;
closure.__closure = object;
closure.__workletHash = 5537358752627;
closure.__initData = env0_14;
const value14 = binding.useMemo(function() {
return items.map(_fun72115);
}, [items2, value10, value9, styles.indicator, Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure])]);
const value15 = binding.useMemo(function() {
return items.map(_fun72117);
}, [items2, length, r20, state, pressedIndex, value, variant, setActiveIndex]);
const value16 = _fun72121();
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const value17 = Gesture.Pan();
const onStart = value17.onStart;
closure = SegmentedControlJ;
closure.__closure = {panIndex: value6, activeIndex: activeIndex};
closure.__workletHash = 16822477236158;
closure.__initData = env0_17;
const value19 = Reflect.apply(onStart, value17, [closure]).onUpdate(value16);
const onEnd = value19.onEnd;
closure = SegmentedControlH;
object = {panIndex: value6, activeIndex: activeIndex};
object.runOnJS = ReanimatedRexportModule.runOnJS;
object.setActiveIndex = setActiveIndex;
closure.__closure = object;
closure.__workletHash = 4531135834116;
closure.__initData = env0_16;
const value20 = Reflect.apply(onEnd, value19, [closure]);
const view = (
<View
accessibilityRole={(require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? 'tablist' : 'tabbar'}
style={styles.controlsContainer}
key={items2.length}
>
{view}
</ScrollView>
<View accessible={false} style={styles.indicatorContainer}>
{value14}
</View>
{value15}
</View>
);
}
}
function SegmentedControlR(a0, a1) { // fn#72109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4277, owner: SegmentedControl.R, offset: 0x01d3a4ee, size: 30 bytes, params: 3, frame: 11
if (a1 != null) {
env0_13.set(a1);
}
}
function _fun72110({nativeEvent}) { // fn#72110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4428, offset: 0x01d3a50c, size: 41 bytes, params: 2, frame: 11
const binding = env0_12;
binding.set(nativeEvent.layout.width);
}
function SegmentedControlG() { // fn#72112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4707, owner: SegmentedControl.G, offset: 0x01d3a578, size: 52 bytes, params: 1, frame: 11
let binding = env0_16;
let get = binding.get;
const value2 = Reflect.apply(get, binding, []);
binding = env0_15;
get = binding.get;
const value3 = value2 - Reflect.apply(get, binding, []);
binding = env0_12;
get = binding.get;
return value3 * Reflect.apply(get, binding, []);
}
function SegmentedControlB() { // fn#72113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4889, owner: SegmentedControl.B, offset: 0x01d3a5ac, size: 734 bytes, params: 1, frame: 23
var r1;
var r2;
var r6;
var r7;
var value5;
var value6;
var value8;
var value11;
var value13;
var moduleValue;
var value15;
var value18;
var moduleValue2;
var value20;
var set;
var binding2;
var value;
let binding = env0_17;
let get = binding.get;
const value2 = Reflect.apply(get, binding, []);
const value3 = pressedIndex.get();
const value4 = 1;
if (value3 >= 0) {
value5 = pressedIndex.get();
binding = env0_16;
if (value5 < binding.get()) {
value11 = value2 - 0.02 * env0_12.get();
r1 = 1.04;
r2 = value11;
if (value) {
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
return (
<GestureDetector gesture={value20}>
{view}
</GestureDetector>
);
} else {
value6 = pressedIndex.get();
binding = env0_16;
if (value6 > binding.get()) {
value8 = value2 + 0.02 * env0_12.get();
r1 = 1.04;
r2 = value8;
} else {
r1 = value4;
r2 = value2;
return (
<ScrollView
horizontal
alwaysBounceHorizontal={false}
contentContainerStyle={styles.scrollContentContainer}
keyboardShouldPersistTaps={keyboardShouldPersistTaps}
>
{view}
</ScrollView>
);
}
function SegmentedControlT() { // fn#72108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4183, owner: SegmentedControl.T, offset: 0x01d3a4dc, size: 18 bytes, params: 1, frame: 9
return env0_12.get();
}
function SegmentedControlR(a0, a1) { // fn#72109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4277, owner: SegmentedControl.R, offset: 0x01d3a4ee, size: 30 bytes, params: 3, frame: 11
if (a1 != null) {
env0_13.set(a1);
}
}
r6 = r1;
r7 = r2;
} else {
r6 = value4;
r7 = value2;
}
get = scrollOverflow.get;
if (Reflect.apply(get, scrollOverflowBinding, []) < 0) {
value18 = environment.__proto__;
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value20 = moduleValue2.interpolate(scrollOverflow.get(), [-50, 0], [0.9, 1], 'clamp');
binding = env0_12;
r2 = r7 + -binding.get() * (value4 - value20) / 2;
r6 = value20;
} else {
scrollOverflowBinding = scrollOverflow;
if (scrollOverflowBinding.get() > 0) {
value13 = environment.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value15 = moduleValue.interpolate(scrollOverflow.get(), [50, 0], [0.9, 1], 'clamp');
r2 = r7 + env0_12.get() * (value4 - value15) / 2;
r6 = value15;
} else {
r2 = r7;
function _fun72110({nativeEvent}) { // fn#72110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4428, offset: 0x01d3a50c, size: 41 bytes, params: 2, frame: 11
const binding = env0_12;
binding.set(nativeEvent.layout.width);
}
function SegmentedControlG() { // fn#72112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4707, owner: SegmentedControl.G, offset: 0x01d3a578, size: 52 bytes, params: 1, frame: 11
let binding = env0_16;
let get = binding.get;
const value2 = Reflect.apply(get, binding, []);
binding = env0_15;
get = binding.get;
const value3 = value2 - Reflect.apply(get, binding, []);
binding = env0_12;
get = binding.get;
return value3 * Reflect.apply(get, binding, []);
}
function SegmentedControlB() { // fn#72113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:4889, owner: SegmentedControl.B, offset: 0x01d3a5ac, size: 734 bytes, params: 1, frame: 23
var r1;
var r2;
var r6;
var r7;
var value5;
var value6;
var value8;
var value11;
var value13;
var moduleValue;
var value15;
var value18;
var moduleValue2;
var value20;
var set;
var binding2;
var value;
let binding = env0_17;
let get = binding.get;
const value2 = Reflect.apply(get, binding, []);
const value3 = pressedIndex.get();
const value4 = 1;
if (value3 >= 0) {
value5 = pressedIndex.get();
binding = env0_16;
if (value5 < binding.get()) {
value11 = value2 - 0.02 * env0_12.get();
r1 = 1.04;
r2 = value11;
} else {
value6 = pressedIndex.get();
binding = env0_16;
if (value6 > binding.get()) {
value8 = value2 + 0.02 * env0_12.get();
r1 = 1.04;
r2 = value8;
} else {
r1 = value4;
r2 = value2;
}
}
r6 = r1;
r7 = r2;
} else {
r6 = value4;
r7 = value2;
}
get = scrollOverflow.get;
if (Reflect.apply(get, scrollOverflowBinding, []) < 0) {
value18 = environment.__proto__;
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value20 = moduleValue2.interpolate(scrollOverflow.get(), [-50, 0], [0.9, 1], 'clamp');
binding = env0_12;
r2 = r7 + -binding.get() * (value4 - value20) / 2;
r6 = value20;
} else {
scrollOverflowBinding = scrollOverflow;
if (scrollOverflowBinding.get() > 0) {
value13 = environment.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value15 = moduleValue.interpolate(scrollOverflow.get(), [50, 0], [0.9, 1], 'clamp');
r2 = r7 + env0_12.get() * (value4 - value15) / 2;
r6 = value15;
} else {
r2 = r7;
}
}
binding = env0_16;
get = binding.get;
r7 = Reflect.apply(get, binding, []) === 0 ? r2 + env0_8 : env0_16.get() !== length - value4 ? r2 : r2 - env0_8;
const value26 = env0_12.get();
binding = env0_13;
get = binding.get;
const value27 = value26 === Reflect.apply(get, binding, []);
if (!value27) {
binding = env0_13;
set = binding.set;
binding2 = env0_12;
Reflect.apply(set, binding, [binding2.get()]);
}
if (value27) {
value = environment.__proto__;
value = (require(4577) /* metro dependency 4577: spring */).withSpring(r7, env1_8);
r1 = value;
} else {
r1 = r7;
}
const items2 = [{translateX: r1}];
const object2 = {};
value = environment.__proto__;
object2.scaleX = (require(4577) /* metro dependency 4577: spring */).withSpring(r6, env1_8);
items2[1] = object2;
return {transform: items2};
}
function _fun72114() { // fn#72114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5779, offset: 0x01d3a88a, size: 28 bytes, params: 1, frame: 11
return items.map(_fun72115);
function _fun72115({id}, a1) { // fn#72115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5790, offset: 0x01d3a8a6, size: 133 bytes, params: 3, frame: 19
const value3 = env1_15.get() === a1;
const View = (ReanimatedRexport).View;
return (
<View
onLayout={value3 ? env1_14 : undefined}
style={[styles.indicator, value3 ? env1_18 : {opacity: 0}]}
key={id}
/>
);
}
}
function _fun72116() { // fn#72116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5944, offset: 0x01d3a92b, size: 28 bytes, params: 1, frame: 11
return items.map(_fun72117);
function _fun72117({label, id, icon}, a1) { // fn#72117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5955, offset: 0x01d3a947, size: 288 bytes, params: 3, frame: 25
var environment;
const env0_0 = a1;
let value = a1 === 0;
const r12 = value ? env1_8 : a1 !== length - 1 ? undefined : -env1_8;
const r11 = value ? -env1_8 : a1 !== length - 1 ? undefined : env1_8;
value = environment.__proto__.__proto__;
const SegmentedControlItem = (SegmentedControlItemNativeModule).SegmentedControlItem;
return (
<SegmentedControlItem
style={{
minWidth: 1 / length * 100 + '%',
marginStart: r12,
marginEnd: r11,
}}
index={a1}
itemCount={length}
label={label}
state={state}
pressed={pressedIndex}
onPress={function() {
setActiveIndex(require);
}}
onPressIn={function() {
pressedIndex.set(require);
}}
onPressOut={function() {
pressedIndex.set(-1);
}}
icon={env1_7 ? icon : null}
variant={variant}
key={id}
/>
);
}
}
function _fun72121() { // fn#72121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6325, offset: 0x01d3aab5, size: 87 bytes, params: 1, frame: 4
const onPanGestureUpdate2 = onPanGestureUpdate;
onPanGestureUpdate2.__closure = {indicatorWidth: env0_12, panIndex: env0_11, activeIndex: activeIndex,
itemCount: length};
onPanGestureUpdate2.__workletHash = 4853281820821;
onPanGestureUpdate2.__initData = env1_15;
return onPanGestureUpdate2;
function onPanGestureUpdate({translationX}) { // fn#72122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6359, offset: 0x01d3ab0c, size: 113 bytes, params: 2, frame: 18
let binding = env1_12;
let get = binding.get;
const value2 = translationX / Reflect.apply(get, binding, []);
binding = env1_11;
get = binding.get;
const value3 = Reflect.apply(get, binding, []) + value2;
const activeIndexBinding = activeIndex;
const set = activeIndexBinding.set;
const Math = global.Math;
const min = Math.min;
const Math2 = global.Math;
Reflect.apply(set, activeIndexBinding, [Reflect.apply(min, Math, [Math2.max(value3, 0), length - 1])]);
}
}
function SegmentedControlJ() { // fn#72123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6677, owner: SegmentedControl.J, offset: 0x01d3ab7d, size: 34 bytes, params: 1, frame: 12
const binding = env0_11;
const set = binding.set;
const activeIndexBinding = activeIndex;
const get = activeIndexBinding.get;
Reflect.apply(set, binding, [Reflect.apply(get, activeIndexBinding, [])]);
}
function SegmentedControlH() { // fn#72124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6814, owner: SegmentedControl.H, offset: 0x01d3ab9f, size: 127 bytes, params: 1, frame: 15
const binding = env0_11;
let set = binding.set;
Reflect.apply(set, binding, [-1]);
let activeIndexBinding = activeIndex;
set = activeIndexBinding.set;
const Math = global.Math;
const round = Math.round;
const activeIndexBinding2 = activeIndex;
let get = activeIndexBinding2.get;
Reflect.apply(set, activeIndexBinding, [Reflect.apply(round, Math, [Reflect.apply(get, activeIndexBinding2, [])])]);
const value3 = ReanimatedRexportModule.runOnJS(setActiveIndex);
activeIndexBinding = activeIndex;
get = activeIndexBinding.get;
value3(Reflect.apply(get, activeIndexBinding, []));
}
}
binding = env0_16;
get = binding.get;
r7 = Reflect.apply(get, binding, []) === 0 ? r2 + env0_8 : env0_16.get() !== length - value4 ? r2 : r2 - env0_8;
const value26 = env0_12.get();
binding = env0_13;
get = binding.get;
const value27 = value26 === Reflect.apply(get, binding, []);
if (!value27) {
binding = env0_13;
set = binding.set;
binding2 = env0_12;
Reflect.apply(set, binding, [binding2.get()]);
}
if (value27) {
value = environment.__proto__;
value = (require(4577) /* metro dependency 4577: spring */).withSpring(r7, env1_8);
r1 = value;
} else {
r1 = r7;
}
const items2 = [{translateX: r1}];
const object = {};
value = environment.__proto__;
object.scaleX = (require(4577) /* metro dependency 4577: spring */).withSpring(r6, env1_8);
items2[1] = object;
return {transform: items2};
}
function _fun72114() { // fn#72114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5779, offset: 0x01d3a88a, size: 28 bytes, params: 1, frame: 11
return items.map(_fun72115);
}
function _fun72116() { // fn#72116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5944, offset: 0x01d3a92b, size: 28 bytes, params: 1, frame: 11
return items.map(_fun72117);
}
function _fun72121() { // fn#72121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6325, offset: 0x01d3aab5, size: 87 bytes, params: 1, frame: 4
const closure = onPanGestureUpdate;
closure.__closure = {indicatorWidth: env0_12, panIndex: env0_11, activeIndex: activeIndex, itemCount: length};
closure.__workletHash = 4853281820821;
closure.__initData = env1_15;
return closure;
}
function SegmentedControlJ() { // fn#72123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6677, owner: SegmentedControl.J, offset: 0x01d3ab7d, size: 34 bytes, params: 1, frame: 12
const binding = env0_11;
const set = binding.set;
const activeIndexBinding = activeIndex;
const get = activeIndexBinding.get;
Reflect.apply(set, binding, [Reflect.apply(get, activeIndexBinding, [])]);
}
function SegmentedControlH() { // fn#72124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6814, owner: SegmentedControl.H, offset: 0x01d3ab9f, size: 127 bytes, params: 1, frame: 15
const binding = env0_11;
let set = binding.set;
Reflect.apply(set, binding, [-1]);
let activeIndexBinding = activeIndex;
set = activeIndexBinding.set;
const Math = global.Math;
const round = Math.round;
const activeIndexBinding2 = activeIndex;
let get = activeIndexBinding2.get;
Reflect.apply(set, activeIndexBinding, [Reflect.apply(round, Math, [Reflect.apply(get, activeIndexBinding2, [])])]);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const value3 = reanimatedRexportModule.runOnJS(setActiveIndex);
activeIndexBinding = activeIndex;
get = activeIndexBinding.get;
value3(Reflect.apply(get, activeIndexBinding, []));
}
function _fun72115({id}, a1) { // fn#72115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5790, offset: 0x01d3a8a6, size: 133 bytes, params: 3, frame: 19
const value3 = env1_15.get() === a1;
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View
onLayout={value3 ? env1_14 : undefined}
style={[styles.indicator, value3 ? env1_18 : {opacity: 0}]}
key={id}
/>
);
}
function _fun72117({label, id, icon}, a1) { // fn#72117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:5955, offset: 0x01d3a947, size: 288 bytes, params: 3, frame: 25
var environment;
const env0_0 = a1;
let value = a1 === 0;
const r12 = value ? env1_8 : a1 !== length - 1 ? undefined : -env1_8;
const r11 = value ? -env1_8 : a1 !== length - 1 ? undefined : env1_8;
value = environment.__proto__.__proto__;
const SegmentedControlItem = (require(9222) /* metro dependency 9222: SegmentedControlItemNative */).SegmentedControlItem;
return (
<SegmentedControlItem
style={{minWidth: 1 / length * 100 + '%', marginStart: r12, marginEnd: r11}}
index={a1}
itemCount={length}
label={label}
state={state}
pressed={pressedIndex}
onPress={function() {
setActiveIndex(require);
}}
onPressIn={function() {
pressedIndex.set(require);
}}
onPressOut={function() {
pressedIndex.set(-1);
}}
icon={env1_7 ? icon : null}
variant={variant}
key={id}
/>
);
}
function onPanGestureUpdate({translationX}) { // fn#72122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9406:6359, offset: 0x01d3ab0c, size: 113 bytes, params: 2, frame: 18
let binding = env1_12;
let get = binding.get;
const value2 = translationX / Reflect.apply(get, binding, []);
binding = env1_11;
get = binding.get;
const value3 = Reflect.apply(get, binding, []) + value2;
const activeIndexBinding = activeIndex;
const set = activeIndexBinding.set;
const Math = global.Math;
const min = Math.min;
const Math2 = global.Math;
Reflect.apply(set, activeIndexBinding, [Reflect.apply(min, Math, [Math2.max(value3, 0), length - 1])]);
}
global.__d(_fun72105, 9221, [31, 27, 33, 4501, 697, 3860, 4017, 4577, 9222, 5321, 477,
2]) /* metro module 9221, dependencies: [31, 27, 33, 4501, 697, 3860, 4017, 4577, 9222, 5321, 477, 2] */;
@@ -1,11 +1,17 @@
/* Metro module 9222; source: design/components/SegmentedControl/native/SegmentedControlItem.native.tsx; dependencies: [31, 27, 33, 4501, 697, 8621, 4017, 4577, 477, 1244, 4573, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as TextModule from '../../Text/native/Text.tsx'; /* Metro dependency 4573 */
function _fun72125(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72125, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9407:6, offset: 0x01d3ac1e, size: 345 bytes, params: 8, frame: 21
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
ReactModule;
let value = ReactNativeModule;
const env0_3 = value.Pressable;
const env0_4 = value.View;
value = require(33) /* metro dependency 33 */;
@@ -15,100 +21,100 @@ function _fun72125(global, require, importDefault, importAll, module, exports, d
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun72126);
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyleProperties = value.createStyleProperties;
object2 = {};
object = {};
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object2.inactive = TEXT_MUTED;
object.inactive = TEXT_MUTED;
let INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
object2.active = INTERACTIVE_TEXT_ACTIVE;
object.active = INTERACTIVE_TEXT_ACTIVE;
INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
object2.pressed = INTERACTIVE_TEXT_ACTIVE;
const env0_9 = Reflect.apply(createStyleProperties, value, [object2]);
object2 = {code: "function SegmentedControlItemNativeTsx1(){const{colors,pressed,index,activeIndex,withSpring,SPRING_CONFIG}=this.__closure;let color=colors.inactive;const isPressActive=pressed.get()>=0;const isPressed=pressed.get()===index;const isActive=Math.round(activeIndex.get())===index;if(isPressed){color=colors.pressed;}else if(isPressActive){color=colors.inactive;}else if(isActive){color=colors.active;}return{color:withSpring(color,SPRING_CONFIG,'animate-always')};}"};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControlItem.native.tsx');
object.pressed = INTERACTIVE_TEXT_ACTIVE;
const env0_9 = Reflect.apply(createStyleProperties, value, [object]);
object = {code: "function SegmentedControlItemNativeTsx1(){const{colors,pressed,index,activeIndex,withSpring,SPRING_CONFIG}=this.__closure;let color=colors.inactive;const isPressActive=pressed.get()>=0;const isPressed=pressed.get()===index;const isActive=Math.round(activeIndex.get())===index;if(isPressed){color=colors.pressed;}else if(isPressActive){color=colors.inactive;}else if(isActive){color=colors.active;}return{color:withSpring(color,SPRING_CONFIG,'animate-always')};}"};
(FileImportTrackerModule).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControlItem.native.tsx');
exports.SegmentedControlItem = SegmentedControlItem;
}
function _fun72126(a0) { // fn#72126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9407:246, offset: 0x01d3ad77, size: 108 bytes, params: 2, frame: 14
const object2 = {};
const value = 4;
object2.borderRadius = importDefault(dependencyMap[value]).radii.lg;
object2.paddingVertical = a0 !== 'experimental_Small' ? 8 : value;
object2.flexDirection = 'row';
object2.justifyContent = 'center';
return {item: object2, label: {'flexDirection': 'column', 'alignItems': 'center', 'gap': 8}};
}
function _fun72126(a0) { // fn#72126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9407:246, offset: 0x01d3ad77, size: 108 bytes, params: 2, frame: 14
const object = {};
const value = 4;
object.borderRadius = importDefault(dependencyMap[value]).radii.lg;
object.paddingVertical = a0 !== 'experimental_Small' ? 8 : value;
object.flexDirection = 'row';
object.justifyContent = 'center';
return {item: object, label: {'flexDirection': 'column', 'alignItems': 'center', 'gap': 8}};
}
function SegmentedControlItem({label, index, itemCount, icon, state, onPress, onPressIn, onPressOut, pressed, variant, style}) { // fn#72127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9407:1205, offset: 0x01d3ade3, size: 562 bytes, params: 2, frame: 31
var r4;
var intl;
const activeIndex = state.activeIndex;
const styles = useStyles(variant);
const value3 = env0_9();
const value4 = (require(8621) /* metro dependency 8621: useStateFromSharedValue */).useDerivedStateFromSharedValue(activeIndex,
function(a0) {
return {selected: a0 === index};
});
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
const SegmentedControlItemB2 = SegmentedControlItemB;
const object = {colors: value3, pressed: pressed, index: index, activeIndex: activeIndex};
object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object.SPRING_CONFIG = env0_7;
SegmentedControlItemB2.__closure = object;
SegmentedControlItemB2.__workletHash = 9369301431547;
SegmentedControlItemB2.__initData = env0_10;
const value5 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [SegmentedControlItemB2]);
const items2 = [styles.item, style];
if (PlatformUtilsModule.isAndroid()) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r4 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['4EsQA1'],
{position: index + 1, tabCount: itemCount});
} else {
r4 = undefined;
}
const Text = (TextModule).Text;
return (
<Pressable
style={items2}
onPress={onPress}
onPressIn={onPressIn}
onPressOut={onPressOut}
accessibilityRole="tab"
accessibilityState={value4}
accessibilityHint={r4}
>
<View style={styles.label}>
{icon}
<Text
animated
variant="text-sm/semibold"
style={value5}
lineClamp={1}
maxFontSizeMultiplier={variant !== 'experimental_Large' ? undefined : 1.5}
>
{label}
</Text>
</View>
</Pressable>
);
function SegmentedControlItemB() { // fn#72129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9407:1478, owner: SegmentedControlItem.b, offset: 0x01d3b02c, size: 176 bytes, params: 1, frame: 19
const inactive = env0_3.inactive;
const pressedBinding = pressed;
let get = pressedBinding.get;
const value3 = Reflect.apply(get, pressedBinding, []) >= 0;
const value4 = pressedBinding.get();
const indexBinding = index;
const Math = global.Math;
const round = Math.round;
const activeIndexBinding = activeIndex;
get = activeIndexBinding.get;
const r5 = value4 === indexBinding ? env0_3.pressed : value3 ? env0_3.inactive : Reflect.apply(round, Math,
[Reflect.apply(get, activeIndexBinding, [])]) !== indexBinding ? inactive : env0_3.active;
const object = {};
object.color = (require(4577) /* metro dependency 4577: spring */).withSpring(r5, env1_7, 'animate-always');
return object;
}
function SegmentedControlItem({label, index, itemCount, icon, state, onPress, onPressIn, onPressOut, pressed, variant, style}) { // fn#72127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9407:1205, offset: 0x01d3ade3, size: 562 bytes, params: 2, frame: 31
var r4;
var intl;
const activeIndex = state.activeIndex;
const styles = useStyles(variant);
const value3 = env0_9();
const value4 = (require(8621) /* metro dependency 8621: useStateFromSharedValue */).useDerivedStateFromSharedValue(activeIndex,
function(a0) {
return {selected: a0 === index};
});
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = SegmentedControlItemB;
const object2 = {colors: value3, pressed: pressed, index: index, activeIndex: activeIndex};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.SPRING_CONFIG = env0_7;
closure.__closure = object2;
closure.__workletHash = 9369301431547;
closure.__initData = env0_10;
const value5 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const items2 = [styles.item, style];
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r4 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['4EsQA1'],
{position: index + 1, tabCount: itemCount});
} else {
r4 = undefined;
}
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Pressable
style={items2}
onPress={onPress}
onPressIn={onPressIn}
onPressOut={onPressOut}
accessibilityRole="tab"
accessibilityState={value4}
accessibilityHint={r4}
>
<View style={styles.label}>
{icon}
<Text
animated
variant="text-sm/semibold"
style={value5}
lineClamp={1}
maxFontSizeMultiplier={variant !== 'experimental_Large' ? undefined : 1.5}
>
{label}
</Text>
</View>
</Pressable>
);
}
function SegmentedControlItemB() { // fn#72129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9407:1478, owner: SegmentedControlItem.b, offset: 0x01d3b02c, size: 176 bytes, params: 1, frame: 19
const inactive = env0_3.inactive;
const pressedBinding = pressed;
let get = pressedBinding.get;
const value3 = Reflect.apply(get, pressedBinding, []) >= 0;
const value4 = pressedBinding.get();
const indexBinding = index;
const Math = global.Math;
const round = Math.round;
const activeIndexBinding = activeIndex;
get = activeIndexBinding.get;
const r5 = value4 === indexBinding ? env0_3.pressed : value3 ? env0_3.inactive : Reflect.apply(round, Math,
[Reflect.apply(get, activeIndexBinding, [])]) !== indexBinding ? inactive : env0_3.active;
const object2 = {};
object2.color = (require(4577) /* metro dependency 4577: spring */).withSpring(r5, env1_7, 'animate-always');
return object2;
}
global.__d(_fun72125, 9222, [31, 27, 33, 4501, 697, 8621, 4017, 4577, 477, 1244, 4573,
2]) /* metro module 9222, dependencies: [31, 27, 33, 4501, 697, 8621, 4017, 4577, 477, 1244, 4573, 2] */;
File diff suppressed because it is too large. Load diff
@@ -1,118 +1,128 @@
/* Metro module 8853; source: design/components/SegmentedControl/native/SegmentedControlState.native.tsx; dependencies: [31, 697, 3875, 4017, 4081, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as AccessibilityPreferencesContextModule from '../../../../external/discord_common/js/packages/design/components/AccessibilityPreferencesContext/AccessibilityPreferencesContext.tsx'; /* Metro dependency 3875 */
import * as ReanimatedRexportModule from '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
function _fun69033(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:6, offset: 0x01c65d4a, size: 137 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 */;
object = {code: 'function SegmentedControlStateNativeTsx1(index,dimensions){const{itemDimensions,itemCount}=this.__closure;itemDimensions.get()[index]=dimensions;itemDimensions.set([...itemDimensions.get()].slice(0,itemCount));}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControlState.native.tsx');
(FileImportTrackerModule).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControlState.native.tsx');
exports.useSegmentedControlState = useSegmentedControlState;
}
function useSegmentedControlState({items, pageWidth, defaultIndex, itemSpacing, onPageChange, onPageChangeStart, onSetActiveIndex}) { // fn#69034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:464, offset: 0x01c65dd3, size: 708 bytes, params: 2, frame: 34
defaultIndex = defaultIndex === undefined ? 0 : defaultIndex;
const r9 = itemSpacing !== undefined ? itemSpacing : (importDefault(697) /* metro dependency 697: native */).space.PX_24;
const env0_3 = onPageChange;
const env0_4 = onPageChangeStart;
const binding = env0_3;
const useContext = binding.useContext;
const AccessibilityPreferencesContext = (require(3875) /* metro dependency 3875: AccessibilityPreferencesContext */).AccessibilityPreferencesContext;
const enabled = Reflect.apply(useContext, binding, [AccessibilityPreferencesContext]).reducedMotion.enabled;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue([]);
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value5 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(defaultIndex);
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue([defaultIndex,
defaultIndex]);
const value8 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef();
const value9 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
const env0_15 = binding.useRef(onPageChange);
binding.useLayoutEffect(_fun69035, [onPageChange]);
let useCallback = binding.useCallback;
const value10 = Reflect.apply(useCallback, binding, [_fun69036, [value6, onPageChangeStart, pageWidth, value3,
value8, enabled, onSetActiveIndex]]);
const length = items.length;
useCallback = binding.useCallback;
const closure = useSegmentedControlStateM;
closure.__closure = {itemDimensions: value2, itemCount: length};
closure.__workletHash = 9501406272062;
closure.__initData = env0_4;
return binding.useMemo(_fun69040, [value6, value7, value8, value3, value4, value5, items, value2, r9, pageWidth,
value9, value10, Reflect.apply(useCallback, binding, [closure, [value2, length]]), enabled]);
}
function _fun69035() { // fn#69035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:971, offset: 0x01c66097, size: 21 bytes, params: 1, frame: 2
env0_15.current = onPageChange;
}
function _fun69036(a0) { // fn#69036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1018, offset: 0x01c660ac, size: 181 bytes, params: 2, frame: 18
var environment;
let value = a1;
const value2 = a2;
const env0_0 = a0;
let r2 = !(value !== undefined) || value;
if (value2 !== undefined) {
}
const closure = updateIndex_69037;
r2 = r2 && env0_11.get() !== a0;
if (r2) {
value = environment.__proto__;
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback((require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes.IMPACT_MEDIUM);
}
const binding = env0_11;
const get = binding.get;
if (a0 !== Reflect.apply(get, binding, [])) {
if (onPageChangeStart != null) {
onPageChangeStart(a0, _fun69038);
} else {
closure(a0);
function useSegmentedControlState({items, pageWidth, defaultIndex, itemSpacing, onPageChange, onPageChangeStart, onSetActiveIndex}) { // fn#69034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:464, offset: 0x01c65dd3, size: 708 bytes, params: 2, frame: 34
defaultIndex = defaultIndex === undefined ? 0 : defaultIndex;
const r9 = itemSpacing !== undefined ? itemSpacing : (importDefault(697) /* metro dependency 697: native */).space.PX_24;
const onPageChange2 = onPageChange;
const onPageChangeStart2 = onPageChangeStart;
const binding = onPageChange2;
const useContext = binding.useContext;
const AccessibilityPreferencesContext = (AccessibilityPreferencesContextModule).AccessibilityPreferencesContext;
const enabled = Reflect.apply(useContext, binding, [AccessibilityPreferencesContext]).reducedMotion.enabled;
const value2 = (ReanimatedRexportModule).useSharedValue([]);
const value3 = (ReanimatedRexportModule).useSharedValue(-1);
const value4 = (ReanimatedRexportModule).useSharedValue(0);
const value5 = (ReanimatedRexportModule).useSharedValue(0);
const value6 = (ReanimatedRexportModule).useSharedValue(defaultIndex);
const value7 = (ReanimatedRexportModule).useSharedValue([defaultIndex,
defaultIndex]);
const value8 = (ReanimatedRexportModule).useAnimatedRef();
const value9 = (ReanimatedRexportModule).useSharedValue(-1);
const env0_15 = binding.useRef(onPageChange);
binding.useLayoutEffect(_fun69035, [onPageChange]);
let useCallback = binding.useCallback;
const value10 = Reflect.apply(useCallback, binding, [_fun69036, [value6, onPageChangeStart, pageWidth, value3,
value8, enabled, onSetActiveIndex]]);
const length = items.length;
useCallback = binding.useCallback;
const useSegmentedControlStateM2 = useSegmentedControlStateM;
useSegmentedControlStateM2.__closure = {itemDimensions: value2, itemCount: length};
useSegmentedControlStateM2.__workletHash = 9501406272062;
useSegmentedControlStateM2.__initData = onPageChangeStart2;
return binding.useMemo(_fun69040, [value6, value7, value8, value3, value4, value5, items, value2, r9, pageWidth,
value9, value10, Reflect.apply(useCallback, binding, [useSegmentedControlStateM2, [value2, length]]), enabled]);
function _fun69035() { // fn#69035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:971, offset: 0x01c66097, size: 21 bytes, params: 1, frame: 2
env0_15.current = onPageChange;
}
function _fun69036(a0) { // fn#69036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1018, offset: 0x01c660ac, size: 181 bytes, params: 2, frame: 18
var environment;
let value = a1;
const value2 = a2;
const env0_0 = a0;
let r2 = !(value !== undefined) || value;
if (value2 !== undefined) {
}
const updateIndex_690372 = updateIndex_69037;
r2 = r2 && env0_11.get() !== a0;
if (r2) {
value = environment.__proto__;
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback((require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes.IMPACT_MEDIUM);
}
const binding = env0_11;
const get = binding.get;
if (a0 !== Reflect.apply(get, binding, [])) {
if (onPageChangeStart != null) {
onPageChangeStart(a0, _fun69038);
} else {
updateIndex_690372(a0);
}
}
function updateIndex_69037(a0) { // fn#69037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1034, offset: 0x01c66161, size: 139 bytes, params: 2, frame: 17
var r3;
var r6;
var current;
env1_11.set(a0);
const value2 = a0 * pageWidth;
env1_8.set(value2);
const value3 = env1_13 == null;
const value4 = undefined;
if (value3) {
r3 = value3;
r6 = value4;
} else {
current = env1_13.current;
r3 = current == null;
r6 = current;
}
if (!r3) {
r6.scrollTo({x: value2, animated: !env0_1 && !enabled});
}
if (onSetActiveIndex != null) {
onSetActiveIndex(a0);
}
return value4;
}
function _fun69038() { // fn#69038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1286, offset: 0x00d6a3a0, size: 20 bytes, params: 1, frame: 11
updateIndex_69037(env0_0);
}
}
function useSegmentedControlStateM(a0, a1) { // fn#69039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1373, owner: useSegmentedControlState.M, offset: 0x01c661ec, size: 87 bytes, params: 3, frame: 16
let binding = env0_7;
binding.get()[a0] = a1;
binding = env0_7;
const set = binding.set;
const value3 = env0_7.get();
const items2 = [];
arraySpread(items2, value3, 0, items2);
Reflect.apply(set, binding, [items2.slice(0, length)]);
}
function _fun69040() { // fn#69040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1547, offset: 0x01c66243, size: 142 bytes, params: 1, frame: 3
return {activeIndex: env0_11, visiblePageRange: env0_12, pagerRef: env0_13, scrollTarget: env0_8,
scrollOverflow: env0_9, scrollOffset: env0_10, items: items, itemDimensions: env0_7, itemSpacing: env0_2,
pageWidth: pageWidth, pressedIndex: env0_14, onPageChangeRef: env0_15, setActiveIndex: env0_16,
setItemDimensions: env0_18, useReducedMotion: enabled};
}
}
}
function useSegmentedControlStateM(a0, a1) { // fn#69039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1373, owner: useSegmentedControlState.M, offset: 0x01c661ec, size: 87 bytes, params: 3, frame: 16
let binding = env0_7;
binding.get()[a0] = a1;
binding = env0_7;
const set = binding.set;
const value3 = env0_7.get();
const items2 = [];
arraySpread(items2, value3, 0, items2);
Reflect.apply(set, binding, [items2.slice(0, length)]);
}
function _fun69040() { // fn#69040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1547, offset: 0x01c66243, size: 142 bytes, params: 1, frame: 3
return {activeIndex: env0_11, visiblePageRange: env0_12, pagerRef: env0_13, scrollTarget: env0_8,
scrollOverflow: env0_9, scrollOffset: env0_10, items: items, itemDimensions: env0_7, itemSpacing: env0_2,
pageWidth: pageWidth, pressedIndex: env0_14, onPageChangeRef: env0_15, setActiveIndex: env0_16,
setItemDimensions: env0_18, useReducedMotion: enabled};
}
function updateIndex_69037(a0) { // fn#69037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9038:1034, offset: 0x01c66161, size: 139 bytes, params: 2, frame: 17
var r3;
var r6;
var current;
env1_11.set(a0);
const value2 = a0 * pageWidth;
env1_8.set(value2);
const value3 = env1_13 == null;
const value4 = undefined;
if (value3) {
r3 = value3;
r6 = value4;
} else {
current = env1_13.current;
r3 = current == null;
r6 = current;
}
if (!r3) {
r6.scrollTo({x: value2, animated: !env0_1 && !enabled});
}
if (onSetActiveIndex != null) {
onSetActiveIndex(a0);
}
return value4;
}
global.__d(_fun69033, 8853, [31, 697, 3875, 4017, 4081,
2]) /* metro module 8853, dependencies: [31, 697, 3875, 4017, 4081, 2] */;