Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,387 @@
/* Metro module 9221; source: design/components/SegmentedControl/native/SegmentedControl.native.tsx; dependencies: [31, 27, 33, 4501, 697, 3860, 4017, 4577, 9222, 5321, 477, 2] */
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 */;
const env0_4 = value.View;
const env0_5 = value.ScrollView;
value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
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);
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);}'};
object = {code: 'function SegmentedControlNativeTsx4(){const{clampedActiveIndex,defaultActiveIndex,indicatorWidth}=this.__closure;return(clampedActiveIndex.get()-defaultActiveIndex.get())*indicatorWidth.get();}'};
object = {code: "function SegmentedControlNativeTsx5(){const{indicatorTranslateX,pressedIndex,clampedActiveIndex,PRESSED_TRANSLATE_AMOUNT,indicatorWidth,scrollOverflow,interpolate,SCROLL_OVERFLOW_UPPER_BOUND,SCROLL_OVERFLOW_MAX_SCALE,segmentSpacing,itemCount,previousIndicatorWidth,withSpring,SELECTED_INDICATOR_SPRING}=this.__closure;let translateX=indicatorTranslateX.get();let scaleX=1;if(pressedIndex.get()>=0){if(pressedIndex.get()<clampedActiveIndex.get()){scaleX+=PRESSED_TRANSLATE_AMOUNT;translateX-=indicatorWidth.get()*(PRESSED_TRANSLATE_AMOUNT/2);}else if(pressedIndex.get()>clampedActiveIndex.get()){scaleX+=PRESSED_TRANSLATE_AMOUNT;translateX+=indicatorWidth.get()*(PRESSED_TRANSLATE_AMOUNT/2);}}if(scrollOverflow.get()<0){const scaleFactor=interpolate(scrollOverflow.get(),[-SCROLL_OVERFLOW_UPPER_BOUND,0],[SCROLL_OVERFLOW_MAX_SCALE,1],'clamp');const scaleAmount=indicatorWidth.get()*(1-scaleFactor);scaleX=scaleFactor;translateX+=-scaleAmount/2;}else if(scrollOverflow.get()>0){const scaleFactor=interpolate(scrollOverflow.get(),[SCROLL_OVERFLOW_UPPER_BOUND,0],[SCROLL_OVERFLOW_MAX_SCALE,1],'clamp');const scaleAmount=indicatorWidth.get()*(1-scaleFactor);scaleX=scaleFactor;translateX+=scaleAmount/2;}if(clampedActiveIndex.get()===0){translateX+=segmentSpacing;}else if(clampedActiveIndex.get()===itemCount-1){translateX-=segmentSpacing;}const animated=indicatorWidth.get()===previousIndicatorWidth.get();if(!animated){previousIndicatorWidth.set(indicatorWidth.get());}return{transform:[{translateX:animated?withSpring(translateX,SELECTED_INDICATOR_SPRING):translateX},{scaleX:withSpring(scaleX,SELECTED_INDICATOR_SPRING)}]};}"};
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');
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 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}
>
{view}
</ScrollView>
);
}
}
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;
} 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 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])]);
}
@@ -0,0 +1,114 @@
/* Metro module 9222; source: design/components/SegmentedControl/native/SegmentedControlItem.native.tsx; dependencies: [31, 27, 33, 4501, 697, 8621, 4017, 4577, 477, 1244, 4573, 2] */
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 */;
const env0_3 = value.Pressable;
const env0_4 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.jsxs;
const env0_7 = {'mass': 0.3, 'damping': 13, 'stiffness': 250, 'overshootClamping': true};
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun72126);
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyleProperties = value.createStyleProperties;
object2 = {};
const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
object2.inactive = TEXT_MUTED;
let INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
object2.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');
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 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 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;
}
@@ -0,0 +1,694 @@
/* Metro module 8861; source: design/components/SegmentedControl/native/SegmentedControlPages.native.tsx; dependencies: [57, 31, 27, 33, 4017, 8862, 477, 5321, 4521, 2] */
function _fun69083(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:6, offset: 0x01c67e56, size: 534 bytes, params: 8, frame: 19
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 */;
const ScrollView = (require(27) /* metro dependency 27 */).ScrollView;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
const env0_6 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(ScrollView);
object = {code: 'function SegmentedControlPagesNativeTsx1(){const{activeIndex}=this.__closure;return activeIndex.get();}'};
object = {code: 'function SegmentedControlPagesNativeTsx2(value){const{runOnJS,updateCurrentActiveIndex}=this.__closure;runOnJS(updateCurrentActiveIndex)(value);}'};
object = {code: 'function SegmentedControlPagesNativeTsx3(){const{pageIndex}=this.__closure;return pageIndex.get();}'};
object = {code: 'function SegmentedControlPagesNativeTsx4(value){const{activeIndex}=this.__closure;activeIndex.set(value);}'};
object = {code: 'function SegmentedControlPagesNativeTsx5(contentOffset,contentSize){const{pageWidth,pageIndex,roundIfClose,reportedPageIndex,runOnJS,onPageChanged}=this.__closure;if(pageWidth===0){return;}pageIndex.set(Math.min(Math.max(roundIfClose(contentOffset.x/pageWidth,1e-4),0),roundIfClose(contentSize.width/pageWidth,1e-4)-1));const pageFullyVisible=pageIndex.get()%1===0;if(pageFullyVisible&&reportedPageIndex.get()!==pageIndex.get()){reportedPageIndex.set(pageIndex.get());runOnJS(onPageChanged)(pageIndex.get());}}'};
object = {code: 'function SegmentedControlPagesNativeTsx6(event){const{onBeginDragWorklet}=this.__closure;var _onBeginDragWorklet;(_onBeginDragWorklet=onBeginDragWorklet)===null||_onBeginDragWorklet===void 0||_onBeginDragWorklet(event);}'};
object = {code: 'function SegmentedControlPagesNativeTsx7(event){const{onEndDragWorklet}=this.__closure;var _onEndDragWorklet;(_onEndDragWorklet=onEndDragWorklet)===null||_onEndDragWorklet===void 0||_onEndDragWorklet(event);}'};
object = {code: 'function SegmentedControlPagesNativeTsx8({contentOffset:contentOffset,contentSize:contentSize}){const{scrollTarget,roundIfClose,runOnJS,refreshScrollOffset,resolvePageIndex}=this.__closure;if(scrollTarget.get()!==-1){const hasReachedTarget=roundIfClose(contentOffset.x-scrollTarget.get(),1e-4)===0;if(hasReachedTarget){scrollTarget.set(-1);}else{const page=scrollTarget.get();runOnJS(refreshScrollOffset)(page);}}resolvePageIndex(contentOffset,contentSize);}'};
object = {code: 'function SegmentedControlPagesNativeTsx9(event){const{lastScrollOffsetX,onScrollWorklet,itemCount,pageWidth,activeIndex,runOnJS,refreshScrollOffset,scrollOverflow,scrollTarget,roundIfClose,resolvePageIndex}=this.__closure;var _onScrollWorklet;const{contentOffset:contentOffset,contentSize:contentSize}=event;if(contentSize.width===0){return;}if(lastScrollOffsetX.get()===contentOffset.x){return;}lastScrollOffsetX.set(contentOffset.x);(_onScrollWorklet=onScrollWorklet)===null||_onScrollWorklet===void 0||_onScrollWorklet(event);const expectedContentSize=itemCount*pageWidth;if(Math.round(expectedContentSize)%Math.round(contentSize.width)!==0){const page=activeIndex.get()*pageWidth;runOnJS(refreshScrollOffset)(page);return;}if(contentOffset.x<0){scrollOverflow.set(contentOffset.x);}else if(contentOffset.x>contentSize.width-pageWidth){scrollOverflow.set(contentOffset.x-(contentSize.width-pageWidth));}else{scrollOverflow.set(0);}if(scrollTarget.get()!==-1){const hasReachedTarget=roundIfClose(contentOffset.x-scrollTarget.get(),1e-4)===0;if(hasReachedTarget){scrollTarget.set(-1);}else{return;}}resolvePageIndex(contentOffset,contentSize);}'};
object = {code: 'function SegmentedControlPagesNativeTsx10(){const{scrollTarget,roundIfClose,pageWidth}=this.__closure;if(scrollTarget.get()===-1){return-1;}return roundIfClose(scrollTarget.get()/pageWidth,1e-4);}'};
object = {code: 'function SegmentedControlPagesNativeTsx11(){const{pageIndex,scrollTargetPageIndex}=this.__closure;const idx=pageIndex.get();let lo=Math.floor(idx);let hi=Math.ceil(idx);const target=scrollTargetPageIndex.get();if(target!==-1){lo=Math.min(lo,target);hi=Math.max(hi,target);}return[lo,hi];}'};
object = {code: 'function SegmentedControlPagesNativeTsx12(range,prev){const{visiblePageRange}=this.__closure;if(prev==null||prev[0]!==range[0]||prev[1]!==range[1]){visiblePageRange.set(range);}}'};
object = {code: 'function SegmentedControlPagesNativeTsx13(){const{pageIndex,index,scrollTargetPageIndex}=this.__closure;if(Math.floor(pageIndex.get())===index||Math.ceil(pageIndex.get())===index){return true;}if(scrollTargetPageIndex.get()===index){return true;}return false;}'};
object = {code: "function SegmentedControlPagesNativeTsx14(){const{reportedPageIndex,index}=this.__closure;const isHidden=reportedPageIndex.get()!==index;return{pointerEvents:isHidden?'none':'box-none',importantForAccessibility:isHidden?'no-hide-descendants':'auto',accessibilityElementsHidden:isHidden};}"};
object = {code: "function SegmentedControlPagesNativeTsx15(){const{isVisibleOnScreen}=this.__closure;return{display:isVisibleOnScreen.get()?'flex':'none',flex:1};}"};
object = {code: 'function SegmentedControlPagesNativeTsx16(){const{activePageRangeStart,activePageRangeEnd}=this.__closure;return[activePageRangeStart.get(),activePageRangeEnd.get()];}'};
object = {code: 'function SegmentedControlPagesNativeTsx17([start,end]){const{index,runOnJS,setFreeze}=this.__closure;const isInActiveRange=index>=start&&index<=end;runOnJS(setFreeze)(!isInActiveRange);}'};
object = {code: 'function SegmentedControlPagesNativeTsx18(min,max){const{activePageRangeStart,activePageRangeEnd}=this.__closure;activePageRangeStart.set(Math.min(activePageRangeStart.get(),min));activePageRangeEnd.set(Math.max(activePageRangeEnd.get(),max));}'};
object = {code: 'function SegmentedControlPagesNativeTsx19(){const{activeIndex,pressedIndex}=this.__closure;return{activeIndex:activeIndex.get(),pressedIndex:pressedIndex.get()};}'};
object = {code: 'function SegmentedControlPagesNativeTsx20({activeIndex:activeIndex,pressedIndex:pressedIndex}){const{expandActivePageRange}=this.__closure;let min=activeIndex;let max=activeIndex;if(pressedIndex!==-1){min=Math.min(activeIndex,pressedIndex);max=Math.max(activeIndex,pressedIndex);}expandActivePageRange(Math.floor(min),Math.ceil(max));}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/SegmentedControl/native/SegmentedControlPages.native.tsx');
exports.SegmentedControlPages = SegmentedControlPages;
}
function SegmentedControlPage(a0) { // fn#69084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5099, offset: 0x01c6806c, size: 668 bytes, params: 2, frame: 29
const reportedPageIndex = a0.reportedPageIndex;
const pageIndex = a0.pageIndex;
const scrollTargetPageIndex = a0.scrollTargetPageIndex;
const index = a0.index;
const env0_3 = index;
const item = a0.item;
const activePageRangeStart = a0.activePageRangeStart;
const env0_4 = activePageRangeStart;
const activePageRangeEnd = a0.activePageRangeEnd;
const object2 = {'reportedPageIndex': 0, 'pageIndex': 0, 'scrollTargetPageIndex': 0, 'index': 0, 'item': 0,
'activePageRangeStart': 0, 'activePageRangeEnd': 0};
silentSetPrototypeOf(object2, null, undefined);
const value = copyDataProperties({}, a0, object2, activePageRangeStart);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useDerivedValue = reanimatedRexportModule.useDerivedValue;
let closure = SegmentedControlPageV;
closure.__closure = {pageIndex: pageIndex, index: index, scrollTargetPageIndex: scrollTargetPageIndex};
closure.__workletHash = 6181538518841;
closure.__initData = env0_19;
const value3 = Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
const moduleValue2 = reanimatedRexportModule;
const useAnimatedProps = moduleValue2.useAnimatedProps;
closure = SegmentedControlPageS;
closure.__closure = {reportedPageIndex: reportedPageIndex, index: index};
closure.__workletHash = 7759188305092;
closure.__initData = env0_20;
const value4 = Reflect.apply(useAnimatedProps, moduleValue2, [closure]);
const moduleValue3 = reanimatedRexportModule;
const useAnimatedStyle = moduleValue3.useAnimatedStyle;
closure = SegmentedControlPageI;
closure.__closure = {isVisibleOnScreen: value3};
closure.__workletHash = 7012147409415;
closure.__initData = env0_21;
const value5 = Reflect.apply(useAnimatedStyle, moduleValue3, [closure]);
const [property, property2] = env0_3(env0_4.useState(_fun69088), 2);
const moduleValue4 = reanimatedRexportModule;
const useAnimatedReaction = moduleValue4.useAnimatedReaction;
closure = function() {
var items = [activePageRangeStart.get()];
items[1] = activePageRangeEnd.get();
return items;
};
closure.__closure = {activePageRangeStart: activePageRangeStart, activePageRangeEnd: activePageRangeEnd};
closure.__workletHash = 16149977006261;
closure.__initData = env0_22;
const closure2 = SegmentedControlPageP_69090;
const object3 = {index: index};
object3.runOnJS = reanimatedRexportModule.runOnJS;
object3.setFreeze = property2;
closure2.__closure = object3;
closure2.__workletHash = 11164856499724;
closure2.__initData = env0_23;
Reflect.apply(useAnimatedReaction, moduleValue4, [closure, closure2]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const viewProps = {...value};
viewProps['animatedProps'] = value4;
const Freeze = (require(4521) /* metro dependency 4521 */).Freeze;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View {...viewProps} key={index}>
<Freeze freeze={property}>
<View2 style={value5}>
{item.page}
</View2>
</Freeze>
</View>
);
}
function SegmentedControlPages({state, style, bounces, nativeGesture, onBeginDragWorklet, onEndDragWorklet, onScrollWorklet}) { // fn#69091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:7371, offset: 0x01c684ca, size: 1759 bytes, params: 2, frame: 41
var object6;
const items3 = state.items;
const activeIndex = state.activeIndex;
const env0_3 = activeIndex;
const visiblePageRange = state.visiblePageRange;
const env0_4 = visiblePageRange;
const pagerRef = state.pagerRef;
const scrollTarget = state.scrollTarget;
const env0_6 = scrollTarget;
const scrollOverflow = state.scrollOverflow;
const env0_7 = scrollOverflow;
const pressedIndex = state.pressedIndex;
const onPageChangeRef = state.onPageChangeRef;
const env0_8 = onPageChangeRef;
const pageWidth = state.pageWidth;
const env0_9 = pageWidth;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useSharedValue = reanimatedRexportModule.useSharedValue;
let get = activeIndex.get;
const value3 = Reflect.apply(useSharedValue, reanimatedRexportModule, [Reflect.apply(get, activeIndex, [])]);
const env0_10 = value3;
const moduleValue2 = reanimatedRexportModule;
useSharedValue = moduleValue2.useSharedValue;
get = activeIndex.get;
const value4 = Reflect.apply(useSharedValue, moduleValue2, [Reflect.apply(get, activeIndex, [])]);
const env0_11 = value4;
const length = items3.length;
const env0_12 = length;
const value5 = reanimatedRexportModule.useSharedValue(undefined);
const env0_13 = value5;
let binding = env0_4;
let useRef = binding.useRef;
const env0_14 = Reflect.apply(useRef, binding, [false]);
binding = env0_4;
useRef = binding.useRef;
get = activeIndex.get;
const env0_15 = Reflect.apply(useRef, binding, [Reflect.apply(get, activeIndex, [])]);
binding = env0_4;
let useCallback = binding.useCallback;
let closure = _fun69092;
const value6 = Reflect.apply(useCallback, binding, [closure, []]);
const env0_16 = value6;
const moduleValue4 = reanimatedRexportModule;
let useAnimatedReaction = moduleValue4.useAnimatedReaction;
closure = function() {
return activeIndex.get();
};
closure.__closure = {activeIndex: activeIndex};
closure.__workletHash = 4275537317596;
closure.__initData = env0_7;
const closure2 = SegmentedControlPagesH;
closure2.__closure = {runOnJS: reanimatedRexportModule.runOnJS, updateCurrentActiveIndex: value6};
closure2.__workletHash = 1219187007872;
closure2.__initData = env0_8;
Reflect.apply(useAnimatedReaction, moduleValue4, [closure, closure2]);
const moduleValue5 = reanimatedRexportModule;
useAnimatedReaction = moduleValue5.useAnimatedReaction;
closure = SegmentedControlPagesZ;
closure.__closure = {pageIndex: value3};
closure.__workletHash = 3363652844798;
closure.__initData = env0_9;
const closure3 = function(a0) {
activeIndex.set(a0);
};
closure3.__closure = {activeIndex: activeIndex};
closure3.__workletHash = 10225590895783;
closure3.__initData = env0_10;
Reflect.apply(useAnimatedReaction, moduleValue5, [closure, closure3]);
const value7 = env0_4.useCallback(function(a0) {
if (!(onPageChangeRef == null || onPageChangeRef.current == null)) {
onPageChangeRef.current(a0);
}
}, [onPageChangeRef]);
const env0_17 = value7;
const value8 = env0_4.useCallback(_fun69098, [pagerRef, scrollTarget]);
const env0_18 = value8;
env0_4.useEffect(_fun69099, [pageWidth, value8]);
binding = env0_4;
useCallback = binding.useCallback;
closure = SegmentedControlPagesTe;
object6 = {pageWidth: pageWidth, pageIndex: value3};
object6.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object6.reportedPageIndex = value4;
object6.runOnJS = reanimatedRexportModule.runOnJS;
object6.onPageChanged = value7;
closure.__closure = object6;
closure.__workletHash = 11872880107296;
closure.__initData = env0_11;
const value9 = Reflect.apply(useCallback, binding, [closure, [value7, value3, pageWidth, value4]]);
const moduleValue6 = reanimatedRexportModule;
const useAnimatedScrollHandler = moduleValue6.useAnimatedScrollHandler;
object6 = {};
closure = function(a0) {
if (onBeginDragWorklet != null) {
onBeginDragWorklet(a0);
}
};
closure.__closure = {onBeginDragWorklet: onBeginDragWorklet};
closure.__workletHash = 2903273634804;
closure.__initData = env0_12;
object6.onBeginDrag = closure;
closure = function(a0) {
if (onEndDragWorklet != null) {
onEndDragWorklet(a0);
}
};
closure.__closure = {onEndDragWorklet: onEndDragWorklet};
closure.__workletHash = 14857102500821;
closure.__initData = env0_13;
object6.onEndDrag = closure;
closure = onMomentumEnd;
const object2 = {scrollTarget: scrollTarget};
object2.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.refreshScrollOffset = value8;
object2.resolvePageIndex = value9;
closure.__closure = object2;
closure.__workletHash = 10636475595563;
closure.__initData = env0_14;
object6.onMomentumEnd = closure;
closure = onScroll_69104;
const object3 = {lastScrollOffsetX: value5, onScrollWorklet: onScrollWorklet, itemCount: length,
pageWidth: pageWidth, activeIndex: activeIndex};
object3.runOnJS = reanimatedRexportModule.runOnJS;
object3.refreshScrollOffset = value8;
object3.scrollOverflow = scrollOverflow;
object3.scrollTarget = scrollTarget;
object3.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object3.resolvePageIndex = value9;
closure.__closure = object3;
closure.__workletHash = 9933659944135;
closure.__initData = env0_15;
object6.onScroll = closure;
const value10 = Reflect.apply(useAnimatedScrollHandler, moduleValue6, [object6]);
const value11 = env0_4.useMemo(function() {
return {flex: 1, width: pageWidth};
}, [pageWidth]);
const value12 = env0_4.useMemo(_fun69106, [value3, pageWidth]);
const value14 = env0_3(useFrozenPageIndices(activeIndex, pressedIndex), 2);
const env0_21 = value14[0];
const env0_22 = value14[1];
const moduleValue7 = reanimatedRexportModule;
const useDerivedValue = moduleValue7.useDerivedValue;
closure = SegmentedControlPagesSe;
object6 = {scrollTarget: scrollTarget};
object6.roundIfClose = (require(8862) /* metro dependency 8862: MathUtils */).roundIfClose;
object6.pageWidth = pageWidth;
closure.__closure = object6;
closure.__workletHash = 7742060999778;
closure.__initData = env0_16;
const value15 = Reflect.apply(useDerivedValue, moduleValue7, [closure]);
const moduleValue8 = reanimatedRexportModule;
useAnimatedReaction = moduleValue8.useAnimatedReaction;
closure = SegmentedControlPagesLe;
closure.__closure = {pageIndex: value3, scrollTargetPageIndex: value15};
closure.__workletHash = 9125733538935;
closure.__initData = env0_17;
const closure4 = SegmentedControlPagesIe;
closure4.__closure = {visiblePageRange: visiblePageRange};
closure4.__workletHash = 14106897948399;
closure4.__initData = env0_18;
Reflect.apply(useAnimatedReaction, moduleValue8, [closure, closure4]);
if (pageWidth === 0) {
return null;
}
binding = env0_6;
const items2 = [value11, style];
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
const binding2 = ((Component) => <Component ref={pagerRef} style={items2} contentOffset={value12} keyboardShouldPersistTaps="handled" showsHorizontalScrollIndicator={false} pagingEnabled snapToInterval={pageWidth} snapToAlignment="center" decelerationRate="fast" centerContent bounces={bounces} horizontal accessibilityRole="none" onScroll={value10} disableIntervalMomentum scrollEventThrottle={platformUtilsModule.isIOS() ? 32 : undefined}>{items3.map(_fun69116)}</Component>)(binding);
if (nativeGesture == null) {
return binding2;
} else {
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
return (
<GestureDetector gesture={nativeGesture}>
{binding2}
</GestureDetector>
);
}
}
function SegmentedControlPageV() { // fn#69085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5296, owner: SegmentedControlPage.v, offset: 0x01c68308, size: 110 bytes, params: 1, frame: 14
const Math = global.Math;
const floor = Math.floor;
const pageIndexBinding = pageIndex;
const get = pageIndexBinding.get;
let r0 = Reflect.apply(floor, Math, [Reflect.apply(get, pageIndexBinding,
[])]) === index || global.Math.ceil(pageIndex.get()) === index;
r0 = !r0 ? scrollTargetPageIndex.get() === index : r0;
return r0;
}
function SegmentedControlPageS() { // fn#69086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5513, owner: SegmentedControlPage.S, offset: 0x01c68376, size: 69 bytes, params: 1, frame: 11
const value = reportedPageIndex.get() !== index;
return {pointerEvents: value ? 'none' : 'box-none',
importantForAccessibility: value ? 'no-hide-descendants' : 'auto', accessibilityElementsHidden: value};
}
function SegmentedControlPageI() { // fn#69087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5793, owner: SegmentedControlPage.I, offset: 0x01c683bb, size: 43 bytes, params: 1, frame: 10
const object2 = {};
object2.display = env0_6.get() ? 'flex' : 'none';
object2.flex = 1;
return object2;
}
function _fun69088() { // fn#69088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:5946, offset: 0x01c683e6, size: 53 bytes, params: 1, frame: 11
const indexBinding = index;
const activePageRangeStartBinding = activePageRangeStart;
const get = activePageRangeStartBinding.get;
return !(indexBinding >= Reflect.apply(get, activePageRangeStartBinding, []) && index <= activePageRangeEnd.get());
}
function SegmentedControlPageP_69090(a0) { // fn#69090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:6171, owner: SegmentedControlPage.p, offset: 0x01c68446, size: 132 bytes, params: 2, frame: 16
var r1;
var r2;
var r4;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r5 = value2 ? value : item;
if (value2) {
r1 = item2;
r2 = value2;
r4 = value;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = item3;
r2 = value3;
r4 = value;
} else {
r1 = item3;
r2 = value3;
r4 = item;
}
}
if (!r2) {
r1.return();
}
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env0_7)(!(index >= r5 && index <= r4));
return value;
}
function _fun69092(a0) { // fn#69092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:7828, offset: 0x01c68ba9, size: 20 bytes, params: 2, frame: 2
env0_15.current = a0;
}
function SegmentedControlPagesH(a0) { // fn#69094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:7973, owner: SegmentedControlPages.H, offset: 0x01c68bbd, size: 52 bytes, params: 2, frame: 12
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(env0_16);
value(a0);
}
function _fun69098(a0) { // fn#69098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:8429, offset: 0x01c68c38, size: 82 bytes, params: 2, frame: 15
var r1;
var r3;
var current;
scrollTarget.set(a0);
const value2 = pagerRef == null;
const value3 = undefined;
if (value2) {
r1 = value2;
r3 = value3;
} else {
current = pagerRef.current;
r1 = current == null;
r3 = current;
}
if (!r1) {
r3.scrollTo({x: a0, animated: false});
}
return value3;
}
function _fun69099() { // fn#69099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:8530, offset: 0x01c68c8a, size: 82 bytes, params: 1, frame: 12
if (pageWidth > 0) {
if (!env0_14.current) {
env0_14.current = true;
if (env0_15.current > 0) {
env0_18(env0_15.current * pageWidth);
}
}
}
}
function SegmentedControlPagesTe(a0, a1) { // fn#69100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:8668, owner: SegmentedControlPages.te, offset: 0x01c68cdc, size: 301 bytes, params: 3, frame: 27
var r3;
var binding;
var set;
var Math;
var min;
var Math2;
var max;
var value2;
var moduleValue;
var roundIfClose;
var x;
var value3;
var moduleValue2;
var get;
var value5;
var value6;
var binding2;
var value;
let pageWidthBinding = pageWidth;
if (pageWidthBinding !== 0) {
binding = env0_10;
set = binding.set;
Math = global.Math;
min = Math.min;
Math2 = global.Math;
max = Math2.max;
value2 = environment.__proto__;
moduleValue = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue.roundIfClose;
x = a0.x;
pageWidthBinding = pageWidth;
value3 = Reflect.apply(max, Math2, [Reflect.apply(roundIfClose, moduleValue,
[x / pageWidthBinding, 0.0001]), 0]);
moduleValue2 = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue2.roundIfClose;
Reflect.apply(set, binding, [Reflect.apply(min, Math, [value3, Reflect.apply(roundIfClose, moduleValue2,
[a1.width / pageWidthBinding, 0.0001]) - 1])]);
get = binding.get;
value5 = Reflect.apply(get, binding, []) % 1 === 0;
if (value5) {
binding = env0_11;
value6 = binding.get();
binding = env0_10;
r3 = value6 !== binding.get();
} else {
r3 = value5;
}
if (r3) {
binding = env0_11;
set = binding.set;
binding2 = env0_10;
get = binding2.get;
Reflect.apply(set, binding, [Reflect.apply(get, binding2, [])]);
value = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env0_17);
get = binding2.get;
value(Reflect.apply(get, binding2, []));
}
}
}
function SegmentedControlPagesOnMomentumEnd({contentOffset, contentSize}) { // fn#69103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:9375, owner: SegmentedControlPages.onMomentumEnd, offset: 0x01c68e28, size: 201 bytes, params: 2, frame: 20
var value3;
var moduleValue;
var roundIfClose;
var x;
var value6;
var moduleValue2;
if (scrollTarget.get() !== -1) {
value3 = environment.__proto__;
moduleValue = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue.roundIfClose;
x = contentOffset.x;
scrollTargetBinding = scrollTarget;
if (Reflect.apply(roundIfClose, moduleValue, [x - scrollTargetBinding.get(), 0.0001]) === 0) {
scrollTarget.set(-1);
} else {
value6 = scrollTarget.get();
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(env0_18)(value6);
}
}
env0_19(contentOffset, contentSize);
}
function SegmentedControlPagesOnScroll(a0) { // fn#69104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:9735, owner: SegmentedControlPages.onScroll, offset: 0x01c68ef1, size: 458 bytes, params: 2, frame: 20
var scrollOverflowBinding;
var scrollTargetBinding;
var value8;
var moduleValue2;
var roundIfClose;
const contentOffset = a0.contentOffset;
const contentSize = a0.contentSize;
if (contentSize.width !== 0) {
var binding = env0_13;
var value2 = binding.get();
var x = contentOffset.x;
if (value2 === x) {
return undefined;
}
binding = env0_13;
var set = binding.set;
x = contentOffset.x;
Reflect.apply(set, binding, [x]);
if (onScrollWorklet != null) {
onScrollWorklet(a0);
}
var Math = global.Math;
var round = Math.round;
var value3 = Reflect.apply(round, Math, [length * pageWidth]);
Math = global.Math;
round = Math.round;
if (value3 % Reflect.apply(round, Math, [contentSize.width]) == 0) {
x = contentOffset.x;
if (x < 0) {
scrollOverflowBinding = scrollOverflow;
scrollOverflowBinding.set(contentOffset.x);
} else if (contentOffset.x > contentSize.width - pageWidth) {
scrollOverflowBinding = scrollOverflow;
scrollOverflowBinding.set(contentOffset.x - (contentSize.width - pageWidth));
} else {
scrollOverflow.set(0);
}
if (scrollTarget.get() === -1) {
env0_19(contentOffset, contentSize);
return undefined;
}
value8 = environment.__proto__;
moduleValue2 = require(8862) /* metro dependency 8862: MathUtils */;
roundIfClose = moduleValue2.roundIfClose;
x = contentOffset.x;
scrollTargetBinding = scrollTarget;
if (Reflect.apply(roundIfClose, moduleValue2, [x - scrollTargetBinding.get(), 0.0001]) !== 0) {
return undefined;
}
scrollTarget.set(-1);
env0_19(contentOffset, contentSize);
return undefined;
}
var value5 = activeIndex.get() * pageWidth;
var moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(env0_18)(value5);
}
}
function _fun69106() { // fn#69106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10414, offset: 0x01c690d1, size: 52 bytes, params: 1, frame: 13
const value2 = env0_10.get();
const value3 = 0;
return {x: (value2 ?? value3) * pageWidth, y: value3};
}
function useFrozenPageIndices(a0, a1) { // fn#69107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10477, owner: SegmentedControlPages.useFrozenPageIndices, offset: 0x01c69105, size: 237 bytes, params: 3, frame: 22
var environment;
const env0_0 = a0;
const env0_1 = a1;
const value = environment.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useSharedValue = reanimatedRexportModule.useSharedValue;
let get = a0.get;
const value2 = Reflect.apply(useSharedValue, reanimatedRexportModule, [Reflect.apply(get, a0, [])]);
const moduleValue2 = reanimatedRexportModule;
useSharedValue = moduleValue2.useSharedValue;
get = a0.get;
const value3 = Reflect.apply(useSharedValue, moduleValue2, [Reflect.apply(get, a0, [])]);
const binding = env1_4;
const useCallback = binding.useCallback;
const closure = useFrozenPageIndicesU;
closure.__closure = {activePageRangeStart: value2, activePageRangeEnd: value3};
closure.__workletHash = 12915998789021;
closure.__initData = env1_24;
const env0_4 = Reflect.apply(useCallback, binding, [closure, [value3, value2]]);
reanimatedRexportModule.useAnimatedReaction(_fun69109(), _fun69111());
return [value2, value3];
}
function SegmentedControlPagesSe() { // fn#69113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11614, owner: SegmentedControlPages.se, offset: 0x01c69377, size: 96 bytes, params: 1, frame: 15
var r0;
var value4;
var moduleValue;
const value2 = scrollTarget.get();
const value3 = -1;
if (value3 === value2) {
r0 = value3;
} else {
value4 = environment.__proto__;
moduleValue = require(8862) /* metro dependency 8862: MathUtils */;
r0 = moduleValue.roundIfClose(scrollTarget.get() / pageWidth, 0.0001);
}
return r0;
}
function SegmentedControlPagesLe() { // fn#69114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11847, owner: SegmentedControlPages.le, offset: 0x01c693d7, size: 129 bytes, params: 1, frame: 17
var r1;
var r2;
var value5;
const value2 = env0_10.get();
let Math = global.Math;
const value3 = Math.floor(value2);
Math = global.Math;
const value4 = Math.ceil(value2);
let value = env0_23.get();
if (value === -1) {
r1 = value4;
r2 = value3;
} else {
Math = global.Math;
value5 = Math.min(value3, value);
Math = global.Math;
value = Math.max(value4, value);
r1 = value;
r2 = value5;
}
return [r2, r1];
}
function SegmentedControlPagesIe(a0, a1) { // fn#69115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:12075, owner: SegmentedControlPages.ie, offset: 0x01c69458, size: 71 bytes, params: 3, frame: 13
if (!(a1 != null && a1[0] === a0[0] && a1[1] === a0[1])) {
visiblePageRange.set(a0);
}
}
function _fun69116(a0, a1) { // fn#69116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:12604, offset: 0x01c6949f, size: 94 bytes, params: 3, frame: 16
return (
<SegmentedControlPage
index={a1}
activePageRangeStart={env0_21}
activePageRangeEnd={env0_22}
reportedPageIndex={env0_11}
pageIndex={env0_10}
scrollTargetPageIndex={env0_23}
style={env0_20}
item={a0}
key={a1}
/>
);
}
function useFrozenPageIndicesU(a0, a1) { // fn#69108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10603, owner: SegmentedControlPages.useFrozenPageIndices.u, offset: 0x01c691f2, size: 95 bytes, params: 3, frame: 17
let binding = env0_2;
let set = binding.set;
let Math = global.Math;
Reflect.apply(set, binding, [Math.min(binding.get(), a0)]);
binding = env0_3;
set = binding.set;
Math = global.Math;
Reflect.apply(set, binding, [Math.max(binding.get(), a1)]);
}
function _fun69109() { // fn#69109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10826, offset: 0x01c69251, size: 69 bytes, params: 1, frame: 4
const closure = SegmentedControlPagesNativeTsx19;
closure.__closure = {activeIndex: env0_0, pressedIndex: require};
closure.__workletHash = 12859889409680;
closure.__initData = env2_25;
return closure;
}
function _fun69111() { // fn#69111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11147, offset: 0x01c692c1, size: 62 bytes, params: 1, frame: 3
const closure = SegmentedControlPagesNativeTsx20;
closure.__closure = {expandActivePageRange: env0_4};
closure.__workletHash = 8613036130189;
closure.__initData = env2_26;
return closure;
}
function SegmentedControlPagesNativeTsx19() { // fn#69110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:10874, offset: 0x01c69296, size: 43 bytes, params: 1, frame: 11
const object2 = {};
object2.activeIndex = env1_0.get();
object2.pressedIndex = require.get();
return object2;
}
function SegmentedControlPagesNativeTsx20({activeIndex, pressedIndex}) { // fn#69112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9046:11195, offset: 0x01c692ff, size: 120 bytes, params: 2, frame: 16
var r4;
var r5;
var Math;
var value;
if (pressedIndex === -1) {
r4 = activeIndex;
r5 = activeIndex;
} else {
Math = global.Math;
value = Math.min(activeIndex, pressedIndex);
Math = global.Math;
r4 = Math.max(activeIndex, pressedIndex);
r5 = value;
}
value = environment.__proto__;
const binding = env1_4;
Math = global.Math;
value = Math.floor(r5);
Math = global.Math;
binding(value, Math.ceil(r4));
}
@@ -0,0 +1,118 @@
/* Metro module 8853; source: design/components/SegmentedControl/native/SegmentedControlState.native.tsx; dependencies: [31, 697, 3875, 4017, 4081, 2] */
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');
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 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;
}