174 lines
11 KiB
TypeScript
174 lines
11 KiB
TypeScript
/* Metro module 15416; source: modules/soundboard/native/SoundboardSoundPicker.tsx; dependencies: [57, 31, 27, 15417, 4294, 1878, 15418, 661, 33, 4501, 697, 4017, 632, 15419, 6948, 5463, 6771, 6789, 8742, 480, 477, 8575, 6275, 4027, 4573, 1244, 6984, 15422, 15430, 15431, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import RTCConnectionStore from '../../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */
|
|
import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */
|
|
import UseTrackImpression from '../../app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
|
|
import UseSoundGrid from '../useSoundGrid.tsx'; /* Metro dependency 15419 */
|
|
import SoundboardSoundPickerCategories from './SoundboardSoundPickerCategories.tsx'; /* Metro dependency 15431 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as AnalyticsUtilsModule from '../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
|
|
import * as UseAnalyticsLocationsModule from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import * as SearchSoundsModule from '../searchSounds.tsx'; /* Metro dependency 6948 */
|
|
import * as SearchFieldNativeModule from '../../../design/components/TextField/native/SearchField.native.tsx'; /* Metro dependency 6984 */
|
|
import * as ExpressionPickerStoreModule from '../../expression_picker/ExpressionPickerStore.tsx'; /* Metro dependency 15417 */
|
|
import * as SoundboardStyleConstantsModule from './SoundboardStyleConstants.tsx'; /* Metro dependency 15418 */
|
|
import * as UseSoundGridModule from '../useSoundGrid.tsx'; /* Metro dependency 15419 */
|
|
import * as SoundboardSoundPickerListModule from './SoundboardSoundPickerList.tsx'; /* Metro dependency 15422 */
|
|
|
|
function _fun117920(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:6, offset: 0x024c5246, size: 422 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const SOUND_ROW_HORIZONTAL_PADDING = (SoundboardStyleConstantsModule).SOUND_ROW_HORIZONTAL_PADDING;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
const object2 = {paddingHorizontal: SOUND_ROW_HORIZONTAL_PADDING};
|
|
const PX_8 = (Native).space.PX_8;
|
|
object2.padding = PX_8;
|
|
object2.width = '100%';
|
|
const env0_13 = Reflect.apply(createStyles, CreateStylesModule, [{title: {marginBottom: 8}, container: {'flex': 1,
|
|
'alignItems': 'center'}, header: object2, body: {'flex': 1, 'width': '100%'}}]);
|
|
value = value.memo(_fun117921);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/soundboard/native/SoundboardSoundPicker.tsx');
|
|
exports.default = value;
|
|
function _fun117921({channel, analyticsSource}) { // fn#117921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:505, offset: 0x024c53ec, size: 1332 bytes, params: 2, frame: 44
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
let useState = binding.useState;
|
|
const value3 = Reflect.apply(useState, binding, [0]);
|
|
const binding2 = env0_3;
|
|
const value4 = binding2(value3, 2);
|
|
const property = value4[0];
|
|
const property2 = value4[1];
|
|
const value5 = binding.useRef(null);
|
|
const value6 = (ReanimatedRexportModule).useSharedValue(0);
|
|
const currentUser = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([UserStore],
|
|
function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const mediaSessionId = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([RTCConnectionStore],
|
|
function() {
|
|
return RTCConnectionStore.getMediaSessionId();
|
|
});
|
|
const {categories, availableSounds} = (UseSoundGrid)(channel,
|
|
{filterOutEmptyCurrentGuild: true});
|
|
const value8 = useExpressionPickerStore(function(a0) {
|
|
return a0.searchQuery;
|
|
});
|
|
useState = binding.useState;
|
|
const value9 = binding2(Reflect.apply(useState, binding, [SearchSoundsModule.searchSounds(value8, availableSounds,
|
|
currentUser, channel)]), 2);
|
|
const property3 = value9[0];
|
|
var env0_3 = value9[1];
|
|
const value10 = (UseSoundGridModule).useSearchCategories(categories,
|
|
property3, value8);
|
|
const insets = (UseSafeAreaInsetsKeyboardAwareNative)({isKeyboardAwareOnAndroid: false}).insets;
|
|
const defaultImport3 = UseAnalyticsLocations;
|
|
const SOUNDBOARD_ACTION_SHEET = (AnalyticsLocation).SOUNDBOARD_ACTION_SHEET;
|
|
const analyticsLocations = defaultImport3(SOUNDBOARD_ACTION_SHEET).analyticsLocations;
|
|
const value11 = binding.useCallback(_fun117925, [channel, currentUser, availableSounds]);
|
|
const defaultImport4 = UseTrackImpression;
|
|
object = {};
|
|
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
|
|
const HALFSHEET = ImpressionTypes.HALFSHEET;
|
|
object.type = HALFSHEET;
|
|
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
|
|
const SOUNDBOARD_POPOUT = ImpressionNames.SOUNDBOARD_POPOUT;
|
|
object.name = SOUNDBOARD_POPOUT;
|
|
object.properties = {source: analyticsSource, guild_id: channel.guild_id, media_session_id: mediaSessionId};
|
|
defaultImport4(object);
|
|
const value12 = (ReanimatedRexportModule).useSharedValue(-1);
|
|
const value13 = (ReanimatedRexportModule).useSharedValue(false);
|
|
const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider;
|
|
const r5 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && ((Component) => <Component animatedSheetIndex={value12} portalHostName="soundboard-footer" />)(importDefault(8575) /* metro dependency 8575: PortalKeyboardFooterIOSIos */);
|
|
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
|
|
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
|
|
const r8 = (
|
|
platformUtilsModule.isAndroid()
|
|
? ((PortalHost) => <PortalHost name="soundboard-footer" />)((require(4027) /* metro dependency 4027 */).PortalHost)
|
|
: undefined
|
|
);
|
|
const Text = (TextModule).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const ABjMWI = (require(1244) /* metro dependency 1244: indexNative */).t.ABjMWI;
|
|
const items2 = [
|
|
<Text
|
|
accessibilityRole="header"
|
|
variant="heading-lg/bold"
|
|
style={styles.title}
|
|
>
|
|
{Reflect.apply(string, intl, [ABjMWI])}
|
|
</Text>,
|
|
];
|
|
const SearchField = (SearchFieldNativeModule).SearchField;
|
|
items2[1] = (
|
|
<View style={styles.header}>
|
|
<SearchField
|
|
size="md"
|
|
placeholder={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.sKt3xS)}
|
|
onChange={value11}
|
|
/>
|
|
</View>
|
|
);
|
|
const SoundboardSoundPickerList = (SoundboardSoundPickerListModule).SoundboardSoundPickerList;
|
|
const value17 = EXPRESSION_FOOTER_HEIGHT + insets.bottom;
|
|
const PX_16 = (Native).space.PX_16;
|
|
items2[2] = (
|
|
<View style={styles.body}>
|
|
<SoundboardSoundPickerList
|
|
listRef={value5}
|
|
channel={channel}
|
|
insetBottom={value17 + PX_16}
|
|
scrollPosition={value6}
|
|
setCategoryIndex={property2}
|
|
categories={value10}
|
|
shouldShowPremiumUpsell={value13}
|
|
/>
|
|
</View>
|
|
);
|
|
items2[3] = ((Component) => <Component shouldShow={value13} />)(importDefault(15430) /* metro dependency 15430: PremiumSoundboardFeatureUpsell */);
|
|
return (
|
|
<AnalyticsLocationProvider value={analyticsLocations}>
|
|
{r5}
|
|
<BottomSheet
|
|
animatedIndex={value12}
|
|
scrollable
|
|
startExpanded
|
|
footer={r8}
|
|
>
|
|
<View style={styles.container}>
|
|
{items2}
|
|
</View>
|
|
{((Component) => <Component guildId={channel.guild_id} listRef={value5} categories={categories} categoryIndex={property} />)(SoundboardSoundPickerCategories)}
|
|
</BottomSheet>
|
|
</AnalyticsLocationProvider>
|
|
);
|
|
function _fun117925(a0) { // fn#117925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15613:1098, offset: 0x024c593e, size: 79 bytes, params: 2, frame: 19
|
|
let value = environment.__proto__;
|
|
setSearchQuery(a0);
|
|
const binding = env0_3;
|
|
value = require(6948) /* metro dependency 6948: searchSounds */;
|
|
binding(value.searchSounds(a0, availableSounds, currentUser, channel));
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117920, 15416, [57, 31, 27, 15417, 4294, 1878, 15418, 661, 33, 4501, 697, 4017, 632, 15419, 6948,
|
|
5463, 6771, 6789, 8742, 480, 477, 8575, 6275, 4027, 4573, 1244, 6984, 15422, 15430, 15431,
|
|
2]) /* metro module 15416, dependencies: [57, 31, 27, 15417, 4294, 1878, 15418, 661, 33, 4501, 697, 4017, 632, 15419, 6948, 5463, 6771, 6789, 8742, 480, 477, 8575, 6275, 4027, 4573, 1244, 6984, 15422, 15430, 15431, 2] */;
|