/* 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 ( {item.page} ); } 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) => {items3.map(_fun69116)})(binding); if (nativeGesture == null) { return binding2; } else { const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector; return ( {binding2} ); } } 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 ( ); } 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)); }