/* Metro module 14394; source: modules/guilds_bar/native/GuildsBarGuildFolder.tsx; dependencies: [31, 5214, 1867, 3969, 4896, 14384, 14390, 14385, 33, 4501, 697, 3860, 566, 6819, 1357, 4577, 4000, 673, 8141, 4017, 4508, 6650, 8366, 5475, 14395, 14397, 8866, 14405, 4081, 6593, 6821, 14387, 14406, 2] */ import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import MobileVisualRefreshExperiment from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import SelectedGuildStore from '../../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */ import SortedGuildStore from '../../../stores/SortedGuildStore.tsx'; /* Metro dependency 4896 */ import GuildReadStateStore from '../../../stores/GuildReadStateStore.tsx'; /* Metro dependency 5214 */ import GuildActionCreators from '../../../actions/GuildActionCreators.tsx'; /* Metro dependency 6593 */ import GuildIcon from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */ import ReanimatedNativeView from '../../core/native/ReanimatedNativeView.tsx'; /* Metro dependency 8141 */ import GuildsBarAnimatedItemWrapper from './GuildsBarAnimatedItemWrapper.tsx'; /* Metro dependency 14395 */ import UseGuildsBarBottomRightBadge from './hooks/useGuildsBarBottomRightBadge.tsx'; /* Metro dependency 14397 */ import IsGuildsBarGuildLabelEqual from './utils/isGuildsBarGuildLabelEqual.tsx'; /* Metro dependency 14405 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as ColorUtilsModule from '../../../external/discord_common/js/shared/utils/ColorUtils.tsx'; /* Metro dependency 673 */ import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */ import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import * as HapticUtilsNativeModule from '../../haptics/HapticUtils.native.tsx'; /* Metro dependency 4081 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as TransitionGroupModule from '../../../design/components/TransitionGroup/TransitionGroup.tsx'; /* Metro dependency 4508 */ import * as SpringModule from '../../../design/animation/reanimated/spring/spring.tsx'; /* Metro dependency 4577 */ import * as SortedGuildStoreModule from '../../../stores/SortedGuildStore.tsx'; /* Metro dependency 4896 */ import * as GuildIconModule from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */ import * as GuildsBarDnDStoreModule from './GuildsBarDnDStore.tsx'; /* Metro dependency 14384 */ import * as GuildsBarConstantsModule from './GuildsBarConstants.tsx'; /* Metro dependency 14385 */ import * as GuildsBarFolderMenuItemsModule from './GuildsBarFolderMenuItems.tsx'; /* Metro dependency 14387 */ import * as GuildsBarConstantsModule2 from '../GuildsBarConstants.tsx'; /* Metro dependency 14390 */ import * as GuildsBarAnimatedItemWrapperModule from './GuildsBarAnimatedItemWrapper.tsx'; /* Metro dependency 14395 */ function _fun108978(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:6, offset: 0x02337985, size: 531 bytes, params: 8, frame: 19 const env0_0 = require; const _arrayLikeToArray_108981 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const getItemKey_108988 = function(a0) { return a0.type; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; let value4 = JsxRuntimeModule; const env0_14 = value4.jsx; const env0_15 = value4.jsxs; const env0_16 = (CreateStylesModule).createStyles(_fun108992); object = {code: "function GuildsBarGuildFolderTsx1(values){const{withSpring,TRANSITION_PHYSICS}=this.__closure;return{animations:{height:withSpring(values.targetHeight,TRANSITION_PHYSICS,'animate-always')},initialValues:{height:values.currentHeight}};}"}; const value6 = value.memo(FolderBGInner); object = {code: 'function GuildsBarGuildFolderTsx2(){const{withSpring,visible,FOLDER_SPRING_PHYSICS,state,TransitionStates,runOnJS,cleanUp,fromTop,guildItemSize}=this.__closure;return{opacity:withSpring(visible.get(),FOLDER_SPRING_PHYSICS,undefined,function(finished){if(finished&&state===TransitionStates.YEETED)runOnJS(cleanUp)();}),transform:[{translateY:withSpring(visible.get()===1?0:fromTop?-guildItemSize:guildItemSize,FOLDER_SPRING_PHYSICS)},{scale:withSpring(visible.get()===1?1:fromTop?0.3:1.3,FOLDER_SPRING_PHYSICS)}]};}'}; object = {code: 'function GuildsBarGuildFolderTsx3(finished){const{state,TransitionStates,runOnJS,cleanUp}=this.__closure;if(finished&&state===TransitionStates.YEETED)runOnJS(cleanUp)();}'}; object = {code: 'function GuildsBarGuildFolderTsx4(values){const{dragDropInProgress,sharedId,id,isDragTarget,withSpring,TRANSITION_PHYSICS}=this.__closure;var _id;const shouldAnimate=dragDropInProgress.get()&&sharedId.get()===""+id&&!isDragTarget;sharedId.set(""+((_id=id)!==null&&_id!==void 0?_id:null));return{animations:{originY:shouldAnimate?withSpring(values.targetOriginY,TRANSITION_PHYSICS,\'animate-always\'):values.targetOriginY,height:shouldAnimate?withSpring(values.targetHeight,TRANSITION_PHYSICS,\'animate-always\'):values.targetHeight},initialValues:{originY:values.currentOriginY,height:values.currentHeight}};}'}; value = value.memo(GuildsBarGuildFolder); (FileImportTrackerModule).fileFinishedImporting('modules/guilds_bar/native/GuildsBarGuildFolder.tsx'); exports.default = value; exports.GuildsBarGuildFolderBG = value6; function _createForOfIteratorHelperLoose_108979(a0, a1) { // fn#108979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:357, offset: 0x02337b98, size: 372 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun108980; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_108981(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_108981(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_108981(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun108980; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); function _fun108980() { // fn#108980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:928, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return env0_1 >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]}; } } function MiniGuildIcon({guildId, position, selected}) { // fn#108982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:2364, offset: 0x02337d0c, size: 336 bytes, params: 2, frame: 23 const useToken = UseTokenModule.useToken; const GUILD_BAR_ITEM_SIZE = (Native).modules.mobile.GUILD_BAR_ITEM_SIZE; const styles = useStyles(false, Reflect.apply(useToken, UseTokenModule, [GUILD_BAR_ITEM_SIZE])); const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() { return GuildStore.getGuild(guildId); }); const r9 = position === 0 ? styles.guildPreview0 : position === 1 ? styles.guildPreview1 : position === 2 ? styles.guildPreview2 : position !== 3 ? undefined : styles.guildPreview3; const items2 = [styles.guildPreviewIcon]; items2[1] = selected ? undefined : styles.guildPreviewIconUnselected; items2[2] = r9; const GuildIconSizes = (GuildIconModule).GuildIconSizes; const XXSMALL = GuildIconSizes.XXSMALL; return ( ); } function TransitionWrapper({children, fromTop, cleanUp, state}) { // fn#108984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:4767, offset: 0x02337e5c, size: 471 bytes, params: 2, frame: 28 fromTop = !(fromTop === undefined) && fromTop; const value2 = (MobileVisualRefreshExperiment)('GuildsBarGuildFolder'); const useToken = UseTokenModule.useToken; const GUILD_BAR_ITEM_SIZE = (Native).modules.mobile.GUILD_BAR_ITEM_SIZE; const value3 = Reflect.apply(useToken, UseTokenModule, [GUILD_BAR_ITEM_SIZE]); const env0_3 = value3; const styles = useStyles(value2, value3); const useSharedValue = ReanimatedRexportModule.useSharedValue; const TransitionStates = (TransitionGroupModule).TransitionStates; const MOUNTED = TransitionStates.MOUNTED; const value6 = Reflect.apply(useSharedValue, ReanimatedRexportModule, [state !== MOUNTED ? 0 : 1]); const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle; const TransitionWrapperA2 = TransitionWrapperA; const object = {}; object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring; object.visible = value6; object.FOLDER_SPRING_PHYSICS = FOLDER_SPRING_PHYSICS; object.state = state; object.TransitionStates = TransitionStates; object.runOnJS = ReanimatedRexportModule.runOnJS; object.cleanUp = cleanUp; object.fromTop = fromTop; object.guildItemSize = value3; TransitionWrapperA2.__closure = object; TransitionWrapperA2.__workletHash = 14426547532118; TransitionWrapperA2.__initData = env0_19; const value7 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [TransitionWrapperA2]); env0_3.useEffect(_fun108987, [state, value6]); return ((Component) => {children})(ReanimatedNativeView); function TransitionWrapperA() { // fn#108985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:5059, owner: TransitionWrapper.a, offset: 0x02338033, size: 354 bytes, params: 1, frame: 25 const object = {}; let withSpring = SpringModule.withSpring; let binding = env0_4; let get = binding.get; const value3 = Reflect.apply(get, binding, []); const aE2 = aE; const object2 = {}; object2.state = state; const TransitionStates = (TransitionGroupModule).TransitionStates; object2.TransitionStates = TransitionStates; object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS; object2.cleanUp = cleanUp; aE2.__closure = object2; aE2.__workletHash = 47605595424; aE2.__initData = env1_20; object.opacity = Reflect.apply(withSpring, SpringModule, [value3, FOLDER_SPRING_PHYSICS, undefined, aE2]); withSpring = SpringModule.withSpring; const value4 = env0_4.get(); const value5 = 1; const items2 = [{translateY: Reflect.apply(withSpring, SpringModule, [value5 === value4 ? 0 : fromTop ? -env0_3 : env0_3, FOLDER_SPRING_PHYSICS])}]; withSpring = SpringModule.withSpring; binding = env0_4; get = binding.get; items2[1] = {scale: Reflect.apply(withSpring, SpringModule, [value5 === Reflect.apply(get, binding, []) ? value5 : fromTop ? 0.3 : 1.3, FOLDER_SPRING_PHYSICS])}; object.transform = items2; return object; function aE(a0) { // fn#108986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:5120, owner: TransitionWrapper.a.e, offset: 0x02338195, size: 107 bytes, params: 2, frame: 13 var r0; var stateBinding; var runOnJS; var value2; let value = a0; if (value) { value = environment.__proto__; stateBinding = state; value = environment.__proto__.__proto__; value = stateBinding === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED; r0 = value; } else { r0 = value; } if (r0) { value = environment.__proto__.__proto__; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; runOnJS = value.runOnJS; value2 = environment.__proto__; Reflect.apply(runOnJS, value, [cleanUp])(); } } } function _fun108987() { // fn#108987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:5742, offset: 0x02338200, size: 69 bytes, params: 1, frame: 14 const binding = env0_4; const set = binding.set; const stateBinding = state; const value = environment.__proto__; const TransitionStates = (TransitionGroupModule).TransitionStates; const YEETED = TransitionStates.YEETED; Reflect.apply(set, binding, [stateBinding !== YEETED ? 1 : 0]); } } function GuildFolderIcon({item}) { // fn#108989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:5900, offset: 0x02338245, size: 135 bytes, params: 2, frame: 17 var value; let r0 = importDefault(dependencyMap[14])('GuildFolderIcon') ? dependencyMap[21] : dependencyMap[22]; if (item.type !== 'icon') { r0 = null; } else { value = importDefault(dependencyMap[23]); value = ((Component) => )(value); r0 = value; } return r0; } function renderGuildFolderContent(a0, a1, a2, a3) { // fn#108990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:6056, offset: 0x023382cc, size: 167 bytes, params: 5, frame: 20 const env0_0 = a1; const type = a1.type; if (type === 'icon') { return ( ); } if (type === 'preview') { return ( {a1.guilds.map(_fun108991)} ); } function _fun108991(a0, a1) { // fn#108991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:6306, offset: 0x02338373, size: 121 bytes, params: 3, frame: 17 var r0; let value = a1; const r1 = value === 0 || value === 1 || (value === 2 || value === 3) ? value : undefined; value = null; if (value != a0) { if (value != r1) { value = environment.__proto__; value = ( ); r0 = value; } else { r0 = value; } } else { r0 = value; } return r0; } } function _fun108992() { // fn#108992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:1296, offset: 0x023383ec, size: 503 bytes, params: 1, frame: 18 const value = a1; const value2 = a2; const r6 = value !== undefined ? value : 48; const r8 = value2 !== undefined ? value2 : 0; const object = {}; const object2 = {position: 'absolute'}; const GUILD_BAR_ITEM_MARGIN = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_BAR_ITEM_MARGIN; object2.top = GUILD_BAR_ITEM_MARGIN; const GUILD_FOLDER_BACKGROUND_LEFT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_FOLDER_BACKGROUND_LEFT; object2.left = GUILD_FOLDER_BACKGROUND_LEFT; const GUILD_FOLDER_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.GUILD_FOLDER_BACKGROUND; object2.backgroundColor = GUILD_FOLDER_BACKGROUND; let GUILD_FOLDER_BACKGROUND_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_FOLDER_BACKGROUND_RADIUS; object2.borderTopLeftRadius = GUILD_FOLDER_BACKGROUND_RADIUS; GUILD_FOLDER_BACKGROUND_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_FOLDER_BACKGROUND_RADIUS; object2.borderTopRightRadius = GUILD_FOLDER_BACKGROUND_RADIUS; GUILD_FOLDER_BACKGROUND_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_FOLDER_BACKGROUND_RADIUS; object2.borderBottomLeftRadius = GUILD_FOLDER_BACKGROUND_RADIUS; GUILD_FOLDER_BACKGROUND_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_FOLDER_BACKGROUND_RADIUS; object2.borderBottomRightRadius = GUILD_FOLDER_BACKGROUND_RADIUS; object2.width = r6 + r8; object.folderBackground = object2; object.folderScaleContainer = {'position': 'absolute', 'top': 0, 'left': 0, 'width': null, 'height': null, 'justifyContent': 'center', 'alignItems': 'center', width: r6, height: r6}; const GUILD_FOLDER_PREVIEW_ICON_MARGIN = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_FOLDER_PREVIEW_ICON_MARGIN; object.guildPreviewIcon = {position: 'absolute', margin: GUILD_FOLDER_PREVIEW_ICON_MARGIN}; const object5 = {}; object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm; object.guildPreviewIconUnselected = object5; object.guildPreview0 = {'top': 0, 'left': 0}; object.guildPreview1 = {'top': 0, 'right': 0}; object.guildPreview2 = {'bottom': 0, 'left': 0}; object.guildPreview3 = {'bottom': 0, 'right': 0}; const object6 = {position: 'absolute', width: r6, height: r6}; const GUILD_FOLDER_PREVIEW_OPACITY = (importDefault(697) /* metro dependency 697: native */).modules.mobile.GUILD_FOLDER_PREVIEW_OPACITY; object6.opacity = GUILD_FOLDER_PREVIEW_OPACITY; object.guildPreviewWrapper = object6; return object; } function FolderBGInner({folderId, totalItems, color}) { // fn#108993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:3118, offset: 0x023385e3, size: 542 bytes, params: 2, frame: 26 const value2 = (MobileVisualRefreshExperiment)('GuildsBarGuildFolder'); let useToken = UseTokenModule.useToken; const GUILD_BAR_ITEM_SIZE = (Native).modules.mobile.GUILD_BAR_ITEM_SIZE; const value3 = Reflect.apply(useToken, UseTokenModule, [GUILD_BAR_ITEM_SIZE]); useToken = UseTokenModule.useToken; const GUILD_BAR_ITEM_MARGIN = (Native).modules.mobile.GUILD_BAR_ITEM_MARGIN; const value4 = Reflect.apply(useToken, UseTokenModule, [GUILD_BAR_ITEM_MARGIN]); useToken = UseTokenModule.useToken; const GUILD_FOLDER_BACKGROUND_WIDTH_OFFSET = (Native).modules.mobile.GUILD_FOLDER_BACKGROUND_WIDTH_OFFSET; const styles = useStyles(value2, value3, Reflect.apply(useToken, UseTokenModule, [GUILD_FOLDER_BACKGROUND_WIDTH_OFFSET])); const value9 = value3 + (value2 ? value4 : 0) + (value3 + 2 * value4) * totalItems + useFolderBGHeightOffset(folderId); const binding = env0_3; const useCallback = binding.useCallback; const closure = function(a0) { var object2 = {}; object2.height = require(dependencyMap[15]).withSpring(a0.targetHeight, TRANSITION_PHYSICS, 'animate-always'); return {animations: object2, initialValues: {height: a0.currentHeight}}; }; const object = {}; object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring; object.TRANSITION_PHYSICS = TRANSITION_PHYSICS; closure.__closure = object; closure.__workletHash = 2519256682742; closure.__initData = env0_17; const value10 = Reflect.apply(useCallback, binding, [closure, []]); useToken = UseTokenModule.useToken; const GUILD_FOLDER_COLOR_OPACITY = (Native).modules.mobile.GUILD_FOLDER_COLOR_OPACITY; return ((Component) => )(ReanimatedNativeView); function _fun108995() { // fn#108995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:3836, offset: 0x02338859, size: 112 bytes, params: 1, frame: 17 var colorBinding; var value2; var moduleValue; var hexWithOpacity; var moduleValue2; if (env0_1) { if (color == null) { return undefined; } colorBinding = color; value2 = environment.__proto__; if (colorBinding !== DEFAULT_FOLDER_COLOR) { moduleValue = require(4000) /* metro dependency 4000: ColorUtils */; hexWithOpacity = moduleValue.hexWithOpacity; moduleValue2 = require(673) /* metro dependency 673: ColorUtils */; return {backgroundColor: Reflect.apply(hexWithOpacity, moduleValue, [moduleValue2.int2hex(color), env0_2])}; } } } } function GuildsBarGuildFolder({id, expanded, name, color, childNodes, isDragPreview, foldersChanged}) { // fn#108996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:7162, offset: 0x023388c9, size: 1243 bytes, params: 2, frame: 47 const color2 = color; isDragPreview = !(isDragPreview === undefined) && isDragPreview; const value2 = (MobileVisualRefreshExperiment)('GuildsBarGuildFolder'); const useToken = UseTokenModule.useToken; const GUILD_BAR_ITEM_SIZE = (Native).modules.mobile.GUILD_BAR_ITEM_SIZE; const styles = useStyles(value2, Reflect.apply(useToken, UseTokenModule, [GUILD_BAR_ITEM_SIZE])); const value4 = (GuildsBarAnimatedItemWrapperModule).useGuildsBarAnimatedWrapperStyles({disableSelectedColor: true, disableBGColor: value2}); const {unread, mentionCount, isMentionLowImportance} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildReadStateStore], function() { if (expanded) { return {'unread': false, 'mentionCount': 0, 'isMentionLowImportance': false}; } var env0_0 = GuildReadStateStore.getMutableGuildStates(); return childNodes.reduce(_fun108998, {'unread': false, 'mentionCount': 0, 'isMentionLowImportance': true}); }); const {selectedPreviewId, hasGuildSelected} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([SelectedGuildStore, SortedGuildStore], _fun108999, [expanded, id, childNodes]); const {badge, cutouts} = (UseGuildsBarBottomRightBadge)({mentionCount: mentionCount, isMentionLowImportance: isMentionLowImportance}); const fluxModule = require(566) /* metro dependency 566: flux */; const useStateFromStores = fluxModule.useStateFromStores; const label = Reflect.apply(useStateFromStores, fluxModule, [[GuildStore], _fun109000, [name, childNodes], IsGuildsBarGuildLabelEqual]).label; let binding = color2; const {tintStyle, folderPreviewStyle} = binding.useMemo(_fun109001, [color]); const value9 = color2.useMemo(function() { return {onPress: _fun109003}; }, [id, foldersChanged]); const value10 = color2.useMemo(_fun109004, [expanded, childNodes, tintStyle, selectedPreviewId]); binding = color2; let useCallback = binding.useCallback; const value11 = Reflect.apply(useCallback, binding, [_fun109005, [expanded, styles.guildPreviewWrapper, folderPreviewStyle]]); const {isDragTarget, dragState, overState, itemSize, dragDropInProgress} = useItemDragState(id, isDragPreview); const {accessibilityActions, onAccessibilityAction} = color2.useMemo(_fun109006, [id]); const value14 = (ReanimatedRexportModule).useSharedValue('' + id); binding = color2; useCallback = binding.useCallback; const GuildsBarGuildFolderW2 = GuildsBarGuildFolderW; object = {dragDropInProgress: dragDropInProgress, sharedId: value14, id: id, isDragTarget: isDragTarget}; object.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring; object.TRANSITION_PHYSICS = TRANSITION_PHYSICS; GuildsBarGuildFolderW2.__closure = object; GuildsBarGuildFolderW2.__workletHash = 11967845900199; GuildsBarGuildFolderW2.__initData = env0_21; const value15 = Reflect.apply(useCallback, binding, [GuildsBarGuildFolderW2, [id, value14, isDragTarget, dragDropInProgress]]); const guildsBarAnimatedItemWrapperProps = {id: '' + id, draggedItemSize: itemSize, accessibilityActions: accessibilityActions, onAccessibilityAction: onAccessibilityAction, selected: hasGuildSelected, unread: !expanded && unread, circle: false, styles: value4, label: label, isDragTarget: isDragTarget, dragState: dragState, sharedId: value14, cutouts: cutouts, config: value9, isDragPreview: isDragPreview, overState: overState, preventClipping: true, expanded: expanded, layout: value15, externalChildren: expanded ? isDragPreview ? badge : ((Component) => )(env0_18) : badge, expandedChildren: ((Component) => )(importDefault(14406) /* metro dependency 14406: HomeDrawerFolderRow */)}; const TransitionGroup = (TransitionGroupModule).TransitionGroup; return ( ); function _fun108997() { // fn#108997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:7523, offset: 0x02338da4, size: 88 bytes, params: 1, frame: 13 if (expanded) { return {'unread': false, 'mentionCount': 0, 'isMentionLowImportance': false}; } const env0_0 = GuildReadStateStore.getMutableGuildStates(); return childNodes.reduce(_fun108998, {'unread': false, 'mentionCount': 0, 'isMentionLowImportance': true}); function _fun108998(a0, a1) { // fn#108998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:7641, offset: 0x02338dfc, size: 202 bytes, params: 3, frame: 10 var highImportanceMentionCount; var r2; var r4; var r1; var binding; var property; var value2; var value3; let id = a1.id; if (id != null) { binding = env0_0; id = a1.id; property = binding[id]; value2 = undefined; highImportanceMentionCount = property == null ? value2 : property.highImportanceMentionCount; value3 = 0; r2 = highImportanceMentionCount ?? value3; binding = env0_0; id = a1.id; property = binding[id]; a0.mentionCount = a0.mentionCount + r2 + ((property == null ? value2 : property.lowImportanceMentionCount) ?? value3); r4 = a0.unread || (env0_0[a1.id] == null ? value2 : env0_0[a1.id].unread); r1 = r4 != null && r4; a0.unread = r1; r1 = a0.isMentionLowImportance && value3 === r2; a0.isMentionLowImportance = r1; } return a0; } } function _fun108999() { // fn#108999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:8145, offset: 0x02338ec6, size: 182 bytes, params: 1, frame: 19 var r5; var r8; var r2; var r1; var value8; var id2; var value9; var value10; let value = environment.__proto__; const guildId = SelectedGuildStore.getGuildId(); const _createForOfIteratorHelperLoose_108979Binding = _createForOfIteratorHelperLoose_108979; const childNodesBinding = childNodes; const value4 = undefined; const value5 = _createForOfIteratorHelperLoose_108979Binding(childNodesBinding); const value6 = value5(); let done = value6.done; if (done) { r2 = value4; } else { r5 = value6; r8 = 0; while (true) { value8 = r5.value; id2 = value8.id; if (id2 === guildId) { r2 = guildId; break; } value9 = typeof r8 === 'bigint' ? r8 + 1n : +r8 + 1; if (value9 >= 4) { r2 = value4; break; } value10 = value5(); done = value10.done; if (done) { r2 = value4; break; } r5 = value10; r8 = value9; continue; } } const expandedBinding = expanded; const value11 = false; if (expandedBinding) { r1 = value11; } else if (guildId != null) { value = SortedGuildStore.getGuildsTree(); value = value.getNode(guildId); value = (value == null ? value4 : value.parentId) === id; r1 = value; } else { r1 = value11; } return {selectedPreviewId: r2, hasGuildSelected: r1}; } function _fun109000() { // fn#109000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:8584, offset: 0x02338f7c, size: 214 bytes, params: 1, frame: 21 var r2; var r7; var value6; var guildStoreBinding; var getGuild; var id; var value7; var push; var name2; var value8; var value9; let nameBinding = name; if (nameBinding != null) { nameBinding = name; return {count: 1, names: [nameBinding], label: nameBinding}; } const items2 = []; const value3 = _createForOfIteratorHelperLoose_108979(childNodes); const value4 = value3(); let done = value4.done; if (!done) { r2 = value4; r7 = 0; while (true) { value6 = r2.value; guildStoreBinding = GuildStore; getGuild = guildStoreBinding.getGuild; id = value6.id; value7 = Reflect.apply(getGuild, guildStoreBinding, [id]); if (value7 != null) { push = items2.push; name2 = value7.name; Reflect.apply(push, items2, [name2]); } value8 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1; if (value8 >= 3) { break; } value9 = value3(); done = value9.done; if (done) { break; } r2 = value9; r7 = value8; continue; } } const object = {names: items2}; childNodesBinding = childNodes; object.count = childNodesBinding.length; object.label = (require(8866) /* metro dependency 8866: ListUtils */).getListSummaryLabel(items2, childNodesBinding.length); return object; } function _fun109001() { // fn#109001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:8895, offset: 0x02339052, size: 86 bytes, params: 1, frame: 14 let value = environment.__proto__; value = ColorUtilsModule.int2hex(color ?? DEFAULT_FOLDER_COLOR); return {tintStyle: {tintColor: value}, folderPreviewStyle: {backgroundColor: value}}; } function _fun109002() { // fn#109002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:9065, offset: 0x023390a8, size: 17 bytes, params: 1, frame: 2 return {onPress: onPress_109003}; function onPress_109003() { // fn#109003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:9071, offset: 0x023390b9, size: 237 bytes, params: 1, frame: 16 var value2; var Set; var value3; var set; let foldersChangedBinding = foldersChanged; if (foldersChangedBinding != null) { value2 = foldersChanged.get(); if (value2.has('' + id)) { Set = global.Set; foldersChangedBinding = foldersChanged; value3 = foldersChangedBinding.get(); set = new Set(); set.add('' + id); foldersChangedBinding.set(set); } } const triggerHapticFeedback = HapticUtilsNativeModule.triggerHapticFeedback; const HapticFeedbackTypes = HapticUtilsNativeModule.HapticFeedbackTypes; const IMPACT_LIGHT = HapticFeedbackTypes.IMPACT_LIGHT; Reflect.apply(triggerHapticFeedback, HapticUtilsNativeModule, [IMPACT_LIGHT]); const defaultImport = GuildActionCreators; defaultImport.toggleGuildFolderExpand(id); } } function _fun109004() { // fn#109004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:9296, offset: 0x023391a6, size: 176 bytes, params: 1, frame: 18 var r3; var value5; var type; var GUILD; var push; var id; var length; var value6; if (expanded) { return [{type: 'icon', tintStyle: tintStyle}]; } const items2 = []; const value3 = _createForOfIteratorHelperLoose_108979(childNodes); const value4 = value3(); let done = value4.done; if (!done) { r3 = value4; reducibleLoop2: while (true) { value5 = r3.value; type = value5.type; GUILD = GuildsNodeType.GUILD; if (type === GUILD) { push = items2.push; id = value5.id; Reflect.apply(push, items2, [id]); length = items2.length; reducibleJoin4: while (true) { if (length >= 4) { break reducibleLoop2; } break reducibleJoin4; } } value6 = value3(); done = value6.done; if (done) { break reducibleLoop2; } r3 = value6; continue reducibleLoop2; } } return [{type: 'preview', guilds: items2, selectedGuildId: selectedPreviewId}]; } function _fun109005(a0) { // fn#109005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:9558, offset: 0x02339256, size: 127 bytes, params: 2, frame: 21 const value = environment.__proto__; const Fragment = env1_3.Fragment; return ( { [ ((Component) => )(importDefault(6821) /* metro dependency 6821: NativeView */), a0, ] } ); } function _fun109006() { // fn#109006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:9788, offset: 0x023392d5, size: 87 bytes, params: 1, frame: 13 var environment; let value = environment.__proto__; const getGuildFolderMenuItems = (GuildsBarFolderMenuItemsModule).getGuildFolderMenuItems; value = Reflect.apply(getGuildFolderMenuItems, value, [id]); const object = {}; object.accessibilityActions = value.map(function(a0) { return {name: a0.label, label: a0.label}; }); object.onAccessibilityAction = onAccessibilityAction_109008; return object; function onAccessibilityAction_109008(a0) { // fn#109008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:9907, offset: 0x0233932c, size: 68 bytes, params: 2, frame: 12 const env0_0 = a0; const value = env0_0.find(_fun109009); if (!(value == null || value.action == null)) { value.action(); } function _fun109009({label}) { // fn#109009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:9955, offset: 0x01c610f3, size: 33 bytes, params: 2, frame: 2 return label === env0_0.nativeEvent.actionName; } } } function GuildsBarGuildFolderW(a0) { // fn#109010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14591:10143, owner: GuildsBarGuildFolder.w, offset: 0x02339370, size: 304 bytes, params: 2, frame: 20 var r4; var moduleValue; var moduleValue2; var value; let r3 = dragDropInProgress.get() && GuildsBarConstantsModule.TRANSITION_PHYSICS.get() === '' + id && !isDragTarget; const set = GuildsBarConstantsModule.TRANSITION_PHYSICS.set; const idBinding = id; const value6 = null; Reflect.apply(set, GuildsBarConstantsModule.TRANSITION_PHYSICS, ['' + (value6 != idBinding ? id : value6)]); const object2 = {}; if (r3) { value = environment.__proto__; moduleValue = require(4577) /* metro dependency 4577: spring */; value = moduleValue.withSpring(a0.targetOriginY, TRANSITION_PHYSICS, 'animate-always'); r4 = value; } else { r4 = a0.targetOriginY; } object2.originY = r4; if (r3) { value = environment.__proto__; moduleValue2 = require(4577) /* metro dependency 4577: spring */; value = moduleValue2.withSpring(a0.targetHeight, TRANSITION_PHYSICS, 'animate-always'); r3 = value; } else { r3 = a0.targetHeight; } object2.height = r3; return {animations: object2, initialValues: {originY: a0.currentOriginY, height: a0.currentHeight}}; } } } global.__d(_fun108978, 14394, [31, 5214, 1867, 3969, 4896, 14384, 14390, 14385, 33, 4501, 697, 3860, 566, 6819, 1357, 4577, 4000, 673, 8141, 4017, 4508, 6650, 8366, 5475, 14395, 14397, 8866, 14405, 4081, 6593, 6821, 14387, 14406, 2]) /* metro module 14394, dependencies: [31, 5214, 1867, 3969, 4896, 14384, 14390, 14385, 33, 4501, 697, 3860, 566, 6819, 1357, 4577, 4000, 673, 8141, 4017, 4508, 6650, 8366, 5475, 14395, 14397, 8866, 14405, 4081, 6593, 6821, 14387, 14406, 2] */;