126 lines
8.7 KiB
TypeScript
126 lines
8.7 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] */
|
|
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});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
const expressionPickerStoreModule = require(15417) /* metro dependency 15417: ExpressionPickerStore */;
|
|
const env0_6 = expressionPickerStoreModule.setSearchQuery;
|
|
const env0_7 = expressionPickerStoreModule.useExpressionPickerStore;
|
|
const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const SOUND_ROW_HORIZONTAL_PADDING = (require(15418) /* metro dependency 15418: SoundboardStyleConstants */).SOUND_ROW_HORIZONTAL_PADDING;
|
|
const env0_10 = (require(661) /* metro dependency 661: Constants */).EXPRESSION_FOOTER_HEIGHT;
|
|
const value3 = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value3.jsx;
|
|
const env0_12 = value3.jsxs;
|
|
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = createStylesModule.createStyles;
|
|
const object = {paddingHorizontal: SOUND_ROW_HORIZONTAL_PADDING};
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object.padding = PX_8;
|
|
object.width = '100%';
|
|
const env0_13 = Reflect.apply(createStyles, createStylesModule, [{title: {marginBottom: 8}, container: {'flex': 1,
|
|
'alignItems': 'center'}, header: object, body: {'flex': 1, 'width': '100%'}}]);
|
|
value = value.memo(_fun117921);
|
|
(require(2) /* metro dependency 2 */).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
|
|
var object2;
|
|
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 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).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} = (importDefault(15419) /* metro dependency 15419: useSoundGrid */)(channel,
|
|
{filterOutEmptyCurrentGuild: true});
|
|
const value8 = useExpressionPickerStore(function(a0) {
|
|
return a0.searchQuery;
|
|
});
|
|
useState = binding.useState;
|
|
const searchSoundsModule = require(6948) /* metro dependency 6948: searchSounds */;
|
|
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 = (require(15419) /* metro dependency 15419: useSoundGrid */).useSearchCategories(categories,
|
|
property3, value8);
|
|
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({isKeyboardAwareOnAndroid: false}).insets;
|
|
const defaultImport3 = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
|
|
const SOUNDBOARD_ACTION_SHEET = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).SOUNDBOARD_ACTION_SHEET;
|
|
const analyticsLocations = defaultImport3(SOUNDBOARD_ACTION_SHEET).analyticsLocations;
|
|
const value11 = binding.useCallback(_fun117925, [channel, currentUser, availableSounds]);
|
|
const defaultImport4 = importDefault(8742) /* metro dependency 8742: useTrackImpression */;
|
|
object2 = {};
|
|
const ImpressionTypes = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionTypes;
|
|
const HALFSHEET = ImpressionTypes.HALFSHEET;
|
|
object2.type = HALFSHEET;
|
|
const ImpressionNames = (require(480) /* metro dependency 480: AnalyticsUtils */).ImpressionNames;
|
|
const SOUNDBOARD_POPOUT = ImpressionNames.SOUNDBOARD_POPOUT;
|
|
object2.name = SOUNDBOARD_POPOUT;
|
|
object2.properties = {source: analyticsSource, guild_id: channel.guild_id, media_session_id: mediaSessionId};
|
|
defaultImport4(object2);
|
|
const value12 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
|
|
const value13 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
|
|
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).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 = (require(6275) /* metro dependency 6275: BottomSheetNative */).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 = (require(4573) /* metro dependency 4573: Text */).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 = (require(6984) /* metro dependency 6984: SearchFieldNative */).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 = (require(15422) /* metro dependency 15422: SoundboardSoundPickerList */).SoundboardSoundPickerList;
|
|
const value17 = EXPRESSION_FOOTER_HEIGHT + insets.bottom;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: 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} />)(importDefault(15431) /* metro dependency 15431: 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));
|
|
}
|
|
|